@skathi-native/cli 0.1.0-beta.4 → 0.3.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/aot/host-globals.json +1 -1
- package/aot/pin.ts +1 -1
- package/aot/toolchain.lock.json +5 -5
- package/aot/transform.ts +9 -1
- package/aot-inputs.ts +21 -2
- package/build.ts +284 -64
- package/check/builtins.json +11 -11
- package/check/bundle.ts +265 -0
- package/check/codes.ts +46 -0
- package/check/css-catalog.json +451 -0
- package/check/css.ts +512 -0
- package/check/finding.ts +63 -1
- package/check/graph.ts +14 -1
- package/check/index.ts +30 -49
- package/check/program.ts +26 -6
- package/cli/aot-build.ts +2 -6
- package/cli/build-app.ts +19 -0
- package/cli/create.ts +70 -12
- package/cli/dev.ts +11 -6
- package/cli/effects.ts +39 -18
- package/cli/gallery.ts +106 -0
- package/cli/sk.ts +5 -2
- package/devtools/commands.ts +26 -1
- package/devtools/ctl.ts +4 -3
- package/effects/compile.ts +160 -31
- package/effects/sk.slang +359 -30
- package/gallery.json +1 -0
- package/package.json +9 -5
- package/prod.ts +78 -10
- package/svelte.ts +76 -0
- package/templates/icon.png +0 -0
- package/templates/showcase/assets/textures/golden.png +0 -0
- package/templates/showcase/assets/textures/hammered.png +0 -0
- package/templates/showcase/assets/textures/noir.png +0 -0
- package/templates/showcase/assets/textures/reeded.png +0 -0
- package/templates/showcase/assets/textures/teal-orange.png +0 -0
- package/templates/showcase/shaders/dissolve.slang +40 -0
- package/templates/showcase/shaders/fireflies.slang +58 -0
- package/templates/showcase/shaders/glass.slang +31 -0
- package/templates/showcase/shaders/grade.slang +34 -0
- package/templates/showcase/shaders/halftone.slang +42 -0
- package/templates/showcase/shaders/lens.slang +51 -0
- package/templates/showcase/shaders/nebula.slang +57 -0
- package/templates/showcase/shaders/orbit.slang +52 -0
- package/templates/showcase/shaders/pond.slang +76 -0
- package/templates/showcase/shaders/ripples.slang +71 -0
- package/templates/showcase/shaders/shatter.slang +116 -0
- package/templates/showcase/shaders/snow.slang +57 -0
- package/templates/showcase/shaders/spotlight.slang +52 -0
- package/templates/showcase/src/App.vue +11 -16
- package/templates/showcase/src/components/FullWindow.vue +77 -0
- package/templates/showcase/src/components/Page.vue +2 -0
- package/templates/showcase/src/fullwindow.ts +36 -0
- package/templates/showcase/src/icons.ts +2 -0
- package/templates/showcase/src/pages/GraphicsPage.vue +122 -0
- package/templates/showcase/src/pages/MotionPage.vue +71 -1
- package/templates/showcase/src/pages/ShadersPage.vue +443 -0
- package/templates/showcase/src/router.ts +32 -1
- package/templates/svelte/.vscode/settings.json +3 -0
- package/templates/svelte/assets/hello.txt +1 -0
- package/templates/svelte/src/App.svelte +142 -0
- package/templates/svelte/src/main.ts +4 -0
- package/vitecompat.ts +2 -0
package/aot/host-globals.json
CHANGED
package/aot/pin.ts
CHANGED
|
@@ -45,7 +45,7 @@ export function pinnedCompilerInfo(pin: ToolchainPin): CompilerInfo {
|
|
|
45
45
|
frontend: pin.frontend.revision,
|
|
46
46
|
engine: pin.engine.revision,
|
|
47
47
|
tableId: pin.table.id,
|
|
48
|
-
compileOptions: `x86_64;references=narrow;image=pic;threads=1;
|
|
48
|
+
compileOptions: `x86_64;references=narrow;image=pic;threads=1;default-options@${pin.engine.revision}`,
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
|
package/aot/toolchain.lock.json
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
"version": 1,
|
|
4
4
|
"target": "x86_64-windows",
|
|
5
5
|
"frontend": {
|
|
6
|
-
"revision": "
|
|
6
|
+
"revision": "237bba51e98a8b3d5b62d2d6c33853c2e83820a7",
|
|
7
7
|
"sourceRepository": "https://github.com/oven-sh/bun.git"
|
|
8
8
|
},
|
|
9
9
|
"engine": {
|
|
10
|
-
"revision": "
|
|
11
|
-
"archiveSha256": "
|
|
10
|
+
"revision": "3bc94211496460feda299ef85eef710eb67fafb3",
|
|
11
|
+
"archiveSha256": "837f06ecd569791d4497ea7e8703f636fac5a1869ca5ee7c5f49b4c4eaa40e3d"
|
|
12
12
|
},
|
|
13
13
|
"table": {
|
|
14
|
-
"id": "
|
|
15
|
-
"dumpSha256": "
|
|
14
|
+
"id": "a9db25bde548594d86b2439e8dfd11335a87004ee374a31e2d1a557c40543886",
|
|
15
|
+
"dumpSha256": "b379cd1e35c090880b6b4ae4fdbdab9b1566a06c829e3e9d6824ac7aaa11cdc7"
|
|
16
16
|
}
|
|
17
17
|
}
|
package/aot/transform.ts
CHANGED
|
@@ -64,6 +64,14 @@ export function opaqueGlobals(tableGlobals: readonly string[] = HOST_TABLE.names
|
|
|
64
64
|
return [...new Set([...tableGlobals, ...BROWSER_GLOBALS])].sort();
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/** A builtin global stays read-only unless the image spells out an assignment to it; writes through
|
|
68
|
+
* `__sk_host` (the runtime wraps setTimeout and WebSocket) are not spelled out, so this dead branch is. */
|
|
69
|
+
function openHostGlobals(names: readonly string[]): string {
|
|
70
|
+
const host = new Set(HOST_TABLE.names);
|
|
71
|
+
const opened = names.filter((name) => host.has(name));
|
|
72
|
+
return `if (__SK_AOT_HOST__ === undefined) {\n${opened.map((name) => `globalThis.${name} = undefined;`).join("\n")}\n}\n`;
|
|
73
|
+
}
|
|
74
|
+
|
|
67
75
|
export function opaqueHost(source: string, names: readonly string[] = opaqueGlobals()): string {
|
|
68
|
-
return `// ${TRANSFORM}: stable host API references are opaque inputs.\n(function(__sk_host) {\nconst globalThis = __sk_host;\nconst {${names.join(",")}} = __sk_host;\n${source}\n})(__SK_AOT_HOST__);\n`;
|
|
76
|
+
return `// ${TRANSFORM}: stable host API references are opaque inputs.\n${openHostGlobals(names)}(function(__sk_host) {\nconst globalThis = __sk_host;\nconst {${names.join(",")}} = __sk_host;\n${source}\n})(__SK_AOT_HOST__);\n`;
|
|
69
77
|
}
|
package/aot-inputs.ts
CHANGED
|
@@ -6,7 +6,8 @@ import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
|
6
6
|
import type ts from "typescript";
|
|
7
7
|
|
|
8
8
|
type TypeScript = typeof ts;
|
|
9
|
-
type InputKind =
|
|
9
|
+
type InputKind =
|
|
10
|
+
"source" | "vue" | "vue-module" | "vue-script" | "svelte" | "svelte-module" | "transformed-module" | "config";
|
|
10
11
|
interface Input {
|
|
11
12
|
path: string;
|
|
12
13
|
kind: InputKind;
|
|
@@ -116,6 +117,21 @@ export class AotInputs {
|
|
|
116
117
|
}
|
|
117
118
|
}
|
|
118
119
|
|
|
120
|
+
/**
|
|
121
|
+
* A Svelte component, or a `.svelte.ts`/`.svelte.js` rune module, and the JS the compiler made of it. The
|
|
122
|
+
* compiler keeps no types, so a rune module's typed source stays the program's view of it.
|
|
123
|
+
*/
|
|
124
|
+
svelte(path: string, original: string, compiled: string): void {
|
|
125
|
+
this.add(path, compiled, "svelte-module", "js");
|
|
126
|
+
if (/\.svelte$/i.test(path)) {
|
|
127
|
+
this.add(path, original, "svelte");
|
|
128
|
+
this.addVirtual(`${resolve(path)}.js`, compiled);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
this.add(path, original, "source");
|
|
132
|
+
this.modules.set(this.key(path), { path: resolve(path), text: original });
|
|
133
|
+
}
|
|
134
|
+
|
|
119
135
|
private collectTypes(): { version: string; config: string | null; diagnostics: { code: number; message: string }[] } {
|
|
120
136
|
const { typescript, appRoot, entry, aliases, declarations = [] } = this.options;
|
|
121
137
|
const read = (path: string): string | undefined => {
|
|
@@ -178,6 +194,9 @@ export class AotInputs {
|
|
|
178
194
|
(specifier.endsWith(".vue")
|
|
179
195
|
? typescript.resolveModuleName(`${specifier}.ts`, importer, options, host).resolvedModule
|
|
180
196
|
: undefined) ??
|
|
197
|
+
(specifier.endsWith(".svelte")
|
|
198
|
+
? typescript.resolveModuleName(`${specifier}.js`, importer, options, host).resolvedModule
|
|
199
|
+
: undefined) ??
|
|
181
200
|
(alias ? typescript.resolveModuleName(specifier, alias, options, host).resolvedModule : undefined) ??
|
|
182
201
|
(alias
|
|
183
202
|
? {
|
|
@@ -282,7 +301,7 @@ export class AotInputs {
|
|
|
282
301
|
limitations: [
|
|
283
302
|
"Source archive, not a native AOT image; no host ABI or builtin-effect descriptors are inferred from declarations.",
|
|
284
303
|
"Original paths are app-root-relative or use a named source-root anchor; blob names are content hashes. An AOT frontend needs a resolver that maps these paths to blobs.",
|
|
285
|
-
"Vue modules and TS/JS source rewrites are retained before Bun transpilation. Bun-generated asset/query/HTML modules, CSS installation and module linking still require a frontend adapter.",
|
|
304
|
+
"Vue and Svelte modules and TS/JS source rewrites are retained before Bun transpilation. Bun-generated asset/query/HTML modules, CSS installation and module linking still require a frontend adapter.",
|
|
286
305
|
"TypeScript file-module resolution is recorded in addition to Bun's runtime graph; unresolvedImports also includes ambient module names that have no file mapping. A frontend adapter must handle them. This archive does not assert type-checking or AOT compatibility.",
|
|
287
306
|
],
|
|
288
307
|
};
|