@lakutata/cli 2.14.0 → 2.14.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 +8 -0
- package/dist/CLIApp.js +14 -23
- package/dist/lib/GetDataDirectory.d.ts +2 -0
- package/dist/lib/GetDataDirectory.d.ts.map +1 -0
- package/dist/lib/GetDataDirectory.js +11 -0
- package/dist/lib/GetLocalDataFilename.d.ts +2 -0
- package/dist/lib/GetLocalDataFilename.d.ts.map +1 -0
- package/dist/lib/GetLocalDataFilename.js +12 -0
- package/dist/lib/ListTemplateNames.d.ts +1 -1
- package/dist/lib/ListTemplateNames.d.ts.map +1 -1
- package/dist/lib/ListTemplateNames.js +30 -6
- package/dist/lib/providers/TemplateManager.d.ts.map +1 -1
- package/dist/lib/providers/TemplateManager.js +2 -1
- package/dist/options/CreateProjectOptions.d.ts.map +1 -1
- package/dist/options/CreateProjectOptions.js +2 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.14.1](https://github.com/lakutata/lakutata-packages/compare/@lakutata/cli@2.14.0...@lakutata/cli@2.14.1) (2025-07-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @lakutata/cli
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [2.14.0](https://github.com/lakutata/lakutata-packages/compare/@lakutata/cli@2.13.0...@lakutata/cli@2.14.0) (2025-07-11)
|
|
7
15
|
|
|
8
16
|
|
package/dist/CLIApp.js
CHANGED
|
@@ -27,28 +27,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
const
|
|
30
|
+
const GetDataDirectory_1 = require("./lib/GetDataDirectory");
|
|
31
31
|
const node_path_1 = __importDefault(require("node:path"));
|
|
32
|
-
const
|
|
32
|
+
const console = __importStar(require("node:console"));
|
|
33
33
|
const node_process_1 = __importDefault(require("node:process"));
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
.env({
|
|
47
|
-
LAKUTATA_TEMPLATE_NAMES: JSON.stringify(templateNames)
|
|
48
|
-
})
|
|
49
|
-
.run(Config)
|
|
50
|
-
.onUncaughtException((error) => {
|
|
51
|
-
console.error(`error: ${error.message}`);
|
|
52
|
-
return node_process_1.default.exit(1);
|
|
53
|
-
});
|
|
54
|
-
}).catch(() => node_process_1.default.exit(1));
|
|
34
|
+
const lakutata_1 = require("lakutata");
|
|
35
|
+
const Config_1 = require("./config/Config");
|
|
36
|
+
lakutata_1.Application
|
|
37
|
+
.alias({
|
|
38
|
+
'@packageJson': node_path_1.default.resolve(__dirname, '../package.json'),
|
|
39
|
+
'@data': (0, GetDataDirectory_1.GetDataDirectory)()
|
|
40
|
+
}, true)
|
|
41
|
+
.run(Config_1.Config)
|
|
42
|
+
.onUncaughtException((error) => {
|
|
43
|
+
console.error(`error: ${error.message}`);
|
|
44
|
+
return node_process_1.default.exit(1);
|
|
45
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetDataDirectory.d.ts","sourceRoot":"","sources":["../../src/lib/GetDataDirectory.ts"],"names":[],"mappings":"AAEA,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GetDataDirectory = void 0;
|
|
7
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
+
function GetDataDirectory() {
|
|
9
|
+
return node_path_1.default.resolve(__dirname, '../../node_modules/.data');
|
|
10
|
+
}
|
|
11
|
+
exports.GetDataDirectory = GetDataDirectory;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetLocalDataFilename.d.ts","sourceRoot":"","sources":["../../src/lib/GetLocalDataFilename.ts"],"names":[],"mappings":"AAGA,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GetLocalDataFilename = void 0;
|
|
7
|
+
const GetDataDirectory_1 = require("./GetDataDirectory");
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
function GetLocalDataFilename() {
|
|
10
|
+
return node_path_1.default.resolve((0, GetDataDirectory_1.GetDataDirectory)(), 'templates.db');
|
|
11
|
+
}
|
|
12
|
+
exports.GetLocalDataFilename = GetLocalDataFilename;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function ListTemplateNames(
|
|
1
|
+
export declare function ListTemplateNames(): string[];
|
|
2
2
|
//# sourceMappingURL=ListTemplateNames.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListTemplateNames.d.ts","sourceRoot":"","sources":["../../src/lib/ListTemplateNames.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"ListTemplateNames.d.ts","sourceRoot":"","sources":["../../src/lib/ListTemplateNames.ts"],"names":[],"mappings":"AAIA,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAY5C"}
|
|
@@ -1,20 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.ListTemplateNames = void 0;
|
|
4
|
-
const helper_1 = require("lakutata/helper");
|
|
5
27
|
const lakutata_1 = require("lakutata");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
28
|
+
const fs = __importStar(require("node:fs"));
|
|
29
|
+
const GetLocalDataFilename_1 = require("./GetLocalDataFilename");
|
|
30
|
+
function ListTemplateNames() {
|
|
31
|
+
const localDataFilename = (0, GetLocalDataFilename_1.GetLocalDataFilename)();
|
|
32
|
+
const isLocalDataExists = fs.existsSync(localDataFilename);
|
|
9
33
|
let cache = {
|
|
10
34
|
templates: [],
|
|
11
35
|
updatedAt: lakutata_1.Time.now()
|
|
12
36
|
};
|
|
13
37
|
if (isLocalDataExists) {
|
|
14
|
-
cache = JSON.parse(
|
|
38
|
+
cache = JSON.parse(fs.readFileSync(localDataFilename, { encoding: 'utf-8' }));
|
|
15
39
|
}
|
|
16
40
|
if (!cache)
|
|
17
41
|
return [];
|
|
18
|
-
return cache.templates.map(template => template.name);
|
|
42
|
+
return cache.templates.map((template) => template.name);
|
|
19
43
|
}
|
|
20
44
|
exports.ListTemplateNames = ListTemplateNames;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateManager.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/TemplateManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAO,QAAQ,EAAO,MAAM,UAAU,CAAA;AACzD,OAAO,EAAC,oBAAoB,EAAC,MAAM,oCAAoC,CAAA;AAQvE,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAA;AAE1C,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"TemplateManager.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/TemplateManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAO,QAAQ,EAAO,MAAM,UAAU,CAAA;AACzD,OAAO,EAAC,oBAAoB,EAAC,MAAM,oCAAoC,CAAA;AAQvE,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAA;AAE1C,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAA;AAI7C,KAAK,YAAY,GAAG;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;CACrB,CAAA;AAQD,qBAAa,eAAgB,SAAQ,QAAQ;IAGzC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAA;IAGnC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IAG9B,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IAGnC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAGlC,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAErC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAyB;IAErE;;;OAGG;cACa,kBAAkB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IA0B7D;;;OAGG;IAEU,IAAI,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB/D;;;;;OAKG;IACH,SAAS,CAAC,cAAc,CAAC,aAAa,EAAE,YAAY,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;CAmBnF"}
|
|
@@ -49,10 +49,11 @@ const logger_1 = require("lakutata/com/logger");
|
|
|
49
49
|
const helper_1 = require("lakutata/helper");
|
|
50
50
|
const Spinner_1 = require("../components/Spinner");
|
|
51
51
|
const promises_1 = require("node:fs/promises");
|
|
52
|
+
const GetLocalDataFilename_1 = require("../GetLocalDataFilename");
|
|
52
53
|
class TemplateManager extends lakutata_1.Provider {
|
|
53
54
|
constructor() {
|
|
54
55
|
super(...arguments);
|
|
55
|
-
this.localDataFilename =
|
|
56
|
+
this.localDataFilename = (0, GetLocalDataFilename_1.GetLocalDataFilename)();
|
|
56
57
|
}
|
|
57
58
|
/**
|
|
58
59
|
* Fetch template repository list from remote
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateProjectOptions.d.ts","sourceRoot":"","sources":["../../src/options/CreateProjectOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"CreateProjectOptions.d.ts","sourceRoot":"","sources":["../../src/options/CreateProjectOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,UAAU,CAAA;AAK5B;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,GAAG;IAQlC,IAAI,EAAE,MAAM,CAAA;IASZ,EAAE,EAAE,MAAM,CAAA;IAUV,QAAQ,EAAE,MAAM,CAAA;IAShB,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"}
|
|
@@ -16,9 +16,7 @@ exports.CreateProjectOptions = void 0;
|
|
|
16
16
|
const lakutata_1 = require("lakutata");
|
|
17
17
|
const dto_1 = require("lakutata/decorator/dto");
|
|
18
18
|
const node_process_1 = __importDefault(require("node:process"));
|
|
19
|
-
|
|
20
|
-
return node_process_1.default.env.LAKUTATA_TEMPLATE_NAMES ? JSON.parse(node_process_1.default.env.LAKUTATA_TEMPLATE_NAMES) : [];
|
|
21
|
-
}
|
|
19
|
+
const ListTemplateNames_1 = require("../lib/ListTemplateNames");
|
|
22
20
|
/**
|
|
23
21
|
* Create project options
|
|
24
22
|
*/
|
|
@@ -45,7 +43,7 @@ __decorate([
|
|
|
45
43
|
(0, dto_1.Expect)(lakutata_1.DTO
|
|
46
44
|
.String()
|
|
47
45
|
.required()
|
|
48
|
-
.allow(...
|
|
46
|
+
.allow(...(0, ListTemplateNames_1.ListTemplateNames)())
|
|
49
47
|
.only()
|
|
50
48
|
.description('Choose a template for this project')),
|
|
51
49
|
__metadata("design:type", String)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lakutata/cli",
|
|
3
|
-
"version": "2.14.
|
|
3
|
+
"version": "2.14.1",
|
|
4
4
|
"description": "Lakutata CLI tool",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lakutata",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/degit": "^2.8.6"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "134e4e8468039341f9e309935f4a1b796ecb40b2"
|
|
54
54
|
}
|