@construct-space/cli 1.0.7 → 1.1.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.
- package/dist/index.js +311 -324
- package/dist/templates/space/actions.ts.tmpl +18 -0
- package/dist/templates/space/entry.ts.tmpl +14 -0
- package/dist/templates/space/full/entry.ts.tmpl +16 -0
- package/dist/templates/space/full/settings.vue.tmpl +31 -0
- package/dist/templates/space/full/skill-data.md.tmpl +18 -0
- package/dist/templates/space/full/skill-ui.md.tmpl +18 -0
- package/dist/templates/space/full/space.manifest.json.tmpl +60 -0
- package/dist/templates/space/index.vue.tmpl +7 -1
- package/dist/templates/space/package.json.tmpl +11 -7
- package/dist/templates/space/space.manifest.json.tmpl +2 -1
- package/dist/templates/space/tsconfig.json.tmpl +4 -9
- package/dist/templates/space/vite.config.ts.tmpl +45 -7
- package/package.json +2 -1
- package/templates/space/actions.ts.tmpl +18 -0
- package/templates/space/entry.ts.tmpl +14 -0
- package/templates/space/full/entry.ts.tmpl +16 -0
- package/templates/space/full/settings.vue.tmpl +31 -0
- package/templates/space/full/skill-data.md.tmpl +18 -0
- package/templates/space/full/skill-ui.md.tmpl +18 -0
- package/templates/space/full/space.manifest.json.tmpl +60 -0
- package/templates/space/index.vue.tmpl +7 -1
- package/templates/space/package.json.tmpl +11 -7
- package/templates/space/space.manifest.json.tmpl +2 -1
- package/templates/space/tsconfig.json.tmpl +4 -9
- package/templates/space/vite.config.ts.tmpl +45 -7
|
@@ -2,6 +2,49 @@ import { defineConfig } from 'vite'
|
|
|
2
2
|
import vue from '@vitejs/plugin-vue'
|
|
3
3
|
import { resolve } from 'path'
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Host-provided externals — these are supplied by Construct at runtime
|
|
7
|
+
* via window.__CONSTRUCT__. Do NOT bundle them; they must stay external.
|
|
8
|
+
*
|
|
9
|
+
* Full list lives in: construct-app/frontend/lib/spaceHost.ts
|
|
10
|
+
*/
|
|
11
|
+
const hostExternals = [
|
|
12
|
+
'vue',
|
|
13
|
+
'vue-router',
|
|
14
|
+
'pinia',
|
|
15
|
+
'@vueuse/core',
|
|
16
|
+
'@vueuse/integrations',
|
|
17
|
+
'@tauri-apps/api',
|
|
18
|
+
'@tauri-apps/api/core',
|
|
19
|
+
'@tauri-apps/api/path',
|
|
20
|
+
'@tauri-apps/api/event',
|
|
21
|
+
'@tauri-apps/api/webview',
|
|
22
|
+
'@tauri-apps/plugin-fs',
|
|
23
|
+
'@tauri-apps/plugin-shell',
|
|
24
|
+
'@tauri-apps/plugin-dialog',
|
|
25
|
+
'@tauri-apps/plugin-process',
|
|
26
|
+
'lucide-vue-next',
|
|
27
|
+
'date-fns',
|
|
28
|
+
'dexie',
|
|
29
|
+
'zod',
|
|
30
|
+
'@construct-space/ui',
|
|
31
|
+
'@construct/sdk',
|
|
32
|
+
'@construct-space/sdk',
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
function makeGlobals(externals: string[]): Record<string, string> {
|
|
36
|
+
const globals: Record<string, string> = {}
|
|
37
|
+
for (const ext of externals) {
|
|
38
|
+
// Simple ids use dot access, scoped/slashed ids use bracket access
|
|
39
|
+
if (/^[a-z]+$/.test(ext)) {
|
|
40
|
+
globals[ext] = `window.__CONSTRUCT__.${ext}`
|
|
41
|
+
} else {
|
|
42
|
+
globals[ext] = `window.__CONSTRUCT__["${ext}"]`
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return globals
|
|
46
|
+
}
|
|
47
|
+
|
|
5
48
|
export default defineConfig({
|
|
6
49
|
plugins: [vue()],
|
|
7
50
|
build: {
|
|
@@ -12,14 +55,9 @@ export default defineConfig({
|
|
|
12
55
|
formats: ['iife'],
|
|
13
56
|
},
|
|
14
57
|
rollupOptions: {
|
|
15
|
-
external:
|
|
58
|
+
external: hostExternals,
|
|
16
59
|
output: {
|
|
17
|
-
globals:
|
|
18
|
-
vue: 'window.__CONSTRUCT__.vue',
|
|
19
|
-
'vue-router': 'window.__CONSTRUCT__["vue-router"]',
|
|
20
|
-
pinia: 'window.__CONSTRUCT__.pinia',
|
|
21
|
-
'@vueuse/core': 'window.__CONSTRUCT__["@vueuse/core"]',
|
|
22
|
-
},
|
|
60
|
+
globals: makeGlobals(hostExternals),
|
|
23
61
|
},
|
|
24
62
|
},
|
|
25
63
|
},
|