@serwist/cli 9.4.0 → 9.4.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.
package/dist/app.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAQ/C,eAAO,MAAM,GAAG,GAAU,QAAQ,UAAU,CAAC,cAAc,CAAC,KAAG,OAAO,CAAC,IAAI,CA+G1E,CAAC"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAS/C,eAAO,MAAM,GAAG,GAAU,QAAQ,UAAU,CAAC,cAAc,CAAC,KAAG,OAAO,CAAC,IAAI,CAkH1E,CAAC"}
package/dist/bin.js CHANGED
@@ -176,7 +176,9 @@ const app = async (params)=>{
176
176
  assert(params && Array.isArray(params.input), errors["missing-input"]);
177
177
  const [command = "help", option] = params.input;
178
178
  process.env.SERWIST_ENV = params.flags.watch ? "watch" : "build";
179
- process.env.NODE_ENV = params.flags.watch ? "development" : "production";
179
+ if (!process.env.NODE_ENV) {
180
+ process.env.NODE_ENV = params.flags.watch ? "development" : "production";
181
+ }
180
182
  switch(command){
181
183
  case "wizard":
182
184
  {
@@ -33,6 +33,7 @@ const runInjectManifestCommand = async ({ config, watch })=>{
33
33
  }
34
34
  };
35
35
  const runBuildCommand = async ({ config, watch })=>{
36
+ const isDev = process.env.NODE_ENV === "development";
36
37
  const options = await validateBuildOptions(config);
37
38
  const { count, manifestEntries, size, warnings } = await getFileManifestEntries(options);
38
39
  for (const warning of warnings){
@@ -48,7 +49,7 @@ const runBuildCommand = async ({ config, watch })=>{
48
49
  const parsedDest = path.parse(config.swDest);
49
50
  const esbuildContext = await esbuild.context({
50
51
  metafile: true,
51
- sourcemap: watch,
52
+ sourcemap: isDev,
52
53
  format: "esm",
53
54
  target: [
54
55
  "chrome64",
@@ -58,7 +59,7 @@ const runBuildCommand = async ({ config, watch })=>{
58
59
  "safari12"
59
60
  ],
60
61
  treeShaking: true,
61
- minify: !watch,
62
+ minify: !isDev,
62
63
  bundle: true,
63
64
  ...options.esbuildOptions,
64
65
  platform: "browser",
@@ -127,7 +128,7 @@ const errors = {
127
128
  "missing-input": "params.input value was not set properly.",
128
129
  "missing-dest-dir-param": oneLine`Please provide the path to a directory in which
129
130
  the libraries will be copied.`,
130
- "invalid-common-js-module": oneLine`Please pass in a valid CommonJS module that
131
+ "invalid-common-js-module": oneLine`Please pass in a valid module that
131
132
  exports your configuration.`,
132
133
  "config-validation-failed": "Your configuration is invalid:",
133
134
  "serwist-build-runtime-error": "Service worker generation failed:",
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/lib/build.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,KAAK,qBAAqB,EAAkB,MAAM,gBAAgB,CAAC;AAKpG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIhD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,qBAAqB,CAAC;CAC/B;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAU,mBAAmB,qBAAqB,kBAwBtF,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,GAAU,mBAAmB,YAAY,kBAuGpE,CAAC"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/lib/build.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,KAAK,qBAAqB,EAAkB,MAAM,gBAAgB,CAAC;AAKpG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAIhD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,qBAAqB,CAAC;CAC/B;AAED;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAU,mBAAmB,qBAAqB,kBAwBtF,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,eAAe,GAAU,mBAAmB,YAAY,kBAwGpE,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import type { InjectManifestOptions } from "@serwist/build";
2
- export declare const readConfig: (configFile: string) => Promise<InjectManifestOptions>;
2
+ export declare const readConfig: <T extends InjectManifestOptions = InjectManifestOptions>(configFile: string) => Promise<T>;
3
3
  //# sourceMappingURL=read-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"read-config.d.ts","sourceRoot":"","sources":["../../src/lib/read-config.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,UAAU,GAAU,YAAY,MAAM,KAAG,OAAO,CAAC,qBAAqB,CAElF,CAAC"}
1
+ {"version":3,"file":"read-config.d.ts","sourceRoot":"","sources":["../../src/lib/read-config.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,eAAO,MAAM,UAAU,GAAU,CAAC,SAAS,qBAAqB,GAAG,qBAAqB,EAAE,YAAY,MAAM,KAAG,OAAO,CAAC,CAAC,CAEvH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serwist/cli",
3
- "version": "9.4.0",
3
+ "version": "9.4.2",
4
4
  "type": "module",
5
5
  "description": "The command line interface of Serwist.",
6
6
  "files": [
@@ -61,7 +61,7 @@
61
61
  "stringify-object": "6.0.0",
62
62
  "update-notifier": "7.3.1",
63
63
  "zod": "4.2.1",
64
- "@serwist/build": "9.4.0"
64
+ "@serwist/build": "9.4.2"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@types/common-tags": "1.8.4",
@@ -71,8 +71,8 @@
71
71
  "esbuild": "0.27.2",
72
72
  "rollup": "4.54.0",
73
73
  "typescript": "5.9.3",
74
- "@serwist/configs": "9.4.0",
75
- "@serwist/utils": "9.4.0"
74
+ "@serwist/configs": "9.4.2",
75
+ "@serwist/utils": "9.4.2"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "esbuild": ">=0.25.0 <1.0.0"