@serwist/cli 9.0.5 → 9.0.7

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2018 Google LLC, 2019 ShadowWalker w@weiw.io https://weiw.io, 2023 Serwist
3
+ Copyright (c) 2018-2023 Google LLC, 2019-2023 ShadowWalker w@weiw.io https://weiw.io, 2020-2023 Anthony Fu <https://github.com/antfu>, 2023-PRESENT Serwist
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/dist/app.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAC;AAIjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAyC/C,eAAO,MAAM,GAAG,WAAkB,UAAU,CAAC,cAAc,CAAC,KAAG,OAAO,CAAC,IAAI,CAiF1E,CAAC"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,MAAM,CAAC;AAGjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAyC/C,eAAO,MAAM,GAAG,WAAkB,UAAU,CAAC,cAAc,CAAC,KAAG,OAAO,CAAC,IAAI,CAiF1E,CAAC"}
package/dist/bin.js CHANGED
@@ -2,16 +2,16 @@
2
2
  import meow from 'meow';
3
3
  import updateNotifier from 'update-notifier';
4
4
  import assert from 'node:assert';
5
+ import path from 'node:path';
5
6
  import { injectManifest } from '@serwist/build';
6
7
  import chokidar from 'chokidar';
7
8
  import prettyBytes from 'pretty-bytes';
8
- import upath from 'upath';
9
9
  import { oneLine } from 'common-tags';
10
10
  import chalk from 'chalk';
11
11
  import { statSync, writeFileSync } from 'node:fs';
12
12
  import stringifyObject from 'stringify-object';
13
- import { glob } from 'glob';
14
13
  import { input, checkbox, select, Separator } from '@inquirer/prompts';
14
+ import { glob } from 'glob';
15
15
 
16
16
  const constants = {
17
17
  defaultConfigFile: "serwist.config.js",
@@ -60,6 +60,10 @@ const readConfig = async (configFile)=>{
60
60
  return (await import(configFile)).default;
61
61
  };
62
62
 
63
+ const toUnix = (p)=>{
64
+ return p.replace(/\\/g, "/").replace(/(?<!^)\/+/g, "/");
65
+ };
66
+
63
67
  const getSubdirectories = async ()=>{
64
68
  return await glob("*/", {
65
69
  ignore: constants.ignoredDirectories.map((directory)=>`${directory}/`)
@@ -117,7 +121,7 @@ const getAllFileExtensions = async (globDirectory)=>{
117
121
  });
118
122
  const extensions = new Set();
119
123
  for (const file of files){
120
- const extension = upath.extname(file);
124
+ const extension = path.extname(file);
121
125
  if (extension) {
122
126
  extensions.add(extension.replace(/^\./, ""));
123
127
  }
@@ -146,7 +150,7 @@ const askQuestions = async ()=>{
146
150
  });
147
151
  const swDest = await input({
148
152
  message: "Where would you like your service worker file to be saved?",
149
- default: upath.join(globDirectory, "sw.js"),
153
+ default: toUnix(path.join(globDirectory, "sw.js")),
150
154
  validate (input) {
151
155
  if (typeof input !== "string") {
152
156
  return "You must provide a valid 'swDest'!";
@@ -234,7 +238,7 @@ const app = async (params)=>{
234
238
  }
235
239
  case "inject-manifest":
236
240
  {
237
- const configPath = upath.resolve(process.cwd(), option || constants.defaultConfigFile);
241
+ const configPath = path.resolve(process.cwd(), option || constants.defaultConfigFile);
238
242
  let config;
239
243
  try {
240
244
  config = await readConfig(configPath);
@@ -1 +1 @@
1
- {"version":3,"file":"ask-questions.d.ts","sourceRoot":"","sources":["../../src/lib/ask-questions.ts"],"names":[],"mappings":"AAmFA,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
+ {"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serwist/cli",
3
- "version": "9.0.5",
3
+ "version": "9.0.7",
4
4
  "type": "module",
5
5
  "description": "The command line interface of Serwist.",
6
6
  "files": [
@@ -19,7 +19,10 @@
19
19
  "engines": {
20
20
  "node": ">=18.0.0"
21
21
  },
22
- "author": "Google's Web DevRel Team, Serwist's Team",
22
+ "author": "Google's Web DevRel Team",
23
+ "contributors": [
24
+ "Serwist <ducanh2912.rusty@gmail.com> (https://serwist.pages.dev/)"
25
+ ],
23
26
  "license": "MIT",
24
27
  "repository": "https://github.com/serwist/serwist",
25
28
  "bugs": "https://github.com/serwist/serwist/issues",
@@ -28,28 +31,26 @@
28
31
  "serwist": "cli.js"
29
32
  },
30
33
  "dependencies": {
31
- "@inquirer/prompts": "5.1.2",
34
+ "@inquirer/prompts": "5.3.8",
32
35
  "chalk": "5.3.0",
33
36
  "chokidar": "3.6.0",
34
37
  "common-tags": "1.8.2",
35
- "fs-extra": "11.2.0",
36
38
  "glob": "10.4.5",
37
39
  "meow": "13.2.0",
38
40
  "pretty-bytes": "6.1.1",
39
41
  "stringify-object": "5.0.0",
40
- "upath": "2.0.1",
41
- "update-notifier": "7.1.0",
42
- "@serwist/build": "9.0.5"
42
+ "update-notifier": "7.2.0",
43
+ "@serwist/build": "9.0.7"
43
44
  },
44
45
  "devDependencies": {
45
46
  "@types/common-tags": "1.8.4",
46
- "@types/fs-extra": "11.0.4",
47
47
  "@types/inquirer": "9.0.7",
48
48
  "@types/stringify-object": "4.0.5",
49
49
  "@types/update-notifier": "6.0.8",
50
- "rollup": "4.18.1",
51
- "typescript": "5.5.3",
52
- "@serwist/configs": "9.0.5"
50
+ "rollup": "4.21.0",
51
+ "typescript": "5.5.4",
52
+ "@serwist/configs": "9.0.7",
53
+ "@serwist/utils": "9.0.7"
53
54
  },
54
55
  "scripts": {
55
56
  "build": "rimraf dist && NODE_ENV=production rollup --config rollup.config.js",