@marcuth/create-package 0.1.1 → 0.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/bin/index.js +15 -10
- package/package.json +4 -1
package/bin/index.js
CHANGED
|
@@ -90,9 +90,11 @@ function writeTsConfig(root) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function writeSourceFile(root, projectDir) {
|
|
93
|
-
const content = `
|
|
94
|
-
|
|
93
|
+
const content = `function main() {
|
|
94
|
+
console.log("Hello from ${projectDir}")
|
|
95
95
|
}
|
|
96
|
+
|
|
97
|
+
main()
|
|
96
98
|
`
|
|
97
99
|
|
|
98
100
|
fs.writeFileSync(
|
|
@@ -362,15 +364,18 @@ function installDevDependencies(root, deps) {
|
|
|
362
364
|
}
|
|
363
365
|
|
|
364
366
|
console.log("📦 Installing dev dependencies using", pm)
|
|
367
|
+
console.log("📦 Command:", pm, commands[pm].join(" "))
|
|
365
368
|
|
|
366
|
-
const result = spawnSync(
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
369
|
+
const result = spawnSync(pm, commands[pm], {
|
|
370
|
+
cwd: root,
|
|
371
|
+
stdio: "inherit",
|
|
372
|
+
shell: true
|
|
373
|
+
})
|
|
374
|
+
|
|
375
|
+
if (result.error) {
|
|
376
|
+
console.error("❌ Spawn error:", result.error)
|
|
377
|
+
process.exit(1)
|
|
378
|
+
}
|
|
374
379
|
|
|
375
380
|
if (result.status !== 0) {
|
|
376
381
|
console.error("❌ Failed to install dev dependencies")
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marcuth/create-package",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Create a new package",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
8
|
"create-package": "./bin/index.js"
|
|
9
9
|
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"playground": "node ./bin/index.js playground/debug_test"
|
|
12
|
+
},
|
|
10
13
|
"keywords": [
|
|
11
14
|
"package generator"
|
|
12
15
|
],
|