@tsed/cli 6.0.0-alpha.1 → 6.0.0-alpha.10
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/esm/Cli.js +0 -13
- package/lib/esm/bin/tsed.js +15 -2
- package/lib/esm/commands/add/AddCmd.js +0 -1
- package/lib/esm/commands/generate/GenerateCmd.js +5 -6
- package/lib/esm/commands/generate/ProviderTypes.js +0 -1
- package/lib/esm/commands/index.js +0 -1
- package/lib/esm/commands/init/InitCmd.js +13 -7
- package/lib/esm/commands/init/config/FeaturesPrompt.js +1 -2
- package/lib/esm/commands/init/config/InitFileSchema.js +0 -1
- package/lib/esm/commands/init/interfaces/InitCmdContext.js +0 -1
- package/lib/esm/commands/init/interfaces/InitOptions.js +5 -2
- package/lib/esm/commands/init/interfaces/InitPromptAnswers.js +2 -2
- package/lib/esm/commands/init/mappers/mapToContext.js +0 -1
- package/lib/esm/commands/init/mappers/mapUniqFeatures.js +1 -1
- package/lib/esm/commands/init/prompts/getFeaturesPrompt.js +0 -1
- package/lib/esm/commands/init/utils/hasFeature.js +0 -1
- package/lib/esm/commands/init/utils/isPlatform.js +0 -1
- package/lib/esm/commands/run/RunCmd.js +0 -1
- package/lib/esm/commands/update/UpdateCmd.js +0 -1
- package/lib/esm/constants/index.js +2 -3
- package/lib/esm/index.js +0 -1
- package/lib/esm/interfaces/ArchitectureConvention.js +1 -2
- package/lib/esm/interfaces/PlatformType.js +1 -2
- package/lib/esm/interfaces/ProjectConvention.js +1 -2
- package/lib/esm/interfaces/index.js +0 -1
- package/lib/esm/loaders/alias.hook.js +9 -0
- package/lib/esm/pipes/ClassNamePipe.js +2 -3
- package/lib/esm/pipes/OutputFilePathPipe.js +0 -1
- package/lib/esm/pipes/RoutePipe.js +3 -4
- package/lib/esm/pipes/index.js +0 -1
- package/lib/esm/platforms/InitPlatformsModule.js +0 -1
- package/lib/esm/platforms/supports/InitBasePlatform.js +0 -1
- package/lib/esm/platforms/supports/InitExpressPlatform.js +0 -1
- package/lib/esm/platforms/supports/InitKoaPlatform.js +0 -1
- package/lib/esm/runtimes/RuntimesModule.js +1 -1
- package/lib/esm/runtimes/index.js +0 -1
- package/lib/esm/runtimes/supports/BabelRuntime.js +3 -1
- package/lib/esm/runtimes/supports/BaseRuntime.js +3 -1
- package/lib/esm/runtimes/supports/BunRuntime.js +0 -1
- package/lib/esm/runtimes/supports/NodeRuntime.js +1 -2
- package/lib/esm/runtimes/supports/WebpackRuntime.js +3 -1
- package/lib/esm/services/ProvidersInfoService.js +1 -2
- package/lib/esm/utils/fillImports.js +5 -6
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/Cli.d.ts +1 -2
- package/lib/types/commands/add/AddCmd.d.ts +1 -1
- package/lib/types/commands/generate/GenerateCmd.d.ts +2 -1
- package/lib/types/commands/init/InitCmd.d.ts +3 -3
- package/lib/types/commands/init/config/FeaturesPrompt.d.ts +1 -1
- package/lib/types/commands/init/interfaces/InitCmdContext.d.ts +2 -2
- package/lib/types/commands/init/mappers/mapToContext.d.ts +1 -1
- package/lib/types/commands/init/mappers/mapUniqFeatures.d.ts +2 -2
- package/lib/types/commands/init/prompts/getFeaturesPrompt.d.ts +1 -1
- package/lib/types/commands/run/RunCmd.d.ts +1 -1
- package/lib/types/commands/update/UpdateCmd.d.ts +1 -1
- package/lib/types/constants/index.d.ts +1 -1
- package/lib/types/loaders/alias.hook.d.ts +2 -0
- package/lib/types/platforms/InitPlatformsModule.d.ts +1 -1
- package/lib/types/platforms/supports/InitExpressPlatform.d.ts +1 -1
- package/lib/types/platforms/supports/InitKoaPlatform.d.ts +1 -1
- package/lib/types/runtimes/supports/BabelRuntime.d.ts +1 -0
- package/lib/types/runtimes/supports/BaseRuntime.d.ts +1 -0
- package/lib/types/runtimes/supports/WebpackRuntime.d.ts +1 -0
- package/package.json +35 -35
- package/templates/init/.dockerignore.hbs +1 -0
- package/templates/init/.swcrc.hbs +1 -1
- package/templates/init/docker/bun/Dockerfile.hbs +2 -2
- package/templates/init/docker/npm/Dockerfile.hbs +5 -5
- package/templates/init/docker/pnpm/Dockerfile.hbs +5 -5
- package/templates/init/docker/yarn/Dockerfile.hbs +5 -5
- package/templates/init/docker/yarn_berry/Dockerfile.hbs +5 -5
- package/templates/init/pm2/bun/processes.config.cjs.hbs +23 -0
- package/templates/init/{processes.config.cjs.hbs → pm2/node-compiled/processes.config.cjs.hbs} +3 -4
- package/templates/init/pm2/node-loader/processes.config.cjs.hbs +24 -0
- package/lib/esm/Cli.js.map +0 -1
- package/lib/esm/bin/tsed.js.map +0 -1
- package/lib/esm/commands/add/AddCmd.js.map +0 -1
- package/lib/esm/commands/generate/GenerateCmd.js.map +0 -1
- package/lib/esm/commands/generate/ProviderTypes.js.map +0 -1
- package/lib/esm/commands/index.js.map +0 -1
- package/lib/esm/commands/init/InitCmd.js.map +0 -1
- package/lib/esm/commands/init/config/FeaturesPrompt.js.map +0 -1
- package/lib/esm/commands/init/config/InitFileSchema.js.map +0 -1
- package/lib/esm/commands/init/interfaces/InitCmdContext.js.map +0 -1
- package/lib/esm/commands/init/interfaces/InitOptions.js.map +0 -1
- package/lib/esm/commands/init/interfaces/InitPromptAnswers.js.map +0 -1
- package/lib/esm/commands/init/mappers/mapToContext.js.map +0 -1
- package/lib/esm/commands/init/mappers/mapUniqFeatures.js.map +0 -1
- package/lib/esm/commands/init/prompts/getFeaturesPrompt.js.map +0 -1
- package/lib/esm/commands/init/utils/hasFeature.js.map +0 -1
- package/lib/esm/commands/init/utils/isPlatform.js.map +0 -1
- package/lib/esm/commands/run/RunCmd.js.map +0 -1
- package/lib/esm/commands/update/UpdateCmd.js.map +0 -1
- package/lib/esm/constants/index.js.map +0 -1
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/interfaces/ArchitectureConvention.js.map +0 -1
- package/lib/esm/interfaces/PlatformType.js.map +0 -1
- package/lib/esm/interfaces/ProjectConvention.js.map +0 -1
- package/lib/esm/interfaces/index.js.map +0 -1
- package/lib/esm/pipes/ClassNamePipe.js.map +0 -1
- package/lib/esm/pipes/OutputFilePathPipe.js.map +0 -1
- package/lib/esm/pipes/RoutePipe.js.map +0 -1
- package/lib/esm/pipes/index.js.map +0 -1
- package/lib/esm/platforms/InitPlatformsModule.js.map +0 -1
- package/lib/esm/platforms/supports/InitBasePlatform.js.map +0 -1
- package/lib/esm/platforms/supports/InitExpressPlatform.js.map +0 -1
- package/lib/esm/platforms/supports/InitKoaPlatform.js.map +0 -1
- package/lib/esm/runtimes/RuntimesModule.js.map +0 -1
- package/lib/esm/runtimes/index.js.map +0 -1
- package/lib/esm/runtimes/supports/BabelRuntime.js.map +0 -1
- package/lib/esm/runtimes/supports/BaseRuntime.js.map +0 -1
- package/lib/esm/runtimes/supports/BunRuntime.js.map +0 -1
- package/lib/esm/runtimes/supports/NodeRuntime.js.map +0 -1
- package/lib/esm/runtimes/supports/WebpackRuntime.js.map +0 -1
- package/lib/esm/services/ProvidersInfoService.js.map +0 -1
- package/lib/esm/utils/fillImports.js.map +0 -1
package/lib/esm/Cli.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { CliCore } from "@tsed/cli-core";
|
|
2
2
|
import chalk from "chalk";
|
|
3
|
-
// @ts-ignore
|
|
4
|
-
import alias from "module-alias";
|
|
5
3
|
import commands from "./commands/index.js";
|
|
6
4
|
import { PKG, TEMPLATE_DIR } from "./constants/index.js";
|
|
7
5
|
import { ArchitectureConvention, ProjectConvention } from "./interfaces/index.js";
|
|
@@ -52,18 +50,7 @@ export class Cli extends CliCore {
|
|
|
52
50
|
};
|
|
53
51
|
const { pkg } = opts;
|
|
54
52
|
this.checkPrecondition(opts);
|
|
55
|
-
this.createAliases();
|
|
56
53
|
await this.updateNotifier(pkg);
|
|
57
54
|
return super.bootstrap(opts, Cli);
|
|
58
55
|
}
|
|
59
|
-
static createAliases() {
|
|
60
|
-
alias.addAliases({
|
|
61
|
-
"@tsed/core": require.resolve("@tsed/core"),
|
|
62
|
-
"@tsed/di": require.resolve("@tsed/di"),
|
|
63
|
-
"@tsed/schema": require.resolve("@tsed/schema"),
|
|
64
|
-
"@tsed/cli-core": require.resolve("@tsed/cli-core"),
|
|
65
|
-
"@tsed/cli": require.resolve("@tsed/cli")
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
56
|
}
|
|
69
|
-
//# sourceMappingURL=Cli.js.map
|
package/lib/esm/bin/tsed.js
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { register } from "node:module";
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4
|
+
const EXT = process.env.CLI_MODE === "ts" ? "ts" : "js";
|
|
5
|
+
register(pathToFileURL(`${import.meta.dirname}/../loaders/alias.hook.${EXT}`), {
|
|
6
|
+
parentURL: import.meta.dirname,
|
|
7
|
+
data: {
|
|
8
|
+
"@tsed/core": fileURLToPath(import.meta.resolve("@tsed/core")),
|
|
9
|
+
"@tsed/di": fileURLToPath(import.meta.resolve("@tsed/di")),
|
|
10
|
+
"@tsed/schema": fileURLToPath(import.meta.resolve("@tsed/schema")),
|
|
11
|
+
"@tsed/cli-core": fileURLToPath(import.meta.resolve("@tsed/cli-core")),
|
|
12
|
+
"@tsed/cli": fileURLToPath(import.meta.resolve("@tsed/cli"))
|
|
13
|
+
},
|
|
14
|
+
transferList: []
|
|
15
|
+
});
|
|
16
|
+
const { Cli } = await import("../Cli.js");
|
|
3
17
|
Cli.bootstrap({}).catch((error) => {
|
|
4
18
|
console.error(error);
|
|
5
19
|
process.exit(-1);
|
|
6
20
|
});
|
|
7
|
-
//# sourceMappingURL=tsed.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var GenerateCmd_1;
|
|
2
2
|
import { __decorate, __metadata } from "tslib";
|
|
3
3
|
import { Command, Inject, ProjectPackageJson, SrcRendererService } from "@tsed/cli-core";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import { normalizePath } from "@tsed/normalize-path";
|
|
5
|
+
import { kebabCase, pascalCase } from "change-case";
|
|
6
|
+
import { globbySync } from "globby";
|
|
7
7
|
import { basename, dirname, join } from "path";
|
|
8
8
|
import { ProjectConvention } from "../../interfaces/ProjectConvention.js";
|
|
9
9
|
import { ClassNamePipe } from "../../pipes/ClassNamePipe.js";
|
|
@@ -131,7 +131,7 @@ let GenerateCmd = GenerateCmd_1 = class GenerateCmd {
|
|
|
131
131
|
type = "prisma.service";
|
|
132
132
|
}
|
|
133
133
|
const symbolName = this.classNamePipe.transform({ name, type, format: ProjectConvention.DEFAULT });
|
|
134
|
-
const symbolParamName =
|
|
134
|
+
const symbolParamName = kebabCase(symbolName);
|
|
135
135
|
return fillImports({
|
|
136
136
|
...ctx,
|
|
137
137
|
type,
|
|
@@ -183,7 +183,7 @@ let GenerateCmd = GenerateCmd_1 = class GenerateCmd {
|
|
|
183
183
|
return [];
|
|
184
184
|
}
|
|
185
185
|
getDirectories(dir) {
|
|
186
|
-
const directories =
|
|
186
|
+
const directories = globbySync("**/*", {
|
|
187
187
|
cwd: join(this.srcRenderService.rootDir, dir),
|
|
188
188
|
ignore: ["__*"]
|
|
189
189
|
});
|
|
@@ -251,4 +251,3 @@ GenerateCmd = GenerateCmd_1 = __decorate([
|
|
|
251
251
|
__metadata("design:paramtypes", [ProvidersInfoService])
|
|
252
252
|
], GenerateCmd);
|
|
253
253
|
export { GenerateCmd };
|
|
254
|
-
//# sourceMappingURL=GenerateCmd.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { CliExeca, CliFs, CliLoadFile, CliPackageJson, CliPlugins, CliService, Command, Configuration, createSubTasks, createTasksRunner, Inject, PackageManager, PackageManagersModule, ProjectPackageJson, RootRendererService } from "@tsed/cli-core";
|
|
3
|
-
import {
|
|
3
|
+
import { kebabCase, pascalCase } from "change-case";
|
|
4
4
|
import { basename, join } from "path";
|
|
5
5
|
import { DEFAULT_TSED_TAGS } from "../../constants/index.js";
|
|
6
6
|
import { ArchitectureConvention } from "../../interfaces/ArchitectureConvention.js";
|
|
@@ -66,10 +66,10 @@ let InitCmd = class InitCmd {
|
|
|
66
66
|
type: "input",
|
|
67
67
|
name: "projectName",
|
|
68
68
|
message: "What is your project name",
|
|
69
|
-
default:
|
|
69
|
+
default: kebabCase(initialOptions.root),
|
|
70
70
|
when: initialOptions.root !== ".",
|
|
71
71
|
transformer(input) {
|
|
72
|
-
return
|
|
72
|
+
return kebabCase(input);
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
...getFeaturesPrompt(runtimes, packageManagers.filter((o) => o !== "bun"), initialOptions)
|
|
@@ -184,7 +184,7 @@ let InitCmd = class InitCmd {
|
|
|
184
184
|
];
|
|
185
185
|
}
|
|
186
186
|
resolveRootDir(ctx) {
|
|
187
|
-
const rootDirName =
|
|
187
|
+
const rootDirName = kebabCase(ctx.projectName || basename(this.packageJson.dir));
|
|
188
188
|
if (this.packageJson.dir.endsWith(rootDirName)) {
|
|
189
189
|
ctx.projectName = ctx.projectName || rootDirName;
|
|
190
190
|
ctx.root = ".";
|
|
@@ -267,14 +267,20 @@ let InitCmd = class InitCmd {
|
|
|
267
267
|
ctx = {
|
|
268
268
|
...ctx,
|
|
269
269
|
node: runtime instanceof NodeRuntime,
|
|
270
|
-
bun: runtime instanceof BunRuntime
|
|
270
|
+
bun: runtime instanceof BunRuntime,
|
|
271
|
+
compiled: runtime instanceof NodeRuntime && runtime.isCompiled()
|
|
271
272
|
};
|
|
273
|
+
const pm2 = ctx.bun ? "bun" : ctx.compiled ? "node-compiled" : "node-loader";
|
|
272
274
|
return this.rootRenderer.renderAll([
|
|
273
275
|
...runtime.files(),
|
|
274
276
|
"/init/.dockerignore.hbs",
|
|
275
277
|
"/init/.gitignore.hbs",
|
|
276
278
|
"/init/.barrels.json.hbs",
|
|
277
|
-
|
|
279
|
+
{
|
|
280
|
+
path: `/init/pm2/${pm2}/processes.config.cjs.hbs`,
|
|
281
|
+
output: `processes.config.cjs`,
|
|
282
|
+
replaces: [`pm2/${pm2}`]
|
|
283
|
+
},
|
|
278
284
|
"/init/docker-compose.yml.hbs",
|
|
279
285
|
{
|
|
280
286
|
path: `/init/docker/${packageManager.name}/Dockerfile.hbs`,
|
|
@@ -282,6 +288,7 @@ let InitCmd = class InitCmd {
|
|
|
282
288
|
replaces: [`docker/${packageManager.name}`]
|
|
283
289
|
},
|
|
284
290
|
"/init/README.md.hbs",
|
|
291
|
+
"/init/tsconfig.json.hbs",
|
|
285
292
|
"/init/tsconfig.base.json.hbs",
|
|
286
293
|
"/init/tsconfig.node.json.hbs",
|
|
287
294
|
ctx.testing && "/init/tsconfig.spec.json.hbs",
|
|
@@ -420,4 +427,3 @@ InitCmd = __decorate([
|
|
|
420
427
|
})
|
|
421
428
|
], InitCmd);
|
|
422
429
|
export { InitCmd };
|
|
423
|
-
//# sourceMappingURL=InitCmd.js.map
|
|
@@ -37,7 +37,7 @@ export var FeatureType;
|
|
|
37
37
|
FeatureType["ESLINT"] = "eslint";
|
|
38
38
|
FeatureType["LINT_STAGED"] = "lintstaged";
|
|
39
39
|
FeatureType["PRETTIER"] = "prettier";
|
|
40
|
-
})(FeatureType
|
|
40
|
+
})(FeatureType || (FeatureType = {}));
|
|
41
41
|
export const FeaturesMap = {
|
|
42
42
|
[PlatformType.EXPRESS]: {
|
|
43
43
|
name: "Express.js",
|
|
@@ -380,4 +380,3 @@ export const FeaturesPrompt = (availableRuntimes, availablePackageManagers) => [
|
|
|
380
380
|
choices: availablePackageManagers
|
|
381
381
|
}
|
|
382
382
|
];
|
|
383
|
-
//# sourceMappingURL=FeaturesPrompt.js.map
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { PackageManager } from "@tsed/cli-core";
|
|
2
|
+
import { ArchitectureConvention } from "../../../interfaces/ArchitectureConvention.js";
|
|
3
|
+
import { PlatformType } from "../../../interfaces/PlatformType.js";
|
|
4
|
+
import { ProjectConvention } from "../../../interfaces/ProjectConvention.js";
|
|
5
|
+
import { FeatureType } from "../config/FeaturesPrompt.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { PackageManager } from "@tsed/cli-core";
|
|
2
|
+
import { ArchitectureConvention, PlatformType, ProjectConvention } from "../../../interfaces/index.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FeatureType } from "../config/FeaturesPrompt.js";
|
|
1
2
|
export function mapUniqFeatures(answers) {
|
|
2
3
|
const features = [];
|
|
3
4
|
Object.entries(answers)
|
|
@@ -11,4 +12,3 @@ export function mapUniqFeatures(answers) {
|
|
|
11
12
|
features: [...new Set(features).values()]
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
|
-
//# sourceMappingURL=mapUniqFeatures.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { dirname, join } from "path";
|
|
2
|
-
import
|
|
3
|
-
const { path, packageJson } =
|
|
2
|
+
import { readPackageUpSync } from "read-pkg-up";
|
|
3
|
+
const { path, packageJson } = readPackageUpSync({
|
|
4
4
|
cwd: join(import.meta.dirname, "..", "..")
|
|
5
5
|
});
|
|
6
6
|
export const PKG = packageJson;
|
|
@@ -9,4 +9,3 @@ export const DEFAULT_TSED_TAGS = "latest";
|
|
|
9
9
|
export const IGNORE_VERSIONS = ["6.0.0"];
|
|
10
10
|
export const IGNORE_TAGS = false; // /alpha|beta/
|
|
11
11
|
export const TEMPLATE_DIR = join(dirname(path), "templates");
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
package/lib/esm/index.js
CHANGED
|
@@ -2,5 +2,4 @@ export var ArchitectureConvention;
|
|
|
2
2
|
(function (ArchitectureConvention) {
|
|
3
3
|
ArchitectureConvention["DEFAULT"] = "arc_default";
|
|
4
4
|
ArchitectureConvention["FEATURE"] = "feature";
|
|
5
|
-
})(ArchitectureConvention
|
|
6
|
-
//# sourceMappingURL=ArchitectureConvention.js.map
|
|
5
|
+
})(ArchitectureConvention || (ArchitectureConvention = {}));
|
|
@@ -2,5 +2,4 @@ export var ProjectConvention;
|
|
|
2
2
|
(function (ProjectConvention) {
|
|
3
3
|
ProjectConvention["DEFAULT"] = "conv_default";
|
|
4
4
|
ProjectConvention["ANGULAR"] = "angular";
|
|
5
|
-
})(ProjectConvention
|
|
6
|
-
//# sourceMappingURL=ProjectConvention.js.map
|
|
5
|
+
})(ProjectConvention || (ProjectConvention = {}));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import generateAliasesResolver from "esm-module-alias";
|
|
2
|
+
let resolver = null;
|
|
3
|
+
export async function initialize(aliases) {
|
|
4
|
+
// Receives data from `register`.
|
|
5
|
+
resolver = generateAliasesResolver(aliases);
|
|
6
|
+
}
|
|
7
|
+
export function resolve(specifier, context, nextResolve) {
|
|
8
|
+
return resolver(specifier, context, nextResolve);
|
|
9
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { Injectable, ProjectPackageJson } from "@tsed/cli-core";
|
|
3
3
|
import { Inject } from "@tsed/di";
|
|
4
|
-
import {
|
|
4
|
+
import { kebabCase, pascalCase } from "change-case";
|
|
5
5
|
import { basename } from "path";
|
|
6
6
|
import { ProjectConvention } from "../interfaces/ProjectConvention.js";
|
|
7
7
|
import { ProvidersInfoService } from "../services/ProvidersInfoService.js";
|
|
@@ -10,7 +10,7 @@ let ClassNamePipe = class ClassNamePipe {
|
|
|
10
10
|
const format = options.format || this.projectPackageJson.preferences.convention || ProjectConvention.DEFAULT;
|
|
11
11
|
const meta = this.providers.get(options.type)?.model || "{{symbolName}}.{{symbolType}}?";
|
|
12
12
|
const type = options.type.split(":").at(-1);
|
|
13
|
-
const symbolName =
|
|
13
|
+
const symbolName = kebabCase(basename(options.name)).replace(`-${type}`, "");
|
|
14
14
|
const names = meta.split(".").reduce((acc, key) => {
|
|
15
15
|
return key
|
|
16
16
|
.replace(/{{symbolName}}/gi, symbolName)
|
|
@@ -38,4 +38,3 @@ ClassNamePipe = __decorate([
|
|
|
38
38
|
Injectable()
|
|
39
39
|
], ClassNamePipe);
|
|
40
40
|
export { ClassNamePipe };
|
|
41
|
-
//# sourceMappingURL=ClassNamePipe.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
import { Injectable } from "@tsed/cli-core";
|
|
3
|
-
import {
|
|
3
|
+
import { kebabCase } from "change-case";
|
|
4
4
|
let RoutePipe = class RoutePipe {
|
|
5
5
|
transform(route) {
|
|
6
6
|
const r = route
|
|
7
7
|
.split("/")
|
|
8
8
|
.reduce((paths, path) => {
|
|
9
|
-
const word =
|
|
9
|
+
const word = kebabCase(path);
|
|
10
10
|
if (paths.includes(`${word}s`) || paths.includes(word)) {
|
|
11
11
|
return paths;
|
|
12
12
|
}
|
|
13
|
-
return [...paths,
|
|
13
|
+
return [...paths, kebabCase(path)];
|
|
14
14
|
}, [])
|
|
15
15
|
.join("/");
|
|
16
16
|
return `/${r}`.replace(/\/\//gi, "/");
|
|
@@ -20,4 +20,3 @@ RoutePipe = __decorate([
|
|
|
20
20
|
Injectable()
|
|
21
21
|
], RoutePipe);
|
|
22
22
|
export { RoutePipe };
|
|
23
|
-
//# sourceMappingURL=RoutePipe.js.map
|
package/lib/esm/pipes/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { __decorate, __metadata, __param } from "tslib";
|
|
|
2
2
|
import { PackageManagersModule, ProjectPackageJson } from "@tsed/cli-core";
|
|
3
3
|
import { Inject, Module } from "@tsed/di";
|
|
4
4
|
import { BabelRuntime } from "./supports/BabelRuntime.js";
|
|
5
|
+
import { BaseRuntime } from "./supports/BaseRuntime.js";
|
|
5
6
|
import { BunRuntime } from "./supports/BunRuntime.js";
|
|
6
7
|
import { NodeRuntime } from "./supports/NodeRuntime.js";
|
|
7
8
|
import { WebpackRuntime } from "./supports/WebpackRuntime.js";
|
|
@@ -57,4 +58,3 @@ RuntimesModule = __decorate([
|
|
|
57
58
|
__metadata("design:paramtypes", [Array])
|
|
58
59
|
], RuntimesModule);
|
|
59
60
|
export { RuntimesModule };
|
|
60
|
-
//# sourceMappingURL=RuntimesModule.js.map
|
|
@@ -8,6 +8,9 @@ let BabelRuntime = class BabelRuntime extends NodeRuntime {
|
|
|
8
8
|
this.name = "babel";
|
|
9
9
|
this.order = 1;
|
|
10
10
|
}
|
|
11
|
+
isCompiled() {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
11
14
|
files() {
|
|
12
15
|
return ["/init/.babelrc.hbs"];
|
|
13
16
|
}
|
|
@@ -42,4 +45,3 @@ BabelRuntime = __decorate([
|
|
|
42
45
|
})
|
|
43
46
|
], BabelRuntime);
|
|
44
47
|
export { BabelRuntime };
|
|
45
|
-
//# sourceMappingURL=BabelRuntime.js.map
|
|
@@ -8,6 +8,9 @@ export class BaseRuntime {
|
|
|
8
8
|
get packageManager() {
|
|
9
9
|
return this.packageManagers.get();
|
|
10
10
|
}
|
|
11
|
+
isCompiled() {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
11
14
|
files() {
|
|
12
15
|
return [];
|
|
13
16
|
}
|
|
@@ -38,4 +41,3 @@ __decorate([
|
|
|
38
41
|
Inject(CliExeca),
|
|
39
42
|
__metadata("design:type", CliExeca)
|
|
40
43
|
], BaseRuntime.prototype, "cliExeca", void 0);
|
|
41
|
-
//# sourceMappingURL=BaseRuntime.js.map
|
|
@@ -12,7 +12,7 @@ let NodeRuntime = class NodeRuntime extends BaseRuntime {
|
|
|
12
12
|
return ["/init/.swcrc.hbs", "/init/nodemon.json.hbs"];
|
|
13
13
|
}
|
|
14
14
|
startDev(main) {
|
|
15
|
-
return `nodemon
|
|
15
|
+
return `nodemon ${main}`;
|
|
16
16
|
}
|
|
17
17
|
startProd(main) {
|
|
18
18
|
return `${this.cmd} --import @swc-node/register/register-esm ${main.replace("dist", "src")}`;
|
|
@@ -41,4 +41,3 @@ NodeRuntime = __decorate([
|
|
|
41
41
|
})
|
|
42
42
|
], NodeRuntime);
|
|
43
43
|
export { NodeRuntime };
|
|
44
|
-
//# sourceMappingURL=NodeRuntime.js.map
|
|
@@ -8,6 +8,9 @@ let WebpackRuntime = class WebpackRuntime extends BabelRuntime {
|
|
|
8
8
|
this.name = "webpack";
|
|
9
9
|
this.order = 2;
|
|
10
10
|
}
|
|
11
|
+
isCompiled() {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
11
14
|
files() {
|
|
12
15
|
return [...super.files(), "/init/webpack.config.js.hbs"];
|
|
13
16
|
}
|
|
@@ -33,4 +36,3 @@ WebpackRuntime = __decorate([
|
|
|
33
36
|
})
|
|
34
37
|
], WebpackRuntime);
|
|
35
38
|
export { WebpackRuntime };
|
|
36
|
-
//# sourceMappingURL=WebpackRuntime.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
-
import { Injectable, nameOf } from "@tsed/cli-core";
|
|
2
|
+
import { Injectable, nameOf, Type } from "@tsed/cli-core";
|
|
3
3
|
let ProvidersInfoService = class ProvidersInfoService {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.map = new Map();
|
|
@@ -44,4 +44,3 @@ ProvidersInfoService = __decorate([
|
|
|
44
44
|
Injectable()
|
|
45
45
|
], ProvidersInfoService);
|
|
46
46
|
export { ProvidersInfoService };
|
|
47
|
-
//# sourceMappingURL=ProvidersInfoService.js.map
|
|
@@ -6,11 +6,11 @@ export function fillImports(ctx) {
|
|
|
6
6
|
});
|
|
7
7
|
const isFeature = ctx.architecture === ArchitectureConvention.FEATURE;
|
|
8
8
|
ctx.barrels = JSON.stringify([
|
|
9
|
-
isFeature ? "./src/rest
|
|
10
|
-
ctx.swagger && (isFeature ? "./src/pages
|
|
11
|
-
ctx.oidc && "./src/interactions
|
|
12
|
-
ctx.graphql && "./src/datasources
|
|
13
|
-
ctx.graphql && "./src/resolvers
|
|
9
|
+
isFeature ? "./src/rest" : "./src/controllers/rest",
|
|
10
|
+
ctx.swagger && (isFeature ? "./src/pages" : "./src/controllers/pages"),
|
|
11
|
+
ctx.oidc && "./src/interactions",
|
|
12
|
+
ctx.graphql && "./src/datasources",
|
|
13
|
+
ctx.graphql && "./src/resolvers"
|
|
14
14
|
].filter(Boolean));
|
|
15
15
|
ctx.imports = [
|
|
16
16
|
ctx.express && { from: "@tsed/platform-express", comment: " // /!\\ keep this import" },
|
|
@@ -33,4 +33,3 @@ export function fillImports(ctx) {
|
|
|
33
33
|
].filter(Boolean);
|
|
34
34
|
return ctx;
|
|
35
35
|
}
|
|
36
|
-
//# sourceMappingURL=fillImports.js.map
|