@travetto/transformer 3.4.1 → 4.0.0-rc.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/README.md CHANGED
@@ -104,11 +104,11 @@ export class Test {
104
104
  Object.defineProperty(exports, "__esModule", { value: true });
105
105
  exports.TEST = void 0;
106
106
  const tslib_1 = require("tslib");
107
- const Ⲑ_root_index_1 = tslib_1.__importStar(require("@travetto/manifest/src/root-index.js"));
107
+ const Ⲑ_runtime_1 = tslib_1.__importStar(require("@travetto/manifest/src/runtime.js"));
108
108
  const Ⲑ_decorator_1 = tslib_1.__importStar(require("@travetto/registry/src/decorator.js"));
109
109
  var ᚕf = "@travetto/transformer/doc/upper.js";
110
110
  let TEST = class TEST {
111
- static Ⲑinit = Ⲑ_root_index_1.RootIndex.registerFunction(TEST, ᚕf, 649563175, { COMPUTEAGE: { hash: 1286718349 } }, false, false);
111
+ static Ⲑinit = Ⲑ_runtime_1.RuntimeIndex.registerFunction(TEST, ᚕf, 649563175, { COMPUTEAGE: { hash: 1286718349 } }, false, false);
112
112
  NAME;
113
113
  AGE;
114
114
  DOB;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/transformer",
3
- "version": "3.4.1",
3
+ "version": "4.0.0-rc.0",
4
4
  "description": "Functionality for AST transformations, with transformer registration, and general utils",
5
5
  "keywords": [
6
6
  "typescript",
@@ -24,9 +24,9 @@
24
24
  "directory": "module/transformer"
25
25
  },
26
26
  "dependencies": {
27
- "@travetto/manifest": "^3.4.0",
27
+ "@travetto/manifest": "^4.0.0-rc.0",
28
28
  "tslib": "^2.6.2",
29
- "typescript": "^5.2.2"
29
+ "typescript": "^5.3.2"
30
30
  },
31
31
  "travetto": {
32
32
  "displayName": "Transformation",
package/src/manager.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import ts from 'typescript';
2
2
 
3
- import { ManifestIndex, RootIndex } from '@travetto/manifest';
3
+ import { ManifestIndex, RuntimeIndex } from '@travetto/manifest';
4
4
 
5
5
  import { NodeTransformer } from './types/visitor';
6
6
  import { VisitorFactory } from './visitor';
@@ -19,12 +19,12 @@ export class TransformerManager {
19
19
  * @returns
20
20
  */
21
21
  static async create(manifestIndex: ManifestIndex): Promise<TransformerManager> {
22
- const transformerFiles = RootIndex.find({ folder: f => f === '$transformer' }).map(f => f.sourceFile);
22
+ const transformerFiles = RuntimeIndex.find({ folder: f => f === '$transformer' }).map(f => f.sourceFile);
23
23
 
24
24
  const transformers: NodeTransformer<TransformerState>[] = [];
25
25
 
26
26
  for (const file of transformerFiles) { // Exclude based on blacklist
27
- const entry = RootIndex.getEntry(file)!;
27
+ const entry = RuntimeIndex.getEntry(file)!;
28
28
  transformers.push(...getAllTransformers(await import(entry.import), entry.module));
29
29
  }
30
30
 
@@ -266,19 +266,15 @@ export const TypeBuilder: {
266
266
  const [tag] = DocUtil.readDocTag(type, 'concrete');
267
267
  if (tag) {
268
268
  // eslint-disable-next-line prefer-const
269
- let [importName, name] = tag.split(':');
270
- if (!name) {
271
- name = importName;
272
- importName = '.';
273
- }
269
+ let [importName, name] = tag.split('#');
274
270
 
275
271
  // Resolving relative to source file
276
- if (importName.startsWith('.')) {
272
+ if (!importName || importName.startsWith('.')) {
277
273
  const rawSourceFile: string = DeclarationUtil.getDeclarations(type)
278
274
  ?.find(x => ts.getAllJSDocTags(x, (t): t is ts.JSDocTag => t.tagName.getText() === 'concrete').length)
279
275
  ?.getSourceFile().fileName ?? '';
280
276
 
281
- if (importName === '.') {
277
+ if (!importName || importName === '.') {
282
278
  importName = resolver.getFileImportName(rawSourceFile);
283
279
  } else {
284
280
  const base = path.dirname(rawSourceFile);
@@ -1,4 +1,4 @@
1
- import crypto from 'crypto';
1
+ import crypto from 'node:crypto';
2
2
 
3
3
  export class SystemUtil {
4
4