@akanjs/devkit 3.0.0-alpha.21 → 3.0.0-alpha.23
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/executors.test.ts +0 -13
- package/executors.ts +0 -32
- package/integration/devStabilityHarness.ts +1 -5
- package/package.json +2 -2
package/executors.test.ts
CHANGED
|
@@ -879,16 +879,3 @@ describe("scan info construction", () => {
|
|
|
879
879
|
expect(info.file.document.scalars.has("money")).toBe(true);
|
|
880
880
|
});
|
|
881
881
|
});
|
|
882
|
-
|
|
883
|
-
describe("AppExecutor.shouldRelaunchForAppEnv", () => {
|
|
884
|
-
test("relaunches when the process was born without the app name, or with another app's", () => {
|
|
885
|
-
expect(AppExecutor.shouldRelaunchForAppEnv("sceny", undefined, undefined)).toBe(true);
|
|
886
|
-
expect(AppExecutor.shouldRelaunchForAppEnv("sceny", "other", undefined)).toBe(true);
|
|
887
|
-
});
|
|
888
|
-
|
|
889
|
-
test("runs in place when the name was present at birth, and never relaunches twice", () => {
|
|
890
|
-
expect(AppExecutor.shouldRelaunchForAppEnv("sceny", "sceny", undefined)).toBe(false);
|
|
891
|
-
expect(AppExecutor.shouldRelaunchForAppEnv("sceny", undefined, "1")).toBe(false);
|
|
892
|
-
expect(AppExecutor.shouldRelaunchForAppEnv("sceny", "other", "1")).toBe(false);
|
|
893
|
-
});
|
|
894
|
-
});
|
package/executors.ts
CHANGED
|
@@ -1284,10 +1284,6 @@ interface AppExecutorOptions {
|
|
|
1284
1284
|
workspace?: WorkspaceExecutor;
|
|
1285
1285
|
name: string;
|
|
1286
1286
|
}
|
|
1287
|
-
// Captured at module load, before the command dispatcher patches the resolved app name into `process.env` —
|
|
1288
|
-
// the relaunch guard below must judge what bundler macros will see, which is the env this process was born with.
|
|
1289
|
-
const bootAppName = process.env.AKAN_PUBLIC_APP_NAME;
|
|
1290
|
-
|
|
1291
1287
|
export class AppExecutor extends SysExecutor {
|
|
1292
1288
|
// `typescript` costs ~65MB resident, so keep it out of the module graph of every process that only
|
|
1293
1289
|
// ever imports an executor. Route validation is the sole consumer here and is already async.
|
|
@@ -1346,34 +1342,6 @@ export class AppExecutor extends SysExecutor {
|
|
|
1346
1342
|
...env,
|
|
1347
1343
|
};
|
|
1348
1344
|
}
|
|
1349
|
-
/**
|
|
1350
|
-
* Bun macros snapshot `process.env` at process start, so the env `prepareCommand` publishes later is invisible
|
|
1351
|
-
* to them — and any hand-written `@libs/<lib>/server` import puts that lib's env files (module-scope `getEnv()`)
|
|
1352
|
-
* into the `getSerializedSignal` macro graph. `AKAN_PUBLIC_APP_NAME` is the one required key no workspace root
|
|
1353
|
-
* `.env` can carry, so the build relaunches itself once with it in place; the child sees it from birth.
|
|
1354
|
-
*
|
|
1355
|
-
* The decision compares the boot snapshot, never the live `process.env`: the command dispatcher writes the
|
|
1356
|
-
* resolved app into `process.env.AKAN_PUBLIC_APP_NAME` before any command method runs, which satisfies runtime
|
|
1357
|
-
* readers but not macros — trusting it is how this relaunch shipped once without ever firing.
|
|
1358
|
-
*/
|
|
1359
|
-
static shouldRelaunchForAppEnv(
|
|
1360
|
-
appName: string,
|
|
1361
|
-
bootName: string | undefined = bootAppName,
|
|
1362
|
-
marker: string | undefined = process.env.AKAN_BUILD_RELAUNCHED,
|
|
1363
|
-
) {
|
|
1364
|
-
if (marker === "1") return false;
|
|
1365
|
-
return bootName !== appName;
|
|
1366
|
-
}
|
|
1367
|
-
async relaunchWithAppEnv(): Promise<number | null> {
|
|
1368
|
-
if (!AppExecutor.shouldRelaunchForAppEnv(this.name)) return null;
|
|
1369
|
-
const child = Bun.spawn([process.execPath, ...process.argv.slice(1)], {
|
|
1370
|
-
env: { ...this.getCommandEnv(), AKAN_PUBLIC_APP_NAME: this.name, AKAN_BUILD_RELAUNCHED: "1" },
|
|
1371
|
-
stdin: "inherit",
|
|
1372
|
-
stdout: "inherit",
|
|
1373
|
-
stderr: "inherit",
|
|
1374
|
-
});
|
|
1375
|
-
return await child.exited;
|
|
1376
|
-
}
|
|
1377
1345
|
async prepareCommand(type: "build" | "start") {
|
|
1378
1346
|
const akanConfig = await this.getConfig();
|
|
1379
1347
|
const databaseMode = process.env.AKAN_DATABASE_MODE ?? akanConfig.defaultDatabaseMode ?? "single";
|
|
@@ -127,11 +127,7 @@ export const env = {
|
|
|
127
127
|
),
|
|
128
128
|
this.writeFile(
|
|
129
129
|
"env/env.server.ts",
|
|
130
|
-
`
|
|
131
|
-
|
|
132
|
-
export const env = {
|
|
133
|
-
...getEnv(),
|
|
134
|
-
} as const;
|
|
130
|
+
`export const env = {} as const;
|
|
135
131
|
`,
|
|
136
132
|
),
|
|
137
133
|
this.writeFile(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/devkit",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.23",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@langchain/openai": "^1.4.6",
|
|
46
46
|
"@tailwindcss/node": "^4.3.0",
|
|
47
47
|
"@trapezedev/project": "^7.1.4",
|
|
48
|
-
"akanjs": "3.0.0-alpha.
|
|
48
|
+
"akanjs": "3.0.0-alpha.23",
|
|
49
49
|
"chalk": "^5.6.2",
|
|
50
50
|
"commander": "^14.0.3",
|
|
51
51
|
"dayjs": "^1.11.20",
|