@lakutata/cli 2.3.0 → 2.4.1
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 +19 -0
- package/dist/lib/providers/Creator.js +4 -4
- package/dist/lib/providers/Information.d.ts.map +1 -1
- package/dist/lib/providers/Information.js +0 -1
- package/dist/options/CreateProjectOptions.d.ts +1 -1
- package/dist/options/CreateProjectOptions.d.ts.map +1 -1
- package/dist/options/CreateProjectOptions.js +2 -2
- package/package.json +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
## [2.4.1](https://github.com/lakutata/lakutata-packages/compare/@lakutata/cli@2.4.0...@lakutata/cli@2.4.1) (2024-08-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @lakutata/cli
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [2.4.0](https://github.com/lakutata/lakutata-packages/compare/@lakutata/cli@2.3.0...@lakutata/cli@2.4.0) (2024-08-02)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **cli:** update initOnly option to overwrite option ([9822407](https://github.com/lakutata/lakutata-packages/commit/982240776987ee281ed95e5a507ceac884146a75))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [2.3.0](https://github.com/lakutata/lakutata-packages/compare/@lakutata/cli@2.2.0...@lakutata/cli@2.3.0) (2024-04-15)
|
|
7
26
|
|
|
8
27
|
|
|
@@ -83,10 +83,10 @@ class Creator extends lakutata_1.Provider {
|
|
|
83
83
|
const authorName = options.author;
|
|
84
84
|
const licenseName = options.license;
|
|
85
85
|
const appType = options.type;
|
|
86
|
-
const targetPath = options.
|
|
86
|
+
const targetPath = options.overwrite ? node_path_1.default.resolve(options.path) : node_path_1.default.resolve(options.path, options.name);
|
|
87
87
|
const { branch } = ProjectTypeConfig_js_1.ProjectTypeConfig[appType];
|
|
88
88
|
const table = new cli_table3_1.default();
|
|
89
|
-
table.push([{ content: ansis_1.default.bold.cyan('Project Creation Information'), colSpan: 2, hAlign: 'center' }], [ansis_1.default.blue('APP ID & Project Name'), appId], [ansis_1.default.blue('APP Name'), appName], [ansis_1.default.blue('APP Description'), appDescription], [ansis_1.default.blue('Project Create Target Path'), targetPath], [ansis_1.default.blue('Project Create Mode'), options.
|
|
89
|
+
table.push([{ content: ansis_1.default.bold.cyan('Project Creation Information'), colSpan: 2, hAlign: 'center' }], [ansis_1.default.blue('APP ID & Project Name'), appId], [ansis_1.default.blue('APP Name'), appName], [ansis_1.default.blue('APP Description'), appDescription], [ansis_1.default.blue('Project Create Target Path'), targetPath], [ansis_1.default.blue('Project Create Mode'), options.overwrite ? ansis_1.default.yellow('Initialize project in an existing directory') : ansis_1.default.green('Create a new folder for the project')], [ansis_1.default.blue('Project Author Name'), authorName], [ansis_1.default.blue('Project License'), licenseName], [ansis_1.default.blue('Project Template Branch'), this.puller.getGitSource(branch)]);
|
|
90
90
|
console.log(table.toString());
|
|
91
91
|
await new Promise(resolve => {
|
|
92
92
|
let timeLeft = 15;
|
|
@@ -100,7 +100,7 @@ class Creator extends lakutata_1.Provider {
|
|
|
100
100
|
}, 1000);
|
|
101
101
|
this.spinner.start(() => `Please confirm the project creation information; the creation process will commence in ${timeLeft} seconds.`);
|
|
102
102
|
});
|
|
103
|
-
await this.checkTargetPathExistence(targetPath, options.
|
|
103
|
+
await this.checkTargetPathExistence(targetPath, options.overwrite);
|
|
104
104
|
await this.checkTargetPathIsDirectory(targetPath);
|
|
105
105
|
await this.checkTargetDirectoryIsEmpty(targetPath);
|
|
106
106
|
this.spinner.start('Pulling');
|
|
@@ -108,11 +108,11 @@ class Creator extends lakutata_1.Provider {
|
|
|
108
108
|
this.spinner.stop();
|
|
109
109
|
this.log.info(`${SpecialChar_js_1.charCheck} Template pulled.`);
|
|
110
110
|
this.spinner.start('Installing');
|
|
111
|
+
//TODO 将项目内的内容进行初始化
|
|
111
112
|
const { execa } = await import('execa');
|
|
112
113
|
await execa('npm', ['install'], { cwd: targetPath });
|
|
113
114
|
await execa('npm', ['install', `${this.onlineVersion.getName()}@${await this.onlineVersion.getVersion()}`], { cwd: targetPath });
|
|
114
115
|
this.spinner.stop();
|
|
115
|
-
//TODO 将项目内的内容进行初始化
|
|
116
116
|
this.log.info(`${SpecialChar_js_1.charCheck} Project has been successfully created.`);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Information.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/Information.ts"],"names":[],"mappings":"AAGA,OAAO,EAAM,QAAQ,EAAO,MAAM,UAAU,CAAA;AAI5C,qBAAa,WAAY,SAAQ,QAAQ;IAGrC,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IAG/B,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAGlC,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAGtC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAGlC,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IAG3C,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IAE3C,SAAS,CAAC,gBAAgB,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAE1E,SAAS,CAAC,WAAW,EAAE,MAAM,CAAA;IAE7B,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAEpC;;;OAGG;cACa,IAAI,IAAI,OAAO,CAAC,IAAI,CA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Ae,IAAI,MAAM;IAInC;;OAEG;IACI,QAAQ,IAAI,SAAS,GAAG,QAAQ;IAIvC;;OAEG;IACI,OAAO,IAAI,MAAM,GAAG,IAAI;IAI/B;;OAEG;IACI,cAAc,IAAI,MAAM;IAI/B;;OAEG;IACU,wCAAwC,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAe/E;;OAEG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAYtC"}
|
|
@@ -25,7 +25,6 @@ class Information extends lakutata_1.Provider {
|
|
|
25
25
|
* @protected
|
|
26
26
|
*/
|
|
27
27
|
async init() {
|
|
28
|
-
// const {packageDirectory} = require('pkg-dir')
|
|
29
28
|
const { packageDirectory } = await import('pkg-dir');
|
|
30
29
|
this.packageDirectory = packageDirectory;
|
|
31
30
|
const installPath = await packageDirectory({ cwd: this.currentDirectory });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateProjectOptions.d.ts","sourceRoot":"","sources":["../../src/options/CreateProjectOptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,UAAU,CAAA;AAG5B;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,GAAG;IASlC,IAAI,EAAE,MAAM,CAAA;IASZ,EAAE,EAAE,MAAM,CAAA;IASV,IAAI,EAAE,MAAM,CAAA;IASZ,IAAI,EAAE,MAAM,CAAA;IAUZ,
|
|
1
|
+
{"version":3,"file":"CreateProjectOptions.d.ts","sourceRoot":"","sources":["../../src/options/CreateProjectOptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,UAAU,CAAA;AAG5B;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,GAAG;IASlC,IAAI,EAAE,MAAM,CAAA;IASZ,EAAE,EAAE,MAAM,CAAA;IASV,IAAI,EAAE,MAAM,CAAA;IASZ,IAAI,EAAE,MAAM,CAAA;IAUZ,SAAS,EAAE,OAAO,CAAA;IASlB,WAAW,EAAE,MAAM,CAAA;IASnB,MAAM,EAAE,MAAM,CAAA;IASd,OAAO,EAAE,MAAM,CAAA;CACzB"}
|
|
@@ -57,9 +57,9 @@ __decorate([
|
|
|
57
57
|
.strict(false)
|
|
58
58
|
.optional()
|
|
59
59
|
.default(false)
|
|
60
|
-
.description('initialize project
|
|
60
|
+
.description('initialize the project within an existing folder (default: false)')),
|
|
61
61
|
__metadata("design:type", Boolean)
|
|
62
|
-
], CreateProjectOptions.prototype, "
|
|
62
|
+
], CreateProjectOptions.prototype, "overwrite", void 0);
|
|
63
63
|
__decorate([
|
|
64
64
|
(0, dto_1.Expect)(lakutata_1.DTO
|
|
65
65
|
.String()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lakutata/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "Lakutata CLI tool",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lakutata",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"clean": "shx rm -rf ./dist",
|
|
25
25
|
"build": "tsc",
|
|
26
26
|
"rebuild": "npm run clean && npm run build",
|
|
27
|
-
"test": "tsx src/CLIApp.ts info"
|
|
27
|
+
"test:info": "tsx src/CLIApp.ts info",
|
|
28
|
+
"test:create": "tsx src/CLIApp.ts create --help"
|
|
28
29
|
},
|
|
29
30
|
"bugs": {
|
|
30
31
|
"url": "https://github.com/lakutata/lakutata-packages/issues"
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
"commander": "^12.0.0",
|
|
37
38
|
"degit": "^2.8.4",
|
|
38
39
|
"execa": "^8.0.1",
|
|
40
|
+
"lakutata": "^2.0.11",
|
|
39
41
|
"latest-version": "^9.0.0",
|
|
40
42
|
"log-update": "^6.0.0",
|
|
41
43
|
"pkg-dir": "^8.0.0",
|
|
@@ -44,5 +46,5 @@
|
|
|
44
46
|
"devDependencies": {
|
|
45
47
|
"@types/degit": "^2.8.6"
|
|
46
48
|
},
|
|
47
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "6b8f0dcb27300f76290e4ba38a929c44520fd58d"
|
|
48
50
|
}
|