Skip to content

Commit 64ce870

Browse files
authored
fix: update deno run commands to set node-modules-dir to manual (#6771)
1 parent 4f7e46f commit 64ce870

File tree

6 files changed

+10
-76
lines changed

6 files changed

+10
-76
lines changed

packages/build/tests/edge_functions/snapshots/tests.js.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Snapshot report for `packages/build/tests/edge_functions/tests.js`
1+
# Snapshot report for `tests/edge_functions/tests.js`
22

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

@@ -1279,7 +1279,7 @@ Generated by [AVA](https://avajs.dev).
12791279
────────────────────────────────────────────────────────────────␊
12801280
12811281
Error message␊
1282-
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␊
1282+
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␊
12831283
STACK TRACE␊
12841284
12851285
export async () => ␊
@@ -1292,9 +1292,9 @@ Generated by [AVA](https://avajs.dev).
12921292
12931293
Error properties␊
12941294
{␊
1295-
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',␊
1296-
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',␊
1297-
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"',␊
1295+
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',␊
1296+
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',␊
1297+
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"',␊
12981298
exitCode: 1,␊
12991299
signal: undefined,␊
13001300
signalDescription: undefined,␊
23 Bytes
Binary file not shown.

packages/build/tests/install/snapshots/tests.js.md

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,70 +1159,3 @@ Generated by [AVA](https://avajs.dev).
11591159
11601160
(Netlify Build completed in 1ms)␊
11611161
Build step duration: Netlify Build completed in 1ms`
1162-
1163-
## In integration dev mode, install local plugins and install the integration when forcing build
1164-
1165-
> Snapshot 1
1166-
1167-
`␊
1168-
Netlify Build ␊
1169-
────────────────────────────────────────────────────────────────␊
1170-
1171-
> Version␊
1172-
@netlify/build 1.0.0␊
1173-
1174-
> Flags␊
1175-
context: dev␊
1176-
debug: true␊
1177-
repositoryRoot: packages/build/tests/install/fixtures/local_missing_integration␊
1178-
testOpts:␊
1179-
pluginsListUrl: test␊
1180-
silentLingeringProcesses: true␊
1181-
1182-
> Current directory␊
1183-
packages/build/tests/install/fixtures/local_missing_integration␊
1184-
1185-
> Config file␊
1186-
packages/build/tests/install/fixtures/local_missing_integration/netlify.toml␊
1187-
1188-
> Resolved config␊
1189-
build:␊
1190-
publish: packages/build/tests/install/fixtures/local_missing_integration␊
1191-
publishOrigin: default␊
1192-
1193-
> Context␊
1194-
dev␊
1195-
1196-
> Installing extensions␊
1197-
- functions-injection␊
1198-
1199-
> Loading extensions␊
1200-
- functions-injection␊
1201-
1202-
functions-injection-buildhooks (onPreBuild event) ␊
1203-
────────────────────────────────────────────────────────────────␊
1204-
1205-
Hello from onPreBuild␊
1206-
1207-
(functions-injection-buildhooks onPreBuild completed in 1ms)␊
1208-
Build step duration: functions-injection-buildhooks onPreBuild completed in 1ms␊
1209-
1210-
Functions bundling ␊
1211-
────────────────────────────────────────────────────────────────␊
1212-
1213-
Packaging Functions generated by functions-injection extension:␊
1214-
- my_unique_prefix_2_function-with-external-dependencies-directory␊
1215-
- my_unique_prefix_2_function-with-external-dependencies-directory-multifile␊
1216-
- my_unique_prefix_2_function-with-external-dependencies.ts␊
1217-
- my_unique_prefix_2_function-with-local-dependencies.ts␊
1218-
- my_unique_prefix_2_function-with-no-dependencies.ts␊
1219-
1220-
1221-
(Functions bundling completed in 1ms)␊
1222-
Build step duration: Functions bundling completed in 1ms␊
1223-
1224-
Netlify Build Complete ␊
1225-
────────────────────────────────────────────────────────────────␊
1226-
1227-
(Netlify Build completed in 1ms)␊
1228-
Build step duration: Netlify Build completed in 1ms`
-77 Bytes
Binary file not shown.

packages/edge-bundler/node/bundler.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ export const bundle = async (
123123
vendorDirectory,
124124
})
125125

126+
if (vendor) {
127+
importMap.add(vendor.importMap)
128+
}
129+
126130
const bundles: Bundle[] = []
127131

128132
if (featureFlags.edge_bundler_generate_tarball || featureFlags.edge_bundler_dry_run_generate_tarball) {
@@ -156,10 +160,6 @@ export const bundle = async (
156160
}
157161
}
158162

159-
if (vendor) {
160-
importMap.add(vendor.importMap)
161-
}
162-
163163
bundles.push(
164164
await bundleESZIP({
165165
basePath,

packages/edge-bundler/node/formats/tarball.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export const bundle = async ({
8888
'--quiet',
8989
'--code-splitting',
9090
'--allow-import',
91+
'--node-modules-dir=manual',
9192
'--outdir',
9293
bundleDir.path,
9394
...functions.map((func) => func.path),

0 commit comments

Comments
 (0)