@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.
Files changed (196) hide show
  1. package/README.md +13 -0
  2. package/dist/builders.json +29 -0
  3. package/dist/index.d.ts +6 -0
  4. package/dist/index.js +11 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/options.d.ts +2 -0
  7. package/dist/options.js +6 -0
  8. package/dist/options.js.map +1 -0
  9. package/dist/src/builders/BuilderOptions.d.ts +90 -0
  10. package/dist/src/builders/BuilderOptions.js +3 -0
  11. package/dist/src/builders/BuilderOptions.js.map +1 -0
  12. package/dist/src/builders/browser/index.d.ts +2 -0
  13. package/dist/src/builders/browser/index.js +17 -0
  14. package/dist/src/builders/browser/index.js.map +1 -0
  15. package/dist/src/builders/browser/schema.json +606 -0
  16. package/dist/src/builders/compile-i18n/compile-i18n-builder.d.ts +5 -0
  17. package/dist/src/builders/compile-i18n/compile-i18n-builder.js +88 -0
  18. package/dist/src/builders/compile-i18n/compile-i18n-builder.js.map +1 -0
  19. package/dist/src/builders/compile-i18n/schema.json +24 -0
  20. package/dist/src/builders/create-schema.d.ts +1 -0
  21. package/dist/src/builders/create-schema.js +32 -0
  22. package/dist/src/builders/create-schema.js.map +1 -0
  23. package/dist/src/builders/deploy/Deploy.model.d.ts +30 -0
  24. package/dist/src/builders/deploy/Deploy.model.js +8 -0
  25. package/dist/src/builders/deploy/Deploy.model.js.map +1 -0
  26. package/dist/src/builders/deploy/app-as-zip-file.d.ts +8 -0
  27. package/dist/src/builders/deploy/app-as-zip-file.js +74 -0
  28. package/dist/src/builders/deploy/app-as-zip-file.js.map +1 -0
  29. package/dist/src/builders/deploy/build-and-zip-app.d.ts +10 -0
  30. package/dist/src/builders/deploy/build-and-zip-app.js +105 -0
  31. package/dist/src/builders/deploy/build-and-zip-app.js.map +1 -0
  32. package/dist/src/builders/deploy/deploy-builder.d.ts +5 -0
  33. package/dist/src/builders/deploy/deploy-builder.js +268 -0
  34. package/dist/src/builders/deploy/deploy-builder.js.map +1 -0
  35. package/dist/src/builders/deploy/helpers.d.ts +25 -0
  36. package/dist/src/builders/deploy/helpers.js +45 -0
  37. package/dist/src/builders/deploy/helpers.js.map +1 -0
  38. package/dist/src/builders/deploy/schema.json +42 -0
  39. package/dist/src/builders/dev-server/index.d.ts +2 -0
  40. package/dist/src/builders/dev-server/index.js +67 -0
  41. package/dist/src/builders/dev-server/index.js.map +1 -0
  42. package/dist/src/builders/dev-server/schema.json +120 -0
  43. package/dist/src/builders/extract-i18n/extract-i18n-builder.d.ts +5 -0
  44. package/dist/src/builders/extract-i18n/extract-i18n-builder.js +126 -0
  45. package/dist/src/builders/extract-i18n/extract-i18n-builder.js.map +1 -0
  46. package/dist/src/builders/extract-i18n/schema.json +30 -0
  47. package/dist/src/options.d.ts +82 -0
  48. package/dist/src/options.js +98 -0
  49. package/dist/src/options.js.map +1 -0
  50. package/dist/src/schematics/collection.json +9 -0
  51. package/dist/src/schematics/ng-add/configs/angular-json.d.ts +28 -0
  52. package/dist/src/schematics/ng-add/configs/angular-json.js +93 -0
  53. package/dist/src/schematics/ng-add/configs/angular-json.js.map +1 -0
  54. package/dist/src/schematics/ng-add/configs/app-module.d.ts +3 -0
  55. package/dist/src/schematics/ng-add/configs/app-module.js +13 -0
  56. package/dist/src/schematics/ng-add/configs/app-module.js.map +1 -0
  57. package/dist/src/schematics/ng-add/configs/app-routing.d.ts +2 -0
  58. package/dist/src/schematics/ng-add/configs/app-routing.js +16 -0
  59. package/dist/src/schematics/ng-add/configs/app-routing.js.map +1 -0
  60. package/dist/src/schematics/ng-add/configs/index-html.d.ts +2 -0
  61. package/dist/src/schematics/ng-add/configs/index-html.js +15 -0
  62. package/dist/src/schematics/ng-add/configs/index-html.js.map +1 -0
  63. package/dist/src/schematics/ng-add/configs/index.d.ts +2 -0
  64. package/dist/src/schematics/ng-add/configs/index.js +37 -0
  65. package/dist/src/schematics/ng-add/configs/index.js.map +1 -0
  66. package/dist/src/schematics/ng-add/configs/main.d.ts +2 -0
  67. package/dist/src/schematics/ng-add/configs/main.js +30 -0
  68. package/dist/src/schematics/ng-add/configs/main.js.map +1 -0
  69. package/dist/src/schematics/ng-add/configs/ng1.d.ts +3 -0
  70. package/dist/src/schematics/ng-add/configs/ng1.js +13 -0
  71. package/dist/src/schematics/ng-add/configs/ng1.js.map +1 -0
  72. package/dist/src/schematics/ng-add/configs/package-json.d.ts +17 -0
  73. package/dist/src/schematics/ng-add/configs/package-json.js +67 -0
  74. package/dist/src/schematics/ng-add/configs/package-json.js.map +1 -0
  75. package/dist/src/schematics/ng-add/configs/translation.d.ts +2 -0
  76. package/dist/src/schematics/ng-add/configs/translation.js +36 -0
  77. package/dist/src/schematics/ng-add/configs/translation.js.map +1 -0
  78. package/dist/src/schematics/ng-add/configs/tsconfig-app-json.d.ts +2 -0
  79. package/dist/src/schematics/ng-add/configs/tsconfig-app-json.js +21 -0
  80. package/dist/src/schematics/ng-add/configs/tsconfig-app-json.js.map +1 -0
  81. package/dist/src/schematics/ng-add/configs/tsconfig-json.d.ts +2 -0
  82. package/dist/src/schematics/ng-add/configs/tsconfig-json.js +19 -0
  83. package/dist/src/schematics/ng-add/configs/tsconfig-json.js.map +1 -0
  84. package/dist/src/schematics/ng-add/index.d.ts +4 -0
  85. package/dist/src/schematics/ng-add/index.js +93 -0
  86. package/dist/src/schematics/ng-add/index.js.map +1 -0
  87. package/dist/src/schematics/ng-add/model.d.ts +19 -0
  88. package/dist/src/schematics/ng-add/model.js +3 -0
  89. package/dist/src/schematics/ng-add/model.js.map +1 -0
  90. package/dist/src/schematics/ng-add/ng-add.json +18 -0
  91. package/dist/src/schematics/ng-add/utils.d.ts +13 -0
  92. package/dist/src/schematics/ng-add/utils.js +32 -0
  93. package/dist/src/schematics/ng-add/utils.js.map +1 -0
  94. package/dist/src/utils/locale-compiler.d.ts +48 -0
  95. package/dist/src/utils/locale-compiler.js +83 -0
  96. package/dist/src/utils/locale-compiler.js.map +1 -0
  97. package/dist/src/utils/locale-json-paths.d.ts +19 -0
  98. package/dist/src/utils/locale-json-paths.js +63 -0
  99. package/dist/src/utils/locale-json-paths.js.map +1 -0
  100. package/dist/src/utils/locale-utils.d.ts +24 -0
  101. package/dist/src/utils/locale-utils.js +104 -0
  102. package/dist/src/utils/locale-utils.js.map +1 -0
  103. package/dist/src/utils/package-config.d.ts +1 -0
  104. package/dist/src/utils/package-config.js +13 -0
  105. package/dist/src/utils/package-config.js.map +1 -0
  106. package/dist/src/webpack/ApplicationOptions.d.ts +344 -0
  107. package/dist/src/webpack/ApplicationOptions.js +3 -0
  108. package/dist/src/webpack/ApplicationOptions.js.map +1 -0
  109. package/dist/src/webpack/BuildDefaults.d.ts +10 -0
  110. package/dist/src/webpack/BuildDefaults.js +15 -0
  111. package/dist/src/webpack/BuildDefaults.js.map +1 -0
  112. package/dist/src/webpack/EnvironmentOptions.d.ts +132 -0
  113. package/dist/src/webpack/EnvironmentOptions.js +15 -0
  114. package/dist/src/webpack/EnvironmentOptions.js.map +1 -0
  115. package/dist/src/webpack/config/babel.d.ts +2 -0
  116. package/dist/src/webpack/config/babel.js +65 -0
  117. package/dist/src/webpack/config/babel.js.map +1 -0
  118. package/dist/src/webpack/config/base.d.ts +27 -0
  119. package/dist/src/webpack/config/base.js +125 -0
  120. package/dist/src/webpack/config/base.js.map +1 -0
  121. package/dist/src/webpack/config/development.d.ts +4 -0
  122. package/dist/src/webpack/config/development.js +37 -0
  123. package/dist/src/webpack/config/development.js.map +1 -0
  124. package/dist/src/webpack/config/extra.d.ts +3 -0
  125. package/dist/src/webpack/config/extra.js +24 -0
  126. package/dist/src/webpack/config/extra.js.map +1 -0
  127. package/dist/src/webpack/config/favicon.d.ts +2 -0
  128. package/dist/src/webpack/config/favicon.js +20 -0
  129. package/dist/src/webpack/config/favicon.js.map +1 -0
  130. package/dist/src/webpack/config/federation.d.ts +3 -0
  131. package/dist/src/webpack/config/federation.js +66 -0
  132. package/dist/src/webpack/config/federation.js.map +1 -0
  133. package/dist/src/webpack/config/legacy.d.ts +2 -0
  134. package/dist/src/webpack/config/legacy.js +72 -0
  135. package/dist/src/webpack/config/legacy.js.map +1 -0
  136. package/dist/src/webpack/config/plugin.d.ts +5 -0
  137. package/dist/src/webpack/config/plugin.js +89 -0
  138. package/dist/src/webpack/config/plugin.js.map +1 -0
  139. package/dist/src/webpack/config/production.d.ts +3 -0
  140. package/dist/src/webpack/config/production.js +30 -0
  141. package/dist/src/webpack/config/production.js.map +1 -0
  142. package/dist/src/webpack/config/styles.d.ts +3 -0
  143. package/dist/src/webpack/config/styles.js +54 -0
  144. package/dist/src/webpack/config/styles.js.map +1 -0
  145. package/dist/src/webpack/config/translation.d.ts +2 -0
  146. package/dist/src/webpack/config/translation.js +23 -0
  147. package/dist/src/webpack/config/translation.js.map +1 -0
  148. package/dist/src/webpack/loaders/loader-data.d.ts +1 -0
  149. package/dist/src/webpack/loaders/loader-data.js +53 -0
  150. package/dist/src/webpack/loaders/loader-data.js.map +1 -0
  151. package/dist/src/webpack/loaders/loader-less.d.ts +1 -0
  152. package/dist/src/webpack/loaders/loader-less.js +23 -0
  153. package/dist/src/webpack/loaders/loader-less.js.map +1 -0
  154. package/dist/src/webpack/loaders/loader-manifest.d.ts +1 -0
  155. package/dist/src/webpack/loaders/loader-manifest.js +88 -0
  156. package/dist/src/webpack/loaders/loader-manifest.js.map +1 -0
  157. package/dist/src/webpack/loaders/loader-ngtemplate.d.ts +1 -0
  158. package/dist/src/webpack/loaders/loader-ngtemplate.js +16 -0
  159. package/dist/src/webpack/loaders/loader-ngtemplate.js.map +1 -0
  160. package/dist/src/webpack/loaders/loader-pluginpath.d.ts +1 -0
  161. package/dist/src/webpack/loaders/loader-pluginpath.js +10 -0
  162. package/dist/src/webpack/loaders/loader-pluginpath.js.map +1 -0
  163. package/dist/src/webpack/loaders/loader-po.d.ts +3 -0
  164. package/dist/src/webpack/loaders/loader-po.js +9 -0
  165. package/dist/src/webpack/loaders/loader-po.js.map +1 -0
  166. package/dist/src/webpack/plugin/index-content.d.ts +2 -0
  167. package/dist/src/webpack/plugin/index-content.js +113 -0
  168. package/dist/src/webpack/plugin/index-content.js.map +1 -0
  169. package/dist/src/webpack/plugin/locales.d.ts +6 -0
  170. package/dist/src/webpack/plugin/locales.js +746 -0
  171. package/dist/src/webpack/plugin/locales.js.map +1 -0
  172. package/dist/src/webpack/plugin/plugin.d.ts +259 -0
  173. package/dist/src/webpack/plugin/plugin.js +286 -0
  174. package/dist/src/webpack/plugin/plugin.js.map +1 -0
  175. package/dist/src/webpack/plugin/translation-aggregation-plugin.d.ts +80 -0
  176. package/dist/src/webpack/plugin/translation-aggregation-plugin.js +152 -0
  177. package/dist/src/webpack/plugin/translation-aggregation-plugin.js.map +1 -0
  178. package/dist/src/webpack/plugin/translation-data-store.d.ts +27 -0
  179. package/dist/src/webpack/plugin/translation-data-store.js +37 -0
  180. package/dist/src/webpack/plugin/translation-data-store.js.map +1 -0
  181. package/dist/src/webpack/utils/federationUtils.d.ts +26 -0
  182. package/dist/src/webpack/utils/federationUtils.js +234 -0
  183. package/dist/src/webpack/utils/federationUtils.js.map +1 -0
  184. package/dist/src/webpack/utils/helpers.d.ts +45 -0
  185. package/dist/src/webpack/utils/helpers.js +137 -0
  186. package/dist/src/webpack/utils/helpers.js.map +1 -0
  187. package/dist/src/webpack/utils/index.d.ts +1 -0
  188. package/dist/src/webpack/utils/index.js +5 -0
  189. package/dist/src/webpack/utils/index.js.map +1 -0
  190. package/dist/src/webpack/utils/legacy-manifest-resolver.d.ts +4 -0
  191. package/dist/src/webpack/utils/legacy-manifest-resolver.js +27 -0
  192. package/dist/src/webpack/utils/legacy-manifest-resolver.js.map +1 -0
  193. package/dist/src/webpack/utils/proxy.d.ts +2 -0
  194. package/dist/src/webpack/utils/proxy.js +39 -0
  195. package/dist/src/webpack/utils/proxy.js.map +1 -0
  196. package/package.json +99 -0
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getContextPath = exports.getKey = exports.getName = exports.dataToAppData = void 0;
4
+ const lodash_1 = require("lodash");
5
+ /**
6
+ * Converts the provided file data to application data.
7
+ *
8
+ * @param fileData - The file data to convert.
9
+ * @returns The application data.
10
+ */
11
+ function dataToAppData(fileData) {
12
+ return fileData.c8y && fileData.c8y.application ? fileData.c8y.application : fileData;
13
+ }
14
+ exports.dataToAppData = dataToAppData;
15
+ /**
16
+ * Gets the name from the application data.
17
+ *
18
+ * @param appData - The application data.
19
+ * @param fallbackStr - The fallback string to use if name is not found.
20
+ * @returns The name of the application.
21
+ */
22
+ function getName(appData, fallbackStr = '') {
23
+ return (0, lodash_1.get)(appData, 'name', fallbackStr);
24
+ }
25
+ exports.getName = getName;
26
+ /**
27
+ * Gets the key from the application data.
28
+ *
29
+ * @param appData - The application data.
30
+ * @param name - The name to use in case the key is not found.
31
+ * @returns The key of the application.
32
+ */
33
+ function getKey(appData, name) {
34
+ let key = (0, lodash_1.get)(appData, 'key');
35
+ if (!key) {
36
+ key = `${(0, lodash_1.kebabCase)(name)}-key`;
37
+ }
38
+ return key;
39
+ }
40
+ exports.getKey = getKey;
41
+ function getContextPath(appData, name) {
42
+ return (0, lodash_1.get)(appData, 'contextPath', name.toLowerCase());
43
+ }
44
+ exports.getContextPath = getContextPath;
45
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/builders/deploy/helpers.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAGxC;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,QAAa;IACzC,OAAO,QAAQ,CAAC,GAAG,IAAI,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;AACxF,CAAC;AAFD,sCAEC;AACD;;;;;;GAMG;AACH,SAAgB,OAAO,CAAC,OAA4B,EAAE,WAAW,GAAG,EAAE;IACpE,OAAO,IAAA,YAAG,EAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;AAC3C,CAAC;AAFD,0BAEC;AACD;;;;;;GAMG;AACH,SAAgB,MAAM,CAAC,OAA4B,EAAE,IAAY;IAC/D,IAAI,GAAG,GAAG,IAAA,YAAG,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC9B,IAAI,CAAC,GAAG,EAAE;QACR,GAAG,GAAG,GAAG,IAAA,kBAAS,EAAC,IAAI,CAAC,MAAM,CAAC;KAChC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAPD,wBAOC;AAED,SAAgB,cAAc,CAAC,OAA4B,EAAE,IAAY;IACvE,OAAO,IAAA,YAAG,EAAC,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;AACzD,CAAC;AAFD,wCAEC"}
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "title": "Deploy schema",
4
+ "description": "Schema for deploying application.",
5
+ "type": "object",
6
+ "properties": {
7
+ "url": {
8
+ "type": "string",
9
+ "description": "The default url to proxy to.",
10
+ "alias": "u"
11
+ },
12
+ "tenant": {
13
+ "type": "string",
14
+ "description": "Tenant id.",
15
+ "alias": "T"
16
+ },
17
+ "user": {
18
+ "type": "string",
19
+ "description": "Tenant user login.",
20
+ "alias": "U"
21
+ },
22
+ "password": {
23
+ "type": "string",
24
+ "description": "Tenant user password.",
25
+ "alias": "P"
26
+ },
27
+ "zipPath": {
28
+ "type": "string",
29
+ "description": "Path to zipped application.",
30
+ "alias": "z"
31
+ },
32
+ "tags": {
33
+ "type": "string",
34
+ "description": "Tags for package applications. To provide multiple tags, separate them with \",\"",
35
+ "alias": "t"
36
+ },
37
+ "browserTarget": {
38
+ "type": "string",
39
+ "description": "The target string for the build"
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,2 @@
1
+ declare const builder: unknown;
2
+ export default builder;
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const architect_1 = require("@angular-devkit/architect");
4
+ const build_angular_1 = require("@angular-devkit/build-angular");
5
+ const chalk = require("chalk");
6
+ const rxjs_1 = require("rxjs");
7
+ const operators_1 = require("rxjs/operators");
8
+ const base_1 = require("../../webpack/config/base");
9
+ const helpers_1 = require("../../webpack/utils/helpers");
10
+ // Sadly the `Builder` interface is not exported by @angular-devkit/architect
11
+ const builder = (0, architect_1.createBuilder)(devServerBuilder);
12
+ exports.default = builder;
13
+ function devServerBuilder(options, context) {
14
+ const webpackConfig = (0, base_1.webpackConfigurationTransformerWithContextForDevServer)(options, context);
15
+ const result = (0, rxjs_1.from)((0, helpers_1.getOptionsFromContext)(context)).pipe((0, operators_1.map)((env) => (0, helpers_1.migrateDeprecatedDevServerOptions)(options, env)), (0, operators_1.switchMap)((options) => (0, build_angular_1.executeDevServerBuilder)(options, context, {
16
+ webpackConfiguration: webpackConfig,
17
+ logging: (stats, configuration) => {
18
+ if (stats.hasWarnings()) {
19
+ context.logger.warn(stats.toString(), stats.toJson());
20
+ }
21
+ if (stats.hasErrors()) {
22
+ context.logger.error(stats.toString(), stats.toJson());
23
+ }
24
+ if (!stats.hasErrors()) {
25
+ context.logger.info(getSuccessLog(options, configuration));
26
+ }
27
+ }
28
+ })));
29
+ return result;
30
+ }
31
+ /**
32
+ * Returns a success message with the relevant URLs.
33
+ * @param options The current build options.
34
+ * @param configuration The current webpack configuration.
35
+ * @param env The currently build env options.
36
+ * @returns A success message with relevant urls.
37
+ */
38
+ function getSuccessLog(options, configuration) {
39
+ const publicPath = configuration.devServer?.devMiddleware?.publicPath;
40
+ const serverUrl = `http://localhost:${configuration.devServer?.port || options.port}`;
41
+ const loggingStr = `
42
+ ✅ ****** c8y build ${chalk.green('successfully')} ******\n
43
+ 💻 Dev server running: ${chalk.bold(chalk.underline(`${serverUrl}${publicPath}/`))}
44
+ 👉 Proxy pointing to: ${chalk.bold(options.url)}
45
+ ${options.shell
46
+ ? `🐚 Shell pointing to: ${chalk.underline(getModuleFederationShellLog(serverUrl, options))}`
47
+ : ''}
48
+ \n✅ ***** -------------------------- *****
49
+ `;
50
+ return loggingStr;
51
+ }
52
+ /**
53
+ * Logs a message with all exported module federation modules as URL parameter.
54
+ * @param serverUrl The current server url.
55
+ * @param shell The shell to proxy to.
56
+ * @param env The env options to get the exports from.
57
+ * @returns A URL which points to the remotes via URL parameter.
58
+ */
59
+ function getModuleFederationShellLog(serverUrl, options) {
60
+ const shellRemotes = {
61
+ [options.runTime.contextPath]: (options.runTime?.exports || []).map(remoteExport => remoteExport.module)
62
+ };
63
+ const encodedRemotes = encodeURIComponent(JSON.stringify(shellRemotes));
64
+ const moduleFederationShellAppProxyUrl = `${serverUrl}/apps/${options.shell}/index.html?remotes=${encodedRemotes}`;
65
+ return moduleFederationShellAppProxyUrl;
66
+ }
67
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/builders/dev-server/index.ts"],"names":[],"mappings":";;AAAA,yDAA0E;AAC1E,iEAAwE;AACxE,+BAA+B;AAC/B,+BAA4B;AAC5B,8CAAgD;AAGhD,oDAAmG;AACnG,yDAGqC;AAGrC,6EAA6E;AAC7E,MAAM,OAAO,GAAY,IAAA,yBAAa,EAA6B,gBAAuB,CAAC,CAAC;AAC5F,kBAAe,OAAO,CAAC;AAEvB,SAAS,gBAAgB,CAAC,OAAmC,EAAE,OAAuB;IACpF,MAAM,aAAa,GAAG,IAAA,6DAAsD,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAE/F,MAAM,MAAM,GAAG,IAAA,WAAI,EAAC,IAAA,+BAAqB,EAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CACtD,IAAA,eAAG,EAAC,CAAC,GAAuB,EAAE,EAAE,CAAC,IAAA,2CAAiC,EAAC,OAAO,EAAE,GAAG,CAAC,C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,CAAC,SAAS,CAAC,2BAA2B,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,EAAE;QAC/F,CAAC,CAAC,EACN;;CAEC,CAAC;IACA,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;;;;GAMG;AACH,SAAS,2BAA2B,CAClC,SAAiB,EACjB,OAAmC;IAEnC,MAAM,YAAY,GAAG;QACnB,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CACjE,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,MAAM,CACpC;KACF,CAAC;IACF,MAAM,cAAc,GAAG,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IACxE,MAAM,gCAAgC,GAAG,GAAG,SAAS,SAAS,OAAO,CAAC,KAAK,uBAAuB,cAAc,EAAE,CAAC;IACnH,OAAO,gCAAgC,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,120 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "title": "Dev Server Target",
4
+ "description": "Dev Server target options for Build Facade.",
5
+ "type": "object",
6
+ "properties": {
7
+ "browserTarget": {
8
+ "type": "string",
9
+ "description": "A browser builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
10
+ "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
11
+ },
12
+ "port": {
13
+ "type": "number",
14
+ "description": "Port to listen on.",
15
+ "default": 4200
16
+ },
17
+ "host": {
18
+ "type": "string",
19
+ "description": "Host to listen on.",
20
+ "default": "localhost"
21
+ },
22
+ "proxyConfig": {
23
+ "type": "string",
24
+ "description": "Proxy configuration file. For more information, see https://angular.io/guide/build#proxying-to-a-backend-server."
25
+ },
26
+ "ssl": {
27
+ "type": "boolean",
28
+ "description": "Serve using HTTPS.",
29
+ "default": false
30
+ },
31
+ "sslKey": {
32
+ "type": "string",
33
+ "description": "SSL key to use for serving HTTPS."
34
+ },
35
+ "sslCert": {
36
+ "type": "string",
37
+ "description": "SSL certificate to use for serving HTTPS."
38
+ },
39
+ "headers": {
40
+ "type": "object",
41
+ "description": "Custom HTTP headers to be added to all responses.",
42
+ "propertyNames": {
43
+ "pattern": "^[-_A-Za-z0-9]+$"
44
+ },
45
+ "additionalProperties": {
46
+ "type": "string"
47
+ }
48
+ },
49
+ "open": {
50
+ "type": "boolean",
51
+ "description": "Opens the url in default browser.",
52
+ "default": false,
53
+ "alias": "o"
54
+ },
55
+ "verbose": {
56
+ "type": "boolean",
57
+ "description": "Adds more details to output logging."
58
+ },
59
+ "liveReload": {
60
+ "type": "boolean",
61
+ "description": "Whether to reload the page on change, using live-reload.",
62
+ "default": true
63
+ },
64
+ "publicHost": {
65
+ "type": "string",
66
+ "description": "The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies."
67
+ },
68
+ "allowedHosts": {
69
+ "type": "array",
70
+ "description": "List of hosts that are allowed to access the dev server.",
71
+ "default": [],
72
+ "items": {
73
+ "type": "string"
74
+ }
75
+ },
76
+ "servePath": {
77
+ "type": "string",
78
+ "description": "The pathname where the application will be served."
79
+ },
80
+ "disableHostCheck": {
81
+ "type": "boolean",
82
+ "description": "Don't verify connected clients are part of allowed hosts.",
83
+ "default": false
84
+ },
85
+ "hmr": {
86
+ "type": "boolean",
87
+ "description": "Enable hot module replacement.",
88
+ "default": false
89
+ },
90
+ "watch": {
91
+ "type": "boolean",
92
+ "description": "Rebuild on change.",
93
+ "default": true
94
+ },
95
+ "poll": {
96
+ "type": "number",
97
+ "description": "Enable and define the file watching poll time period in milliseconds."
98
+ },
99
+ "forceEsbuild": {
100
+ "type": "boolean",
101
+ "description": "Force the development server to use the 'browser-esbuild' builder when building. This is a developer preview option for the esbuild-based build system.",
102
+ "default": false
103
+ },
104
+ "url": {
105
+ "type": "string",
106
+ "description": "The default url to proxy to.",
107
+ "default": "https://demos.cumulocity.com",
108
+ "alias": "u"
109
+ },
110
+ "shell": {
111
+ "type": "string",
112
+ "description": "A shell application to verify plugins.",
113
+ "alias": "s"
114
+ }
115
+ },
116
+ "additionalProperties": false,
117
+ "required": [
118
+ "browserTarget"
119
+ ]
120
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Creates a Builder instance for extracting locales using the specified extract-i18n builder function.
3
+ */
4
+ declare const builder: unknown;
5
+ export default builder;
@@ -0,0 +1,126 @@
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 fs_extra_1 = require("fs-extra");
6
+ const fast_glob_1 = require("fast-glob");
7
+ const locale_utils_1 = require("../../utils/locale-utils");
8
+ const _ = require("lodash");
9
+ const chalk = require("chalk");
10
+ const options_1 = require("../../options");
11
+ /**
12
+ * Creates a Builder instance for extracting locales using the specified extract-i18n builder function.
13
+ */
14
+ const builder = (0, architect_1.createBuilder)(extractI18nBuilder);
15
+ exports.default = builder;
16
+ /**
17
+ * Output directory for the generated .po files.
18
+ */
19
+ let outputPath;
20
+ /**
21
+ * Include source line references.
22
+ */
23
+ let includeReferences;
24
+ /**
25
+ * Extracts all strings for translation and outputs the .po files to defined folder.
26
+ * It also creates locales.pot file which contains all strings that were marked with the translate pipe,
27
+ * the translate directive or the gettext method in your own source code. That means it does not include
28
+ * any default strings from node_modules/@c8y/locales. You can append these values to your custom *.po files
29
+ * and translate them.
30
+ * @param refs '-r' or '--refs' Include source line references.
31
+ * @param output '-o' or '--o' Output directory for the generated .po files.
32
+ * @param paths '-p' or '--paths' Glob patterns list (separated with spaces) to extract locales from.
33
+ * **Example**
34
+ * ```bash
35
+ * $ ng extract-i18n ngx-components -r -o ./custom-locales -p .
36
+ */
37
+ async function extractI18nBuilder(options) {
38
+ try {
39
+ await extractLocales(options);
40
+ }
41
+ catch (ex) {
42
+ console.error(ex);
43
+ return { success: false };
44
+ }
45
+ return { success: true };
46
+ }
47
+ /**
48
+ * Executes the locale extraction.
49
+ * @param options The options for extraction process.
50
+ */
51
+ async function extractLocales(options) {
52
+ const srcGlobs = options.paths?.length ? options.paths : ['./'];
53
+ const paths = await (0, fast_glob_1.async)(srcGlobs, { absolute: true, onlyDirectories: true });
54
+ outputPath = (0, path_1.resolve)(options.output || './locales');
55
+ includeReferences = options.refs || false;
56
+ await createCombinedFiles(paths);
57
+ }
58
+ /**
59
+ * Creates combined locale files from the provided paths and saves result.
60
+ * @param paths An array of paths from which to extract locale files.
61
+ */
62
+ async function createCombinedFiles(paths) {
63
+ const [pos, extractor] = await Promise.all([(0, locale_utils_1.getPoObjects)(paths), (0, locale_utils_1.getExtractor)(paths)]);
64
+ pos.push(extractor.toPo());
65
+ await (0, fs_extra_1.ensureDir)(outputPath);
66
+ savePoFiles(combinePos(pos));
67
+ }
68
+ /**
69
+ * Combines multiple PO (Portable Object) files into a single PO file per language.
70
+ * @param pos An array of PO objects representing individual locale files.
71
+ * @returns A record of combined PO files indexed by language code.
72
+ */
73
+ function combinePos(pos) {
74
+ const combinedPos = {};
75
+ _.forEach(pos, (po) => {
76
+ const lang = po.headers.Language || 'template';
77
+ if (!combinedPos[lang]) {
78
+ combinedPos[lang] = (0, locale_utils_1.createNewPo)(po);
79
+ }
80
+ const combinePo = combinedPos[lang];
81
+ combinePo.extractedComments = _.uniq(_.union(combinePo.extractedComments, po.extractedComments));
82
+ combinePo.comments = _.uniq(_.union(combinePo.comments, po.comments));
83
+ _.forEach(po.items, i => {
84
+ const exists = _.find(combinePo.items, { msgid: i.msgid });
85
+ if (!includeReferences) {
86
+ i.references.length = 0;
87
+ }
88
+ i.extractedComments.length = 0;
89
+ if (exists) {
90
+ exists.extractedComments = _.uniq(exists.extractedComments.concat(i.extractedComments));
91
+ exists.comments = _.uniq(exists.comments.concat(i.comments));
92
+ exists.references = _.uniq(exists.references.concat(i.references));
93
+ }
94
+ else {
95
+ combinePo.items.push(i);
96
+ }
97
+ });
98
+ combinePo.items = _.sortBy(combinePo.items, item => item.msgid);
99
+ });
100
+ return combinedPos;
101
+ }
102
+ /**
103
+ * Saves combined PO files to the output directory.
104
+ * @param extractedPos A record of PO files indexed by language code to be saved.
105
+ */
106
+ function savePoFiles(extractedPos) {
107
+ _.forEach(extractedPos, (po) => {
108
+ const { Language } = po.headers;
109
+ const filename = Language ? `${Language}.po` : 'locales.pot';
110
+ const outputFilePath = (0, path_1.join)(outputPath, filename);
111
+ try {
112
+ po.save(outputFilePath, err => {
113
+ if (err) {
114
+ throw err;
115
+ }
116
+ });
117
+ const msg = options_1.options['TXT.EXTRACT.SAVED'](outputFilePath);
118
+ console.info(chalk.green(msg));
119
+ }
120
+ catch (err) {
121
+ console.error(err);
122
+ process.exit(1);
123
+ }
124
+ });
125
+ }
126
+ //# sourceMappingURL=extract-i18n-builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-i18n-builder.js","sourceRoot":"","sources":["../../../../src/builders/extract-i18n/extract-i18n-builder.ts"],"names":[],"mappings":";;AAAA,yDAA0D;AAE1D,+BAAqC;AACrC,uCAAqC;AACrC,yCAA0C;AAC1C,2DAAmF;AACnF,4BAA4B;AAC5B,+BAA+B;AAC/B,2CAAwC;AAGxC;;GAEG;AACH,MAAM,OAAO,GAAY,IAAA,yBAAa,EAA+B,kBAAkB,CAAC,CAAC;AACzF,kBAAe,OAAO,CAAC;AACvB;;GAEG;AACH,IAAI,UAAkB,CAAC;AACvB;;GAEG;AACH,IAAI,iBAA0B,CAAC;AAE/B;;;;;;;;;;;;GAYG;AACH,KAAK,UAAU,kBAAkB,CAC/B,OAAqC;IAErC,IAAI;QACF,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;KAC/B;IAAC,OAAO,EAAE,EAAE;QACX,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;KAC3B;IAC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AK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACzB;QACH,CAAC,CAAC,CAAC;QACH,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,OAAO,WAAW,CAAC;AACrB,CAAC;AACD;;;GAGG;AACH,SAAS,WAAW,CAAC,YAAgC;IACnD,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,EAAM,EAAE,EAAE;QACjC,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC;QAChC,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC;QAC7D,MAAM,cAAc,GAAG,IAAA,WAAI,EAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QAClD,IAAI;YACF,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC,EAAE;gBAC5B,IAAI,GAAG,EAAE;oBACP,MAAM,GAAG,CAAC;iBACX;YACH,CAAC,CAAC,CAAC;YACH,MAAM,GAAG,GAAG,iBAAO,CAAC,mBAAmB,CAAC,CAAC,cAAc,CAAC,CAAC;YACzD,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;SAChC;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "title": "Extract i18n schema",
4
+ "description": "Extracts all strings for translation.",
5
+ "type": "object",
6
+ "properties": {
7
+ "output": {
8
+ "type": "string",
9
+ "description": "Output directory for the generated .po files.",
10
+ "alias": "o"
11
+ },
12
+ "refs": {
13
+ "type": "boolean",
14
+ "description": "Include source line references.",
15
+ "alias": "r",
16
+ "default": false
17
+ },
18
+ "paths": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "string"
22
+ },
23
+ "$default": {
24
+ "$source": "argv"
25
+ },
26
+ "alias": "p",
27
+ "description": "Glob patterns list to extract locales from."
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,82 @@
1
+ export declare const options: {
2
+ 'TXT.BUILD': string;
3
+ 'TXT.BUILD.APPFOLDER': string;
4
+ 'TXT.BUILD.OUTPUTPATH': string;
5
+ 'PATH.TARGETS': string;
6
+ 'GLOB.LEGACY_APP_MANIFESTS': string;
7
+ 'TXT.CLI_DESCRIPTION': string;
8
+ 'TXT.BUILD_PATH': string;
9
+ 'TXT.TARGET': string;
10
+ 'TXT.URL': string;
11
+ 'TXT.TENANT': string;
12
+ 'TXT.USERNAME': string;
13
+ 'TXT.PASSWORD': string;
14
+ 'TXT.SILENT_MODE': string;
15
+ 'TXT.VERSION_TAG': string;
16
+ 'TXT.NOT_PACKAGE_WARNING': string;
17
+ 'TXT.USERNAME_MSG': string;
18
+ 'TXT.USERNAME_DEFAULT': string;
19
+ 'TXT.INSTANCE_URL': string;
20
+ 'TXT.NO_APP': string;
21
+ 'TXT.APP_DEPLOYED': (ctxPath: any) => string;
22
+ 'PATH.MANIFEST_FILE': string;
23
+ 'PATH.BUILT_MANIFEST_FILE': string;
24
+ 'TXT.PROVIDE_CREDENTIALS': string;
25
+ 'TXT.INVALID_CREDENTIALS_BASEURL': (baseUrl: any) => string;
26
+ 'TXT.ZIP_CREATING': string;
27
+ 'TXT.APP_UPLOADING': (bytes: any) => string;
28
+ 'TXT.APP_UPLOAD_ERROR': string;
29
+ 'TXT.APP_CREATING': string;
30
+ 'TXT.APP_CREATE_FAILED': string;
31
+ 'TXT.APP_FETCHING': string;
32
+ 'TXT.APP_FETCHING_FAILED': string;
33
+ 'TXT.APP_ACTIVATING': (id: any) => string;
34
+ 'TXT.APP_ACTIVATING_FAILED': (contextPath: any) => string;
35
+ 'TXT.EXTRACT.SAVED': (file: any) => string;
36
+ 'TXT.SERVER': string;
37
+ 'TXT.SERVER.PORT': string;
38
+ 'TXT.SERVER.SSL': string;
39
+ 'TXT.SERVER.PROD': string;
40
+ 'TXT.SERVER.HOT_RELOADING': string;
41
+ 'TXT.SERVER.FAILED': string;
42
+ 'TXT.SERVER.LOCAL_DOMAIN': string;
43
+ 'TXT.SERVER.CUSTOM_PROXY_PATHS': string;
44
+ 'TXT.SERVER.CI': string;
45
+ C8Y_BASE_URL_DEFAULT: string;
46
+ C8Y_APPS_NPM_URL: string;
47
+ 'BUILD.DEFAULT_PORT': number;
48
+ 'BUILD.DEFAULT_PUBLIC_PATH': string;
49
+ 'BUILD.DEFAULT_OUT': string;
50
+ 'TXT.BUILD.FAILED': string;
51
+ 'TXT.BRANDING': string;
52
+ 'PACKAGE.BASE_BRANDING': string;
53
+ 'PACKAGE.BASE_TEMPLATE': string;
54
+ 'TXT.NPM_PACKAGE_NAME': (defaultPkg: any) => string;
55
+ 'TXT.SCAFFOLD.CI': string;
56
+ 'PACKAGE.CLI': string;
57
+ 'PACKAGE.APPS': string;
58
+ 'PACKAGE.CLIENT': string;
59
+ 'PACKAGE.CLI.PROPERTIES.WHITELIST': string[];
60
+ 'BUILD.BRANDING_PATH': string;
61
+ 'TXT.NEW': string;
62
+ 'TXT.MANIFESTS': string;
63
+ 'PATH.APPS': string[];
64
+ 'TXT.NEW_APPLICATION': (folder: any) => string;
65
+ 'TXT.NEW_APPLICATION_FAILED': (appName: any) => string;
66
+ 'TXT.DOWNLOADED_APPS': string;
67
+ 'TXT.COPIED_FILES': string;
68
+ 'TXT.NPM_INITIALIZED': string;
69
+ 'TXT.UPDATED_PACKAGE_JSON': string;
70
+ 'TXT.GLOBAL_TITLE': string;
71
+ BIN: string;
72
+ 'PATH.DEPLOY_APPS': string[];
73
+ ENV_PREFIX: string;
74
+ NPM_REGISTRY: string;
75
+ 'TXT.NPM_REGISTRY': string;
76
+ 'TXT.LOCALE_COMPILE.NO_FILES_TO_COMPILE_FOUND': string;
77
+ 'TXT.LOCALE_COMPILE.FILE_SAVED': (file: any) => string;
78
+ 'TXT.VERBOSE': string;
79
+ 'TXT.NONEXISTING_VERSION': string;
80
+ 'TXT.SHELL': string;
81
+ 'TXT.REQUIRED_OPTION': (prop: any) => string;
82
+ };
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.options = void 0;
4
+ // tslint:disable:max-line-length
5
+ exports.options = {
6
+ 'TXT.BUILD': 'Build the specified apps into the build folder (default ./dist). It takes as an argument a glob or context paths.',
7
+ 'TXT.BUILD.APPFOLDER': 'Use app folders globs, instead of context paths. Used for angular applications',
8
+ 'TXT.BUILD.OUTPUTPATH': 'The folder where to create the apps.',
9
+ 'PATH.TARGETS': './targets',
10
+ 'GLOB.LEGACY_APP_MANIFESTS': '{apps/,}cumulocity{.*,}.json',
11
+ 'TXT.CLI_DESCRIPTION': 'Cumulocity IoT developer CLI',
12
+ 'TXT.BUILD_PATH': 'The file system path to load a build from',
13
+ 'TXT.TARGET': `The target file to be used. Can be either a relative file path to json. Or a the name of the target to be read at ./targets/<target>.json'`,
14
+ 'TXT.URL': 'The url of the remote instance.',
15
+ 'TXT.TENANT': 'Tenant',
16
+ 'TXT.USERNAME': 'Username',
17
+ 'TXT.PASSWORD': 'Password',
18
+ 'TXT.SILENT_MODE': 'does not prompt for additional inputs',
19
+ 'TXT.VERSION_TAG': 'A custom tag which will be added to the package version',
20
+ 'TXT.NOT_PACKAGE_WARNING': 'The provided tag is redundant since the application is not a package.',
21
+ 'TXT.USERNAME_MSG': 'Username must not contain spaces nor slashes ("/", "\\") nor ("+"), (":"), ("$") signs.',
22
+ 'TXT.USERNAME_DEFAULT': 'admin',
23
+ 'TXT.INSTANCE_URL': 'Instance URL',
24
+ 'TXT.NO_APP': 'No application found',
25
+ 'TXT.APP_DEPLOYED': (ctxPath) => `Application ${ctxPath} deployed.`,
26
+ 'PATH.MANIFEST_FILE': 'cumulocity*.json',
27
+ 'PATH.BUILT_MANIFEST_FILE': 'cumulocity.json',
28
+ 'TXT.PROVIDE_CREDENTIALS': 'Please provide credentials:',
29
+ 'TXT.INVALID_CREDENTIALS_BASEURL': (baseUrl) => `Failed to connect to ${baseUrl}. Invalid credentials provided or tenant not reachable.`,
30
+ 'TXT.ZIP_CREATING': 'Creating zip...',
31
+ 'TXT.APP_UPLOADING': (bytes) => `Uploading application zip with ${bytes} bytes...`,
32
+ 'TXT.APP_UPLOAD_ERROR': 'File upload failed:',
33
+ 'TXT.APP_CREATING': 'Creating application...',
34
+ 'TXT.APP_CREATE_FAILED': 'Create application failed:',
35
+ 'TXT.APP_FETCHING': 'Fetching application list...',
36
+ 'TXT.APP_FETCHING_FAILED': 'Cannot fetch application list:',
37
+ 'TXT.APP_ACTIVATING': (id) => `Activating binary version id ${id}...`,
38
+ 'TXT.APP_ACTIVATING_FAILED': (contextPath) => `Cannot activate latest version for application ${contextPath}:`,
39
+ 'TXT.EXTRACT.SAVED': (file) => `File: ${file} saved`,
40
+ 'TXT.SERVER': 'Run local development server',
41
+ 'TXT.SERVER.PORT': 'Port for the local development server. Default is 9000',
42
+ 'TXT.SERVER.SSL': 'Use SSL for local development server',
43
+ 'TXT.SERVER.PROD': 'Make a production ready build.',
44
+ 'TXT.SERVER.HOT_RELOADING': 'Uses hot reloading.',
45
+ 'TXT.SERVER.FAILED': 'Failed to start local development server',
46
+ 'TXT.SERVER.LOCAL_DOMAIN': 'Local domain or ip, defaults to localhost. Used to rewrite remote cookies.',
47
+ 'TXT.SERVER.CUSTOM_PROXY_PATHS': 'Allows to set a custom RegEx for additional paths to be proxied to the tenant. If option is not provided the default RegEx will proxy requests to /apps/public/... to the tenant. If option is used without an argument, the default proxy for /apps/public/... will be disabled. Only http request will be proxied.',
48
+ 'TXT.SERVER.CI': 'Optimized build for CI integration. Removes extensive progress login.',
49
+ C8Y_BASE_URL_DEFAULT: 'http://demos.cumulocity.com',
50
+ C8Y_APPS_NPM_URL: 'https://unpkg.com/@c8y',
51
+ 'BUILD.DEFAULT_PORT': 9000,
52
+ 'BUILD.DEFAULT_PUBLIC_PATH': 'apps',
53
+ 'BUILD.DEFAULT_OUT': 'dist',
54
+ 'TXT.BUILD.FAILED': 'Build failed',
55
+ 'TXT.BRANDING': 'Use branding from specified path.',
56
+ 'PACKAGE.BASE_BRANDING': '@c8y/style',
57
+ 'PACKAGE.BASE_TEMPLATE': '@c8y/apps',
58
+ 'TXT.NPM_PACKAGE_NAME': (defaultPkg) => `Define a different package used for scaffolding a new application (default is ${defaultPkg}).`,
59
+ 'TXT.SCAFFOLD.CI': 'Optimized scaffolding for CI integration. Does not verify if packages are available in the used version.',
60
+ 'PACKAGE.CLI': '@c8y/cli',
61
+ 'PACKAGE.APPS': '@c8y/apps',
62
+ 'PACKAGE.CLIENT': '@c8y/client',
63
+ 'PACKAGE.CLI.PROPERTIES.WHITELIST': [
64
+ 'author',
65
+ 'name',
66
+ 'version',
67
+ 'description',
68
+ 'contributors',
69
+ 'license',
70
+ 'keywords',
71
+ 'homepage',
72
+ 'repository',
73
+ 'versioningMatrix'
74
+ ],
75
+ 'BUILD.BRANDING_PATH': '@c8y/style',
76
+ 'TXT.NEW': 'Create a folder to start a brand new application.',
77
+ 'TXT.MANIFESTS': 'Use legacy application manifests instead of package.json',
78
+ 'PATH.APPS': ['./'],
79
+ 'TXT.NEW_APPLICATION': (folder) => `Application created. Go into the folder "${folder}" and run npm install`,
80
+ 'TXT.NEW_APPLICATION_FAILED': (appName) => `Failed to create application "${appName}".`,
81
+ 'TXT.DOWNLOADED_APPS': 'Applications downloaded.',
82
+ 'TXT.COPIED_FILES': 'Files copied.',
83
+ 'TXT.NPM_INITIALIZED': 'npm initialized.',
84
+ 'TXT.UPDATED_PACKAGE_JSON': 'package.json updated.',
85
+ 'TXT.GLOBAL_TITLE': 'Cumulocity',
86
+ BIN: 'c8ycli',
87
+ 'PATH.DEPLOY_APPS': ['dist/apps/*'],
88
+ ENV_PREFIX: 'C8Y_',
89
+ NPM_REGISTRY: 'https://registry.npmjs.org/',
90
+ 'TXT.NPM_REGISTRY': 'Url for the npm registry used to fetch applications package',
91
+ 'TXT.LOCALE_COMPILE.NO_FILES_TO_COMPILE_FOUND': 'No files to compile found.',
92
+ 'TXT.LOCALE_COMPILE.FILE_SAVED': (file) => `File: ${file} saved`,
93
+ 'TXT.VERBOSE': 'Adds more details to output logging',
94
+ 'TXT.NONEXISTING_VERSION': 'The selected version doest not exist.',
95
+ 'TXT.SHELL': 'Proxied module federation shell application.',
96
+ 'TXT.REQUIRED_OPTION': (prop) => `Property "${prop}" is required.`
97
+ };
98
+ //# sourceMappingURL=options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACpB,QAAA,OAAO,GAAG;IACrB,WAAW,EACT,mHAAmH;IACrH,qBAAqB,EACnB,gFAAgF;IAClF,sBAAsB,EAAE,sCAAsC;IAC9D,cAAc,EAAE,WAAW;IAC3B,2BAA2B,EAAE,8BAA8B;IAC3D,qBAAqB,EAAE,8BAA8B;IACrD,gBAAgB,EAAE,2CAA2C;IAC7D,YAAY,EAAE,4IAA4I;IAC1J,SAAS,EAAE,iCAAiC;IAC5C,YAAY,EAAE,QAAQ;IACtB,cAAc,EAAE,UAAU;IAC1B,cAAc,EAAE,UAAU;IAC1B,iBAAiB,EAAE,uCAAuC;IAC1D,iBAAiB,EAAE,yDAAyD;IAC5E,yBAAyB,EACvB,uEAAuE;IACzE,kBAAkB,EAChB,yFAAyF;IAC3F,sBAAsB,EAAE,OAAO;IAC/B,kBAAkB,EAAE,cAAc;IAClC,YAAY,EAAE,sBAAsB;IACpC,kBAAkB,EAAE,CAAC,OAAY,EAAE,EAAE,CAAC,eAA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