Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 5 additions & 5 deletions packages/build/tests/edge_functions/snapshots/tests.js.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Snapshot report for `packages/build/tests/edge_functions/tests.js`
# Snapshot report for `tests/edge_functions/tests.js`

The actual snapshot is saved in `tests.js.snap`.

Expand Down Expand Up @@ -1279,7 +1279,7 @@ Generated by [AVA](https://avajs.dev).
────────────────────────────────────────────────────────────────␊
Error message␊
Error: Command failed with exit code 1: deno bundle --import-map BASE64_STRING --quiet --code-splitting --allow-import --outdir /external/path packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts␊
Error: Command failed with exit code 1: deno bundle --import-map BASE64_STRING --quiet --code-splitting --allow-import --node-modules-dir=manual --outdir /external/path packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts␊
STACK TRACE␊
export async () => ␊
Expand All @@ -1292,9 +1292,9 @@ Generated by [AVA](https://avajs.dev).
Error properties␊
{␊
shortMessage: 'Command failed with exit code 1: deno bundle --import-map BASE64_STRING --quiet --code-splitting --allow-import --outdir /external/path packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts',␊
command: 'deno bundle --import-map BASE64_STRING --quiet --code-splitting --allow-import --outdir /external/path packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts',␊
escapedCommand: 'deno bundle --import-map "BASE64_STRING" --quiet --code-splitting --allow-import --outdir "/external/path" "packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts"',␊
shortMessage: 'Command failed with exit code 1: deno bundle --import-map BASE64_STRING --quiet --code-splitting --allow-import --node-modules-dir=manual --outdir /external/path packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts',␊
command: 'deno bundle --import-map BASE64_STRING --quiet --code-splitting --allow-import --node-modules-dir=manual --outdir /external/path packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts',␊
escapedCommand: 'deno bundle --import-map "BASE64_STRING" --quiet --code-splitting --allow-import "--node-modules-dir=manual" --outdir "/external/path" "packages/build/tests/edge_functions/fixtures/functions_invalid/netlify/edge-functions/functions-1.ts"',␊
exitCode: 1,␊
signal: undefined,␊
signalDescription: undefined,␊
Expand Down
Binary file modified packages/build/tests/edge_functions/snapshots/tests.js.snap
Binary file not shown.
67 changes: 0 additions & 67 deletions packages/build/tests/install/snapshots/tests.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -1159,70 +1159,3 @@ Generated by [AVA](https://avajs.dev).
(Netlify Build completed in 1ms)␊
Build step duration: Netlify Build completed in 1ms`

## In integration dev mode, install local plugins and install the integration when forcing build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come this is getting removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test does not exist - which is why the snapshot was removed when I regenerated snapshots


> Snapshot 1
`␊
Netlify Build ␊
────────────────────────────────────────────────────────────────␊
> Version␊
@netlify/build 1.0.0␊
> Flags␊
context: dev␊
debug: true␊
repositoryRoot: packages/build/tests/install/fixtures/local_missing_integration␊
testOpts:␊
pluginsListUrl: test␊
silentLingeringProcesses: true␊
> Current directory␊
packages/build/tests/install/fixtures/local_missing_integration␊
> Config file␊
packages/build/tests/install/fixtures/local_missing_integration/netlify.toml␊
> Resolved config␊
build:␊
publish: packages/build/tests/install/fixtures/local_missing_integration␊
publishOrigin: default␊
> Context␊
dev␊
> Installing extensions␊
- functions-injection␊
> Loading extensions␊
- functions-injection␊
functions-injection-buildhooks (onPreBuild event) ␊
────────────────────────────────────────────────────────────────␊
Hello from onPreBuild␊
(functions-injection-buildhooks onPreBuild completed in 1ms)␊
Build step duration: functions-injection-buildhooks onPreBuild completed in 1ms␊
Functions bundling ␊
────────────────────────────────────────────────────────────────␊
Packaging Functions generated by functions-injection extension:␊
- my_unique_prefix_2_function-with-external-dependencies-directory␊
- my_unique_prefix_2_function-with-external-dependencies-directory-multifile␊
- my_unique_prefix_2_function-with-external-dependencies.ts␊
- my_unique_prefix_2_function-with-local-dependencies.ts␊
- my_unique_prefix_2_function-with-no-dependencies.ts␊
(Functions bundling completed in 1ms)␊
Build step duration: Functions bundling completed in 1ms␊
Netlify Build Complete ␊
────────────────────────────────────────────────────────────────␊
(Netlify Build completed in 1ms)␊
Build step duration: Netlify Build completed in 1ms`
Binary file modified packages/build/tests/install/snapshots/tests.js.snap
Binary file not shown.
8 changes: 4 additions & 4 deletions packages/edge-bundler/node/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ export const bundle = async (
vendorDirectory,
})

if (vendor) {
importMap.add(vendor.importMap)
}

Comment on lines +126 to +129
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixes a bug where we were not including npm/vendor dependencies for our tarball bundles

const bundles: Bundle[] = []

if (featureFlags.edge_bundler_generate_tarball || featureFlags.edge_bundler_dry_run_generate_tarball) {
Expand Down Expand Up @@ -156,10 +160,6 @@ export const bundle = async (
}
}

if (vendor) {
importMap.add(vendor.importMap)
}

bundles.push(
await bundleESZIP({
basePath,
Expand Down
1 change: 1 addition & 0 deletions packages/edge-bundler/node/formats/tarball.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const bundle = async ({
'--quiet',
'--code-splitting',
'--allow-import',
'--node-modules-dir=manual',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the bug where Deno was adding a .deno folder into the node_modules folder, which caused issues for our hosted build system as it would cache the .deno folder - which is not a good thing to do because the package versions that Deno was selecting were not adhering to the Netlify Edge Functions' lockfiles (if those lockfiles were from bun/pnpm/yarn/npm)

'--outdir',
bundleDir.path,
...functions.map((func) => func.path),
Expand Down
Loading