@analogjs/vite-plugin-angular 2.5.0-beta.8 → 2.5.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 +24 -0
- package/package.json +23 -5
- package/src/lib/angular-vite-plugin.d.ts +12 -1
- package/src/lib/angular-vite-plugin.js +102 -300
- package/src/lib/angular-vite-plugin.js.map +1 -1
- package/src/lib/angular-vitest-plugin.js +2 -2
- package/src/lib/angular-vitest-plugin.js.map +1 -1
- package/src/lib/compiler/angular-version.d.ts +19 -0
- package/src/lib/compiler/angular-version.js +42 -0
- package/src/lib/compiler/angular-version.js.map +1 -0
- package/src/lib/compiler/class-field-lowering.d.ts +23 -0
- package/src/lib/compiler/class-field-lowering.js +213 -0
- package/src/lib/compiler/class-field-lowering.js.map +1 -0
- package/src/lib/compiler/compile.d.ts +44 -0
- package/src/lib/compiler/compile.js +1160 -0
- package/src/lib/compiler/compile.js.map +1 -0
- package/src/lib/compiler/constants.d.ts +18 -0
- package/src/lib/compiler/constants.js +48 -0
- package/src/lib/compiler/constants.js.map +1 -0
- package/src/lib/compiler/debug.d.ts +22 -0
- package/src/lib/compiler/debug.js +35 -0
- package/src/lib/compiler/debug.js.map +1 -0
- package/src/lib/compiler/defer.d.ts +47 -0
- package/src/lib/compiler/defer.js +203 -0
- package/src/lib/compiler/defer.js.map +1 -0
- package/src/lib/compiler/dts-reader.d.ts +35 -0
- package/src/lib/compiler/dts-reader.js +526 -0
- package/src/lib/compiler/dts-reader.js.map +1 -0
- package/src/lib/compiler/hmr.d.ts +16 -0
- package/src/lib/compiler/hmr.js +80 -0
- package/src/lib/compiler/hmr.js.map +1 -0
- package/src/lib/compiler/index.d.ts +7 -0
- package/src/lib/compiler/index.js +8 -0
- package/src/lib/compiler/index.js.map +1 -0
- package/src/lib/compiler/jit-metadata.d.ts +14 -0
- package/src/lib/compiler/jit-metadata.js +224 -0
- package/src/lib/compiler/jit-metadata.js.map +1 -0
- package/src/lib/compiler/jit-transform.d.ts +24 -0
- package/src/lib/compiler/jit-transform.js +269 -0
- package/src/lib/compiler/jit-transform.js.map +1 -0
- package/src/lib/compiler/js-emitter.d.ts +10 -0
- package/src/lib/compiler/js-emitter.js +502 -0
- package/src/lib/compiler/js-emitter.js.map +1 -0
- package/src/lib/compiler/metadata.d.ts +57 -0
- package/src/lib/compiler/metadata.js +894 -0
- package/src/lib/compiler/metadata.js.map +1 -0
- package/src/lib/compiler/registry.d.ts +49 -0
- package/src/lib/compiler/registry.js +273 -0
- package/src/lib/compiler/registry.js.map +1 -0
- package/src/lib/compiler/resource-inliner.d.ts +21 -0
- package/src/lib/compiler/resource-inliner.js +200 -0
- package/src/lib/compiler/resource-inliner.js.map +1 -0
- package/src/lib/compiler/style-ast.d.ts +8 -0
- package/src/lib/compiler/style-ast.js +110 -0
- package/src/lib/compiler/style-ast.js.map +1 -0
- package/src/lib/compiler/styles.d.ts +13 -0
- package/src/lib/compiler/styles.js +60 -0
- package/src/lib/compiler/styles.js.map +1 -0
- package/src/lib/compiler/test-helpers.d.ts +7 -0
- package/src/lib/compiler/test-helpers.js +28 -0
- package/src/lib/compiler/test-helpers.js.map +1 -0
- package/src/lib/compiler/type-elision.d.ts +26 -0
- package/src/lib/compiler/type-elision.js +313 -0
- package/src/lib/compiler/type-elision.js.map +1 -0
- package/src/lib/compiler/utils.d.ts +10 -0
- package/src/lib/compiler/utils.js +95 -0
- package/src/lib/compiler/utils.js.map +1 -0
- package/src/lib/fast-compile-plugin.d.ts +28 -0
- package/src/lib/fast-compile-plugin.js +404 -0
- package/src/lib/fast-compile-plugin.js.map +1 -0
- package/src/lib/utils/plugin-config.d.ts +45 -0
- package/src/lib/utils/plugin-config.js +89 -0
- package/src/lib/utils/plugin-config.js.map +1 -0
- package/src/lib/utils/safe-module-paths.d.ts +16 -0
- package/src/lib/utils/safe-module-paths.js +26 -0
- package/src/lib/utils/safe-module-paths.js.map +1 -0
- package/src/lib/utils/virtual-ids.d.ts +4 -0
- package/src/lib/utils/virtual-ids.js +30 -0
- package/src/lib/utils/virtual-ids.js.map +1 -0
- package/src/lib/utils/virtual-resources.d.ts +19 -0
- package/src/lib/utils/virtual-resources.js +47 -0
- package/src/lib/utils/virtual-resources.js.map +1 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import * as ts from 'typescript';
|
|
2
|
+
/** Collect type-only imported names: `import type { X }` and `import { type X }`. */
|
|
3
|
+
export function collectTypeOnlyImports(sf) {
|
|
4
|
+
const result = new Set();
|
|
5
|
+
for (const stmt of sf.statements) {
|
|
6
|
+
if (!ts.isImportDeclaration(stmt) || !stmt.importClause)
|
|
7
|
+
continue;
|
|
8
|
+
const clause = stmt.importClause;
|
|
9
|
+
if (clause.isTypeOnly) {
|
|
10
|
+
if (clause.namedBindings && ts.isNamedImports(clause.namedBindings)) {
|
|
11
|
+
for (const el of clause.namedBindings.elements)
|
|
12
|
+
result.add(el.name.text);
|
|
13
|
+
}
|
|
14
|
+
if (clause.name)
|
|
15
|
+
result.add(clause.name.text);
|
|
16
|
+
}
|
|
17
|
+
else if (clause.namedBindings &&
|
|
18
|
+
ts.isNamedImports(clause.namedBindings)) {
|
|
19
|
+
for (const el of clause.namedBindings.elements) {
|
|
20
|
+
if (el.isTypeOnly)
|
|
21
|
+
result.add(el.name.text);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
/** Recursively find all class declarations in a source file, including nested scopes. */
|
|
28
|
+
export function findAllClasses(sf) {
|
|
29
|
+
const result = [];
|
|
30
|
+
function walk(node) {
|
|
31
|
+
if (ts.isClassDeclaration(node))
|
|
32
|
+
result.push(node);
|
|
33
|
+
ts.forEachChild(node, walk);
|
|
34
|
+
}
|
|
35
|
+
walk(sf);
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
/** Unwrap forwardRef(() => X) to X. Returns the original node if not a forwardRef call. */
|
|
39
|
+
export function unwrapForwardRef(node) {
|
|
40
|
+
if (ts.isCallExpression(node) &&
|
|
41
|
+
ts.isIdentifier(node.expression) &&
|
|
42
|
+
node.expression.text === 'forwardRef') {
|
|
43
|
+
const arg = node.arguments[0];
|
|
44
|
+
if (arg && ts.isArrowFunction(arg)) {
|
|
45
|
+
if (ts.isBlock(arg.body)) {
|
|
46
|
+
const stmt = arg.body.statements[0];
|
|
47
|
+
if (stmt && ts.isReturnStatement(stmt) && stmt.expression)
|
|
48
|
+
return stmt.expression;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return arg.body;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (arg &&
|
|
55
|
+
ts.isFunctionExpression(arg) &&
|
|
56
|
+
arg.body.statements.length === 1) {
|
|
57
|
+
const stmt = arg.body.statements[0];
|
|
58
|
+
if (ts.isReturnStatement(stmt) && stmt.expression)
|
|
59
|
+
return stmt.expression;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return node;
|
|
63
|
+
}
|
|
64
|
+
/** Unwrap forwardRef(() => X) to X for OXC AST nodes. Returns the original node if not a forwardRef call. */
|
|
65
|
+
export function unwrapForwardRefOxc(node) {
|
|
66
|
+
if (node?.type === 'CallExpression' &&
|
|
67
|
+
node.callee?.type === 'Identifier' &&
|
|
68
|
+
node.callee.name === 'forwardRef') {
|
|
69
|
+
const arg = node.arguments?.[0];
|
|
70
|
+
if (arg?.type === 'ArrowFunctionExpression') {
|
|
71
|
+
if (arg.body?.type === 'FunctionBody' ||
|
|
72
|
+
arg.body?.type === 'BlockStatement') {
|
|
73
|
+
const stmts = arg.body.statements || arg.body.body || [];
|
|
74
|
+
const stmt = stmts[0];
|
|
75
|
+
if (stmt?.type === 'ReturnStatement' && stmt.argument)
|
|
76
|
+
return stmt.argument;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
// Expression body: forwardRef(() => X)
|
|
80
|
+
return arg.body;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (arg?.type === 'FunctionExpression') {
|
|
84
|
+
const stmts = arg.body?.statements || arg.body?.body || [];
|
|
85
|
+
if (stmts.length === 1) {
|
|
86
|
+
const stmt = stmts[0];
|
|
87
|
+
if (stmt?.type === 'ReturnStatement' && stmt.argument)
|
|
88
|
+
return stmt.argument;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return node;
|
|
93
|
+
}
|
|
94
|
+
export { ANGULAR_DECORATORS } from './constants.js';
|
|
95
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../packages/vite-plugin-angular/src/lib/compiler/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,qFAAqF;AACrF,MAAM,UAAU,sBAAsB,CAAC,EAAiB;IACtD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,KAAK,MAAM,IAAI,IAAI,EAAE,CAAC,UAAU,EAAE,CAAC;QACjC,IAAI,CAAC,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY;YAAE,SAAS;QAClE,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC;QACjC,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;YACtB,IAAI,MAAM,CAAC,aAAa,IAAI,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC;gBACpE,KAAK,MAAM,EAAE,IAAI,MAAM,CAAC,aAAa,CAAC,QAAQ;oBAC5C,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC7B,CAAC;YACD,IAAI,MAAM,CAAC,IAAI;gBAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChD,CAAC;aAAM,IACL,MA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AC,QAAQ;oBACnD,OAAO,IAAI,CAAC,QAAQ,CAAC;YACzB,CAAC;iBAAM,CAAC;gBACN,uCAAuC;gBACvC,OAAO,GAAG,CAAC,IAAI,CAAC;YAClB,CAAC;QACH,CAAC;QACD,IAAI,GAAG,EAAE,IAAI,KAAK,oBAAoB,EAAE,CAAC;YACvC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,UAAU,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC;YAC3D,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;gBACtB,IAAI,IAAI,EAAE,IAAI,KAAK,iBAAiB,IAAI,IAAI,CAAC,QAAQ;oBACnD,OAAO,IAAI,CAAC,QAAQ,CAAC;YACzB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import { type ComponentRegistry } from './compiler/index.js';
|
|
3
|
+
declare global {
|
|
4
|
+
/**
|
|
5
|
+
* Shared convention for out-of-tree compilers (e.g. `@tsrx/analog`) that
|
|
6
|
+
* produce Angular Ivy definitions from a non-TS source format. Populate
|
|
7
|
+
* this map with directive/component metadata for any class fastCompile
|
|
8
|
+
* can't reach through its own tsconfig-driven scan, and the per-compile
|
|
9
|
+
* registry lookup in `fastCompilePlugin` will merge those entries in —
|
|
10
|
+
* so TS `@Component({ imports: [X] })` references to such classes
|
|
11
|
+
* resolve statically instead of hitting the `_unresolved-${className}`
|
|
12
|
+
* sentinel.
|
|
13
|
+
*/
|
|
14
|
+
var __ANALOG_EXTERNAL_REGISTRY__: ComponentRegistry | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface FastCompilePluginOptions {
|
|
17
|
+
tsconfigGetter: () => string;
|
|
18
|
+
workspaceRoot: string;
|
|
19
|
+
inlineStylesExtension: string;
|
|
20
|
+
jit: boolean;
|
|
21
|
+
liveReload: boolean;
|
|
22
|
+
supportedBrowsers: string[];
|
|
23
|
+
transformFilter?: (code: string, id: string) => boolean;
|
|
24
|
+
isTest: boolean;
|
|
25
|
+
isAstroIntegration: boolean;
|
|
26
|
+
fastCompileMode?: 'full' | 'partial';
|
|
27
|
+
}
|
|
28
|
+
export declare function fastCompilePlugin(pluginOptions: FastCompilePluginOptions): Plugin;
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { promises as fsPromises } from 'node:fs';
|
|
2
|
+
import { dirname, isAbsolute, resolve } from 'node:path';
|
|
3
|
+
import * as vite from 'vite';
|
|
4
|
+
import * as compilerCli from '@angular/compiler-cli';
|
|
5
|
+
import { defaultClientConditions, normalizePath, preprocessCSS, } from 'vite';
|
|
6
|
+
import { compile, scanFile, scanPackageDts, collectImportedPackages, collectRelativeReExports, jitTransform, inlineResourceUrls, extractInlineStyles, generateHmrCode, debugCompile, debugRegistry, } from './compiler/index.js';
|
|
7
|
+
import { TS_EXT_REGEX, getTsConfigPath, createDepOptimizerConfig, } from './utils/plugin-config.js';
|
|
8
|
+
import { VIRTUAL_RAW_PREFIX, toVirtualRawId } from './utils/virtual-ids.js';
|
|
9
|
+
import { loadVirtualRawModule, rewriteHtmlRawImport, } from './utils/virtual-resources.js';
|
|
10
|
+
import { markStylePathSafe } from './utils/safe-module-paths.js';
|
|
11
|
+
export function fastCompilePlugin(pluginOptions) {
|
|
12
|
+
let resolvedConfig;
|
|
13
|
+
let tsConfigResolutionContext = null;
|
|
14
|
+
let watchMode = false;
|
|
15
|
+
// fast-compile plugin state
|
|
16
|
+
const registry = new Map();
|
|
17
|
+
const resourceToSource = new Map();
|
|
18
|
+
const scannedDtsPackages = new Set();
|
|
19
|
+
let projectRoot = '';
|
|
20
|
+
let useDefineForClassFields = true;
|
|
21
|
+
/**
|
|
22
|
+
* Scan a file into the registry, then recursively walk its relative
|
|
23
|
+
* `export *` / `export { … } from './x'` chain so any underlying
|
|
24
|
+
* directive classes also land in the registry. Used both at
|
|
25
|
+
* `buildStart` (for tsconfig path entries) and at dev time (file
|
|
26
|
+
* `add` and `handleHotUpdate`) so newly added barrels stay in sync
|
|
27
|
+
* without requiring a server restart.
|
|
28
|
+
*
|
|
29
|
+
* The `visited` set prevents infinite recursion within a single
|
|
30
|
+
* top-level call. Each fresh scan should pass an empty set (so HMR
|
|
31
|
+
* re-scans aren't blocked by buildStart's earlier visits).
|
|
32
|
+
*/
|
|
33
|
+
async function scanBarrelExports(file, visited = new Set(), overwrite = false) {
|
|
34
|
+
if (visited.has(file))
|
|
35
|
+
return;
|
|
36
|
+
visited.add(file);
|
|
37
|
+
let code;
|
|
38
|
+
try {
|
|
39
|
+
code = await fsPromises.readFile(file, 'utf-8');
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
if (debugRegistry.enabled) {
|
|
43
|
+
debugRegistry('scanBarrelExports: failed to read %s: %s', file, e?.message);
|
|
44
|
+
}
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const entries = scanFile(code, file);
|
|
48
|
+
for (const entry of entries) {
|
|
49
|
+
// At buildStart we want stable registry entries (don't overwrite
|
|
50
|
+
// an earlier scan with a barrel re-scan); HMR explicitly asks
|
|
51
|
+
// for overwrite so updated metadata replaces stale entries.
|
|
52
|
+
if (overwrite || !registry.has(entry.className)) {
|
|
53
|
+
registry.set(entry.className, entry);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// Collect every relative re-export specifier via OXC AST so
|
|
57
|
+
// recursive scans can't trip over each other (a shared `/g` regex
|
|
58
|
+
// would have its `lastIndex` reset by each recursive call and
|
|
59
|
+
// silently skip half of an outer barrel's re-exports, which
|
|
60
|
+
// previously left directives like `HlmRadioGroup` unregistered).
|
|
61
|
+
const dir = dirname(file);
|
|
62
|
+
for (const rel of collectRelativeReExports(code, file)) {
|
|
63
|
+
// NodeNext-style libraries write `export * from './foo.js'`
|
|
64
|
+
// even though the source is `./foo.ts`. Strip the ESM
|
|
65
|
+
// extension before probing or the candidates would be
|
|
66
|
+
// `foo.js.ts` / `foo.js/index.ts`, which never exist.
|
|
67
|
+
const normalizedRel = rel.replace(/\.(?:js|mjs)$/u, '');
|
|
68
|
+
const reExportCandidates = [
|
|
69
|
+
resolve(dir, normalizedRel + '.ts'),
|
|
70
|
+
resolve(dir, normalizedRel, 'index.ts'),
|
|
71
|
+
];
|
|
72
|
+
let resolved = false;
|
|
73
|
+
for (const candidate of reExportCandidates) {
|
|
74
|
+
try {
|
|
75
|
+
await fsPromises.access(candidate);
|
|
76
|
+
await scanBarrelExports(candidate, visited, overwrite);
|
|
77
|
+
resolved = true;
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
// try next candidate
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (!resolved && debugRegistry.enabled) {
|
|
85
|
+
debugRegistry('scanBarrelExports: %s re-export %s did not resolve to %o', file, rel, reExportCandidates);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async function initFastCompile() {
|
|
90
|
+
if (pluginOptions.jit)
|
|
91
|
+
return; // JIT: no registry scan needed
|
|
92
|
+
// Scan all source files to build the registry
|
|
93
|
+
registry.clear();
|
|
94
|
+
scannedDtsPackages.clear();
|
|
95
|
+
const resolvedTsConfigPath = resolveTsConfigPath();
|
|
96
|
+
projectRoot = dirname(resolvedTsConfigPath);
|
|
97
|
+
const config = compilerCli.readConfiguration(resolvedTsConfigPath);
|
|
98
|
+
useDefineForClassFields = config.options?.useDefineForClassFields ?? true;
|
|
99
|
+
// Collect candidate files: tsconfig rootNames PLUS the entry points
|
|
100
|
+
// named in `compilerOptions.paths`. App tsconfigs typically only
|
|
101
|
+
// include the app's own sources, so workspace library entry barrels
|
|
102
|
+
// (e.g. `HlmSelectImports = [HlmSelect, HlmSelectContent, ...] as
|
|
103
|
+
// const`) live outside `rootNames` and would otherwise miss the
|
|
104
|
+
// initial scan. The compiler then can't see that `HlmSelectImports`
|
|
105
|
+
// is a tuple barrel and emits the bare identifier into the parent
|
|
106
|
+
// component's `dependencies()` list, where Angular's runtime
|
|
107
|
+
// silently drops it because arrays don't have a directive def.
|
|
108
|
+
const candidates = new Set(config.rootNames);
|
|
109
|
+
const tsPaths = config.options?.paths;
|
|
110
|
+
const baseUrl = (config.options?.baseUrl ?? projectRoot);
|
|
111
|
+
if (tsPaths) {
|
|
112
|
+
for (const targets of Object.values(tsPaths)) {
|
|
113
|
+
for (const target of targets) {
|
|
114
|
+
// Skip wildcard patterns — entry barrels are normally exact
|
|
115
|
+
// file paths like "libs/helm/select/src/index.ts".
|
|
116
|
+
if (target.includes('*'))
|
|
117
|
+
continue;
|
|
118
|
+
candidates.add(resolve(baseUrl, target));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
const results = await Promise.all(Array.from(candidates).map(async (file) => {
|
|
123
|
+
try {
|
|
124
|
+
const code = await fsPromises.readFile(file, 'utf-8');
|
|
125
|
+
return scanFile(code, file);
|
|
126
|
+
}
|
|
127
|
+
catch (e) {
|
|
128
|
+
if (debugRegistry.enabled) {
|
|
129
|
+
debugRegistry('initFastCompile: skipping unreadable %s: %s', file, e?.message);
|
|
130
|
+
}
|
|
131
|
+
return []; // Skip unreadable files
|
|
132
|
+
}
|
|
133
|
+
}));
|
|
134
|
+
for (const entries of results) {
|
|
135
|
+
for (const entry of entries) {
|
|
136
|
+
registry.set(entry.className, entry);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
// Library barrels typically `export * from './lib/...'` rather than
|
|
140
|
+
// declaring directives directly, so the entry file alone gives us
|
|
141
|
+
// the tuple consts but not the directive classes they reference.
|
|
142
|
+
// Walk the relative `export *` chain so the underlying classes also
|
|
143
|
+
// land in the registry. Use a SHARED visited set across all
|
|
144
|
+
// barrels so recursive walks don't double-scan a file that's
|
|
145
|
+
// re-exported from multiple entry points.
|
|
146
|
+
const buildStartVisited = new Set();
|
|
147
|
+
if (tsPaths) {
|
|
148
|
+
const barrelCandidates = [];
|
|
149
|
+
for (const targets of Object.values(tsPaths)) {
|
|
150
|
+
for (const target of targets) {
|
|
151
|
+
if (target.includes('*'))
|
|
152
|
+
continue;
|
|
153
|
+
barrelCandidates.push(resolve(baseUrl, target));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
await Promise.all(barrelCandidates.map((c) => scanBarrelExports(c, buildStartVisited)));
|
|
157
|
+
}
|
|
158
|
+
debugRegistry('initFastCompile done: %d entries from %d candidate files', registry.size, candidates.size);
|
|
159
|
+
}
|
|
160
|
+
function ensureDtsRegistryForSource(code, id) {
|
|
161
|
+
for (const pkg of collectImportedPackages(code, id)) {
|
|
162
|
+
if (scannedDtsPackages.has(pkg))
|
|
163
|
+
continue;
|
|
164
|
+
scannedDtsPackages.add(pkg);
|
|
165
|
+
try {
|
|
166
|
+
const dtsEntries = scanPackageDts(pkg, projectRoot);
|
|
167
|
+
for (const entry of dtsEntries) {
|
|
168
|
+
if (!registry.has(entry.className)) {
|
|
169
|
+
registry.set(entry.className, entry);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
// Package may not have .d.ts files or may not be Angular
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
async function handleFastCompileTransform(code, id) {
|
|
179
|
+
if (!/(Component|Directive|Pipe|Injectable|NgModule)\(/.test(code)) {
|
|
180
|
+
// Non-Angular file — leave it alone so a downstream plugin (or
|
|
181
|
+
// Vite's built-in TS handler) can process it.
|
|
182
|
+
return undefined;
|
|
183
|
+
}
|
|
184
|
+
// JIT mode
|
|
185
|
+
if (pluginOptions.jit) {
|
|
186
|
+
const result = jitTransform(code, id);
|
|
187
|
+
return { code: result.code, map: result.map };
|
|
188
|
+
}
|
|
189
|
+
// Inline external templateUrl/styleUrl(s) into the source before compilation
|
|
190
|
+
code = inlineResourceUrls(code, id);
|
|
191
|
+
// Pre-resolve inline styles that need preprocessing (SCSS/Sass/Less)
|
|
192
|
+
let resolvedStyles;
|
|
193
|
+
let resolvedInlineStyles;
|
|
194
|
+
if (pluginOptions.inlineStylesExtension !== 'css') {
|
|
195
|
+
const styleStrings = extractInlineStyles(code, id);
|
|
196
|
+
if (styleStrings.length > 0) {
|
|
197
|
+
resolvedInlineStyles = new Map();
|
|
198
|
+
for (let i = 0; i < styleStrings.length; i++) {
|
|
199
|
+
try {
|
|
200
|
+
const fakePath = id.replace(/\.ts$/, `.inline-${i}.${pluginOptions.inlineStylesExtension}`);
|
|
201
|
+
const processed = await preprocessCSS(styleStrings[i], fakePath, resolvedConfig);
|
|
202
|
+
resolvedInlineStyles.set(i, processed.code);
|
|
203
|
+
}
|
|
204
|
+
catch (e) {
|
|
205
|
+
if (debugCompile.enabled) {
|
|
206
|
+
debugCompile('inline style #%d preprocessing failed in %s: %s', i, id, e?.message);
|
|
207
|
+
}
|
|
208
|
+
// Skip styles that can't be preprocessed
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (resolvedInlineStyles.size === 0)
|
|
212
|
+
resolvedInlineStyles = undefined;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
ensureDtsRegistryForSource(code, id);
|
|
216
|
+
// Merge entries from the shared external-registry global into this
|
|
217
|
+
// compile's lookup view. Convention: out-of-tree compilers populate
|
|
218
|
+
// `globalThis.__ANALOG_EXTERNAL_REGISTRY__` with directive metadata
|
|
219
|
+
// for classes fastCompile can't reach through its tsconfig-driven
|
|
220
|
+
// scan (e.g. `.tsrx` files compiled by `@tsrx/analog`). Without this
|
|
221
|
+
// merge, a TS `@Component({ imports: [X] })` that references such a
|
|
222
|
+
// class hits `_unresolved-${className}` as its selector and the tag
|
|
223
|
+
// never matches at runtime.
|
|
224
|
+
let compileRegistry = registry;
|
|
225
|
+
const externalRegistry = globalThis.__ANALOG_EXTERNAL_REGISTRY__;
|
|
226
|
+
if (externalRegistry && externalRegistry.size > 0) {
|
|
227
|
+
compileRegistry = new Map(registry);
|
|
228
|
+
for (const [k, v] of externalRegistry)
|
|
229
|
+
compileRegistry.set(k, v);
|
|
230
|
+
}
|
|
231
|
+
const result = compile(code, id, {
|
|
232
|
+
registry: compileRegistry,
|
|
233
|
+
resolvedStyles,
|
|
234
|
+
resolvedInlineStyles,
|
|
235
|
+
useDefineForClassFields,
|
|
236
|
+
compilationMode: pluginOptions.fastCompileMode,
|
|
237
|
+
});
|
|
238
|
+
// Track resource dependencies for HMR
|
|
239
|
+
for (const dep of result.resourceDependencies) {
|
|
240
|
+
resourceToSource.set(dep, id);
|
|
241
|
+
}
|
|
242
|
+
// Strip TypeScript-only syntax
|
|
243
|
+
const stripped = vite.transformWithOxc
|
|
244
|
+
? await vite.transformWithOxc(result.code, id, {
|
|
245
|
+
lang: 'ts',
|
|
246
|
+
sourcemap: false,
|
|
247
|
+
decorator: { legacy: false, emitDecoratorMetadata: false },
|
|
248
|
+
})
|
|
249
|
+
: await vite.transformWithEsbuild(result.code, id, {
|
|
250
|
+
loader: 'ts',
|
|
251
|
+
sourcemap: false,
|
|
252
|
+
});
|
|
253
|
+
let outputCode = stripped.code;
|
|
254
|
+
// Append HMR code in dev mode
|
|
255
|
+
if (watchMode && pluginOptions.liveReload) {
|
|
256
|
+
const fileDeclarations = [...registry.values()].filter((e) => e.fileName === id);
|
|
257
|
+
if (fileDeclarations.length > 0) {
|
|
258
|
+
const localDepClassNames = fileDeclarations.map((e) => e.className);
|
|
259
|
+
outputCode += generateHmrCode(fileDeclarations, localDepClassNames);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return { code: outputCode, map: result.map };
|
|
263
|
+
}
|
|
264
|
+
function resolveTsConfigPath() {
|
|
265
|
+
const { root, isProd, isLib } = tsConfigResolutionContext;
|
|
266
|
+
return getTsConfigPath(root, pluginOptions.tsconfigGetter(), isProd, pluginOptions.isTest, isLib);
|
|
267
|
+
}
|
|
268
|
+
return {
|
|
269
|
+
name: '@analogjs/vite-plugin-angular-fast-compile',
|
|
270
|
+
enforce: 'pre',
|
|
271
|
+
async config(config, { command }) {
|
|
272
|
+
watchMode = command === 'serve';
|
|
273
|
+
const isProd = config.mode === 'production' ||
|
|
274
|
+
process.env['NODE_ENV'] === 'production';
|
|
275
|
+
tsConfigResolutionContext = {
|
|
276
|
+
root: config.root || '.',
|
|
277
|
+
isProd,
|
|
278
|
+
isLib: !!config?.build?.lib,
|
|
279
|
+
};
|
|
280
|
+
const preliminaryTsConfigPath = resolveTsConfigPath();
|
|
281
|
+
const depOptimizer = createDepOptimizerConfig({
|
|
282
|
+
tsconfig: preliminaryTsConfigPath,
|
|
283
|
+
isProd,
|
|
284
|
+
jit: pluginOptions.jit,
|
|
285
|
+
watchMode,
|
|
286
|
+
isTest: pluginOptions.isTest,
|
|
287
|
+
isAstroIntegration: pluginOptions.isAstroIntegration,
|
|
288
|
+
});
|
|
289
|
+
return {
|
|
290
|
+
...(vite.rolldownVersion ? { oxc: {} } : { esbuild: false }),
|
|
291
|
+
...depOptimizer,
|
|
292
|
+
resolve: {
|
|
293
|
+
conditions: [
|
|
294
|
+
...depOptimizer.resolve.conditions,
|
|
295
|
+
...(config.resolve?.conditions || defaultClientConditions),
|
|
296
|
+
],
|
|
297
|
+
},
|
|
298
|
+
};
|
|
299
|
+
},
|
|
300
|
+
configResolved(config) {
|
|
301
|
+
resolvedConfig = config;
|
|
302
|
+
},
|
|
303
|
+
configureServer(server) {
|
|
304
|
+
// Watch for new .ts files and scan them into the registry. Use
|
|
305
|
+
// the barrel-aware scanner so a newly added re-export entry
|
|
306
|
+
// (`export * from './x'`) also expands its underlying directive
|
|
307
|
+
// classes — otherwise the registry stays stale until restart.
|
|
308
|
+
server.watcher.on('add', async (filePath) => {
|
|
309
|
+
if (filePath.endsWith('.ts') &&
|
|
310
|
+
!filePath.endsWith('.spec.ts') &&
|
|
311
|
+
!filePath.endsWith('.d.ts')) {
|
|
312
|
+
await scanBarrelExports(filePath, new Set(), true);
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
},
|
|
316
|
+
async buildStart() {
|
|
317
|
+
await initFastCompile();
|
|
318
|
+
},
|
|
319
|
+
async handleHotUpdate(ctx) {
|
|
320
|
+
// Resource file changes → invalidate parent .ts module
|
|
321
|
+
if (resourceToSource.has(ctx.file)) {
|
|
322
|
+
const parentSource = resourceToSource.get(ctx.file);
|
|
323
|
+
const parentModule = ctx.server.moduleGraph.getModuleById(parentSource);
|
|
324
|
+
if (parentModule) {
|
|
325
|
+
return [parentModule];
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
if (TS_EXT_REGEX.test(ctx.file)) {
|
|
329
|
+
const [fileId] = ctx.file.split('?');
|
|
330
|
+
// Remove old entries from this file
|
|
331
|
+
const oldEntries = [...registry.entries()]
|
|
332
|
+
.filter(([_, v]) => v.fileName === fileId)
|
|
333
|
+
.map(([k]) => k);
|
|
334
|
+
for (const key of oldEntries) {
|
|
335
|
+
registry.delete(key);
|
|
336
|
+
}
|
|
337
|
+
// Rescan the changed file via the barrel-aware scanner so an
|
|
338
|
+
// edited barrel re-export picks up newly-referenced files.
|
|
339
|
+
// Pass overwrite=true so updated metadata replaces stale
|
|
340
|
+
// entries from the previous scan.
|
|
341
|
+
await scanBarrelExports(fileId, new Set(), true);
|
|
342
|
+
}
|
|
343
|
+
// Let Vite handle the rest — the transform hook will recompile
|
|
344
|
+
return ctx.modules;
|
|
345
|
+
},
|
|
346
|
+
resolveId(id, importer) {
|
|
347
|
+
if (id.startsWith(VIRTUAL_RAW_PREFIX)) {
|
|
348
|
+
return `\0${id}`;
|
|
349
|
+
}
|
|
350
|
+
if (pluginOptions.jit && id.startsWith('angular:jit:')) {
|
|
351
|
+
const filePath = normalizePath(resolve(dirname(importer), id.split(';')[1]));
|
|
352
|
+
if (id.includes(':style')) {
|
|
353
|
+
markStylePathSafe(resolvedConfig, filePath);
|
|
354
|
+
return filePath + '?inline';
|
|
355
|
+
}
|
|
356
|
+
return toVirtualRawId(filePath);
|
|
357
|
+
}
|
|
358
|
+
const rawRewrite = rewriteHtmlRawImport(id, importer);
|
|
359
|
+
if (rawRewrite)
|
|
360
|
+
return rawRewrite;
|
|
361
|
+
// User `.scss?inline` / `.css?inline` imports: resolve and mark
|
|
362
|
+
// safe so Vite's native CSS pipeline handles them.
|
|
363
|
+
if (/\.(css|scss|sass|less)\?inline$/.test(id) && importer) {
|
|
364
|
+
const filePath = id.split('?')[0];
|
|
365
|
+
const resolved = isAbsolute(filePath)
|
|
366
|
+
? normalizePath(filePath)
|
|
367
|
+
: normalizePath(resolve(dirname(importer), filePath));
|
|
368
|
+
markStylePathSafe(resolvedConfig, resolved);
|
|
369
|
+
return resolved + '?inline';
|
|
370
|
+
}
|
|
371
|
+
return undefined;
|
|
372
|
+
},
|
|
373
|
+
async load(id) {
|
|
374
|
+
const rawModule = await loadVirtualRawModule(this, id);
|
|
375
|
+
if (rawModule !== undefined)
|
|
376
|
+
return rawModule;
|
|
377
|
+
// Vitest fallback: module-runner can skip resolveId, so the bare
|
|
378
|
+
// ?inline query reaches load. Mark safe and let Vite handle it.
|
|
379
|
+
if (/\.(css|scss|sass|less)\?inline$/.test(id)) {
|
|
380
|
+
markStylePathSafe(resolvedConfig, id.split('?')[0]);
|
|
381
|
+
}
|
|
382
|
+
return;
|
|
383
|
+
},
|
|
384
|
+
transform: {
|
|
385
|
+
filter: {
|
|
386
|
+
id: {
|
|
387
|
+
include: [TS_EXT_REGEX],
|
|
388
|
+
exclude: [/node_modules/, 'type=script', '@ng/component'],
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
async handler(code, id) {
|
|
392
|
+
if (pluginOptions.transformFilter &&
|
|
393
|
+
!(pluginOptions.transformFilter(code, id) ?? true)) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
if (id.includes('.ts?')) {
|
|
397
|
+
id = id.replace(/\?(.*)/, '');
|
|
398
|
+
}
|
|
399
|
+
return handleFastCompileTransform(code, id);
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
//# sourceMappingURL=fast-compile-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fast-compile-plugin.js","sourceRoot":"","sources":["../../../../../packages/vite-plugin-angular/src/lib/fast-compile-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAC;AACrD,OAAO,EACL,uBAAuB,EACvB,aAAa,EAEb,aAAa,GAEd,MAAM,MAAM,CAAC;AAEd,OAAO,EACL,OAAO,EACP,QAAQ,EACR,cAAc,EACd,uBAAuB,EACvB,wBAAwB,EACxB,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,aAAa,GAEd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,YAAY,EACZ,eAAe,EACf,wBAAwB,GAEzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AA8BjE,MAAM,UAAU,iBAAiB,CAC/B,aAAuC;IAEvC,IAAI,cAA8B,CAAC;IACnC,IAAI,yBAAyB,GAAqC,IAAI,CAAC;IACvE,IAAI,SAAS,GAAG,KAAK,CAAC;IAEtB,4BAA4B;IAC5B,MAAM,Q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C;YACtD,CAAC;YAED,OAAO;QACT,CAAC;QACD,SAAS,EAAE;YACT,MAAM,EAAE;gBACN,EAAE,EAAE;oBACF,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,eAAe,CAAC;iBAC1D;aACF;YACD,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE;gBACpB,IACE,aAAa,CAAC,eAAe;oBAC7B,CAAC,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,EAClD,CAAC;oBACD,OAAO;gBACT,CAAC;gBAED,IAAI,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;oBACxB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;gBAChC,CAAC;gBACD,OAAO,0BAA0B,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC9C,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as vite from 'vite';
|
|
2
|
+
/**
|
|
3
|
+
* TypeScript file extension regex
|
|
4
|
+
* Match .ts / .cts / .mts extensions with an optional ?query suffix.
|
|
5
|
+
* Reject .tsx — and any other `.ts<letter>…` extension like .tsrx — via
|
|
6
|
+
* a negative-lookahead on a following ASCII letter, so only genuine TS
|
|
7
|
+
* files pass.
|
|
8
|
+
*
|
|
9
|
+
* Previous form `/\.[cm]?(ts)[^x]?\??/` was intended to exclude `.tsx`
|
|
10
|
+
* specifically (`[^x]?` = not-an-x), but the `?` quantifier also allows
|
|
11
|
+
* zero characters, and any non-`x` letter was admitted — so `.tsrx`
|
|
12
|
+
* and similar extensions matched by accident.
|
|
13
|
+
*/
|
|
14
|
+
export declare const TS_EXT_REGEX: RegExp;
|
|
15
|
+
export interface TsConfigResolutionContext {
|
|
16
|
+
root: string;
|
|
17
|
+
isProd: boolean;
|
|
18
|
+
isLib: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare function getTsConfigPath(root: string, tsconfig: string, isProd: boolean, isTest: boolean, isLib: boolean): string;
|
|
21
|
+
export declare function createTsConfigGetter(tsconfigOrGetter?: string | (() => string)): () => string;
|
|
22
|
+
export interface DepOptimizerOptions {
|
|
23
|
+
tsconfig: string;
|
|
24
|
+
isProd: boolean;
|
|
25
|
+
jit: boolean;
|
|
26
|
+
watchMode: boolean;
|
|
27
|
+
isTest: boolean;
|
|
28
|
+
isAstroIntegration: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function createDepOptimizerConfig(opts: DepOptimizerOptions): {
|
|
31
|
+
optimizeDeps: {
|
|
32
|
+
rolldownOptions: Omit<vite.Rolldown.RolldownOptions, "logLevel" | "input" | "output"> & {
|
|
33
|
+
output?: Omit<vite.Rolldown.OutputOptions, "format" | "sourcemap" | "dir" | "banner">;
|
|
34
|
+
};
|
|
35
|
+
include: string[];
|
|
36
|
+
exclude: string[];
|
|
37
|
+
} | {
|
|
38
|
+
esbuildOptions: import("vite/types/internal/esbuildOptions.js").DepsOptimizerEsbuildOptions;
|
|
39
|
+
include: string[];
|
|
40
|
+
exclude: string[];
|
|
41
|
+
};
|
|
42
|
+
resolve: {
|
|
43
|
+
conditions: string[];
|
|
44
|
+
};
|
|
45
|
+
};
|