Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: adapt edge-bundler repo #5599

Merged
merged 16 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
44 changes: 0 additions & 44 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,50 +109,6 @@ jobs:
retry_on: error
command: npx nx affected --target=test:ci --exclude=@netlify/build --parallel=3

test-edge-bundler-integration:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
node-version: [14.16.0, '*']
exclude:
- os: macOS-latest
node-version: 14.16.0
- os: windows-latest
node-version: 14.16.0
fail-fast: false
steps:
# Sets an output parameter if this is a release PR
- name: Check for release
id: release-check
# For windows we have to use $env:
run: |-
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT
echo "IS_RELEASE=true" >> $env:GITHUB_OUTPUT
if: ${{ startsWith(github.head_ref, 'release-') }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
- uses: nrwl/nx-set-shas@v3
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
- name: Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
- name: Install npm@7
run: npm install -g npm@7
if: ${{ matrix.node-version == '14.16.0' && !steps.release-check.outputs.IS_RELEASE }}
- name: Install dependencies
run: npm ci
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
- name: Test
run: npx lerna run test:integration --scope @netlify/edge-bundler
if: ${{ !steps.release-check.outputs.IS_RELEASE }}

test-build:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
Expand Down
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"packages/build-info": "7.13.2",
"packages/build": "29.40.0",
"packages/edge-bundler": "11.4.0",
"packages/cache-utils": "5.1.5",
"packages/config": "20.12.1",
"packages/framework-info": "9.8.11",
Expand Down
4 changes: 2 additions & 2 deletions packages/build/tests/monitor/snapshots/tests.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -1620,7 +1620,7 @@ Generated by [AVA](https://avajs.dev).
────────────────────────────────────────────────────────────────␊
Error message␊
Command failed with exit code 1: deno run --allow-all --no-config --import-map=/node_module/path --quiet /node_module/path {"basePath":"packages/build/tests/monitor/fixtures/edge_function_error","destPath":"packages/build/tests/monitor/fixtures/edge_function_error/.netlify/edge-functions-dist/HEXADECIMAL_ID.eszip","externals":[],"functions":[{"name":"trouble","path":"packages/build/tests/monitor/fixtures/edge_function_error/netlify/edge-functions/trouble.ts"}],"importMapData":"{/"imports/":{/"@netlify/edge-functions/":/"https://edge.netlify.com/v1.0.0/index.ts/",/"netlify:edge/":/"https://edge.netlify.com/v1.0.0/index.ts?v=legacy/"},/"scopes/":{}}"}␊
Command failed with exit code 1: deno run --allow-all --no-config --import-map=packages/edge-bundler/deno/vendor/import_map.json --quiet packages/edge-bundler/deno/bundle.ts {"basePath":"packages/build/tests/monitor/fixtures/edge_function_error","destPath":"packages/build/tests/monitor/fixtures/edge_function_error/.netlify/edge-functions-dist/HEXADECIMAL_ID.eszip","externals":[],"functions":[{"name":"trouble","path":"packages/build/tests/monitor/fixtures/edge_function_error/netlify/edge-functions/trouble.ts"}],"importMapData":"{/"imports/":{/"@netlify/edge-functions/":/"https://edge.netlify.com/v1.0.0/index.ts/",/"netlify:edge/":/"https://edge.netlify.com/v1.0.0/index.ts?v=legacy/"},/"scopes/":{}}"}␊
error: Uncaught (in promise) Error: Error: Could not find file: packages/build/tests/monitor/fixtures/edge_function_error/netlify/edge-functions/file.ts␊
const ret = new Error(getStringFromWasm0(arg0, arg1));␊
^␊
Expand All @@ -1638,7 +1638,7 @@ Generated by [AVA](https://avajs.dev).
Error monitoring payload:␊
{␊
"errorClass": "functionsBundling",␊
"errorMessage": "Command failed with exit code 1: deno run --allow-all --no-config --import-map=/node_module/path --quiet /node_module/path {/"basePath/":/"packages/build/tests/monitor/fixtures/edge_function_error",/"destPath/":/"packages/build/tests/monitor/fixtures/edge_function_error/.netlify/edge-functions-dist/HEXADECIMAL_ID.eszip",/"externals/":[],/"functions/":[{/"name/":/"trouble/",/"path/":/"packages/build/tests/monitor/fixtures/edge_function_error/netlify/edge-functions/trouble.ts"}],/"importMapData/":/"{//"imports//":{//"@netlify/edge-functions//"://"https://edge.netlify.com/v1.0.0/index.ts//",//"netlify:edge//"://"https://edge.netlify.com/v1.0.0/index.ts?v=legacy//"},//"scopes//":{}}/"}/nerror: Uncaught (in promise) Error: Error: Could not find file: packages/build/tests/monitor/fixtures/edge_function_error/netlify/edge-functions/file.ts/n const ret = new Error(getStringFromWasm0(arg0, arg1));/n ^/n at __wbg_new_HEXADECIMAL_ID (/node_module/path)/n at <anonymous> (/node_module/path)/n at <anonymous> (/node_module/path)/n at <anonymous> (/node_module/path)/n at __wbg_adapter_40 (/node_module/path)/n at real (/node_module/path)/n at eventLoopTick (ext:core/01_core.js:80:80)",␊
"errorMessage": "Command failed with exit code 1: deno run --allow-all --no-config --import-map=packages/edge-bundler/deno/vendor/import_map.json --quiet packages/edge-bundler/deno/bundle.ts {/"basePath/":/"packages/build/tests/monitor/fixtures/edge_function_error",/"destPath/":/"packages/build/tests/monitor/fixtures/edge_function_error/.netlify/edge-functions-dist/HEXADECIMAL_ID.eszip",/"externals/":[],/"functions/":[{/"name/":/"trouble/",/"path/":/"packages/build/tests/monitor/fixtures/edge_function_error/netlify/edge-functions/trouble.ts"}],/"importMapData/":/"{//"imports//":{//"@netlify/edge-functions//"://"https://edge.netlify.com/v1.0.0/index.ts//",//"netlify:edge//"://"https://edge.netlify.com/v1.0.0/index.ts?v=legacy//"},//"scopes//":{}}/"}/nerror: Uncaught (in promise) Error: Error: Could not find file: packages/build/tests/monitor/fixtures/edge_function_error/netlify/edge-functions/file.ts/n const ret = new Error(getStringFromWasm0(arg0, arg1));/n ^/n at __wbg_new_HEXADECIMAL_ID (packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/eszip_wasm.generated.js:80:80)/n at <anonymous> (packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/eszip_wasm_bg.wasm:1:80)/n at <anonymous> (packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/eszip_wasm_bg.wasm:1:80)/n at <anonymous> (packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/eszip_wasm_bg.wasm:1:80)/n at __wbg_adapter_40 (packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/eszip_wasm.generated.js:80:8)/n at real (packages/edge-bundler/deno/vendor/deno.land/x/[email protected]/eszip_wasm.generated.js:80:80)/n at eventLoopTick (ext:core/01_core.js:80:7)",␊
"context": "Bundling of edge function failed",␊
"groupingHash": "Bundling of edge function failed/nCommand failed with exit code 0: deno run --allow-all --no-config /external/path --quiet /external/path {/"/":/"/",/"/":/"/",/"/":[],/"/":[{/"/":/"/",/"/":/"/"}],/"/":/"/"/external/path"/"/external/path"/"/external/path"/"/external/path"/"/external/path"/"/external/path"/"}/nerror: Uncaught (in promise) Error: Error: Could not find file: /external/path const ret = new Error(getStringFromWasm0(arg0, arg0));/n ^/n at __wbg_new_hex /external/path at <anonymous> /external/path at <anonymous> /external/path at <anonymous> /external/path at __wbg_adapter_0 /external/path at real /external/path at eventLoopTick /external/path",␊
"severity": "info",␊
Expand Down
Binary file modified packages/build/tests/monitor/snapshots/tests.js.snap
Binary file not shown.
8 changes: 6 additions & 2 deletions packages/edge-bundler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"prepack": "npm run build",
"test": "run-s build test:dev",
"test:dev": "run-s test:dev:*",
"test:ci": "run-s test:ci:*",
"test:ci": "run-s test:integration test:ci:*",
"test:dev:vitest": "vitest run",
"test:dev:vitest:watch": "vitest watch",
"test:dev:deno": "deno test --allow-all deno",
Expand All @@ -29,7 +29,11 @@
},
"keywords": [],
"license": "MIT",
"repository": "https://github.com/netlify/build",
"repository": {
"type": "git",
"url": "https://github.com/netlify/build.git",
"directory": "packages/build"
Skn0tt marked this conversation as resolved.
Show resolved Hide resolved
},
"bugs": {
"url": "https://github.com/netlify/build/issues"
},
Expand Down
1 change: 1 addition & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"packages/build": {},
"packages/cache-utils": {},
"packages/config": {},
"packages/edge-bundler": {},
"packages/framework-info": {},
"packages/functions-utils": {},
"packages/git-utils": {},
Expand Down
Loading