@serwist/cli 9.5.6 → 9.5.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.
Files changed (59) hide show
  1. package/dist/bin.d.mts +10 -0
  2. package/dist/bin.d.mts.map +1 -0
  3. package/dist/bin.mjs +280 -0
  4. package/dist/bin.mjs.map +1 -0
  5. package/dist/chunks/constants-DptMolAX.js +67 -0
  6. package/dist/chunks/constants-DptMolAX.js.map +1 -0
  7. package/dist/chunks/errors-MXE2_2kj.js +139 -0
  8. package/dist/chunks/errors-MXE2_2kj.js.map +1 -0
  9. package/dist/chunks/schema-Bboy6FnP.js +29 -0
  10. package/dist/chunks/schema-Bboy6FnP.js.map +1 -0
  11. package/dist/chunks/types-Zr8JQZBi.d.ts +34 -0
  12. package/dist/chunks/types-Zr8JQZBi.d.ts.map +1 -0
  13. package/dist/chunks/validation-BIte-nSt.js +15 -0
  14. package/dist/chunks/validation-BIte-nSt.js.map +1 -0
  15. package/dist/index.d.mts +46 -0
  16. package/dist/index.d.mts.map +1 -0
  17. package/dist/index.mjs +3 -0
  18. package/dist/index.schema.d.mts +87 -0
  19. package/dist/index.schema.d.mts.map +1 -0
  20. package/dist/index.schema.mjs +3 -0
  21. package/package.json +17 -18
  22. package/dist/app.d.ts +0 -4
  23. package/dist/app.d.ts.map +0 -1
  24. package/dist/bin.d.ts +0 -6
  25. package/dist/bin.d.ts.map +0 -1
  26. package/dist/bin.js +0 -339
  27. package/dist/chunks/constants.js +0 -84
  28. package/dist/chunks/errors.js +0 -153
  29. package/dist/chunks/schema.js +0 -13
  30. package/dist/index.d.ts +0 -5
  31. package/dist/index.d.ts.map +0 -1
  32. package/dist/index.js +0 -11
  33. package/dist/index.schema.d.ts +0 -3
  34. package/dist/index.schema.d.ts.map +0 -1
  35. package/dist/index.schema.js +0 -4
  36. package/dist/lib/ask-questions.d.ts +0 -9
  37. package/dist/lib/ask-questions.d.ts.map +0 -1
  38. package/dist/lib/build.d.ts +0 -18
  39. package/dist/lib/build.d.ts.map +0 -1
  40. package/dist/lib/cleanup-stack-trace.d.ts +0 -2
  41. package/dist/lib/cleanup-stack-trace.d.ts.map +0 -1
  42. package/dist/lib/constants.d.ts +0 -7
  43. package/dist/lib/constants.d.ts.map +0 -1
  44. package/dist/lib/errors.d.ts +0 -17
  45. package/dist/lib/errors.d.ts.map +0 -1
  46. package/dist/lib/help-text.d.ts +0 -2
  47. package/dist/lib/help-text.d.ts.map +0 -1
  48. package/dist/lib/logger.d.ts +0 -7
  49. package/dist/lib/logger.d.ts.map +0 -1
  50. package/dist/lib/read-config.d.ts +0 -3
  51. package/dist/lib/read-config.d.ts.map +0 -1
  52. package/dist/lib/run-wizard.d.ts +0 -2
  53. package/dist/lib/run-wizard.d.ts.map +0 -1
  54. package/dist/lib/schema.d.ts +0 -79
  55. package/dist/lib/schema.d.ts.map +0 -1
  56. package/dist/lib/validation.d.ts +0 -3
  57. package/dist/lib/validation.d.ts.map +0 -1
  58. package/dist/types.d.ts +0 -23
  59. package/dist/types.d.ts.map +0 -1
@@ -1,84 +0,0 @@
1
- import { validationErrorMap, SerwistConfigError } from '@serwist/build/schema';
2
- import z from 'zod';
3
-
4
- const validateBuildOptions = async (input)=>{
5
- const result = await (await import('./schema.js')).buildOptions.spa(input, {
6
- error: validationErrorMap
7
- });
8
- if (!result.success) {
9
- throw new SerwistConfigError({
10
- moduleName: "@serwist/cli",
11
- message: z.prettifyError(result.error)
12
- });
13
- }
14
- return result.data;
15
- };
16
-
17
- const constants = {
18
- defaultConfigFile: "serwist.config.js",
19
- ignoredDirectories: [
20
- "node_modules"
21
- ],
22
- ignoredFileExtensions: [
23
- "map"
24
- ]
25
- };
26
- const SUPPORTED_ESBUILD_OPTIONS = [
27
- "sourcemap",
28
- "legalComments",
29
- "sourceRoot",
30
- "sourcesContent",
31
- "format",
32
- "globalName",
33
- "target",
34
- "supported",
35
- "define",
36
- "treeShaking",
37
- "minify",
38
- "mangleProps",
39
- "reserveProps",
40
- "mangleQuoted",
41
- "mangleCache",
42
- "drop",
43
- "dropLabels",
44
- "minifyWhitespace",
45
- "minifyIdentifiers",
46
- "minifySyntax",
47
- "lineLimit",
48
- "charset",
49
- "ignoreAnnotations",
50
- "jsx",
51
- "jsxFactory",
52
- "jsxFragment",
53
- "jsxImportSource",
54
- "jsxDev",
55
- "jsxSideEffects",
56
- "pure",
57
- "keepNames",
58
- "absPaths",
59
- "color",
60
- "logLevel",
61
- "logLimit",
62
- "logOverride",
63
- "tsconfigRaw",
64
- "bundle",
65
- "splitting",
66
- "preserveSymlinks",
67
- "external",
68
- "packages",
69
- "alias",
70
- "loader",
71
- "resolveExtensions",
72
- "mainFields",
73
- "conditions",
74
- "allowOverwrite",
75
- "tsconfig",
76
- "outExtension",
77
- "publicPath",
78
- "inject",
79
- "banner",
80
- "footer",
81
- "plugins"
82
- ];
83
-
84
- export { SUPPORTED_ESBUILD_OPTIONS as S, constants as c, validateBuildOptions as v };
@@ -1,153 +0,0 @@
1
- import path from 'node:path';
2
- import { injectManifest, getFileManifestEntries } from '@serwist/build';
3
- import chokidar from 'chokidar';
4
- import { glob } from 'glob';
5
- import prettyBytes from 'pretty-bytes';
6
- import chalk from 'chalk';
7
- import { v as validateBuildOptions } from './constants.js';
8
- import { oneLine } from 'common-tags';
9
-
10
- const logger = {
11
- debug: (...args)=>console.log(chalk.gray(...args)),
12
- log: (...args)=>console.log(...args),
13
- warn: (...args)=>console.warn(chalk.yellow(...args)),
14
- error: (...args)=>console.error(chalk.red.bold(...args))
15
- };
16
-
17
- const runInjectManifestCommand = async ({ config, watch })=>{
18
- const { count, filePaths, size, warnings } = await injectManifest(config);
19
- for (const warning of warnings){
20
- logger.warn(warning);
21
- }
22
- if (filePaths.length === 1) {
23
- logger.log(`The service worker file was written to ${config.swDest}.`);
24
- } else {
25
- const message = filePaths.sort().map((filePath)=>` • ${filePath}`).join("\n");
26
- logger.log(`The service worker files were written to:\n${message}`);
27
- }
28
- if (count > 0) {
29
- logger.log(`The service worker will precache ${count} URLs, ` + `totaling ${prettyBytes(size)}.`);
30
- }
31
- if (watch) {
32
- logger.log("\nWatching for changes...");
33
- }
34
- };
35
- const runBuildCommand = async ({ config, watch })=>{
36
- const isDev = process.env.NODE_ENV === "development";
37
- const options = await validateBuildOptions(config);
38
- const { count, manifestEntries, size, warnings } = await getFileManifestEntries(options);
39
- for (const warning of warnings){
40
- logger.warn(warning);
41
- }
42
- const manifestString = manifestEntries === undefined ? "undefined" : JSON.stringify(manifestEntries, null, 2);
43
- let esbuild;
44
- try {
45
- esbuild = await import('esbuild');
46
- } catch (err) {
47
- throw logger.error(`${err}\nThis command needs esbuild. Install it using "npm i esbuild".`);
48
- }
49
- const parsedDest = path.parse(config.swDest);
50
- const esbuildContext = await esbuild.context({
51
- metafile: true,
52
- sourcemap: isDev,
53
- format: "esm",
54
- target: [
55
- "chrome64",
56
- "edge79",
57
- "firefox67",
58
- "opera51",
59
- "safari12"
60
- ],
61
- treeShaking: true,
62
- minify: !isDev,
63
- bundle: true,
64
- ...options.esbuildOptions,
65
- platform: "browser",
66
- define: {
67
- ...options.esbuildOptions.define,
68
- ...options.injectionPoint ? {
69
- [options.injectionPoint]: manifestString
70
- } : {}
71
- },
72
- outdir: parsedDest.dir,
73
- entryNames: "[name]",
74
- assetNames: "[name]-[hash]",
75
- chunkNames: "[name]-[hash]",
76
- entryPoints: [
77
- {
78
- in: config.swSrc,
79
- out: parsedDest.name
80
- }
81
- ]
82
- });
83
- const rebuild = async ()=>{
84
- const result = await esbuildContext.rebuild();
85
- const filePaths = Object.keys(result.metafile.outputs);
86
- if (filePaths.length === 1) {
87
- logger.log(`The service worker file was written to ${config.swDest}.`);
88
- } else {
89
- const message = filePaths.sort().map((filePath)=>` • ${filePath}`).join("\n");
90
- logger.log(`The service worker files were written to:\n${message}`);
91
- }
92
- if (count > 0) {
93
- logger.log(`The service worker will precache ${count} URLs, ` + `totaling ${prettyBytes(size)}.`);
94
- }
95
- if (watch) {
96
- logger.log("\nWatching for changes...");
97
- }
98
- };
99
- if (watch) {
100
- if (config.globPatterns) {
101
- chokidar.watch([
102
- config.swSrc,
103
- ...config.disablePrecacheManifest ? [] : await glob(config.globPatterns, {
104
- cwd: config.globDirectory,
105
- follow: config.globFollow,
106
- ignore: config.globIgnores
107
- })
108
- ], {
109
- ignoreInitial: true,
110
- cwd: config.globDirectory
111
- }).on("all", async ()=>{
112
- if (config === null) return;
113
- await rebuild();
114
- }).on("ready", async ()=>{
115
- if (config === null) return;
116
- await rebuild();
117
- }).on("error", (err)=>{
118
- logger.error(err instanceof Error ? err.toString() : "Unknown error");
119
- });
120
- }
121
- } else {
122
- await rebuild();
123
- await esbuildContext.dispose();
124
- }
125
- };
126
-
127
- const errors = {
128
- "missing-input": "params.input value was not set properly.",
129
- "missing-dest-dir-param": oneLine`Please provide the path to a directory in which
130
- the libraries will be copied.`,
131
- "invalid-common-js-module": oneLine`Please pass in a valid module that
132
- exports your configuration.`,
133
- "config-validation-failed": "Your configuration is invalid:",
134
- "serwist-build-runtime-error": "Service worker generation failed:",
135
- "unknown-command": "Unknown command:",
136
- "no-file-extensions-found": oneLine`No files could be found that are suitable for
137
- caching.`,
138
- "no-file-extensions-selected": "Please select at least one file extension.",
139
- "invalid-sw-dest": oneLine`Please enter a valid path to use for the service worker
140
- file that's created.`,
141
- "glob-directory-invalid": oneLine`The path you entered isn't a valid directory.`,
142
- "invalid-config-location": oneLine`Please enter a valid path to use for the saved
143
- configuration file.`,
144
- "sw-src-missing-injection-point": oneLine`That is not a valid source service worker
145
- file. Please try again with a file containing
146
- 'self.__SW_MANIFEST'.`,
147
- "no-search-parameters-supplied": oneLine`Please provide the url search param(s)
148
- you would like to ignore.`,
149
- "invalid-search-parameters-supplied": oneLine`Please provide the valid URL search parameter(s)
150
- without the leading '/' or '?' (i.e. source,version,language).`
151
- };
152
-
153
- export { runInjectManifestCommand as a, errors as e, logger as l, runBuildCommand as r };
@@ -1,13 +0,0 @@
1
- import { injectManifestOptions } from '@serwist/build/schema';
2
- import z from 'zod';
3
- import { S as SUPPORTED_ESBUILD_OPTIONS } from './constants.js';
4
-
5
- const buildPartial = z.strictObject({
6
- esbuildOptions: z.partialRecord(z.literal(SUPPORTED_ESBUILD_OPTIONS), z.any()).prefault({})
7
- });
8
- const buildOptions = z.strictObject({
9
- ...injectManifestOptions.shape,
10
- ...buildPartial.shape
11
- });
12
-
13
- export { buildOptions, buildPartial };
package/dist/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export { type BuildCommand, type InjectManifestCommand, runBuildCommand, runInjectManifestCommand } from "./lib/build.js";
2
- export { constants, SUPPORTED_ESBUILD_OPTIONS } from "./lib/constants.js";
3
- export { errors } from "./lib/errors.js";
4
- export type * from "./types.js";
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,qBAAqB,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC1H,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,mBAAmB,YAAY,CAAC"}
package/dist/index.js DELETED
@@ -1,11 +0,0 @@
1
- export { e as errors, r as runBuildCommand, a as runInjectManifestCommand } from './chunks/errors.js';
2
- export { S as SUPPORTED_ESBUILD_OPTIONS, c as constants } from './chunks/constants.js';
3
- import 'node:path';
4
- import '@serwist/build';
5
- import 'chokidar';
6
- import 'glob';
7
- import 'pretty-bytes';
8
- import 'chalk';
9
- import 'common-tags';
10
- import '@serwist/build/schema';
11
- import 'zod';
@@ -1,3 +0,0 @@
1
- export { buildOptions, buildPartial } from "./lib/schema.js";
2
- export { validateBuildOptions } from "./lib/validation.js";
3
- //# sourceMappingURL=index.schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.schema.d.ts","sourceRoot":"","sources":["../src/index.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,4 +0,0 @@
1
- export { buildOptions, buildPartial } from './chunks/schema.js';
2
- export { v as validateBuildOptions } from './chunks/constants.js';
3
- import '@serwist/build/schema';
4
- import 'zod';
@@ -1,9 +0,0 @@
1
- interface ConfigWithConfigLocation {
2
- config: {
3
- [key: string]: any;
4
- };
5
- configLocation: string;
6
- }
7
- export declare const askQuestions: () => Promise<ConfigWithConfigLocation>;
8
- export {};
9
- //# sourceMappingURL=ask-questions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ask-questions.d.ts","sourceRoot":"","sources":["../../src/lib/ask-questions.ts"],"names":[],"mappings":"AAoFA,UAAU,wBAAwB;IAChC,MAAM,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,QAAa,OAAO,CAAC,wBAAwB,CAuErE,CAAC"}
@@ -1,18 +0,0 @@
1
- import { type InjectManifestOptions } from "@serwist/build";
2
- import type { BuildOptions } from "../types.js";
3
- export interface InjectManifestCommand {
4
- watch: boolean;
5
- config: InjectManifestOptions;
6
- }
7
- /**
8
- * Runs the specified build command with the provided configuration.
9
- *
10
- * @param options
11
- */
12
- export declare const runInjectManifestCommand: ({ config, watch }: InjectManifestCommand) => Promise<void>;
13
- export interface BuildCommand {
14
- config: BuildOptions;
15
- watch: boolean;
16
- }
17
- export declare const runBuildCommand: ({ config, watch }: BuildCommand) => Promise<void>;
18
- //# sourceMappingURL=build.d.ts.map
@@ -1 +0,0 @@
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,2 +0,0 @@
1
- export declare const cleanupStackTrace: (error: Error, moduleName: string) => string;
2
- //# sourceMappingURL=cleanup-stack-trace.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cleanup-stack-trace.d.ts","sourceRoot":"","sources":["../../src/lib/cleanup-stack-trace.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,iBAAiB,GAAI,OAAO,KAAK,EAAE,YAAY,MAAM,KAAG,MAiBpE,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare const constants: {
2
- defaultConfigFile: string;
3
- ignoredDirectories: string[];
4
- ignoredFileExtensions: string[];
5
- };
6
- export declare const SUPPORTED_ESBUILD_OPTIONS: readonly ["sourcemap", "legalComments", "sourceRoot", "sourcesContent", "format", "globalName", "target", "supported", "define", "treeShaking", "minify", "mangleProps", "reserveProps", "mangleQuoted", "mangleCache", "drop", "dropLabels", "minifyWhitespace", "minifyIdentifiers", "minifySyntax", "lineLimit", "charset", "ignoreAnnotations", "jsx", "jsxFactory", "jsxFragment", "jsxImportSource", "jsxDev", "jsxSideEffects", "pure", "keepNames", "absPaths", "color", "logLevel", "logLimit", "logOverride", "tsconfigRaw", "bundle", "splitting", "preserveSymlinks", "external", "packages", "alias", "loader", "resolveExtensions", "mainFields", "conditions", "allowOverwrite", "tsconfig", "outExtension", "publicPath", "inject", "banner", "footer", "plugins"];
7
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS;;;;CAIrB,CAAC;AAEF,eAAO,MAAM,yBAAyB,ovBA0Dc,CAAC"}
@@ -1,17 +0,0 @@
1
- export declare const errors: {
2
- "missing-input": string;
3
- "missing-dest-dir-param": string;
4
- "invalid-common-js-module": string;
5
- "config-validation-failed": string;
6
- "serwist-build-runtime-error": string;
7
- "unknown-command": string;
8
- "no-file-extensions-found": string;
9
- "no-file-extensions-selected": string;
10
- "invalid-sw-dest": string;
11
- "glob-directory-invalid": string;
12
- "invalid-config-location": string;
13
- "sw-src-missing-injection-point": string;
14
- "no-search-parameters-supplied": string;
15
- "invalid-search-parameters-supplied": string;
16
- };
17
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;CAwBlB,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const helpText = "Usage:\n$ serwist <command> [options]\n\nCommands:\n wizard\n Runs the configuration wizard, which will generate a\n config file based on answers to questions.\n\n inject-manifest [<path/to/config.js>] [--watch]\n Takes an existing service worker file and creates a\n copy of it with a precache manifest injected. The precache \n manifest is generated based on the options in the config file \n (defaults to 'serwist.config.js'). If '--watch' is provided, the \n CLI will stay running and rebuild the service worker each \n time a file in the precache manifest changes. See \n https://serwist.pages.dev/docs/cli for more information.\n\nConfiguration file:\n The 'inject-manifest' command expects the configuration \n file to be a JavaScript file. By default, it is assumed \n to be named 'serwist.config.js' and located in the current\n directory, but this can be overridden.\n\nExamples:\n $ serwist wizard\n $ serwist inject-manifest configs/serwist-config.js\n";
2
- //# sourceMappingURL=help-text.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"help-text.d.ts","sourceRoot":"","sources":["../../src/lib/help-text.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,QAAQ,4+BA0BpB,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare const logger: {
2
- debug: (...args: string[]) => void;
3
- log: (...args: string[]) => void;
4
- warn: (...args: string[]) => void;
5
- error: (...args: string[]) => void;
6
- };
7
- //# sourceMappingURL=logger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,MAAM;qBACA,MAAM,EAAE,KAAG,IAAI;mBACjB,MAAM,EAAE,KAAG,IAAI;oBACd,MAAM,EAAE,KAAG,IAAI;qBACd,MAAM,EAAE,KAAG,IAAI;CACjC,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { InjectManifestOptions } from "@serwist/build";
2
- export declare const readConfig: <T extends InjectManifestOptions = InjectManifestOptions>(configFile: string) => Promise<T>;
3
- //# sourceMappingURL=read-config.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,2 +0,0 @@
1
- export declare function runWizard(): Promise<void>;
2
- //# sourceMappingURL=run-wizard.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-wizard.d.ts","sourceRoot":"","sources":["../../src/lib/run-wizard.ts"],"names":[],"mappings":"AAaA,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAgB/C"}
@@ -1,79 +0,0 @@
1
- import z from "zod";
2
- export declare const buildPartial: z.ZodObject<{
3
- esbuildOptions: z.ZodPrefault<z.ZodRecord<z.ZodLiteral<"bundle" | "splitting" | "preserveSymlinks" | "external" | "packages" | "alias" | "loader" | "resolveExtensions" | "mainFields" | "conditions" | "allowOverwrite" | "tsconfig" | "outExtension" | "publicPath" | "inject" | "banner" | "footer" | "plugins" | "sourcemap" | "legalComments" | "sourceRoot" | "sourcesContent" | "format" | "globalName" | "target" | "supported" | "mangleProps" | "reserveProps" | "mangleQuoted" | "mangleCache" | "drop" | "dropLabels" | "minify" | "minifyWhitespace" | "minifyIdentifiers" | "minifySyntax" | "lineLimit" | "charset" | "treeShaking" | "ignoreAnnotations" | "jsx" | "jsxFactory" | "jsxFragment" | "jsxImportSource" | "jsxDev" | "jsxSideEffects" | "define" | "pure" | "keepNames" | "absPaths" | "color" | "logLevel" | "logLimit" | "logOverride" | "tsconfigRaw"> & z.z.core.$partial, z.ZodAny>>;
4
- }, z.z.core.$strict>;
5
- export declare const buildOptions: z.ZodObject<{
6
- esbuildOptions: z.ZodPrefault<z.ZodRecord<z.ZodLiteral<"bundle" | "splitting" | "preserveSymlinks" | "external" | "packages" | "alias" | "loader" | "resolveExtensions" | "mainFields" | "conditions" | "allowOverwrite" | "tsconfig" | "outExtension" | "publicPath" | "inject" | "banner" | "footer" | "plugins" | "sourcemap" | "legalComments" | "sourceRoot" | "sourcesContent" | "format" | "globalName" | "target" | "supported" | "mangleProps" | "reserveProps" | "mangleQuoted" | "mangleCache" | "drop" | "dropLabels" | "minify" | "minifyWhitespace" | "minifyIdentifiers" | "minifySyntax" | "lineLimit" | "charset" | "treeShaking" | "ignoreAnnotations" | "jsx" | "jsxFactory" | "jsxFragment" | "jsxImportSource" | "jsxDev" | "jsxSideEffects" | "define" | "pure" | "keepNames" | "absPaths" | "color" | "logLevel" | "logLimit" | "logOverride" | "tsconfigRaw"> & z.z.core.$partial, z.ZodAny>>;
7
- globDirectory: z.ZodString;
8
- swDest: z.ZodString;
9
- injectionPoint: z.ZodDefault<z.ZodString>;
10
- swSrc: z.ZodString;
11
- globFollow: z.ZodDefault<z.ZodBoolean>;
12
- globIgnores: z.ZodDefault<z.ZodArray<z.ZodString>>;
13
- globPatterns: z.ZodDefault<z.ZodArray<z.ZodString>>;
14
- globStrict: z.ZodDefault<z.ZodBoolean>;
15
- templatedURLs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
16
- additionalPrecacheEntries: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
17
- integrity: z.ZodOptional<z.ZodString>;
18
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
19
- url: z.ZodString;
20
- }, z.z.core.$strict>]>>>;
21
- disablePrecacheManifest: z.ZodDefault<z.ZodBoolean>;
22
- dontCacheBustURLsMatching: z.ZodOptional<z.ZodCustom<RegExp, RegExp>>;
23
- manifestTransforms: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodCustom<z.z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
24
- size: z.ZodNumber;
25
- integrity: z.ZodOptional<z.ZodString>;
26
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
- url: z.ZodString;
28
- }, z.z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
29
- manifest: z.ZodArray<z.ZodObject<{
30
- size: z.ZodNumber;
31
- integrity: z.ZodOptional<z.ZodString>;
32
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
- url: z.ZodString;
34
- }, z.z.core.$strip>>;
35
- warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
- }, z.z.core.$strict>>, z.z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
37
- size: z.ZodNumber;
38
- integrity: z.ZodOptional<z.ZodString>;
39
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
40
- url: z.ZodString;
41
- }, z.z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
42
- manifest: z.ZodArray<z.ZodObject<{
43
- size: z.ZodNumber;
44
- integrity: z.ZodOptional<z.ZodString>;
45
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
46
- url: z.ZodString;
47
- }, z.z.core.$strip>>;
48
- warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
49
- }, z.z.core.$strict>>>, z.ZodTransform<z.z.core.$InferOuterFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
50
- size: z.ZodNumber;
51
- integrity: z.ZodOptional<z.ZodString>;
52
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
- url: z.ZodString;
54
- }, z.z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
55
- manifest: z.ZodArray<z.ZodObject<{
56
- size: z.ZodNumber;
57
- integrity: z.ZodOptional<z.ZodString>;
58
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
59
- url: z.ZodString;
60
- }, z.z.core.$strip>>;
61
- warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
62
- }, z.z.core.$strict>>, z.z.core.$InferInnerFunctionTypeAsync<z.ZodTuple<[z.ZodArray<z.ZodObject<{
63
- size: z.ZodNumber;
64
- integrity: z.ZodOptional<z.ZodString>;
65
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
66
- url: z.ZodString;
67
- }, z.z.core.$strip>>, z.ZodOptional<z.ZodUnknown>], null>, z.ZodObject<{
68
- manifest: z.ZodArray<z.ZodObject<{
69
- size: z.ZodNumber;
70
- integrity: z.ZodOptional<z.ZodString>;
71
- revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
72
- url: z.ZodString;
73
- }, z.z.core.$strip>>;
74
- warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
75
- }, z.z.core.$strict>>>>>>;
76
- maximumFileSizeToCacheInBytes: z.ZodDefault<z.ZodNumber>;
77
- modifyURLPrefix: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
78
- }, z.z.core.$strict>;
79
- //# sourceMappingURL=schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/lib/schema.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,eAAO,MAAM,YAAY;;oBAEvB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAGvB,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { BuildOptionsComplete } from "../types.js";
2
- export declare const validateBuildOptions: (input: unknown) => Promise<BuildOptionsComplete>;
3
- //# sourceMappingURL=validation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/lib/validation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,eAAO,MAAM,oBAAoB,GAAU,OAAO,OAAO,KAAG,OAAO,CAAC,oBAAoB,CASvF,CAAC"}
package/dist/types.d.ts DELETED
@@ -1,23 +0,0 @@
1
- import type { InjectManifestOptions, InjectManifestOptionsComplete } from "@serwist/build";
2
- import type { Prettify, Require } from "@serwist/utils";
3
- import type { BuildOptions as BaseEsbuildOptions } from "esbuild";
4
- import type { Flag } from "meow";
5
- import type { SUPPORTED_ESBUILD_OPTIONS } from "./lib/constants.js";
6
- export type StringFlag = Flag<"string", string> | Flag<"string", string[], true>;
7
- export type BooleanFlag = Flag<"boolean", boolean> | Flag<"boolean", boolean[], true>;
8
- export type NumberFlag = Flag<"number", number> | Flag<"number", number[], true>;
9
- export type AnyFlag = StringFlag | BooleanFlag | NumberFlag;
10
- export type AnyFlags = Record<string, AnyFlag>;
11
- export type EsbuildSupportedOptions = (typeof SUPPORTED_ESBUILD_OPTIONS)[number];
12
- export type EsbuildOptions = Pick<BaseEsbuildOptions, EsbuildSupportedOptions>;
13
- export interface BuildPartial {
14
- /**
15
- * Options to configure the esbuild instance used to bundle
16
- * the service worker.
17
- */
18
- esbuildOptions?: EsbuildOptions;
19
- }
20
- export type BuildResolved = Require<BuildPartial, "esbuildOptions">;
21
- export type BuildOptions = Prettify<InjectManifestOptions & BuildPartial>;
22
- export type BuildOptionsComplete = Prettify<InjectManifestOptionsComplete & BuildResolved>;
23
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAEpE,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;AACjF,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,CAAC;AACtF,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;AACjF,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;AAC5D,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE/C,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,CAAC;AAE/E,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAED,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;AAEpE,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,qBAAqB,GAAG,YAAY,CAAC,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,6BAA6B,GAAG,aAAa,CAAC,CAAC"}