@rxap/environment 21.0.1 → 22.0.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 (42) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/compodoc/changelog.html +2 -0
  3. package/compodoc/dependencies.html +3 -3
  4. package/compodoc/js/search/search_index.js +2 -2
  5. package/compodoc/properties.html +1 -1
  6. package/docs/documentation.json +69 -69
  7. package/docs/html/classes/EnvironmentComponent.html +2 -2
  8. package/docs/html/functions/DetermineProductionEnvironmentName.html +1 -1
  9. package/docs/html/functions/DetermineReleaseName.html +1 -1
  10. package/docs/html/functions/IsNotReleaseVersion.html +1 -1
  11. package/docs/html/functions/ProvideEnvironment.html +1 -1
  12. package/docs/html/functions/UpdateEnvironment.html +2 -2
  13. package/docs/html/index.html +2 -2
  14. package/docs/html/interfaces/Environment.html +11 -11
  15. package/docs/html/modules.html +1 -1
  16. package/docs/html/types/AnySchema.html +1 -1
  17. package/docs/html/variables/RXAP_ENVIRONMENT.html +1 -1
  18. package/docs/markdown/README.md +1 -1
  19. package/docs/markdown/classes/EnvironmentComponent.md +3 -3
  20. package/docs/markdown/functions/DetermineProductionEnvironmentName.md +2 -2
  21. package/docs/markdown/functions/DetermineReleaseName.md +2 -2
  22. package/docs/markdown/functions/IsNotReleaseVersion.md +2 -2
  23. package/docs/markdown/functions/ProvideEnvironment.md +2 -2
  24. package/docs/markdown/functions/UpdateEnvironment.md +2 -2
  25. package/docs/markdown/globals.md +2 -2
  26. package/docs/markdown/interfaces/Environment.md +18 -18
  27. package/docs/markdown/type-aliases/AnySchema.md +2 -2
  28. package/docs/markdown/variables/RXAP_ENVIRONMENT.md +2 -2
  29. package/docs/wiki/Class.EnvironmentComponent.md +2 -2
  30. package/docs/wiki/Function.DetermineProductionEnvironmentName.md +1 -1
  31. package/docs/wiki/Function.DetermineReleaseName.md +1 -1
  32. package/docs/wiki/Function.IsNotReleaseVersion.md +1 -1
  33. package/docs/wiki/Function.ProvideEnvironment.md +1 -1
  34. package/docs/wiki/Function.UpdateEnvironment.md +1 -1
  35. package/docs/wiki/Interface.Environment.md +17 -17
  36. package/docs/wiki/TypeAlias.AnySchema.md +1 -1
  37. package/docs/wiki/Variable.RXAP_ENVIRONMENT.md +1 -1
  38. package/docs/wiki/globals.md +1 -1
  39. package/fesm2022/rxap-environment.mjs +68 -51
  40. package/fesm2022/rxap-environment.mjs.map +1 -1
  41. package/package.json +6 -6
  42. package/types/rxap-environment.d.ts +92 -100
@@ -1,85 +1,102 @@
1
- import { __decorate } from 'tslib';
2
- import { DatePipe } from '@angular/common';
3
- import * as i0 from '@angular/core';
4
- import { InjectionToken, inject, ChangeDetectionStrategy, Component } from '@angular/core';
5
- const RXAP_ENVIRONMENT = new InjectionToken('rxap-environment');
1
+ import { __decorate } from "tslib";
2
+ import { DatePipe } from "@angular/common";
3
+ import * as i0 from "@angular/core";
4
+ import { ChangeDetectionStrategy, Component, InjectionToken, inject } from "@angular/core";
5
+ const RXAP_ENVIRONMENT = new InjectionToken("rxap-environment");
6
6
  let EnvironmentComponent = class EnvironmentComponent {
7
7
  constructor() {
8
8
  this.environment = inject(RXAP_ENVIRONMENT);
9
9
  }
10
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EnvironmentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
11
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.9", type: EnvironmentComponent, isStandalone: true, selector: "rxap-environment", host: { classAttribute: "rxap-environment" }, ngImport: i0, template: "<div class=\"p-4\">\n <h2 class=\"text-xl font-bold pb-2\">{{ environment.app }}</h2>\n <table class=\"table-auto\">\n @if (environment.name) {\n <tr>\n <th>Environment</th>\n <td>{{environment.name}}</td>\n </tr>\n }\n <tr>\n <th>Production</th>\n <td>{{environment.production}}</td>\n </tr>\n @if (environment.serviceWorker !== undefined) {\n <tr>\n <th>Service Worker</th>\n <td>{{environment.serviceWorker}}</td>\n </tr>\n }\n @if (environment.release) {\n <tr>\n <th>Release</th>\n <td>{{environment.release}}</td>\n </tr>\n }\n @if (environment.commit) {\n <tr>\n <th>Commit</th>\n <td>{{environment.commit}}</td>\n </tr>\n }\n @if (environment.timestamp) {\n <tr>\n <th>Timestamp</th>\n <td>{{environment.timestamp | date:'dd.MM.yy HH:mm:ss'}}</td>\n </tr>\n }\n @if (environment.branch) {\n <tr>\n <th>Branch</th>\n <td>{{environment.branch}}</td>\n </tr>\n }\n @if (environment.tag) {\n <tr>\n <th>Tag</th>\n <td>{{environment.tag}}</td>\n </tr>\n }\n <ng-content></ng-content>\n </table>\n</div>\n", styles: [".collapse-button{background-color:transparent;margin:8px 8px 20px;border:none;cursor:pointer;width:calc(100% - 16px)}table th{text-align:left;padding-right:16px}table th,table td{font-size:75%}\n"], dependencies: [{ kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
10
+ static {
11
+ this.ɵfac = i0.ɵɵngDeclareFactory({
12
+ minVersion: "12.0.0",
13
+ version: "22.3.0",
14
+ ngImport: i0,
15
+ type: EnvironmentComponent,
16
+ deps: [],
17
+ target: i0.ɵɵFactoryTarget.Component
18
+ });
19
+ }
20
+ static {
21
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
22
+ minVersion: "17.0.0",
23
+ version: "22.3.0",
24
+ type: EnvironmentComponent,
25
+ isStandalone: true,
26
+ selector: "rxap-environment",
27
+ host: { classAttribute: "rxap-environment" },
28
+ ngImport: i0,
29
+ template: "<div class=\"p-4\">\n <h2 class=\"text-xl font-bold pb-2\">{{ environment.app }}</h2>\n <table class=\"table-auto\">\n @if (environment.name) {\n <tr>\n <th>Environment</th>\n <td>{{environment.name}}</td>\n </tr>\n }\n <tr>\n <th>Production</th>\n <td>{{environment.production}}</td>\n </tr>\n @if (environment.serviceWorker !== undefined) {\n <tr>\n <th>Service Worker</th>\n <td>{{environment.serviceWorker}}</td>\n </tr>\n }\n @if (environment.release) {\n <tr>\n <th>Release</th>\n <td>{{environment.release}}</td>\n </tr>\n }\n @if (environment.commit) {\n <tr>\n <th>Commit</th>\n <td>{{environment.commit}}</td>\n </tr>\n }\n @if (environment.timestamp) {\n <tr>\n <th>Timestamp</th>\n <td>{{environment.timestamp | date:'dd.MM.yy HH:mm:ss'}}</td>\n </tr>\n }\n @if (environment.branch) {\n <tr>\n <th>Branch</th>\n <td>{{environment.branch}}</td>\n </tr>\n }\n @if (environment.tag) {\n <tr>\n <th>Tag</th>\n <td>{{environment.tag}}</td>\n </tr>\n }\n <ng-content></ng-content>\n </table>\n</div>\n",
30
+ styles: [".collapse-button{background-color:transparent;margin:8px 8px 20px;border:none;cursor:pointer;width:calc(100% - 16px)}table th{text-align:left;padding-right:16px}table th,table td{font-size:75%}\n"],
31
+ dependencies: [{
32
+ kind: "pipe",
33
+ type: DatePipe,
34
+ name: "date"
35
+ }],
36
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
37
+ });
38
+ }
12
39
  };
13
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EnvironmentComponent, decorators: [{
40
+ i0.ɵɵngDeclareClassMetadata({
41
+ minVersion: "12.0.0",
42
+ version: "22.3.0",
43
+ ngImport: i0,
44
+ type: EnvironmentComponent,
45
+ decorators: [{
14
46
  type: Component,
15
- args: [{ selector: 'rxap-environment', changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'rxap-environment' }, imports: [DatePipe], template: "<div class=\"p-4\">\n <h2 class=\"text-xl font-bold pb-2\">{{ environment.app }}</h2>\n <table class=\"table-auto\">\n @if (environment.name) {\n <tr>\n <th>Environment</th>\n <td>{{environment.name}}</td>\n </tr>\n }\n <tr>\n <th>Production</th>\n <td>{{environment.production}}</td>\n </tr>\n @if (environment.serviceWorker !== undefined) {\n <tr>\n <th>Service Worker</th>\n <td>{{environment.serviceWorker}}</td>\n </tr>\n }\n @if (environment.release) {\n <tr>\n <th>Release</th>\n <td>{{environment.release}}</td>\n </tr>\n }\n @if (environment.commit) {\n <tr>\n <th>Commit</th>\n <td>{{environment.commit}}</td>\n </tr>\n }\n @if (environment.timestamp) {\n <tr>\n <th>Timestamp</th>\n <td>{{environment.timestamp | date:'dd.MM.yy HH:mm:ss'}}</td>\n </tr>\n }\n @if (environment.branch) {\n <tr>\n <th>Branch</th>\n <td>{{environment.branch}}</td>\n </tr>\n }\n @if (environment.tag) {\n <tr>\n <th>Tag</th>\n <td>{{environment.tag}}</td>\n </tr>\n }\n <ng-content></ng-content>\n </table>\n</div>\n", styles: [".collapse-button{background-color:transparent;margin:8px 8px 20px;border:none;cursor:pointer;width:calc(100% - 16px)}table th{text-align:left;padding-right:16px}table th,table td{font-size:75%}\n"] }]
16
- }] });
47
+ args: [{
48
+ selector: "rxap-environment",
49
+ changeDetection: ChangeDetectionStrategy.OnPush,
50
+ host: { class: "rxap-environment" },
51
+ imports: [DatePipe],
52
+ template: "<div class=\"p-4\">\n <h2 class=\"text-xl font-bold pb-2\">{{ environment.app }}</h2>\n <table class=\"table-auto\">\n @if (environment.name) {\n <tr>\n <th>Environment</th>\n <td>{{environment.name}}</td>\n </tr>\n }\n <tr>\n <th>Production</th>\n <td>{{environment.production}}</td>\n </tr>\n @if (environment.serviceWorker !== undefined) {\n <tr>\n <th>Service Worker</th>\n <td>{{environment.serviceWorker}}</td>\n </tr>\n }\n @if (environment.release) {\n <tr>\n <th>Release</th>\n <td>{{environment.release}}</td>\n </tr>\n }\n @if (environment.commit) {\n <tr>\n <th>Commit</th>\n <td>{{environment.commit}}</td>\n </tr>\n }\n @if (environment.timestamp) {\n <tr>\n <th>Timestamp</th>\n <td>{{environment.timestamp | date:'dd.MM.yy HH:mm:ss'}}</td>\n </tr>\n }\n @if (environment.branch) {\n <tr>\n <th>Branch</th>\n <td>{{environment.branch}}</td>\n </tr>\n }\n @if (environment.tag) {\n <tr>\n <th>Tag</th>\n <td>{{environment.tag}}</td>\n </tr>\n }\n <ng-content></ng-content>\n </table>\n</div>\n",
53
+ styles: [".collapse-button{background-color:transparent;margin:8px 8px 20px;border:none;cursor:pointer;width:calc(100% - 16px)}table th{text-align:left;padding-right:16px}table th,table td{font-size:75%}\n"]
54
+ }]
55
+ }]
56
+ });
17
57
  function DetermineProductionEnvironmentName(environment) {
18
- if (environment.tier) {
58
+ if (environment.tier)
19
59
  return environment.tier;
20
- }
21
60
  else if (environment.tag) {
22
61
  const tagMatch = environment.tag.match(/^v\d+\.\d+\.\d+(-([^.]+)\.\d+)?$/);
23
- if (!tagMatch) {
24
- return undefined;
25
- }
26
- // if the tage has a chanel/digest use this as environment name
27
- return tagMatch[2] ?? 'production';
62
+ if (!tagMatch)
63
+ return;
64
+ return tagMatch[2] ?? "production";
28
65
  }
29
- else if (environment.branch) {
66
+ else if (environment.branch)
30
67
  return environment.branch;
31
- }
32
- return undefined;
33
68
  }
34
- function DetermineReleaseName(environment, defaultReleaseName = 'local-development') {
35
- if (environment.tag) {
69
+ function DetermineReleaseName(environment, defaultReleaseName = "local-development") {
70
+ if (environment.tag)
36
71
  return environment.tag;
37
- }
38
- else if (environment.branch) {
72
+ else if (environment.branch)
39
73
  return environment.branch;
40
- }
41
74
  return defaultReleaseName;
42
75
  }
43
76
  function IsNotReleaseVersion(environment) {
44
- if (!environment.tag) {
77
+ if (!environment.tag)
45
78
  return true;
46
- }
47
- if (environment.tier !== 'production') {
79
+ if (environment.tier !== "production")
48
80
  return true;
49
- }
50
81
  const tagMatch = environment.tag.match(/^v\d+\.\d+\.\d+(-([^.]+)\.\d+)?$/);
51
- if (!tagMatch) {
82
+ if (!tagMatch)
52
83
  return true;
53
- }
54
- if (tagMatch[2]) {
84
+ if (tagMatch[2])
55
85
  return true;
56
- }
57
86
  return false;
58
87
  }
59
88
  function ProvideEnvironment(environment) {
60
89
  return {
61
90
  provide: RXAP_ENVIRONMENT,
62
- useValue: environment,
91
+ useValue: environment
63
92
  };
64
93
  }
65
- /**
66
- * Loads the build.json and adds all keys to the environment object
67
- */
68
- async function UpdateEnvironment(environment, url = 'build.json') {
69
- await fetch(url)
70
- .then((response) => {
71
- if (!response.ok) {
72
- throw new Error('Could not load build.json');
73
- }
94
+ async function UpdateEnvironment(environment, url = "build.json") {
95
+ await fetch(url).then((response) => {
96
+ if (!response.ok)
97
+ throw new Error("Could not load build.json");
74
98
  return response.json();
75
- })
76
- .then((build) => Object.assign(environment, build))
77
- .catch(error => console.error(error.message));
99
+ }).then((build) => Object.assign(environment, build)).catch((error) => console.error(error.message));
78
100
  console.debug(`environment: '${environment.name}'`, environment);
79
101
  }
80
- // region environment
81
- // endregion
82
- /**
83
- * Generated bundle index. Do not edit.
84
- */
85
102
  export { DetermineProductionEnvironmentName, DetermineReleaseName, EnvironmentComponent, IsNotReleaseVersion, ProvideEnvironment, RXAP_ENVIRONMENT, UpdateEnvironment };
@@ -1 +1 @@
1
- {"version":3,"file":"rxap-environment.mjs","sources":["../../../../../packages/angular/environment/src/lib/environment/tokens.ts","../../../../../packages/angular/environment/src/lib/environment/environment.component.ts","../../../../../packages/angular/environment/src/lib/environment/environment.component.html","../../../../../packages/angular/environment/src/lib/determine-production-environment-name.ts","../../../../../packages/angular/environment/src/lib/determine-release-name.ts","../../../../../packages/angular/environment/src/lib/is-not-release-version.ts","../../../../../packages/angular/environment/src/lib/provide-environment.ts","../../../../../packages/angular/environment/src/lib/update-environment.ts","../../../../../packages/angular/environment/src/index.ts","../../../../../packages/angular/environment/src/rxap-environment.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Environment } from '../environment';\n\nexport const RXAP_ENVIRONMENT = new InjectionToken<Environment>('rxap-environment');\n","import { DatePipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n} from '@angular/core';\nimport { Showcase } from '@ng-prism/core';\nimport { Environment } from '../environment';\nimport { RXAP_ENVIRONMENT } from './tokens';\n\n@Showcase({\n title: 'Environment',\n category: 'Environment',\n description: 'Shows the build information of the running app. The values are read from the `RXAP_ENVIRONMENT` token, which the styleguide host provides with demo data.',\n status: 'stable',\n variants: [\n { name: 'Default' },\n ],\n})\n@Component({\n selector: 'rxap-environment',\n templateUrl: './environment.component.html',\n styleUrls: ['./environment.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n \n host: { class: 'rxap-environment' },\n imports: [DatePipe]\n})\nexport class EnvironmentComponent {\n\n public readonly environment: Environment = inject(RXAP_ENVIRONMENT);\n\n}\n","<div class=\"p-4\">\n <h2 class=\"text-xl font-bold pb-2\">{{ environment.app }}</h2>\n <table class=\"table-auto\">\n @if (environment.name) {\n <tr>\n <th>Environment</th>\n <td>{{environment.name}}</td>\n </tr>\n }\n <tr>\n <th>Production</th>\n <td>{{environment.production}}</td>\n </tr>\n @if (environment.serviceWorker !== undefined) {\n <tr>\n <th>Service Worker</th>\n <td>{{environment.serviceWorker}}</td>\n </tr>\n }\n @if (environment.release) {\n <tr>\n <th>Release</th>\n <td>{{environment.release}}</td>\n </tr>\n }\n @if (environment.commit) {\n <tr>\n <th>Commit</th>\n <td>{{environment.commit}}</td>\n </tr>\n }\n @if (environment.timestamp) {\n <tr>\n <th>Timestamp</th>\n <td>{{environment.timestamp | date:'dd.MM.yy HH:mm:ss'}}</td>\n </tr>\n }\n @if (environment.branch) {\n <tr>\n <th>Branch</th>\n <td>{{environment.branch}}</td>\n </tr>\n }\n @if (environment.tag) {\n <tr>\n <th>Tag</th>\n <td>{{environment.tag}}</td>\n </tr>\n }\n <ng-content></ng-content>\n </table>\n</div>\n","import { Environment } from './environment';\n\nexport function DetermineProductionEnvironmentName(environment: Environment) {\n if (environment.tier) {\n return environment.tier;\n } else if (environment.tag) {\n const tagMatch = environment.tag.match(/^v\\d+\\.\\d+\\.\\d+(-([^.]+)\\.\\d+)?$/);\n if (!tagMatch) {\n return undefined;\n }\n // if the tage has a chanel/digest use this as environment name\n return tagMatch[2] ?? 'production';\n } else if (environment.branch) {\n return environment.branch;\n }\n return undefined;\n}\n","import { Environment } from './environment';\n\nexport function DetermineReleaseName(environment: Environment, defaultReleaseName = 'local-development'): string {\n\n if (environment.tag) {\n return environment.tag;\n } else if (environment.branch) {\n return environment.branch;\n }\n return defaultReleaseName;\n\n}\n","import { Environment } from './environment';\n\nexport function IsNotReleaseVersion(environment: Environment): boolean {\n if (!environment.tag) {\n return true;\n }\n if (environment.tier !== 'production') {\n return true;\n }\n const tagMatch = environment.tag.match(/^v\\d+\\.\\d+\\.\\d+(-([^.]+)\\.\\d+)?$/);\n if (!tagMatch) {\n return true;\n }\n if (tagMatch[2]) {\n return true;\n }\n return false;\n}\n","import { Environment } from './environment';\nimport { RXAP_ENVIRONMENT } from './environment/tokens';\n\nexport function ProvideEnvironment(environment: Environment) {\n return {\n provide: RXAP_ENVIRONMENT,\n useValue: environment,\n };\n}\n","import { Environment } from './environment';\n\n/**\n * Loads the build.json and adds all keys to the environment object\n */\nexport async function UpdateEnvironment(environment: Environment, url = 'build.json') {\n await fetch(url)\n .then((response) => {\n if (!response.ok) {\n throw new Error('Could not load build.json');\n }\n return response.json();\n })\n .then((build) => Object.assign(environment, build))\n .catch(error => console.error(error.message));\n console.debug(`environment: '${ environment.name }'`, environment);\n}\n","// region environment\nexport * from './lib/environment/environment.component';\nexport * from './lib/environment/tokens';\n// endregion\n\n// region \nexport * from './lib/determine-production-environment-name';\nexport * from './lib/determine-release-name';\nexport * from './lib/environment';\nexport * from './lib/is-not-release-version';\nexport * from './lib/provide-environment';\nexport * from './lib/update-environment';\n// endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAGa,gBAAgB,GAAG,IAAI,cAAc,CAAc,kBAAkB;;ACyB3E,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB,CAAA;AAA1B,IAAA,WAAA,GAAA;AAEW,QAAA,IAAA,CAAA,WAAW,GAAgB,MAAM,CAAC,gBAAgB,CAAC;AAEpE,IAAA;8GAJY,oBAAoB,EA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,CAAC,GAAG;AACZ,SAAA,IAAI,CAAC,CAAC,QAAQ,KAAI;AACjB,QAAA,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;AAChB,YAAA,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC;QAC9C;AACA,QAAA,OAAO,QAAQ,CAAC,IAAI,EAAE;AACxB,IAAA,CAAC;AACA,SAAA,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC;AACjD,SAAA,KAAK,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/C,OAAO,CAAC,KAAK,CAAC,CAAA,cAAA,EAAkB,WAAW,CAAC,IAAK,CAAA,CAAA,CAAG,EAAE,WAAW,CAAC;AACpE;;AChBA;AAYA;;ACZA;;AAEG;;;;"}
1
+ {"version":3,"file":"rxap-environment.mjs","names":[],"sources":["../../../../../packages/angular/environment/src/lib/environment/tokens.ts","../../../../../packages/angular/environment/src/lib/environment/environment.component.ts","../../../../../packages/angular/environment/src/lib/environment/environment.component.html","../../../../../packages/angular/environment/src/lib/determine-production-environment-name.ts","../../../../../packages/angular/environment/src/lib/determine-release-name.ts","../../../../../packages/angular/environment/src/lib/is-not-release-version.ts","../../../../../packages/angular/environment/src/lib/provide-environment.ts","../../../../../packages/angular/environment/src/lib/update-environment.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { Environment } from '../environment';\n\nexport const RXAP_ENVIRONMENT = new InjectionToken<Environment>('rxap-environment');\n","import { DatePipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n} from '@angular/core';\nimport { Showcase } from '@ng-prism/core';\nimport { Environment } from '../environment';\nimport { RXAP_ENVIRONMENT } from './tokens';\n\n@Showcase({\n title: 'Environment',\n category: 'Environment',\n description: 'Shows the build information of the running app. The values are read from the `RXAP_ENVIRONMENT` token, which the styleguide host provides with demo data.',\n status: 'stable',\n variants: [\n { name: 'Default' },\n ],\n})\n@Component({\n selector: 'rxap-environment',\n templateUrl: './environment.component.html',\n styleUrls: ['./environment.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n \n host: { class: 'rxap-environment' },\n imports: [DatePipe]\n})\nexport class EnvironmentComponent {\n\n public readonly environment: Environment = inject(RXAP_ENVIRONMENT);\n\n}\n","<div class=\"p-4\">\n <h2 class=\"text-xl font-bold pb-2\">{{ environment.app }}</h2>\n <table class=\"table-auto\">\n @if (environment.name) {\n <tr>\n <th>Environment</th>\n <td>{{environment.name}}</td>\n </tr>\n }\n <tr>\n <th>Production</th>\n <td>{{environment.production}}</td>\n </tr>\n @if (environment.serviceWorker !== undefined) {\n <tr>\n <th>Service Worker</th>\n <td>{{environment.serviceWorker}}</td>\n </tr>\n }\n @if (environment.release) {\n <tr>\n <th>Release</th>\n <td>{{environment.release}}</td>\n </tr>\n }\n @if (environment.commit) {\n <tr>\n <th>Commit</th>\n <td>{{environment.commit}}</td>\n </tr>\n }\n @if (environment.timestamp) {\n <tr>\n <th>Timestamp</th>\n <td>{{environment.timestamp | date:'dd.MM.yy HH:mm:ss'}}</td>\n </tr>\n }\n @if (environment.branch) {\n <tr>\n <th>Branch</th>\n <td>{{environment.branch}}</td>\n </tr>\n }\n @if (environment.tag) {\n <tr>\n <th>Tag</th>\n <td>{{environment.tag}}</td>\n </tr>\n }\n <ng-content></ng-content>\n </table>\n</div>\n","import { Environment } from './environment';\n\nexport function DetermineProductionEnvironmentName(environment: Environment) {\n if (environment.tier) {\n return environment.tier;\n } else if (environment.tag) {\n const tagMatch = environment.tag.match(/^v\\d+\\.\\d+\\.\\d+(-([^.]+)\\.\\d+)?$/);\n if (!tagMatch) {\n return undefined;\n }\n // if the tage has a chanel/digest use this as environment name\n return tagMatch[2] ?? 'production';\n } else if (environment.branch) {\n return environment.branch;\n }\n return undefined;\n}\n","import { Environment } from './environment';\n\nexport function DetermineReleaseName(environment: Environment, defaultReleaseName = 'local-development'): string {\n\n if (environment.tag) {\n return environment.tag;\n } else if (environment.branch) {\n return environment.branch;\n }\n return defaultReleaseName;\n\n}\n","import { Environment } from './environment';\n\nexport function IsNotReleaseVersion(environment: Environment): boolean {\n if (!environment.tag) {\n return true;\n }\n if (environment.tier !== 'production') {\n return true;\n }\n const tagMatch = environment.tag.match(/^v\\d+\\.\\d+\\.\\d+(-([^.]+)\\.\\d+)?$/);\n if (!tagMatch) {\n return true;\n }\n if (tagMatch[2]) {\n return true;\n }\n return false;\n}\n","import { Environment } from './environment';\nimport { RXAP_ENVIRONMENT } from './environment/tokens';\n\nexport function ProvideEnvironment(environment: Environment) {\n return {\n provide: RXAP_ENVIRONMENT,\n useValue: environment,\n };\n}\n","import { Environment } from './environment';\n\n/**\n * Loads the build.json and adds all keys to the environment object\n */\nexport async function UpdateEnvironment(environment: Environment, url = 'build.json') {\n await fetch(url)\n .then((response) => {\n if (!response.ok) {\n throw new Error('Could not load build.json');\n }\n return response.json();\n })\n .then((build) => Object.assign(environment, build))\n .catch(error => console.error(error.message));\n console.debug(`environment: '${ environment.name }'`, environment);\n}\n"],"mappings":";;;;;AAGA,MAAa,mBAAmB,IAAI,eAA4B,kBAAkB;ACyB3E,IAAM,uBAAN,MAAM,qBAAoB;CAA1B,cAAA;EAEW,KAAA,cAA2B,OAAO,gBAAgB;CAEnE;CAJY;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAoB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAApB;EAAA,KAAA,OAAA,GAAA,qBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,MAAA;GAAoB,cAAA;GAAA,UAAA;GAAA,MAAA,EAAA,gBAAA,mBAAA;GAAA,UAAA;GAAA,UC5BjC;GAoDA,QAAA,CAAA,qMAAA;GAAA,cAAA,CAAA;IAAA,MAAA;IAAA,MD1Bc;IAAQ,MAAA;GAAA,CA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M,IAAI,MAAM,2BAA2B;EAE7C,OAAO,SAAS,KAAI;CACtB,CAAC,CAAC,CACD,MAAM,UAAU,OAAO,OAAO,aAAa,KAAK,CAAC,CAAC,CAClD,OAAM,UAAS,QAAQ,MAAM,MAAM,OAAO,CAAC;CAC9C,QAAQ,MAAM,iBAAkB,YAAY,KAAK,IAAK,WAAW;AACnE"}
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
- "version": "21.0.1",
2
+ "version": "22.0.0-dev.0",
3
3
  "name": "@rxap/environment",
4
4
  "description": "Provides utilities and components for managing application environments in Angular, including determining environment names, release versions, and providing environment-specific configurations. It offers a component to display environment information and functions to update the environment with build details. The package also includes an init generator for setting up peer dependencies.\n",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "dependencies": {
7
- "@nx/devkit": "22.7.5",
7
+ "@nx/devkit": "24.0.6",
8
8
  "tslib": "2.6.2"
9
9
  },
10
10
  "peerDependencies": {
11
- "@angular/common": "^21.2.9",
12
- "@angular/core": "^21.2.9"
11
+ "@angular/common": "^22.3.0",
12
+ "@angular/core": "^22.3.0"
13
13
  },
14
14
  "author": {
15
15
  "name": "Merzough Münker",
@@ -34,11 +34,11 @@
34
34
  "packageGroup": [
35
35
  {
36
36
  "package": "@angular/common",
37
- "version": "21.2.9"
37
+ "version": "22.3.0"
38
38
  },
39
39
  {
40
40
  "package": "@angular/core",
41
- "version": "21.2.9"
41
+ "version": "22.3.0"
42
42
  }
43
43
  ]
44
44
  },
@@ -1,110 +1,102 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken } from '@angular/core';
3
-
4
- type AnySchema = {
5
- validateAsync: (...args: any[]) => any;
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ import * as i0 from "@angular/core";
5
+ import { InjectionToken } from "@angular/core";
6
+ export type AnySchema = {
7
+ validateAsync: (...args: any[]) => any;
6
8
  };
7
- interface Environment {
8
- /**
9
- * The name of the app
10
- */
11
- app: string;
12
- /**
13
- * The name of the environment
14
- */
9
+ export interface Environment {
10
+ /**
11
+ * The name of the app
12
+ */
13
+ app: string;
14
+ /**
15
+ * The name of the environment
16
+ */
17
+ name?: string;
18
+ /**
19
+ * The app is compiled from code in the production branch
20
+ */
21
+ production: boolean;
22
+ /**
23
+ * Where the service worker is active or not
24
+ */
25
+ serviceWorker?: boolean;
26
+ /**
27
+ * The current app release
28
+ */
29
+ release?: string | null;
30
+ /**
31
+ * The current commit
32
+ */
33
+ commit?: string | null;
34
+ /**
35
+ * The build timestamp
36
+ */
37
+ timestamp?: string | number | null;
38
+ /**
39
+ * The current branch
40
+ */
41
+ branch?: string | null;
42
+ /**
43
+ * The current tag
44
+ */
45
+ tag?: string | null;
46
+ tier?: string;
47
+ slug?: {
15
48
  name?: string;
49
+ };
50
+ moduleFederation?: {
51
+ manifest?: string | Record<string, string>;
52
+ };
53
+ sentry?: {
54
+ enabled?: boolean;
55
+ debug?: boolean;
56
+ dsn?: string;
57
+ integrations?: {
58
+ httpClient?: {
59
+ failedRequestTargets?: Array<string | RegExp>;
60
+ failedRequestStatusCodes?: Array<[number, number] | number>;
61
+ };
62
+ BrowserTracing?: {
63
+ tracePropagationTargets?: string[];
64
+ };
65
+ };
66
+ };
67
+ config?: string | {
68
+ fromUrlParam?: string | boolean;
69
+ fromLocalStorage?: boolean;
70
+ schema?: AnySchema;
71
+ strategy?: string;
72
+ url?: string | string[] | ((environment: Environment) => string | string[]);
16
73
  /**
17
- * The app is compiled from code in the production branch
18
- */
19
- production: boolean;
20
- /**
21
- * Where the service worker is active or not
22
- */
23
- serviceWorker?: boolean;
24
- /**
25
- * The current app release
26
- */
27
- release?: string | null;
28
- /**
29
- * The current commit
30
- */
31
- commit?: string | null;
32
- /**
33
- * The build timestamp
34
- */
35
- timestamp?: string | number | null;
36
- /**
37
- * The current branch
38
- */
39
- branch?: string | null;
40
- /**
41
- * The current tag
74
+ * static config values
42
75
  */
43
- tag?: string | null;
44
- tier?: string;
45
- slug?: {
46
- name?: string;
47
- };
48
- moduleFederation?: {
49
- manifest?: string | Record<string, string>;
50
- };
51
- sentry?: {
52
- enabled?: boolean;
53
- debug?: boolean;
54
- dsn?: string;
55
- integrations?: {
56
- httpClient?: {
57
- failedRequestTargets?: Array<string | RegExp>;
58
- failedRequestStatusCodes?: Array<[number, number] | number>;
59
- };
60
- BrowserTracing?: {
61
- tracePropagationTargets?: string[];
62
- };
63
- };
64
- };
65
- config?: string | {
66
- fromUrlParam?: string | boolean;
67
- fromLocalStorage?: boolean;
68
- schema?: AnySchema;
69
- strategy?: string;
70
- url?: string | string[] | ((environment: Environment) => string | string[]);
71
- /**
72
- * static config values
73
- */
74
- static?: Record<string, any>;
75
- };
76
- origin?: string;
77
- openApi?: {
78
- load?: {
79
- openApiUrl?: string;
80
- } | boolean;
81
- };
82
- [key: string]: any;
76
+ static?: Record<string, any>;
77
+ };
78
+ origin?: string;
79
+ openApi?: {
80
+ load?: {
81
+ openApiUrl?: string;
82
+ } | boolean;
83
+ };
84
+ [key: string]: any;
83
85
  }
84
-
85
- declare class EnvironmentComponent {
86
- readonly environment: Environment;
87
- static ɵfac: i0.ɵɵFactoryDeclaration<EnvironmentComponent, never>;
88
- static ɵcmp: i0.ɵɵComponentDeclaration<EnvironmentComponent, "rxap-environment", never, {}, {}, never, ["*"], true, never>;
86
+ export declare class EnvironmentComponent {
87
+ readonly environment: Environment;
88
+ static ɵfac: i0.ɵɵFactoryDeclaration<EnvironmentComponent, never>;
89
+ static ɵcmp: i0.ɵɵComponentDeclaration<EnvironmentComponent, "rxap-environment", never, {}, {}, never, ["*"], true, never>;
89
90
  }
90
-
91
- declare const RXAP_ENVIRONMENT: InjectionToken<Environment>;
92
-
93
- declare function DetermineProductionEnvironmentName(environment: Environment): string | undefined;
94
-
95
- declare function DetermineReleaseName(environment: Environment, defaultReleaseName?: string): string;
96
-
97
- declare function IsNotReleaseVersion(environment: Environment): boolean;
98
-
99
- declare function ProvideEnvironment(environment: Environment): {
100
- provide: i0.InjectionToken<Environment>;
101
- useValue: Environment;
91
+ export declare const RXAP_ENVIRONMENT: InjectionToken<Environment>;
92
+ export declare function DetermineProductionEnvironmentName(environment: Environment): string | undefined;
93
+ export declare function DetermineReleaseName(environment: Environment, defaultReleaseName?: string): string;
94
+ export declare function IsNotReleaseVersion(environment: Environment): boolean;
95
+ export declare function ProvideEnvironment(environment: Environment): {
96
+ provide: import("@angular/core").InjectionToken<Environment>;
97
+ useValue: Environment;
102
98
  };
103
-
104
99
  /**
105
100
  * Loads the build.json and adds all keys to the environment object
106
101
  */
107
- declare function UpdateEnvironment(environment: Environment, url?: string): Promise<void>;
108
-
109
- export { DetermineProductionEnvironmentName, DetermineReleaseName, EnvironmentComponent, IsNotReleaseVersion, ProvideEnvironment, RXAP_ENVIRONMENT, UpdateEnvironment };
110
- export type { AnySchema, Environment };
102
+ export declare function UpdateEnvironment(environment: Environment, url?: string): Promise<void>;