npm-init2 3.0.1 → 3.0.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.
- package/CHANGELOG.md +23 -0
- package/lib/initWithPreserveDeps.d.ts +0 -1
- package/lib/initWithPreserveDeps.js +1 -2
- package/lib/initWithPreserveDeps.js.map +1 -1
- package/lib/writeReadme.js +1 -2
- package/lib/writeReadme.js.map +1 -1
- package/lib/yargs-setting.js +1 -2
- package/lib/yargs-setting.js.map +1 -1
- package/package.json +20 -20
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,29 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.0.3](https://github.com/bluelovers/ws-yarn-workspaces/compare/npm-init2@3.0.2...npm-init2@3.0.3) (2024-05-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package npm-init2
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.0.2](https://github.com/bluelovers/ws-yarn-workspaces/compare/npm-init2@3.0.1...npm-init2@3.0.2) (2024-05-03)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### 🛠 Build System
|
|
19
|
+
|
|
20
|
+
* update typescript ([ffa656a](https://github.com/bluelovers/ws-yarn-workspaces/commit/ffa656aefe53966db445d52234eb0efe4651e3dd))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### 📌 Dependencies
|
|
24
|
+
|
|
25
|
+
* update deps ([f731d88](https://github.com/bluelovers/ws-yarn-workspaces/commit/f731d88db6e63d180e2db2e493beb42e84eb8e16))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
## [3.0.1](https://github.com/bluelovers/ws-yarn-workspaces/compare/npm-init2@3.0.0...npm-init2@3.0.1) (2024-02-28)
|
|
7
30
|
|
|
8
31
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initWithPreserveDeps =
|
|
3
|
+
exports.initWithPreserveDeps = initWithPreserveDeps;
|
|
4
4
|
const cross_spawn_extra_1 = require("cross-spawn-extra");
|
|
5
5
|
const npm_package_json_loader_1 = require("npm-package-json-loader");
|
|
6
6
|
function initWithPreserveDeps({ npmClient, cwd, args, old_pkg, pkg_file_path }) {
|
|
@@ -22,6 +22,5 @@ function initWithPreserveDeps({ npmClient, cwd, args, old_pkg, pkg_file_path })
|
|
|
22
22
|
}
|
|
23
23
|
return { cp };
|
|
24
24
|
}
|
|
25
|
-
exports.initWithPreserveDeps = initWithPreserveDeps;
|
|
26
25
|
exports.default = initWithPreserveDeps;
|
|
27
26
|
//# sourceMappingURL=initWithPreserveDeps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initWithPreserveDeps.js","sourceRoot":"","sources":["initWithPreserveDeps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initWithPreserveDeps.js","sourceRoot":"","sources":["initWithPreserveDeps.ts"],"names":[],"mappings":";;AAIA,oDAqCC;AAzCD,yDAAyC;AAEzC,qEAA4D;AAE5D,SAAgB,oBAAoB,CAAC,EACpC,SAAS,EACT,GAAG,EACH,IAAI,EACJ,OAAO,EACP,aAAa,EAOb;IAEA,MAAM,EAAE,GAAG,IAAA,wBAAI,EAAC,SAAS,EAAE,IAAI,EAAE;QAChC,KAAK,EAAE,SAAS;QAChB,GAAG;QACH,GAAG,EAAE;YACJ,WAAW,EAAE,GAAG;YAChB,QAAQ,EAAE,GAAG;SACb;KACD,CAAC,CAAC;IAEH,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,OAAO,EACxB,CAAC;QACA,IAAI,GAAG,GAAG,IAAI,2CAAiB,CAAC,aAAa,CAAC,CAAC;QAE/C,IAAI,GAAG,CAAC,MAAM,EAAE,EAChB,CAAC;YACA,GAAG,CAAC,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;YAC7C,GAAG,CAAC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;YAEnD,GAAG,CAAC,mBAAmB,EAAE,CAAC;QAC3B,CAAC;IACF,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,CAAA;AACd,CAAC;AAED,kBAAe,oBAAoB,CAAA","sourcesContent":["import { sync } from 'cross-spawn-extra';\nimport { IPackageJson } from '@ts-type/package-dts';\nimport { PackageJsonLoader } from 'npm-package-json-loader';\n\nexport function initWithPreserveDeps({\n\tnpmClient,\n\tcwd,\n\targs,\n\told_pkg,\n\tpkg_file_path\n}: {\n\tnpmClient: string,\n\tcwd: string,\n\targs: string[],\n\told_pkg: IPackageJson,\n\tpkg_file_path: string,\n})\n{\n\tconst cp = sync(npmClient, args, {\n\t\tstdio: 'inherit',\n\t\tcwd,\n\t\tenv: {\n\t\t\tFORCE_COLOR: \"0\",\n\t\t\tNO_COLOR: \"1\",\n\t\t}\n\t});\n\n\tif (!cp.error && old_pkg)\n\t{\n\t\tlet pkg = new PackageJsonLoader(pkg_file_path);\n\n\t\tif (pkg.exists())\n\t\t{\n\t\t\tpkg.data.dependencies = old_pkg.dependencies;\n\t\t\tpkg.data.devDependencies = old_pkg.devDependencies;\n\n\t\t\tpkg.writeOnlyWhenLoaded();\n\t\t}\n\t}\n\n\treturn { cp }\n}\n\nexport default initWithPreserveDeps\n"]}
|
package/lib/writeReadme.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.writeReadme =
|
|
3
|
+
exports.writeReadme = writeReadme;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fs_extra_1 = require("fs-extra");
|
|
6
6
|
const template_1 = tslib_1.__importDefault(require("lodash/template"));
|
|
@@ -17,5 +17,4 @@ function writeReadme(options) {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
exports.writeReadme = writeReadme;
|
|
21
20
|
//# sourceMappingURL=writeReadme.js.map
|
package/lib/writeReadme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeReadme.js","sourceRoot":"","sources":["writeReadme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"writeReadme.js","sourceRoot":"","sources":["writeReadme.ts"],"names":[],"mappings":";;AAKA,kCAmBC;;AAxBD,uCAAoD;AAEpD,uEAA6C;AAC7C,2BAAmC;AAEnC,SAAgB,WAAW,CAAC,OAG3B;IAEA,IAAI,IAAA,qBAAU,EAAC,OAAO,CAAC,IAAI,CAAC,EAC5B,CAAC;QACA,IAAI,GAAG,GAAG,IAAA,uBAAY,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;QAChD,IAAI,QAAQ,GAAG,IAAA,kBAAc,EAAC,GAAG,CAAC,QAAQ,EAAE,EAAE;QAC7C,0BAA0B;SAC1B,CAAC,CAAA;QAEF,IAAI,GAAG,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;QAEpC,IAAI,GAAG,KAAK,GAAG,EACf,CAAC;YACA,IAAA,kBAAa,EAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;QACjC,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["import { existsSync, readFileSync } from \"fs-extra\";\nimport { join } from \"path\";\nimport lodashTemplate from 'lodash/template';\nimport { writeFileSync } from \"fs\";\n\nexport function writeReadme(options: {\n\tfile: string,\n\tvariable: Record<any, any>,\n})\n{\n\tif (existsSync(options.file))\n\t{\n\t\tlet md1 = readFileSync(options.file).toString();\n\t\tlet compiled = lodashTemplate(md1.toString(), {\n\t\t\t//escape: new RegExp('_'),\n\t\t})\n\n\t\tlet md2 = compiled(options.variable)\n\n\t\tif (md1 !== md2)\n\t\t{\n\t\t\twriteFileSync(options.file, md2)\n\t\t}\n\t}\n}\n"]}
|
package/lib/yargs-setting.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Created by user on 2019/5/16.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.setupToYargs =
|
|
6
|
+
exports.setupToYargs = setupToYargs;
|
|
7
7
|
function setupToYargs(yargs) {
|
|
8
8
|
const _return = yargs
|
|
9
9
|
.default({
|
|
@@ -62,6 +62,5 @@ function setupToYargs(yargs) {
|
|
|
62
62
|
});
|
|
63
63
|
return _return;
|
|
64
64
|
}
|
|
65
|
-
exports.setupToYargs = setupToYargs;
|
|
66
65
|
exports.default = setupToYargs;
|
|
67
66
|
//# sourceMappingURL=yargs-setting.js.map
|
package/lib/yargs-setting.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yargs-setting.js","sourceRoot":"","sources":["yargs-setting.ts"],"names":[],"mappings":";AAAA;;GAEG
|
|
1
|
+
{"version":3,"file":"yargs-setting.js","sourceRoot":"","sources":["yargs-setting.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAMH,oCA4DC;AA5DD,SAAgB,YAAY,CAAI,KAAc;IAE7C,MAAM,OAAO,GAAG,KAAK;SACnB,OAAO,CAAC;IACR,uBAAuB;KACvB,CAAC;SACD,MAAM,CAAC,WAAW,EAAE;QACpB,KAAK,EAAE,CAAC,GAAG,CAAC;QACZ,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,mBAAmB;QAChC,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,QAAQ;KACd,CAAC;SACD,MAAM,CAAC,KAAK,EAAE;QACd,KAAK,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC;QACzB,sBAAsB;QACtB,mBAAmB;QAChB,IAAI,EAAE,SAAS;KACf,CAAC;SACD,MAAM,CAAC,KAAK,EAAE;QACd,KAAK,EAAE,CAAC,GAAG,CAAC;QACZ,WAAW,EAAE,IAAI;QACjB,SAAS,EAAE,IAAI;QAClB,2BAA2B;QACxB,kBAAkB,EAAE,OAAO,CAAC,GAAG,EAAE;QACjC,IAAI,EAAE,QAAQ;KACd,CAAC;SACD,MAAM,CAAC,oBAAoB,EAAE;QAC7B,KAAK,EAAE,CAAC,GAAG,CAAC;QACZ,IAAI,EAAE,SAAS;KACf,CAAC;SACD,MAAM,CAAC,OAAO,EAAE;QAChB,KAAK,EAAE,CAAC,GAAG,CAAC;QACZ,IAAI,EAAE,SAAS;KACf,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACf,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;KACb,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QAClB,KAAK,EAAE,CAAC,GAAG,CAAC;QACZ,IAAI,EAAE,SAAS;KACf,CAAC;SACD,MAAM,CAAC,cAAc,EAAE;QACvB,KAAK,EAAE,CAAC,GAAG,CAAC;QACZ,IAAI,EAAE,QAAQ;KACd,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACf,IAAI,EAAE,QAAQ;KACd,CAAC;SACD,MAAM,CAAC,YAAY,EAAE;QACrB,IAAI,EAAE,SAAS;KACf,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACf,IAAI,EAAE,SAAS;KACf,CAAC,CACF;IAED,OAAO,OAA4C,CAAA;AACpD,CAAC;AAED,kBAAe,YAAY,CAAA","sourcesContent":["/**\n * Created by user on 2019/5/16.\n */\n\nimport yargs, { Arguments } from 'yargs';\nimport { Argv, Omit } from 'yargs';\nimport { IYargsSync, IYargsUnPackArgv } from '@yarn-tool/types';\n\nexport function setupToYargs<T>(yargs: Argv<T>)\n{\n\tconst _return = yargs\n\t\t.default({\n\t\t\t//input: process.cwd(),\n\t\t})\n\t\t.option('npmClient', {\n\t\t\talias: ['N'],\n\t\t\trequiresArg: true,\n\t\t\tnormalize: true,\n\t\t\tdescription: 'npm, yarn, ...etc',\n\t\t\tdefault: 'npm',\n\t\t\ttype: 'string',\n\t\t})\n\t\t.option('yes', {\n\t\t\talias: ['y', 'silent'],\n//\t\trequiresArg: true,\n//\t\tdefault: 'npm',\n\t\t\ttype: 'boolean',\n\t\t})\n\t\t.option('cwd', {\n\t\t\talias: ['C'],\n\t\t\trequiresArg: true,\n\t\t\tnormalize: true,\n//\t\tdefault: process.cwd(),\n\t\t\tdefaultDescription: process.cwd(),\n\t\t\ttype: 'string',\n\t\t})\n\t\t.option('skipCheckWorkspace', {\n\t\t\talias: ['W'],\n\t\t\ttype: 'boolean',\n\t\t})\n\t\t.option('force', {\n\t\t\talias: ['f'],\n\t\t\ttype: 'boolean',\n\t\t})\n\t\t.option('sort', {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t})\n\t\t.option('private', {\n\t\t\talias: ['p'],\n\t\t\ttype: 'boolean',\n\t\t})\n\t\t.option('createModule', {\n\t\t\talias: ['m'],\n\t\t\ttype: 'string',\n\t\t})\n\t\t.option('name', {\n\t\t\ttype: 'string',\n\t\t})\n\t\t.option('copyStatic', {\n\t\t\ttype: 'boolean',\n\t\t})\n\t\t.option('tsdx', {\n\t\t\ttype: 'boolean',\n\t\t})\n\t;\n\n\treturn _return as any as IYargsSync<typeof _return>\n}\n\nexport default setupToYargs\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-init2",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "a lazy npm init for create new package, support yarn workspace. make we without use `mkdir xxx && cd xxx && [npm|yarn] init` with `npx npm-init2 xxx`",
|
|
6
6
|
"keywords": [
|
|
@@ -57,34 +57,34 @@
|
|
|
57
57
|
"resolutions": {},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@ts-type/package-dts": "^2.0.8",
|
|
60
|
-
"@yarn-tool/find-root": "^2.0.
|
|
61
|
-
"@yarn-tool/init-path": "^2.0.
|
|
62
|
-
"@yarn-tool/is-builtin-module": "^1.0.
|
|
63
|
-
"@yarn-tool/node-modules-link": "^3.0.
|
|
64
|
-
"@yarn-tool/pkg-entry-util": "^3.0.
|
|
65
|
-
"@yarn-tool/pkg-git-info": "^2.0.
|
|
66
|
-
"@yarn-tool/pkg-hosted-info": "^3.0.
|
|
67
|
-
"@yarn-tool/setup-module-env": "^3.0.
|
|
68
|
-
"@yarn-tool/static-file": "^3.0.
|
|
60
|
+
"@yarn-tool/find-root": "^2.0.14",
|
|
61
|
+
"@yarn-tool/init-path": "^2.0.2",
|
|
62
|
+
"@yarn-tool/is-builtin-module": "^1.0.23",
|
|
63
|
+
"@yarn-tool/node-modules-link": "^3.0.2",
|
|
64
|
+
"@yarn-tool/pkg-entry-util": "^3.0.2",
|
|
65
|
+
"@yarn-tool/pkg-git-info": "^2.0.2",
|
|
66
|
+
"@yarn-tool/pkg-hosted-info": "^3.0.2",
|
|
67
|
+
"@yarn-tool/setup-module-env": "^3.0.2",
|
|
68
|
+
"@yarn-tool/static-file": "^3.0.3",
|
|
69
69
|
"@yarn-tool/types": "^1.0.16",
|
|
70
|
-
"@yarn-tool/update-notifier": "^1.0.
|
|
71
|
-
"@yarn-tool/workspaces-project": "^3.0.
|
|
72
|
-
"@yarn-tool/write-package-json": "^1.0.
|
|
73
|
-
"cross-spawn-extra": "^
|
|
70
|
+
"@yarn-tool/update-notifier": "^1.0.40",
|
|
71
|
+
"@yarn-tool/workspaces-project": "^3.0.2",
|
|
72
|
+
"@yarn-tool/write-package-json": "^1.0.13",
|
|
73
|
+
"cross-spawn-extra": "^3.0.3",
|
|
74
74
|
"debug-color2": "^1.3.2",
|
|
75
|
-
"find-yarn-workspace-root2": "^1.2.
|
|
75
|
+
"find-yarn-workspace-root2": "^1.2.50",
|
|
76
76
|
"fs-extra": "^11.2.0",
|
|
77
77
|
"json5": "^2.2.3",
|
|
78
78
|
"lodash": "^4.17.21",
|
|
79
79
|
"micromatch": "^4.0.5",
|
|
80
|
-
"npm-package-json-loader": "^3.0.
|
|
80
|
+
"npm-package-json-loader": "^3.0.2",
|
|
81
81
|
"path-is-same": "^1.0.25",
|
|
82
|
-
"sort-package-json-scripts": "^1.1.
|
|
82
|
+
"sort-package-json-scripts": "^1.1.27",
|
|
83
83
|
"tslib": ">=2",
|
|
84
84
|
"upath2": "^3.1.19",
|
|
85
85
|
"validate-npm-package-name": "^5.0.0",
|
|
86
|
-
"workspaces-config": "^2.0.
|
|
87
|
-
"ws-pkg-list": "^3.0.
|
|
86
|
+
"workspaces-config": "^2.0.2",
|
|
87
|
+
"ws-pkg-list": "^3.0.2",
|
|
88
88
|
"yargs": "^17.7.2"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"bundleDependencies": [],
|
|
95
95
|
"preferGlobal": true,
|
|
96
96
|
"publishConfig": {},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "ab9a6ddd2269cc9eb3167266928b01d42596176d"
|
|
98
98
|
}
|