@pplethai/cli 0.17.0 → 0.18.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pplethai/cli",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,4 +1,6 @@
1
- // The deployed Worker is dist/pple_app/index.js. Vite inlines
1
+ // The deployed Worker is dist/<worker name>/index.js (the name in
2
+ // wrangler.jsonc, which `pple init` sets to the app's slug), found the way the
3
+ // deploy workflow finds it. Vite inlines
2
4
  // `import.meta.env.DEV` to false and drops the Persona bypass and the
3
5
  // offline registry wrapper (ADR-0011). Strings that exist only in those
4
6
  // modules must not survive. The client bundle is a different compile.
@@ -7,13 +9,14 @@ import fs from "node:fs";
7
9
  import path from "node:path";
8
10
  import { fileURLToPath } from "node:url";
9
11
 
10
- const bundle = path.resolve(
11
- path.dirname(fileURLToPath(import.meta.url)),
12
- "../dist/pple_app/index.js",
13
- );
12
+ const dist = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../dist");
13
+ const bundle = (fs.existsSync(dist) ? fs.readdirSync(dist) : [])
14
+ .filter((dir) => dir !== "client")
15
+ .map((dir) => path.join(dist, dir, "index.js"))
16
+ .find((file) => fs.existsSync(file));
14
17
 
15
- if (!fs.existsSync(bundle)) {
16
- console.error(`production Worker bundle not found at ${bundle}`);
18
+ if (!bundle) {
19
+ console.error(`production Worker bundle not found at ${dist}/*/index.js`);
17
20
  process.exit(1);
18
21
  }
19
22