@marcuth/create-package 0.1.1 → 0.1.3

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.
Files changed (2) hide show
  1. package/bin/index.js +18 -10
  2. package/package.json +4 -1
package/bin/index.js CHANGED
@@ -50,6 +50,9 @@ function writePackageJson(root, packageName) {
50
50
  dev: "ts-node ./src/index.ts",
51
51
  format: "prettier --write \"src/**/*.ts\""
52
52
  },
53
+ publishConfig: {
54
+ access: "public"
55
+ },
53
56
  keywords: [
54
57
  "marcuth"
55
58
  ],
@@ -90,9 +93,11 @@ function writeTsConfig(root) {
90
93
  }
91
94
 
92
95
  function writeSourceFile(root, projectDir) {
93
- const content = `export function hello() {
94
- return "Hello from ${projectDir}"
96
+ const content = `function main() {
97
+ console.log("Hello from ${projectDir}")
95
98
  }
99
+
100
+ main()
96
101
  `
97
102
 
98
103
  fs.writeFileSync(
@@ -362,15 +367,18 @@ function installDevDependencies(root, deps) {
362
367
  }
363
368
 
364
369
  console.log("📦 Installing dev dependencies using", pm)
370
+ console.log("📦 Command:", pm, commands[pm].join(" "))
365
371
 
366
- const result = spawnSync(
367
- pm,
368
- commands[pm],
369
- {
370
- cwd: root,
371
- stdio: "inherit"
372
- }
373
- )
372
+ const result = spawnSync(pm, commands[pm], {
373
+ cwd: root,
374
+ stdio: "inherit",
375
+ shell: true
376
+ })
377
+
378
+ if (result.error) {
379
+ console.error("❌ Spawn error:", result.error)
380
+ process.exit(1)
381
+ }
374
382
 
375
383
  if (result.status !== 0) {
376
384
  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.1",
3
+ "version": "0.1.3",
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
  ],