Skip to content

Commit a6806dc

Browse files
kamiazyaclaude
andauthored
fix: resolve Deno examples CI failure after version bump (#610)
When Version Packages PR was merged, Deno examples failed because they used `npm:web-csv-toolbox` specifier which queries npm registry for the latest version. Since the new version wasn't published yet, Deno downloaded the old version from npm instead of using the local build. Changes: - Use deno.json import map to directly reference local dist files - Remove npm: prefix from imports in index.ts files - Delete setup.ts scripts that copied builds to npm cache (no longer needed) - Remove "Setup Deno workspace structure" step from CI workflow - For slim example, explicitly pass WASM file path to loadWASM() This ensures Deno examples use the local build artifacts directly, avoiding npm registry lookups entirely. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 24f04d7 commit a6806dc

File tree

7 files changed

+11
-293
lines changed

7 files changed

+11
-293
lines changed

.github/workflows/.examples.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,6 @@ jobs:
196196
with:
197197
deno-version: lts
198198

199-
- name: Setup Deno workspace structure
200-
run: |
201-
cd examples/deno/${{ matrix.example }}
202-
deno task setup
203-
204199
- name: Run example - ${{ matrix.example }}
205200
run: |
206201
cd examples/deno/${{ matrix.example }}

examples/deno/main/deno.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json",
33
"nodeModulesDir": "auto",
44
"tasks": {
5-
"setup": "deno run --allow-read --allow-write setup.ts",
65
"start": "deno run --allow-read index.ts"
6+
},
7+
"imports": {
8+
"web-csv-toolbox": "../../../dist/node/main.node.js"
79
}
810
}

examples/deno/main/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { parseString, parseStringToArraySyncWASM } from 'npm:web-csv-toolbox';
1+
import { parseString, parseStringToArraySyncWASM } from 'web-csv-toolbox';
22

33
console.log('🦕 Deno Main Version Test');
44
console.log('Features: Auto WASM initialization via npm: prefix\n');

examples/deno/main/setup.ts

Lines changed: 0 additions & 141 deletions
This file was deleted.

examples/deno/slim/deno.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json",
33
"nodeModulesDir": "auto",
44
"tasks": {
5-
"setup": "deno run --allow-read --allow-write setup.ts",
65
"start": "deno run --allow-read index.ts"
6+
},
7+
"imports": {
8+
"web-csv-toolbox/slim": "../../../dist/node/slim.node.js"
79
}
810
}

examples/deno/slim/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { loadWASM, parseStringToArraySyncWASM } from 'npm:web-csv-toolbox/slim';
1+
import { loadWASM, parseStringToArraySyncWASM } from 'web-csv-toolbox/slim';
22

33
console.log('🦕 Deno Slim Entry Test');
44
console.log('Features: Manual WASM initialization via npm: prefix, smaller JS bundle\n');
@@ -11,9 +11,10 @@ try {
1111
console.log();
1212

1313
// Slim entry: Must initialize WASM manually
14-
// With npm: prefix, Deno uses Node.js loader which auto-resolves WASM path
14+
// For local development, specify the WASM file path explicitly
1515
console.log('⏳ Initializing WASM...');
16-
await loadWASM(); // No argument needed - will use import.meta.resolve internally
16+
const wasmPath = new URL('../../../dist/csv.wasm', import.meta.url);
17+
await loadWASM(wasmPath);
1718
console.log('✅ WASM initialized\n');
1819

1920
// Now we can use sync WASM APIs

examples/deno/slim/setup.ts

Lines changed: 0 additions & 141 deletions
This file was deleted.

0 commit comments

Comments
 (0)