@c8y/devkit 1019.0.3
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 +13 -0
- package/dist/builders.json +29 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/options.d.ts +2 -0
- package/dist/options.js +6 -0
- package/dist/options.js.map +1 -0
- package/dist/src/builders/BuilderOptions.d.ts +90 -0
- package/dist/src/builders/BuilderOptions.js +3 -0
- package/dist/src/builders/BuilderOptions.js.map +1 -0
- package/dist/src/builders/browser/index.d.ts +2 -0
- package/dist/src/builders/browser/index.js +17 -0
- package/dist/src/builders/browser/index.js.map +1 -0
- package/dist/src/builders/browser/schema.json +606 -0
- package/dist/src/builders/compile-i18n/compile-i18n-builder.d.ts +5 -0
- package/dist/src/builders/compile-i18n/compile-i18n-builder.js +88 -0
- package/dist/src/builders/compile-i18n/compile-i18n-builder.js.map +1 -0
- package/dist/src/builders/compile-i18n/schema.json +24 -0
- package/dist/src/builders/create-schema.d.ts +1 -0
- package/dist/src/builders/create-schema.js +32 -0
- package/dist/src/builders/create-schema.js.map +1 -0
- package/dist/src/builders/deploy/Deploy.model.d.ts +30 -0
- package/dist/src/builders/deploy/Deploy.model.js +8 -0
- package/dist/src/builders/deploy/Deploy.model.js.map +1 -0
- package/dist/src/builders/deploy/app-as-zip-file.d.ts +8 -0
- package/dist/src/builders/deploy/app-as-zip-file.js +74 -0
- package/dist/src/builders/deploy/app-as-zip-file.js.map +1 -0
- package/dist/src/builders/deploy/build-and-zip-app.d.ts +10 -0
- package/dist/src/builders/deploy/build-and-zip-app.js +105 -0
- package/dist/src/builders/deploy/build-and-zip-app.js.map +1 -0
- package/dist/src/builders/deploy/deploy-builder.d.ts +5 -0
- package/dist/src/builders/deploy/deploy-builder.js +268 -0
- package/dist/src/builders/deploy/deploy-builder.js.map +1 -0
- package/dist/src/builders/deploy/helpers.d.ts +25 -0
- package/dist/src/builders/deploy/helpers.js +45 -0
- package/dist/src/builders/deploy/helpers.js.map +1 -0
- package/dist/src/builders/deploy/schema.json +42 -0
- package/dist/src/builders/dev-server/index.d.ts +2 -0
- package/dist/src/builders/dev-server/index.js +67 -0
- package/dist/src/builders/dev-server/index.js.map +1 -0
- package/dist/src/builders/dev-server/schema.json +120 -0
- package/dist/src/builders/extract-i18n/extract-i18n-builder.d.ts +5 -0
- package/dist/src/builders/extract-i18n/extract-i18n-builder.js +126 -0
- package/dist/src/builders/extract-i18n/extract-i18n-builder.js.map +1 -0
- package/dist/src/builders/extract-i18n/schema.json +30 -0
- package/dist/src/options.d.ts +82 -0
- package/dist/src/options.js +98 -0
- package/dist/src/options.js.map +1 -0
- package/dist/src/schematics/collection.json +9 -0
- package/dist/src/schematics/ng-add/configs/angular-json.d.ts +28 -0
- package/dist/src/schematics/ng-add/configs/angular-json.js +93 -0
- package/dist/src/schematics/ng-add/configs/angular-json.js.map +1 -0
- package/dist/src/schematics/ng-add/configs/app-module.d.ts +3 -0
- package/dist/src/schematics/ng-add/configs/app-module.js +13 -0
- package/dist/src/schematics/ng-add/configs/app-module.js.map +1 -0
- package/dist/src/schematics/ng-add/configs/app-routing.d.ts +2 -0
- package/dist/src/schematics/ng-add/configs/app-routing.js +16 -0
- package/dist/src/schematics/ng-add/configs/app-routing.js.map +1 -0
- package/dist/src/schematics/ng-add/configs/index-html.d.ts +2 -0
- package/dist/src/schematics/ng-add/configs/index-html.js +15 -0
- package/dist/src/schematics/ng-add/configs/index-html.js.map +1 -0
- package/dist/src/schematics/ng-add/configs/index.d.ts +2 -0
- package/dist/src/schematics/ng-add/configs/index.js +37 -0
- package/dist/src/schematics/ng-add/configs/index.js.map +1 -0
- package/dist/src/schematics/ng-add/configs/main.d.ts +2 -0
- package/dist/src/schematics/ng-add/configs/main.js +30 -0
- package/dist/src/schematics/ng-add/configs/main.js.map +1 -0
- package/dist/src/schematics/ng-add/configs/ng1.d.ts +3 -0
- package/dist/src/schematics/ng-add/configs/ng1.js +13 -0
- package/dist/src/schematics/ng-add/configs/ng1.js.map +1 -0
- package/dist/src/schematics/ng-add/configs/package-json.d.ts +17 -0
- package/dist/src/schematics/ng-add/configs/package-json.js +67 -0
- package/dist/src/schematics/ng-add/configs/package-json.js.map +1 -0
- package/dist/src/schematics/ng-add/configs/translation.d.ts +2 -0
- package/dist/src/schematics/ng-add/configs/translation.js +36 -0
- package/dist/src/schematics/ng-add/configs/translation.js.map +1 -0
- package/dist/src/schematics/ng-add/configs/tsconfig-app-json.d.ts +2 -0
- package/dist/src/schematics/ng-add/configs/tsconfig-app-json.js +21 -0
- package/dist/src/schematics/ng-add/configs/tsconfig-app-json.js.map +1 -0
- package/dist/src/schematics/ng-add/configs/tsconfig-json.d.ts +2 -0
- package/dist/src/schematics/ng-add/configs/tsconfig-json.js +19 -0
- package/dist/src/schematics/ng-add/configs/tsconfig-json.js.map +1 -0
- package/dist/src/schematics/ng-add/index.d.ts +4 -0
- package/dist/src/schematics/ng-add/index.js +93 -0
- package/dist/src/schematics/ng-add/index.js.map +1 -0
- package/dist/src/schematics/ng-add/model.d.ts +19 -0
- package/dist/src/schematics/ng-add/model.js +3 -0
- package/dist/src/schematics/ng-add/model.js.map +1 -0
- package/dist/src/schematics/ng-add/ng-add.json +18 -0
- package/dist/src/schematics/ng-add/utils.d.ts +13 -0
- package/dist/src/schematics/ng-add/utils.js +32 -0
- package/dist/src/schematics/ng-add/utils.js.map +1 -0
- package/dist/src/utils/locale-compiler.d.ts +48 -0
- package/dist/src/utils/locale-compiler.js +83 -0
- package/dist/src/utils/locale-compiler.js.map +1 -0
- package/dist/src/utils/locale-json-paths.d.ts +19 -0
- package/dist/src/utils/locale-json-paths.js +63 -0
- package/dist/src/utils/locale-json-paths.js.map +1 -0
- package/dist/src/utils/locale-utils.d.ts +24 -0
- package/dist/src/utils/locale-utils.js +104 -0
- package/dist/src/utils/locale-utils.js.map +1 -0
- package/dist/src/utils/package-config.d.ts +1 -0
- package/dist/src/utils/package-config.js +13 -0
- package/dist/src/utils/package-config.js.map +1 -0
- package/dist/src/webpack/ApplicationOptions.d.ts +344 -0
- package/dist/src/webpack/ApplicationOptions.js +3 -0
- package/dist/src/webpack/ApplicationOptions.js.map +1 -0
- package/dist/src/webpack/BuildDefaults.d.ts +10 -0
- package/dist/src/webpack/BuildDefaults.js +15 -0
- package/dist/src/webpack/BuildDefaults.js.map +1 -0
- package/dist/src/webpack/EnvironmentOptions.d.ts +132 -0
- package/dist/src/webpack/EnvironmentOptions.js +15 -0
- package/dist/src/webpack/EnvironmentOptions.js.map +1 -0
- package/dist/src/webpack/config/babel.d.ts +2 -0
- package/dist/src/webpack/config/babel.js +65 -0
- package/dist/src/webpack/config/babel.js.map +1 -0
- package/dist/src/webpack/config/base.d.ts +27 -0
- package/dist/src/webpack/config/base.js +125 -0
- package/dist/src/webpack/config/base.js.map +1 -0
- package/dist/src/webpack/config/development.d.ts +4 -0
- package/dist/src/webpack/config/development.js +37 -0
- package/dist/src/webpack/config/development.js.map +1 -0
- package/dist/src/webpack/config/extra.d.ts +3 -0
- package/dist/src/webpack/config/extra.js +24 -0
- package/dist/src/webpack/config/extra.js.map +1 -0
- package/dist/src/webpack/config/favicon.d.ts +2 -0
- package/dist/src/webpack/config/favicon.js +20 -0
- package/dist/src/webpack/config/favicon.js.map +1 -0
- package/dist/src/webpack/config/federation.d.ts +3 -0
- package/dist/src/webpack/config/federation.js +66 -0
- package/dist/src/webpack/config/federation.js.map +1 -0
- package/dist/src/webpack/config/legacy.d.ts +2 -0
- package/dist/src/webpack/config/legacy.js +72 -0
- package/dist/src/webpack/config/legacy.js.map +1 -0
- package/dist/src/webpack/config/plugin.d.ts +5 -0
- package/dist/src/webpack/config/plugin.js +89 -0
- package/dist/src/webpack/config/plugin.js.map +1 -0
- package/dist/src/webpack/config/production.d.ts +3 -0
- package/dist/src/webpack/config/production.js +30 -0
- package/dist/src/webpack/config/production.js.map +1 -0
- package/dist/src/webpack/config/styles.d.ts +3 -0
- package/dist/src/webpack/config/styles.js +54 -0
- package/dist/src/webpack/config/styles.js.map +1 -0
- package/dist/src/webpack/config/translation.d.ts +2 -0
- package/dist/src/webpack/config/translation.js +23 -0
- package/dist/src/webpack/config/translation.js.map +1 -0
- package/dist/src/webpack/loaders/loader-data.d.ts +1 -0
- package/dist/src/webpack/loaders/loader-data.js +53 -0
- package/dist/src/webpack/loaders/loader-data.js.map +1 -0
- package/dist/src/webpack/loaders/loader-less.d.ts +1 -0
- package/dist/src/webpack/loaders/loader-less.js +23 -0
- package/dist/src/webpack/loaders/loader-less.js.map +1 -0
- package/dist/src/webpack/loaders/loader-manifest.d.ts +1 -0
- package/dist/src/webpack/loaders/loader-manifest.js +88 -0
- package/dist/src/webpack/loaders/loader-manifest.js.map +1 -0
- package/dist/src/webpack/loaders/loader-ngtemplate.d.ts +1 -0
- package/dist/src/webpack/loaders/loader-ngtemplate.js +16 -0
- package/dist/src/webpack/loaders/loader-ngtemplate.js.map +1 -0
- package/dist/src/webpack/loaders/loader-pluginpath.d.ts +1 -0
- package/dist/src/webpack/loaders/loader-pluginpath.js +10 -0
- package/dist/src/webpack/loaders/loader-pluginpath.js.map +1 -0
- package/dist/src/webpack/loaders/loader-po.d.ts +3 -0
- package/dist/src/webpack/loaders/loader-po.js +9 -0
- package/dist/src/webpack/loaders/loader-po.js.map +1 -0
- package/dist/src/webpack/plugin/index-content.d.ts +2 -0
- package/dist/src/webpack/plugin/index-content.js +113 -0
- package/dist/src/webpack/plugin/index-content.js.map +1 -0
- package/dist/src/webpack/plugin/locales.d.ts +6 -0
- package/dist/src/webpack/plugin/locales.js +746 -0
- package/dist/src/webpack/plugin/locales.js.map +1 -0
- package/dist/src/webpack/plugin/plugin.d.ts +259 -0
- package/dist/src/webpack/plugin/plugin.js +286 -0
- package/dist/src/webpack/plugin/plugin.js.map +1 -0
- package/dist/src/webpack/plugin/translation-aggregation-plugin.d.ts +80 -0
- package/dist/src/webpack/plugin/translation-aggregation-plugin.js +152 -0
- package/dist/src/webpack/plugin/translation-aggregation-plugin.js.map +1 -0
- package/dist/src/webpack/plugin/translation-data-store.d.ts +27 -0
- package/dist/src/webpack/plugin/translation-data-store.js +37 -0
- package/dist/src/webpack/plugin/translation-data-store.js.map +1 -0
- package/dist/src/webpack/utils/federationUtils.d.ts +26 -0
- package/dist/src/webpack/utils/federationUtils.js +234 -0
- package/dist/src/webpack/utils/federationUtils.js.map +1 -0
- package/dist/src/webpack/utils/helpers.d.ts +45 -0
- package/dist/src/webpack/utils/helpers.js +137 -0
- package/dist/src/webpack/utils/helpers.js.map +1 -0
- package/dist/src/webpack/utils/index.d.ts +1 -0
- package/dist/src/webpack/utils/index.js +5 -0
- package/dist/src/webpack/utils/index.js.map +1 -0
- package/dist/src/webpack/utils/legacy-manifest-resolver.d.ts +4 -0
- package/dist/src/webpack/utils/legacy-manifest-resolver.js +27 -0
- package/dist/src/webpack/utils/legacy-manifest-resolver.js.map +1 -0
- package/dist/src/webpack/utils/proxy.d.ts +2 -0
- package/dist/src/webpack/utils/proxy.js +39 -0
- package/dist/src/webpack/utils/proxy.js.map +1 -0
- package/package.json +99 -0
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"title": "Webpack browser schema for Build Facade.",
|
|
4
|
+
"description": "Browser target options",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"assets": {
|
|
8
|
+
"type": "array",
|
|
9
|
+
"description": "List of static application assets.",
|
|
10
|
+
"default": [],
|
|
11
|
+
"items": {
|
|
12
|
+
"$ref": "#/definitions/assetPattern"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"main": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The full path for the main entry point to the app, relative to the current workspace."
|
|
18
|
+
},
|
|
19
|
+
"polyfills": {
|
|
20
|
+
"description": "Polyfills to be included in the build.",
|
|
21
|
+
"oneOf": [
|
|
22
|
+
{
|
|
23
|
+
"type": "array",
|
|
24
|
+
"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'.",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"uniqueItems": true
|
|
28
|
+
},
|
|
29
|
+
"default": []
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "The full path for the polyfills file, relative to the current workspace or a module specifier. Example: 'zone.js'."
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"tsConfig": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "The full path for the TypeScript configuration file, relative to the current workspace."
|
|
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": [
|
|
68
|
+
"input"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"type": "string",
|
|
73
|
+
"description": "The file to include.",
|
|
74
|
+
"pattern": "\\.[cm]?jsx?$"
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"styles": {
|
|
80
|
+
"description": "Global styles to be included in the build.",
|
|
81
|
+
"type": "array",
|
|
82
|
+
"default": [],
|
|
83
|
+
"items": {
|
|
84
|
+
"oneOf": [
|
|
85
|
+
{
|
|
86
|
+
"type": "object",
|
|
87
|
+
"properties": {
|
|
88
|
+
"input": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"description": "The file to include.",
|
|
91
|
+
"pattern": "\\.(?:css|scss|sass|less)$"
|
|
92
|
+
},
|
|
93
|
+
"bundleName": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"pattern": "^[\\w\\-.]*$",
|
|
96
|
+
"description": "The bundle name for this extra entry point."
|
|
97
|
+
},
|
|
98
|
+
"inject": {
|
|
99
|
+
"type": "boolean",
|
|
100
|
+
"description": "If the bundle will be referenced in the HTML file.",
|
|
101
|
+
"default": true
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"additionalProperties": false,
|
|
105
|
+
"required": [
|
|
106
|
+
"input"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"type": "string",
|
|
111
|
+
"description": "The file to include.",
|
|
112
|
+
"pattern": "\\.(?:css|scss|sass|less)$"
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"inlineStyleLanguage": {
|
|
118
|
+
"description": "The stylesheet language to use for the application's inline component styles.",
|
|
119
|
+
"type": "string",
|
|
120
|
+
"default": "css",
|
|
121
|
+
"enum": [
|
|
122
|
+
"css",
|
|
123
|
+
"less",
|
|
124
|
+
"sass",
|
|
125
|
+
"scss"
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
"stylePreprocessorOptions": {
|
|
129
|
+
"description": "Options to pass to style preprocessors.",
|
|
130
|
+
"type": "object",
|
|
131
|
+
"properties": {
|
|
132
|
+
"includePaths": {
|
|
133
|
+
"description": "Paths to include. Paths will be resolved to workspace root.",
|
|
134
|
+
"type": "array",
|
|
135
|
+
"items": {
|
|
136
|
+
"type": "string"
|
|
137
|
+
},
|
|
138
|
+
"default": []
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"additionalProperties": false
|
|
142
|
+
},
|
|
143
|
+
"optimization": {
|
|
144
|
+
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
|
|
145
|
+
"default": true,
|
|
146
|
+
"x-user-analytics": "ep.ng_optimization",
|
|
147
|
+
"oneOf": [
|
|
148
|
+
{
|
|
149
|
+
"type": "object",
|
|
150
|
+
"properties": {
|
|
151
|
+
"scripts": {
|
|
152
|
+
"type": "boolean",
|
|
153
|
+
"description": "Enables optimization of the scripts output.",
|
|
154
|
+
"default": true
|
|
155
|
+
},
|
|
156
|
+
"styles": {
|
|
157
|
+
"description": "Enables optimization of the styles output.",
|
|
158
|
+
"default": true,
|
|
159
|
+
"oneOf": [
|
|
160
|
+
{
|
|
161
|
+
"type": "object",
|
|
162
|
+
"properties": {
|
|
163
|
+
"minify": {
|
|
164
|
+
"type": "boolean",
|
|
165
|
+
"description": "Minify CSS definitions by removing extraneous whitespace and comments, merging identifiers and minimizing values.",
|
|
166
|
+
"default": true
|
|
167
|
+
},
|
|
168
|
+
"inlineCritical": {
|
|
169
|
+
"type": "boolean",
|
|
170
|
+
"description": "Extract and inline critical CSS definitions to improve first paint time.",
|
|
171
|
+
"default": true
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"additionalProperties": false
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"type": "boolean"
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
"fonts": {
|
|
182
|
+
"description": "Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY` environment variable can be used to specify a proxy server.",
|
|
183
|
+
"default": true,
|
|
184
|
+
"oneOf": [
|
|
185
|
+
{
|
|
186
|
+
"type": "object",
|
|
187
|
+
"properties": {
|
|
188
|
+
"inline": {
|
|
189
|
+
"type": "boolean",
|
|
190
|
+
"description": "Reduce render blocking requests by inlining external Google Fonts and Adobe Fonts CSS definitions in the application's HTML index file. This option requires internet access. `HTTPS_PROXY` environment variable can be used to specify a proxy server.",
|
|
191
|
+
"default": true
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
"additionalProperties": false
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"type": "boolean"
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"additionalProperties": false
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"type": "boolean"
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
"fileReplacements": {
|
|
210
|
+
"description": "Replace compilation source files with other compilation source files in the build.",
|
|
211
|
+
"type": "array",
|
|
212
|
+
"items": {
|
|
213
|
+
"$ref": "#/definitions/fileReplacement"
|
|
214
|
+
},
|
|
215
|
+
"default": []
|
|
216
|
+
},
|
|
217
|
+
"outputPath": {
|
|
218
|
+
"type": "string",
|
|
219
|
+
"description": "The full path for the new output directory, relative to the current workspace."
|
|
220
|
+
},
|
|
221
|
+
"resourcesOutputPath": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"description": "The path where style resources will be placed, relative to outputPath."
|
|
224
|
+
},
|
|
225
|
+
"aot": {
|
|
226
|
+
"type": "boolean",
|
|
227
|
+
"description": "Build using Ahead of Time compilation.",
|
|
228
|
+
"x-user-analytics": "ep.ng_aot",
|
|
229
|
+
"default": true
|
|
230
|
+
},
|
|
231
|
+
"sourceMap": {
|
|
232
|
+
"description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.",
|
|
233
|
+
"default": false,
|
|
234
|
+
"oneOf": [
|
|
235
|
+
{
|
|
236
|
+
"type": "object",
|
|
237
|
+
"properties": {
|
|
238
|
+
"scripts": {
|
|
239
|
+
"type": "boolean",
|
|
240
|
+
"description": "Output source maps for all scripts.",
|
|
241
|
+
"default": true
|
|
242
|
+
},
|
|
243
|
+
"styles": {
|
|
244
|
+
"type": "boolean",
|
|
245
|
+
"description": "Output source maps for all styles.",
|
|
246
|
+
"default": true
|
|
247
|
+
},
|
|
248
|
+
"hidden": {
|
|
249
|
+
"type": "boolean",
|
|
250
|
+
"description": "Output source maps used for error reporting tools.",
|
|
251
|
+
"default": false
|
|
252
|
+
},
|
|
253
|
+
"vendor": {
|
|
254
|
+
"type": "boolean",
|
|
255
|
+
"description": "Resolve vendor packages source maps.",
|
|
256
|
+
"default": false
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"additionalProperties": false
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"type": "boolean"
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
"vendorChunk": {
|
|
267
|
+
"type": "boolean",
|
|
268
|
+
"description": "Generate a seperate bundle containing only vendor libraries. This option should only be used for development to reduce the incremental compilation time.",
|
|
269
|
+
"default": false
|
|
270
|
+
},
|
|
271
|
+
"commonChunk": {
|
|
272
|
+
"type": "boolean",
|
|
273
|
+
"description": "Generate a seperate bundle containing code used across multiple bundles.",
|
|
274
|
+
"default": true
|
|
275
|
+
},
|
|
276
|
+
"baseHref": {
|
|
277
|
+
"type": "string",
|
|
278
|
+
"description": "Base url for the application being built."
|
|
279
|
+
},
|
|
280
|
+
"deployUrl": {
|
|
281
|
+
"type": "string",
|
|
282
|
+
"description": "URL where files will be deployed.",
|
|
283
|
+
"x-deprecated": "Use \"baseHref\" option, \"APP_BASE_HREF\" DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url."
|
|
284
|
+
},
|
|
285
|
+
"verbose": {
|
|
286
|
+
"type": "boolean",
|
|
287
|
+
"description": "Adds more details to output logging.",
|
|
288
|
+
"default": false
|
|
289
|
+
},
|
|
290
|
+
"progress": {
|
|
291
|
+
"type": "boolean",
|
|
292
|
+
"description": "Log progress to the console while building.",
|
|
293
|
+
"default": true
|
|
294
|
+
},
|
|
295
|
+
"i18nMissingTranslation": {
|
|
296
|
+
"type": "string",
|
|
297
|
+
"description": "How to handle missing translations for i18n.",
|
|
298
|
+
"enum": [
|
|
299
|
+
"warning",
|
|
300
|
+
"error",
|
|
301
|
+
"ignore"
|
|
302
|
+
],
|
|
303
|
+
"default": "warning"
|
|
304
|
+
},
|
|
305
|
+
"i18nDuplicateTranslation": {
|
|
306
|
+
"type": "string",
|
|
307
|
+
"description": "How to handle duplicate translations for i18n.",
|
|
308
|
+
"enum": [
|
|
309
|
+
"warning",
|
|
310
|
+
"error",
|
|
311
|
+
"ignore"
|
|
312
|
+
],
|
|
313
|
+
"default": "warning"
|
|
314
|
+
},
|
|
315
|
+
"localize": {
|
|
316
|
+
"description": "Translate the bundles in one or more locales.",
|
|
317
|
+
"oneOf": [
|
|
318
|
+
{
|
|
319
|
+
"type": "boolean",
|
|
320
|
+
"description": "Translate all locales."
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"type": "array",
|
|
324
|
+
"description": "List of locales ID's to translate.",
|
|
325
|
+
"minItems": 1,
|
|
326
|
+
"items": {
|
|
327
|
+
"type": "string",
|
|
328
|
+
"pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?(-x(-[a-zA-Z0-9]{1,8})+)?$"
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
]
|
|
332
|
+
},
|
|
333
|
+
"watch": {
|
|
334
|
+
"type": "boolean",
|
|
335
|
+
"description": "Run build when files change.",
|
|
336
|
+
"default": false
|
|
337
|
+
},
|
|
338
|
+
"outputHashing": {
|
|
339
|
+
"type": "string",
|
|
340
|
+
"description": "Define the output filename cache-busting hashing mode.",
|
|
341
|
+
"default": "none",
|
|
342
|
+
"enum": [
|
|
343
|
+
"none",
|
|
344
|
+
"all",
|
|
345
|
+
"media",
|
|
346
|
+
"bundles"
|
|
347
|
+
]
|
|
348
|
+
},
|
|
349
|
+
"poll": {
|
|
350
|
+
"type": "number",
|
|
351
|
+
"description": "Enable and define the file watching poll time period in milliseconds."
|
|
352
|
+
},
|
|
353
|
+
"deleteOutputPath": {
|
|
354
|
+
"type": "boolean",
|
|
355
|
+
"description": "Delete the output path before building.",
|
|
356
|
+
"default": true
|
|
357
|
+
},
|
|
358
|
+
"preserveSymlinks": {
|
|
359
|
+
"type": "boolean",
|
|
360
|
+
"description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
|
|
361
|
+
},
|
|
362
|
+
"extractLicenses": {
|
|
363
|
+
"type": "boolean",
|
|
364
|
+
"description": "Extract all licenses in a separate file.",
|
|
365
|
+
"default": true
|
|
366
|
+
},
|
|
367
|
+
"buildOptimizer": {
|
|
368
|
+
"type": "boolean",
|
|
369
|
+
"description": "Enables advanced build optimizations when using the 'aot' option.",
|
|
370
|
+
"default": true
|
|
371
|
+
},
|
|
372
|
+
"namedChunks": {
|
|
373
|
+
"type": "boolean",
|
|
374
|
+
"description": "Use file name for lazy loaded chunks.",
|
|
375
|
+
"default": false
|
|
376
|
+
},
|
|
377
|
+
"subresourceIntegrity": {
|
|
378
|
+
"type": "boolean",
|
|
379
|
+
"description": "Enables the use of subresource integrity validation.",
|
|
380
|
+
"default": false
|
|
381
|
+
},
|
|
382
|
+
"serviceWorker": {
|
|
383
|
+
"type": "boolean",
|
|
384
|
+
"description": "Generates a service worker config for production builds.",
|
|
385
|
+
"default": false
|
|
386
|
+
},
|
|
387
|
+
"ngswConfigPath": {
|
|
388
|
+
"type": "string",
|
|
389
|
+
"description": "Path to ngsw-config.json."
|
|
390
|
+
},
|
|
391
|
+
"index": {
|
|
392
|
+
"description": "Configures the generation of the application's HTML index.",
|
|
393
|
+
"oneOf": [
|
|
394
|
+
{
|
|
395
|
+
"type": "string",
|
|
396
|
+
"description": "The path of a file to use for the application's HTML index. The filename of the specified path will be used for the generated file and will be created in the root of the application's configured output path."
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"type": "object",
|
|
400
|
+
"description": "",
|
|
401
|
+
"properties": {
|
|
402
|
+
"input": {
|
|
403
|
+
"type": "string",
|
|
404
|
+
"minLength": 1,
|
|
405
|
+
"description": "The path of a file to use for the application's generated HTML index."
|
|
406
|
+
},
|
|
407
|
+
"output": {
|
|
408
|
+
"type": "string",
|
|
409
|
+
"minLength": 1,
|
|
410
|
+
"default": "index.html",
|
|
411
|
+
"description": "The output path of the application's generated HTML index file. The full provided path will be used and will be considered relative to the application's configured output path."
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"required": [
|
|
415
|
+
"input"
|
|
416
|
+
]
|
|
417
|
+
}
|
|
418
|
+
]
|
|
419
|
+
},
|
|
420
|
+
"statsJson": {
|
|
421
|
+
"type": "boolean",
|
|
422
|
+
"description": "Generates a 'stats.json' file which can be analyzed using tools such as 'webpack-bundle-analyzer'.",
|
|
423
|
+
"default": false
|
|
424
|
+
},
|
|
425
|
+
"budgets": {
|
|
426
|
+
"description": "Budget thresholds to ensure parts of your application stay within boundaries which you set.",
|
|
427
|
+
"type": "array",
|
|
428
|
+
"items": {
|
|
429
|
+
"$ref": "#/definitions/budget"
|
|
430
|
+
},
|
|
431
|
+
"default": []
|
|
432
|
+
},
|
|
433
|
+
"webWorkerTsConfig": {
|
|
434
|
+
"type": "string",
|
|
435
|
+
"description": "TypeScript configuration for Web Worker modules."
|
|
436
|
+
},
|
|
437
|
+
"crossOrigin": {
|
|
438
|
+
"type": "string",
|
|
439
|
+
"description": "Define the crossorigin attribute setting of elements that provide CORS support.",
|
|
440
|
+
"default": "none",
|
|
441
|
+
"enum": [
|
|
442
|
+
"none",
|
|
443
|
+
"anonymous",
|
|
444
|
+
"use-credentials"
|
|
445
|
+
]
|
|
446
|
+
},
|
|
447
|
+
"allowedCommonJsDependencies": {
|
|
448
|
+
"description": "A list of CommonJS packages that are allowed to be used without a build time warning.",
|
|
449
|
+
"type": "array",
|
|
450
|
+
"items": {
|
|
451
|
+
"type": "string"
|
|
452
|
+
},
|
|
453
|
+
"default": []
|
|
454
|
+
},
|
|
455
|
+
"url": {
|
|
456
|
+
"type": "string",
|
|
457
|
+
"description": "The default url to proxy to.",
|
|
458
|
+
"default": "https://unknown.cumulocity.com",
|
|
459
|
+
"alias": "u"
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
"additionalProperties": false,
|
|
463
|
+
"required": [
|
|
464
|
+
"outputPath",
|
|
465
|
+
"main",
|
|
466
|
+
"tsConfig"
|
|
467
|
+
],
|
|
468
|
+
"definitions": {
|
|
469
|
+
"assetPattern": {
|
|
470
|
+
"oneOf": [
|
|
471
|
+
{
|
|
472
|
+
"type": "object",
|
|
473
|
+
"properties": {
|
|
474
|
+
"followSymlinks": {
|
|
475
|
+
"type": "boolean",
|
|
476
|
+
"default": false,
|
|
477
|
+
"description": "Allow glob patterns to follow symlink directories. This allows subdirectories of the symlink to be searched."
|
|
478
|
+
},
|
|
479
|
+
"glob": {
|
|
480
|
+
"type": "string",
|
|
481
|
+
"description": "The pattern to match."
|
|
482
|
+
},
|
|
483
|
+
"input": {
|
|
484
|
+
"type": "string",
|
|
485
|
+
"description": "The input directory path in which to apply 'glob'. Defaults to the project root."
|
|
486
|
+
},
|
|
487
|
+
"ignore": {
|
|
488
|
+
"description": "An array of globs to ignore.",
|
|
489
|
+
"type": "array",
|
|
490
|
+
"items": {
|
|
491
|
+
"type": "string"
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
"output": {
|
|
495
|
+
"type": "string",
|
|
496
|
+
"description": "Absolute path within the output."
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
"additionalProperties": false,
|
|
500
|
+
"required": [
|
|
501
|
+
"glob",
|
|
502
|
+
"input",
|
|
503
|
+
"output"
|
|
504
|
+
]
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"type": "string"
|
|
508
|
+
}
|
|
509
|
+
]
|
|
510
|
+
},
|
|
511
|
+
"fileReplacement": {
|
|
512
|
+
"oneOf": [
|
|
513
|
+
{
|
|
514
|
+
"type": "object",
|
|
515
|
+
"properties": {
|
|
516
|
+
"src": {
|
|
517
|
+
"type": "string",
|
|
518
|
+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
|
|
519
|
+
},
|
|
520
|
+
"replaceWith": {
|
|
521
|
+
"type": "string",
|
|
522
|
+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
"additionalProperties": false,
|
|
526
|
+
"required": [
|
|
527
|
+
"src",
|
|
528
|
+
"replaceWith"
|
|
529
|
+
]
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"type": "object",
|
|
533
|
+
"properties": {
|
|
534
|
+
"replace": {
|
|
535
|
+
"type": "string",
|
|
536
|
+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
|
|
537
|
+
},
|
|
538
|
+
"with": {
|
|
539
|
+
"type": "string",
|
|
540
|
+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
"additionalProperties": false,
|
|
544
|
+
"required": [
|
|
545
|
+
"replace",
|
|
546
|
+
"with"
|
|
547
|
+
]
|
|
548
|
+
}
|
|
549
|
+
]
|
|
550
|
+
},
|
|
551
|
+
"budget": {
|
|
552
|
+
"type": "object",
|
|
553
|
+
"properties": {
|
|
554
|
+
"type": {
|
|
555
|
+
"type": "string",
|
|
556
|
+
"description": "The type of budget.",
|
|
557
|
+
"enum": [
|
|
558
|
+
"all",
|
|
559
|
+
"allScript",
|
|
560
|
+
"any",
|
|
561
|
+
"anyScript",
|
|
562
|
+
"anyComponentStyle",
|
|
563
|
+
"bundle",
|
|
564
|
+
"initial"
|
|
565
|
+
]
|
|
566
|
+
},
|
|
567
|
+
"name": {
|
|
568
|
+
"type": "string",
|
|
569
|
+
"description": "The name of the bundle."
|
|
570
|
+
},
|
|
571
|
+
"baseline": {
|
|
572
|
+
"type": "string",
|
|
573
|
+
"description": "The baseline size for comparison."
|
|
574
|
+
},
|
|
575
|
+
"maximumWarning": {
|
|
576
|
+
"type": "string",
|
|
577
|
+
"description": "The maximum threshold for warning relative to the baseline."
|
|
578
|
+
},
|
|
579
|
+
"maximumError": {
|
|
580
|
+
"type": "string",
|
|
581
|
+
"description": "The maximum threshold for error relative to the baseline."
|
|
582
|
+
},
|
|
583
|
+
"minimumWarning": {
|
|
584
|
+
"type": "string",
|
|
585
|
+
"description": "The minimum threshold for warning relative to the baseline."
|
|
586
|
+
},
|
|
587
|
+
"minimumError": {
|
|
588
|
+
"type": "string",
|
|
589
|
+
"description": "The minimum threshold for error relative to the baseline."
|
|
590
|
+
},
|
|
591
|
+
"warning": {
|
|
592
|
+
"type": "string",
|
|
593
|
+
"description": "The threshold for warning relative to the baseline (min & max)."
|
|
594
|
+
},
|
|
595
|
+
"error": {
|
|
596
|
+
"type": "string",
|
|
597
|
+
"description": "The threshold for error relative to the baseline (min & max)."
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
"additionalProperties": false,
|
|
601
|
+
"required": [
|
|
602
|
+
"type"
|
|
603
|
+
]
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const architect_1 = require("@angular-devkit/architect");
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const chalk = require("chalk");
|
|
6
|
+
const fast_glob_1 = require("fast-glob");
|
|
7
|
+
const fs_extra_1 = require("fs-extra");
|
|
8
|
+
const options_1 = require("../../options");
|
|
9
|
+
const locale_compiler_1 = require("../../utils/locale-compiler");
|
|
10
|
+
/**
|
|
11
|
+
* Creates a Builder instance for compiling locales using the specified compile-i18n builder function.
|
|
12
|
+
*/
|
|
13
|
+
const builder = (0, architect_1.createBuilder)(compileI18nBuilder);
|
|
14
|
+
exports.default = builder;
|
|
15
|
+
/**
|
|
16
|
+
* Output path for the generated json files.
|
|
17
|
+
*/
|
|
18
|
+
let outputPath;
|
|
19
|
+
/**
|
|
20
|
+
* Helper class for loading .po files and compiling them to json files.
|
|
21
|
+
*/
|
|
22
|
+
let localeCompiler;
|
|
23
|
+
/**
|
|
24
|
+
* Compiles the globs for po files into json, that can be used later in UI app as translations source.
|
|
25
|
+
* @param output '-o' or '--o' Output directory for the generated .json files.
|
|
26
|
+
* @param paths '-p' or '--paths' Glob patterns list (separated with spaces) to compile locales from.
|
|
27
|
+
* **Example**
|
|
28
|
+
* ```bash
|
|
29
|
+
* $ ng run ngx-components:compile-i18n -p ./custom-locales/de.po ./custom-locales/pl.po -o ./compiled-locales
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
async function compileI18nBuilder(options) {
|
|
33
|
+
try {
|
|
34
|
+
await compileLocales(options);
|
|
35
|
+
}
|
|
36
|
+
catch (ex) {
|
|
37
|
+
console.error(ex);
|
|
38
|
+
return { success: false };
|
|
39
|
+
}
|
|
40
|
+
return { success: true };
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Compiles localization files to json.
|
|
44
|
+
* @param options The options for compiling process.
|
|
45
|
+
*/
|
|
46
|
+
async function compileLocales(options) {
|
|
47
|
+
const poPaths = options.paths;
|
|
48
|
+
let srcGlobs;
|
|
49
|
+
if (poPaths.length) {
|
|
50
|
+
srcGlobs = poPaths.map(poPath => (0, fast_glob_1.convertPathToPattern)(poPath));
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
srcGlobs = ['./*'];
|
|
54
|
+
}
|
|
55
|
+
const paths = (await (0, fast_glob_1.async)(srcGlobs, { absolute: true, onlyFiles: true })).filter((p) => /po$/.test(p));
|
|
56
|
+
if (paths.length === 0) {
|
|
57
|
+
console.error(options_1.options['TXT.LOCALE_COMPILE.NO_FILES_TO_COMPILE_FOUND']);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
outputPath = (0, path_1.resolve)(options.output || './');
|
|
61
|
+
const poFiles = await read(paths);
|
|
62
|
+
localeCompiler = new locale_compiler_1.LocaleCompiler();
|
|
63
|
+
poFiles.forEach((content, i) => localeCompiler.loadPo(content, paths[i].toString()));
|
|
64
|
+
await write(localeCompiler.compile());
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Reads the content of the provided paths and returns them as strings.
|
|
68
|
+
* @param paths An array of file paths to read.
|
|
69
|
+
* @returns An array of file contents as strings.
|
|
70
|
+
*/
|
|
71
|
+
async function read(paths) {
|
|
72
|
+
return (await Promise.all(paths.map(path => (0, fs_extra_1.readFile)(path)))).map((buffer) => buffer.toString());
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Writes the compiled localization data to the specified output path.
|
|
76
|
+
* @param files An array of compiled PO objects to write.
|
|
77
|
+
* @returns A promise array, each promise representing a write operation.
|
|
78
|
+
*/
|
|
79
|
+
async function write(files) {
|
|
80
|
+
return await Promise.all(files.map(async ({ language, json }) => {
|
|
81
|
+
await (0, fs_extra_1.ensureDir)(outputPath);
|
|
82
|
+
const outputFilePath = `${outputPath}/${language}.json`;
|
|
83
|
+
await (0, fs_extra_1.writeFile)((0, path_1.resolve)(outputFilePath), json);
|
|
84
|
+
const msg = options_1.options['TXT.LOCALE_COMPILE.FILE_SAVED'](outputFilePath);
|
|
85
|
+
console.info(chalk.green(msg));
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=compile-i18n-builder.js.map
|