refactor: replace build dependencies with native Node.js APIs

Replace fs-extra/rimraf with native node:fs, lodash with
structuredClone/spread, ts-node with tsx, minimist with node:util
parseArgs, winston with console logger, async-promise-queue with
native Promise concurrency. Use promisify for child_process.exec.
Normalize all imports to use node: protocol. Extract Jest config to
jest.config.ts and replace ts-jest with @swc/jest.
This commit is contained in:
Daniel Sogl
2026-03-21 15:11:03 -07:00
parent f103f8bdae
commit 120e0f6d23
17 changed files with 197 additions and 281 deletions
+12 -6
View File
@@ -1,6 +1,10 @@
import {
canHaveDecorators,
canHaveModifiers,
Decorator,
factory,
getDecorators as tsGetDecorators,
getModifiers as tsGetModifiers,
SourceFile,
SyntaxKind,
TransformationContext,
@@ -25,7 +29,6 @@ function transformClass(cls: any, ngcBuild?: boolean) {
for (const prop in pluginDecoratorArgs) {
pluginStatics.push(
factory.createPropertyDeclaration(
undefined,
[factory.createToken(SyntaxKind.StaticKeyword)],
factory.createIdentifier(prop),
undefined,
@@ -36,11 +39,14 @@ function transformClass(cls: any, ngcBuild?: boolean) {
}
}
const clsDecorators = canHaveDecorators(cls) ? tsGetDecorators(cls) : undefined;
const keepDecorators =
ngcBuild && clsDecorators && clsDecorators.length
? clsDecorators.filter((d: Decorator) => getDecoratorName(d) === 'Injectable')
: [];
cls = factory.createClassDeclaration(
ngcBuild && cls.decorators && cls.decorators.length
? cls.decorators.filter((d) => getDecoratorName(d) === 'Injectable')
: undefined, // remove Plugin and Injectable decorators
[factory.createToken(SyntaxKind.ExportKeyword)],
[...keepDecorators, factory.createToken(SyntaxKind.ExportKeyword)],
cls.name,
cls.typeParameters,
cls.heritageClauses,
@@ -58,7 +64,7 @@ function transformClasses(file: SourceFile, ctx: TransformationContext, ngcBuild
(node) => {
if (
node.kind !== SyntaxKind.ClassDeclaration ||
(node.modifiers && node.modifiers.find((v) => v.kind === SyntaxKind.DeclareKeyword))
(canHaveModifiers(node) ? tsGetModifiers(node) : undefined)?.find((v) => v.kind === SyntaxKind.DeclareKeyword)
) {
return node;
}