@analogjs/vite-plugin-angular 3.0.0-beta.14 → 3.0.0-beta.16
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/lib/angular-vite-plugin.d.ts +12 -4
- package/src/lib/angular-vite-plugin.js +4 -3
- package/src/lib/angular-vite-plugin.js.map +1 -1
- package/src/lib/fast-compile-plugin.d.ts +2 -0
- package/src/lib/fast-compile-plugin.js.map +1 -1
- package/src/lib/live-reload-plugin.d.ts +4 -3
- package/src/lib/live-reload-plugin.js +4 -3
- package/src/lib/live-reload-plugin.js.map +1 -1
- package/src/lib/ngp-compile-plugin.js +124 -42
- package/src/lib/ngp-compile-plugin.js.map +1 -1
- package/src/lib/utils/hmr-component-updates.d.ts +7 -0
- package/src/lib/utils/hmr-component-updates.js +87 -0
- package/src/lib/utils/hmr-component-updates.js.map +1 -0
- package/src/lib/utils/{tsgo-checker.d.ts → lsp-type-checker.d.ts} +15 -2
- package/src/lib/utils/{tsgo-checker.js → lsp-type-checker.js} +42 -7
- package/src/lib/utils/lsp-type-checker.js.map +1 -0
- package/src/lib/utils/tsgo-checker.js.map +0 -1
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import { type DebugOption } from "./utils/debug.js";
|
|
|
5
5
|
import { FileReplacement } from "./plugins/file-replacements.plugin.js";
|
|
6
6
|
import { AnalogStylesheetRegistry } from "./stylesheet-registry.js";
|
|
7
7
|
export { DiagnosticModes, injectViteIgnoreForHmrMetadata, isIgnoredHmrFile, toAngularCompilationFileReplacements, mapTemplateUpdatesToFiles, refreshStylesheetRegistryForFile, describeStylesheetContent, isTestWatchMode, getBrowserModeCliOverride } from "./utils/compilation-shared.js";
|
|
8
|
+
import type { TypeCheckerOption } from "./utils/lsp-type-checker.js";
|
|
8
9
|
export interface PluginOptions {
|
|
9
10
|
/**
|
|
10
11
|
* Path to the tsconfig used for compilation, or a function returning it.
|
|
@@ -37,18 +38,25 @@ export interface PluginOptions {
|
|
|
37
38
|
* This is separate from Vite's `server.hmr` option, which configures the
|
|
38
39
|
* HMR client transport.
|
|
39
40
|
*
|
|
40
|
-
* Defaults to `true` for watch mode
|
|
41
|
-
*
|
|
42
|
-
*
|
|
41
|
+
* Defaults to `true` for watch mode, or `false` with `compilation: 'ngp'`,
|
|
42
|
+
* which reloads the page on every change unless this is `true`. Set to
|
|
43
|
+
* `false` to disable Angular reload updates while keeping other stylesheet
|
|
44
|
+
* externalization behavior available when needed.
|
|
43
45
|
*/
|
|
44
46
|
liveReload?: boolean;
|
|
45
47
|
/**
|
|
46
48
|
* Skip semantic and Angular template diagnostics during compilation.
|
|
47
49
|
* Defaults to `true`, or `false` with `compilation: 'ngp'`, which requires
|
|
48
|
-
*
|
|
50
|
+
* a TypeScript 7 type checker (see `typeChecker`).
|
|
49
51
|
*/
|
|
50
52
|
disableTypeChecking?: boolean;
|
|
51
53
|
/**
|
|
54
|
+
* TypeScript 7 type checker used with `compilation: 'ngp'`: `'tsgo'`
|
|
55
|
+
* (default), `'tsrs'`, or a command serving the TypeScript 7 language
|
|
56
|
+
* server over stdio (`args` defaults to `['--lsp', '--stdio']`).
|
|
57
|
+
*/
|
|
58
|
+
typeChecker?: TypeCheckerOption;
|
|
59
|
+
/**
|
|
52
60
|
* Replace source files at build time, like `fileReplacements` in
|
|
53
61
|
* `angular.json`.
|
|
54
62
|
*/
|
|
@@ -43,12 +43,12 @@ function evictDeletedFileMetadata(file, { classNamesMap, fileTransformMap }) {
|
|
|
43
43
|
}
|
|
44
44
|
function angular(options) {
|
|
45
45
|
applyDebugOption(options?.debug, options?.workspaceRoot);
|
|
46
|
-
const liveReload = options?.liveReload ?? true;
|
|
47
46
|
let externalizeStylesRequested = false;
|
|
48
47
|
let configureStylesheetRegistry;
|
|
49
48
|
let transformFilter;
|
|
50
49
|
const isTest = process.env.NODE_ENV === "test" || !!process.env["VITEST"];
|
|
51
50
|
const compilation = options?.compilation === "ngp" && !(isTest && options.jit === void 0) ? "ngp" : "ngtsc";
|
|
51
|
+
const liveReload = options?.liveReload ?? compilation !== "ngp";
|
|
52
52
|
/**
|
|
53
53
|
* Normalize plugin options so defaults
|
|
54
54
|
* are used for values not provided.
|
|
@@ -747,13 +747,14 @@ function angular(options) {
|
|
|
747
747
|
isTest,
|
|
748
748
|
isAstroIntegration,
|
|
749
749
|
fastCompileMode: pluginOptions.fastCompileMode,
|
|
750
|
-
disableTypeChecking: pluginOptions.disableTypeChecking
|
|
750
|
+
disableTypeChecking: pluginOptions.disableTypeChecking,
|
|
751
|
+
typeChecker: options?.typeChecker
|
|
751
752
|
}) : angularPlugin();
|
|
752
753
|
return [
|
|
753
754
|
cssExtensionStyleResolverPlugin(),
|
|
754
755
|
replaceFiles(pluginOptions.fileReplacements, pluginOptions.workspaceRoot),
|
|
755
756
|
virtualModulesPlugin({ jit }),
|
|
756
|
-
pluginOptions.liveReload && liveReloadPlugin({
|
|
757
|
+
pluginOptions.liveReload && liveReloadPlugin(pluginOptions.compilation === "ngp" ? compilationPlugin.api.componentUpdates : {
|
|
757
758
|
classNames,
|
|
758
759
|
fileEmitter
|
|
759
760
|
}),
|