@vsceasy/cli 0.1.4 → 0.1.5

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.
@@ -4,16 +4,18 @@
4
4
  */
5
5
  export declare function findProjectRoot(start?: string): string;
6
6
  /**
7
- * Resolves the bundled templates/ directory. Works whether the CLI runs from
8
- * the source tree (src/) or the compiled dist/.
9
- */
10
- /**
11
- * Resolves the bundled templates/ directory by walking up from `fromFile`
12
- * until a directory containing `templates/` is found.
7
+ * Resolves the bundled templates/ directory.
8
+ *
9
+ * In the source tree / npm-style installs an on-disk `templates/` exists next
10
+ * to the code, so we return that directly (fast, no extraction). When that is
11
+ * absent notably a globally installed binary whose bin is a symlink, where
12
+ * walking the filesystem can never reach the package — we materialize the
13
+ * templates embedded in the binary (see scripts/embedTemplates.ts) into a
14
+ * stable temp dir and return that. Either way callers get a real directory,
15
+ * so every fs.readFileSync/readdirSync consumer keeps working unchanged.
13
16
  *
14
- * Callers must pass a runtime-real path (e.g. `process.argv[1]`, the CLI entry
15
- * node actually executes). Do NOT pass `__dirname`: the bundler inlines it as
16
- * the absolute build-machine path (e.g. /home/runner/work/.../src/commands/x),
17
- * which does not exist on a user's machine.
17
+ * Callers may pass a runtime-real path (e.g. `process.argv[1]`) to seed the
18
+ * disk walk. Do NOT pass `__dirname`: the bundler inlines it as the
19
+ * build-machine path, which does not exist on a user's machine.
18
20
  */
19
21
  export declare function findTemplatesRoot(fromFile?: string): string;
@@ -0,0 +1,2 @@
1
+ export declare const TEMPLATES_VERSION = "0.1.5";
2
+ export declare const TEMPLATE_FILES: Record<string, string>;
package/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "@vsceasy/cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Build VS Code extensions fast — React UI + typed RPC bridge between extension and webview + file-based routing for panels, commands, menus, tree views, and subpanels.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
+ "pretest": "bun run embed:templates",
7
8
  "test": "bun test ./src/tests",
8
9
  "gen:types": "bun scripts/genCodiconTypes.ts",
9
10
  "sync:runtime": "bun scripts/syncRuntime.ts",
11
+ "embed:templates": "bun scripts/embedTemplates.ts",
10
12
  "build:runtime": "cd packages/vsceasy-runtime && bun install && bunx tsc",
11
- "build": "bun run gen:types && bun run sync:runtime && bun run build:runtime && tsc --emitDeclarationOnly && bun build ./src/index.ts ./src/bin/cli.ts --target=node --outdir ./dist --format cjs",
13
+ "build": "bun run gen:types && bun run sync:runtime && bun run embed:templates && bun run build:runtime && tsc --emitDeclarationOnly && bun build ./src/index.ts ./src/bin/cli.ts --target=node --outdir ./dist --format cjs",
12
14
  "build:test": "bun build ./src/tests/*.ts --target=node --outdir dist/tests --format cjs",
13
15
  "prepublishOnly": "bun run build",
14
16
  "start": "bun run src/cli.ts",