edge-functions 5.0.1 → 5.0.2

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.
@@ -760,7 +760,8 @@ var setEnvironment = async ({
760
760
  }
761
761
  };
762
762
  }
763
- await env_default.writeUserConfig(mergedConfig);
763
+ const hasUserConfig = await env_default.readUserConfig();
764
+ if (!hasUserConfig) await env_default.writeUserConfig(mergedConfig);
764
765
  const storeConfig = {
765
766
  preset: mergedConfig.build.preset,
766
767
  bundler: mergedConfig.build?.bundler,
@@ -769,6 +770,7 @@ var setEnvironment = async ({
769
770
  entry: mergedConfig.build.entry
770
771
  };
771
772
  await env_default.writeStore(storeConfig);
773
+ return mergedConfig;
772
774
  } catch (error) {
773
775
  throw new Error(`Failed to set environment: ${error.message}`);
774
776
  }
@@ -933,9 +935,13 @@ var build = async ({
933
935
  });
934
936
  feedback4.build.success("Build completed successfully");
935
937
  await executePostbuild({ buildConfig: buildConfigSetup, ctx });
936
- await setEnvironment({ config, preset: resolvedPreset, ctx });
937
- return {
938
+ const mergedConfig = await setEnvironment({
938
939
  config,
940
+ preset: resolvedPreset,
941
+ ctx
942
+ });
943
+ return {
944
+ config: mergedConfig,
939
945
  ctx
940
946
  };
941
947
  } catch (error) {
@@ -2,7 +2,7 @@ import {
2
2
  buildCommand,
3
3
  bundler_default,
4
4
  writeStore
5
- } from "./chunk-EFK4CX5I.js";
5
+ } from "./chunk-IZH6EJIJ.js";
6
6
  import {
7
7
  debug
8
8
  } from "./chunk-GVUH3USH.js";
@@ -14,7 +14,7 @@ async function devCommand({
14
14
  port
15
15
  }) {
16
16
  const parsedPort = parseInt(port, 10);
17
- const { server } = await import("./env-GXBT7FGS.js");
17
+ const { server } = await import("./env-JQJQ6JUU.js");
18
18
  const edgeDir = join(process.cwd(), ".edge");
19
19
  const devWorkerPath = join(edgeDir, "worker.dev.js");
20
20
  const entryPoint = entry || devWorkerPath;
@@ -6,7 +6,7 @@ import {
6
6
  server_default,
7
7
  writeStore,
8
8
  writeUserConfig
9
- } from "./chunk-EFK4CX5I.js";
9
+ } from "./chunk-IZH6EJIJ.js";
10
10
  import "./chunk-GVUH3USH.js";
11
11
  export {
12
12
  env_default as default,
package/dist/main.js CHANGED
@@ -90,7 +90,7 @@ function setupBundlerProcessHandlers() {
90
90
  function startBundler() {
91
91
  AzionBundler.version(BUNDLER_CURRENT_VERSION);
92
92
  AzionBundler.command("store <command>").description("Manage store configuration (init/destroy)").option("--scope <scope>", "Project scope", "global").option("--preset <string>", "Preset name").option("--entry <string>", "Code entrypoint").option("--bundler <type>", "Bundler type (webpack/esbuild)").option("--polyfills [boolean]", "Use node polyfills in build").option("--worker [boolean]", "Indicates worker expression").action(async (command, options) => {
93
- const { storeCommand } = await import("./commands-UAU476PN.js");
93
+ const { storeCommand } = await import("./commands-BH2QCRMB.js");
94
94
  await storeCommand({ command, options });
95
95
  });
96
96
  AzionBundler.command("build").description("Build a project for edge deployment").option(
@@ -106,7 +106,7 @@ function startBundler() {
106
106
  "--worker [boolean]",
107
107
  "Indicates that the constructed code inserts its own worker expression. Use --worker or --worker=true to enable, --worker=false to disable"
108
108
  ).option("--development", "Build in development mode", false).action(async (options) => {
109
- const { buildCommand, manifestCommand } = await import("./commands-UAU476PN.js");
109
+ const { buildCommand, manifestCommand } = await import("./commands-BH2QCRMB.js");
110
110
  const { config } = await buildCommand({
111
111
  ...options,
112
112
  production: !options.development
@@ -117,11 +117,11 @@ function startBundler() {
117
117
  "[entry]",
118
118
  "Specify the entry file (default: .edge/worker.dev.js)"
119
119
  ).option("-p, --port <port>", "Specify the port", "3333").action(async (entry, options) => {
120
- const { devCommand } = await import("./commands-UAU476PN.js");
120
+ const { devCommand } = await import("./commands-BH2QCRMB.js");
121
121
  await devCommand({ entry, ...options });
122
122
  });
123
123
  AzionBundler.command("presets <command>").description("List <ls> defined project presets for Azion").action(async (command) => {
124
- const { presetsCommand } = await import("./commands-UAU476PN.js");
124
+ const { presetsCommand } = await import("./commands-BH2QCRMB.js");
125
125
  await presetsCommand(command);
126
126
  });
127
127
  AzionBundler.command("manifest [action]").description(
@@ -139,7 +139,7 @@ Examples:
139
139
  $ az manifest --entry=azion.config.js --output=.edge
140
140
  `
141
141
  ).action(async (action, options) => {
142
- const { manifestCommand } = await import("./commands-UAU476PN.js");
142
+ const { manifestCommand } = await import("./commands-BH2QCRMB.js");
143
143
  await manifestCommand({
144
144
  ...options,
145
145
  action
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edge-functions",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "Tool to launch and build JavaScript/Frameworks. This tool automates polyfills for Edge Computing and assists in creating Workers, notably for the Azion platform.",
5
5
  "main": "dist/main.js",
6
6
  "module": "dist/main.ts",