@analogjs/vite-plugin-angular 3.0.0-alpha.86 → 3.0.0-alpha.88
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/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +3 -1
- package/src/index.js.map +1 -1
- package/src/lib/angular-jit-plugin.js +2 -2
- package/src/lib/angular-vite-plugin.d.ts +0 -3
- package/src/lib/angular-vite-plugin.js +18 -39
- package/src/lib/angular-vite-plugin.js.map +1 -1
- package/src/lib/angular-vitest-plugin.d.ts +1 -1
- package/src/lib/angular-vitest-plugin.js +1 -1
- package/src/lib/angular-vitest-plugin.js.map +1 -1
- package/src/lib/compilation-api/compilation-api-plugin.d.ts +19 -13
- package/src/lib/compilation-api/compilation-api-plugin.js +74 -15
- package/src/lib/compilation-api/compilation-api-plugin.js.map +1 -1
- package/src/lib/compilation-api/index.d.ts +1 -1
- package/src/lib/fast-compile-plugin.js +1 -1
- package/src/lib/host.js +1 -1
- package/src/lib/stylesheet-registry.js +1 -1
- package/src/lib/utils/compilation-shared.js +1 -1
- package/src/lib/utils/devkit.js +1 -1
- package/src/lib/utils/transform-cache.js +2 -2
- package/src/lib/utils/tsconfig-resolver.js +1 -1
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { angularCompilationPlugin, type AngularCompilationPluginOptions } from "./lib/compilation-api/index.js";
|
|
1
2
|
import { angular } from "./lib/angular-vite-plugin.js";
|
|
2
3
|
export { angular } from "./lib/angular-vite-plugin.js";
|
|
3
4
|
export type { PluginOptions } from "./lib/angular-vite-plugin.js";
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { angularCompilationPlugin } from "./lib/compilation-api/compilation-api-plugin.js";
|
|
2
|
+
import "./lib/compilation-api/index.js";
|
|
1
3
|
import { angular } from "./lib/angular-vite-plugin.js";
|
|
2
4
|
//#region packages/vite-plugin-angular/src/index.ts
|
|
3
5
|
var src_default = angular;
|
|
4
6
|
//#endregion
|
|
5
|
-
export { angular, src_default as default };
|
|
7
|
+
export { angular, angularCompilationPlugin, src_default as default };
|
|
6
8
|
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export {\n angularCompilationPlugin,\n type AngularCompilationPluginOptions,\n} from './lib/compilation-api/index.js';\nimport { angular } from './lib/angular-vite-plugin.js';\nexport { angular } from './lib/angular-vite-plugin.js';\nexport type { PluginOptions } from './lib/angular-vite-plugin.js';\nexport type {\n AnalogIntegrationPlugin,\n AnalogPluginContext,\n AnalogPluginHooks,\n ComponentRegistryEntries,\n StylesheetRegistryConfigurator,\n StylesheetRegistryContext,\n TransformFilter,\n} from './lib/analog-plugin-interop.js';\nexport type {\n RegistryEntry as ComponentRegistryEntry,\n RegistryInput as ComponentRegistryInput,\n} from './lib/compiler/registry.js';\nexport type {\n StylePreprocessor,\n StylesheetDependency,\n StylesheetDiagnostic,\n StylesheetRegistryReader,\n StylesheetTransformContext,\n StylesheetTransformResult,\n} from './lib/style-preprocessor.js';\n\nexport default angular;\n"],"mappings":";;;;AA6BA,IAAA,cAAe"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getJitInlineStyles } from "./utils/jit-inline-styles.js";
|
|
2
1
|
import { debugStyles } from "./utils/debug.js";
|
|
3
|
-
import { discoverAnalogIntegrations } from "./analog-plugin-interop.js";
|
|
4
2
|
import { preprocessStylesheet } from "./stylesheet-registry.js";
|
|
3
|
+
import { discoverAnalogIntegrations } from "./analog-plugin-interop.js";
|
|
4
|
+
import { getJitInlineStyles } from "./utils/jit-inline-styles.js";
|
|
5
5
|
import { preprocessCSS } from "vite";
|
|
6
6
|
//#region packages/vite-plugin-angular/src/lib/angular-jit-plugin.ts
|
|
7
7
|
function jitPlugin({ inlineStylesExtension }) {
|
|
@@ -40,9 +40,6 @@ export interface PluginOptions {
|
|
|
40
40
|
* - `'partial'`: Emit partial declarations for library publishing.
|
|
41
41
|
*/
|
|
42
42
|
fastCompileMode?: "full" | "partial";
|
|
43
|
-
experimental?: {
|
|
44
|
-
useAngularCompilationAPI?: boolean;
|
|
45
|
-
};
|
|
46
43
|
/**
|
|
47
44
|
* Enable debug logging for specific scopes.
|
|
48
45
|
*
|
|
@@ -1,40 +1,36 @@
|
|
|
1
1
|
import { angularFullVersion, cjt, sourceFileCache } from "./utils/devkit.js";
|
|
2
|
+
import { activateDeferredDebug, applyDebugOption, debugCompiler, debugCompilerV, debugEmit, debugEmitV, debugHmr, debugHmrV, debugStyles, debugStylesV } from "./utils/debug.js";
|
|
2
3
|
import { createCompilerPlugin, createRolldownCompilerPlugin } from "./compiler-plugin.js";
|
|
3
4
|
import { TS_EXT_REGEX, createTsConfigGetter, getTsConfigPath, isProdMode } from "./utils/plugin-config.js";
|
|
5
|
+
import { TsconfigResolver } from "./utils/tsconfig-resolver.js";
|
|
4
6
|
import { getJsTransformConfigKey, isRolldown } from "./utils/rolldown.js";
|
|
7
|
+
import { AnalogStylesheetRegistry, preprocessStylesheet, rewriteRelativeCssImports } from "./stylesheet-registry.js";
|
|
8
|
+
import { discoverAnalogIntegrations } from "./analog-plugin-interop.js";
|
|
9
|
+
import { describeStylesheetContent, injectViteIgnoreForHmrMetadata, isIgnoredHmrFile, isTestWatchMode } from "./utils/compilation-shared.js";
|
|
10
|
+
import { angularVitestPlugins } from "./angular-vitest-plugin.js";
|
|
5
11
|
import { buildOptimizerPlugin } from "./angular-build-optimizer-plugin.js";
|
|
6
12
|
import { toJitInlineStyleId } from "./utils/jit-inline-styles.js";
|
|
7
|
-
import { activateDeferredDebug, applyDebugOption, debugCompiler, debugCompilerV, debugEmit, debugEmitV, debugHmr, debugHmrV, debugStyles, debugStylesV } from "./utils/debug.js";
|
|
8
|
-
import { discoverAnalogIntegrations } from "./analog-plugin-interop.js";
|
|
9
|
-
import { AnalogStylesheetRegistry, preprocessStylesheet, rewriteRelativeCssImports } from "./stylesheet-registry.js";
|
|
10
13
|
import { jitPlugin } from "./angular-jit-plugin.js";
|
|
11
|
-
import {
|
|
12
|
-
import { augmentHostWithCaching, augmentHostWithResources, augmentProgramWithVersioning, mergeTransformers } from "./host.js";
|
|
13
|
-
import { TsconfigResolver } from "./utils/tsconfig-resolver.js";
|
|
14
|
-
import { describeStylesheetContent, injectViteIgnoreForHmrMetadata, isIgnoredHmrFile, isTestWatchMode } from "./utils/compilation-shared.js";
|
|
14
|
+
import { liveReloadPlugin } from "./live-reload-plugin.js";
|
|
15
15
|
import { toVirtualRawId } from "./utils/virtual-ids.js";
|
|
16
|
+
import { virtualModulesPlugin } from "./virtual-modules-plugin.js";
|
|
17
|
+
import { encapsulationPlugin, getComponentStyleSheetMeta, isComponentStyleSheet } from "./encapsulation-plugin.js";
|
|
18
|
+
import { nxFolderPlugin } from "./nx-folder-plugin.js";
|
|
19
|
+
import { routerPlugin } from "./router-plugin.js";
|
|
20
|
+
import { replaceFiles } from "./plugins/file-replacements.plugin.js";
|
|
21
|
+
import { cssExtensionStyleResolverPlugin } from "./utils/css-extension-resolver.js";
|
|
16
22
|
import { loadVirtualRawModule, rewriteHtmlRawImport } from "./utils/virtual-resources.js";
|
|
17
|
-
import {
|
|
18
|
-
import "./
|
|
19
|
-
import { ANGULAR_DECORATOR_CALL_RE } from "./compiler/constants.js";
|
|
20
|
-
import "./compiler/index.js";
|
|
23
|
+
import { StyleUrlsResolver, TemplateUrlsResolver } from "./component-resolvers.js";
|
|
24
|
+
import { augmentHostWithCaching, augmentHostWithResources, augmentProgramWithVersioning, mergeTransformers } from "./host.js";
|
|
21
25
|
import { markStylePathSafe } from "./utils/safe-module-paths.js";
|
|
22
26
|
import { fastCompilePlugin } from "./fast-compile-plugin.js";
|
|
23
|
-
import { encapsulationPlugin, getComponentStyleSheetMeta, isComponentStyleSheet } from "./encapsulation-plugin.js";
|
|
24
|
-
import { virtualModulesPlugin } from "./virtual-modules-plugin.js";
|
|
25
|
-
import { angularVitestPlugins } from "./angular-vitest-plugin.js";
|
|
26
|
-
import { cssExtensionStyleResolverPlugin } from "./utils/css-extension-resolver.js";
|
|
27
27
|
import { pendingTasksPlugin } from "./angular-pending-tasks.plugin.js";
|
|
28
|
-
import { liveReloadPlugin } from "./live-reload-plugin.js";
|
|
29
|
-
import { nxFolderPlugin } from "./nx-folder-plugin.js";
|
|
30
|
-
import { replaceFiles } from "./plugins/file-replacements.plugin.js";
|
|
31
|
-
import { routerPlugin } from "./router-plugin.js";
|
|
32
28
|
import { union } from "es-toolkit";
|
|
33
29
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
34
30
|
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
35
|
-
import * as compilerCli from "@angular/compiler-cli";
|
|
36
31
|
import { createRequire } from "node:module";
|
|
37
32
|
import { normalizePath, preprocessCSS } from "vite";
|
|
33
|
+
import * as compilerCli from "@angular/compiler-cli";
|
|
38
34
|
//#region packages/vite-plugin-angular/src/lib/angular-vite-plugin.ts
|
|
39
35
|
var require = createRequire(import.meta.url);
|
|
40
36
|
var classNames = /* @__PURE__ */ new Map();
|
|
@@ -63,7 +59,6 @@ function angular(options) {
|
|
|
63
59
|
liveReload,
|
|
64
60
|
disableTypeChecking: options?.disableTypeChecking ?? true,
|
|
65
61
|
fileReplacements: options?.fileReplacements ?? [],
|
|
66
|
-
useAngularCompilationAPI: options?.experimental?.useAngularCompilationAPI ?? false,
|
|
67
62
|
fastCompile: options?.fastCompile ?? false,
|
|
68
63
|
fastCompileMode: options?.fastCompileMode ?? "full",
|
|
69
64
|
stylePreprocessor: void 0
|
|
@@ -211,7 +206,7 @@ function angular(options) {
|
|
|
211
206
|
advancedOptimizations: isProd,
|
|
212
207
|
jit,
|
|
213
208
|
incremental: watchMode
|
|
214
|
-
}, !isAstroIntegration)] };
|
|
209
|
+
}, isTest, !isAstroIntegration)] };
|
|
215
210
|
const esbuildOptions = {
|
|
216
211
|
plugins: [createCompilerPlugin({
|
|
217
212
|
tsconfig: preliminaryTsConfigPath,
|
|
@@ -589,9 +584,6 @@ function angular(options) {
|
|
|
589
584
|
} },
|
|
590
585
|
async handler(code, id) {
|
|
591
586
|
if (transformFilter && !transformFilter(code, id)) return;
|
|
592
|
-
if (pluginOptions.useAngularCompilationAPI) {
|
|
593
|
-
if (!ANGULAR_DECORATOR_CALL_RE.test(code)) return;
|
|
594
|
-
}
|
|
595
587
|
if (id.includes(".ts?")) id = id.replace(/\?(.*)/, "");
|
|
596
588
|
fileTransformMap.set(id, code);
|
|
597
589
|
/**
|
|
@@ -690,20 +682,7 @@ function angular(options) {
|
|
|
690
682
|
}
|
|
691
683
|
};
|
|
692
684
|
}
|
|
693
|
-
const compilationPlugin = pluginOptions.
|
|
694
|
-
tsconfigGetter: pluginOptions.tsconfigGetter,
|
|
695
|
-
workspaceRoot: pluginOptions.workspaceRoot,
|
|
696
|
-
inlineStylesExtension: pluginOptions.inlineStylesExtension,
|
|
697
|
-
jit,
|
|
698
|
-
liveReload: pluginOptions.liveReload,
|
|
699
|
-
disableTypeChecking: pluginOptions.disableTypeChecking,
|
|
700
|
-
supportedBrowsers: pluginOptions.supportedBrowsers,
|
|
701
|
-
fileReplacements: pluginOptions.fileReplacements,
|
|
702
|
-
isTest,
|
|
703
|
-
isAstroIntegration,
|
|
704
|
-
include: pluginOptions.include,
|
|
705
|
-
debug: options?.debug
|
|
706
|
-
}) : pluginOptions.fastCompile ? fastCompilePlugin({
|
|
685
|
+
const compilationPlugin = pluginOptions.fastCompile ? fastCompilePlugin({
|
|
707
686
|
tsconfigGetter: pluginOptions.tsconfigGetter,
|
|
708
687
|
workspaceRoot: pluginOptions.workspaceRoot,
|
|
709
688
|
inlineStylesExtension: pluginOptions.inlineStylesExtension,
|