@tsed/cli 6.1.9 → 6.1.10-rc.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.
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { register } from "node:module";
3
+ import { join } from "node:path";
3
4
  import { fileURLToPath, pathToFileURL } from "node:url";
4
5
  const EXT = process.env.CLI_MODE === "ts" ? "ts" : "js";
5
- register(pathToFileURL(`${import.meta.dirname}/../loaders/alias.hook.${EXT}`), {
6
+ register(pathToFileURL(join(import.meta.dirname, `../loaders/alias.hook.${EXT}`)), {
6
7
  parentURL: import.meta.dirname,
7
8
  data: {
8
9
  "@tsed/core": fileURLToPath(import.meta.resolve("@tsed/core")),
@@ -1,10 +1,10 @@
1
1
  var GenerateCmd_1;
2
2
  import { __decorate, __metadata } from "tslib";
3
- import { Command, Inject, inject, ProjectPackageJson, SrcRendererService } from "@tsed/cli-core";
3
+ import { basename, dirname, join } from "node:path";
4
+ import { Command, Inject, ProjectPackageJson, SrcRendererService } from "@tsed/cli-core";
4
5
  import { normalizePath } from "@tsed/normalize-path";
5
6
  import { kebabCase, pascalCase } from "change-case";
6
7
  import { globbySync } from "globby";
7
- import { basename, dirname, join } from "path";
8
8
  import { ProjectConvention } from "../../interfaces/ProjectConvention.js";
9
9
  import { ClassNamePipe } from "../../pipes/ClassNamePipe.js";
10
10
  import { OutputFilePathPipe } from "../../pipes/OutputFilePathPipe.js";
@@ -1,7 +1,7 @@
1
1
  import { __decorate } from "tslib";
2
+ import { basename, join } from "node:path";
2
3
  import { CliExeca, CliFs, CliLoadFile, cliPackageJson, CliPlugins, CliService, Command, Configuration, createSubTasks, createTasksRunner, inject, PackageManager, PackageManagersModule, ProjectPackageJson, RootRendererService } from "@tsed/cli-core";
3
4
  import { kebabCase, pascalCase } from "change-case";
4
- import { basename, join } from "path";
5
5
  import { DEFAULT_TSED_TAGS } from "../../constants/index.js";
6
6
  import { ArchitectureConvention } from "../../interfaces/ArchitectureConvention.js";
7
7
  import { PlatformType } from "../../interfaces/index.js";
@@ -1,4 +1,4 @@
1
- import { dirname, join } from "path";
1
+ import { dirname, join } from "node:path";
2
2
  import { readPackageUpSync } from "read-pkg-up";
3
3
  const { path, packageJson } = readPackageUpSync({
4
4
  cwd: join(import.meta.dirname, "..", "..")
@@ -1,7 +1,15 @@
1
- import generateAliasesResolver from "esm-module-alias";
1
+ function generateAliasesResolver(aliases, options) {
2
+ return (specifier, parentModuleURL, defaultResolve) => {
3
+ if (aliases[specifier]) {
4
+ return defaultResolve(aliases[specifier], parentModuleURL);
5
+ }
6
+ return defaultResolve(specifier, parentModuleURL);
7
+ };
8
+ }
2
9
  let resolver = null;
3
10
  export async function initialize(aliases) {
4
11
  // Receives data from `register`.
12
+ // console.debug("Initializing alias hook with aliases", aliases);
5
13
  resolver = generateAliasesResolver(aliases);
6
14
  }
7
15
  export function resolve(specifier, context, nextResolve) {
@@ -1,8 +1,8 @@
1
1
  import { __decorate } from "tslib";
2
+ import { basename } from "node:path";
2
3
  import { ProjectPackageJson } from "@tsed/cli-core";
3
4
  import { inject, Injectable } from "@tsed/di";
4
5
  import { kebabCase, pascalCase } from "change-case";
5
- import { basename } from "path";
6
6
  import { ProjectConvention } from "../interfaces/ProjectConvention.js";
7
7
  import { ProvidersInfoService } from "../services/ProvidersInfoService.js";
8
8
  let ClassNamePipe = class ClassNamePipe {
@@ -1,7 +1,7 @@
1
1
  import { __decorate } from "tslib";
2
+ import { dirname, join } from "node:path";
2
3
  import { inject, Injectable, ProjectPackageJson } from "@tsed/cli-core";
3
4
  import { Inject } from "@tsed/di";
4
- import { dirname, join } from "path";
5
5
  import { ArchitectureConvention, ProjectConvention } from "../interfaces/index.js";
6
6
  import { ProvidersInfoService } from "../services/ProvidersInfoService.js";
7
7
  import { ClassNamePipe } from "./ClassNamePipe.js";
@@ -1,6 +1,6 @@
1
1
  import { __decorate } from "tslib";
2
+ import { dirname } from "node:path";
2
3
  import { Injectable } from "@tsed/di";
3
- import { dirname } from "path";
4
4
  import { NodeRuntime } from "./NodeRuntime.js";
5
5
  let BabelRuntime = class BabelRuntime extends NodeRuntime {
6
6
  constructor() {
@@ -1,6 +1,6 @@
1
1
  import { __decorate } from "tslib";
2
+ import { dirname } from "node:path";
2
3
  import { Injectable } from "@tsed/di";
3
- import { dirname } from "path";
4
4
  import { BabelRuntime } from "./BabelRuntime.js";
5
5
  let WebpackRuntime = class WebpackRuntime extends BabelRuntime {
6
6
  constructor() {