@lakutata/cli 2.14.0 → 2.14.2

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
@@ -3,6 +3,22 @@
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.2](https://github.com/lakutata/lakutata-packages/compare/@lakutata/cli@2.14.1...@lakutata/cli@2.14.2) (2025-07-11)
7
+
8
+ **Note:** Version bump only for package @lakutata/cli
9
+
10
+
11
+
12
+
13
+
14
+ ## [2.14.1](https://github.com/lakutata/lakutata-packages/compare/@lakutata/cli@2.14.0...@lakutata/cli@2.14.1) (2025-07-11)
15
+
16
+ **Note:** Version bump only for package @lakutata/cli
17
+
18
+
19
+
20
+
21
+
6
22
  # [2.14.0](https://github.com/lakutata/lakutata-packages/compare/@lakutata/cli@2.13.0...@lakutata/cli@2.14.0) (2025-07-11)
7
23
 
8
24
 
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 console = __importStar(require("node:console"));
30
+ const GetDataDirectory_1 = require("./lib/GetDataDirectory");
31
31
  const node_path_1 = __importDefault(require("node:path"));
32
- const ListTemplateNames_1 = require("./lib/ListTemplateNames");
32
+ const console = __importStar(require("node:console"));
33
33
  const node_process_1 = __importDefault(require("node:process"));
34
- const dataDir = node_path_1.default.resolve(__dirname, '../node_modules/.data');
35
- const localDataFilename = node_path_1.default.resolve(dataDir, 'templates.db');
36
- (0, ListTemplateNames_1.ListTemplateNames)(localDataFilename).then(async (templateNames) => {
37
- node_process_1.default.env.LAKUTATA_TEMPLATE_NAMES = JSON.stringify(templateNames);
38
- const { Config } = require('./config/Config');
39
- const { Application } = await import('lakutata');
40
- Application
41
- .alias({
42
- '@packageJson': node_path_1.default.resolve(__dirname, '../package.json'),
43
- '@data': dataDir,
44
- '@localDataFilename': localDataFilename
45
- }, true)
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,2 @@
1
+ export declare function GetDataDirectory(): string;
2
+ //# sourceMappingURL=GetDataDirectory.d.ts.map
@@ -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,2 @@
1
+ export declare function GetLocalDataFilename(): string;
2
+ //# sourceMappingURL=GetLocalDataFilename.d.ts.map
@@ -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(localDataFilename: string): Promise<string[]>;
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,wBAAsB,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAWpF"}
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 promises_1 = require("node:fs/promises");
7
- async function ListTemplateNames(localDataFilename) {
8
- const isLocalDataExists = await (0, helper_1.IsExists)(localDataFilename);
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(await (0, promises_1.readFile)(localDataFilename, { encoding: 'utf-8' }));
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,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AAM,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 = node_path_1.default.resolve('@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;AAQ5B;;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"}
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
- function templateNames() {
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
  */
@@ -29,7 +27,7 @@ __decorate([
29
27
  (0, dto_1.Expect)(lakutata_1.DTO
30
28
  .String()
31
29
  .required()
32
- .pattern(/^(\w+\.?)*\w+$/)
30
+ .pattern(/^([a-zA-Z0-9_-]+\.?)*[a-zA-Z0-9_-]+$/)
33
31
  .description('Specify the name of the application')),
34
32
  __metadata("design:type", String)
35
33
  ], CreateProjectOptions.prototype, "name", void 0);
@@ -45,7 +43,7 @@ __decorate([
45
43
  (0, dto_1.Expect)(lakutata_1.DTO
46
44
  .String()
47
45
  .required()
48
- .allow(...templateNames())
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.0",
3
+ "version": "2.14.2",
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": "dd63eb76227cfa240247f8f2edf368fa9f327091"
53
+ "gitHead": "e104593986eea83d2e5cd95df75498c3c06b03dc"
54
54
  }
@@ -1,4 +0,0 @@
1
- import { DTO } from 'lakutata';
2
- export declare class LakutataInfoOptions extends DTO {
3
- }
4
- //# sourceMappingURL=LakutataInfoOptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LakutataInfoOptions.d.ts","sourceRoot":"","sources":["../../src/options/LakutataInfoOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,UAAU,CAAA;AAE5B,qBAAa,mBAAoB,SAAQ,GAAG;CAC3C"}
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LakutataInfoOptions = void 0;
4
- const lakutata_1 = require("lakutata");
5
- class LakutataInfoOptions extends lakutata_1.DTO {
6
- }
7
- exports.LakutataInfoOptions = LakutataInfoOptions;