build internal rust lib

This commit is contained in:
Brandon Thomas committed 2025-11-20 15:29:32 -05:00
1 parent 840e918890
commit d838f3e166
6 files changed
+1145 -147

No files matched your search

+7 -11
View File
@@ -22,19 +22,15 @@ export default defineConfig({
],
server: {
proxy: {
// Example: rewrite /@fs/path/to/wasm/* -> /wasm/*
//'^/@fs/.vite/deps/spark_internal_rs_bg.wasm': {
'^/@fs/.*vite/deps/.*.wasm$': {
target: 'http://localhost:5173', // or another backend
//rewrite: (path) =>
// path.replace(/^\/@fs\/path\/to\/wasm\//, '/Users/bt/dev/storyteller/storyteller-rust/frontend/vendor/spark/rust/spark-internal-rs/pkg/spark_internal_rs_bg.wasm'),
target: 'http://localhost:5173',
rewrite: (path) => {
const p = '/@fs/Users/bt/dev/storyteller/storyteller-rust/frontend/vendor/spark/rust/spark-internal-rs/pkg/spark_internal_rs_bg.wasm';
console.log('path', p);
// http://localhost:5173/@fs/Users/bt/dev/storyteller/storyteller-rust/frontend/apps/editor3d/node_modules/.vite/deps/spark_internal_rs_bg.wasm
const replaced = path.replace('storyteller-rust/frontend/apps/editor3d/node_modules/.vite/deps/', 'storyteller-rust/frontend/vendor/spark/rust/spark-internal-rs/pkg/');
console.log('replaced', replaced);
const replaced = path.replace(
'storyteller-rust/frontend/apps/editor3d/node_modules/.vite/deps/',
'storyteller-rust/frontend/vendor/spark/rust/spark-internal-rs/pkg/'
);
console.log('original path', path);
console.log('rewritten path', replaced);
return replaced;
},
changeOrigin: true,
+1122 -132
View File
File diff suppressed because it is too large. Load diff
+2
View File
@@ -24,6 +24,7 @@
"konva": "^9.3.20",
"lodash": "^4.17.21",
"lucide-react": "^0.512.0",
"node": "^25.2.1",
"pnpm": "^10.8.1",
"posthog-js": "^1.141.0",
"react": "18.3.1",
@@ -92,6 +93,7 @@
"vite": "^6.0.0",
"vite-plugin-banner": "^0.8.0",
"vite-plugin-dts": "~4.5.0",
"vite-plugin-glsl": "^1.5.4",
"vite-plugin-static-copy": "^2.3.1",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.0.0"
+3 -3
View File
@@ -29,9 +29,9 @@
// "apps/editor2d/app/src/*",
"apps/editor3d/app/src/*"
],
"@sparkjsdev/spark": [
"vendor/spark/src/index.ts"
]
//"@sparkjsdev/spark": [
// "vendor/spark/src/index.ts"
//]
}
}
}
+1 -1
View File
@@ -34,7 +34,7 @@
"lint": "biome check .",
"lint:fix": "biome check . --fix",
"lint:summary": "biome check --reporter=summary",
"prepare": "",
"prepare": "npm run build:wasm",
"site:build": "npm run build && npm run site:clean && node scripts/copy-site-files.js && mkdocs build && node scripts/rename-assets-to-static.js",
"site:clean": "node scripts/clean-site-files.js && node scripts/clean-site.js",
"site:deploy": "npm run site:build && node scripts/deploy-site.js",
+10
View File
@@ -28,6 +28,15 @@ export default defineConfig(({ mode }) => {
cacheDir: '../../node_modules/.vite/vendor/spark',
appType: "mpa",
resolve: {
alias: {
'spark-internal-rs': path.resolve(
__dirname,
'rust/spark-internal-rs/pkg' // <-- or whatever actual path
),
},
},
plugins: [
glsl({
include: ["**/*.glsl"],
@@ -90,6 +99,7 @@ export default defineConfig(({ mode }) => {
},
emptyOutDir: isFirstPass,
},
worker: {
rollupOptions: {