@netlify/dev 4.3.6 → 4.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.cjs CHANGED
@@ -295,6 +295,7 @@ var getRuntime = async ({ blobs, deployID, projectRoot, siteID }) => {
295
295
  });
296
296
  return {
297
297
  env,
298
+ envSnapshot,
298
299
  stop: async () => {
299
300
  restoreEnvironment(envSnapshot);
300
301
  await blobsServer?.stop();
@@ -543,19 +544,31 @@ var NetlifyDev = class {
543
544
  });
544
545
  }
545
546
  if (this.#features.edgeFunctions) {
546
- const env = Object.entries(envVariables).reduce((acc, [key, variable]) => {
547
- if (variable.usedSource === "account" || variable.usedSource === "addons" || variable.usedSource === "internal" || variable.usedSource === "ui" || variable.usedSource.startsWith(".env")) {
548
- return {
547
+ const edgeFunctionsEnv = {
548
+ // User-defined env vars + documented runtime env vars
549
+ ...Object.entries(envVariables).reduce(
550
+ (acc, [key, variable]) => ({
549
551
  ...acc,
550
552
  [key]: variable.value
551
- };
552
- }
553
- return acc;
554
- }, {});
553
+ }),
554
+ {}
555
+ ),
556
+ // Add runtime env vars that we've set ourselves so far. These are "internal" env vars,
557
+ // part of the runtime emulation. They've already been populated on this process's env, which
558
+ // is needed to make other dev features work. These are different than the "documented" runtime
559
+ // env vars, in that they are implementation details, needed to make our features work.
560
+ ...Object.keys(runtime.envSnapshot).reduce(
561
+ (acc, key) => ({
562
+ ...acc,
563
+ [key]: runtime.env.get(key) ?? ""
564
+ }),
565
+ {}
566
+ )
567
+ };
555
568
  const edgeFunctionsHandler = new import_dev.EdgeFunctionsHandler({
556
569
  configDeclarations: this.#config?.config.edge_functions ?? [],
557
570
  directories: [this.#config?.config.build.edge_functions].filter(Boolean),
558
- env,
571
+ env: edgeFunctionsEnv,
559
572
  geolocation: import_dev_utils.mockLocation,
560
573
  logger: this.#logger,
561
574
  siteID,
package/dist/main.js CHANGED
@@ -261,6 +261,7 @@ var getRuntime = async ({ blobs, deployID, projectRoot, siteID }) => {
261
261
  });
262
262
  return {
263
263
  env,
264
+ envSnapshot,
264
265
  stop: async () => {
265
266
  restoreEnvironment(envSnapshot);
266
267
  await blobsServer?.stop();
@@ -509,19 +510,31 @@ var NetlifyDev = class {
509
510
  });
510
511
  }
511
512
  if (this.#features.edgeFunctions) {
512
- const env = Object.entries(envVariables).reduce((acc, [key, variable]) => {
513
- if (variable.usedSource === "account" || variable.usedSource === "addons" || variable.usedSource === "internal" || variable.usedSource === "ui" || variable.usedSource.startsWith(".env")) {
514
- return {
513
+ const edgeFunctionsEnv = {
514
+ // User-defined env vars + documented runtime env vars
515
+ ...Object.entries(envVariables).reduce(
516
+ (acc, [key, variable]) => ({
515
517
  ...acc,
516
518
  [key]: variable.value
517
- };
518
- }
519
- return acc;
520
- }, {});
519
+ }),
520
+ {}
521
+ ),
522
+ // Add runtime env vars that we've set ourselves so far. These are "internal" env vars,
523
+ // part of the runtime emulation. They've already been populated on this process's env, which
524
+ // is needed to make other dev features work. These are different than the "documented" runtime
525
+ // env vars, in that they are implementation details, needed to make our features work.
526
+ ...Object.keys(runtime.envSnapshot).reduce(
527
+ (acc, key) => ({
528
+ ...acc,
529
+ [key]: runtime.env.get(key) ?? ""
530
+ }),
531
+ {}
532
+ )
533
+ };
521
534
  const edgeFunctionsHandler = new EdgeFunctionsHandler({
522
535
  configDeclarations: this.#config?.config.edge_functions ?? [],
523
536
  directories: [this.#config?.config.build.edge_functions].filter(Boolean),
524
- env,
537
+ env: edgeFunctionsEnv,
525
538
  geolocation: mockLocation,
526
539
  logger: this.#logger,
527
540
  siteID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/dev",
3
- "version": "4.3.6",
3
+ "version": "4.3.8",
4
4
  "description": "Emulation of the Netlify environment for local development",
5
5
  "type": "module",
6
6
  "engines": {
@@ -52,15 +52,15 @@
52
52
  "vitest": "^3.0.0"
53
53
  },
54
54
  "dependencies": {
55
- "@netlify/blobs": "10.0.3",
55
+ "@netlify/blobs": "10.0.4",
56
56
  "@netlify/config": "^23.0.11",
57
57
  "@netlify/dev-utils": "3.2.2",
58
58
  "@netlify/edge-functions": "2.15.6",
59
- "@netlify/functions": "4.1.9",
59
+ "@netlify/functions": "4.1.10",
60
60
  "@netlify/headers": "2.0.4",
61
61
  "@netlify/images": "1.1.2",
62
62
  "@netlify/redirects": "3.0.4",
63
- "@netlify/runtime": "4.0.7",
63
+ "@netlify/runtime": "4.0.8",
64
64
  "@netlify/static": "3.0.4",
65
65
  "ulid": "^3.0.0"
66
66
  }