Skip to content

Commit fc06c7e

Browse files
authored
Split components out into libraries for reuse with slang-vscode-extension (#157)
* Fully working library split * formatting * Fix compiler wasm types * Ensure dependencies are built first * Fix smoke test path * Reduce size of build files * Add versions to package.json to fix issue when using libraries externally * Add missing version * Improve engine dependency management * Fix uniform panel text colors * Update README build instructions * Regenerate broken lock file * delete engine package.json
1 parent 9154a2d commit fc06c7e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+5606
-2355
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ jobs:
1818
with:
1919
build-artifacts-dir: ./src
2020

21+
- name: Copy types to compilation engine
22+
run: |
23+
cp ./src/slang-wasm.d.ts ./engine/slang-compilation-engine/media/slang-wasm.d.ts
24+
cp ./src/spirv-tools.d.ts ./engine/slang-compilation-engine/media/spirv-tools.d.ts
25+
2126
- name: Build
2227
run: |
2328
npm install
@@ -41,4 +46,4 @@ jobs:
4146
gzip -d src/slang-wasm.wasm.gz
4247
cp src/slang-wasm.wasm ./
4348
cp slang-repo/tests/wasm/smoke/smoke-test.js slang-repo/
44-
node slang-repo/smoke-test.js src/slang/rand_float.slang computeMain
49+
node slang-repo/smoke-test.js engine/slang-compilation-engine/src/slang/rand_float.slang computeMain

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Move them into the `src` directory of the slang-playground.
3333

3434
Run `npm install` to install dependencies.
3535

36+
Run `npm run build-engine` to build library files. You will need to do this any time they are updated.
37+
3638
Run `npm run dev` to start the development server. The command will show you the URL where you can access the playground.
3739

3840
Run `npm run build` to build the project. It will create a `dist` directory with the build artifacts. The website should be hostable on any static file server from this directory.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "playground-render-canvas",
3+
"version": "0.0.1",
4+
"description": "Extension for the Slang Shading Language",
5+
"main": "dist/index.umd.js",
6+
"module": "dist/index.es.js",
7+
"types": "dist/index.d.ts",
8+
"exports": {
9+
".": {
10+
"types": "./dist/index.d.ts",
11+
"style": "./dist/playground-render-canvas.css",
12+
"import": "./dist/index.es.js",
13+
"require": "./dist/index.umd.js"
14+
},
15+
"./dist/playground-render-canvas.css": {
16+
"default": "./dist/playground-render-canvas.css"
17+
}
18+
},
19+
"scripts": {
20+
"build": "vite build",
21+
"type-check": "vue-tsc --build"
22+
},
23+
"dependencies": {
24+
"slang-playground-shared": "0.0.1"
25+
},
26+
"peerDependencies": {
27+
"vue": "^3.5.17"
28+
},
29+
"devDependencies": {
30+
"@types/node": "^24.0.14",
31+
"@types/vscode": "^1.85.0",
32+
"@vitejs/plugin-vue": "^5.0.4",
33+
"@vscode/test-web": "^0.0.51",
34+
"vite-plugin-dts": "^4.5.4",
35+
"@webgpu/types": "^0.1.51",
36+
"vue": "^3.5.17",
37+
"vue-tsc": "^3.0.1"
38+
},
39+
"type": "module"
40+
}

0 commit comments

Comments
 (0)