@angular-devkit/build-angular 17.1.0-next.2 → 17.1.0-rc.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/builders.json +5 -0
- package/package.json +24 -20
- package/src/builders/app-shell/index.js +7 -0
- package/src/builders/application/build-action.d.ts +4 -3
- package/src/builders/application/build-action.js +8 -5
- package/src/builders/application/execute-build.js +10 -4
- package/src/builders/application/index.d.ts +20 -10
- package/src/builders/application/index.js +38 -26
- package/src/builders/application/options.d.ts +11 -3
- package/src/builders/application/options.js +42 -30
- package/src/builders/application/schema.d.ts +32 -2
- package/src/builders/application/schema.json +40 -2
- package/src/builders/browser-esbuild/index.js +8 -4
- package/src/builders/dev-server/vite-server.js +7 -13
- package/src/builders/jest/index.js +2 -2
- package/src/builders/prerender/index.js +7 -0
- package/src/builders/ssr-dev-server/index.js +17 -31
- package/src/builders/web-test-runner/builder-status-warnings.d.ts +11 -0
- package/src/builders/web-test-runner/builder-status-warnings.js +46 -0
- package/src/builders/web-test-runner/index.d.ts +10 -0
- package/src/builders/web-test-runner/index.js +151 -0
- package/src/builders/web-test-runner/jasmine_runner.js +88 -0
- package/src/builders/web-test-runner/options.d.ts +24 -0
- package/src/builders/web-test-runner/options.js +26 -0
- package/src/builders/web-test-runner/schema.d.ts +188 -0
- package/src/builders/web-test-runner/schema.js +15 -0
- package/src/builders/web-test-runner/schema.json +291 -0
- package/src/builders/web-test-runner/test_page.html +40 -0
- package/src/tools/esbuild/angular/angular-host.js +1 -1
- package/src/tools/esbuild/angular/compiler-plugin.js +10 -26
- package/src/tools/esbuild/angular/component-stylesheets.d.ts +3 -6
- package/src/tools/esbuild/angular/component-stylesheets.js +46 -60
- package/src/tools/esbuild/angular/jit-plugin-callbacks.js +2 -2
- package/src/tools/esbuild/bundler-context.d.ts +1 -1
- package/src/tools/esbuild/bundler-context.js +18 -2
- package/src/tools/esbuild/cache.d.ts +88 -0
- package/src/tools/esbuild/cache.js +92 -0
- package/src/tools/esbuild/compiler-plugin-options.js +1 -1
- package/src/tools/esbuild/index-html-generator.js +3 -1
- package/src/tools/esbuild/javascript-transformer-worker.d.ts +2 -2
- package/src/tools/esbuild/javascript-transformer-worker.js +12 -5
- package/src/tools/esbuild/javascript-transformer.d.ts +3 -1
- package/src/tools/esbuild/javascript-transformer.js +42 -17
- package/src/tools/esbuild/stylesheets/bundle-options.d.ts +1 -1
- package/src/tools/esbuild/stylesheets/sass-language.js +3 -12
- package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.js +9 -1
- package/src/tools/esbuild/utils.d.ts +2 -2
- package/src/tools/esbuild/utils.js +61 -74
- package/src/tools/sass/lexer.d.ts +0 -11
- package/src/tools/sass/lexer.js +1 -87
- package/src/utils/index-file/index-html-generator.js +15 -28
- package/src/utils/index.d.ts +1 -0
- package/src/utils/index.js +1 -0
- package/src/{builders/dev-server → utils}/load-proxy-config.js +2 -2
- package/src/{builders/jest → utils}/test-files.d.ts +1 -2
- package/src/{builders/jest → utils}/test-files.js +3 -3
- /package/src/{builders/dev-server → utils}/load-proxy-config.d.ts +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web Test Runner target options for Build Facade.
|
|
3
|
+
*/
|
|
4
|
+
export interface Schema {
|
|
5
|
+
/**
|
|
6
|
+
* List of static application assets.
|
|
7
|
+
*/
|
|
8
|
+
assets?: AssetPattern[];
|
|
9
|
+
/**
|
|
10
|
+
* Override which browsers tests are run against.
|
|
11
|
+
*/
|
|
12
|
+
browsers?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Output a code coverage report.
|
|
15
|
+
*/
|
|
16
|
+
codeCoverage?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Globs to exclude from code coverage.
|
|
19
|
+
*/
|
|
20
|
+
codeCoverageExclude?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* Globs of files to exclude, relative to the project root.
|
|
23
|
+
*/
|
|
24
|
+
exclude?: string[];
|
|
25
|
+
/**
|
|
26
|
+
* Replace compilation source files with other compilation source files in the build.
|
|
27
|
+
*/
|
|
28
|
+
fileReplacements?: FileReplacement[];
|
|
29
|
+
/**
|
|
30
|
+
* Globs of files to include, relative to project root.
|
|
31
|
+
* There are 2 special cases:
|
|
32
|
+
* - when a path to directory is provided, all spec files ending ".spec.@(ts|tsx)" will be
|
|
33
|
+
* included
|
|
34
|
+
* - when a path to a file is provided, and a matching spec file exists it will be included
|
|
35
|
+
* instead.
|
|
36
|
+
*/
|
|
37
|
+
include?: string[];
|
|
38
|
+
/**
|
|
39
|
+
* The stylesheet language to use for the application's inline component styles.
|
|
40
|
+
*/
|
|
41
|
+
inlineStyleLanguage?: InlineStyleLanguage;
|
|
42
|
+
/**
|
|
43
|
+
* The name of the main entry-point file.
|
|
44
|
+
*/
|
|
45
|
+
main?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Enable and define the file watching poll time period in milliseconds.
|
|
48
|
+
*/
|
|
49
|
+
poll?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Polyfills to be included in the build.
|
|
52
|
+
*/
|
|
53
|
+
polyfills?: Polyfills;
|
|
54
|
+
/**
|
|
55
|
+
* Do not use the real path when resolving modules. If unset then will default to `true` if
|
|
56
|
+
* NodeJS option --preserve-symlinks is set.
|
|
57
|
+
*/
|
|
58
|
+
preserveSymlinks?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Log progress to the console while building.
|
|
61
|
+
*/
|
|
62
|
+
progress?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Global scripts to be included in the build.
|
|
65
|
+
*/
|
|
66
|
+
scripts?: ScriptElement[];
|
|
67
|
+
/**
|
|
68
|
+
* Output source maps for scripts and styles. For more information, see
|
|
69
|
+
* https://angular.io/guide/workspace-config#source-map-configuration.
|
|
70
|
+
*/
|
|
71
|
+
sourceMap?: SourceMapUnion;
|
|
72
|
+
/**
|
|
73
|
+
* Options to pass to style preprocessors
|
|
74
|
+
*/
|
|
75
|
+
stylePreprocessorOptions?: StylePreprocessorOptions;
|
|
76
|
+
/**
|
|
77
|
+
* Global styles to be included in the build.
|
|
78
|
+
*/
|
|
79
|
+
styles?: StyleElement[];
|
|
80
|
+
/**
|
|
81
|
+
* The name of the TypeScript configuration file.
|
|
82
|
+
*/
|
|
83
|
+
tsConfig: string;
|
|
84
|
+
/**
|
|
85
|
+
* Run build when files change.
|
|
86
|
+
*/
|
|
87
|
+
watch?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* TypeScript configuration for Web Worker modules.
|
|
90
|
+
*/
|
|
91
|
+
webWorkerTsConfig?: string;
|
|
92
|
+
}
|
|
93
|
+
export type AssetPattern = AssetPatternClass | string;
|
|
94
|
+
export interface AssetPatternClass {
|
|
95
|
+
/**
|
|
96
|
+
* The pattern to match.
|
|
97
|
+
*/
|
|
98
|
+
glob: string;
|
|
99
|
+
/**
|
|
100
|
+
* An array of globs to ignore.
|
|
101
|
+
*/
|
|
102
|
+
ignore?: string[];
|
|
103
|
+
/**
|
|
104
|
+
* The input directory path in which to apply 'glob'. Defaults to the project root.
|
|
105
|
+
*/
|
|
106
|
+
input: string;
|
|
107
|
+
/**
|
|
108
|
+
* Absolute path within the output.
|
|
109
|
+
*/
|
|
110
|
+
output: string;
|
|
111
|
+
}
|
|
112
|
+
export interface FileReplacement {
|
|
113
|
+
replace?: string;
|
|
114
|
+
replaceWith?: string;
|
|
115
|
+
src?: string;
|
|
116
|
+
with?: string;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The stylesheet language to use for the application's inline component styles.
|
|
120
|
+
*/
|
|
121
|
+
export declare enum InlineStyleLanguage {
|
|
122
|
+
Css = "css",
|
|
123
|
+
Less = "less",
|
|
124
|
+
Sass = "sass",
|
|
125
|
+
Scss = "scss"
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Polyfills to be included in the build.
|
|
129
|
+
*/
|
|
130
|
+
export type Polyfills = string[] | string;
|
|
131
|
+
export type ScriptElement = ScriptClass | string;
|
|
132
|
+
export interface ScriptClass {
|
|
133
|
+
/**
|
|
134
|
+
* The bundle name for this extra entry point.
|
|
135
|
+
*/
|
|
136
|
+
bundleName?: string;
|
|
137
|
+
/**
|
|
138
|
+
* If the bundle will be referenced in the HTML file.
|
|
139
|
+
*/
|
|
140
|
+
inject?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* The file to include.
|
|
143
|
+
*/
|
|
144
|
+
input: string;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Output source maps for scripts and styles. For more information, see
|
|
148
|
+
* https://angular.io/guide/workspace-config#source-map-configuration.
|
|
149
|
+
*/
|
|
150
|
+
export type SourceMapUnion = boolean | SourceMapClass;
|
|
151
|
+
export interface SourceMapClass {
|
|
152
|
+
/**
|
|
153
|
+
* Output source maps for all scripts.
|
|
154
|
+
*/
|
|
155
|
+
scripts?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Output source maps for all styles.
|
|
158
|
+
*/
|
|
159
|
+
styles?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Resolve vendor packages source maps.
|
|
162
|
+
*/
|
|
163
|
+
vendor?: boolean;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Options to pass to style preprocessors
|
|
167
|
+
*/
|
|
168
|
+
export interface StylePreprocessorOptions {
|
|
169
|
+
/**
|
|
170
|
+
* Paths to include. Paths will be resolved to workspace root.
|
|
171
|
+
*/
|
|
172
|
+
includePaths?: string[];
|
|
173
|
+
}
|
|
174
|
+
export type StyleElement = StyleClass | string;
|
|
175
|
+
export interface StyleClass {
|
|
176
|
+
/**
|
|
177
|
+
* The bundle name for this extra entry point.
|
|
178
|
+
*/
|
|
179
|
+
bundleName?: string;
|
|
180
|
+
/**
|
|
181
|
+
* If the bundle will be referenced in the HTML file.
|
|
182
|
+
*/
|
|
183
|
+
inject?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* The file to include.
|
|
186
|
+
*/
|
|
187
|
+
input: string;
|
|
188
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
|
3
|
+
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.InlineStyleLanguage = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* The stylesheet language to use for the application's inline component styles.
|
|
8
|
+
*/
|
|
9
|
+
var InlineStyleLanguage;
|
|
10
|
+
(function (InlineStyleLanguage) {
|
|
11
|
+
InlineStyleLanguage["Css"] = "css";
|
|
12
|
+
InlineStyleLanguage["Less"] = "less";
|
|
13
|
+
InlineStyleLanguage["Sass"] = "sass";
|
|
14
|
+
InlineStyleLanguage["Scss"] = "scss";
|
|
15
|
+
})(InlineStyleLanguage || (exports.InlineStyleLanguage = InlineStyleLanguage = {}));
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"title": "Web Test Runner Target",
|
|
4
|
+
"description": "Web Test Runner target options for Build Facade.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"main": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The name of the main entry-point file."
|
|
10
|
+
},
|
|
11
|
+
"tsConfig": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "The name of the TypeScript configuration file."
|
|
14
|
+
},
|
|
15
|
+
"polyfills": {
|
|
16
|
+
"description": "Polyfills to be included in the build.",
|
|
17
|
+
"oneOf": [
|
|
18
|
+
{
|
|
19
|
+
"type": "array",
|
|
20
|
+
"description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
|
|
21
|
+
"items": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"uniqueItems": true
|
|
24
|
+
},
|
|
25
|
+
"default": []
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "The full path for the polyfills file, relative to the current workspace or a module specifier. Example: 'zone.js'."
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"assets": {
|
|
34
|
+
"type": "array",
|
|
35
|
+
"description": "List of static application assets.",
|
|
36
|
+
"default": [],
|
|
37
|
+
"items": {
|
|
38
|
+
"$ref": "#/definitions/assetPattern"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"description": "Global scripts to be included in the build.",
|
|
43
|
+
"type": "array",
|
|
44
|
+
"default": [],
|
|
45
|
+
"items": {
|
|
46
|
+
"oneOf": [
|
|
47
|
+
{
|
|
48
|
+
"type": "object",
|
|
49
|
+
"properties": {
|
|
50
|
+
"input": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "The file to include.",
|
|
53
|
+
"pattern": "\\.[cm]?jsx?$"
|
|
54
|
+
},
|
|
55
|
+
"bundleName": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"pattern": "^[\\w\\-.]*$",
|
|
58
|
+
"description": "The bundle name for this extra entry point."
|
|
59
|
+
},
|
|
60
|
+
"inject": {
|
|
61
|
+
"type": "boolean",
|
|
62
|
+
"description": "If the bundle will be referenced in the HTML file.",
|
|
63
|
+
"default": true
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"required": ["input"]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"type": "string",
|
|
71
|
+
"description": "The file to include.",
|
|
72
|
+
"pattern": "\\.[cm]?jsx?$"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"styles": {
|
|
78
|
+
"description": "Global styles to be included in the build.",
|
|
79
|
+
"type": "array",
|
|
80
|
+
"default": [],
|
|
81
|
+
"items": {
|
|
82
|
+
"oneOf": [
|
|
83
|
+
{
|
|
84
|
+
"type": "object",
|
|
85
|
+
"properties": {
|
|
86
|
+
"input": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "The file to include.",
|
|
89
|
+
"pattern": "\\.(?:css|scss|sass|less)$"
|
|
90
|
+
},
|
|
91
|
+
"bundleName": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"pattern": "^[\\w\\-.]*$",
|
|
94
|
+
"description": "The bundle name for this extra entry point."
|
|
95
|
+
},
|
|
96
|
+
"inject": {
|
|
97
|
+
"type": "boolean",
|
|
98
|
+
"description": "If the bundle will be referenced in the HTML file.",
|
|
99
|
+
"default": true
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"additionalProperties": false,
|
|
103
|
+
"required": ["input"]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"type": "string",
|
|
107
|
+
"description": "The file to include.",
|
|
108
|
+
"pattern": "\\.(?:css|scss|sass|less)$"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"inlineStyleLanguage": {
|
|
114
|
+
"description": "The stylesheet language to use for the application's inline component styles.",
|
|
115
|
+
"type": "string",
|
|
116
|
+
"default": "css",
|
|
117
|
+
"enum": ["css", "less", "sass", "scss"]
|
|
118
|
+
},
|
|
119
|
+
"stylePreprocessorOptions": {
|
|
120
|
+
"description": "Options to pass to style preprocessors",
|
|
121
|
+
"type": "object",
|
|
122
|
+
"properties": {
|
|
123
|
+
"includePaths": {
|
|
124
|
+
"description": "Paths to include. Paths will be resolved to workspace root.",
|
|
125
|
+
"type": "array",
|
|
126
|
+
"items": {
|
|
127
|
+
"type": "string"
|
|
128
|
+
},
|
|
129
|
+
"default": []
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"additionalProperties": false
|
|
133
|
+
},
|
|
134
|
+
"include": {
|
|
135
|
+
"type": "array",
|
|
136
|
+
"items": {
|
|
137
|
+
"type": "string"
|
|
138
|
+
},
|
|
139
|
+
"default": ["**/*.spec.ts"],
|
|
140
|
+
"description": "Globs of files to include, relative to project root. \nThere are 2 special cases:\n - when a path to directory is provided, all spec files ending \".spec.@(ts|tsx)\" will be included\n - when a path to a file is provided, and a matching spec file exists it will be included instead."
|
|
141
|
+
},
|
|
142
|
+
"exclude": {
|
|
143
|
+
"type": "array",
|
|
144
|
+
"items": {
|
|
145
|
+
"type": "string"
|
|
146
|
+
},
|
|
147
|
+
"default": [],
|
|
148
|
+
"description": "Globs of files to exclude, relative to the project root."
|
|
149
|
+
},
|
|
150
|
+
"sourceMap": {
|
|
151
|
+
"description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.",
|
|
152
|
+
"default": true,
|
|
153
|
+
"oneOf": [
|
|
154
|
+
{
|
|
155
|
+
"type": "object",
|
|
156
|
+
"properties": {
|
|
157
|
+
"scripts": {
|
|
158
|
+
"type": "boolean",
|
|
159
|
+
"description": "Output source maps for all scripts.",
|
|
160
|
+
"default": true
|
|
161
|
+
},
|
|
162
|
+
"styles": {
|
|
163
|
+
"type": "boolean",
|
|
164
|
+
"description": "Output source maps for all styles.",
|
|
165
|
+
"default": true
|
|
166
|
+
},
|
|
167
|
+
"vendor": {
|
|
168
|
+
"type": "boolean",
|
|
169
|
+
"description": "Resolve vendor packages source maps.",
|
|
170
|
+
"default": false
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"additionalProperties": false
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"type": "boolean"
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
"progress": {
|
|
181
|
+
"type": "boolean",
|
|
182
|
+
"description": "Log progress to the console while building.",
|
|
183
|
+
"default": true
|
|
184
|
+
},
|
|
185
|
+
"watch": {
|
|
186
|
+
"type": "boolean",
|
|
187
|
+
"description": "Run build when files change."
|
|
188
|
+
},
|
|
189
|
+
"poll": {
|
|
190
|
+
"type": "number",
|
|
191
|
+
"description": "Enable and define the file watching poll time period in milliseconds."
|
|
192
|
+
},
|
|
193
|
+
"preserveSymlinks": {
|
|
194
|
+
"type": "boolean",
|
|
195
|
+
"description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
|
|
196
|
+
},
|
|
197
|
+
"browsers": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"description": "Override which browsers tests are run against."
|
|
200
|
+
},
|
|
201
|
+
"codeCoverage": {
|
|
202
|
+
"type": "boolean",
|
|
203
|
+
"description": "Output a code coverage report.",
|
|
204
|
+
"default": false
|
|
205
|
+
},
|
|
206
|
+
"codeCoverageExclude": {
|
|
207
|
+
"type": "array",
|
|
208
|
+
"description": "Globs to exclude from code coverage.",
|
|
209
|
+
"items": {
|
|
210
|
+
"type": "string"
|
|
211
|
+
},
|
|
212
|
+
"default": []
|
|
213
|
+
},
|
|
214
|
+
"fileReplacements": {
|
|
215
|
+
"description": "Replace compilation source files with other compilation source files in the build.",
|
|
216
|
+
"type": "array",
|
|
217
|
+
"items": {
|
|
218
|
+
"oneOf": [
|
|
219
|
+
{
|
|
220
|
+
"type": "object",
|
|
221
|
+
"properties": {
|
|
222
|
+
"src": {
|
|
223
|
+
"type": "string"
|
|
224
|
+
},
|
|
225
|
+
"replaceWith": {
|
|
226
|
+
"type": "string"
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"additionalProperties": false,
|
|
230
|
+
"required": ["src", "replaceWith"]
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"type": "object",
|
|
234
|
+
"properties": {
|
|
235
|
+
"replace": {
|
|
236
|
+
"type": "string"
|
|
237
|
+
},
|
|
238
|
+
"with": {
|
|
239
|
+
"type": "string"
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"additionalProperties": false,
|
|
243
|
+
"required": ["replace", "with"]
|
|
244
|
+
}
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
"default": []
|
|
248
|
+
},
|
|
249
|
+
"webWorkerTsConfig": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
"description": "TypeScript configuration for Web Worker modules."
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
"additionalProperties": false,
|
|
255
|
+
"required": ["tsConfig"],
|
|
256
|
+
"definitions": {
|
|
257
|
+
"assetPattern": {
|
|
258
|
+
"oneOf": [
|
|
259
|
+
{
|
|
260
|
+
"type": "object",
|
|
261
|
+
"properties": {
|
|
262
|
+
"glob": {
|
|
263
|
+
"type": "string",
|
|
264
|
+
"description": "The pattern to match."
|
|
265
|
+
},
|
|
266
|
+
"input": {
|
|
267
|
+
"type": "string",
|
|
268
|
+
"description": "The input directory path in which to apply 'glob'. Defaults to the project root."
|
|
269
|
+
},
|
|
270
|
+
"output": {
|
|
271
|
+
"type": "string",
|
|
272
|
+
"description": "Absolute path within the output."
|
|
273
|
+
},
|
|
274
|
+
"ignore": {
|
|
275
|
+
"description": "An array of globs to ignore.",
|
|
276
|
+
"type": "array",
|
|
277
|
+
"items": {
|
|
278
|
+
"type": "string"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"additionalProperties": false,
|
|
283
|
+
"required": ["glob", "input", "output"]
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"type": "string"
|
|
287
|
+
}
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf8">
|
|
5
|
+
<title>Unit tests</title>
|
|
6
|
+
|
|
7
|
+
<script type="module">
|
|
8
|
+
(async () => {
|
|
9
|
+
// To initialize tests correctly we load things in a very particular order.
|
|
10
|
+
|
|
11
|
+
// Step 1. Load user polyfills (including `zone.js`). Does *not* include `zone.js/testing`, which gets executed after Jasmine.
|
|
12
|
+
await import('./polyfills.js');
|
|
13
|
+
|
|
14
|
+
// Step 2. Import Jasmine.
|
|
15
|
+
// Jasmine gets wrapped into a CommonJS context by the bundling process which makes it think it is running in NodeJS, so it does not
|
|
16
|
+
// find the `window` global. Assign this to the NodeJS `global` symbol so Jasmine initializes correctly.
|
|
17
|
+
window.global = window;
|
|
18
|
+
const { default: jasmineRequire } = await import('./jasmine.js');
|
|
19
|
+
delete window.global; // Avoid leaking `global` into user tests or libraries, which might think they are running in NodeJS.
|
|
20
|
+
|
|
21
|
+
// Step 3. Initialize Jasmine on the page. Doing this after `zone.js` means Zone can patch browser globals before Jasmine runs.
|
|
22
|
+
// Doing this before `zone.js/testing`, means Zone can patch Jasmine-defined globals.
|
|
23
|
+
const jasmine = jasmineRequire.core(jasmineRequire);
|
|
24
|
+
const jasmineGlobal = jasmine.getGlobal();
|
|
25
|
+
jasmineGlobal.jasmine = jasmine;
|
|
26
|
+
const jasmineEnv = jasmine.getEnv();
|
|
27
|
+
Object.assign(window, jasmineRequire.interface(jasmine, jasmineEnv));
|
|
28
|
+
|
|
29
|
+
// Step 4. Import `zone.js/testing`, which will find and patch Jasmine globals from steps 2. and 3.
|
|
30
|
+
// https://github.com/angular/angular/blob/af4f5df150d527a1b523def1eb51d2b661a25f83/packages/zone.js/lib/jasmine/jasmine.ts
|
|
31
|
+
await import('./testing.js');
|
|
32
|
+
|
|
33
|
+
// Step 5. Run the actual tests.
|
|
34
|
+
const { runJasmineTests } = await import('./jasmine_runner.js');
|
|
35
|
+
await runJasmineTests(jasmineEnv);
|
|
36
|
+
})();
|
|
37
|
+
</script>
|
|
38
|
+
</head>
|
|
39
|
+
<body></body>
|
|
40
|
+
</html>
|
|
@@ -46,7 +46,7 @@ function createAngularCompilerHost(compilerOptions, hostOptions) {
|
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
48
|
const result = await hostOptions.transformStylesheet(data, context.containingFile, context.resourceFile ?? undefined);
|
|
49
|
-
return result ? { content: result } : null;
|
|
49
|
+
return typeof result === 'string' ? { content: result } : null;
|
|
50
50
|
};
|
|
51
51
|
// Allow the AOT compiler to request the set of changed templates and styles
|
|
52
52
|
host.getModifiedResourceFiles = function () {
|
|
@@ -35,7 +35,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.createCompilerPlugin = void 0;
|
|
37
37
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
38
|
-
const node_fs_1 = require("node:fs");
|
|
39
38
|
const path = __importStar(require("node:path"));
|
|
40
39
|
const environment_options_1 = require("../../../utils/environment-options");
|
|
41
40
|
const javascript_transformer_1 = require("../javascript-transformer");
|
|
@@ -54,18 +53,6 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
|
|
|
54
53
|
async setup(build) {
|
|
55
54
|
let setupWarnings = [];
|
|
56
55
|
const preserveSymlinks = build.initialOptions.preserveSymlinks;
|
|
57
|
-
let tsconfigPath = pluginOptions.tsconfig;
|
|
58
|
-
if (!preserveSymlinks) {
|
|
59
|
-
// Use the real path of the tsconfig if not preserving symlinks.
|
|
60
|
-
// This ensures the TS source file paths are based on the real path of the configuration.
|
|
61
|
-
// NOTE: promises.realpath should not be used here since it uses realpath.native which
|
|
62
|
-
// can cause case conversion and other undesirable behavior on Windows systems.
|
|
63
|
-
// ref: https://github.com/nodejs/node/issues/7726
|
|
64
|
-
try {
|
|
65
|
-
tsconfigPath = (0, node_fs_1.realpathSync)(tsconfigPath);
|
|
66
|
-
}
|
|
67
|
-
catch { }
|
|
68
|
-
}
|
|
69
56
|
// Initialize a worker pool for JavaScript transformations
|
|
70
57
|
const javascriptTransformer = new javascript_transformer_1.JavaScriptTransformer(pluginOptions, environment_options_1.maxWorkers);
|
|
71
58
|
// Setup defines based on the values used by the Angular compiler-cli
|
|
@@ -132,14 +119,14 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
|
|
|
132
119
|
else {
|
|
133
120
|
stylesheetResult = await stylesheetBundler.bundleInline(data, containingFile, styleOptions.inlineStyleLanguage);
|
|
134
121
|
}
|
|
135
|
-
const { contents,
|
|
122
|
+
const { contents, outputFiles, metafile, referencedFiles, errors, warnings } = stylesheetResult;
|
|
136
123
|
if (errors) {
|
|
137
124
|
(result.errors ??= []).push(...errors);
|
|
138
125
|
}
|
|
139
126
|
(result.warnings ??= []).push(...warnings);
|
|
140
127
|
additionalResults.set(stylesheetFile ?? containingFile, {
|
|
141
|
-
outputFiles
|
|
142
|
-
metafile
|
|
128
|
+
outputFiles,
|
|
129
|
+
metafile,
|
|
143
130
|
});
|
|
144
131
|
if (referencedFiles) {
|
|
145
132
|
referencedFileTracker.add(containingFile, referencedFiles);
|
|
@@ -185,7 +172,7 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
|
|
|
185
172
|
// In watch mode, previous build state will be reused.
|
|
186
173
|
let referencedFiles;
|
|
187
174
|
try {
|
|
188
|
-
const initializationResult = await compilation.initialize(
|
|
175
|
+
const initializationResult = await compilation.initialize(pluginOptions.tsconfig, hostOptions, createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserveSymlinks));
|
|
189
176
|
shouldTsIgnoreJs = !initializationResult.compilerOptions.allowJs;
|
|
190
177
|
referencedFiles = initializationResult.referencedFiles;
|
|
191
178
|
}
|
|
@@ -401,22 +388,19 @@ function createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserve
|
|
|
401
388
|
function bundleWebWorker(build, pluginOptions, workerFile) {
|
|
402
389
|
try {
|
|
403
390
|
return build.esbuild.buildSync({
|
|
391
|
+
...build.initialOptions,
|
|
404
392
|
platform: 'browser',
|
|
405
393
|
write: false,
|
|
406
394
|
bundle: true,
|
|
407
395
|
metafile: true,
|
|
408
396
|
format: 'esm',
|
|
409
|
-
mainFields: ['es2020', 'es2015', 'browser', 'module', 'main'],
|
|
410
|
-
logLevel: 'silent',
|
|
411
|
-
sourcemap: pluginOptions.sourcemap,
|
|
412
397
|
entryNames: 'worker-[hash]',
|
|
413
398
|
entryPoints: [workerFile],
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
target: build.initialOptions.target,
|
|
399
|
+
sourcemap: pluginOptions.sourcemap,
|
|
400
|
+
// Zone.js is not used in Web workers so no need to disable
|
|
401
|
+
supported: undefined,
|
|
402
|
+
// Plugins are not supported in sync esbuild calls
|
|
403
|
+
plugins: undefined,
|
|
420
404
|
});
|
|
421
405
|
}
|
|
422
406
|
catch (error) {
|
|
@@ -26,9 +26,7 @@ export declare class ComponentStylesheetBundler {
|
|
|
26
26
|
errors: import("esbuild").Message[] | undefined;
|
|
27
27
|
warnings: import("esbuild").Message[];
|
|
28
28
|
contents: string;
|
|
29
|
-
|
|
30
|
-
path: string | undefined;
|
|
31
|
-
resourceFiles: OutputFile[];
|
|
29
|
+
outputFiles: OutputFile[];
|
|
32
30
|
metafile: import("esbuild").Metafile | undefined;
|
|
33
31
|
referencedFiles: Set<string> | undefined;
|
|
34
32
|
}>;
|
|
@@ -36,12 +34,11 @@ export declare class ComponentStylesheetBundler {
|
|
|
36
34
|
errors: import("esbuild").Message[] | undefined;
|
|
37
35
|
warnings: import("esbuild").Message[];
|
|
38
36
|
contents: string;
|
|
39
|
-
|
|
40
|
-
path: string | undefined;
|
|
41
|
-
resourceFiles: OutputFile[];
|
|
37
|
+
outputFiles: OutputFile[];
|
|
42
38
|
metafile: import("esbuild").Metafile | undefined;
|
|
43
39
|
referencedFiles: Set<string> | undefined;
|
|
44
40
|
}>;
|
|
45
41
|
invalidate(files: Iterable<string>): void;
|
|
46
42
|
dispose(): Promise<void>;
|
|
43
|
+
private extractResult;
|
|
47
44
|
}
|