|
21 | 21 | "type": "module", |
22 | 22 | "main": "./dist/extension.js", |
23 | 23 | "scripts": { |
24 | | - "clean": "rimraf out dist types && rimraf --glob \"*.vsix\"", |
| 24 | + "clean": "rimraf out dist types coverage && rimraf --glob \"*.vsix\"", |
25 | 25 | "clean-wasm": "rimraf wit-bindgen-wasm/pkg wit-bindgen-wasm/target", |
26 | 26 | "clean-samples": "rimraf samples/target samples/tmp/*", |
27 | 27 | "clean-deps": "rimraf node_modules package-lock.json", |
|
39 | 39 | "test-navigator-polyfill": "vitest run tests/navigator-polyfill.test.ts", |
40 | 40 | "gen-types": "tsc --project tsconfig.json --emitDeclarationOnly", |
41 | 41 | "gen-watch": "npm run gen-types -- -w", |
42 | | - "build-wasm-prod": "cd wit-bindgen-wasm && wasm-pack build --target web --out-dir pkg --release", |
43 | | - "build-wasm": "cd wit-bindgen-wasm && wasm-pack build --target web --out-dir pkg", |
| 42 | + "build-wasm-prod": "./scripts/build-wasm.sh --release", |
| 43 | + "build-wasm": "./scripts/build-wasm.sh", |
44 | 44 | "build-extension-prod": "node esbuild.mts -- --production", |
45 | 45 | "build-extension": "node esbuild.mts", |
46 | 46 | "build-extension-watch": "node esbuild.mts --watch", |
|
56 | 56 | "test": "run-s lint fmt-check build package gen-types test-grammar test-unit", |
57 | 57 | "test-wasm": "cd wit-bindgen-wasm && cargo test", |
58 | 58 | "check-wasm": "cd wit-bindgen-wasm && cargo check", |
59 | | - "verify-wasm": "node -e \"console.log('Verifying WASM build...'); const fs = require('fs'); const path = 'wit-bindgen-wasm/pkg/wit_bindgen_wasm_bg.wasm'; if (fs.existsSync(path)) { console.log('✅ WASM file exists:', path); const size = Math.round(fs.statSync(path).size / 1024); console.log('📏 Size:', size, 'KB'); try { const fd = fs.openSync(path, 'r'); const header = Buffer.alloc(8); fs.readSync(fd, header, 0, 8, 0); fs.closeSync(fd); const magicOk = header[0] === 0x00 && header[1] === 0x61 && header[2] === 0x73 && header[3] === 0x6D; if (!magicOk) { console.warn('⚠️ Not a WebAssembly binary (bad magic).'); process.exit(1); } const version = header.readUInt32LE(4); if (version === 1) { console.log('🧩 Type: Core WebAssembly module (vanilla wasm)'); } else if (version === 0x0A) { console.log('🧩 Type: WebAssembly component'); } else { console.log('🧩 Type: Unknown/other (version ' + version + ')'); } } catch (e) { console.error('❌ Error reading header:', e.message); process.exit(1); } } else { console.error('❌ WASM file not found:', path); process.exit(1); }\"", |
| 59 | + "verify-wasm": "node -e \"console.log('Verifying WASM build...'); const fs = require('fs'); const path = 'wit-bindgen-wasm/pkg/wit_bindgen_wasm.core.wasm'; if (fs.existsSync(path)) { console.log('✅ WASM file exists:', path); const size = Math.round(fs.statSync(path).size / 1024); console.log('📏 Size:', size, 'KB'); try { const fd = fs.openSync(path, 'r'); const header = Buffer.alloc(8); fs.readSync(fd, header, 0, 8, 0); fs.closeSync(fd); const magicOk = header[0] === 0x00 && header[1] === 0x61 && header[2] === 0x73 && header[3] === 0x6D; if (!magicOk) { console.warn('⚠️ Not a WebAssembly binary (bad magic).'); process.exit(1); } const version = header.readUInt32LE(4); if (version === 1) { console.log('🧩 Type: Core WebAssembly module'); } else if (version === 0x0A) { console.log('🧩 Type: WebAssembly component'); } else { console.log('🧩 Type: Unknown/other (version ' + version + ')'); } console.log('✅ WASM verification passed'); } catch (e) { console.error('❌ Error reading header:', e.message); process.exit(1); } } else { console.error('❌ WASM file not found:', path); process.exit(1); }\"", |
60 | 60 | "dev": "run-p gen-watch build-extension-watch", |
61 | 61 | "publish": "npx -y @vscode/vsce publish", |
62 | 62 | "publish-ovsx": "ovsx publish", |
63 | 63 | "release": "npx release-please release-pr --repo-url bytecodealliance/vscode-wit --config-file .github/release-please-config.json --manifest-file .github/release-please-manifest.json --token", |
64 | 64 | "update-npm": "npx npm-check-updates -u -t minor", |
65 | 65 | "update-npm-major": "npx npm-check-updates -u", |
66 | | - "update-cargo": "cd wit-bindgen-wasm && cargo update && (command -v cargo-upgrade >/dev/null 2>&1 || cargo install cargo-edit) && cargo upgrade", |
67 | | - "update-cargo-major": "cd wit-bindgen-wasm && cargo update && (command -v cargo-upgrade >/dev/null 2>&1 || cargo install cargo-edit) && cargo upgrade --incompatible", |
| 66 | + "update-cargo": "cd wit-bindgen-wasm && cargo update && (command -v cargo-upgrade >/dev/null 2>&1 || cargo install cargo-edit) && cargo upgrade && npm run update-wasm-tools", |
| 67 | + "update-cargo-major": "cd wit-bindgen-wasm && cargo update && (command -v cargo-upgrade >/dev/null 2>&1 || cargo install cargo-edit) && cargo upgrade --incompatible && npm run update-wasm-tools", |
| 68 | + "update-wasm-tools": "./scripts/update-wasm-tools-version.sh", |
68 | 69 | "update": "run-s update-npm update-cargo", |
69 | 70 | "update-major": "run-s update-npm-major update-cargo-major" |
70 | 71 | }, |
71 | | - "dependencies": { |
72 | | - "@bytecodealliance/jco": "1.17.0", |
73 | | - "wit-bindgen-wasm": "file:wit-bindgen-wasm/pkg" |
74 | | - }, |
| 72 | + "dependencies": {}, |
75 | 73 | "devDependencies": { |
| 74 | + "@bytecodealliance/jco": "1.17.0", |
76 | 75 | "@eslint/css": "1.0.0", |
77 | 76 | "@eslint/js": "10.0.1", |
78 | 77 | "@types/node": "25.5.0", |
|
94 | 93 | "typescript-eslint": "8.57.1", |
95 | 94 | "vitest": "4.1.0", |
96 | 95 | "vscode-tmgrammar-test": "0.1.3", |
97 | | - "wasm-pack": "0.14.0" |
| 96 | + "wit-bindgen-wasm": "file:wit-bindgen-wasm/pkg" |
98 | 97 | }, |
99 | 98 | "contributes": { |
100 | 99 | "colors": [ |
|
0 commit comments