create-pubinfo 2.0.0-beta.21 → 2.0.0-beta.22
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/index.cjs +4 -3
- package/dist/index.js +5 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -30,7 +30,7 @@ var import_consola6 = __toESM(require("consola"), 1);
|
|
|
30
30
|
var package_default = {
|
|
31
31
|
name: "create-pubinfo",
|
|
32
32
|
type: "module",
|
|
33
|
-
version: "2.0.0-beta.
|
|
33
|
+
version: "2.0.0-beta.22",
|
|
34
34
|
description: "\u521D\u59CB\u5316\u9879\u76EE\u6846\u67B6",
|
|
35
35
|
author: "Werheng <werheng.zhang@gmail.com>",
|
|
36
36
|
license: "MIT",
|
|
@@ -137,12 +137,13 @@ function validateInput(input2) {
|
|
|
137
137
|
var import_meta = {};
|
|
138
138
|
function generate(options, version) {
|
|
139
139
|
const root = (0, import_node_process.cwd)();
|
|
140
|
-
const
|
|
140
|
+
const __dirname = (0, import_node_path2.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
141
141
|
const templateDir = (0, import_node_path2.resolve)(
|
|
142
|
-
|
|
142
|
+
__dirname,
|
|
143
143
|
"../../templates",
|
|
144
144
|
`pubinfo-template`
|
|
145
145
|
);
|
|
146
|
+
const targetPath = (0, import_node_path2.resolve)(root, options.dir);
|
|
146
147
|
copy(templateDir, targetPath);
|
|
147
148
|
rewriteFile((0, import_node_path2.resolve)(targetPath, "src/settings.ts"), (content) => {
|
|
148
149
|
return content.replace(/storagePrefix:\s*'([^']*)'/g, `storagePrefix: '${options.key}'`);
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import consola6 from "consola";
|
|
|
8
8
|
var package_default = {
|
|
9
9
|
name: "create-pubinfo",
|
|
10
10
|
type: "module",
|
|
11
|
-
version: "2.0.0-beta.
|
|
11
|
+
version: "2.0.0-beta.22",
|
|
12
12
|
description: "\u521D\u59CB\u5316\u9879\u76EE\u6846\u67B6",
|
|
13
13
|
author: "Werheng <werheng.zhang@gmail.com>",
|
|
14
14
|
license: "MIT",
|
|
@@ -46,7 +46,7 @@ var package_default = {
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
// src/core/generate.ts
|
|
49
|
-
import { resolve as resolve2 } from "node:path";
|
|
49
|
+
import { dirname, resolve as resolve2 } from "node:path";
|
|
50
50
|
import { cwd } from "node:process";
|
|
51
51
|
import { fileURLToPath } from "node:url";
|
|
52
52
|
|
|
@@ -114,12 +114,13 @@ function validateInput(input2) {
|
|
|
114
114
|
// src/core/generate.ts
|
|
115
115
|
function generate(options, version) {
|
|
116
116
|
const root = cwd();
|
|
117
|
-
const
|
|
117
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
118
118
|
const templateDir = resolve2(
|
|
119
|
-
|
|
119
|
+
__dirname,
|
|
120
120
|
"../../templates",
|
|
121
121
|
`pubinfo-template`
|
|
122
122
|
);
|
|
123
|
+
const targetPath = resolve2(root, options.dir);
|
|
123
124
|
copy(templateDir, targetPath);
|
|
124
125
|
rewriteFile(resolve2(targetPath, "src/settings.ts"), (content) => {
|
|
125
126
|
return content.replace(/storagePrefix:\s*'([^']*)'/g, `storagePrefix: '${options.key}'`);
|