mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-21 07:32:54 +00:00
docs(plugins): fix example CLI commands
This commit is contained in:
1 parent
0a7bd1a45e
commit
6da543aaec
2 files changed
+22
-3
No files matched your search
@@ -34,6 +34,7 @@ import { assertSafePackagePath, PackagePathRegistry } from "./packagePath.ts";
|
||||
|
||||
const execFileAsync = promisify(execFile);
|
||||
const cliPath = fileURLToPath(new URL("./cli.ts", import.meta.url));
|
||||
const repositoryRoot = fileURLToPath(new URL("../../../", import.meta.url));
|
||||
|
||||
function crc32(contents: Buffer): number {
|
||||
let crc = 0xffffffff;
|
||||
@@ -388,6 +389,24 @@ test("compatibility CLI checks a validated plugin target", async (context) => {
|
||||
);
|
||||
});
|
||||
|
||||
test("example README commands use repository-root CLI paths", async () => {
|
||||
const readme = await readFile(
|
||||
path.join(repositoryRoot, "examples/plugins/hello-netcatty/README.md"),
|
||||
"utf8",
|
||||
);
|
||||
|
||||
assert.match(readme, /npm run build:plugin-packages/);
|
||||
assert.match(
|
||||
readme,
|
||||
/npm exec -- netcatty-plugin validate examples\/plugins\/hello-netcatty/,
|
||||
);
|
||||
assert.match(
|
||||
readme,
|
||||
/npm exec -- netcatty-plugin compatibility examples\/plugins\/hello-netcatty --netcatty 0\.0\.0/,
|
||||
);
|
||||
assert.doesNotMatch(readme, /npm exec --workspace @netcatty\/plugin-cli/);
|
||||
});
|
||||
|
||||
test("init creates a valid TypeScript plugin skeleton", async (context) => {
|
||||
const root = await mkdtemp(path.join(tmpdir(), "netcatty-plugin-init-"));
|
||||
context.after(() => rm(root, { recursive: true, force: true }));
|
||||
|
||||
Reference in new issue
Block a user