skills-manifest 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import * as citty6 from "citty";
1
+ import * as citty0 from "citty";
2
2
 
3
3
  //#region src/cli/add.d.ts
4
- declare const add: citty6.CommandDef<{
4
+ declare const add: citty0.CommandDef<{
5
5
  readonly repo: {
6
6
  readonly type: "positional";
7
7
  readonly description: "Repository (e.g. owner/repo or full URL)";
@@ -6,7 +6,7 @@ import { t as sync } from "../sync-1OE33hei.mjs";
6
6
  import { defineCommand, runMain } from "citty";
7
7
 
8
8
  //#region package.json
9
- var version = "0.3.1";
9
+ var version = "0.3.2";
10
10
 
11
11
  //#endregion
12
12
  //#region src/cli/index.ts
@@ -1,6 +1,6 @@
1
- import * as citty1 from "citty";
1
+ import * as citty2 from "citty";
2
2
 
3
3
  //#region src/cli/init.d.ts
4
- declare const init: citty1.CommandDef<citty1.ArgsDef>;
4
+ declare const init: citty2.CommandDef<citty2.ArgsDef>;
5
5
  //#endregion
6
6
  export { init };
@@ -1,6 +1,6 @@
1
- import * as citty0 from "citty";
1
+ import * as citty5 from "citty";
2
2
 
3
3
  //#region src/cli/install.d.ts
4
- declare const install: citty0.CommandDef<citty0.ArgsDef>;
4
+ declare const install: citty5.CommandDef<citty5.ArgsDef>;
5
5
  //#endregion
6
6
  export { install };
@@ -1,7 +1,7 @@
1
- import * as citty3 from "citty";
1
+ import * as citty4 from "citty";
2
2
 
3
3
  //#region src/cli/remove.d.ts
4
- declare const remove: citty3.CommandDef<{
4
+ declare const remove: citty4.CommandDef<{
5
5
  readonly repo: {
6
6
  readonly type: "positional";
7
7
  readonly description: "Repository (e.g. owner/repo or full URL)";
@@ -1,6 +1,6 @@
1
- import * as citty4 from "citty";
1
+ import * as citty0 from "citty";
2
2
 
3
3
  //#region src/cli/sync.d.ts
4
- declare const sync: citty4.CommandDef<citty4.ArgsDef>;
4
+ declare const sync: citty0.CommandDef<citty0.ArgsDef>;
5
5
  //#endregion
6
6
  export { sync };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "skills-manifest",
3
3
  "type": "module",
4
- "version": "0.3.1",
4
+ "version": "0.3.2",
5
5
  "description": "A lightweight manifest manager for skills, enabling project-level skill synchronization and collaborative configuration.",
6
6
  "author": "Hairyf <wwu710632@gmail.com>",
7
7
  "license": "MIT",
@@ -58,7 +58,7 @@
58
58
  "vitest": "^4.0.15",
59
59
  "vitest-package-exports": "^0.1.1",
60
60
  "yaml": "^2.8.2",
61
- "skills-manifest": "0.3.1"
61
+ "skills-manifest": "0.3.2"
62
62
  },
63
63
  "simple-git-hooks": {
64
64
  "pre-commit": "pnpm i --frozen-lockfile --ignore-scripts --offline && npx lint-staged"
@@ -1,27 +1,22 @@
1
1
  #!/usr/bin/env node
2
+ import { enableCompileCache } from 'node:module';
2
3
  import { spawnSync } from 'node:child_process';
3
4
  import { createRequire } from 'node:module';
4
- import { fileURLToPath } from 'node:url';
5
5
  import { join, dirname } from 'node:path';
6
6
 
7
- const require = createRequire(import.meta.url);
8
- const __dirname = dirname(fileURLToPath(import.meta.url));
7
+ if (enableCompileCache)
8
+ try { enableCompileCache(); } catch {}
9
9
 
10
10
  const argv = process.argv.slice(2);
11
11
  const skipManifest = argv.includes('--skip-manifest');
12
12
  const forwardArgs = argv.filter(arg => arg !== '--skip-manifest');
13
13
  const [cmd] = forwardArgs;
14
14
 
15
- // 1. 执行主 CLI 程序
16
- const mainResult = spawnSync(process.execPath, [join(__dirname, '../dist/cli.mjs'), ...forwardArgs], { stdio: 'inherit' });
17
-
18
- if (mainResult.status === 0 && !skipManifest && ['add', 'remove'].includes(cmd)) {
19
- try {
20
- const binPath = require.resolve('skills-manifest/bin/skills-manifest', { paths: [process.cwd()] });
21
- spawnSync(process.execPath, [binPath, 'sync', ...forwardArgs], { stdio: 'inherit' });
22
- } catch {
23
- console.warn('skills-manifest: failed to sync from skills. Sync add/remove with manifest will not run.')
24
- }
15
+ if (!skipManifest && ['add', 'remove'].includes(cmd)) {
16
+ const require = createRequire(import.meta.url);
17
+ const manifestPkg = require.resolve('skills-manifest/package.json', { paths: [process.cwd()] });
18
+ const binPath = join(dirname(manifestPkg), 'bin/index.mjs');
19
+ spawnSync(process.execPath, [binPath, 'sync', ...forwardArgs], { stdio: 'inherit' });
25
20
  }
26
21
 
27
- process.exit(mainResult.status ?? 1);
22
+ await import('../dist/cli.mjs');