swpp-backends 3.1.1 → 3.1.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/cli-index.js CHANGED
File without changes
@@ -168,8 +168,9 @@ class BasicActions {
168
168
  throw new untils_1.RuntimeException(untils_1.exceptionNames.fileDuplicate, `指定文件[${item.path.absPath}]已存在`);
169
169
  }
170
170
  }
171
- await Promise.all(fileList.map(it => {
172
- it.path.mkdirs().then(() => untils_1.utils.writeFile(it.path.absPath, it.content));
171
+ await Promise.all(fileList.map(async (it) => {
172
+ await it.path.mkdirs();
173
+ await untils_1.utils.writeFile(it.path.absPath, it.content);
173
174
  }));
174
175
  }
175
176
  }
package/dist/swpp/cli.js CHANGED
@@ -94,7 +94,7 @@ async function runBuild(cliJsonPath = './swpp.cli.json', context) {
94
94
  context,
95
95
  publicPath: cliConfig.webRoot,
96
96
  isServiceWorker: cliConfig.serviceWorker ?? true,
97
- domJsPath: cliConfig.gen_dom ? undefined : cliConfig.domJsPath,
97
+ domJsPath: cliConfig.gen_dom ? cliConfig.domJsPath : undefined,
98
98
  diffJsonPath: cliConfig.diffJsonPath
99
99
  });
100
100
  await actions.loadConfigs(Array.isArray(cliConfig.configFiles) ? cliConfig.configFiles : [cliConfig.configFiles]);
@@ -52,12 +52,12 @@ class KeyValueDatabase {
52
52
  let value = item.manual ?? item.default;
53
53
  let isNoCache = false;
54
54
  if (SpecialConfig_1.SpecialConfig.isRuntimeSpecialConfig(value)) {
55
- this.runtime.debugCallChain.push(this.namespace, key);
56
- value = value.get(this.runtime, this.compilation);
57
- this.runtime.debugCallChain.pop(this.namespace, key);
58
55
  if (SpecialConfig_1.SpecialConfig.isNoCacheConfig(value)) {
59
56
  isNoCache = true;
60
57
  }
58
+ this.runtime.debugCallChain.push(this.namespace, key);
59
+ value = value.get(this.runtime, this.compilation);
60
+ this.runtime.debugCallChain.pop(this.namespace, key);
61
61
  }
62
62
  // 进行类型预检
63
63
  if (!(item.default === null || item.default === undefined || value === null || value === undefined) && typeof value != typeof item.default) {
package/package.json CHANGED
@@ -1,35 +1,37 @@
1
- {
2
- "name": "swpp-backends",
3
- "version": "3.1.1",
4
- "main": "dist/index.js",
5
- "typings": "dist/index.d.ts",
6
- "description": "Generate a powerful ServiceWorker for your website.",
7
- "author": "kmar",
8
- "license": "AGPL-3.0",
9
- "files": [
10
- "dist",
11
- "types"
12
- ],
13
- "bin": {
14
- "swpp-cli": "dist/cli-index.js"
15
- },
16
- "devDependencies": {
17
- "@types/node": "^22.9.3",
18
- "typescript": "^5.7.2"
19
- },
20
- "dependencies": {
21
- "commander": "^12.1.0",
22
- "jiti": "^2.4.2",
23
- "node-html-parser": "^7.0.1"
24
- },
25
- "repository": {
26
- "type": "git",
27
- "url": "git+ssh://git@github.com/EmptyDreams/swpp-backends.git"
28
- },
29
- "homepage": "https://swpp.kmar.top/",
30
- "keywords": [
31
- "ServiceWorker",
32
- "sw"
33
- ],
34
- "scripts": {}
1
+ {
2
+ "name": "swpp-backends",
3
+ "version": "3.1.2",
4
+ "main": "dist/index.js",
5
+ "typings": "dist/index.d.ts",
6
+ "scripts": {
7
+ "prepublishOnly": "tsc"
8
+ },
9
+ "description": "Generate a powerful ServiceWorker for your website.",
10
+ "author": "kmar",
11
+ "license": "AGPL-3.0",
12
+ "files": [
13
+ "dist",
14
+ "types"
15
+ ],
16
+ "bin": {
17
+ "swpp-cli": "dist/cli-index.js"
18
+ },
19
+ "devDependencies": {
20
+ "@types/node": "^22.9.3",
21
+ "typescript": "^5.7.2"
22
+ },
23
+ "dependencies": {
24
+ "commander": "^12.1.0",
25
+ "jiti": "^2.4.2",
26
+ "node-html-parser": "^7.0.1"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+ssh://git@github.com/EmptyDreams/swpp-backends.git"
31
+ },
32
+ "homepage": "https://swpp.kmar.top/",
33
+ "keywords": [
34
+ "ServiceWorker",
35
+ "sw"
36
+ ]
35
37
  }