embedded-ts
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "embedded-ts", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Embedded TypeScript.", | ||
@@ -22,38 +22,19 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@commitlint/cli": "^16.2.3", | ||
"@leonzalion/configs": "^1.1.11", | ||
"@types/lru-cache": "^7.4.0", | ||
"@types/node": "^17.0.21", | ||
"@leonzalion/configs": "^1.2.3", | ||
"@types/lru-cache": "^7.6.1", | ||
"@types/node": "^17.0.23", | ||
"@types/xml-escape": "^1.1.0", | ||
"desm": "^1.2.0", | ||
"eslint": "^8.11.0", | ||
"eslint-define-config": "^1.3.0", | ||
"execa": "^6.1.0", | ||
"lint-staged": "^12.3.6", | ||
"lion-git-hooks": "^1.0.7", | ||
"lion-system": "^1.0.15", | ||
"lionp": "^1.0.23", | ||
"prettier": "^2.6.0", | ||
"tsc-alias": "^1.6.4", | ||
"typescript": "^4.6.2", | ||
"vitest": "^0.6.3" | ||
"lion-system": "^1.0.17", | ||
"typescript": "^4.6.3", | ||
"vitest": "^0.8.3" | ||
}, | ||
"prettier": "@leonzalion/configs/prettier.cjs", | ||
"commitlint": { | ||
"extends": [ | ||
"@leonzalion/configs/commitlint.cjs" | ||
] | ||
}, | ||
"lint-staged": { | ||
"*.{js,ts}": [ | ||
"pnpm run lint", | ||
"pnpm run prettier" | ||
] | ||
}, | ||
"dependencies": { | ||
"change-case": "^4.1.2", | ||
"commander": "^9.0.0", | ||
"esbuild": "^0.14.27", | ||
"commander": "^9.1.0", | ||
"esbuild": "^0.14.30", | ||
"escape-string-regexp": "^5.0.0", | ||
"lru-cache": "^7.5.1", | ||
"lru-cache": "^7.7.3", | ||
"outdent": "^0.8.0", | ||
@@ -60,0 +41,0 @@ "xml-escape": "^1.1.0" |
@@ -174,3 +174,7 @@ export declare type RenderFileCallback<T> = (err: Error | null, str: string) => T; | ||
importResolver: ImportResolver; | ||
/** | ||
* A custom transform function for transforming the compiled template source code | ||
*/ | ||
transform?: (source: string) => string | Promise<string>; | ||
} | ||
export {}; |
@@ -9,3 +9,2 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { | ||
import * as path from 'node:path'; | ||
import esbuild from 'esbuild'; | ||
import escapeStringRegexp from 'escape-string-regexp'; | ||
@@ -315,2 +314,3 @@ import LRUCache from 'lru-cache'; | ||
views: opts.views, | ||
transform: opts.transform, | ||
}; | ||
@@ -353,7 +353,14 @@ if (typeof options.outputFunctionName !== 'undefined' && | ||
} | ||
const { code } = await esbuild.transform(this.source, { | ||
minify: false, | ||
keepNames: true, | ||
loader: 'ts', | ||
}); | ||
let code; | ||
if (options.transform === undefined) { | ||
const { default: esbuild } = await import('esbuild'); | ||
({ code } = await esbuild.transform(this.source, { | ||
minify: false, | ||
keepNames: true, | ||
loader: 'ts', | ||
})); | ||
} | ||
else { | ||
code = await options.transform(this.source); | ||
} | ||
this.source = outdent ` | ||
@@ -360,0 +367,0 @@ var __output = ""; |
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
35593
10
861
Updatedcommander@^9.1.0
Updatedesbuild@^0.14.30
Updatedlru-cache@^7.7.3