create-node-lib 2.10.1 → 2.11.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # [2.11.0](https://github.com/lirantal/create-node-lib/compare/v2.10.1...v2.11.0) (2026-03-09)
2
+
3
+
4
+ ### Features
5
+
6
+ * auto set the remote properly post scaffold ([6c92b6a](https://github.com/lirantal/create-node-lib/commit/6c92b6ae8d4f47a7b1f4de5e26dd62fb82ad5abc))
7
+ * change to main branch post scaffold ([4e7c55d](https://github.com/lirantal/create-node-lib/commit/4e7c55d95db8a1dc34108b54314242a2cf0d0c57))
8
+
1
9
  ## [2.10.1](https://github.com/lirantal/create-node-lib/compare/v2.10.0...v2.10.1) (2026-03-09)
2
10
 
3
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-node-lib",
3
- "version": "2.10.1",
3
+ "version": "2.11.0",
4
4
  "description": "Scaffolding out a Node.js library module",
5
5
  "bin": "./bin/cli.js",
6
6
  "engines": {
package/saofile.js CHANGED
@@ -110,7 +110,14 @@ module.exports = {
110
110
  ]
111
111
  },
112
112
  async completed() {
113
- this.gitInit()
113
+ const spawn = require('child_process').spawnSync
114
+ spawn('git', ['init', '-b', 'main'], { cwd: this.outDir })
115
+
116
+ const repoUrl = this.answers.projectRepository
117
+ if (repoUrl) {
118
+ const remoteUrl = repoUrl.endsWith('.git') ? repoUrl : `${repoUrl}.git`
119
+ spawn('git', ['remote', 'add', 'origin', remoteUrl], { cwd: this.outDir })
120
+ }
114
121
  await this.npmInstall({ npmClient: this.answers.npmClient })
115
122
  await this.npmInstall({ npmClient: this.answers.npmClient, args: ['run', 'prepare'] })
116
123
  this.showProjectTips()