@nestia/core 12.0.0-dev.20260612.2 → 12.0.0-dev.20260619.1

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/MIGRATION.md CHANGED
@@ -112,11 +112,11 @@ binary, but tooling may still inspect the entry.
112
112
 
113
113
  ### 7. Internal symbols removed
114
114
 
115
- The `INestiaTransformOptions`, `INestiaTransformProject`, `PlainBodyProgrammer`, `TypedBodyProgrammer`, and the `programmers/` / `transformers/` directories were deleted. None were exported from `module.ts`; if your code imported them via deep paths it must be rewritten against the new pipeline or migrated to `@nestia/factory`.
115
+ The `INestiaTransformOptions`, `INestiaTransformProject`, `PlainBodyProgrammer`, `TypedBodyProgrammer`, and the `programmers/` / `transformers/` directories were deleted. None were exported from `module.ts`; if your code imported them via deep paths it must be rewritten against the new pipeline or migrated to `@ttsc/factory`.
116
116
 
117
- ### 8. `@nestia/factory` is a new published package
117
+ ### 8. AST factory: `@ttsc/factory`
118
118
 
119
- `@nestia/factory` provides a printer-compatible TypeScript AST factory used by `@nestia/sdk` and `@nestia/migrate`. Third-party code generators that previously reached into `@nestia/core`'s internal `factories/` can depend on `@nestia/factory` directly. The surface tracks internal needs but is publicly consumable.
119
+ `@nestia/sdk` and `@nestia/migrate` build TypeScript source through [`@ttsc/factory`](https://www.npmjs.com/package/@ttsc/factory), a dependency-free, printer-compatible AST factory and printer that keeps working after the TypeScript-Go (tsgo) migration. Third-party code generators that previously reached into `@nestia/core`'s internal `factories/` can depend on `@ttsc/factory` directly.
120
120
 
121
121
  ### 9. Runtime requirement: Go 1.26+ on PATH
122
122
 
@@ -1,10 +1,10 @@
1
+ import type { ITtscPlugin, ITtscPluginFactoryContext } from "ttsc";
1
2
  /**
2
3
  * `@nestia/core` ttsc plugin descriptor.
3
4
  *
4
5
  * `@nestia/sdk` is not a standalone plugin: its Go transform is declared here
5
- * as a `contributor` that ttsc statically links into this host binary, and
6
- * only when `@nestia/sdk` is actually resolvable from the project. A project
6
+ * as a `contributor` that ttsc statically links into this host binary, and only
7
+ * when `@nestia/sdk` is actually resolvable from the project. A project
7
8
  * depending on `@nestia/core` alone never compiles any SDK transform code.
8
9
  */
9
- export declare function createTtscPlugin(context: ITtscPluginFactoryContext): ITtscPlugin;
10
- export default createTtscPlugin;
10
+ export default function createTtscPlugin(context: ITtscPluginFactoryContext): ITtscPlugin;
package/lib/transform.js CHANGED
@@ -3,68 +3,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createTtscPlugin = createTtscPlugin;
7
- const node_fs_1 = __importDefault(require("node:fs"));
6
+ exports.default = createTtscPlugin;
7
+ const node_module_1 = require("node:module");
8
8
  const node_path_1 = __importDefault(require("node:path"));
9
- const node_url_1 = require("node:url");
10
- const filename = currentFilename();
11
- const dirname = node_path_1.default.dirname(filename);
12
9
  /**
13
10
  * `@nestia/core` ttsc plugin descriptor.
14
11
  *
15
12
  * `@nestia/sdk` is not a standalone plugin: its Go transform is declared here
16
- * as a `contributor` that ttsc statically links into this host binary, and
17
- * only when `@nestia/sdk` is actually resolvable from the project. A project
13
+ * as a `contributor` that ttsc statically links into this host binary, and only
14
+ * when `@nestia/sdk` is actually resolvable from the project. A project
18
15
  * depending on `@nestia/core` alone never compiles any SDK transform code.
19
16
  */
20
17
  function createTtscPlugin(context) {
21
- const plugin = {
18
+ const requireFrom = (0, node_module_1.createRequire)(node_path_1.default.join(context.projectRoot, "package.json"));
19
+ const root = node_path_1.default.dirname(requireFrom.resolve("@nestia/core/package.json"));
20
+ return {
22
21
  name: "@nestia/core",
23
- source: node_path_1.default.resolve(root(context), "native", "cmd", "ttsc-nestia"),
24
- composes: ["typia/lib/transform"],
22
+ source: node_path_1.default.resolve(root, "native", "cmd", "ttsc-nestia"),
25
23
  };
26
- const sdk = resolveSdkContributorSource(context);
27
- if (sdk !== null)
28
- plugin.contributors = [{ name: "sdk", source: sdk }];
29
- return plugin;
30
- }
31
- exports.default = createTtscPlugin;
32
- function root(context) {
33
- var _a;
34
- return ((_a = resolvePackageRoot("@nestia/core/package.json", context.projectRoot)) !== null && _a !== void 0 ? _a : node_path_1.default.resolve(dirname, ".."));
35
- }
36
- function resolveSdkContributorSource(context) {
37
- const manifest = resolvePackageRoot("@nestia/sdk/package.json", context.projectRoot);
38
- if (manifest === null)
39
- return null;
40
- const source = node_path_1.default.resolve(manifest, "native", "sdk");
41
- return node_fs_1.default.existsSync(source) ? source : null;
42
- }
43
- function resolvePackageRoot(packageJson, projectRoot) {
44
- try {
45
- return node_path_1.default.dirname(require.resolve(packageJson, { paths: [dirname, projectRoot] }));
46
- }
47
- catch (_a) {
48
- return null;
49
- }
50
- }
51
- function currentFilename() {
52
- var _a;
53
- var _b, _c;
54
- if (typeof __filename === "string" &&
55
- __filename !== "[stdin]" &&
56
- __filename.length !== 0)
57
- return normalizeFilename(__filename);
58
- const line = (_a = new Error().stack) === null || _a === void 0 ? void 0 : _a.split("\n").find((entry) => entry.includes("/src/transform.ts") ||
59
- entry.includes("/lib/transform.js") ||
60
- entry.includes("/lib/transform.mjs"));
61
- const matched = line === null || line === void 0 ? void 0 : line.match(/\(([^()]+):\d+:\d+\)|at ([^\s()]+):\d+:\d+/);
62
- const fallback = typeof __filename === "string" ? __filename : "";
63
- return normalizeFilename((_c = (_b = matched === null || matched === void 0 ? void 0 : matched[1]) !== null && _b !== void 0 ? _b : matched === null || matched === void 0 ? void 0 : matched[2]) !== null && _c !== void 0 ? _c : fallback);
64
- }
65
- function normalizeFilename(value) {
66
- if (value.startsWith("file:"))
67
- return (0, node_url_1.fileURLToPath)(value);
68
- return value;
69
24
  }
70
25
  //# sourceMappingURL=transform.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transform.js","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAC7B,uCAAyC;AAez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","sources":["../src/transform.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA4C;AAC5C,0DAA6B;AAG7B;;;;;;;GAOG;AACH,0BACE,OAAkC;IAElC,MAAM,WAAW,GAAG,IAAA,2BAAa,EAC/B,mBAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,cAAc,CAAC,CAC/C,CAAC;IACF,MAAM,IAAI,GAAW,mBAAI,CAAC,OAAO,CAC/B,WAAW,CAAC,OAAO,CAAC,2BAA2B,CAAC,CACjD,CAAC;IACF,OAAO;QACL,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,mBAAI,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,CAAC;KAC3D,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestia/core",
3
- "version": "12.0.0-dev.20260612.2",
3
+ "version": "12.0.0-dev.20260619.1",
4
4
  "description": "Super-fast validation decorators of NestJS",
5
5
  "types": "lib/index.d.ts",
6
6
  "main": "lib/index.js",
@@ -46,8 +46,8 @@
46
46
  },
47
47
  "homepage": "https://nestia.io",
48
48
  "dependencies": {
49
- "@typia/interface": "13.0.0-dev.20260612.1",
50
- "@typia/utils": "13.0.0-dev.20260612.1",
49
+ "@typia/interface": "13.0.0-dev.20260619.1",
50
+ "@typia/utils": "13.0.0-dev.20260619.1",
51
51
  "get-function-location": "^2.0.0",
52
52
  "glob": "^11.0.3",
53
53
  "path-parser": "^6.1.0",
@@ -55,9 +55,9 @@
55
55
  "reflect-metadata": ">=0.1.12",
56
56
  "rxjs": ">=6.0.3",
57
57
  "tgrid": "^1.1.0",
58
- "typia": "13.0.0-dev.20260612.1",
58
+ "typia": "13.0.0-dev.20260619.1",
59
59
  "ws": "^7.5.3",
60
- "@nestia/fetcher": "^12.0.0-dev.20260612.2"
60
+ "@nestia/fetcher": "^12.0.0-dev.20260619.1"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@modelcontextprotocol/sdk": "^1.18.0",
@@ -65,8 +65,8 @@
65
65
  "@nestjs/core": ">=7.0.1",
66
66
  "reflect-metadata": ">=0.1.12",
67
67
  "rxjs": ">=6.0.3",
68
- "typia": "13.0.0-dev.20260612.1",
69
- "@nestia/fetcher": "^12.0.0-dev.20260612.2"
68
+ "typia": "13.0.0-dev.20260619.1",
69
+ "@nestia/fetcher": "^12.0.0-dev.20260619.1"
70
70
  },
71
71
  "peerDependenciesMeta": {
72
72
  "@modelcontextprotocol/sdk": {
@@ -78,14 +78,14 @@
78
78
  "@nestjs/common": "^11.1.6",
79
79
  "@nestjs/core": "^11.1.6",
80
80
  "@nestjs/platform-express": "^11.1.6",
81
- "@typescript/native-preview": "7.0.0-dev.20260518.1",
82
81
  "@types/express": "^4.17.15",
83
82
  "@types/multer": "^1.4.12",
84
83
  "@types/ws": "^8.5.10",
85
84
  "fastify": "^4.28.1",
86
85
  "rimraf": "^6.1.3",
87
- "ttsc": "^0.15.3",
88
- "tstl": "^3.0.0"
86
+ "ttsc": "^0.16.2",
87
+ "tstl": "^3.0.0",
88
+ "typescript": "7.0.1-rc"
89
89
  },
90
90
  "files": [
91
91
  "README.md",
package/src/transform.ts CHANGED
@@ -1,101 +1,26 @@
1
- import fs from "node:fs";
1
+ import { createRequire } from "node:module";
2
2
  import path from "node:path";
3
- import { fileURLToPath } from "node:url";
4
-
5
- /** @internal */
6
- interface ITtscPluginFactoryContext {
7
- projectRoot: string;
8
- }
9
-
10
- /** @internal */
11
- interface ITtscPlugin {
12
- name: string;
13
- source: string;
14
- composes: string[];
15
- contributors?: { name: string; source: string }[];
16
- }
17
-
18
- const filename: string = currentFilename();
19
- const dirname: string = path.dirname(filename);
3
+ import type { ITtscPlugin, ITtscPluginFactoryContext } from "ttsc";
20
4
 
21
5
  /**
22
6
  * `@nestia/core` ttsc plugin descriptor.
23
7
  *
24
8
  * `@nestia/sdk` is not a standalone plugin: its Go transform is declared here
25
- * as a `contributor` that ttsc statically links into this host binary, and
26
- * only when `@nestia/sdk` is actually resolvable from the project. A project
9
+ * as a `contributor` that ttsc statically links into this host binary, and only
10
+ * when `@nestia/sdk` is actually resolvable from the project. A project
27
11
  * depending on `@nestia/core` alone never compiles any SDK transform code.
28
12
  */
29
- export function createTtscPlugin(
13
+ export default function createTtscPlugin(
30
14
  context: ITtscPluginFactoryContext,
31
15
  ): ITtscPlugin {
32
- const plugin: ITtscPlugin = {
33
- name: "@nestia/core",
34
- source: path.resolve(root(context), "native", "cmd", "ttsc-nestia"),
35
- composes: ["typia/lib/transform"],
36
- };
37
- const sdk: string | null = resolveSdkContributorSource(context);
38
- if (sdk !== null) plugin.contributors = [{ name: "sdk", source: sdk }];
39
- return plugin;
40
- }
41
- export default createTtscPlugin;
42
-
43
- function root(context: ITtscPluginFactoryContext): string {
44
- return (
45
- resolvePackageRoot("@nestia/core/package.json", context.projectRoot) ??
46
- path.resolve(dirname, "..")
47
- );
48
- }
49
-
50
- function resolveSdkContributorSource(
51
- context: ITtscPluginFactoryContext,
52
- ): string | null {
53
- const manifest: string | null = resolvePackageRoot(
54
- "@nestia/sdk/package.json",
55
- context.projectRoot,
16
+ const requireFrom = createRequire(
17
+ path.join(context.projectRoot, "package.json"),
56
18
  );
57
- if (manifest === null) return null;
58
- const source: string = path.resolve(manifest, "native", "sdk");
59
- return fs.existsSync(source) ? source : null;
60
- }
61
-
62
- function resolvePackageRoot(
63
- packageJson: string,
64
- projectRoot: string,
65
- ): string | null {
66
- try {
67
- return path.dirname(
68
- require.resolve(packageJson, { paths: [dirname, projectRoot] }),
69
- );
70
- } catch {
71
- return null;
72
- }
73
- }
74
-
75
- function currentFilename(): string {
76
- if (
77
- typeof __filename === "string" &&
78
- __filename !== "[stdin]" &&
79
- __filename.length !== 0
80
- )
81
- return normalizeFilename(__filename);
82
-
83
- const line: string | undefined = new Error().stack
84
- ?.split("\n")
85
- .find(
86
- (entry) =>
87
- entry.includes("/src/transform.ts") ||
88
- entry.includes("/lib/transform.js") ||
89
- entry.includes("/lib/transform.mjs"),
90
- );
91
- const matched: RegExpMatchArray | null | undefined = line?.match(
92
- /\(([^()]+):\d+:\d+\)|at ([^\s()]+):\d+:\d+/,
19
+ const root: string = path.dirname(
20
+ requireFrom.resolve("@nestia/core/package.json"),
93
21
  );
94
- const fallback: string = typeof __filename === "string" ? __filename : "";
95
- return normalizeFilename(matched?.[1] ?? matched?.[2] ?? fallback);
96
- }
97
-
98
- function normalizeFilename(value: string): string {
99
- if (value.startsWith("file:")) return fileURLToPath(value);
100
- return value;
22
+ return {
23
+ name: "@nestia/core",
24
+ source: path.resolve(root, "native", "cmd", "ttsc-nestia"),
25
+ };
101
26
  }