@tsed/cli-core 4.0.0-rc.3 → 4.0.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/lib/cjs/services/CliFs.js +2 -2
- package/lib/cjs/services/CliFs.js.map +1 -1
- package/lib/cjs/utils/index.js +0 -1
- package/lib/cjs/utils/index.js.map +1 -1
- package/lib/esm/services/CliFs.js +1 -1
- package/lib/esm/services/CliFs.js.map +1 -1
- package/lib/esm/utils/index.js +0 -1
- package/lib/esm/utils/index.js.map +1 -1
- package/lib/types/utils/index.d.ts +0 -1
- package/package.json +5 -8
- package/lib/cjs/utils/normalizePath.js +0 -19
- package/lib/cjs/utils/normalizePath.js.map +0 -1
- package/lib/esm/utils/normalizePath.js +0 -14
- package/lib/esm/utils/normalizePath.js.map +0 -1
- package/lib/types/utils/normalizePath.d.ts +0 -2
|
@@ -5,14 +5,14 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const di_1 = require("@tsed/di");
|
|
6
6
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
7
7
|
const path_1 = require("path");
|
|
8
|
-
const
|
|
8
|
+
const core_1 = require("@tsed/core");
|
|
9
9
|
let CliFs = class CliFs {
|
|
10
10
|
raw = fs_extra_1.default;
|
|
11
11
|
exists(path) {
|
|
12
12
|
return this.raw.existsSync(path);
|
|
13
13
|
}
|
|
14
14
|
join(...args) {
|
|
15
|
-
return (0,
|
|
15
|
+
return (0, core_1.normalizePath)((0, path_1.join)(...args));
|
|
16
16
|
}
|
|
17
17
|
async readFile(file, encoding) {
|
|
18
18
|
return this.raw.readFile(file, encoding);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CliFs.js","sourceRoot":"","sources":["../../../src/services/CliFs.ts"],"names":[],"mappings":";;;;AAAA,iCAAoC;AAEpC,gEAA0B;AAE1B,+BAA0B;AAC1B,
|
|
1
|
+
{"version":3,"file":"CliFs.js","sourceRoot":"","sources":["../../../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,IAAI,CAAC,EAAE,IAAA,WAAI,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAA,WAAI,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAChI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAClB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,GAAW,EAAE,OAAe,OAAO,CAAC,GAAG,EAAE;QAC1D,IAAI;YACF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;gBAC1C,OAAO,gEAAa,GAAG,GAAC,CAAC;aAC1B;SACF;QAAC,OAAO,EAAE,EAAE,GAAE;QAEf,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,IAAA,WAAI,EAAC,cAAc,EAAE,GAAG,CAAC,CAAC,CAAC;QAE9D,IAAI,IAAI,EAAE;YACR,iEAAc,IAAI,IAAE;SACrB;QAED,iEAAc,GAAG,IAAE;IACrB,CAAC;CACF,CAAA;AApDY,KAAK;IADjB,IAAA,eAAU,GAAE;GACA,KAAK,CAoDjB;AApDY,sBAAK","sourcesContent":["import {Injectable} from \"@tsed/di\";\nimport {PathLike, WriteFileOptions} from \"fs\";\nimport Fs from \"fs-extra\";\nimport {EnsureOptions} from \"fs-extra\";\nimport {join} from \"path\";\nimport {normalizePath} from \"@tsed/core\";\n\n@Injectable()\nexport class CliFs {\n raw = Fs;\n\n exists(path: string) {\n return this.raw.existsSync(path);\n }\n\n join(...args: string[]) {\n return normalizePath(join(...args));\n }\n\n async readFile(file: string | Buffer | number, encoding?: any): Promise<string> {\n return this.raw.readFile(file, encoding) as any;\n }\n\n writeFileSync(path: PathLike | number, data: any, options?: WriteFileOptions) {\n return this.raw.writeFileSync(path, data, options);\n }\n\n writeFile(file: string | Buffer | number, data: any, options?: WriteFileOptions | string) {\n return this.raw.writeFile(file, data, options as any);\n }\n\n ensureDir(path: string, options?: EnsureOptions | number) {\n return this.raw.ensureDir(path, options);\n }\n\n ensureDirSync(path: string, options?: EnsureOptions | number): void {\n return this.raw.ensureDirSync(path, options);\n }\n\n findUpFile(root: string, file: string) {\n return [join(root, file), join(root, \"..\", file), join(root, \"..\", \"..\", file), join(root, \"..\", \"..\", \"..\", file)].find((path) =>\n this.exists(path)\n );\n }\n\n async importModule(mod: string, root: string = process.cwd()) {\n try {\n if (process.env.NODE_ENV === \"development\") {\n return await import(mod);\n }\n } catch (er) {}\n\n const path = this.findUpFile(root, join(\"node_modules\", mod));\n\n if (path) {\n return import(path);\n }\n\n return import(mod);\n }\n}\n"]}
|
package/lib/cjs/utils/index.js
CHANGED
|
@@ -10,7 +10,6 @@ tslib_1.__exportStar(require("./mapCommanderArgs"), exports);
|
|
|
10
10
|
tslib_1.__exportStar(require("./mapCommanderOptions"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./parseOption"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./createTasksRunner"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./normalizePath"), exports);
|
|
14
13
|
tslib_1.__exportStar(require("./getPackageJson"), exports);
|
|
15
14
|
tslib_1.__exportStar(require("./getTemplateDirectory"), exports);
|
|
16
15
|
var filedirname_1 = require("filedirname");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;AAAA,2DAAiC;AACjC,+DAAqC;AACrC,wDAA8B;AAC9B,sDAA4B;AAC5B,6DAAmC;AACnC,gEAAsC;AACtC,wDAA8B;AAC9B,8DAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;AAAA,2DAAiC;AACjC,+DAAqC;AACrC,wDAA8B;AAC9B,sDAA4B;AAC5B,6DAAmC;AACnC,gEAAsC;AACtC,wDAA8B;AAC9B,8DAAoC;AACpC,2DAAiC;AACjC,iEAAuC;AACvC,2CAAmD;AAA3C,mIAAA,OAAO,OAAe","sourcesContent":["export * from \"./createInjector\";\nexport * from \"./getCommandMetadata\";\nexport * from \"./loadPlugins\";\nexport * from \"./logToCurl\";\nexport * from \"./mapCommanderArgs\";\nexport * from \"./mapCommanderOptions\";\nexport * from \"./parseOption\";\nexport * from \"./createTasksRunner\";\nexport * from \"./getPackageJson\";\nexport * from \"./getTemplateDirectory\";\nexport {default as filedirname} from \"filedirname\";\n"]}
|
|
@@ -2,7 +2,7 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { Injectable } from "@tsed/di";
|
|
3
3
|
import Fs from "fs-extra";
|
|
4
4
|
import { join } from "path";
|
|
5
|
-
import { normalizePath } from "
|
|
5
|
+
import { normalizePath } from "@tsed/core";
|
|
6
6
|
let CliFs = class CliFs {
|
|
7
7
|
raw = Fs;
|
|
8
8
|
exists(path) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CliFs.js","sourceRoot":"","sources":["../../../src/services/CliFs.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEpC,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAC,aAAa,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"CliFs.js","sourceRoot":"","sources":["../../../src/services/CliFs.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEpC,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAC1B,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAGzC,IAAa,KAAK,GAAlB,MAAa,KAAK;IAChB,GAAG,GAAG,EAAE,CAAC;I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AI,EAAE,EAAE,CAChI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAClB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,GAAW,EAAE,OAAe,OAAO,CAAC,GAAG,EAAE;QAC1D,IAAI;YACF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;gBAC1C,OAAO,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC;aAC1B;SACF;QAAC,OAAO,EAAE,EAAE,GAAE;QAEf,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,CAAC;QAE9D,IAAI,IAAI,EAAE;YACR,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;SACrB;QAED,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;CACF,CAAA;AApDY,KAAK;IADjB,UAAU,EAAE;GACA,KAAK,CAoDjB;SApDY,KAAK","sourcesContent":["import {Injectable} from \"@tsed/di\";\nimport {PathLike, WriteFileOptions} from \"fs\";\nimport Fs from \"fs-extra\";\nimport {EnsureOptions} from \"fs-extra\";\nimport {join} from \"path\";\nimport {normalizePath} from \"@tsed/core\";\n\n@Injectable()\nexport class CliFs {\n raw = Fs;\n\n exists(path: string) {\n return this.raw.existsSync(path);\n }\n\n join(...args: string[]) {\n return normalizePath(join(...args));\n }\n\n async readFile(file: string | Buffer | number, encoding?: any): Promise<string> {\n return this.raw.readFile(file, encoding) as any;\n }\n\n writeFileSync(path: PathLike | number, data: any, options?: WriteFileOptions) {\n return this.raw.writeFileSync(path, data, options);\n }\n\n writeFile(file: string | Buffer | number, data: any, options?: WriteFileOptions | string) {\n return this.raw.writeFile(file, data, options as any);\n }\n\n ensureDir(path: string, options?: EnsureOptions | number) {\n return this.raw.ensureDir(path, options);\n }\n\n ensureDirSync(path: string, options?: EnsureOptions | number): void {\n return this.raw.ensureDirSync(path, options);\n }\n\n findUpFile(root: string, file: string) {\n return [join(root, file), join(root, \"..\", file), join(root, \"..\", \"..\", file), join(root, \"..\", \"..\", \"..\", file)].find((path) =>\n this.exists(path)\n );\n }\n\n async importModule(mod: string, root: string = process.cwd()) {\n try {\n if (process.env.NODE_ENV === \"development\") {\n return await import(mod);\n }\n } catch (er) {}\n\n const path = this.findUpFile(root, join(\"node_modules\", mod));\n\n if (path) {\n return import(path);\n }\n\n return import(mod);\n }\n}\n"]}
|
package/lib/esm/utils/index.js
CHANGED
|
@@ -6,7 +6,6 @@ export * from "./mapCommanderArgs.js";
|
|
|
6
6
|
export * from "./mapCommanderOptions.js";
|
|
7
7
|
export * from "./parseOption.js";
|
|
8
8
|
export * from "./createTasksRunner.js";
|
|
9
|
-
export * from "./normalizePath.js";
|
|
10
9
|
export * from "./getPackageJson.js";
|
|
11
10
|
export * from "./getTemplateDirectory.js";
|
|
12
11
|
export { default as filedirname } from "filedirname";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,aAAa,CAAC","sourcesContent":["export * from \"./createInjector\";\nexport * from \"./getCommandMetadata\";\nexport * from \"./loadPlugins\";\nexport * from \"./logToCurl\";\nexport * from \"./mapCommanderArgs\";\nexport * from \"./mapCommanderOptions\";\nexport * from \"./parseOption\";\nexport * from \"./createTasksRunner\";\nexport * from \"./getPackageJson\";\nexport * from \"./getTemplateDirectory\";\nexport {default as filedirname} from \"filedirname\";\n"]}
|
|
@@ -6,7 +6,6 @@ export * from "./mapCommanderArgs";
|
|
|
6
6
|
export * from "./mapCommanderOptions";
|
|
7
7
|
export * from "./parseOption";
|
|
8
8
|
export * from "./createTasksRunner";
|
|
9
|
-
export * from "./normalizePath";
|
|
10
9
|
export * from "./getPackageJson";
|
|
11
10
|
export * from "./getTemplateDirectory";
|
|
12
11
|
export { default as filedirname } from "filedirname";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/cli-core",
|
|
3
|
-
"version": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Build your CLI with TypeScript and Decorators",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
@@ -78,17 +78,14 @@
|
|
|
78
78
|
"@types/url-parse": "^1.4.3"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"@tsed/core": ">=7.0.0
|
|
82
|
-
"@tsed/di": ">=7.0.0
|
|
81
|
+
"@tsed/core": ">=7.0.0",
|
|
82
|
+
"@tsed/di": ">=7.0.0"
|
|
83
83
|
},
|
|
84
84
|
"repository": "https://github.com/tsedio/tsed-cli",
|
|
85
85
|
"bugs": {
|
|
86
86
|
"url": "https://github.com/tsedio/tsed-cli/issues"
|
|
87
87
|
},
|
|
88
|
-
"homepage": "https://github.com/tsedio/tsed-cli/tree/
|
|
88
|
+
"homepage": "https://github.com/tsedio/tsed-cli/tree/master/packages/cli-core",
|
|
89
89
|
"author": "Romain Lenzotti",
|
|
90
|
-
"license": "MIT"
|
|
91
|
-
"publishConfig": {
|
|
92
|
-
"tag": "rc"
|
|
93
|
-
}
|
|
90
|
+
"license": "MIT"
|
|
94
91
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizePath = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const core_1 = require("@tsed/core");
|
|
6
|
-
const path_1 = require("path");
|
|
7
|
-
const normalize_path_1 = tslib_1.__importDefault(require("normalize-path"));
|
|
8
|
-
function normalizePath(item, ...paths) {
|
|
9
|
-
if ((0, core_1.isString)(item)) {
|
|
10
|
-
const path = (0, path_1.join)(item, ...paths);
|
|
11
|
-
return (0, normalize_path_1.default)(path);
|
|
12
|
-
}
|
|
13
|
-
if ((0, core_1.isArray)(item)) {
|
|
14
|
-
return item.map((item) => normalizePath(item));
|
|
15
|
-
}
|
|
16
|
-
return item;
|
|
17
|
-
}
|
|
18
|
-
exports.normalizePath = normalizePath;
|
|
19
|
-
//# sourceMappingURL=normalizePath.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalizePath.js","sourceRoot":"","sources":["../../../src/utils/normalizePath.ts"],"names":[],"mappings":";;;;AAAA,qCAA6C;AAC7C,+BAA0B;AAC1B,4EAAqC;AAIrC,SAAgB,aAAa,CAAC,IAAS,EAAE,GAAG,KAAe;IACzD,IAAI,IAAA,eAAQ,EAAC,IAAI,CAAC,EAAE;QAClB,MAAM,IAAI,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;QAClC,OAAO,IAAA,wBAAO,EAAC,IAAI,CAAC,CAAC;KACtB;IAED,IAAI,IAAA,cAAO,EAAC,IAAI,CAAC,EAAE;QACjB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;KACrD;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAXD,sCAWC","sourcesContent":["import {isArray, isString} from \"@tsed/core\";\nimport {join} from \"path\";\nimport fixPath from \"normalize-path\";\n\nexport function normalizePath(item: string, ...paths: string[]): string;\nexport function normalizePath(item: (string | any)[]): (string | any)[];\nexport function normalizePath(item: any, ...paths: string[]) {\n if (isString(item)) {\n const path = join(item, ...paths);\n return fixPath(path);\n }\n\n if (isArray(item)) {\n return item.map((item: any) => normalizePath(item));\n }\n\n return item;\n}\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { isArray, isString } from "@tsed/core";
|
|
2
|
-
import { join } from "path";
|
|
3
|
-
import fixPath from "normalize-path";
|
|
4
|
-
export function normalizePath(item, ...paths) {
|
|
5
|
-
if (isString(item)) {
|
|
6
|
-
const path = join(item, ...paths);
|
|
7
|
-
return fixPath(path);
|
|
8
|
-
}
|
|
9
|
-
if (isArray(item)) {
|
|
10
|
-
return item.map((item) => normalizePath(item));
|
|
11
|
-
}
|
|
12
|
-
return item;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=normalizePath.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalizePath.js","sourceRoot":"","sources":["../../../src/utils/normalizePath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAC,IAAI,EAAC,MAAM,MAAM,CAAC;AAC1B,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAIrC,MAAM,UAAU,aAAa,CAAC,IAAS,EAAE,GAAG,KAAe;IACzD,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;QAClB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;QAClC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;KACtB;IAED,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE;QACjB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;KACrD;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import {isArray, isString} from \"@tsed/core\";\nimport {join} from \"path\";\nimport fixPath from \"normalize-path\";\n\nexport function normalizePath(item: string, ...paths: string[]): string;\nexport function normalizePath(item: (string | any)[]): (string | any)[];\nexport function normalizePath(item: any, ...paths: string[]) {\n if (isString(item)) {\n const path = join(item, ...paths);\n return fixPath(path);\n }\n\n if (isArray(item)) {\n return item.map((item: any) => normalizePath(item));\n }\n\n return item;\n}\n"]}
|