@rxap/environment 22.0.0-dev.0 → 22.0.0-dev.2

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 (96) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +5 -3
  3. package/compodoc/architecture.html +222 -0
  4. package/compodoc/changelog.html +66 -5
  5. package/compodoc/components/EnvironmentComponent.html +87 -22
  6. package/compodoc/dependencies.html +84 -15
  7. package/compodoc/index.html +50 -8
  8. package/compodoc/interfaces/Environment.html +860 -671
  9. package/compodoc/js/architecture-graph.js +288 -0
  10. package/compodoc/js/libs/bootstrap-native.js +4 -2
  11. package/compodoc/js/libs/jszip.min.js +13 -0
  12. package/compodoc/js/libs/svg-pan-zoom.min.js +3 -3
  13. package/compodoc/js/libs/tablesort.min.js +3 -3
  14. package/compodoc/js/libs/tablesort.number.min.js +3 -3
  15. package/compodoc/js/libs/vis-network.min.js +78 -0
  16. package/compodoc/js/menu-wc.js +25 -12
  17. package/compodoc/js/menu.js +10 -11
  18. package/compodoc/js/routes/routes_index.js +1 -0
  19. package/compodoc/js/routes.js +142 -34
  20. package/compodoc/js/search/search-lunr.js +6 -8
  21. package/compodoc/js/search/search.js +118 -66
  22. package/compodoc/js/search/search_index.js +2 -2
  23. package/compodoc/js/tabs.js +98 -15
  24. package/compodoc/js/tree.js +44 -7
  25. package/compodoc/license.html +48 -6
  26. package/compodoc/llms.txt +68 -0
  27. package/compodoc/miscellaneous/functions.html +144 -16
  28. package/compodoc/miscellaneous/typealiases.html +47 -5
  29. package/compodoc/miscellaneous/variables.html +58 -5
  30. package/compodoc/modules.html +44 -3
  31. package/compodoc/overview.html +54 -3
  32. package/compodoc/properties.html +45 -4
  33. package/compodoc/routes.html +227 -0
  34. package/compodoc/styles/compodoc.css +365 -44
  35. package/compodoc/styles/dark.css +16 -0
  36. package/compodoc/template-playground/default-templates.json +192 -0
  37. package/compodoc/template-playground/hbs-render.service.ts +217 -0
  38. package/compodoc/template-playground/main.ts +9 -0
  39. package/compodoc/template-playground/template-editor.service.ts +173 -0
  40. package/compodoc/template-playground/template-playground.component.ts +614 -0
  41. package/compodoc/template-playground/template-playground.module.ts +29 -0
  42. package/compodoc/template-playground/zip-export.service.ts +86 -0
  43. package/compodoc/template-playground-app/app.js +1389 -0
  44. package/compodoc/template-playground-app/index.html +462 -0
  45. package/docs/documentation.json +334 -347
  46. package/docs/html/assets/highlight.css +1 -1
  47. package/docs/html/assets/icons.js +1 -1
  48. package/docs/html/assets/icons.svg +1 -1
  49. package/docs/html/assets/main.js +5 -5
  50. package/docs/html/assets/search.js +1 -1
  51. package/docs/html/assets/style.css +265 -228
  52. package/docs/html/classes/EnvironmentComponent.html +70 -3
  53. package/docs/html/functions/DetermineProductionEnvironmentName.html +42 -1
  54. package/docs/html/functions/DetermineReleaseName.html +43 -1
  55. package/docs/html/functions/IsNotReleaseVersion.html +42 -1
  56. package/docs/html/functions/ProvideEnvironment.html +42 -1
  57. package/docs/html/functions/UpdateEnvironment.html +45 -2
  58. package/docs/html/hierarchy.html +29 -0
  59. package/docs/html/index.html +44 -7
  60. package/docs/html/interfaces/Environment.html +188 -27
  61. package/docs/html/modules.html +52 -1
  62. package/docs/html/types/AnySchema.html +55 -1
  63. package/docs/html/variables/RXAP_ENVIRONMENT.html +33 -1
  64. package/docs/markdown/README.md +6 -4
  65. package/docs/markdown/classes/EnvironmentComponent.md +6 -6
  66. package/docs/markdown/functions/DetermineProductionEnvironmentName.md +4 -4
  67. package/docs/markdown/functions/DetermineReleaseName.md +4 -4
  68. package/docs/markdown/functions/IsNotReleaseVersion.md +2 -2
  69. package/docs/markdown/functions/ProvideEnvironment.md +2 -2
  70. package/docs/markdown/functions/UpdateEnvironment.md +4 -4
  71. package/docs/markdown/globals.md +2 -2
  72. package/docs/markdown/interfaces/Environment.md +63 -59
  73. package/docs/markdown/type-aliases/AnySchema.md +7 -5
  74. package/docs/markdown/variables/RXAP_ENVIRONMENT.md +2 -2
  75. package/docs/wiki/Class.EnvironmentComponent.md +5 -5
  76. package/docs/wiki/Function.DetermineProductionEnvironmentName.md +3 -3
  77. package/docs/wiki/Function.DetermineReleaseName.md +3 -3
  78. package/docs/wiki/Function.IsNotReleaseVersion.md +1 -1
  79. package/docs/wiki/Function.ProvideEnvironment.md +1 -1
  80. package/docs/wiki/Function.UpdateEnvironment.md +3 -3
  81. package/docs/wiki/Home.md +5 -3
  82. package/docs/wiki/Interface.Environment.md +62 -58
  83. package/docs/wiki/TypeAlias.AnySchema.md +6 -4
  84. package/docs/wiki/Variable.RXAP_ENVIRONMENT.md +1 -1
  85. package/docs/wiki/globals.md +1 -1
  86. package/generators.json +16 -0
  87. package/package.json +7 -9
  88. package/src/generators/init/generator.js +120 -0
  89. package/src/generators/init/index.js +6 -0
  90. package/src/generators/init/schema.json +8 -0
  91. package/src/generators/package.json +3 -0
  92. package/compodoc/js/libs/vis.min.js +0 -47
  93. package/compodoc/js/menu-wc_es5.js +0 -40
  94. package/compodoc/modules/EnvironmentComponentModule/dependencies.svg +0 -66
  95. package/compodoc/modules/EnvironmentComponentModule.html +0 -426
  96. package/theme.css +0 -1
@@ -2,11 +2,11 @@
2
2
 
3
3
  # Interface: Environment
4
4
 
5
- Defined in: [environment.ts:3](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L3)
5
+ Defined in: [environment.ts:3](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L3)
6
6
 
7
7
  ## Indexable
8
8
 
9
- \[`key`: `string`\]: `any`
9
+ > \[`key`: `string`\]: `any`
10
10
 
11
11
  ## Properties
12
12
 
@@ -14,7 +14,7 @@ Defined in: [environment.ts:3](https://gitlab.com/rxap/packages/-/blob/c8145693a
14
14
 
15
15
  > **app**: `string`
16
16
 
17
- Defined in: [environment.ts:7](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L7)
17
+ Defined in: [environment.ts:7](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L7)
18
18
 
19
19
  The name of the app
20
20
 
@@ -22,9 +22,9 @@ The name of the app
22
22
 
23
23
  ### branch?
24
24
 
25
- > `optional` **branch**: `null` \| `string`
25
+ > `optional` **branch?**: `string` \| `null`
26
26
 
27
- Defined in: [environment.ts:35](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L35)
27
+ Defined in: [environment.ts:35](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L35)
28
28
 
29
29
  The current branch
30
30
 
@@ -32,9 +32,9 @@ The current branch
32
32
 
33
33
  ### commit?
34
34
 
35
- > `optional` **commit**: `null` \| `string`
35
+ > `optional` **commit?**: `string` \| `null`
36
36
 
37
- Defined in: [environment.ts:27](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L27)
37
+ Defined in: [environment.ts:27](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L27)
38
38
 
39
39
  The current commit
40
40
 
@@ -42,61 +42,65 @@ The current commit
42
42
 
43
43
  ### config?
44
44
 
45
- > `optional` **config**: `string` \| \{ `fromLocalStorage`: `boolean`; `fromUrlParam`: `string` \| `boolean`; `schema`: [`AnySchema`](../wiki/TypeAlias.AnySchema); `static`: `Record`\<`string`, `any`\>; `strategy`: `string`; `url`: `string` \| `string`[] \| (`environment`) => `string` \| `string`[]; \}
45
+ > `optional` **config?**: `string` \| \{ `fromLocalStorage?`: `boolean`; `fromUrlParam?`: `string` \| `boolean`; `schema?`: [`AnySchema`](../wiki/TypeAlias.AnySchema); `static?`: `Record`\<`string`, `any`\>; `strategy?`: `string`; `url?`: `string` \| `string`[] \| ((`environment`) => `string` \| `string`[]); \}
46
46
 
47
- Defined in: [environment.ts:66](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L66)
47
+ Defined in: [environment.ts:66](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L66)
48
48
 
49
- #### Type declaration
49
+ #### Union Members
50
50
 
51
51
  `string`
52
52
 
53
- \{ `fromLocalStorage`: `boolean`; `fromUrlParam`: `string` \| `boolean`; `schema`: [`AnySchema`](../wiki/TypeAlias.AnySchema); `static`: `Record`\<`string`, `any`\>; `strategy`: `string`; `url`: `string` \| `string`[] \| (`environment`) => `string` \| `string`[]; \}
53
+ ***
54
+
55
+ ##### Type Literal
56
+
57
+ \{ `fromLocalStorage?`: `boolean`; `fromUrlParam?`: `string` \| `boolean`; `schema?`: [`AnySchema`](../wiki/TypeAlias.AnySchema); `static?`: `Record`\<`string`, `any`\>; `strategy?`: `string`; `url?`: `string` \| `string`[] \| ((`environment`) => `string` \| `string`[]); \}
54
58
 
55
- #### fromLocalStorage?
59
+ ##### fromLocalStorage?
56
60
 
57
- > `optional` **fromLocalStorage**: `boolean`
61
+ > `optional` **fromLocalStorage?**: `boolean`
58
62
 
59
- #### fromUrlParam?
63
+ ##### fromUrlParam?
60
64
 
61
- > `optional` **fromUrlParam**: `string` \| `boolean`
65
+ > `optional` **fromUrlParam?**: `string` \| `boolean`
62
66
 
63
- #### schema?
67
+ ##### schema?
64
68
 
65
- > `optional` **schema**: [`AnySchema`](../wiki/TypeAlias.AnySchema)
69
+ > `optional` **schema?**: [`AnySchema`](../wiki/TypeAlias.AnySchema)
66
70
 
67
- #### static?
71
+ ##### static?
68
72
 
69
- > `optional` **static**: `Record`\<`string`, `any`\>
73
+ > `optional` **static?**: `Record`\<`string`, `any`\>
70
74
 
71
75
  static config values
72
76
 
73
- #### strategy?
77
+ ##### strategy?
74
78
 
75
- > `optional` **strategy**: `string`
79
+ > `optional` **strategy?**: `string`
76
80
 
77
- #### url?
81
+ ##### url?
78
82
 
79
- > `optional` **url**: `string` \| `string`[] \| (`environment`) => `string` \| `string`[]
83
+ > `optional` **url?**: `string` \| `string`[] \| ((`environment`) => `string` \| `string`[])
80
84
 
81
85
  ***
82
86
 
83
87
  ### moduleFederation?
84
88
 
85
- > `optional` **moduleFederation**: `object`
89
+ > `optional` **moduleFederation?**: `object`
86
90
 
87
- Defined in: [environment.ts:47](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L47)
91
+ Defined in: [environment.ts:47](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L47)
88
92
 
89
93
  #### manifest?
90
94
 
91
- > `optional` **manifest**: `string` \| `Record`\<`string`, `string`\>
95
+ > `optional` **manifest?**: `string` \| `Record`\<`string`, `string`\>
92
96
 
93
97
  ***
94
98
 
95
99
  ### name?
96
100
 
97
- > `optional` **name**: `string`
101
+ > `optional` **name?**: `string`
98
102
 
99
- Defined in: [environment.ts:11](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L11)
103
+ Defined in: [environment.ts:11](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L11)
100
104
 
101
105
  The name of the environment
102
106
 
@@ -104,21 +108,21 @@ The name of the environment
104
108
 
105
109
  ### openApi?
106
110
 
107
- > `optional` **openApi**: `object`
111
+ > `optional` **openApi?**: `object`
108
112
 
109
- Defined in: [environment.ts:80](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L80)
113
+ Defined in: [environment.ts:80](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L80)
110
114
 
111
115
  #### load?
112
116
 
113
- > `optional` **load**: `boolean` \| \{ `openApiUrl`: `string`; \}
117
+ > `optional` **load?**: `boolean` \| \{ `openApiUrl?`: `string`; \}
114
118
 
115
119
  ***
116
120
 
117
121
  ### origin?
118
122
 
119
- > `optional` **origin**: `string`
123
+ > `optional` **origin?**: `string`
120
124
 
121
- Defined in: [environment.ts:78](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L78)
125
+ Defined in: [environment.ts:78](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L78)
122
126
 
123
127
  ***
124
128
 
@@ -126,7 +130,7 @@ Defined in: [environment.ts:78](https://gitlab.com/rxap/packages/-/blob/c8145693
126
130
 
127
131
  > **production**: `boolean`
128
132
 
129
- Defined in: [environment.ts:15](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L15)
133
+ Defined in: [environment.ts:15](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L15)
130
134
 
131
135
  The app is compiled from code in the production branch
132
136
 
@@ -134,9 +138,9 @@ The app is compiled from code in the production branch
134
138
 
135
139
  ### release?
136
140
 
137
- > `optional` **release**: `null` \| `string`
141
+ > `optional` **release?**: `string` \| `null`
138
142
 
139
- Defined in: [environment.ts:23](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L23)
143
+ Defined in: [environment.ts:23](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L23)
140
144
 
141
145
  The current app release
142
146
 
@@ -144,53 +148,53 @@ The current app release
144
148
 
145
149
  ### sentry?
146
150
 
147
- > `optional` **sentry**: `object`
151
+ > `optional` **sentry?**: `object`
148
152
 
149
- Defined in: [environment.ts:51](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L51)
153
+ Defined in: [environment.ts:51](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L51)
150
154
 
151
155
  #### debug?
152
156
 
153
- > `optional` **debug**: `boolean`
157
+ > `optional` **debug?**: `boolean`
154
158
 
155
159
  #### dsn?
156
160
 
157
- > `optional` **dsn**: `string`
161
+ > `optional` **dsn?**: `string`
158
162
 
159
163
  #### enabled?
160
164
 
161
- > `optional` **enabled**: `boolean`
165
+ > `optional` **enabled?**: `boolean`
162
166
 
163
167
  #### integrations?
164
168
 
165
- > `optional` **integrations**: `object`
169
+ > `optional` **integrations?**: `object`
166
170
 
167
171
  ##### integrations.BrowserTracing?
168
172
 
169
- > `optional` **BrowserTracing**: `object`
173
+ > `optional` **BrowserTracing?**: `object`
170
174
 
171
175
  ##### integrations.BrowserTracing.tracePropagationTargets?
172
176
 
173
- > `optional` **tracePropagationTargets**: `string`[]
177
+ > `optional` **tracePropagationTargets?**: `string`[]
174
178
 
175
179
  ##### integrations.httpClient?
176
180
 
177
- > `optional` **httpClient**: `object`
181
+ > `optional` **httpClient?**: `object`
178
182
 
179
183
  ##### integrations.httpClient.failedRequestStatusCodes?
180
184
 
181
- > `optional` **failedRequestStatusCodes**: (`number` \| \[`number`, `number`\])[]
185
+ > `optional` **failedRequestStatusCodes?**: (`number` \| \[`number`, `number`\])[]
182
186
 
183
187
  ##### integrations.httpClient.failedRequestTargets?
184
188
 
185
- > `optional` **failedRequestTargets**: (`string` \| `RegExp`)[]
189
+ > `optional` **failedRequestTargets?**: (`string` \| `RegExp`)[]
186
190
 
187
191
  ***
188
192
 
189
193
  ### serviceWorker?
190
194
 
191
- > `optional` **serviceWorker**: `boolean`
195
+ > `optional` **serviceWorker?**: `boolean`
192
196
 
193
- Defined in: [environment.ts:19](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L19)
197
+ Defined in: [environment.ts:19](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L19)
194
198
 
195
199
  Where the service worker is active or not
196
200
 
@@ -198,21 +202,21 @@ Where the service worker is active or not
198
202
 
199
203
  ### slug?
200
204
 
201
- > `optional` **slug**: `object`
205
+ > `optional` **slug?**: `object`
202
206
 
203
- Defined in: [environment.ts:43](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L43)
207
+ Defined in: [environment.ts:43](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L43)
204
208
 
205
209
  #### name?
206
210
 
207
- > `optional` **name**: `string`
211
+ > `optional` **name?**: `string`
208
212
 
209
213
  ***
210
214
 
211
215
  ### tag?
212
216
 
213
- > `optional` **tag**: `null` \| `string`
217
+ > `optional` **tag?**: `string` \| `null`
214
218
 
215
- Defined in: [environment.ts:39](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L39)
219
+ Defined in: [environment.ts:39](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L39)
216
220
 
217
221
  The current tag
218
222
 
@@ -220,16 +224,16 @@ The current tag
220
224
 
221
225
  ### tier?
222
226
 
223
- > `optional` **tier**: `string`
227
+ > `optional` **tier?**: `string`
224
228
 
225
- Defined in: [environment.ts:41](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L41)
229
+ Defined in: [environment.ts:41](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L41)
226
230
 
227
231
  ***
228
232
 
229
233
  ### timestamp?
230
234
 
231
- > `optional` **timestamp**: `null` \| `string` \| `number`
235
+ > `optional` **timestamp?**: `string` \| `number` \| `null`
232
236
 
233
- Defined in: [environment.ts:31](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L31)
237
+ Defined in: [environment.ts:31](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L31)
234
238
 
235
239
  The build timestamp
@@ -2,16 +2,18 @@
2
2
 
3
3
  # Type Alias: AnySchema
4
4
 
5
- > **AnySchema**: `object`
5
+ > **AnySchema** = `object`
6
6
 
7
- Defined in: [environment.ts:1](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment.ts#L1)
7
+ Defined in: [environment.ts:1](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L1)
8
8
 
9
- ## Type declaration
9
+ ## Properties
10
10
 
11
- ### validateAsync()
11
+ ### validateAsync
12
12
 
13
13
  > **validateAsync**: (...`args`) => `any`
14
14
 
15
+ Defined in: [environment.ts:1](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment.ts#L1)
16
+
15
17
  #### Parameters
16
18
 
17
19
  ##### args
@@ -4,4 +4,4 @@
4
4
 
5
5
  > `const` **RXAP\_ENVIRONMENT**: `InjectionToken`\<[`Environment`](../wiki/Interface.Environment)\>
6
6
 
7
- Defined in: [environment/tokens.ts:4](https://gitlab.com/rxap/packages/-/blob/c8145693a1e685c856c9997ae6c17bbf32838e79/packages/angular/environment/src/lib/environment/tokens.ts#L4)
7
+ Defined in: [environment/tokens.ts:4](https://gitlab.com/rxap/packages/-/blob/73459044d95e79d1cc84f9d21f658812d63c3185/packages/angular/environment/src/lib/environment/tokens.ts#L4)
@@ -1,4 +1,4 @@
1
- # @rxap/environment v22.0.0-dev.0
1
+ # @rxap/environment v22.0.0-dev.2
2
2
 
3
3
  ## Classes
4
4
 
@@ -0,0 +1,16 @@
1
+ {
2
+ "generators": {
3
+ "init": {
4
+ "factory": "./src/generators/init/generator",
5
+ "schema": "./src/generators/init/schema.json",
6
+ "description": "Initialize the package in the workspace"
7
+ }
8
+ },
9
+ "schematics": {
10
+ "init": {
11
+ "factory": "./src/generators/init/index",
12
+ "schema": "./src/generators/init/schema.json",
13
+ "description": "Initialize the package in the workspace"
14
+ }
15
+ }
16
+ }
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
- "version": "22.0.0-dev.0",
2
+ "version": "22.0.0-dev.2",
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
7
  "@nx/devkit": "24.0.6",
8
- "tslib": "2.6.2"
8
+ "tslib": "2.9.1"
9
9
  },
10
10
  "peerDependencies": {
11
- "@angular/common": "^22.3.0",
12
- "@angular/core": "^22.3.0"
11
+ "@angular/common": "^22.0.0",
12
+ "@angular/core": "^22.0.0"
13
13
  },
14
14
  "author": {
15
15
  "name": "Merzough Münker",
@@ -43,8 +43,7 @@
43
43
  ]
44
44
  },
45
45
  "publishConfig": {
46
- "access": "public",
47
- "directory": "../../../dist/packages/angular/environment"
46
+ "access": "public"
48
47
  },
49
48
  "repository": {
50
49
  "type": "git",
@@ -62,8 +61,7 @@
62
61
  ".": {
63
62
  "types": "./types/rxap-environment.d.ts",
64
63
  "default": "./fesm2022/rxap-environment.mjs"
65
- },
66
- "./theme": "./theme.css"
64
+ }
67
65
  },
68
66
  "type": "module"
69
- }
67
+ }
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initGenerator = initGenerator;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const fs_1 = require("fs");
6
+ const path_1 = require("path");
7
+ /**
8
+ * Resolves the directory of a package installed in the workspace. The lookup starts at the
9
+ * workspace root, not at this package: with an isolated node_modules layout (pnpm) or Yarn PnP
10
+ * the peer is not resolvable from here. The plain node_modules path is the fallback for packages
11
+ * whose `exports` map hides their package.json.
12
+ */
13
+ function resolvePackageDir(root, packageName) {
14
+ try {
15
+ return (0, path_1.dirname)(require.resolve(`${packageName}/package.json`, { paths: [root] }));
16
+ }
17
+ catch {
18
+ return (0, path_1.join)(root, 'node_modules', ...packageName.split('/'));
19
+ }
20
+ }
21
+ async function initGenerator(tree, options) {
22
+ // The package's own package.json lives on disk next to the compiled generator
23
+ // (inside node_modules when installed), which the virtual Tree does not track.
24
+ // Read it directly from the physical filesystem.
25
+ const packageJsonFilePath = (0, path_1.join)(__dirname, '..', '..', '..', 'package.json');
26
+ if (!(0, fs_1.existsSync)(packageJsonFilePath)) {
27
+ console.error('package.json not found in: ' + packageJsonFilePath);
28
+ return;
29
+ }
30
+ const { peerDependencies, name: packageName } = JSON.parse((0, fs_1.readFileSync)(packageJsonFilePath, 'utf-8'));
31
+ console.log(`Coerce peer dependencies for package: ${packageName}`);
32
+ if (!peerDependencies || !Object.keys(peerDependencies).length) {
33
+ console.log('No peer dependencies found');
34
+ return;
35
+ }
36
+ console.log(`Peer dependencies: ${Object.keys(peerDependencies).join(', ')}`);
37
+ const rootPackageJson = JSON.parse(tree.read('package.json', 'utf-8'));
38
+ let isDevDependency = !!rootPackageJson.devDependencies?.[packageName];
39
+ if (isDevDependency &&
40
+ [/^@rxap\/ngx/, /^@rxap\/nest/].some((rx) => rx.test(packageName))) {
41
+ rootPackageJson.dependencies ??= {};
42
+ rootPackageJson.dependencies[packageName] =
43
+ rootPackageJson.devDependencies[packageName];
44
+ delete rootPackageJson.devDependencies[packageName];
45
+ isDevDependency = false;
46
+ tree.write('package.json', JSON.stringify(rootPackageJson, null, 2));
47
+ }
48
+ if (!isDevDependency &&
49
+ [
50
+ /^@rxap\/plugin/,
51
+ /^@rxap\/workspace/,
52
+ /@rxap\/schematic/,
53
+ ].some((rx) => rx.test(packageName))) {
54
+ rootPackageJson.devDependencies ??= {};
55
+ rootPackageJson.devDependencies[packageName] =
56
+ rootPackageJson.dependencies[packageName];
57
+ delete rootPackageJson.dependencies[packageName];
58
+ isDevDependency = true;
59
+ tree.write('package.json', JSON.stringify(rootPackageJson, null, 2));
60
+ }
61
+ const missingPeerDependencies = Object.entries(peerDependencies)
62
+ .filter(([dep]) => !rootPackageJson.dependencies?.[dep] &&
63
+ !rootPackageJson.devDependencies?.[dep])
64
+ .reduce((acc, [dep, version]) => ({ ...acc, [dep]: version }), {});
65
+ if (!Object.keys(missingPeerDependencies).length) {
66
+ console.log('No missing peer dependencies');
67
+ return;
68
+ }
69
+ if (isDevDependency) {
70
+ (0, devkit_1.addDependenciesToPackageJson)(tree, {}, missingPeerDependencies);
71
+ }
72
+ else {
73
+ (0, devkit_1.addDependenciesToPackageJson)(tree, missingPeerDependencies, {});
74
+ }
75
+ await (0, devkit_1.formatFiles)(tree);
76
+ (0, devkit_1.installPackagesTask)(tree);
77
+ for (const peer of Object.keys(missingPeerDependencies)) {
78
+ console.log(`Peer dependency ${peer} added to package.json`);
79
+ // node_modules is physical and excluded from the virtual Tree, so read the
80
+ // peer files from disk.
81
+ const peerPackageDir = resolvePackageDir(tree.root, peer);
82
+ const peerPackageJsonFilePath = (0, path_1.join)(peerPackageDir, 'package.json');
83
+ if (!(0, fs_1.existsSync)(peerPackageJsonFilePath)) {
84
+ console.log(`Peer dependency ${peer} has no package.json`);
85
+ continue;
86
+ }
87
+ const { generators, schematics } = JSON.parse((0, fs_1.readFileSync)(peerPackageJsonFilePath, 'utf-8'));
88
+ if (!generators && !schematics) {
89
+ console.log(`Peer dependency ${peer} has no generators or schematics`);
90
+ continue;
91
+ }
92
+ const configFile = generators || schematics;
93
+ const configFilePath = (0, path_1.join)(peerPackageDir, configFile);
94
+ if (!(0, fs_1.existsSync)(configFilePath)) {
95
+ console.log(`Peer dependency ${peer} has no generators or schematics file`);
96
+ continue;
97
+ }
98
+ const config = JSON.parse((0, fs_1.readFileSync)(configFilePath, 'utf-8'));
99
+ if (!config.generators?.init) {
100
+ console.log(`Peer dependency ${peer} has no init generator`);
101
+ continue;
102
+ }
103
+ const initGeneratorFilePath = config.generators.init.factory;
104
+ const fullInitGeneratorFilePath = (0, path_1.join)(peerPackageDir, initGeneratorFilePath) + '.js';
105
+ if (!(0, fs_1.existsSync)(fullInitGeneratorFilePath)) {
106
+ console.log(`Peer dependency ${peer} has no init generator file: ` +
107
+ fullInitGeneratorFilePath);
108
+ continue;
109
+ }
110
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
111
+ const initGenerator = require((0, path_1.join)(peerPackageDir, initGeneratorFilePath))?.default;
112
+ if (typeof initGenerator !== 'function') {
113
+ console.log(`Peer dependency ${peer} has no init generator function`);
114
+ continue;
115
+ }
116
+ console.log(`Run init generator for peer dependency ${peer}`);
117
+ await initGenerator(tree, options);
118
+ }
119
+ }
120
+ exports.default = initGenerator;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const devkit_1 = require("@nx/devkit");
4
+ const generator_1 = require("./generator");
5
+ const schematic = (0, devkit_1.convertNxGenerator)(generator_1.default);
6
+ exports.default = schematic;
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "Init",
4
+ "title": "",
5
+ "type": "object",
6
+ "properties": {},
7
+ "required": []
8
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }