@amodalai/amodal 0.1.12 → 0.1.13
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": "@amodalai/amodal",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Amodal CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -30,16 +30,9 @@
|
|
|
30
30
|
"semver": "^7.6.0",
|
|
31
31
|
"yargs": "^17.7.2",
|
|
32
32
|
"zod": "^4.3.6",
|
|
33
|
-
"@amodalai/core": "0.1.
|
|
34
|
-
"@amodalai/runtime": "0.1.
|
|
35
|
-
|
|
36
|
-
"peerDependencies": {
|
|
37
|
-
"@amodalai/runtime-app": "0.1.12"
|
|
38
|
-
},
|
|
39
|
-
"peerDependenciesMeta": {
|
|
40
|
-
"@amodalai/runtime-app": {
|
|
41
|
-
"optional": true
|
|
42
|
-
}
|
|
33
|
+
"@amodalai/core": "0.1.13",
|
|
34
|
+
"@amodalai/runtime": "0.1.13",
|
|
35
|
+
"@amodalai/runtime-app": "0.1.13"
|
|
43
36
|
},
|
|
44
37
|
"devDependencies": {
|
|
45
38
|
"@types/node": "^20.11.24",
|
package/src/commands/dev.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import type {CommandModule} from 'yargs';
|
|
8
8
|
import {existsSync} from 'node:fs';
|
|
9
|
+
import {createRequire} from 'node:module';
|
|
9
10
|
import path from 'node:path';
|
|
10
11
|
import {fileURLToPath} from 'node:url';
|
|
11
12
|
import {createLocalServer} from '@amodalai/runtime';
|
|
@@ -42,15 +43,19 @@ export async function runDev(options: DevOptions = {}): Promise<void> {
|
|
|
42
43
|
try {
|
|
43
44
|
let staticAppDir: string | undefined;
|
|
44
45
|
|
|
45
|
-
// Use pre-built static assets for the SPA
|
|
46
|
+
// Use pre-built static assets for the SPA.
|
|
46
47
|
// Vite dev middleware is only used inside the monorepo with `pnpm dev`.
|
|
47
48
|
const scriptDir = path.dirname(fileURLToPath(import.meta.url));
|
|
48
49
|
const candidates = [
|
|
49
50
|
// esbuild bundle: bundle/app/
|
|
50
51
|
path.resolve(scriptDir, 'app'),
|
|
51
|
-
// global/local install: <pkg root>/node_modules/@amodalai/runtime-app/dist/
|
|
52
|
-
path.resolve(scriptDir, '..', '..', '..', 'node_modules', '@amodalai', 'runtime-app', 'dist'),
|
|
53
52
|
];
|
|
53
|
+
|
|
54
|
+
// Resolve @amodalai/runtime-app via Node module resolution (works regardless of install layout)
|
|
55
|
+
const require = createRequire(import.meta.url);
|
|
56
|
+
const runtimeAppPkg = require.resolve('@amodalai/runtime-app/package.json');
|
|
57
|
+
candidates.push(path.join(path.dirname(runtimeAppPkg), 'dist'));
|
|
58
|
+
|
|
54
59
|
for (const dir of candidates) {
|
|
55
60
|
if (existsSync(path.join(dir, 'index.html'))) {
|
|
56
61
|
process.stderr.write('[dev] Serving pre-built runtime app\n');
|