Skip to content

Commit cc18bdd

Browse files
committed
chore: vendor deno deps in CI before deno tests
When building the package, we only care about vendoring `edge-runtime/` deps, but for Deno tests/typechecking/linting, we want to vendor the deps of our build tools written in Deno too.
1 parent 4d35e6c commit cc18bdd

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/deno-test.yml

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ jobs:
1212
uses: denoland/setup-deno@v1
1313
with:
1414
deno-version: vx.x.x
15+
- name: Vendor Deno Dependencies
16+
uses: actions/github-script@v7
17+
with:
18+
script: |
19+
const { vendorDeno } = await import('${{ github.workspace }}/tools/build.js')
20+
21+
await vendorDeno('edge-runtime')
22+
await vendorDeno('tools/deno')
1523
- name: Typecheck
1624
run: npm run typecheck:deno
1725
- name: Lint

tools/build.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ async function bundle(entryPoints, format, watch) {
7777
})
7878
}
7979

80-
async function vendorDeno() {
81-
const vendorSource = resolve('edge-runtime/vendor.ts')
82-
const vendorDest = resolve('edge-runtime/vendor')
80+
export async function vendorDeno(dir) {
81+
const vendorSource = resolve(join(dir, 'vendor.ts'))
82+
const vendorDest = resolve(join(dir, 'vendor'))
8383

8484
try {
8585
await execaCommand('deno --version')
@@ -100,7 +100,7 @@ const args = new Set(process.argv.slice(2))
100100
const watch = args.has('--watch') || args.has('-w')
101101

102102
await Promise.all([
103-
vendorDeno(),
103+
vendorDeno('edge-runtime'),
104104
bundle(entryPointsESM, 'esm', watch),
105105
...entryPointsCJS.map((entry) => bundle([entry], 'cjs', watch)),
106106
cp('src/build/templates', join(OUT_DIR, 'build/templates'), { recursive: true, force: true }),

0 commit comments

Comments
 (0)