@travetto/transformer
Advanced tools
Comparing version 5.0.0-rc.4 to 5.0.0-rc.5
{ | ||
"name": "@travetto/transformer", | ||
"version": "5.0.0-rc.4", | ||
"version": "5.0.0-rc.5", | ||
"description": "Functionality for AST transformations, with transformer registration, and general utils", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@travetto/manifest": "^5.0.0-rc.3", | ||
"@travetto/manifest": "^5.0.0-rc.4", | ||
"tslib": "^2.6.3", | ||
@@ -30,0 +30,0 @@ "typescript": "^5.5.3" |
@@ -108,3 +108,3 @@ <!-- This file was generated by @travetto/doc and should not be modified directly --> | ||
const Ⲑ_function_1 = tslib_1.__importStar(require("@travetto/runtime/src/function.js")); | ||
var ᚕm = ["@travetto/transformer", "doc/upper"]; | ||
var ᚕm = ["@travetto/transformer", "doc/upper.ts"]; | ||
class TEST { | ||
@@ -111,0 +111,0 @@ static Ⲑinit = Ⲑ_function_1.registerFunction(TEST, ᚕm, { hash: 649563175, lines: [1, 9] }, { COMPUTEAGE: { hash: 1286718349, lines: [6, 8, 7] } }, false, false); |
import ts from 'typescript'; | ||
import { PackageUtil, path } from '@travetto/manifest'; | ||
import { ManifestModuleUtil, PackageUtil, path } from '@travetto/manifest'; | ||
@@ -107,2 +107,6 @@ import { AnyType, TransformResolver, ManagedType } from './resolver/types'; | ||
if (file.endsWith('.ts') && !file.endsWith('.d.ts')) { | ||
file = ManifestModuleUtil.withOutputExtension(file); | ||
} | ||
// Allow for node classes to be imported directly | ||
@@ -109,0 +113,0 @@ if (/@types\/node/.test(file)) { |
import ts from 'typescript'; | ||
import { ManifestIndex } from '@travetto/manifest'; | ||
import { ManifestIndex, ManifestModuleUtil } from '@travetto/manifest'; | ||
@@ -28,3 +28,3 @@ import { NodeTransformer } from './types/visitor'; | ||
const entry = manifestIndex.getEntry(file)!; | ||
transformers.push(...getAllTransformers(await import(entry.import), entry.module)); | ||
transformers.push(...getAllTransformers(await import(ManifestModuleUtil.withOutputExtension(entry.import)), entry.module)); | ||
} | ||
@@ -31,0 +31,0 @@ |
@@ -44,4 +44,5 @@ import ts from 'typescript'; | ||
return this.#manifestIndex.getEntry(ManifestModuleUtil.getFileType(sourceFile) === 'ts' ? sourceFile : `${sourceFile}.js`) ?? | ||
this.#manifestIndex.getFromImport(ManifestModuleUtil.sourceToBlankExt(sourceFile).replace(/^.*node_modules\//, '')); | ||
this.#manifestIndex.getFromImport(ManifestModuleUtil.withoutSourceExtension(sourceFile).replace(/^.*node_modules\//, '')); | ||
} | ||
/** | ||
@@ -52,3 +53,3 @@ * Resolve an import name (e.g. @module/path/file) for a file | ||
const imp = this.getFileImport(file)?.import ?? file; | ||
return removeExt ? ManifestModuleUtil.sourceToBlankExt(imp) : imp; | ||
return removeExt ? ManifestModuleUtil.withoutSourceExtension(imp) : imp; | ||
} | ||
@@ -55,0 +56,0 @@ |
import ts from 'typescript'; | ||
import { path, ManifestIndex, ManifestModuleUtil } from '@travetto/manifest'; | ||
import { path, ManifestIndex } from '@travetto/manifest'; | ||
@@ -269,3 +269,3 @@ import { ManagedType, AnyType, ForeignType } from './resolver/types'; | ||
const decl = this.factory.createVariableDeclaration(this.#modIdent, undefined, undefined, | ||
this.fromLiteral([entry?.module, ManifestModuleUtil.sourceToBlankExt(entry?.relativeFile ?? '')]) | ||
this.fromLiteral([entry?.module, entry?.relativeFile ?? '']) | ||
); | ||
@@ -272,0 +272,0 @@ this.addStatements([ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
94312
2378