@cabloy/cli 3.1.18 → 3.1.21
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/LICENSE +0 -0
- package/README.md +0 -0
- package/dist/index.js +30 -0
- package/dist/lib/local.helper.d.ts +4 -0
- package/package.json +11 -14
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -492,19 +492,49 @@ class LocalHelper {
|
|
|
492
492
|
if (!moduleInfo) throw new Error(`module name is not valid: ${moduleName}`);
|
|
493
493
|
return moduleInfo;
|
|
494
494
|
}
|
|
495
|
+
parseModuleInfoCanonical(moduleName, moduleRole = 'module') {
|
|
496
|
+
const moduleInfo = this.parseModuleInfo(moduleName);
|
|
497
|
+
if (moduleInfo.relativeName !== moduleName) {
|
|
498
|
+
throw new Error(`${moduleRole} name must use the canonical relative module name: ${moduleInfo.relativeName}. Received: ${moduleName}. Use names like training-student, not package names or extra-suffixed names.`);
|
|
499
|
+
}
|
|
500
|
+
return moduleInfo;
|
|
501
|
+
}
|
|
495
502
|
findModule(moduleName) {
|
|
496
503
|
const moduleInfo = this.parseModuleInfo(moduleName);
|
|
497
504
|
return this.cli.modulesMeta.modules[moduleInfo.relativeName];
|
|
498
505
|
}
|
|
506
|
+
findModuleCanonical(moduleName, moduleRole = 'module') {
|
|
507
|
+
const moduleInfo = this.parseModuleInfoCanonical(moduleName, moduleRole);
|
|
508
|
+
const module = this.cli.modulesMeta.modules[moduleInfo.relativeName];
|
|
509
|
+
if (!module) {
|
|
510
|
+
throw new Error(`${moduleRole} does not exist: ${moduleName}`);
|
|
511
|
+
}
|
|
512
|
+
return module;
|
|
513
|
+
}
|
|
499
514
|
parseSuiteInfo(suiteName) {
|
|
500
515
|
const suiteInfo = ModuleInfo.parseInfoPro(suiteName, process.env.CabloyCliBrandName, 'suite');
|
|
501
516
|
if (!suiteInfo) throw new Error(`suite name is not valid: ${suiteName}`);
|
|
502
517
|
return suiteInfo;
|
|
503
518
|
}
|
|
519
|
+
parseSuiteInfoCanonical(suiteName, suiteRole = 'suite') {
|
|
520
|
+
const suiteInfo = this.parseSuiteInfo(suiteName);
|
|
521
|
+
if (suiteInfo.relativeName !== suiteName) {
|
|
522
|
+
throw new Error(`${suiteRole} name must use the canonical relative suite name: ${suiteInfo.relativeName}. Received: ${suiteName}. Use names like a-training, not package names or extra-suffixed names.`);
|
|
523
|
+
}
|
|
524
|
+
return suiteInfo;
|
|
525
|
+
}
|
|
504
526
|
findSuite(suiteName) {
|
|
505
527
|
const suiteInfo = this.parseSuiteInfo(suiteName);
|
|
506
528
|
return this.cli.modulesMeta.suites[suiteInfo.relativeName];
|
|
507
529
|
}
|
|
530
|
+
findSuiteCanonical(suiteName, suiteRole = 'suite') {
|
|
531
|
+
const suiteInfo = this.parseSuiteInfoCanonical(suiteName, suiteRole);
|
|
532
|
+
const suite = this.cli.modulesMeta.suites[suiteInfo.relativeName];
|
|
533
|
+
if (!suite) {
|
|
534
|
+
throw new Error(`${suiteRole} does not exist: ${suiteName}`);
|
|
535
|
+
}
|
|
536
|
+
return suite;
|
|
537
|
+
}
|
|
508
538
|
async ensureDir(dir) {
|
|
509
539
|
await fse.ensureDir(dir);
|
|
510
540
|
return dir;
|
|
@@ -79,9 +79,13 @@ export declare class LocalHelper {
|
|
|
79
79
|
slashPrefixForPath(count: number): string;
|
|
80
80
|
parseNameMeta(name: string, ignores?: string[]): NameMeta;
|
|
81
81
|
parseModuleInfo(moduleName: any): ModuleInfo.IModuleInfo;
|
|
82
|
+
parseModuleInfoCanonical(moduleName: any, moduleRole?: string): ModuleInfo.IModuleInfo;
|
|
82
83
|
findModule(moduleName: any): ModuleInfo.IModule;
|
|
84
|
+
findModuleCanonical(moduleName: any, moduleRole?: string): ModuleInfo.IModule;
|
|
83
85
|
parseSuiteInfo(suiteName: any): ModuleInfo.IModuleInfo;
|
|
86
|
+
parseSuiteInfoCanonical(suiteName: any, suiteRole?: string): ModuleInfo.IModuleInfo;
|
|
84
87
|
findSuite(suiteName: any): ModuleInfo.ISuite;
|
|
88
|
+
findSuiteCanonical(suiteName: any, suiteRole?: string): ModuleInfo.ISuite;
|
|
85
89
|
ensureDir(dir: any): Promise<any>;
|
|
86
90
|
pnpmInstall(): Promise<void>;
|
|
87
91
|
formatFile({ fileName, logPrefix }: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabloy/cli",
|
|
3
|
-
"version": "3.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "3.1.21",
|
|
4
|
+
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "@cabloy/cli",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"cabloy-cli",
|
|
@@ -26,19 +26,9 @@
|
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"clean": "rimraf dist tsconfig.tsbuildinfo",
|
|
31
|
-
"tsc:publish": "npm run clean && node ../cli/src/bin/vona.ts :bin:buildGeneral && tsc",
|
|
32
|
-
"prepublishOnly": "npm run tsc:publish",
|
|
33
|
-
"prepack": "clean-package",
|
|
34
|
-
"postpack": "clean-package restore"
|
|
35
|
-
},
|
|
36
29
|
"dependencies": {
|
|
37
30
|
"@babel/parser": "^7.29.2",
|
|
38
|
-
"@cabloy/module-glob": "^5.3.13",
|
|
39
31
|
"@cabloy/module-info": "^2.0.0",
|
|
40
|
-
"@cabloy/process-helper": "^3.1.8",
|
|
41
|
-
"@cabloy/utils": "^2.1.22",
|
|
42
32
|
"@cabloy/word-utils": "^2.1.8",
|
|
43
33
|
"@npmcli/config": "^10.8.1",
|
|
44
34
|
"@zhennann/common-bin": "^4.0.1",
|
|
@@ -55,6 +45,13 @@
|
|
|
55
45
|
"istextorbinary": "^3.3.0",
|
|
56
46
|
"semver": "^7.7.4",
|
|
57
47
|
"tmp": "^0.2.7",
|
|
58
|
-
"urllib": "^4.9.0"
|
|
48
|
+
"urllib": "^4.9.0",
|
|
49
|
+
"@cabloy/module-glob": "^5.3.13",
|
|
50
|
+
"@cabloy/process-helper": "^3.1.8",
|
|
51
|
+
"@cabloy/utils": "^2.1.22"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"clean": "rimraf dist tsconfig.tsbuildinfo",
|
|
55
|
+
"tsc:publish": "npm run clean && node ../cli/src/bin/vona.ts :bin:buildGeneral && tsc"
|
|
59
56
|
}
|
|
60
|
-
}
|
|
57
|
+
}
|