@serwist/cli 9.5.10 → 9.5.11

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/bin.mjs CHANGED
@@ -247,8 +247,16 @@ Commands:
247
247
  time a file in the precache manifest changes. See
248
248
  https://serwist.pages.dev/docs/cli for more information.
249
249
 
250
+ build [<path/to/config.js>] [--watch]
251
+ Takes a service worker file and bundles it with a precache manifest
252
+ injected using esbuild. The precache manifest is generated based
253
+ on the options in the config file (defaults to 'serwist.config.js').
254
+ If '--watch' is provided, the CLI will stay running and rebuild
255
+ the service worker each time a file in the precache manifest changes.
256
+ See https://serwist.pages.dev/docs/cli for more information.
257
+
250
258
  Configuration file:
251
- The 'inject-manifest' command expects the configuration
259
+ The 'inject-manifest' and 'build' commands expect the configuration
252
260
  file to be a JavaScript file. By default, it is assumed
253
261
  to be named 'serwist.config.js' and located in the current
254
262
  directory, but this can be overridden.
@@ -256,6 +264,7 @@ Configuration file:
256
264
  Examples:
257
265
  $ serwist wizard
258
266
  $ serwist inject-manifest configs/serwist-config.js
267
+ $ serwist build configs/serwist-config.js
259
268
  `;
260
269
  //#endregion
261
270
  //#region src/bin.ts
package/dist/bin.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.mjs","names":[],"sources":["../src/lib/read-config.ts","../src/lib/ask-questions.ts","../src/lib/run-wizard.ts","../src/app.ts","../src/lib/cleanup-stack-trace.ts","../src/lib/help-text.ts","../src/bin.ts"],"sourcesContent":["/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport type { InjectManifestOptions } from \"@serwist/build\";\n\nexport const readConfig = async <T extends InjectManifestOptions = InjectManifestOptions>(configFile: string): Promise<T> => {\n return (await import(configFile)).default as T | Promise<T>;\n};\n","import assert from \"node:assert\";\nimport { statSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { checkbox, input, Separator, select } from \"@inquirer/prompts\";\nimport type { InjectManifestOptions } from \"@serwist/build\";\nimport { toUnix } from \"@serwist/utils\";\nimport { glob } from \"glob\";\nimport { constants } from \"./constants.js\";\nimport { errors } from \"./errors.js\";\n\n/**\n * @returns The subdirectories of the current\n * working directory, with hidden and ignored ones filtered out.\n */\nconst getSubdirectories = async (): Promise<string[]> => {\n return await glob(\"*/\", {\n ignore: constants.ignoredDirectories.map((directory) => `${directory}/`),\n });\n};\n\nconst askRootOfWebApp = async (): Promise<string> => {\n const subdirectories = await getSubdirectories();\n\n const { globDirectory, manualDirectoryInput } = await (async () => {\n if (subdirectories.length > 0) {\n const manualEntryChoice = \"Manually enter path\";\n const globDirectory = await select({\n message: \"What is the root of your web app (i.e. which directory do you deploy)?\",\n choices: [...subdirectories.map((dir) => ({ value: dir })), new Separator(), { value: manualEntryChoice }],\n });\n let manualDirectoryInput: string | undefined;\n if (globDirectory === manualEntryChoice) {\n manualDirectoryInput = await input({ message: \"Please enter the path to the root of your web app:\" });\n }\n return {\n globDirectory,\n manualDirectoryInput,\n };\n }\n\n const globDirectory = await input({ message: \"Please enter the path to the root of your web app:\", default: \".\" });\n\n return {\n globDirectory,\n manualDirectoryInput: undefined,\n };\n })();\n\n const stat = statSync(manualDirectoryInput || globDirectory);\n\n assert(stat.isDirectory(), errors[\"glob-directory-invalid\"]);\n\n return manualDirectoryInput || globDirectory;\n};\n\n/**\n * @param globDirectory The directory used for the root of globbing.\n * @returns The unique file extensions corresponding\n * to all of the files under globDirectory.\n */\nconst getAllFileExtensions = async (globDirectory: string) => {\n // Use a pattern to match any file that contains a '.', since that signifies\n // the presence of a file extension.\n const files: string[] = await glob(\"**/*.*\", {\n cwd: globDirectory,\n nodir: true,\n ignore: [\n ...constants.ignoredDirectories.map((directory) => `**/${directory}/**`),\n ...constants.ignoredFileExtensions.map((extension) => `**/*.${extension}`),\n ],\n });\n\n const extensions: Set<string> = new Set();\n for (const file of files) {\n const extension = path.extname(file);\n if (extension) {\n // Get rid of the leading . character.\n extensions.add(extension.replace(/^\\./, \"\"));\n }\n }\n\n return [...extensions];\n};\n\ninterface ConfigWithConfigLocation {\n config: {\n [key: string]: any;\n };\n configLocation: string;\n}\n\nexport const askQuestions = async (): Promise<ConfigWithConfigLocation> => {\n const globDirectory = await askRootOfWebApp();\n\n const fileExtensions = await getAllFileExtensions(globDirectory);\n\n assert(fileExtensions.length > 0, errors[\"no-file-extensions-found\"]);\n\n const swSrc = await input({\n message: \"Where's your existing service worker file? To be used with 'injectManifest', it should include a call to 'self.__SW_MANIFEST'\",\n validate(input) {\n if (typeof input !== \"string\") {\n return \"You must provide a valid 'swSrc'!\";\n }\n if (!statSync(input, { throwIfNoEntry: false })?.isFile()) {\n return \"'swSrc' must point to a valid file!\";\n }\n return true;\n },\n });\n\n const swDest = await input({\n message: \"Where would you like your service worker file to be saved?\",\n default: toUnix(path.join(globDirectory, \"sw.js\")),\n validate(input) {\n if (typeof input !== \"string\") {\n return \"You must provide a valid 'swDest'!\";\n }\n return true;\n },\n });\n\n const selectedExtensions = await checkbox({\n message: \"Which file types would you like to precache?\",\n choices: fileExtensions.map((ext) => ({ value: ext, checked: true })),\n validate(input) {\n if (!Array.isArray(input)) {\n return \"'selectedExtensions' is not an array. This is most likely a bug.\";\n }\n if (input.length === 0) {\n return errors[\"no-file-extensions-selected\"];\n }\n return true;\n },\n });\n\n const configLocation = await input({\n message: \"Where would you like to save these configuration options?\",\n default: constants.defaultConfigFile,\n validate(input) {\n if (typeof input !== \"string\") {\n return \"You must provide a valid location!\";\n }\n return true;\n },\n });\n\n // glob isn't happy with a single option inside of a {} group, so use a\n // pattern without a {} group when there's only one extension.\n const globPatterns = [`**/*.${selectedExtensions.length === 1 ? selectedExtensions[0] : `{${selectedExtensions.join(\",\")}}`}`];\n\n const config = {\n globDirectory,\n globPatterns,\n swSrc,\n swDest,\n } satisfies InjectManifestOptions;\n\n return {\n config,\n configLocation,\n };\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { writeFileSync } from \"node:fs\";\nimport stringifyObject from \"stringify-object\";\n\nimport { askQuestions } from \"./ask-questions.js\";\nimport { logger } from \"./logger.js\";\n\nexport async function runWizard(): Promise<void> {\n const { configLocation, config } = await askQuestions();\n\n const contents = `/** @type {import(\"@serwist/build\").InjectManifestOptions} */\\nexport default ${stringifyObject(config)};`;\n\n writeFileSync(configLocation, contents);\n\n logger.log(`To build your service worker, run\n\n serwist inject-manifest ${configLocation}\n\nas part of a build process.`);\n\n logger.log(\n `You can further customize your service worker by making changes to ${configLocation}. See https://serwist.pages.dev/docs/build/configuring for details.`,\n );\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport assert from \"node:assert\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport type { InjectManifestOptions } from \"@serwist/build\";\nimport chokidar from \"chokidar\";\nimport { glob } from \"glob\";\nimport type { Result as MeowResult } from \"meow\";\n\nimport type { SupportedFlags } from \"./bin.js\";\nimport { runBuildCommand, runInjectManifestCommand } from \"./lib/build.js\";\nimport { constants } from \"./lib/constants.js\";\nimport { errors } from \"./lib/errors.js\";\nimport { logger } from \"./lib/logger.js\";\nimport { readConfig } from \"./lib/read-config.js\";\nimport { runWizard } from \"./lib/run-wizard.js\";\nimport type { BuildOptions } from \"./types.js\";\n\nexport const app = async (params: MeowResult<SupportedFlags>): Promise<void> => {\n // This should not be a user-visible error, unless meow() messes something up.\n assert(params && Array.isArray(params.input), errors[\"missing-input\"]);\n\n // Default to showing the help message if there's no command provided.\n const [command = \"help\", option] = params.input;\n\n process.env.SERWIST_ENV = params.flags.watch ? \"watch\" : \"build\";\n\n if (!process.env.NODE_ENV) {\n process.env.NODE_ENV = params.flags.watch ? \"development\" : \"production\";\n }\n\n switch (command) {\n case \"wizard\": {\n await runWizard();\n break;\n }\n\n case \"build\": {\n const configPath = path.resolve(process.cwd(), option || constants.defaultConfigFile);\n const configUrl = pathToFileURL(configPath).href;\n\n let config: BuildOptions | null;\n try {\n config = await readConfig<BuildOptions>(configUrl);\n } catch (error) {\n config = null;\n if (error instanceof Error) {\n logger.error(errors[\"invalid-common-js-module\"]);\n throw error;\n }\n }\n\n if (config === null) {\n throw logger.error(errors[\"invalid-config-location\"]);\n }\n\n logger.log(`Using configuration from ${configPath}.`);\n\n await runBuildCommand({ config, watch: !!params.flags.watch });\n\n break;\n }\n\n case \"inject-manifest\": {\n const configPath = path.resolve(process.cwd(), option || constants.defaultConfigFile);\n const configUrl = pathToFileURL(configPath).href;\n\n let config: InjectManifestOptions | null;\n try {\n config = await readConfig(configUrl);\n } catch (error) {\n config = null;\n if (error instanceof Error) {\n logger.error(errors[\"invalid-common-js-module\"]);\n throw error;\n }\n }\n\n if (config === null) {\n throw logger.error(errors[\"invalid-config-location\"]);\n }\n\n logger.log(`Using configuration from ${configPath}.`);\n\n // Determine whether we're in --watch mode, or one-off mode.\n if (params.flags.watch) {\n if (config.globPatterns) {\n chokidar\n .watch(\n await glob(config.globPatterns, {\n cwd: config.globDirectory,\n follow: config.globFollow,\n ignore: config.globIgnores,\n }),\n {\n ignoreInitial: true,\n cwd: config.globDirectory,\n },\n )\n .on(\"all\", async () => {\n if (config === null) return;\n await runInjectManifestCommand({\n config,\n watch: true,\n });\n })\n .on(\"ready\", async () => {\n if (config === null) return;\n await runInjectManifestCommand({\n config,\n watch: true,\n });\n })\n .on(\"error\", (err) => {\n logger.error(err instanceof Error ? err.toString() : \"Unknown error\");\n });\n }\n } else {\n await runInjectManifestCommand({ config, watch: false });\n }\n break;\n }\n\n // biome-ignore lint/suspicious/noFallthroughSwitchClause: Biome.js doesn't handle functions that return `never`... yet.\n case \"help\": {\n params.showHelp();\n }\n\n default: {\n throw new Error(`${errors[\"unknown-command\"]} ${command}`);\n }\n }\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\n\n// Helper to parse out less relevant info from an Error's stack trace.\n// Removes the initial portion, since that's obtained from error.message.\n// Removes every stack frame earlier than the last instance of moduleName,\n// since that's just frames related to the Node runtime/loader.\nexport const cleanupStackTrace = (error: Error, moduleName: string): string => {\n if (!error.stack) {\n return \"\";\n }\n const frames = error.stack.split(\"\\n\");\n let startFrame: number | undefined;\n let lastFrame = 0;\n frames.forEach((frame, index) => {\n if (startFrame === undefined && frame.includes(\" at \")) {\n startFrame = index;\n }\n\n if (frame.includes(`${moduleName}:`)) {\n lastFrame = index;\n }\n });\n return frames.slice(startFrame, lastFrame + 1).join(\"\\n\");\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\n\nexport 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`;\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\n\nimport type { Result as MeowResult } from \"meow\";\nimport meow from \"meow\";\nimport updateNotifier, { type Package } from \"update-notifier\";\nimport { app } from \"./app.js\";\nimport { cleanupStackTrace } from \"./lib/cleanup-stack-trace.js\";\nimport { helpText } from \"./lib/help-text.js\";\nimport { logger } from \"./lib/logger.js\";\nimport type { AnyFlags, BooleanFlag } from \"./types.js\";\n\nexport interface SupportedFlags extends AnyFlags {\n debug: BooleanFlag;\n watch: BooleanFlag;\n}\n\nvoid (async () => {\n const params: MeowResult<any> = meow(helpText, {\n importMeta: import.meta,\n });\n\n updateNotifier({ pkg: params.pkg as Package }).notify();\n\n try {\n await app(params);\n } catch (error) {\n if (error instanceof Error) {\n // Show the full error and stack trace if we're run with --debug.\n if (params.flags.debug) {\n if (error.stack) {\n logger.error(`\\n${error.stack}`);\n }\n } else {\n logger.error(`\\n${error.message}`);\n logger.debug(`${cleanupStackTrace(error, \"app.js\")}\\n`);\n }\n }\n\n process.exit(1);\n }\n})();\n"],"mappings":";;;;;;;;;;;;;;AASA,MAAa,aAAa,OAAgE,eAAmC;AAC3H,SAAQ,MAAM,OAAO,aAAa;;;;;;;;ACIpC,MAAM,oBAAoB,YAA+B;AACvD,QAAO,MAAM,KAAK,MAAM,EACtB,QAAQ,UAAU,mBAAmB,KAAK,cAAc,GAAG,UAAU,GAAG,EACzE,CAAC;;AAGJ,MAAM,kBAAkB,YAA6B;CACnD,MAAM,iBAAiB,MAAM,mBAAmB;CAEhD,MAAM,EAAE,eAAe,yBAAyB,OAAO,YAAY;AACjE,MAAI,eAAe,SAAS,GAAG;GAC7B,MAAM,oBAAoB;GAC1B,MAAM,gBAAgB,MAAM,OAAO;IACjC,SAAS;IACT,SAAS;KAAC,GAAG,eAAe,KAAK,SAAS,EAAE,OAAO,KAAK,EAAE;KAAE,IAAI,WAAW;KAAE,EAAE,OAAO,mBAAmB;KAAC;IAC3G,CAAC;GACF,IAAI;AACJ,OAAI,kBAAkB,kBACpB,wBAAuB,MAAM,MAAM,EAAE,SAAS,sDAAsD,CAAC;AAEvG,UAAO;IACL;IACA;IACD;;AAKH,SAAO;GACL,eAAA,MAH0B,MAAM;IAAE,SAAS;IAAsD,SAAS;IAAK,CAAC;GAIhH,sBAA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S,MAAM,MAAM,MAAM,KAAK;CACtC,IAAI;CACJ,IAAI,YAAY;AAChB,QAAO,SAAS,OAAO,UAAU;AAC/B,MAAI,eAAe,KAAA,KAAa,MAAM,SAAS,UAAU,CACvD,cAAa;AAGf,MAAI,MAAM,SAAS,GAAG,WAAW,GAAG,CAClC,aAAY;GAEd;AACF,QAAO,OAAO,MAAM,YAAY,YAAY,EAAE,CAAC,KAAK,KAAK;;;;ACpB3D,MAAa,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CCclB,YAAY;CAChB,MAAM,SAA0B,KAAK,UAAU,EAC7C,YAAY,OAAO,MACpB,CAAC;AAEF,gBAAe,EAAE,KAAK,OAAO,KAAgB,CAAC,CAAC,QAAQ;AAEvD,KAAI;AACF,QAAM,IAAI,OAAO;UACV,OAAO;AACd,MAAI,iBAAiB,MAEnB,KAAI,OAAO,MAAM;OACX,MAAM,MACR,QAAO,MAAM,KAAK,MAAM,QAAQ;SAE7B;AACL,UAAO,MAAM,KAAK,MAAM,UAAU;AAClC,UAAO,MAAM,GAAG,kBAAkB,OAAO,SAAS,CAAC,IAAI;;AAI3D,UAAQ,KAAK,EAAE;;IAEf"}
1
+ {"version":3,"file":"bin.mjs","names":[],"sources":["../src/lib/read-config.ts","../src/lib/ask-questions.ts","../src/lib/run-wizard.ts","../src/app.ts","../src/lib/cleanup-stack-trace.ts","../src/lib/help-text.ts","../src/bin.ts"],"sourcesContent":["/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport type { InjectManifestOptions } from \"@serwist/build\";\n\nexport const readConfig = async <T extends InjectManifestOptions = InjectManifestOptions>(configFile: string): Promise<T> => {\n return (await import(configFile)).default as T | Promise<T>;\n};\n","import assert from \"node:assert\";\nimport { statSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { checkbox, input, Separator, select } from \"@inquirer/prompts\";\nimport type { InjectManifestOptions } from \"@serwist/build\";\nimport { toUnix } from \"@serwist/utils\";\nimport { glob } from \"glob\";\nimport { constants } from \"./constants.js\";\nimport { errors } from \"./errors.js\";\n\n/**\n * @returns The subdirectories of the current\n * working directory, with hidden and ignored ones filtered out.\n */\nconst getSubdirectories = async (): Promise<string[]> => {\n return await glob(\"*/\", {\n ignore: constants.ignoredDirectories.map((directory) => `${directory}/`),\n });\n};\n\nconst askRootOfWebApp = async (): Promise<string> => {\n const subdirectories = await getSubdirectories();\n\n const { globDirectory, manualDirectoryInput } = await (async () => {\n if (subdirectories.length > 0) {\n const manualEntryChoice = \"Manually enter path\";\n const globDirectory = await select({\n message: \"What is the root of your web app (i.e. which directory do you deploy)?\",\n choices: [...subdirectories.map((dir) => ({ value: dir })), new Separator(), { value: manualEntryChoice }],\n });\n let manualDirectoryInput: string | undefined;\n if (globDirectory === manualEntryChoice) {\n manualDirectoryInput = await input({ message: \"Please enter the path to the root of your web app:\" });\n }\n return {\n globDirectory,\n manualDirectoryInput,\n };\n }\n\n const globDirectory = await input({ message: \"Please enter the path to the root of your web app:\", default: \".\" });\n\n return {\n globDirectory,\n manualDirectoryInput: undefined,\n };\n })();\n\n const stat = statSync(manualDirectoryInput || globDirectory);\n\n assert(stat.isDirectory(), errors[\"glob-directory-invalid\"]);\n\n return manualDirectoryInput || globDirectory;\n};\n\n/**\n * @param globDirectory The directory used for the root of globbing.\n * @returns The unique file extensions corresponding\n * to all of the files under globDirectory.\n */\nconst getAllFileExtensions = async (globDirectory: string) => {\n // Use a pattern to match any file that contains a '.', since that signifies\n // the presence of a file extension.\n const files: string[] = await glob(\"**/*.*\", {\n cwd: globDirectory,\n nodir: true,\n ignore: [\n ...constants.ignoredDirectories.map((directory) => `**/${directory}/**`),\n ...constants.ignoredFileExtensions.map((extension) => `**/*.${extension}`),\n ],\n });\n\n const extensions: Set<string> = new Set();\n for (const file of files) {\n const extension = path.extname(file);\n if (extension) {\n // Get rid of the leading . character.\n extensions.add(extension.replace(/^\\./, \"\"));\n }\n }\n\n return [...extensions];\n};\n\ninterface ConfigWithConfigLocation {\n config: {\n [key: string]: any;\n };\n configLocation: string;\n}\n\nexport const askQuestions = async (): Promise<ConfigWithConfigLocation> => {\n const globDirectory = await askRootOfWebApp();\n\n const fileExtensions = await getAllFileExtensions(globDirectory);\n\n assert(fileExtensions.length > 0, errors[\"no-file-extensions-found\"]);\n\n const swSrc = await input({\n message: \"Where's your existing service worker file? To be used with 'injectManifest', it should include a call to 'self.__SW_MANIFEST'\",\n validate(input) {\n if (typeof input !== \"string\") {\n return \"You must provide a valid 'swSrc'!\";\n }\n if (!statSync(input, { throwIfNoEntry: false })?.isFile()) {\n return \"'swSrc' must point to a valid file!\";\n }\n return true;\n },\n });\n\n const swDest = await input({\n message: \"Where would you like your service worker file to be saved?\",\n default: toUnix(path.join(globDirectory, \"sw.js\")),\n validate(input) {\n if (typeof input !== \"string\") {\n return \"You must provide a valid 'swDest'!\";\n }\n return true;\n },\n });\n\n const selectedExtensions = await checkbox({\n message: \"Which file types would you like to precache?\",\n choices: fileExtensions.map((ext) => ({ value: ext, checked: true })),\n validate(input) {\n if (!Array.isArray(input)) {\n return \"'selectedExtensions' is not an array. This is most likely a bug.\";\n }\n if (input.length === 0) {\n return errors[\"no-file-extensions-selected\"];\n }\n return true;\n },\n });\n\n const configLocation = await input({\n message: \"Where would you like to save these configuration options?\",\n default: constants.defaultConfigFile,\n validate(input) {\n if (typeof input !== \"string\") {\n return \"You must provide a valid location!\";\n }\n return true;\n },\n });\n\n // glob isn't happy with a single option inside of a {} group, so use a\n // pattern without a {} group when there's only one extension.\n const globPatterns = [`**/*.${selectedExtensions.length === 1 ? selectedExtensions[0] : `{${selectedExtensions.join(\",\")}}`}`];\n\n const config = {\n globDirectory,\n globPatterns,\n swSrc,\n swDest,\n } satisfies InjectManifestOptions;\n\n return {\n config,\n configLocation,\n };\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { writeFileSync } from \"node:fs\";\nimport stringifyObject from \"stringify-object\";\n\nimport { askQuestions } from \"./ask-questions.js\";\nimport { logger } from \"./logger.js\";\n\nexport async function runWizard(): Promise<void> {\n const { configLocation, config } = await askQuestions();\n\n const contents = `/** @type {import(\"@serwist/build\").InjectManifestOptions} */\\nexport default ${stringifyObject(config)};`;\n\n writeFileSync(configLocation, contents);\n\n logger.log(`To build your service worker, run\n\n serwist inject-manifest ${configLocation}\n\nas part of a build process.`);\n\n logger.log(\n `You can further customize your service worker by making changes to ${configLocation}. See https://serwist.pages.dev/docs/build/configuring for details.`,\n );\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport assert from \"node:assert\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport type { InjectManifestOptions } from \"@serwist/build\";\nimport chokidar from \"chokidar\";\nimport { glob } from \"glob\";\nimport type { Result as MeowResult } from \"meow\";\n\nimport type { SupportedFlags } from \"./bin.js\";\nimport { runBuildCommand, runInjectManifestCommand } from \"./lib/build.js\";\nimport { constants } from \"./lib/constants.js\";\nimport { errors } from \"./lib/errors.js\";\nimport { logger } from \"./lib/logger.js\";\nimport { readConfig } from \"./lib/read-config.js\";\nimport { runWizard } from \"./lib/run-wizard.js\";\nimport type { BuildOptions } from \"./types.js\";\n\nexport const app = async (params: MeowResult<SupportedFlags>): Promise<void> => {\n // This should not be a user-visible error, unless meow() messes something up.\n assert(params && Array.isArray(params.input), errors[\"missing-input\"]);\n\n // Default to showing the help message if there's no command provided.\n const [command = \"help\", option] = params.input;\n\n process.env.SERWIST_ENV = params.flags.watch ? \"watch\" : \"build\";\n\n if (!process.env.NODE_ENV) {\n process.env.NODE_ENV = params.flags.watch ? \"development\" : \"production\";\n }\n\n switch (command) {\n case \"wizard\": {\n await runWizard();\n break;\n }\n\n case \"build\": {\n const configPath = path.resolve(process.cwd(), option || constants.defaultConfigFile);\n const configUrl = pathToFileURL(configPath).href;\n\n let config: BuildOptions | null;\n try {\n config = await readConfig<BuildOptions>(configUrl);\n } catch (error) {\n config = null;\n if (error instanceof Error) {\n logger.error(errors[\"invalid-common-js-module\"]);\n throw error;\n }\n }\n\n if (config === null) {\n throw logger.error(errors[\"invalid-config-location\"]);\n }\n\n logger.log(`Using configuration from ${configPath}.`);\n\n await runBuildCommand({ config, watch: !!params.flags.watch });\n\n break;\n }\n\n case \"inject-manifest\": {\n const configPath = path.resolve(process.cwd(), option || constants.defaultConfigFile);\n const configUrl = pathToFileURL(configPath).href;\n\n let config: InjectManifestOptions | null;\n try {\n config = await readConfig(configUrl);\n } catch (error) {\n config = null;\n if (error instanceof Error) {\n logger.error(errors[\"invalid-common-js-module\"]);\n throw error;\n }\n }\n\n if (config === null) {\n throw logger.error(errors[\"invalid-config-location\"]);\n }\n\n logger.log(`Using configuration from ${configPath}.`);\n\n // Determine whether we're in --watch mode, or one-off mode.\n if (params.flags.watch) {\n if (config.globPatterns) {\n chokidar\n .watch(\n await glob(config.globPatterns, {\n cwd: config.globDirectory,\n follow: config.globFollow,\n ignore: config.globIgnores,\n }),\n {\n ignoreInitial: true,\n cwd: config.globDirectory,\n },\n )\n .on(\"all\", async () => {\n if (config === null) return;\n await runInjectManifestCommand({\n config,\n watch: true,\n });\n })\n .on(\"ready\", async () => {\n if (config === null) return;\n await runInjectManifestCommand({\n config,\n watch: true,\n });\n })\n .on(\"error\", (err) => {\n logger.error(err instanceof Error ? err.toString() : \"Unknown error\");\n });\n }\n } else {\n await runInjectManifestCommand({ config, watch: false });\n }\n break;\n }\n\n // biome-ignore lint/suspicious/noFallthroughSwitchClause: Biome.js doesn't handle functions that return `never`... yet.\n case \"help\": {\n params.showHelp();\n }\n\n default: {\n throw new Error(`${errors[\"unknown-command\"]} ${command}`);\n }\n }\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\n\n// Helper to parse out less relevant info from an Error's stack trace.\n// Removes the initial portion, since that's obtained from error.message.\n// Removes every stack frame earlier than the last instance of moduleName,\n// since that's just frames related to the Node runtime/loader.\nexport const cleanupStackTrace = (error: Error, moduleName: string): string => {\n if (!error.stack) {\n return \"\";\n }\n const frames = error.stack.split(\"\\n\");\n let startFrame: number | undefined;\n let lastFrame = 0;\n frames.forEach((frame, index) => {\n if (startFrame === undefined && frame.includes(\" at \")) {\n startFrame = index;\n }\n\n if (frame.includes(`${moduleName}:`)) {\n lastFrame = index;\n }\n });\n return frames.slice(startFrame, lastFrame + 1).join(\"\\n\");\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\n\nexport 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\n build [<path/to/config.js>] [--watch]\n Takes a service worker file and bundles it with a precache manifest\n injected using esbuild. The precache manifest is generated based\n on the options in the config file (defaults to 'serwist.config.js').\n If '--watch' is provided, the CLI will stay running and rebuild\n the service worker each time a file in the precache manifest changes.\n See https://serwist.pages.dev/docs/cli for more information.\n\nConfiguration file:\n The 'inject-manifest' and 'build' commands expect 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 $ serwist build configs/serwist-config.js\n`;\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\n\nimport type { Result as MeowResult } from \"meow\";\nimport meow from \"meow\";\nimport updateNotifier, { type Package } from \"update-notifier\";\nimport { app } from \"./app.js\";\nimport { cleanupStackTrace } from \"./lib/cleanup-stack-trace.js\";\nimport { helpText } from \"./lib/help-text.js\";\nimport { logger } from \"./lib/logger.js\";\nimport type { AnyFlags, BooleanFlag } from \"./types.js\";\n\nexport interface SupportedFlags extends AnyFlags {\n debug: BooleanFlag;\n watch: BooleanFlag;\n}\n\nvoid (async () => {\n const params: MeowResult<any> = meow(helpText, {\n importMeta: import.meta,\n });\n\n updateNotifier({ pkg: params.pkg as Package }).notify();\n\n try {\n await app(params);\n } catch (error) {\n if (error instanceof Error) {\n // Show the full error and stack trace if we're run with --debug.\n if (params.flags.debug) {\n if (error.stack) {\n logger.error(`\\n${error.stack}`);\n }\n } else {\n logger.error(`\\n${error.message}`);\n logger.debug(`${cleanupStackTrace(error, \"app.js\")}\\n`);\n }\n }\n\n process.exit(1);\n }\n})();\n"],"mappings":";;;;;;;;;;;;;;AASA,MAAa,aAAa,OAAgE,eAAmC;AAC3H,SAAQ,MAAM,OAAO,aAAa;;;;;;;;ACIpC,MAAM,oBAAoB,YAA+B;AACvD,QAAO,MAAM,KAAK,MAAM,EACtB,QAAQ,UAAU,mBAAmB,KAAK,cAAc,GAAG,UAAU,GAAG,EACzE,CAAC;;AAGJ,MAAM,kBAAkB,YAA6B;CACnD,MAAM,iBAAiB,MAAM,mBAAmB;CAEhD,MAAM,EAAE,eAAe,yBAAyB,OAAO,YAAY;AACjE,MAAI,eAAe,SAAS,GAAG;GAC7B,MAAM,oBAAoB;GAC1B,MAAM,gBAAgB,MAAM,OAAO;IACjC,SAAS;IACT,SAAS;KAAC,GAAG,eAAe,KAAK,SAAS,EAAE,OAAO,KAAK,EAAE;KAAE,IAAI,WAAW;KAAE,EAAE,OAAO,mBAAmB;KAAC;IAC3G,CAAC;GACF,IAAI;AACJ,OAAI,kBAAkB,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H,QAAO,UAAU;EAGnB,QACE,OAAM,IAAI,MAAM,GAAG,OAAO,mBAAmB,GAAG,UAAU;;;;;AC3HhE,MAAa,qBAAqB,OAAc,eAA+B;AAC7E,KAAI,CAAC,MAAM,MACT,QAAO;CAET,MAAM,SAAS,MAAM,MAAM,MAAM,KAAK;CACtC,IAAI;CACJ,IAAI,YAAY;AAChB,QAAO,SAAS,OAAO,UAAU;AAC/B,MAAI,eAAe,KAAA,KAAa,MAAM,SAAS,UAAU,CACvD,cAAa;AAGf,MAAI,MAAM,SAAS,GAAG,WAAW,GAAG,CAClC,aAAY;GAEd;AACF,QAAO,OAAO,MAAM,YAAY,YAAY,EAAE,CAAC,KAAK,KAAK;;;;ACpB3D,MAAa,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CCclB,YAAY;CAChB,MAAM,SAA0B,KAAK,UAAU,EAC7C,YAAY,OAAO,MACpB,CAAC;AAEF,gBAAe,EAAE,KAAK,OAAO,KAAgB,CAAC,CAAC,QAAQ;AAEvD,KAAI;AACF,QAAM,IAAI,OAAO;UACV,OAAO;AACd,MAAI,iBAAiB,MAEnB,KAAI,OAAO,MAAM;OACX,MAAM,MACR,QAAO,MAAM,KAAK,MAAM,QAAQ;SAE7B;AACL,UAAO,MAAM,KAAK,MAAM,UAAU;AAClC,UAAO,MAAM,GAAG,kBAAkB,OAAO,SAAS,CAAC,IAAI;;AAI3D,UAAQ,KAAK,EAAE;;IAEf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serwist/cli",
3
- "version": "9.5.10",
3
+ "version": "9.5.11",
4
4
  "type": "module",
5
5
  "description": "The command line interface of Serwist.",
6
6
  "files": [
@@ -61,8 +61,8 @@
61
61
  "stringify-object": "6.0.0",
62
62
  "update-notifier": "7.3.1",
63
63
  "zod": "4.4.1",
64
- "@serwist/build": "9.5.10",
65
- "@serwist/utils": "9.5.10"
64
+ "@serwist/build": "9.5.11",
65
+ "@serwist/utils": "9.5.11"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/common-tags": "1.8.4",