Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@typescript-eslint/parser": "^7.12.0",
"@vitejs/plugin-react-swc": "^3.7.0",
"storybook": "^8.1.6",
"typescript": "^5.4.5",
"typescript": "^5.5.4",
"vite": "^5.2.13"
}
}
1 change: 0 additions & 1 deletion apps/studio/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@

<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
15 changes: 9 additions & 6 deletions apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"scripts": {
"dev:app": "tauri dev",
"build:app": "tauri build",
"js:dev": "vite",
"js:build": "tsc && vite build",
"js:dev": "rsbuild dev",
"js:build": "tsc && rsbuild build",
"tauri": "tauri",
"types": "tsc -p ./tsconfig.json --noEmit",
"lint": "biome check ."
Expand All @@ -22,10 +22,10 @@
"@tanstack/react-query": "^5",
"@tanstack/react-query-devtools": "^5",
"@tauri-apps/api": ">=2.0.0-rc.0",
"@tauri-apps/plugin-shell": ">=2.0.0-rc.0",
"@tauri-apps/plugin-dialog": ">=2.0.0-rc.0",
"@tauri-apps/plugin-shell": ">=2.0.0-rc.0",
"@typescript/vfs": "^1.5.3",
"@valtown/codemirror-ts": "^2.1.1",
"@valtown/codemirror-ts": "^2.1.2",
"@villagekit/design": "workspace:*",
"@villagekit/math": "workspace:*",
"@villagekit/parameters": "workspace:*",
Expand All @@ -51,10 +51,13 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@rsbuild/core": "1.0.1-rc.2",
"@rsbuild/plugin-react": "1.0.1-rc.2",
"@rsbuild/plugin-source-build": "^1.0.1",
"@rspack/core": "^1.0.0",
"@tauri-apps/cli": ">=2.0.0-rc.0",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"typescript": "^5.2.2",
"vite": "^5.3.1"
"typescript": "^5.5.4"
}
}
62 changes: 62 additions & 0 deletions apps/studio/rsbuild.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { defineConfig } from '@rsbuild/core'
import { pluginReact } from '@rsbuild/plugin-react'
import { pluginSourceBuild } from '@rsbuild/plugin-source-build'

const host = process.env.TAURI_DEV_HOST

export default defineConfig({
plugins: [
pluginReact({
swcReactOptions: {
refresh: false,
},
reactRefreshOptions: {
exclude: /.*/,
},
}),
pluginSourceBuild(),
],
dev: {
hmr: true,
},
html: {
template: './index.html',
},
source: {
entry: {
index: './src/main.tsx',
},
},
server: {
// tauri expects a fixed port, fail if that port is not available
port: 1420,
strictPort: true,
host,
},
tools: {
rspack: {
module: {
rules: [
// support ?raw imports
{
resourceQuery: /raw/,
type: 'asset/source',
},
],
// typescript/lib/typescript: https://github.com/microsoft/TypeScript/issues/39436
// @typescript/vfs/dist/vfs.esm.js: https://github.com/microsoft/TypeScript-Website/pull/3022
parser: {
javascript: {
exprContextCritical: false,
wrappedContextCritical: false,
},
},
},
},
bundlerChain(chain, { CHAIN_ID }) {
// also necessary to support ?raw imports
// ref: https://github.com/web-infra-dev/rsbuild/issues/3070#issuecomment-2259846975
chain.module.rule(CHAIN_ID.RULE.JS).resourceQuery({ not: /raw/ })
},
},
})
13 changes: 3 additions & 10 deletions apps/studio/src/editor/workers/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,19 @@ Comlink.expose(
)
fsMap.set(
'/node_modules/@villagekit/design/kit.d.ts',
// @ts-ignore
(await import('@villagekit/design/type-bundles/kit.d.ts?raw')).default,
)
fsMap.set(
'/node_modules/@villagekit/part-gridbeam/creator.d.ts',
// @ts-ignore
// NOTE (mw): why?
(await import('../../../../../parts/gridbeam/dist-type-bundles/creator.d.ts?raw')).default,
(await import('@villagekit/part-gridbeam/type-bundles/creator.d.ts?raw')).default,
)
fsMap.set(
'/node_modules/@villagekit/part-gridpanel/creator.d.ts',
// @ts-ignore
// NOTE (mw): why?
(await import('../../../../../parts/gridpanel/dist-type-bundles/creator.d.ts?raw')).default,
(await import('@villagekit/part-gridpanel/type-bundles/creator.d.ts?raw')).default,
)
fsMap.set(
'/node_modules/@villagekit/part-fastener/creator.d.ts',
// @ts-ignore
// NOTE (mw): why?
(await import('../../../../../parts/fastener/dist-type-bundles/creator.d.ts?raw')).default,
(await import('@villagekit/part-fastener/type-bundles/creator.d.ts?raw')).default,
)
const system = createSystem(fsMap)
const compilerOpts = {}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"@types/three": "^0.165.0",
"@villagekit/tsconfig": "workspace:*",
"depcheck": "^1.4.7",
"dts-bundle-generator": "^9.5.1",
"esbuild-plugin-file-path-extensions": "^2.1.2",
"esbuild-plugin-raw": "^0.1.8",
"dts-bundle-generator": "^9.5.1",
"glob": "^10.4.1",
"publint": "^0.2.8",
"rollup": "^4.21.2",
Expand Down
Loading