create-jwn-js 1.1.2 → 1.1.4
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/index.mjs +3 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -18,6 +18,7 @@ import json5 from "json5";
|
|
|
18
18
|
// red
|
|
19
19
|
// } = require('kolorist')
|
|
20
20
|
import {yellow, blue, red} from "kolorist";
|
|
21
|
+
const __dirname = import.meta.dirname;
|
|
21
22
|
const cwd = process.cwd()
|
|
22
23
|
const FRAMEWORKS = [
|
|
23
24
|
{
|
|
@@ -192,7 +193,7 @@ async function init() {
|
|
|
192
193
|
|
|
193
194
|
// connect.json
|
|
194
195
|
if(fs.existsSync(path.join(templateDir, `connect-template.json`))) {
|
|
195
|
-
const connect =
|
|
196
|
+
const connect = json5.parse(fs.readFileSync(path.join(templateDir, `connect-template.json`)).toString());
|
|
196
197
|
write('connect.json', JSON.stringify(connect, null, 2));
|
|
197
198
|
}
|
|
198
199
|
|
|
@@ -203,7 +204,7 @@ async function init() {
|
|
|
203
204
|
}
|
|
204
205
|
|
|
205
206
|
// package.json
|
|
206
|
-
const pkg =
|
|
207
|
+
const pkg = json5.parse(fs.readFileSync(path.join(templateDir, `package.json`)).toString());
|
|
207
208
|
|
|
208
209
|
pkg.name = packageName || targetDir
|
|
209
210
|
|