@rxap/plugin-angular 16.1.0-dev.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/GETSTARTED.md +0 -0
  3. package/GUIDES.md +0 -0
  4. package/README.md +62 -0
  5. package/generators.json +29 -0
  6. package/package.json +73 -0
  7. package/src/generators/fix-schematic/generator.d.ts +4 -0
  8. package/src/generators/fix-schematic/generator.js +66 -0
  9. package/src/generators/fix-schematic/generator.js.map +1 -0
  10. package/src/generators/fix-schematic/schema.d.ts +3 -0
  11. package/src/generators/fix-schematic/schema.json +21 -0
  12. package/src/generators/init/generator.d.ts +4 -0
  13. package/src/generators/init/generator.js +38 -0
  14. package/src/generators/init/generator.js.map +1 -0
  15. package/src/generators/init/schema.d.ts +3 -0
  16. package/src/generators/init/schema.json +16 -0
  17. package/src/generators/init-application/files/shared/.gitkeep +0 -0
  18. package/src/generators/init-application/files/shared/assets/.dockerignore +1 -0
  19. package/src/generators/init-application/files/shared/assets/Dockerfile +5 -0
  20. package/src/generators/init-application/files/shared/assets/nginx.conf +74 -0
  21. package/src/generators/init-application/files/shared/i18n.index.html.hbs +40 -0
  22. package/src/generators/init-application/files/shared/ngsw-config.json +62 -0
  23. package/src/generators/init-application/files/shared/proxy.conf.json +6 -0
  24. package/src/generators/init-application/generator.d.ts +4 -0
  25. package/src/generators/init-application/generator.js +263 -0
  26. package/src/generators/init-application/generator.js.map +1 -0
  27. package/src/generators/init-application/schema.d.ts +12 -0
  28. package/src/generators/init-application/schema.json +46 -0
  29. package/src/generators/init-library/generator.d.ts +4 -0
  30. package/src/generators/init-library/generator.js +109 -0
  31. package/src/generators/init-library/generator.js.map +1 -0
  32. package/src/generators/init-library/schema.d.ts +3 -0
  33. package/src/generators/init-library/schema.json +16 -0
  34. package/src/generators/schematic/files/schematic/__fileName__/index.ts.template +8 -0
  35. package/src/generators/schematic/files/schematic/__fileName__/schema.d.ts.template +3 -0
  36. package/src/generators/schematic/files/schematic/__fileName__/schema.json.template +18 -0
  37. package/src/generators/schematic/generator.d.ts +6 -0
  38. package/src/generators/schematic/generator.js +137 -0
  39. package/src/generators/schematic/generator.js.map +1 -0
  40. package/src/generators/schematic/schema.d.ts +6 -0
  41. package/src/generators/schematic/schema.json +43 -0
  42. package/src/index.d.ts +3 -0
  43. package/src/index.js +10 -0
  44. package/src/index.js.map +1 -0
  45. package/src/lib/skip-project.d.ts +1 -0
  46. package/src/lib/skip-project.js +19 -0
  47. package/src/lib/skip-project.js.map +1 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ # 16.1.0-dev.0 (2023-08-01)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **init-library:** add check version executor to angular libraries ([0ef7b06](https://gitlab.com/rxap/packages/commit/0ef7b069ebd3787501bde1e960b4f5a687dc03be))
11
+ - **options:** disable generate main by default ([76aa3f6](https://gitlab.com/rxap/packages/commit/76aa3f659ea97d8bb6038adee56c09b99c9d10f3))
12
+ - use new angular bootstrap utility class ([2a67044](https://gitlab.com/rxap/packages/commit/2a670440b92918330fccafcbe7a53cff14f4f3b4))
13
+ - use utility function to coerce default target dependencies ([afe5f53](https://gitlab.com/rxap/packages/commit/afe5f535383aab813dcaa88e5b25da874d190c12))
14
+
15
+ ### Features
16
+
17
+ - use new angular bootstrap utility class ([615b62d](https://gitlab.com/rxap/packages/commit/615b62d332f5320e215b986e0c3a6ad36858a0e6))
package/GETSTARTED.md ADDED
File without changes
package/GUIDES.md ADDED
File without changes
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # @rxap/plugin-angular
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@rxap/plugin-angular?style=flat-square)](https://www.npmjs.com/package/@rxap/plugin-angular)
4
+ [![commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](https://commitizen.github.io/cz-cli/)
5
+ [![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
6
+ ![Libraries.io dependency status for latest release, scoped npm package](https://img.shields.io/librariesio/release/npm/@rxap/plugin-angular)
7
+ ![npm](https://img.shields.io/npm/dm/@rxap/plugin-angular)
8
+ ![NPM](https://img.shields.io/npm/l/@rxap/plugin-angular)
9
+
10
+ - [Installation](#installation)
11
+ - [Generators](#generators)
12
+
13
+ # Installation
14
+
15
+ **Add the package to your workspace:**
16
+ ```bash
17
+ yarn add @rxap/plugin-angular
18
+ ```
19
+ **Install peer dependencies:**
20
+ ```bash
21
+ yarn add
22
+ ```
23
+ **Execute the init generator:**
24
+ ```bash
25
+ yarn nx g @rxap/plugin-angular:init
26
+ ```
27
+ # Generators
28
+
29
+ ## init
30
+ > init generator
31
+
32
+ ```bash
33
+ yarn nx g @rxap/plugin-angular:init
34
+ ```
35
+
36
+ ## init-application
37
+ > init-application generator
38
+
39
+ ```bash
40
+ yarn nx g @rxap/plugin-angular:init-application
41
+ ```
42
+
43
+ ## init-library
44
+ > init-library generator
45
+
46
+ ```bash
47
+ yarn nx g @rxap/plugin-angular:init-library
48
+ ```
49
+
50
+ ## fix-schematic
51
+ > fix-schematic generator
52
+
53
+ ```bash
54
+ yarn nx g @rxap/plugin-angular:fix-schematic
55
+ ```
56
+
57
+ ## schematic
58
+ > Create a Schematic for a project.
59
+
60
+ ```bash
61
+ yarn nx g @rxap/plugin-angular:schematic
62
+ ```
@@ -0,0 +1,29 @@
1
+ {
2
+ "generators": {
3
+ "init": {
4
+ "factory": "./src/generators/init/generator",
5
+ "schema": "./src/generators/init/schema.json",
6
+ "description": "init generator"
7
+ },
8
+ "init-application": {
9
+ "factory": "./src/generators/init-application/generator",
10
+ "schema": "./src/generators/init-application/schema.json",
11
+ "description": "init-application generator"
12
+ },
13
+ "init-library": {
14
+ "factory": "./src/generators/init-library/generator",
15
+ "schema": "./src/generators/init-library/schema.json",
16
+ "description": "init-library generator"
17
+ },
18
+ "fix-schematic": {
19
+ "factory": "./src/generators/fix-schematic/generator",
20
+ "schema": "./src/generators/fix-schematic/schema.json",
21
+ "description": "fix-schematic generator"
22
+ },
23
+ "schematic": {
24
+ "factory": "./src/generators/schematic/generator",
25
+ "schema": "./src/generators/schematic/schema.json",
26
+ "description": "Create a Schematic for a project."
27
+ }
28
+ }
29
+ }
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@rxap/plugin-angular",
3
+ "version": "16.1.0-dev.0",
4
+ "type": "commonjs",
5
+ "generators": "./generators.json",
6
+ "publishConfig": {
7
+ "access": "public",
8
+ "directory": "../../../dist/packages/plugin/angular"
9
+ },
10
+ "keywords": [
11
+ "rxap",
12
+ "plugin",
13
+ "nx",
14
+ "nx-plugin",
15
+ "packages",
16
+ "angular"
17
+ ],
18
+ "homepage": "https:/gitlab.com/rxap/packages/packages/plugin/angular",
19
+ "bugs": {
20
+ "url": "https://gitlab.com/rxap/packages/-/issues",
21
+ "email": "incoming+rxap-packages-14898188-issue-@incoming.gitlab.com"
22
+ },
23
+ "license": "GPL-3.0-or-later",
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://gitlab.com/rxap/packages.git",
27
+ "directory": "packages/plugin/angular"
28
+ },
29
+ "author": {
30
+ "name": "Merzough Münker",
31
+ "email": "mmuenker@digitaix.com"
32
+ },
33
+ "dependencies": {
34
+ "ignore": "^5.2.4",
35
+ "semver": "^7.3.5",
36
+ "tslib": "2.6.1"
37
+ },
38
+ "peerDependencies": {
39
+ "@nx/devkit": "^16.5.0",
40
+ "@rxap/generator-utilities": "^1.0.1-dev.2",
41
+ "@rxap/schematics-ts-morph": "^16.0.0-dev.5",
42
+ "@rxap/workspace-ts-morph": "^0.0.2-dev.0",
43
+ "@rxap/workspace-utilities": "^0.1.0-dev.0",
44
+ "nx": "^16.5.0",
45
+ "ts-morph": "^18.0.0",
46
+ "@rxap/node-utilities": "1.0.1-dev.2",
47
+ "@rxap/schematics-utilities": "16.0.0-dev.6",
48
+ "@rxap/utilities": "16.0.0-dev.4"
49
+ },
50
+ "nx-migrations": {
51
+ "packageGroup": [
52
+ {
53
+ "package": "@rxap/generator-utilities",
54
+ "version": "1.0.1-dev.2"
55
+ },
56
+ {
57
+ "package": "@rxap/schematics-ts-morph",
58
+ "version": "16.0.0-dev.5"
59
+ },
60
+ {
61
+ "package": "@rxap/workspace-ts-morph",
62
+ "version": "0.0.2-dev.0"
63
+ },
64
+ {
65
+ "package": "@rxap/workspace-utilities",
66
+ "version": "0.1.0-dev.0"
67
+ }
68
+ ]
69
+ },
70
+ "gitHead": "ed3a0788894aa734ec2a8e9e957cf73cabe033d6",
71
+ "main": "./src/index.js",
72
+ "types": "./src/index.d.ts"
73
+ }
@@ -0,0 +1,4 @@
1
+ import { Tree } from '@nx/devkit';
2
+ import { FixSchematicGeneratorSchema } from './schema';
3
+ export declare function fixSchematicGenerator(tree: Tree, options: FixSchematicGeneratorSchema): Promise<void>;
4
+ export default fixSchematicGenerator;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fixSchematicGenerator = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const generator_utilities_1 = require("@rxap/generator-utilities");
6
+ const path_1 = require("path");
7
+ function fixSchematicGenerator(tree, options) {
8
+ var _a, _b;
9
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
+ const projectRoot = (0, generator_utilities_1.GetProjectRoot)(tree, options.project);
11
+ const schematicsSourceRoot = (0, path_1.join)((0, generator_utilities_1.GetProjectSourceRoot)(tree, options.project), 'schematics');
12
+ if (!tree.exists(schematicsSourceRoot)) {
13
+ console.warn(`The schematics source root ${schematicsSourceRoot} does not exists!`);
14
+ return;
15
+ }
16
+ const packageJson = JSON.parse(tree.read((0, path_1.join)(projectRoot, 'package.json')).toString('utf-8'));
17
+ if (!packageJson.schematics) {
18
+ console.warn(`The package.json file does not contains schematics property!`);
19
+ return;
20
+ }
21
+ const collectionFile = (0, path_1.join)(projectRoot, packageJson.schematics);
22
+ if (!tree.exists(collectionFile)) {
23
+ console.warn(`The collection file ${collectionFile} does not exists!`);
24
+ return;
25
+ }
26
+ const collection = JSON.parse(tree.read(collectionFile).toString('utf-8'));
27
+ (_a = collection.schematics) !== null && _a !== void 0 ? _a : (collection.schematics = {});
28
+ const { schematics } = collection;
29
+ const detectedSchemaJsonFiles = [];
30
+ for (const { path, isFile } of (0, generator_utilities_1.VisitTree)(tree, schematicsSourceRoot)) {
31
+ if (isFile && path.endsWith('schema.json')) {
32
+ detectedSchemaJsonFiles.push('./' + (0, path_1.relative)(projectRoot, path));
33
+ }
34
+ }
35
+ const notDefinedSchematics = detectedSchemaJsonFiles
36
+ .filter(schemaJsonFile => !Object.values(schematics)
37
+ .some((schematic) => schematic.schema === schemaJsonFile));
38
+ console.log(`Not defined schematics: ${notDefinedSchematics.length}`);
39
+ if (notDefinedSchematics.length) {
40
+ console.log(` - ${notDefinedSchematics.join('\n - ')}`);
41
+ }
42
+ else {
43
+ console.log('All schematics are defined');
44
+ }
45
+ for (const schemaJsonFile of notDefinedSchematics) {
46
+ const basePath = (0, path_1.dirname)(schemaJsonFile);
47
+ const schematicName = basePath.split('/').pop();
48
+ if (schematics[schematicName]) {
49
+ console.warn(`The schematic ${schematicName} is already defined!`);
50
+ continue;
51
+ }
52
+ schematics[schematicName] = {
53
+ schema: schemaJsonFile,
54
+ factory: `${basePath}/index`,
55
+ };
56
+ }
57
+ for (const [name, schematic] of Object.entries(schematics)) {
58
+ (_b = schematic['description']) !== null && _b !== void 0 ? _b : (schematic['description'] = `The ${name} schematic`);
59
+ }
60
+ console.log('Update collection file');
61
+ tree.write(collectionFile, JSON.stringify(collection, null, 2));
62
+ });
63
+ }
64
+ exports.fixSchematicGenerator = fixSchematicGenerator;
65
+ exports.default = fixSchematicGenerator;
66
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/generators/fix-schematic/generator.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ export interface FixSchematicGeneratorSchema {
2
+ project: string;
3
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "FixSchematic",
4
+ "title": "",
5
+ "type": "object",
6
+ "properties": {
7
+ "project": {
8
+ "type": "string",
9
+ "description": "The name of the project.",
10
+ "alias": "p",
11
+ "$default": {
12
+ "$source": "projectName"
13
+ },
14
+ "x-prompt": "What is the name of the project for the schematic?",
15
+ "x-priority": "important"
16
+ }
17
+ },
18
+ "required": [
19
+ "project"
20
+ ]
21
+ }
@@ -0,0 +1,4 @@
1
+ import { Tree } from '@nx/devkit';
2
+ import { InitGeneratorSchema } from './schema';
3
+ export declare function initGenerator(tree: Tree, options: InitGeneratorSchema): Promise<void>;
4
+ export default initGenerator;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initGenerator = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ const generator_utilities_1 = require("@rxap/generator-utilities");
7
+ const skip_project_1 = require("../../lib/skip-project");
8
+ const generator_1 = require("../init-application/generator");
9
+ const generator_2 = require("../init-library/generator");
10
+ function skipProject(tree, options, project, projectName) {
11
+ if ((0, skip_project_1.SkipNonAngularProject)(tree, options, project, projectName)) {
12
+ return true;
13
+ }
14
+ return false;
15
+ }
16
+ function initGenerator(tree, options) {
17
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
18
+ console.log('angular init generator:', options);
19
+ for (const [projectName, project] of (0, devkit_1.getProjects)(tree).entries()) {
20
+ if (skipProject(tree, options, project, projectName)) {
21
+ continue;
22
+ }
23
+ console.log(`init project: ${projectName}`);
24
+ if ((0, generator_utilities_1.HasComponents)(tree, project.root)) {
25
+ yield (0, generator_utilities_1.CoerceCypressComponentTesting)(tree, project, projectName);
26
+ }
27
+ if (project.projectType === 'library') {
28
+ yield (0, generator_2.default)(tree, Object.assign(Object.assign({}, options), { projects: [projectName] }));
29
+ }
30
+ if (project.projectType === 'application') {
31
+ yield (0, generator_1.default)(tree, Object.assign(Object.assign({}, options), { projects: [projectName] }));
32
+ }
33
+ }
34
+ });
35
+ }
36
+ exports.initGenerator = initGenerator;
37
+ exports.default = initGenerator;
38
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/plugin/angular/src/generators/init/generator.ts"],"names":[],"mappings":";;;;AAAA,uCAIoB;AACpB,mEAGmC;AACnC,yDAA+D;AAC/D,6DAAqE;AACrE,yDAA6D;AAG7D,SAAS,WAAW,CAAC,IAAU,EAAE,OAA4B,EAAE,OAA6B,EAAE,WAAmB;IAE/G,IAAI,IAAA,oCAAqB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;QAC9D,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AAEf,CAAC;AAED,SAAsB,aAAa,CAAC,IAAU,EAAE,OAA4B;;QAC1E,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;QAEhD,KAAK,MAAM,CAAE,WAAW,EAAE,OAAO,CAAE,IAAI,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;YAElE,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE;gBACpD,SAAS;aACV;YAED,OAAO,CAAC,GAAG,CAAC,iBAAkB,WAAY,EAAE,CAAC,CAAC;YAE9C,IAAI,IAAA,mCAAa,EAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE;gBACrC,MAAM,IAAA,mDAA6B,EAAC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;aACjE;YAED,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE;gBACrC,MAAM,IAAA,mBAAoB,EAAC,IAAI,kCAAO,OAAO,KAAE,QAAQ,EAAE,CAAE,WAAW,CAAE,IAAG,CAAC;aAC7E;YAED,IAAI,OAAO,CAAC,WAAW,KAAK,aAAa,EAAE;gBACzC,MAAM,IAAA,mBAAwB,EAAC,IAAI,kCAAO,OAAO,KAAE,QAAQ,EAAE,CAAE,WAAW,CAAE,IAAG,CAAC;aACjF;SAEF;IAEH,CAAC;CAAA;AAzBD,sCAyBC;AAED,kBAAe,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ export interface InitGeneratorSchema {
2
+ projects?: string[];
3
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "Init",
4
+ "title": "",
5
+ "type": "object",
6
+ "properties": {
7
+ "projects": {
8
+ "alias": "project",
9
+ "type": "array",
10
+ "items": {
11
+ "type": "string"
12
+ }
13
+ }
14
+ },
15
+ "required": []
16
+ }
@@ -0,0 +1,5 @@
1
+ FROM nginx:alpine
2
+
3
+ COPY nginx.conf /etc/nginx/nginx.conf
4
+
5
+ COPY . /usr/share/nginx/html
@@ -0,0 +1,74 @@
1
+ user nginx;
2
+ worker_processes auto;
3
+
4
+ error_log /var/log/nginx/error.log notice;
5
+ pid /var/run/nginx.pid;
6
+
7
+ events {
8
+ worker_connections 1024;
9
+ }
10
+
11
+ http {
12
+ include /etc/nginx/mime.types;
13
+ default_type application/octet-stream;
14
+
15
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
16
+ '$status $body_bytes_sent "$http_referer" '
17
+ '"$http_user_agent" "$http_x_forwarded_for"';
18
+
19
+ access_log /var/log/nginx/access.log main;
20
+
21
+ sendfile on;
22
+ tcp_nopush on;
23
+
24
+ keepalive_timeout 65;
25
+
26
+ gzip on;
27
+ gzip_types text/plain text/html text/css image/jpeg application/javascript image/png image/svg+xml font/woff font/woff2 application/json;
28
+
29
+ map $http_accept_language $accept_language {
30
+ default en;
31
+ }
32
+
33
+ server {
34
+
35
+ listen 80 default_server;
36
+ listen [::]:80 default_server;
37
+ server_name _;
38
+
39
+ root /usr/share/nginx/html;
40
+
41
+ index index.html;
42
+
43
+ location ~* .(js|css)$ {
44
+ expires max;
45
+ log_not_found on;
46
+ access_log off;
47
+ add_header Cache-Control "public";
48
+ }
49
+
50
+ location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
51
+ expires 1d;
52
+ log_not_found on;
53
+ access_log off;
54
+ add_header Cache-Control "public";
55
+ }
56
+
57
+ location ~* .(json|html|xml)$ {
58
+ expires epoch;
59
+ log_not_found on;
60
+ access_log on;
61
+ add_header Cache-Control "no-cache";
62
+ }
63
+
64
+ location / {
65
+ rewrite ^/(.*)$ https://$host/$accept_language/$1 redirect;
66
+ }
67
+
68
+ location ~ ^/(de|en|pl) {
69
+ try_files $uri $uri/ /$1/index.html?$args;
70
+ }
71
+
72
+ }
73
+
74
+ }
@@ -0,0 +1,40 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset='UTF-8'>
5
+ <title>Multi language redirect</title>
6
+ </head>
7
+ <body>
8
+ <script>
9
+
10
+ const availableLanguages = [
11
+ {{#each availableLanguages}}
12
+ '{{this}}',
13
+ {{/each}}
14
+ ];
15
+ const preferredLanguages = (navigator && navigator.languages) || [];
16
+ let redirectLanguage = '{{defaultLanguage}}';
17
+
18
+ for (const preferredLanguage of preferredLanguages) {
19
+ if (availableLanguages.includes(preferredLanguage)) {
20
+ redirectLanguage = preferredLanguage;
21
+ break;
22
+ }
23
+ }
24
+
25
+ let pathname = location.pathname ?? '';
26
+
27
+ const langRegex = new RegExp(`^\/(${availableLanguages.join('|')})`);
28
+ while (pathname.match(langRegex)) {
29
+ pathname = pathname.replace(langRegex, '');
30
+ }
31
+
32
+ const redirectUrl = location.origin + '/' + redirectLanguage + pathname + (location.search ?? '');
33
+
34
+ alert('redirect to ' + redirectUrl);
35
+
36
+ location.replace(redirectUrl);
37
+
38
+ </script>
39
+ </body>
40
+ </html>
@@ -0,0 +1,62 @@
1
+ {
2
+ "$schema": "../node_modules/@angular/service-worker/config/schema.json",
3
+ "index": "/index.html",
4
+ "assetGroups": [
5
+ {
6
+ "name": "app",
7
+ "installMode": "prefetch",
8
+ "resources": {
9
+ "files": [
10
+ "/index.html",
11
+ "/*.css",
12
+ "/*.js"
13
+ ]
14
+ }
15
+ },
16
+ {
17
+ "name": "assets",
18
+ "installMode": "prefetch",
19
+ "resources": {
20
+ "files": [
21
+ "/assets/**",
22
+ "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
23
+ ]
24
+ }
25
+ }
26
+ ],
27
+ "dataGroups": [
28
+ {
29
+ "name": "config",
30
+ "urls": [
31
+ "/*.json"
32
+ ],
33
+ "cacheConfig": {
34
+ "strategy": "freshness",
35
+ "maxSize": 10,
36
+ "maxAge": "1d",
37
+ "timeout": "30s"
38
+ }
39
+ },
40
+ {
41
+ "name": "api",
42
+ "urls": [
43
+ "/api/**"
44
+ ],
45
+ "cacheConfig": {
46
+ "strategy": "freshness",
47
+ "maxSize": 10,
48
+ "maxAge": "1d",
49
+ "timeout": "60s"
50
+ }
51
+ }
52
+ ],
53
+ "navigationUrls": [
54
+ "/**",
55
+ "!/**/*.*",
56
+ "!/**/*__*",
57
+ "!/**/*__*/**",
58
+ "!/tunnel/**",
59
+ "!/tunnel",
60
+ "!/api/**"
61
+ ]
62
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "/api": {
3
+ "target": "https://127-0-0-1.nip.io:8443",
4
+ "secure": false
5
+ }
6
+ }
@@ -0,0 +1,4 @@
1
+ import { Tree } from '@nx/devkit';
2
+ import { InitApplicationGeneratorSchema } from './schema';
3
+ export declare function initApplicationGenerator(tree: Tree, options: InitApplicationGeneratorSchema): Promise<void>;
4
+ export default initApplicationGenerator;