@lakutata/cli 2.17.1 → 3.0.0-beta.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/README.md +455 -28
- package/dist/esm/CLIApp.js +6 -0
- package/dist/esm/Config.js +53 -0
- package/dist/esm/controllers/CommandLineController.js +180 -0
- package/dist/esm/controllers/I18nController.js +67 -0
- package/dist/esm/controllers/MigrationController.js +66 -0
- package/dist/esm/controllers/NativeController.js +41 -0
- package/dist/esm/controllers/PackController.js +88 -0
- package/dist/esm/controllers/WorkspaceController.js +91 -0
- package/dist/esm/dtos/AddPackageDTO.js +25 -0
- package/dist/esm/dtos/BundleDTO.js +29 -0
- package/dist/esm/dtos/CleanDTO.js +17 -0
- package/dist/esm/dtos/CreateProjectDTO.js +61 -0
- package/dist/esm/dtos/ExecutableDTO.js +37 -0
- package/dist/esm/dtos/I18nDTO.js +41 -0
- package/dist/esm/dtos/InstallerDTO.js +33 -0
- package/dist/{options/ListTemplatesOptions.js → esm/dtos/ListTemplatesDTO.js} +5 -14
- package/dist/esm/dtos/MigrationDTO.js +45 -0
- package/dist/esm/dtos/NativeDTO.js +41 -0
- package/dist/esm/dtos/RunScriptDTO.js +33 -0
- package/dist/esm/dtos/VersionDTO.js +29 -0
- package/dist/esm/lib/AddPackage.js +487 -0
- package/dist/esm/lib/Builder.js +21 -0
- package/dist/esm/lib/Clean.js +146 -0
- package/dist/esm/lib/Environment.js +11 -0
- package/dist/esm/lib/I18n.js +67 -0
- package/dist/esm/lib/Language.js +24 -0
- package/dist/esm/lib/Migration.js +94 -0
- package/dist/esm/lib/Output.js +40 -0
- package/dist/esm/lib/Processes.js +54 -0
- package/dist/esm/lib/ProjectCreator.js +191 -0
- package/dist/esm/lib/Registry.js +152 -0
- package/dist/esm/lib/Settings.js +25 -0
- package/dist/esm/lib/Tar.js +145 -0
- package/dist/esm/lib/TemplateCatalog.js +195 -0
- package/dist/esm/lib/TemplateFeatures.js +141 -0
- package/dist/esm/lib/Versions.js +58 -0
- package/dist/esm/lib/native/CMake.js +357 -0
- package/dist/esm/lib/native/Gyp.js +398 -0
- package/dist/esm/lib/native/NativeProject.js +370 -0
- package/dist/esm/lib/native/TextEdits.js +68 -0
- package/dist/esm/lib/native/Toml.js +325 -0
- package/dist/esm/lib/workspace/Run.js +111 -0
- package/dist/esm/lib/workspace/Version.js +144 -0
- package/dist/esm/lib/workspace/Workspace.js +231 -0
- package/dist/esm/locales/zh-CN.json +194 -0
- package/dist/esm/locales/zh-TW.json +194 -0
- package/dist/esm/types/ProcessResult.js +1 -0
- package/package.json +32 -43
- package/CHANGELOG.md +0 -460
- package/dist/CLIApp.d.ts +0 -3
- package/dist/CLIApp.d.ts.map +0 -1
- package/dist/CLIApp.js +0 -45
- package/dist/config/Config.d.ts +0 -3
- package/dist/config/Config.d.ts.map +0 -1
- package/dist/config/Config.js +0 -63
- package/dist/config/SetupCLIEntrypoint.d.ts +0 -3
- package/dist/config/SetupCLIEntrypoint.d.ts.map +0 -1
- package/dist/config/SetupCLIEntrypoint.js +0 -31
- package/dist/controllers/CommandLineController.d.ts +0 -25
- package/dist/controllers/CommandLineController.d.ts.map +0 -1
- package/dist/controllers/CommandLineController.js +0 -78
- package/dist/lib/ConvertDTO2Inquirer.d.ts +0 -3
- package/dist/lib/ConvertDTO2Inquirer.d.ts.map +0 -1
- package/dist/lib/ConvertDTO2Inquirer.js +0 -61
- package/dist/lib/GetDataDirectory.d.ts +0 -2
- package/dist/lib/GetDataDirectory.d.ts.map +0 -1
- package/dist/lib/GetDataDirectory.js +0 -11
- package/dist/lib/GetLocalDataFilename.d.ts +0 -2
- package/dist/lib/GetLocalDataFilename.d.ts.map +0 -1
- package/dist/lib/GetLocalDataFilename.js +0 -12
- package/dist/lib/ListTemplateNames.d.ts +0 -2
- package/dist/lib/ListTemplateNames.d.ts.map +0 -1
- package/dist/lib/ListTemplateNames.js +0 -44
- package/dist/lib/SpecialChar.d.ts +0 -9
- package/dist/lib/SpecialChar.d.ts.map +0 -1
- package/dist/lib/SpecialChar.js +0 -11
- package/dist/lib/components/DeGitPuller.d.ts +0 -19
- package/dist/lib/components/DeGitPuller.d.ts.map +0 -1
- package/dist/lib/components/DeGitPuller.js +0 -65
- package/dist/lib/components/Spinner.d.ts +0 -23
- package/dist/lib/components/Spinner.d.ts.map +0 -1
- package/dist/lib/components/Spinner.js +0 -61
- package/dist/lib/providers/Creator.d.ts +0 -46
- package/dist/lib/providers/Creator.d.ts.map +0 -1
- package/dist/lib/providers/Creator.js +0 -179
- package/dist/lib/providers/Information.d.ts +0 -91
- package/dist/lib/providers/Information.d.ts.map +0 -1
- package/dist/lib/providers/Information.js +0 -225
- package/dist/lib/providers/OnlineLatestVersion.d.ts +0 -14
- package/dist/lib/providers/OnlineLatestVersion.d.ts.map +0 -1
- package/dist/lib/providers/OnlineLatestVersion.js +0 -47
- package/dist/lib/providers/TemplateManager.d.ts +0 -36
- package/dist/lib/providers/TemplateManager.d.ts.map +0 -1
- package/dist/lib/providers/TemplateManager.js +0 -164
- package/dist/options/CreateProjectOptions.d.ts +0 -15
- package/dist/options/CreateProjectOptions.d.ts.map +0 -1
- package/dist/options/CreateProjectOptions.js +0 -94
- package/dist/options/ListTemplatesOptions.d.ts +0 -5
- package/dist/options/ListTemplatesOptions.d.ts.map +0 -1
- package/tsconfig.json +0 -7
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SetupCLIEntrypoint = void 0;
|
|
4
|
-
const entrypoint_1 = require("lakutata/com/entrypoint");
|
|
5
|
-
const commander_1 = require("commander");
|
|
6
|
-
function SetupCLIEntrypoint() {
|
|
7
|
-
return (0, entrypoint_1.BuildCLIEntrypoint)((module, cliMap, handler) => {
|
|
8
|
-
const CLIProgram = new commander_1.Command();
|
|
9
|
-
cliMap.forEach((dtoJsonSchema, command) => {
|
|
10
|
-
const cmd = new commander_1.Command(command).description(dtoJsonSchema.description);
|
|
11
|
-
for (const property in dtoJsonSchema.properties) {
|
|
12
|
-
const attr = dtoJsonSchema.properties[property];
|
|
13
|
-
const optionsArgs = [`--${property} <${attr.type}>`, attr.description];
|
|
14
|
-
if (Array.isArray(dtoJsonSchema.required) && dtoJsonSchema.required.includes(property)) {
|
|
15
|
-
optionsArgs[1] = `(required) ${optionsArgs[1]}`;
|
|
16
|
-
cmd.requiredOption(...optionsArgs);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
cmd.option(...optionsArgs);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
cmd.action(async (args) => await handler(new entrypoint_1.CLIContext({
|
|
23
|
-
command: command,
|
|
24
|
-
data: args
|
|
25
|
-
})));
|
|
26
|
-
CLIProgram.addCommand(cmd);
|
|
27
|
-
});
|
|
28
|
-
CLIProgram.parse();
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
exports.SetupCLIEntrypoint = SetupCLIEntrypoint;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Information } from '../lib/providers/Information';
|
|
2
|
-
import { Creator } from '../lib/providers/Creator';
|
|
3
|
-
import { type ActionPattern } from 'lakutata';
|
|
4
|
-
import { Controller } from 'lakutata/com/entrypoint';
|
|
5
|
-
import { ListTemplatesOptions } from '../options/ListTemplatesOptions';
|
|
6
|
-
import { TemplateManager } from '../lib/providers/TemplateManager';
|
|
7
|
-
export declare class CommandLineController extends Controller {
|
|
8
|
-
protected readonly projectCreator: Creator;
|
|
9
|
-
protected readonly frameworkInfo: Information;
|
|
10
|
-
protected readonly templateManager: TemplateManager;
|
|
11
|
-
/**
|
|
12
|
-
* Create project
|
|
13
|
-
*/
|
|
14
|
-
create(): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* List templates
|
|
17
|
-
* @param inp
|
|
18
|
-
*/
|
|
19
|
-
templates(inp: ActionPattern<ListTemplatesOptions>): Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* Show framework info
|
|
22
|
-
*/
|
|
23
|
-
info(): Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=CommandLineController.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommandLineController.d.ts","sourceRoot":"","sources":["../../src/controllers/CommandLineController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAC,KAAK,aAAa,EAAM,MAAM,UAAU,CAAA;AAGhD,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAA;AACpE,OAAO,EAAC,eAAe,EAAC,MAAM,kCAAkC,CAAA;AAIhE,qBAAa,qBAAsB,SAAQ,UAAU;IAGjD,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;IAG1C,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAA;IAG7C,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAA;IAEnD;;OAEG;IAEU,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC;;;OAGG;IAEU,SAAS,CAAC,GAAG,EAAE,aAAa,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/E;;OAEG;IAEU,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAGrC"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CommandLineController = void 0;
|
|
13
|
-
const Information_1 = require("../lib/providers/Information");
|
|
14
|
-
const Creator_1 = require("../lib/providers/Creator");
|
|
15
|
-
const lakutata_1 = require("lakutata");
|
|
16
|
-
const di_1 = require("lakutata/decorator/di");
|
|
17
|
-
const ctrl_1 = require("lakutata/decorator/ctrl");
|
|
18
|
-
const entrypoint_1 = require("lakutata/com/entrypoint");
|
|
19
|
-
const ListTemplatesOptions_1 = require("../options/ListTemplatesOptions");
|
|
20
|
-
const TemplateManager_1 = require("../lib/providers/TemplateManager");
|
|
21
|
-
const CreateProjectOptions_1 = require("../options/CreateProjectOptions");
|
|
22
|
-
const ConvertDTO2Inquirer_1 = require("../lib/ConvertDTO2Inquirer");
|
|
23
|
-
class CommandLineController extends entrypoint_1.Controller {
|
|
24
|
-
/**
|
|
25
|
-
* Create project
|
|
26
|
-
*/
|
|
27
|
-
async create() {
|
|
28
|
-
await this.projectCreator.create(await (0, ConvertDTO2Inquirer_1.ConvertDTO2Inquirer)(CreateProjectOptions_1.CreateProjectOptions));
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* List templates
|
|
32
|
-
* @param inp
|
|
33
|
-
*/
|
|
34
|
-
async templates(inp) {
|
|
35
|
-
await this.templateManager.list(inp);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Show framework info
|
|
39
|
-
*/
|
|
40
|
-
async info() {
|
|
41
|
-
await this.frameworkInfo.print();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.CommandLineController = CommandLineController;
|
|
45
|
-
__decorate([
|
|
46
|
-
(0, di_1.Inject)('creator'),
|
|
47
|
-
__metadata("design:type", Creator_1.Creator)
|
|
48
|
-
], CommandLineController.prototype, "projectCreator", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, di_1.Inject)('info'),
|
|
51
|
-
__metadata("design:type", Information_1.Information)
|
|
52
|
-
], CommandLineController.prototype, "frameworkInfo", void 0);
|
|
53
|
-
__decorate([
|
|
54
|
-
(0, di_1.Inject)('templateManager'),
|
|
55
|
-
__metadata("design:type", TemplateManager_1.TemplateManager
|
|
56
|
-
/**
|
|
57
|
-
* Create project
|
|
58
|
-
*/
|
|
59
|
-
)
|
|
60
|
-
], CommandLineController.prototype, "templateManager", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
(0, ctrl_1.CLIAction)('create', lakutata_1.DTO.description('create a Lakutata project')),
|
|
63
|
-
__metadata("design:type", Function),
|
|
64
|
-
__metadata("design:paramtypes", []),
|
|
65
|
-
__metadata("design:returntype", Promise)
|
|
66
|
-
], CommandLineController.prototype, "create", null);
|
|
67
|
-
__decorate([
|
|
68
|
-
(0, ctrl_1.CLIAction)('templates', ListTemplatesOptions_1.ListTemplatesOptions.description('list available project templates')),
|
|
69
|
-
__metadata("design:type", Function),
|
|
70
|
-
__metadata("design:paramtypes", [Object]),
|
|
71
|
-
__metadata("design:returntype", Promise)
|
|
72
|
-
], CommandLineController.prototype, "templates", null);
|
|
73
|
-
__decorate([
|
|
74
|
-
(0, ctrl_1.CLIAction)('info', lakutata_1.DTO.description('show Lakutata framework info')),
|
|
75
|
-
__metadata("design:type", Function),
|
|
76
|
-
__metadata("design:paramtypes", []),
|
|
77
|
-
__metadata("design:returntype", Promise)
|
|
78
|
-
], CommandLineController.prototype, "info", null);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConvertDTO2Inquirer.d.ts","sourceRoot":"","sources":["../../src/lib/ConvertDTO2Inquirer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,GAAG,EAAC,MAAM,UAAU,CAAA;AAG3C,wBAAsB,mBAAmB,CAAC,QAAQ,SAAS,OAAO,GAAG,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAmDjH"}
|
|
@@ -1,61 +0,0 @@
|
|
|
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.ConvertDTO2Inquirer = void 0;
|
|
7
|
-
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
|
-
async function ConvertDTO2Inquirer(dto) {
|
|
9
|
-
const jsonSchema = dto.toOpenAPIJsonSchema();
|
|
10
|
-
const prompts = [];
|
|
11
|
-
for (const propertyName in jsonSchema.properties) {
|
|
12
|
-
const propertyInfo = jsonSchema.properties[propertyName];
|
|
13
|
-
const propertyRequired = Array.isArray(jsonSchema.required) && jsonSchema.required.includes(propertyName);
|
|
14
|
-
switch (propertyInfo.type) {
|
|
15
|
-
case 'boolean':
|
|
16
|
-
{
|
|
17
|
-
prompts.push({
|
|
18
|
-
name: propertyName,
|
|
19
|
-
type: 'confirm',
|
|
20
|
-
message: propertyInfo.description || '',
|
|
21
|
-
default: propertyInfo.default,
|
|
22
|
-
required: propertyRequired
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
break;
|
|
26
|
-
case 'string':
|
|
27
|
-
default: {
|
|
28
|
-
if (propertyInfo.enum) {
|
|
29
|
-
const enums = propertyInfo.enum.filter(value => !!value);
|
|
30
|
-
prompts.push({
|
|
31
|
-
name: propertyName,
|
|
32
|
-
type: 'list',
|
|
33
|
-
message: propertyInfo.description || '',
|
|
34
|
-
required: propertyRequired,
|
|
35
|
-
choices: enums.map((value) => ({
|
|
36
|
-
name: value,
|
|
37
|
-
value: value
|
|
38
|
-
}))
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
prompts.push({
|
|
43
|
-
name: propertyName,
|
|
44
|
-
type: 'input',
|
|
45
|
-
message: propertyInfo.description || '',
|
|
46
|
-
default: propertyInfo.default,
|
|
47
|
-
required: propertyRequired,
|
|
48
|
-
validate: (input) => {
|
|
49
|
-
if (propertyInfo.pattern) {
|
|
50
|
-
return new RegExp(propertyInfo.pattern).test(input);
|
|
51
|
-
}
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return inquirer_1.default.prompt(prompts);
|
|
60
|
-
}
|
|
61
|
-
exports.ConvertDTO2Inquirer = ConvertDTO2Inquirer;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetDataDirectory.d.ts","sourceRoot":"","sources":["../../src/lib/GetDataDirectory.ts"],"names":[],"mappings":"AAEA,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GetLocalDataFilename.d.ts","sourceRoot":"","sources":["../../src/lib/GetLocalDataFilename.ts"],"names":[],"mappings":"AAGA,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C"}
|
|
@@ -1,12 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListTemplateNames.d.ts","sourceRoot":"","sources":["../../src/lib/ListTemplateNames.ts"],"names":[],"mappings":"AAIA,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAY5C"}
|
|
@@ -1,44 +0,0 @@
|
|
|
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
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ListTemplateNames = void 0;
|
|
27
|
-
const lakutata_1 = require("lakutata");
|
|
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);
|
|
33
|
-
let cache = {
|
|
34
|
-
templates: [],
|
|
35
|
-
updatedAt: lakutata_1.Time.now()
|
|
36
|
-
};
|
|
37
|
-
if (isLocalDataExists) {
|
|
38
|
-
cache = JSON.parse(fs.readFileSync(localDataFilename, { encoding: 'utf-8' }));
|
|
39
|
-
}
|
|
40
|
-
if (!cache)
|
|
41
|
-
return [];
|
|
42
|
-
return cache.templates.map((template) => template.name);
|
|
43
|
-
}
|
|
44
|
-
exports.ListTemplateNames = ListTemplateNames;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SpecialChar.d.ts","sourceRoot":"","sources":["../../src/lib/SpecialChar.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAAY,CAAA;AACpC;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,MAAY,CAAA"}
|
package/dist/lib/SpecialChar.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Component } from 'lakutata';
|
|
2
|
-
export declare class DeGitPuller extends Component {
|
|
3
|
-
protected readonly cache: boolean;
|
|
4
|
-
protected readonly verbose: boolean;
|
|
5
|
-
protected readonly force: boolean;
|
|
6
|
-
protected readonly baseRepo: string;
|
|
7
|
-
/**
|
|
8
|
-
* get git source
|
|
9
|
-
* @param template
|
|
10
|
-
*/
|
|
11
|
-
getGitSource(template: string): string;
|
|
12
|
-
/**
|
|
13
|
-
* Exec pull
|
|
14
|
-
* @param branch
|
|
15
|
-
* @param localTarget
|
|
16
|
-
*/
|
|
17
|
-
pull(branch: string, localTarget: string): Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=DeGitPuller.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeGitPuller.d.ts","sourceRoot":"","sources":["../../../src/lib/components/DeGitPuller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,SAAS,EAAM,MAAM,UAAU,CAAA;AAGvC,qBACa,WAAY,SAAQ,SAAS;IAGtC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAQ;IAGzC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAO;IAG1C,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAO;IAGxC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IAEnC;;;OAGG;IACI,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAI7C;;;;OAIG;IACU,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAOxE"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.DeGitPuller = void 0;
|
|
16
|
-
const degit_1 = __importDefault(require("degit"));
|
|
17
|
-
const di_1 = require("lakutata/decorator/di");
|
|
18
|
-
const lakutata_1 = require("lakutata");
|
|
19
|
-
let DeGitPuller = class DeGitPuller extends lakutata_1.Component {
|
|
20
|
-
constructor() {
|
|
21
|
-
super(...arguments);
|
|
22
|
-
this.cache = false;
|
|
23
|
-
this.verbose = true;
|
|
24
|
-
this.force = true;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* get git source
|
|
28
|
-
* @param template
|
|
29
|
-
*/
|
|
30
|
-
getGitSource(template) {
|
|
31
|
-
return `${this.baseRepo}-${template}`;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Exec pull
|
|
35
|
-
* @param branch
|
|
36
|
-
* @param localTarget
|
|
37
|
-
*/
|
|
38
|
-
async pull(branch, localTarget) {
|
|
39
|
-
await (0, degit_1.default)(this.getGitSource(branch), {
|
|
40
|
-
cache: this.cache,
|
|
41
|
-
verbose: this.verbose,
|
|
42
|
-
force: this.force
|
|
43
|
-
}).clone(localTarget);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
exports.DeGitPuller = DeGitPuller;
|
|
47
|
-
__decorate([
|
|
48
|
-
(0, di_1.Configurable)(lakutata_1.DTO.Boolean().optional().default(false)),
|
|
49
|
-
__metadata("design:type", Boolean)
|
|
50
|
-
], DeGitPuller.prototype, "cache", void 0);
|
|
51
|
-
__decorate([
|
|
52
|
-
(0, di_1.Configurable)(lakutata_1.DTO.Boolean().optional().default(true)),
|
|
53
|
-
__metadata("design:type", Boolean)
|
|
54
|
-
], DeGitPuller.prototype, "verbose", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
(0, di_1.Configurable)(lakutata_1.DTO.Boolean().optional().default(true)),
|
|
57
|
-
__metadata("design:type", Boolean)
|
|
58
|
-
], DeGitPuller.prototype, "force", void 0);
|
|
59
|
-
__decorate([
|
|
60
|
-
(0, di_1.Configurable)(lakutata_1.DTO.String().required()),
|
|
61
|
-
__metadata("design:type", String)
|
|
62
|
-
], DeGitPuller.prototype, "baseRepo", void 0);
|
|
63
|
-
exports.DeGitPuller = DeGitPuller = __decorate([
|
|
64
|
-
(0, di_1.Singleton)()
|
|
65
|
-
], DeGitPuller);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { type Spinner as CliSpinner } from 'cli-spinners';
|
|
3
|
-
import { Component } from 'lakutata';
|
|
4
|
-
export declare class Spinner extends Component {
|
|
5
|
-
protected readonly style: CliSpinner;
|
|
6
|
-
protected spinnerInterval: NodeJS.Timeout | null;
|
|
7
|
-
protected logUpdate: any;
|
|
8
|
-
/**
|
|
9
|
-
* Initializer
|
|
10
|
-
* @protected
|
|
11
|
-
*/
|
|
12
|
-
protected init(): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Start spinner
|
|
15
|
-
* @param description
|
|
16
|
-
*/
|
|
17
|
-
start(description?: string | (() => string)): void;
|
|
18
|
-
/**
|
|
19
|
-
* Stop spinner
|
|
20
|
-
*/
|
|
21
|
-
stop(): void;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=Spinner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.d.ts","sourceRoot":"","sources":["../../../src/lib/components/Spinner.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,KAAK,OAAO,IAAI,UAAU,EAAO,MAAM,cAAc,CAAA;AAE7D,OAAO,EAAC,SAAS,EAAC,MAAM,UAAU,CAAA;AAElC,qBACa,OAAQ,SAAQ,SAAS;IAGlC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAO;IAE3C,SAAS,CAAC,eAAe,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAO;IAEvD,SAAS,CAAC,SAAS,EAAE,GAAG,CAAA;IAExB;;;OAGG;cACa,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAKrC;;;OAGG;IACI,KAAK,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,GAAG,IAAI;IAUzD;;OAEG;IACI,IAAI,IAAI,IAAI;CAOtB"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Spinner = void 0;
|
|
13
|
-
const cli_spinners_1 = require("cli-spinners");
|
|
14
|
-
const di_1 = require("lakutata/decorator/di");
|
|
15
|
-
const lakutata_1 = require("lakutata");
|
|
16
|
-
let Spinner = class Spinner extends lakutata_1.Component {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.style = cli_spinners_1.dots;
|
|
20
|
-
this.spinnerInterval = null;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Initializer
|
|
24
|
-
* @protected
|
|
25
|
-
*/
|
|
26
|
-
async init() {
|
|
27
|
-
const logUpdatePackage = await import('log-update');
|
|
28
|
-
this.logUpdate = logUpdatePackage.default;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Start spinner
|
|
32
|
-
* @param description
|
|
33
|
-
*/
|
|
34
|
-
start(description) {
|
|
35
|
-
this.stop();
|
|
36
|
-
let i = 0;
|
|
37
|
-
this.spinnerInterval = setInterval(() => {
|
|
38
|
-
const { frames } = this.style;
|
|
39
|
-
const text = description ? `${frames[i = ++i % frames.length]} ${typeof description === 'function' ? description() : description}` : frames[i = ++i % frames.length];
|
|
40
|
-
this.logUpdate(text);
|
|
41
|
-
}, cli_spinners_1.dots.interval);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Stop spinner
|
|
45
|
-
*/
|
|
46
|
-
stop() {
|
|
47
|
-
if (this.spinnerInterval) {
|
|
48
|
-
clearInterval(this.spinnerInterval);
|
|
49
|
-
this.spinnerInterval = null;
|
|
50
|
-
this.logUpdate.clear();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
exports.Spinner = Spinner;
|
|
55
|
-
__decorate([
|
|
56
|
-
(0, di_1.Configurable)(),
|
|
57
|
-
__metadata("design:type", Object)
|
|
58
|
-
], Spinner.prototype, "style", void 0);
|
|
59
|
-
exports.Spinner = Spinner = __decorate([
|
|
60
|
-
(0, di_1.Singleton)()
|
|
61
|
-
], Spinner);
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Information } from './Information.js';
|
|
2
|
-
import { DeGitPuller } from '../components/DeGitPuller.js';
|
|
3
|
-
import { Spinner } from '../components/Spinner.js';
|
|
4
|
-
import { CreateProjectOptions } from '../../options/CreateProjectOptions.js';
|
|
5
|
-
import { Application, Provider } from 'lakutata';
|
|
6
|
-
import { Logger } from 'lakutata/com/logger';
|
|
7
|
-
import { OnlineLatestVersion } from './OnlineLatestVersion';
|
|
8
|
-
export declare class Creator extends Provider {
|
|
9
|
-
protected readonly app: Application;
|
|
10
|
-
protected readonly log: Logger;
|
|
11
|
-
protected readonly spinner: Spinner;
|
|
12
|
-
protected readonly puller: DeGitPuller;
|
|
13
|
-
protected readonly frameworkInfo: Information;
|
|
14
|
-
protected readonly onlineVersion: OnlineLatestVersion;
|
|
15
|
-
/**
|
|
16
|
-
* Check if the target path exists
|
|
17
|
-
* @param targetDirectory
|
|
18
|
-
* @param initOnly
|
|
19
|
-
* @protected
|
|
20
|
-
*/
|
|
21
|
-
protected checkTargetPathExistence(targetDirectory: string, initOnly: boolean): Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
* Check target path is a valid directory
|
|
24
|
-
* @param targetDirectory
|
|
25
|
-
* @protected
|
|
26
|
-
*/
|
|
27
|
-
protected checkTargetPathIsDirectory(targetDirectory: string): Promise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* Check target directory is empty, if the target directory is not empty, throw error and exit
|
|
30
|
-
* @param targetDirectory
|
|
31
|
-
* @param initOnly
|
|
32
|
-
* @protected
|
|
33
|
-
*/
|
|
34
|
-
protected checkTargetDirectoryIsEmpty(targetDirectory: string, initOnly: boolean): Promise<void>;
|
|
35
|
-
/**
|
|
36
|
-
* project information filling
|
|
37
|
-
* @protected
|
|
38
|
-
*/
|
|
39
|
-
protected projectInformationFilling(targetPath: string, fields: Record<string, string>): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Exec create
|
|
42
|
-
* @param options
|
|
43
|
-
*/
|
|
44
|
-
create(options: CreateProjectOptions): Promise<void>;
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=Creator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Creator.d.ts","sourceRoot":"","sources":["../../../src/lib/providers/Creator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAA;AAChD,OAAO,EAAC,oBAAoB,EAAC,MAAM,uCAAuC,CAAA;AAK1E,OAAO,EAAC,WAAW,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAC,MAAM,EAAC,MAAM,qBAAqB,CAAA;AAK1C,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAA;AAEzD,qBAAa,OAAQ,SAAQ,QAAQ;IAGjC,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,MAAM,EAAE,WAAW,CAAA;IAGtC,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAA;IAG7C,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAA;IAErD;;;;;OAKG;cACa,wBAAwB,CAAC,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAUnG;;;;OAIG;cACa,0BAA0B,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASlF;;;;;OAKG;cACa,2BAA2B,CAAC,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAStG;;;OAGG;cACa,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAW5G;;;OAGG;IAEU,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;CAyDpE"}
|