@serwist/cli 9.1.0-preview.0 → 10.0.0-preview.1
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.js +2 -7
- package/package.json +9 -9
package/dist/bin.js
CHANGED
|
@@ -12,6 +12,7 @@ import chalk from 'chalk';
|
|
|
12
12
|
import { statSync, writeFileSync } from 'node:fs';
|
|
13
13
|
import stringifyObject from 'stringify-object';
|
|
14
14
|
import { input, checkbox, select, Separator } from '@inquirer/prompts';
|
|
15
|
+
import { toUnix } from '@serwist/utils';
|
|
15
16
|
|
|
16
17
|
const constants = {
|
|
17
18
|
defaultConfigFile: "serwist.config.js",
|
|
@@ -29,8 +30,6 @@ const errors = {
|
|
|
29
30
|
the libraries will be copied.`,
|
|
30
31
|
"invalid-common-js-module": oneLine`Please pass in a valid CommonJS module that
|
|
31
32
|
exports your configuration.`,
|
|
32
|
-
"config-validation-failed": "Your configuration is invalid:",
|
|
33
|
-
"serwist-build-runtime-error": "Service worker generation failed:",
|
|
34
33
|
"unknown-command": "Unknown command:",
|
|
35
34
|
"no-file-extensions-found": oneLine`No files could be found that are suitable for
|
|
36
35
|
caching.`,
|
|
@@ -60,10 +59,6 @@ const readConfig = async (configFile)=>{
|
|
|
60
59
|
return (await import(configFile)).default;
|
|
61
60
|
};
|
|
62
61
|
|
|
63
|
-
const toUnix = (p)=>{
|
|
64
|
-
return p.replace(/\\/g, "/").replace(/(?<!^)\/+/g, "/");
|
|
65
|
-
};
|
|
66
|
-
|
|
67
62
|
const getSubdirectories = async ()=>{
|
|
68
63
|
return await glob("*/", {
|
|
69
64
|
ignore: constants.ignoredDirectories.map((directory)=>`${directory}/`)
|
|
@@ -275,7 +270,7 @@ const app = async (params)=>{
|
|
|
275
270
|
watch: true
|
|
276
271
|
});
|
|
277
272
|
}).on("error", (err)=>{
|
|
278
|
-
logger.error(err.toString());
|
|
273
|
+
logger.error(err instanceof Error ? err.toString() : "Unknown error");
|
|
279
274
|
});
|
|
280
275
|
}
|
|
281
276
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0-preview.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The command line interface of Serwist.",
|
|
6
6
|
"files": [
|
|
@@ -31,26 +31,26 @@
|
|
|
31
31
|
"serwist": "cli.js"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@inquirer/prompts": "7.
|
|
35
|
-
"chalk": "5.
|
|
36
|
-
"chokidar": "4.0.
|
|
34
|
+
"@inquirer/prompts": "7.3.2",
|
|
35
|
+
"chalk": "5.4.1",
|
|
36
|
+
"chokidar": "4.0.3",
|
|
37
37
|
"common-tags": "1.8.2",
|
|
38
38
|
"glob": "10.4.5",
|
|
39
39
|
"meow": "13.2.0",
|
|
40
40
|
"pretty-bytes": "6.1.1",
|
|
41
41
|
"stringify-object": "5.0.0",
|
|
42
42
|
"update-notifier": "7.3.1",
|
|
43
|
-
"@serwist/build": "
|
|
43
|
+
"@serwist/build": "10.0.0-preview.1",
|
|
44
|
+
"@serwist/utils": "10.0.0-preview.1"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@types/common-tags": "1.8.4",
|
|
47
48
|
"@types/inquirer": "9.0.7",
|
|
48
49
|
"@types/stringify-object": "4.0.5",
|
|
49
50
|
"@types/update-notifier": "6.0.8",
|
|
50
|
-
"rollup": "4.
|
|
51
|
-
"typescript": "5.
|
|
52
|
-
"@serwist/configs": "
|
|
53
|
-
"@serwist/utils": "9.1.0-preview.0"
|
|
51
|
+
"rollup": "4.34.8",
|
|
52
|
+
"typescript": "5.7.3",
|
|
53
|
+
"@serwist/configs": "10.0.0-preview.1"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "rimraf dist && NODE_ENV=production rollup --config rollup.config.js",
|