@analogjs/vite-plugin-angular 3.0.0-alpha.72 → 3.0.0-alpha.74
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 +1 -1
- package/package.json +1 -1
- package/src/index.d.ts +2 -2
- package/src/index.js.map +1 -1
- package/src/lib/analog-plugin-interop.d.ts +12 -1
- package/src/lib/analog-plugin-interop.js +19 -1
- package/src/lib/analog-plugin-interop.js.map +1 -1
- package/src/lib/angular-jit-plugin.js +0 -2
- package/src/lib/angular-jit-plugin.js.map +1 -1
- package/src/lib/angular-vite-plugin.d.ts +1 -77
- package/src/lib/angular-vite-plugin.js +8 -23
- package/src/lib/angular-vite-plugin.js.map +1 -1
- package/src/lib/compilation-api/compilation-api-plugin.d.ts +0 -7
- package/src/lib/compilation-api/compilation-api-plugin.js +4 -13
- package/src/lib/compilation-api/compilation-api-plugin.js.map +1 -1
- package/src/lib/encapsulation-plugin.d.ts +6 -1
- package/src/lib/encapsulation-plugin.js +7 -2
- package/src/lib/encapsulation-plugin.js.map +1 -1
- package/src/lib/host.js +0 -2
- package/src/lib/host.js.map +1 -1
- package/src/lib/style-preprocessor.d.ts +1 -1
- package/src/lib/style-preprocessor.js.map +1 -1
- package/src/lib/utils/debug.d.ts +1 -3
- package/src/lib/utils/debug.js +1 -5
- package/src/lib/utils/debug.js.map +1 -1
- package/src/lib/utils/tsconfig-resolver.d.ts +0 -1
- package/src/lib/utils/tsconfig-resolver.js +1 -2
- package/src/lib/utils/tsconfig-resolver.js.map +1 -1
- package/src/lib/style-pipeline.d.ts +0 -15
- package/src/lib/style-pipeline.js +0 -31
- package/src/lib/style-pipeline.js.map +0 -1
- package/src/lib/tailwind-plugin.d.ts +0 -34
- package/src/lib/tailwind-plugin.js +0 -116
- package/src/lib/tailwind-plugin.js.map +0 -1
- package/src/lib/utils/tailwind-reference.d.ts +0 -12
- package/src/lib/utils/tailwind-reference.js +0 -99
- package/src/lib/utils/tailwind-reference.js.map +0 -1
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { AnalogStylesheetRegistry } from "./stylesheet-registry.js";
|
|
2
|
-
import type { StylePipelineStylesheetRegistry, StylePreprocessor, StylesheetTransformContext, StylesheetTransformResult } from "./style-preprocessor.js";
|
|
3
|
-
export interface AngularStylePipelineContext {
|
|
4
|
-
workspaceRoot: string;
|
|
5
|
-
}
|
|
6
|
-
export interface AngularStylePipelinePlugin {
|
|
7
|
-
name: string;
|
|
8
|
-
preprocessStylesheet?: (code: string, context: StylesheetTransformContext) => string | StylesheetTransformResult | undefined;
|
|
9
|
-
configureStylesheetRegistry?: (registry: StylePipelineStylesheetRegistry, context: AngularStylePipelineContext) => void;
|
|
10
|
-
}
|
|
11
|
-
export interface AngularStylePipelineOptions {
|
|
12
|
-
plugins: AngularStylePipelinePlugin[];
|
|
13
|
-
}
|
|
14
|
-
export declare function stylePipelinePreprocessorFromPlugins(options: AngularStylePipelineOptions | undefined): StylePreprocessor | undefined;
|
|
15
|
-
export declare function configureStylePipelineRegistry(options: AngularStylePipelineOptions | undefined, registry: AnalogStylesheetRegistry, context: AngularStylePipelineContext): void;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { debugStylePipeline } from "./utils/debug.js";
|
|
2
|
-
import { normalizeStylesheetTransformResult } from "./style-preprocessor.js";
|
|
3
|
-
//#region packages/vite-plugin-angular/src/lib/style-pipeline.ts
|
|
4
|
-
function stylePipelinePreprocessorFromPlugins(options) {
|
|
5
|
-
const preprocessors = options?.plugins.map((plugin) => plugin.preprocessStylesheet).filter((preprocessor) => !!preprocessor) ?? [];
|
|
6
|
-
if (!preprocessors.length) return;
|
|
7
|
-
return (code, filename, context) => {
|
|
8
|
-
if (!context) {
|
|
9
|
-
debugStylePipeline("skipping community stylesheet preprocessors because Angular did not provide a stylesheet context", { filename });
|
|
10
|
-
return code;
|
|
11
|
-
}
|
|
12
|
-
let current = normalizeStylesheetTransformResult(void 0, code);
|
|
13
|
-
for (const preprocess of preprocessors) {
|
|
14
|
-
const next = normalizeStylesheetTransformResult(preprocess(current.code, context), current.code);
|
|
15
|
-
current = {
|
|
16
|
-
code: next.code,
|
|
17
|
-
dependencies: [...current.dependencies ?? [], ...next.dependencies ?? []],
|
|
18
|
-
diagnostics: [...current.diagnostics ?? [], ...next.diagnostics ?? []],
|
|
19
|
-
tags: [...current.tags ?? [], ...next.tags ?? []]
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
return current;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function configureStylePipelineRegistry(options, registry, context) {
|
|
26
|
-
for (const plugin of options?.plugins ?? []) plugin.configureStylesheetRegistry?.(registry, context);
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
export { configureStylePipelineRegistry, stylePipelinePreprocessorFromPlugins };
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=style-pipeline.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-pipeline.js","names":[],"sources":["../../../src/lib/style-pipeline.ts"],"sourcesContent":["import type { AnalogStylesheetRegistry } from './stylesheet-registry.js';\nimport type {\n StylePipelineStylesheetRegistry,\n StylePreprocessor,\n StylesheetTransformContext,\n StylesheetTransformResult,\n} from './style-preprocessor.js';\nimport { normalizeStylesheetTransformResult } from './style-preprocessor.js';\nimport { debugStylePipeline } from './utils/debug.js';\n\nexport interface AngularStylePipelineContext {\n workspaceRoot: string;\n}\n\nexport interface AngularStylePipelinePlugin {\n name: string;\n preprocessStylesheet?: (\n code: string,\n context: StylesheetTransformContext,\n ) => string | StylesheetTransformResult | undefined;\n configureStylesheetRegistry?: (\n registry: StylePipelineStylesheetRegistry,\n context: AngularStylePipelineContext,\n ) => void;\n}\n\nexport interface AngularStylePipelineOptions {\n plugins: AngularStylePipelinePlugin[];\n}\n\nexport function stylePipelinePreprocessorFromPlugins(\n options: AngularStylePipelineOptions | undefined,\n): StylePreprocessor | undefined {\n const preprocessors =\n options?.plugins\n .map((plugin) => plugin.preprocessStylesheet)\n .filter((preprocessor) => !!preprocessor) ?? [];\n\n if (!preprocessors.length) {\n return undefined;\n }\n\n return (code, filename, context) => {\n if (!context) {\n debugStylePipeline(\n 'skipping community stylesheet preprocessors because Angular did not provide a stylesheet context',\n {\n filename,\n },\n );\n return code;\n }\n\n let current = normalizeStylesheetTransformResult(undefined, code);\n for (const preprocess of preprocessors) {\n const next = normalizeStylesheetTransformResult(\n preprocess(current.code, context),\n current.code,\n );\n current = {\n code: next.code,\n dependencies: [\n ...(current.dependencies ?? []),\n ...(next.dependencies ?? []),\n ],\n diagnostics: [\n ...(current.diagnostics ?? []),\n ...(next.diagnostics ?? []),\n ],\n tags: [...(current.tags ?? []), ...(next.tags ?? [])],\n };\n }\n\n return current;\n };\n}\n\nexport function configureStylePipelineRegistry(\n options: AngularStylePipelineOptions | undefined,\n registry: AnalogStylesheetRegistry,\n context: AngularStylePipelineContext,\n): void {\n for (const plugin of options?.plugins ?? []) {\n plugin.configureStylesheetRegistry?.(registry, context);\n }\n}\n"],"mappings":";;;AA8BA,SAAgB,qCACd,SAC+B;CAC/B,MAAM,gBACJ,SAAS,QACN,KAAK,WAAW,OAAO,qBAAqB,CAC5C,QAAQ,iBAAiB,CAAC,CAAC,aAAa,IAAI,EAAE;AAEnD,KAAI,CAAC,cAAc,OACjB;AAGF,SAAQ,MAAM,UAAU,YAAY;AAClC,MAAI,CAAC,SAAS;AACZ,sBACE,oGACA,EACE,UACD,CACF;AACD,UAAO;;EAGT,IAAI,UAAU,mCAAmC,KAAA,GAAW,KAAK;AACjE,OAAK,MAAM,cAAc,eAAe;GACtC,MAAM,OAAO,mCACX,WAAW,QAAQ,MAAM,QAAQ,EACjC,QAAQ,KACT;AACD,aAAU;IACR,MAAM,KAAK;IACX,cAAc,CACZ,GAAI,QAAQ,gBAAgB,EAAE,EAC9B,GAAI,KAAK,gBAAgB,EAAE,CAC5B;IACD,aAAa,CACX,GAAI,QAAQ,eAAe,EAAE,EAC7B,GAAI,KAAK,eAAe,EAAE,CAC3B;IACD,MAAM,CAAC,GAAI,QAAQ,QAAQ,EAAE,EAAG,GAAI,KAAK,QAAQ,EAAE,CAAE;IACtD;;AAGH,SAAO;;;AAIX,SAAgB,+BACd,SACA,UACA,SACM;AACN,MAAK,MAAM,UAAU,SAAS,WAAW,EAAE,CACzC,QAAO,8BAA8B,UAAU,QAAQ"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Plugin, ResolvedConfig } from "vite";
|
|
2
|
-
import type { StylePreprocessor } from "./style-preprocessor.js";
|
|
3
|
-
import type { AngularStylePipelineOptions } from "./style-pipeline.js";
|
|
4
|
-
export interface TailwindCssOptions {
|
|
5
|
-
rootStylesheet: string;
|
|
6
|
-
prefixes?: string[];
|
|
7
|
-
}
|
|
8
|
-
export interface TailwindReferencePluginOptions {
|
|
9
|
-
tailwindCss?: TailwindCssOptions;
|
|
10
|
-
}
|
|
11
|
-
export declare function tailwindReferencePlugin(options: TailwindReferencePluginOptions): Plugin;
|
|
12
|
-
/**
|
|
13
|
-
* Builds a resolved stylePreprocessor function from plugin options.
|
|
14
|
-
*
|
|
15
|
-
* When `tailwindCss` is configured, creates an injector that prepends
|
|
16
|
-
* `@reference "<rootStylesheet>"` into component CSS that uses Tailwind
|
|
17
|
-
* utilities. Uses absolute paths because Angular's externalRuntimeStyles
|
|
18
|
-
* serves component CSS as virtual modules (hash-based IDs) with no
|
|
19
|
-
* meaningful directory — relative paths can't resolve from a hash.
|
|
20
|
-
*
|
|
21
|
-
* If both `tailwindCss` and `stylePreprocessor` are provided, they are
|
|
22
|
-
* chained: Tailwind reference injection runs first, then the user's
|
|
23
|
-
* custom preprocessor.
|
|
24
|
-
*/
|
|
25
|
-
export declare function buildStylePreprocessor(options?: {
|
|
26
|
-
stylePreprocessor?: StylePreprocessor;
|
|
27
|
-
stylePipeline?: AngularStylePipelineOptions;
|
|
28
|
-
tailwindCss?: TailwindCssOptions;
|
|
29
|
-
}): StylePreprocessor | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Validates the Tailwind CSS integration configuration and emits actionable
|
|
32
|
-
* warnings for common misconfigurations that cause silent failures.
|
|
33
|
-
*/
|
|
34
|
-
export declare function validateTailwindConfig(tailwindCss: TailwindCssOptions | undefined, config: ResolvedConfig, isWatchMode: boolean): void;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { debugTailwind, debugTailwindV } from "./utils/debug.js";
|
|
2
|
-
import { inspectCssTailwindDirectives, throwTailwindReferenceTextError } from "./utils/tailwind-reference.js";
|
|
3
|
-
import { composeStylePreprocessors } from "./style-preprocessor.js";
|
|
4
|
-
import { stylePipelinePreprocessorFromPlugins } from "./style-pipeline.js";
|
|
5
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
6
|
-
import { basename, dirname, isAbsolute } from "node:path";
|
|
7
|
-
import { normalizePath } from "vite";
|
|
8
|
-
//#region packages/vite-plugin-angular/src/lib/tailwind-plugin.ts
|
|
9
|
-
/**
|
|
10
|
-
* Core injection logic shared by both the Vite pre-transform plugin and the
|
|
11
|
-
* Angular style preprocessor. Returns the `@reference`-prepended CSS when
|
|
12
|
-
* injection is needed, or `undefined` when the file should be left alone.
|
|
13
|
-
*/
|
|
14
|
-
function injectTailwindReference(code, opts) {
|
|
15
|
-
const directiveState = inspectCssTailwindDirectives(code);
|
|
16
|
-
if (directiveState.hasReferenceDirective || directiveState.hasTailwindImportDirective) return;
|
|
17
|
-
if (!(opts.prefixes ? opts.prefixes.some((p) => directiveState.commentlessCode.includes(p)) : directiveState.commentlessCode.includes("@apply"))) return;
|
|
18
|
-
if (directiveState.hasReferenceText) throwTailwindReferenceTextError(opts.fileId, opts.rootStylesheet);
|
|
19
|
-
return `@reference "${opts.rootStylesheet.replace(/\\/g, "/")}";\n${code}`;
|
|
20
|
-
}
|
|
21
|
-
function tailwindReferencePlugin(options) {
|
|
22
|
-
return {
|
|
23
|
-
name: "@analogjs/vite-plugin-angular:tailwind-reference",
|
|
24
|
-
enforce: "pre",
|
|
25
|
-
transform(code, id) {
|
|
26
|
-
const tw = options.tailwindCss;
|
|
27
|
-
if (!tw || !id.includes(".css")) return;
|
|
28
|
-
if (id.split("?")[0] === tw.rootStylesheet) return;
|
|
29
|
-
const rootBasename = basename(tw.rootStylesheet);
|
|
30
|
-
if (inspectCssTailwindDirectives(code).commentlessCode.includes(rootBasename)) return;
|
|
31
|
-
const result = injectTailwindReference(code, {
|
|
32
|
-
rootStylesheet: tw.rootStylesheet,
|
|
33
|
-
prefixes: tw.prefixes,
|
|
34
|
-
fileId: id
|
|
35
|
-
});
|
|
36
|
-
if (result) debugTailwind("injected @reference via pre-transform", { id: id.split("/").slice(-2).join("/") });
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Builds a resolved stylePreprocessor function from plugin options.
|
|
43
|
-
*
|
|
44
|
-
* When `tailwindCss` is configured, creates an injector that prepends
|
|
45
|
-
* `@reference "<rootStylesheet>"` into component CSS that uses Tailwind
|
|
46
|
-
* utilities. Uses absolute paths because Angular's externalRuntimeStyles
|
|
47
|
-
* serves component CSS as virtual modules (hash-based IDs) with no
|
|
48
|
-
* meaningful directory — relative paths can't resolve from a hash.
|
|
49
|
-
*
|
|
50
|
-
* If both `tailwindCss` and `stylePreprocessor` are provided, they are
|
|
51
|
-
* chained: Tailwind reference injection runs first, then the user's
|
|
52
|
-
* custom preprocessor.
|
|
53
|
-
*/
|
|
54
|
-
function buildStylePreprocessor(options) {
|
|
55
|
-
const userPreprocessor = options?.stylePreprocessor;
|
|
56
|
-
const stylePipelinePreprocessor = stylePipelinePreprocessorFromPlugins(options?.stylePipeline);
|
|
57
|
-
const tw = options?.tailwindCss;
|
|
58
|
-
if (!tw && !userPreprocessor && !stylePipelinePreprocessor) return;
|
|
59
|
-
let tailwindPreprocessor;
|
|
60
|
-
if (tw) {
|
|
61
|
-
const rootStylesheet = tw.rootStylesheet;
|
|
62
|
-
const prefixes = tw.prefixes;
|
|
63
|
-
debugTailwind("configured", {
|
|
64
|
-
rootStylesheet,
|
|
65
|
-
prefixes
|
|
66
|
-
});
|
|
67
|
-
if (!existsSync(rootStylesheet)) console.warn(`[@analogjs/vite-plugin-angular] tailwindCss.rootStylesheet not found at "${rootStylesheet}". @reference directives will point to a non-existent file, which will cause Tailwind CSS errors. Ensure the path is absolute and the file exists.`);
|
|
68
|
-
tailwindPreprocessor = (code, filename) => {
|
|
69
|
-
const result = injectTailwindReference(code, {
|
|
70
|
-
rootStylesheet,
|
|
71
|
-
prefixes,
|
|
72
|
-
fileId: filename
|
|
73
|
-
});
|
|
74
|
-
if (result) {
|
|
75
|
-
debugTailwind("injected @reference via preprocessor", { filename });
|
|
76
|
-
return result;
|
|
77
|
-
}
|
|
78
|
-
debugTailwindV("skip (no injection needed)", { filename });
|
|
79
|
-
return code;
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
if (tailwindPreprocessor && (stylePipelinePreprocessor || userPreprocessor)) debugTailwind("chained with style pipeline or user stylePreprocessor");
|
|
83
|
-
return composeStylePreprocessors([
|
|
84
|
-
tailwindPreprocessor,
|
|
85
|
-
stylePipelinePreprocessor,
|
|
86
|
-
userPreprocessor
|
|
87
|
-
]);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Validates the Tailwind CSS integration configuration and emits actionable
|
|
91
|
-
* warnings for common misconfigurations that cause silent failures.
|
|
92
|
-
*/
|
|
93
|
-
function validateTailwindConfig(tailwindCss, config, isWatchMode) {
|
|
94
|
-
const PREFIX = "[@analogjs/vite-plugin-angular]";
|
|
95
|
-
const tw = tailwindCss;
|
|
96
|
-
if (!tw) return;
|
|
97
|
-
if (!isAbsolute(tw.rootStylesheet)) console.warn(`${PREFIX} tailwindCss.rootStylesheet must be an absolute path. Got: "${tw.rootStylesheet}". Use path.resolve(__dirname, '...') in your vite.config to convert it.`);
|
|
98
|
-
const hasTailwindPlugin = config.plugins.some((p) => p.name.startsWith("@tailwindcss/vite") || p.name.startsWith("tailwindcss"));
|
|
99
|
-
if (isWatchMode && !hasTailwindPlugin) throw new Error(`${PREFIX} tailwindCss is configured but no @tailwindcss/vite plugin was found. Component CSS with @apply directives will not be processed.\n\n Fix: npm install @tailwindcss/vite --save-dev\n Then add tailwindcss() to your vite.config plugins array.\n`);
|
|
100
|
-
if (isWatchMode && tw.rootStylesheet) {
|
|
101
|
-
const projectRoot = normalizePath(config.root);
|
|
102
|
-
const normalizedRootStylesheet = normalizePath(tw.rootStylesheet);
|
|
103
|
-
if (!normalizedRootStylesheet.startsWith(projectRoot)) {
|
|
104
|
-
if (!(config.server?.fs?.allow ?? []).some((allowed) => normalizedRootStylesheet.startsWith(normalizePath(allowed)))) console.warn(`${PREFIX} tailwindCss.rootStylesheet is outside the Vite project root. The dev server may reject it with 403.\n\n Root: ${projectRoot}\n Stylesheet: ${tw.rootStylesheet}\n\n Fix: server.fs.allow: ['${dirname(tw.rootStylesheet)}']\n`);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
if (tw.prefixes !== void 0 && tw.prefixes.length === 0) console.warn(`${PREFIX} tailwindCss.prefixes is an empty array. No component stylesheets will receive @reference injection. Either remove the prefixes option (to use @apply detection) or specify your prefixes: ['tw:']\n`);
|
|
108
|
-
if (existsSync(tw.rootStylesheet)) try {
|
|
109
|
-
const rootContent = readFileSync(tw.rootStylesheet, "utf-8");
|
|
110
|
-
if (!rootContent.includes("@import \"tailwindcss\"") && !rootContent.includes("@import 'tailwindcss'")) console.warn(`${PREFIX} tailwindCss.rootStylesheet does not contain @import "tailwindcss". The @reference directive will point to a file without Tailwind configuration.\n\n File: ${tw.rootStylesheet}\n`);
|
|
111
|
-
} catch {}
|
|
112
|
-
}
|
|
113
|
-
//#endregion
|
|
114
|
-
export { buildStylePreprocessor, tailwindReferencePlugin, validateTailwindConfig };
|
|
115
|
-
|
|
116
|
-
//# sourceMappingURL=tailwind-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind-plugin.js","names":[],"sources":["../../../src/lib/tailwind-plugin.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { basename, dirname, isAbsolute } from 'node:path';\nimport { normalizePath, Plugin, ResolvedConfig } from 'vite';\nimport {\n inspectCssTailwindDirectives,\n throwTailwindReferenceTextError,\n} from './utils/tailwind-reference.js';\nimport { debugTailwind, debugTailwindV } from './utils/debug.js';\nimport { composeStylePreprocessors } from './style-preprocessor.js';\nimport type { StylePreprocessor } from './style-preprocessor.js';\nimport { stylePipelinePreprocessorFromPlugins } from './style-pipeline.js';\nimport type { AngularStylePipelineOptions } from './style-pipeline.js';\n\nexport interface TailwindCssOptions {\n rootStylesheet: string;\n prefixes?: string[];\n}\n\nexport interface TailwindReferencePluginOptions {\n tailwindCss?: TailwindCssOptions;\n}\n\n/**\n * Core injection logic shared by both the Vite pre-transform plugin and the\n * Angular style preprocessor. Returns the `@reference`-prepended CSS when\n * injection is needed, or `undefined` when the file should be left alone.\n */\nfunction injectTailwindReference(\n code: string,\n opts: {\n rootStylesheet: string;\n prefixes?: string[];\n fileId: string;\n },\n): string | undefined {\n const directiveState = inspectCssTailwindDirectives(code);\n\n if (\n directiveState.hasReferenceDirective ||\n directiveState.hasTailwindImportDirective\n ) {\n return undefined;\n }\n\n const needsRef = opts.prefixes\n ? opts.prefixes.some((p) => directiveState.commentlessCode.includes(p))\n : directiveState.commentlessCode.includes('@apply');\n\n if (!needsRef) {\n return undefined;\n }\n\n if (directiveState.hasReferenceText) {\n throwTailwindReferenceTextError(opts.fileId, opts.rootStylesheet);\n }\n\n return `@reference \"${opts.rootStylesheet.replace(/\\\\/g, '/')}\";\\n${code}`;\n}\n\nexport function tailwindReferencePlugin(\n options: TailwindReferencePluginOptions,\n): Plugin {\n return {\n name: '@analogjs/vite-plugin-angular:tailwind-reference',\n enforce: 'pre',\n transform(code: string, id: string) {\n const tw = options.tailwindCss;\n if (!tw || !id.includes('.css')) return;\n\n const cleanId = id.split('?')[0];\n if (cleanId === tw.rootStylesheet) return;\n\n // Skip entry stylesheets that @import the root config\n const rootBasename = basename(tw.rootStylesheet);\n const directiveState = inspectCssTailwindDirectives(code);\n if (directiveState.commentlessCode.includes(rootBasename)) return;\n\n const result = injectTailwindReference(code, {\n rootStylesheet: tw.rootStylesheet,\n prefixes: tw.prefixes,\n fileId: id,\n });\n\n if (result) {\n debugTailwind('injected @reference via pre-transform', {\n id: id.split('/').slice(-2).join('/'),\n });\n }\n\n return result;\n },\n };\n}\n\n/**\n * Builds a resolved stylePreprocessor function from plugin options.\n *\n * When `tailwindCss` is configured, creates an injector that prepends\n * `@reference \"<rootStylesheet>\"` into component CSS that uses Tailwind\n * utilities. Uses absolute paths because Angular's externalRuntimeStyles\n * serves component CSS as virtual modules (hash-based IDs) with no\n * meaningful directory — relative paths can't resolve from a hash.\n *\n * If both `tailwindCss` and `stylePreprocessor` are provided, they are\n * chained: Tailwind reference injection runs first, then the user's\n * custom preprocessor.\n */\nexport function buildStylePreprocessor(options?: {\n stylePreprocessor?: StylePreprocessor;\n stylePipeline?: AngularStylePipelineOptions;\n tailwindCss?: TailwindCssOptions;\n}): StylePreprocessor | undefined {\n const userPreprocessor = options?.stylePreprocessor;\n const stylePipelinePreprocessor = stylePipelinePreprocessorFromPlugins(\n options?.stylePipeline,\n );\n const tw = options?.tailwindCss;\n\n if (!tw && !userPreprocessor && !stylePipelinePreprocessor) {\n return undefined;\n }\n\n let tailwindPreprocessor:\n | ((code: string, filename: string) => string)\n | undefined;\n\n if (tw) {\n const rootStylesheet = tw.rootStylesheet;\n const prefixes = tw.prefixes;\n debugTailwind('configured', { rootStylesheet, prefixes });\n\n if (!existsSync(rootStylesheet)) {\n console.warn(\n `[@analogjs/vite-plugin-angular] tailwindCss.rootStylesheet not found ` +\n `at \"${rootStylesheet}\". @reference directives will point to a ` +\n `non-existent file, which will cause Tailwind CSS errors. ` +\n `Ensure the path is absolute and the file exists.`,\n );\n }\n\n tailwindPreprocessor = (code: string, filename: string): string => {\n const result = injectTailwindReference(code, {\n rootStylesheet,\n prefixes,\n fileId: filename,\n });\n\n if (result) {\n debugTailwind('injected @reference via preprocessor', { filename });\n return result;\n }\n\n debugTailwindV('skip (no injection needed)', { filename });\n return code;\n };\n }\n\n if (tailwindPreprocessor && (stylePipelinePreprocessor || userPreprocessor)) {\n debugTailwind('chained with style pipeline or user stylePreprocessor');\n }\n\n return composeStylePreprocessors([\n tailwindPreprocessor,\n stylePipelinePreprocessor,\n userPreprocessor,\n ]);\n}\n\n/**\n * Validates the Tailwind CSS integration configuration and emits actionable\n * warnings for common misconfigurations that cause silent failures.\n */\nexport function validateTailwindConfig(\n tailwindCss: TailwindCssOptions | undefined,\n config: ResolvedConfig,\n isWatchMode: boolean,\n): void {\n const PREFIX = '[@analogjs/vite-plugin-angular]';\n const tw = tailwindCss;\n\n if (!tw) return;\n\n if (!isAbsolute(tw.rootStylesheet)) {\n console.warn(\n `${PREFIX} tailwindCss.rootStylesheet must be an absolute path. ` +\n `Got: \"${tw.rootStylesheet}\". Use path.resolve(__dirname, '...') ` +\n `in your vite.config to convert it.`,\n );\n }\n\n const resolvedPlugins = config.plugins;\n const hasTailwindPlugin = resolvedPlugins.some(\n (p) =>\n p.name.startsWith('@tailwindcss/vite') ||\n p.name.startsWith('tailwindcss'),\n );\n\n if (isWatchMode && !hasTailwindPlugin) {\n throw new Error(\n `${PREFIX} tailwindCss is configured but no @tailwindcss/vite ` +\n `plugin was found. Component CSS with @apply directives will ` +\n `not be processed.\\n\\n` +\n ` Fix: npm install @tailwindcss/vite --save-dev\\n` +\n ` Then add tailwindcss() to your vite.config plugins array.\\n`,\n );\n }\n\n if (isWatchMode && tw.rootStylesheet) {\n const projectRoot = normalizePath(config.root);\n const normalizedRootStylesheet = normalizePath(tw.rootStylesheet);\n if (!normalizedRootStylesheet.startsWith(projectRoot)) {\n const fsAllow = config.server?.fs?.allow ?? [];\n const isAllowed = fsAllow.some((allowed) =>\n normalizedRootStylesheet.startsWith(normalizePath(allowed)),\n );\n if (!isAllowed) {\n console.warn(\n `${PREFIX} tailwindCss.rootStylesheet is outside the Vite ` +\n `project root. The dev server may reject it with 403.\\n\\n` +\n ` Root: ${projectRoot}\\n` +\n ` Stylesheet: ${tw.rootStylesheet}\\n\\n` +\n ` Fix: server.fs.allow: ['${dirname(tw.rootStylesheet)}']\\n`,\n );\n }\n }\n }\n\n if (tw.prefixes !== undefined && tw.prefixes.length === 0) {\n console.warn(\n `${PREFIX} tailwindCss.prefixes is an empty array. No component ` +\n `stylesheets will receive @reference injection. Either remove ` +\n `the prefixes option (to use @apply detection) or specify your ` +\n `prefixes: ['tw:']\\n`,\n );\n }\n\n if (existsSync(tw.rootStylesheet)) {\n try {\n const rootContent = readFileSync(tw.rootStylesheet, 'utf-8');\n if (\n !rootContent.includes('@import \"tailwindcss\"') &&\n !rootContent.includes(\"@import 'tailwindcss'\")\n ) {\n console.warn(\n `${PREFIX} tailwindCss.rootStylesheet does not contain ` +\n `@import \"tailwindcss\". The @reference directive will ` +\n `point to a file without Tailwind configuration.\\n\\n` +\n ` File: ${tw.rootStylesheet}\\n`,\n );\n }\n } catch {\n // Silently skip — existence check already warned in buildStylePreprocessor.\n }\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface CssTailwindDirectiveState {
|
|
2
|
-
commentlessCode: string;
|
|
3
|
-
hasReferenceDirective: boolean;
|
|
4
|
-
hasReferenceText: boolean;
|
|
5
|
-
hasTailwindImportDirective: boolean;
|
|
6
|
-
}
|
|
7
|
-
export declare class TailwindReferenceError extends Error {
|
|
8
|
-
readonly name = "TailwindReferenceError";
|
|
9
|
-
}
|
|
10
|
-
export declare function inspectCssTailwindDirectives(code: string): CssTailwindDirectiveState;
|
|
11
|
-
export declare function throwTailwindReferenceTextError(filename: string, rootStylesheet: string): never;
|
|
12
|
-
export declare function isTailwindReferenceError(error: unknown): error is TailwindReferenceError;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
//#region packages/vite-plugin-angular/src/lib/utils/tailwind-reference.ts
|
|
2
|
-
var ANGULAR_TAILWIND_PREFIX = "[@analogjs/vite-plugin-angular]";
|
|
3
|
-
var CSS_REFERENCE_DIRECTIVE_REGEX = /(^|[;}\n\r])\s*@reference\b/m;
|
|
4
|
-
var CSS_TAILWIND_IMPORT_REGEX = /(^|[;}\n\r])\s*@import\s+["']tailwindcss["']/m;
|
|
5
|
-
var TailwindReferenceError = class extends Error {
|
|
6
|
-
name = "TailwindReferenceError";
|
|
7
|
-
};
|
|
8
|
-
function stripCssBlockComments(code) {
|
|
9
|
-
let result = "";
|
|
10
|
-
let quote = null;
|
|
11
|
-
for (let index = 0; index < code.length; index++) {
|
|
12
|
-
const character = code[index];
|
|
13
|
-
const nextCharacter = code[index + 1];
|
|
14
|
-
if (quote) {
|
|
15
|
-
if (character === "\\" && nextCharacter) {
|
|
16
|
-
result += character;
|
|
17
|
-
result += nextCharacter;
|
|
18
|
-
index++;
|
|
19
|
-
continue;
|
|
20
|
-
}
|
|
21
|
-
if (character === quote) quote = null;
|
|
22
|
-
result += character;
|
|
23
|
-
continue;
|
|
24
|
-
}
|
|
25
|
-
if (character === "\"" || character === "'" || character === "`") {
|
|
26
|
-
quote = character;
|
|
27
|
-
result += character;
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
if (character === "/" && nextCharacter === "*") {
|
|
31
|
-
result += " ";
|
|
32
|
-
index += 2;
|
|
33
|
-
while (index < code.length) {
|
|
34
|
-
const commentCharacter = code[index];
|
|
35
|
-
const commentNextCharacter = code[index + 1];
|
|
36
|
-
if (commentCharacter === "*" && commentNextCharacter === "/") {
|
|
37
|
-
result += " ";
|
|
38
|
-
index++;
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
result += commentCharacter === "\n" || commentCharacter === "\r" ? commentCharacter : " ";
|
|
42
|
-
index++;
|
|
43
|
-
}
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
result += character;
|
|
47
|
-
}
|
|
48
|
-
return result;
|
|
49
|
-
}
|
|
50
|
-
function hasReferenceTextInComments(code) {
|
|
51
|
-
let quote = null;
|
|
52
|
-
for (let index = 0; index < code.length; index++) {
|
|
53
|
-
const character = code[index];
|
|
54
|
-
const nextCharacter = code[index + 1];
|
|
55
|
-
if (quote) {
|
|
56
|
-
if (character === "\\" && nextCharacter) {
|
|
57
|
-
index++;
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
if (character === quote) quote = null;
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
if (character === "\"" || character === "'" || character === "`") {
|
|
64
|
-
quote = character;
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
if (character === "/" && nextCharacter === "*") {
|
|
68
|
-
const commentStart = index + 2;
|
|
69
|
-
index += 2;
|
|
70
|
-
while (index < code.length) {
|
|
71
|
-
const commentCharacter = code[index];
|
|
72
|
-
const commentNextCharacter = code[index + 1];
|
|
73
|
-
if (commentCharacter === "*" && commentNextCharacter === "/") break;
|
|
74
|
-
index++;
|
|
75
|
-
}
|
|
76
|
-
if (code.slice(commentStart, index).includes("@reference")) return true;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
function inspectCssTailwindDirectives(code) {
|
|
82
|
-
const commentlessCode = stripCssBlockComments(code);
|
|
83
|
-
return {
|
|
84
|
-
commentlessCode,
|
|
85
|
-
hasReferenceDirective: CSS_REFERENCE_DIRECTIVE_REGEX.test(commentlessCode),
|
|
86
|
-
hasReferenceText: hasReferenceTextInComments(code),
|
|
87
|
-
hasTailwindImportDirective: CSS_TAILWIND_IMPORT_REGEX.test(commentlessCode)
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
function throwTailwindReferenceTextError(filename, rootStylesheet) {
|
|
91
|
-
throw new TailwindReferenceError(`${ANGULAR_TAILWIND_PREFIX} Tailwind @reference auto-injection was blocked for "${filename}" because the stylesheet contains the text "@reference" but does not contain a real @reference directive.\n\nThis is usually caused by a CSS comment such as "/* ... @reference ... */".\n\nFix one of:\n - Reword the comment so it does not contain "@reference"\n - Add a real @reference "${rootStylesheet}"; directive\n`);
|
|
92
|
-
}
|
|
93
|
-
function isTailwindReferenceError(error) {
|
|
94
|
-
return error instanceof TailwindReferenceError;
|
|
95
|
-
}
|
|
96
|
-
//#endregion
|
|
97
|
-
export { inspectCssTailwindDirectives, isTailwindReferenceError, throwTailwindReferenceTextError };
|
|
98
|
-
|
|
99
|
-
//# sourceMappingURL=tailwind-reference.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind-reference.js","names":[],"sources":["../../../../src/lib/utils/tailwind-reference.ts"],"sourcesContent":["const ANGULAR_TAILWIND_PREFIX = '[@analogjs/vite-plugin-angular]';\nconst CSS_REFERENCE_DIRECTIVE_REGEX = /(^|[;}\\n\\r])\\s*@reference\\b/m;\nconst CSS_TAILWIND_IMPORT_REGEX =\n /(^|[;}\\n\\r])\\s*@import\\s+[\"']tailwindcss[\"']/m;\n\nexport interface CssTailwindDirectiveState {\n commentlessCode: string;\n hasReferenceDirective: boolean;\n hasReferenceText: boolean;\n hasTailwindImportDirective: boolean;\n}\n\nexport class TailwindReferenceError extends Error {\n readonly name = 'TailwindReferenceError';\n}\n\n// Match real CSS directives, not prose inside block comments. The scanner keeps\n// quoted CSS content intact so `/* ... */` sequences inside strings do not get\n// mistaken for real comments.\nfunction stripCssBlockComments(code: string): string {\n let result = '';\n let quote: '\"' | \"'\" | '`' | null = null;\n\n for (let index = 0; index < code.length; index++) {\n const character = code[index];\n const nextCharacter = code[index + 1];\n\n if (quote) {\n if (character === '\\\\' && nextCharacter) {\n result += character;\n result += nextCharacter;\n index++;\n continue;\n }\n if (character === quote) {\n quote = null;\n }\n result += character;\n continue;\n }\n\n if (character === '\"' || character === \"'\" || character === '`') {\n quote = character;\n result += character;\n continue;\n }\n\n if (character === '/' && nextCharacter === '*') {\n result += ' ';\n index += 2;\n\n while (index < code.length) {\n const commentCharacter = code[index];\n const commentNextCharacter = code[index + 1];\n\n if (commentCharacter === '*' && commentNextCharacter === '/') {\n result += ' ';\n index++;\n break;\n }\n\n result +=\n commentCharacter === '\\n' || commentCharacter === '\\r'\n ? commentCharacter\n : ' ';\n index++;\n }\n continue;\n }\n\n result += character;\n }\n\n return result;\n}\n\nfunction hasReferenceTextInComments(code: string): boolean {\n let quote: '\"' | \"'\" | '`' | null = null;\n\n for (let index = 0; index < code.length; index++) {\n const character = code[index];\n const nextCharacter = code[index + 1];\n\n if (quote) {\n if (character === '\\\\' && nextCharacter) {\n index++;\n continue;\n }\n if (character === quote) {\n quote = null;\n }\n continue;\n }\n\n if (character === '\"' || character === \"'\" || character === '`') {\n quote = character;\n continue;\n }\n\n if (character === '/' && nextCharacter === '*') {\n const commentStart = index + 2;\n index += 2;\n\n while (index < code.length) {\n const commentCharacter = code[index];\n const commentNextCharacter = code[index + 1];\n\n if (commentCharacter === '*' && commentNextCharacter === '/') {\n break;\n }\n index++;\n }\n\n if (code.slice(commentStart, index).includes('@reference')) {\n return true;\n }\n }\n }\n\n return false;\n}\n\nexport function inspectCssTailwindDirectives(\n code: string,\n): CssTailwindDirectiveState {\n const commentlessCode = stripCssBlockComments(code);\n\n return {\n commentlessCode,\n hasReferenceDirective: CSS_REFERENCE_DIRECTIVE_REGEX.test(commentlessCode),\n hasReferenceText: hasReferenceTextInComments(code),\n hasTailwindImportDirective: CSS_TAILWIND_IMPORT_REGEX.test(commentlessCode),\n };\n}\n\nexport function throwTailwindReferenceTextError(\n filename: string,\n rootStylesheet: string,\n): never {\n throw new TailwindReferenceError(\n `${ANGULAR_TAILWIND_PREFIX} Tailwind @reference auto-injection was ` +\n `blocked for \"${filename}\" because the stylesheet contains the ` +\n `text \"@reference\" but does not contain a real @reference ` +\n `directive.\\n\\n` +\n `This is usually caused by a CSS comment such as ` +\n `\"/* ... @reference ... */\".\\n\\n` +\n `Fix one of:\\n` +\n ` - Reword the comment so it does not contain \"@reference\"\\n` +\n ` - Add a real @reference \"${rootStylesheet}\"; directive\\n`,\n );\n}\n\nexport function isTailwindReferenceError(\n error: unknown,\n): error is TailwindReferenceError {\n return error instanceof TailwindReferenceError;\n}\n"],"mappings":";AAAA,IAAM,0BAA0B;AAChC,IAAM,gCAAgC;AACtC,IAAM,4BACJ;AASF,IAAa,yBAAb,cAA4C,MAAM;CAChD,OAAgB;;AAMlB,SAAS,sBAAsB,MAAsB;CACnD,IAAI,SAAS;CACb,IAAI,QAAgC;AAEpC,MAAK,IAAI,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;EAChD,MAAM,YAAY,KAAK;EACvB,MAAM,gBAAgB,KAAK,QAAQ;AAEnC,MAAI,OAAO;AACT,OAAI,cAAc,QAAQ,eAAe;AACvC,cAAU;AACV,cAAU;AACV;AACA;;AAEF,OAAI,cAAc,MAChB,SAAQ;AAEV,aAAU;AACV;;AAGF,MAAI,cAAc,QAAO,cAAc,OAAO,cAAc,KAAK;AAC/D,WAAQ;AACR,aAAU;AACV;;AAGF,MAAI,cAAc,OAAO,kBAAkB,KAAK;AAC9C,aAAU;AACV,YAAS;AAET,UAAO,QAAQ,KAAK,QAAQ;IAC1B,MAAM,mBAAmB,KAAK;IAC9B,MAAM,uBAAuB,KAAK,QAAQ;AAE1C,QAAI,qBAAqB,OAAO,yBAAyB,KAAK;AAC5D,eAAU;AACV;AACA;;AAGF,cACE,qBAAqB,QAAQ,qBAAqB,OAC9C,mBACA;AACN;;AAEF;;AAGF,YAAU;;AAGZ,QAAO;;AAGT,SAAS,2BAA2B,MAAuB;CACzD,IAAI,QAAgC;AAEpC,MAAK,IAAI,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;EAChD,MAAM,YAAY,KAAK;EACvB,MAAM,gBAAgB,KAAK,QAAQ;AAEnC,MAAI,OAAO;AACT,OAAI,cAAc,QAAQ,eAAe;AACvC;AACA;;AAEF,OAAI,cAAc,MAChB,SAAQ;AAEV;;AAGF,MAAI,cAAc,QAAO,cAAc,OAAO,cAAc,KAAK;AAC/D,WAAQ;AACR;;AAGF,MAAI,cAAc,OAAO,kBAAkB,KAAK;GAC9C,MAAM,eAAe,QAAQ;AAC7B,YAAS;AAET,UAAO,QAAQ,KAAK,QAAQ;IAC1B,MAAM,mBAAmB,KAAK;IAC9B,MAAM,uBAAuB,KAAK,QAAQ;AAE1C,QAAI,qBAAqB,OAAO,yBAAyB,IACvD;AAEF;;AAGF,OAAI,KAAK,MAAM,cAAc,MAAM,CAAC,SAAS,aAAa,CACxD,QAAO;;;AAKb,QAAO;;AAGT,SAAgB,6BACd,MAC2B;CAC3B,MAAM,kBAAkB,sBAAsB,KAAK;AAEnD,QAAO;EACL;EACA,uBAAuB,8BAA8B,KAAK,gBAAgB;EAC1E,kBAAkB,2BAA2B,KAAK;EAClD,4BAA4B,0BAA0B,KAAK,gBAAgB;EAC5E;;AAGH,SAAgB,gCACd,UACA,gBACO;AACP,OAAM,IAAI,uBACR,GAAG,wBAAwB,uDACT,SAAS,kSAOK,eAAe,gBAChD;;AAGH,SAAgB,yBACd,OACiC;AACjC,QAAO,iBAAiB"}
|