@powerlines/plugin-env 0.15.136 → 0.15.137
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -2
- package/dist/index.mjs +2 -2
- package/package.json +288 -49
- package/dist/plugin-alloy/src/core/components/output.cjs +0 -33
- package/dist/plugin-alloy/src/core/components/output.mjs +0 -32
- package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -116
- package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -116
- package/dist/plugin-alloy/src/index.cjs +0 -98
- package/dist/plugin-alloy/src/index.mjs +0 -96
- package/dist/plugin-alloy/src/internal/unctx.cjs +0 -9
- package/dist/plugin-alloy/src/internal/unctx.mjs +0 -8
package/dist/index.cjs
CHANGED
|
@@ -17,7 +17,6 @@ const require_components_env = require('./components/env.cjs');
|
|
|
17
17
|
require('./components/index.cjs');
|
|
18
18
|
const require_babel_plugin = require('./babel/plugin.cjs');
|
|
19
19
|
require('./babel/index.cjs');
|
|
20
|
-
const require_index = require('./plugin-alloy/src/index.cjs');
|
|
21
20
|
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
22
21
|
let __stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
|
|
23
22
|
let __stryke_env_types = require("@stryke/env/types");
|
|
@@ -25,6 +24,8 @@ let defu = require("defu");
|
|
|
25
24
|
defu = require_rolldown_runtime.__toESM(defu);
|
|
26
25
|
let __stryke_path_join = require("@stryke/path/join");
|
|
27
26
|
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
27
|
+
let __powerlines_plugin_alloy = require("@powerlines/plugin-alloy");
|
|
28
|
+
__powerlines_plugin_alloy = require_rolldown_runtime.__toESM(__powerlines_plugin_alloy);
|
|
28
29
|
let __powerlines_plugin_automd = require("@powerlines/plugin-automd");
|
|
29
30
|
__powerlines_plugin_automd = require_rolldown_runtime.__toESM(__powerlines_plugin_automd);
|
|
30
31
|
let __powerlines_plugin_babel = require("@powerlines/plugin-babel");
|
|
@@ -40,7 +41,7 @@ let __stryke_string_format_constant_case = require("@stryke/string-format/consta
|
|
|
40
41
|
*/
|
|
41
42
|
const plugin = (options = {}) => {
|
|
42
43
|
return [
|
|
43
|
-
|
|
44
|
+
(0, __powerlines_plugin_alloy.default)(options.alloy),
|
|
44
45
|
(0, __powerlines_plugin_babel.default)(options.babel),
|
|
45
46
|
{
|
|
46
47
|
name: "env",
|
package/dist/index.mjs
CHANGED
|
@@ -15,13 +15,13 @@ import { EnvBuiltin, EnvTypeDefinition } from "./components/env.mjs";
|
|
|
15
15
|
import "./components/index.mjs";
|
|
16
16
|
import { envBabelPlugin } from "./babel/plugin.mjs";
|
|
17
17
|
import "./babel/index.mjs";
|
|
18
|
-
import src_default$1 from "./plugin-alloy/src/index.mjs";
|
|
19
18
|
import { ReflectionClass, ReflectionKind } from "@powerlines/deepkit/vendor/type";
|
|
20
19
|
import { isParentPath } from "@stryke/path/is-parent-path";
|
|
21
20
|
import { ENV_PREFIXES } from "@stryke/env/types";
|
|
22
21
|
import defu from "defu";
|
|
23
22
|
import { joinPaths } from "@stryke/path/join";
|
|
24
23
|
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
24
|
+
import alloy from "@powerlines/plugin-alloy";
|
|
25
25
|
import automd from "@powerlines/plugin-automd";
|
|
26
26
|
import babel from "@powerlines/plugin-babel";
|
|
27
27
|
import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
|
|
@@ -35,7 +35,7 @@ import { constantCase } from "@stryke/string-format/constant-case";
|
|
|
35
35
|
*/
|
|
36
36
|
const plugin = (options = {}) => {
|
|
37
37
|
return [
|
|
38
|
-
|
|
38
|
+
alloy(options.alloy),
|
|
39
39
|
babel(options.babel),
|
|
40
40
|
{
|
|
41
41
|
name: "env",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-env",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.137",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing a Powerlines plugin for injecting static .env configuration values to the code so that they're accessible at runtime.",
|
|
6
6
|
"repository": {
|
|
@@ -41,76 +41,315 @@
|
|
|
41
41
|
"main": "./dist/index.cjs",
|
|
42
42
|
"module": "./dist/index.mjs",
|
|
43
43
|
"exports": {
|
|
44
|
-
".": {
|
|
44
|
+
".": {
|
|
45
|
+
"require": {
|
|
46
|
+
"types": "./dist/index.d.cts",
|
|
47
|
+
"default": "./dist/index.cjs"
|
|
48
|
+
},
|
|
49
|
+
"import": {
|
|
50
|
+
"types": "./dist/index.d.mts",
|
|
51
|
+
"default": "./dist/index.mjs"
|
|
52
|
+
},
|
|
53
|
+
"default": {
|
|
54
|
+
"types": "./dist/index.d.mts",
|
|
55
|
+
"default": "./dist/index.mjs"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
45
58
|
"./babel": {
|
|
46
|
-
"require":
|
|
47
|
-
|
|
59
|
+
"require": {
|
|
60
|
+
"types": "./dist/babel/index.d.cts",
|
|
61
|
+
"default": "./dist/babel/index.cjs"
|
|
62
|
+
},
|
|
63
|
+
"import": {
|
|
64
|
+
"types": "./dist/babel/index.d.mts",
|
|
65
|
+
"default": "./dist/babel/index.mjs"
|
|
66
|
+
},
|
|
67
|
+
"default": {
|
|
68
|
+
"types": "./dist/babel/index.d.mts",
|
|
69
|
+
"default": "./dist/babel/index.mjs"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"./babel/*": {
|
|
73
|
+
"require": {
|
|
74
|
+
"types": "./dist/babel/*.d.cts",
|
|
75
|
+
"default": "./dist/babel/*.cjs"
|
|
76
|
+
},
|
|
77
|
+
"import": {
|
|
78
|
+
"types": "./dist/babel/*.d.mts",
|
|
79
|
+
"default": "./dist/babel/*.mjs"
|
|
80
|
+
},
|
|
81
|
+
"default": {
|
|
82
|
+
"types": "./dist/babel/*.d.mts",
|
|
83
|
+
"default": "./dist/babel/*.mjs"
|
|
84
|
+
}
|
|
48
85
|
},
|
|
49
86
|
"./babel/plugin": {
|
|
50
|
-
"require":
|
|
51
|
-
|
|
87
|
+
"require": {
|
|
88
|
+
"types": "./dist/babel/plugin.d.cts",
|
|
89
|
+
"default": "./dist/babel/plugin.cjs"
|
|
90
|
+
},
|
|
91
|
+
"import": {
|
|
92
|
+
"types": "./dist/babel/plugin.d.mts",
|
|
93
|
+
"default": "./dist/babel/plugin.mjs"
|
|
94
|
+
},
|
|
95
|
+
"default": {
|
|
96
|
+
"types": "./dist/babel/plugin.d.mts",
|
|
97
|
+
"default": "./dist/babel/plugin.mjs"
|
|
98
|
+
}
|
|
52
99
|
},
|
|
53
100
|
"./components": {
|
|
54
|
-
"require":
|
|
55
|
-
|
|
101
|
+
"require": {
|
|
102
|
+
"types": "./dist/components/index.d.cts",
|
|
103
|
+
"default": "./dist/components/index.cjs"
|
|
104
|
+
},
|
|
105
|
+
"import": {
|
|
106
|
+
"types": "./dist/components/index.d.mts",
|
|
107
|
+
"default": "./dist/components/index.mjs"
|
|
108
|
+
},
|
|
109
|
+
"default": {
|
|
110
|
+
"types": "./dist/components/index.d.mts",
|
|
111
|
+
"default": "./dist/components/index.mjs"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"./components/*": {
|
|
115
|
+
"require": {
|
|
116
|
+
"types": "./dist/components/*.d.cts",
|
|
117
|
+
"default": "./dist/components/*.cjs"
|
|
118
|
+
},
|
|
119
|
+
"import": {
|
|
120
|
+
"types": "./dist/components/*.d.mts",
|
|
121
|
+
"default": "./dist/components/*.mjs"
|
|
122
|
+
},
|
|
123
|
+
"default": {
|
|
124
|
+
"types": "./dist/components/*.d.mts",
|
|
125
|
+
"default": "./dist/components/*.mjs"
|
|
126
|
+
}
|
|
56
127
|
},
|
|
57
128
|
"./components/docs": {
|
|
58
|
-
"require":
|
|
59
|
-
|
|
129
|
+
"require": {
|
|
130
|
+
"types": "./dist/components/docs.d.cts",
|
|
131
|
+
"default": "./dist/components/docs.cjs"
|
|
132
|
+
},
|
|
133
|
+
"import": {
|
|
134
|
+
"types": "./dist/components/docs.d.mts",
|
|
135
|
+
"default": "./dist/components/docs.mjs"
|
|
136
|
+
},
|
|
137
|
+
"default": {
|
|
138
|
+
"types": "./dist/components/docs.d.mts",
|
|
139
|
+
"default": "./dist/components/docs.mjs"
|
|
140
|
+
}
|
|
60
141
|
},
|
|
61
142
|
"./components/env": {
|
|
62
|
-
"require":
|
|
63
|
-
|
|
143
|
+
"require": {
|
|
144
|
+
"types": "./dist/components/env.d.cts",
|
|
145
|
+
"default": "./dist/components/env.cjs"
|
|
146
|
+
},
|
|
147
|
+
"import": {
|
|
148
|
+
"types": "./dist/components/env.d.mts",
|
|
149
|
+
"default": "./dist/components/env.mjs"
|
|
150
|
+
},
|
|
151
|
+
"default": {
|
|
152
|
+
"types": "./dist/components/env.d.mts",
|
|
153
|
+
"default": "./dist/components/env.mjs"
|
|
154
|
+
}
|
|
64
155
|
},
|
|
65
156
|
"./helpers": {
|
|
66
|
-
"require":
|
|
67
|
-
|
|
157
|
+
"require": {
|
|
158
|
+
"types": "./dist/helpers/index.d.cts",
|
|
159
|
+
"default": "./dist/helpers/index.cjs"
|
|
160
|
+
},
|
|
161
|
+
"import": {
|
|
162
|
+
"types": "./dist/helpers/index.d.mts",
|
|
163
|
+
"default": "./dist/helpers/index.mjs"
|
|
164
|
+
},
|
|
165
|
+
"default": {
|
|
166
|
+
"types": "./dist/helpers/index.d.mts",
|
|
167
|
+
"default": "./dist/helpers/index.mjs"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"./helpers/*": {
|
|
171
|
+
"require": {
|
|
172
|
+
"types": "./dist/helpers/*.d.cts",
|
|
173
|
+
"default": "./dist/helpers/*.cjs"
|
|
174
|
+
},
|
|
175
|
+
"import": {
|
|
176
|
+
"types": "./dist/helpers/*.d.mts",
|
|
177
|
+
"default": "./dist/helpers/*.mjs"
|
|
178
|
+
},
|
|
179
|
+
"default": {
|
|
180
|
+
"types": "./dist/helpers/*.d.mts",
|
|
181
|
+
"default": "./dist/helpers/*.mjs"
|
|
182
|
+
}
|
|
68
183
|
},
|
|
69
184
|
"./helpers/automd-generator": {
|
|
70
|
-
"require":
|
|
71
|
-
|
|
185
|
+
"require": {
|
|
186
|
+
"types": "./dist/helpers/automd-generator.d.cts",
|
|
187
|
+
"default": "./dist/helpers/automd-generator.cjs"
|
|
188
|
+
},
|
|
189
|
+
"import": {
|
|
190
|
+
"types": "./dist/helpers/automd-generator.d.mts",
|
|
191
|
+
"default": "./dist/helpers/automd-generator.mjs"
|
|
192
|
+
},
|
|
193
|
+
"default": {
|
|
194
|
+
"types": "./dist/helpers/automd-generator.d.mts",
|
|
195
|
+
"default": "./dist/helpers/automd-generator.mjs"
|
|
196
|
+
}
|
|
72
197
|
},
|
|
73
198
|
"./helpers/create-reflection-resource": {
|
|
74
|
-
"require":
|
|
75
|
-
|
|
199
|
+
"require": {
|
|
200
|
+
"types": "./dist/helpers/create-reflection-resource.d.cts",
|
|
201
|
+
"default": "./dist/helpers/create-reflection-resource.cjs"
|
|
202
|
+
},
|
|
203
|
+
"import": {
|
|
204
|
+
"types": "./dist/helpers/create-reflection-resource.d.mts",
|
|
205
|
+
"default": "./dist/helpers/create-reflection-resource.mjs"
|
|
206
|
+
},
|
|
207
|
+
"default": {
|
|
208
|
+
"types": "./dist/helpers/create-reflection-resource.d.mts",
|
|
209
|
+
"default": "./dist/helpers/create-reflection-resource.mjs"
|
|
210
|
+
}
|
|
76
211
|
},
|
|
77
212
|
"./helpers/docs-helper": {
|
|
78
|
-
"require":
|
|
79
|
-
|
|
213
|
+
"require": {
|
|
214
|
+
"types": "./dist/helpers/docs-helper.d.cts",
|
|
215
|
+
"default": "./dist/helpers/docs-helper.cjs"
|
|
216
|
+
},
|
|
217
|
+
"import": {
|
|
218
|
+
"types": "./dist/helpers/docs-helper.d.mts",
|
|
219
|
+
"default": "./dist/helpers/docs-helper.mjs"
|
|
220
|
+
},
|
|
221
|
+
"default": {
|
|
222
|
+
"types": "./dist/helpers/docs-helper.d.mts",
|
|
223
|
+
"default": "./dist/helpers/docs-helper.mjs"
|
|
224
|
+
}
|
|
80
225
|
},
|
|
81
226
|
"./helpers/load": {
|
|
82
|
-
"require":
|
|
83
|
-
|
|
227
|
+
"require": {
|
|
228
|
+
"types": "./dist/helpers/load.d.cts",
|
|
229
|
+
"default": "./dist/helpers/load.cjs"
|
|
230
|
+
},
|
|
231
|
+
"import": {
|
|
232
|
+
"types": "./dist/helpers/load.d.mts",
|
|
233
|
+
"default": "./dist/helpers/load.mjs"
|
|
234
|
+
},
|
|
235
|
+
"default": {
|
|
236
|
+
"types": "./dist/helpers/load.d.mts",
|
|
237
|
+
"default": "./dist/helpers/load.mjs"
|
|
238
|
+
}
|
|
84
239
|
},
|
|
85
240
|
"./helpers/persistence": {
|
|
86
|
-
"require":
|
|
87
|
-
|
|
241
|
+
"require": {
|
|
242
|
+
"types": "./dist/helpers/persistence.d.cts",
|
|
243
|
+
"default": "./dist/helpers/persistence.cjs"
|
|
244
|
+
},
|
|
245
|
+
"import": {
|
|
246
|
+
"types": "./dist/helpers/persistence.d.mts",
|
|
247
|
+
"default": "./dist/helpers/persistence.mjs"
|
|
248
|
+
},
|
|
249
|
+
"default": {
|
|
250
|
+
"types": "./dist/helpers/persistence.d.mts",
|
|
251
|
+
"default": "./dist/helpers/persistence.mjs"
|
|
252
|
+
}
|
|
88
253
|
},
|
|
89
254
|
"./helpers/reflect": {
|
|
90
|
-
"require":
|
|
91
|
-
|
|
255
|
+
"require": {
|
|
256
|
+
"types": "./dist/helpers/reflect.d.cts",
|
|
257
|
+
"default": "./dist/helpers/reflect.cjs"
|
|
258
|
+
},
|
|
259
|
+
"import": {
|
|
260
|
+
"types": "./dist/helpers/reflect.d.mts",
|
|
261
|
+
"default": "./dist/helpers/reflect.mjs"
|
|
262
|
+
},
|
|
263
|
+
"default": {
|
|
264
|
+
"types": "./dist/helpers/reflect.d.mts",
|
|
265
|
+
"default": "./dist/helpers/reflect.mjs"
|
|
266
|
+
}
|
|
92
267
|
},
|
|
93
268
|
"./helpers/source-file-env": {
|
|
94
|
-
"require":
|
|
95
|
-
|
|
269
|
+
"require": {
|
|
270
|
+
"types": "./dist/helpers/source-file-env.d.cts",
|
|
271
|
+
"default": "./dist/helpers/source-file-env.cjs"
|
|
272
|
+
},
|
|
273
|
+
"import": {
|
|
274
|
+
"types": "./dist/helpers/source-file-env.d.mts",
|
|
275
|
+
"default": "./dist/helpers/source-file-env.mjs"
|
|
276
|
+
},
|
|
277
|
+
"default": {
|
|
278
|
+
"types": "./dist/helpers/source-file-env.d.mts",
|
|
279
|
+
"default": "./dist/helpers/source-file-env.mjs"
|
|
280
|
+
}
|
|
96
281
|
},
|
|
97
282
|
"./helpers/template-helpers": {
|
|
98
|
-
"require":
|
|
99
|
-
|
|
283
|
+
"require": {
|
|
284
|
+
"types": "./dist/helpers/template-helpers.d.cts",
|
|
285
|
+
"default": "./dist/helpers/template-helpers.cjs"
|
|
286
|
+
},
|
|
287
|
+
"import": {
|
|
288
|
+
"types": "./dist/helpers/template-helpers.d.mts",
|
|
289
|
+
"default": "./dist/helpers/template-helpers.mjs"
|
|
290
|
+
},
|
|
291
|
+
"default": {
|
|
292
|
+
"types": "./dist/helpers/template-helpers.d.mts",
|
|
293
|
+
"default": "./dist/helpers/template-helpers.mjs"
|
|
294
|
+
}
|
|
100
295
|
},
|
|
296
|
+
"./package.json": "./package.json",
|
|
101
297
|
"./types": {
|
|
102
|
-
"require":
|
|
103
|
-
|
|
298
|
+
"require": {
|
|
299
|
+
"types": "./dist/types/index.d.cts",
|
|
300
|
+
"default": "./dist/types/index.cjs"
|
|
301
|
+
},
|
|
302
|
+
"import": {
|
|
303
|
+
"types": "./dist/types/index.d.mts",
|
|
304
|
+
"default": "./dist/types/index.mjs"
|
|
305
|
+
},
|
|
306
|
+
"default": {
|
|
307
|
+
"types": "./dist/types/index.d.mts",
|
|
308
|
+
"default": "./dist/types/index.mjs"
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"./types/*": {
|
|
312
|
+
"require": {
|
|
313
|
+
"types": "./dist/types/*.d.cts",
|
|
314
|
+
"default": "./dist/types/*.cjs"
|
|
315
|
+
},
|
|
316
|
+
"import": {
|
|
317
|
+
"types": "./dist/types/*.d.mts",
|
|
318
|
+
"default": "./dist/types/*.mjs"
|
|
319
|
+
},
|
|
320
|
+
"default": {
|
|
321
|
+
"types": "./dist/types/*.d.mts",
|
|
322
|
+
"default": "./dist/types/*.mjs"
|
|
323
|
+
}
|
|
104
324
|
},
|
|
105
325
|
"./types/plugin": {
|
|
106
|
-
"require":
|
|
107
|
-
|
|
326
|
+
"require": {
|
|
327
|
+
"types": "./dist/types/plugin.d.cts",
|
|
328
|
+
"default": "./dist/types/plugin.cjs"
|
|
329
|
+
},
|
|
330
|
+
"import": {
|
|
331
|
+
"types": "./dist/types/plugin.d.mts",
|
|
332
|
+
"default": "./dist/types/plugin.mjs"
|
|
333
|
+
},
|
|
334
|
+
"default": {
|
|
335
|
+
"types": "./dist/types/plugin.d.mts",
|
|
336
|
+
"default": "./dist/types/plugin.mjs"
|
|
337
|
+
}
|
|
108
338
|
},
|
|
109
339
|
"./types/runtime": {
|
|
110
|
-
"require":
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
340
|
+
"require": {
|
|
341
|
+
"types": "./dist/types/runtime.d.cts",
|
|
342
|
+
"default": "./dist/types/runtime.cjs"
|
|
343
|
+
},
|
|
344
|
+
"import": {
|
|
345
|
+
"types": "./dist/types/runtime.d.mts",
|
|
346
|
+
"default": "./dist/types/runtime.mjs"
|
|
347
|
+
},
|
|
348
|
+
"default": {
|
|
349
|
+
"types": "./dist/types/runtime.d.mts",
|
|
350
|
+
"default": "./dist/types/runtime.mjs"
|
|
351
|
+
}
|
|
352
|
+
}
|
|
114
353
|
},
|
|
115
354
|
"typings": "dist/index.d.mts",
|
|
116
355
|
"files": ["dist/**/*"],
|
|
@@ -130,28 +369,28 @@
|
|
|
130
369
|
"@alloy-js/typescript": "^0.22.0",
|
|
131
370
|
"@babel/core": "^7.28.6",
|
|
132
371
|
"@babel/types": "^7.28.6",
|
|
133
|
-
"@powerlines/plugin-alloy": "^0.19.
|
|
134
|
-
"@powerlines/plugin-automd": "^0.1.
|
|
135
|
-
"@powerlines/plugin-babel": "^0.12.
|
|
136
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
372
|
+
"@powerlines/plugin-alloy": "^0.19.9",
|
|
373
|
+
"@powerlines/plugin-automd": "^0.1.234",
|
|
374
|
+
"@powerlines/plugin-babel": "^0.12.243",
|
|
375
|
+
"@powerlines/plugin-plugin": "^0.12.185",
|
|
137
376
|
"@storm-software/config-tools": "^1.189.0",
|
|
138
|
-
"@stryke/capnp": "^0.12.
|
|
139
|
-
"@stryke/env": "^0.20.
|
|
140
|
-
"@stryke/fs": "^0.33.
|
|
377
|
+
"@stryke/capnp": "^0.12.64",
|
|
378
|
+
"@stryke/env": "^0.20.56",
|
|
379
|
+
"@stryke/fs": "^0.33.39",
|
|
141
380
|
"@stryke/json": "^0.9.40",
|
|
142
381
|
"@stryke/string-format": "^0.13.6",
|
|
143
382
|
"@stryke/type-checks": "^0.5.22",
|
|
144
383
|
"@stryke/types": "^0.10.36",
|
|
145
384
|
"automd": "^0.4.2",
|
|
146
|
-
"powerlines": "^0.38.
|
|
385
|
+
"powerlines": "^0.38.1"
|
|
147
386
|
},
|
|
148
387
|
"devDependencies": {
|
|
149
|
-
"@powerlines/deepkit": "^0.6.
|
|
150
|
-
"@powerlines/plugin-deepkit": "^0.11.
|
|
388
|
+
"@powerlines/deepkit": "^0.6.14",
|
|
389
|
+
"@powerlines/plugin-deepkit": "^0.11.113",
|
|
151
390
|
"@types/node": "^24.10.9",
|
|
152
391
|
"vite": "8.0.0-beta.2"
|
|
153
392
|
},
|
|
154
393
|
"publishConfig": { "access": "public" },
|
|
155
394
|
"types": "./dist/index.d.cts",
|
|
156
|
-
"gitHead": "
|
|
395
|
+
"gitHead": "2a4d9ef63cc29e4551fa9f680ea63874c7f48d2d"
|
|
157
396
|
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __alloy_js_core = require("@alloy-js/core");
|
|
3
|
-
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
|
-
let __stryke_path_replace = require("@stryke/path/replace");
|
|
5
|
-
|
|
6
|
-
//#region ../plugin-alloy/src/core/components/output.tsx
|
|
7
|
-
/**
|
|
8
|
-
* Output component for rendering the Powerlines plugin's output files via templates.
|
|
9
|
-
*/
|
|
10
|
-
function Output(props) {
|
|
11
|
-
const [{ children, context, basePath }, rest] = (0, __alloy_js_core.splitProps)(props, [
|
|
12
|
-
"children",
|
|
13
|
-
"context",
|
|
14
|
-
"basePath"
|
|
15
|
-
]);
|
|
16
|
-
const basePathRef = (0, __alloy_js_core.computed)(() => basePath ? (0, __stryke_path_replace.replacePath)(basePath, context.workspaceConfig.workspaceRoot) : context.workspaceConfig.workspaceRoot);
|
|
17
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Output, (0, __alloy_js_core_jsx_runtime.mergeProps)(rest, {
|
|
18
|
-
get basePath() {
|
|
19
|
-
return basePathRef.value;
|
|
20
|
-
},
|
|
21
|
-
get children() {
|
|
22
|
-
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
23
|
-
get when() {
|
|
24
|
-
return Boolean(context);
|
|
25
|
-
},
|
|
26
|
-
children
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
exports.Output = Output;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Output, Show, computed, splitProps } from "@alloy-js/core";
|
|
2
|
-
import { createComponent, mergeProps } from "@alloy-js/core/jsx-runtime";
|
|
3
|
-
import { replacePath } from "@stryke/path/replace";
|
|
4
|
-
|
|
5
|
-
//#region ../plugin-alloy/src/core/components/output.tsx
|
|
6
|
-
/**
|
|
7
|
-
* Output component for rendering the Powerlines plugin's output files via templates.
|
|
8
|
-
*/
|
|
9
|
-
function Output$1(props) {
|
|
10
|
-
const [{ children, context, basePath }, rest] = splitProps(props, [
|
|
11
|
-
"children",
|
|
12
|
-
"context",
|
|
13
|
-
"basePath"
|
|
14
|
-
]);
|
|
15
|
-
const basePathRef = computed(() => basePath ? replacePath(basePath, context.workspaceConfig.workspaceRoot) : context.workspaceConfig.workspaceRoot);
|
|
16
|
-
return createComponent(Output, mergeProps(rest, {
|
|
17
|
-
get basePath() {
|
|
18
|
-
return basePathRef.value;
|
|
19
|
-
},
|
|
20
|
-
get children() {
|
|
21
|
-
return createComponent(Show, {
|
|
22
|
-
get when() {
|
|
23
|
-
return Boolean(context);
|
|
24
|
-
},
|
|
25
|
-
children
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
export { Output$1 as Output };
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
const require_unctx = require('../../internal/unctx.cjs');
|
|
2
|
-
|
|
3
|
-
//#region ../plugin-alloy/src/core/contexts/context.ts
|
|
4
|
-
const __ΩRecord = [
|
|
5
|
-
"K",
|
|
6
|
-
"T",
|
|
7
|
-
"Record",
|
|
8
|
-
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
9
|
-
];
|
|
10
|
-
const __ΩMetaItem = [
|
|
11
|
-
"builtin",
|
|
12
|
-
"entry",
|
|
13
|
-
"kind",
|
|
14
|
-
"The kind of metadata item.",
|
|
15
|
-
"skipFormat",
|
|
16
|
-
"Whether to skip formatting for this output.",
|
|
17
|
-
"StoragePreset",
|
|
18
|
-
"storage",
|
|
19
|
-
"The storage preset or adapter name for the output files.",
|
|
20
|
-
"MetaItem",
|
|
21
|
-
"PP.!.\"&J4#8?$)4%8?&P\"w'&J4(8?)&\"LMw*y"
|
|
22
|
-
];
|
|
23
|
-
const __ΩPowerlinesContextInterface = [
|
|
24
|
-
"PluginContext",
|
|
25
|
-
"TContext",
|
|
26
|
-
() => __ΩRecord,
|
|
27
|
-
() => __ΩMetaItem,
|
|
28
|
-
"TMeta",
|
|
29
|
-
"value",
|
|
30
|
-
"The current Powerlines context.",
|
|
31
|
-
"meta",
|
|
32
|
-
"The current render metadata.",
|
|
33
|
-
"PowerlinesContextInterface",
|
|
34
|
-
"\"w!c\"&n$o##c%Pe\"!4&?'e\"\"4(?)Mw*y"
|
|
35
|
-
];
|
|
36
|
-
/**
|
|
37
|
-
* Hook to access the Powerlines Context.
|
|
38
|
-
*
|
|
39
|
-
* @returns The Context.
|
|
40
|
-
*/
|
|
41
|
-
function usePowerlinesContext() {
|
|
42
|
-
return require_unctx.unctx.tryUse();
|
|
43
|
-
}
|
|
44
|
-
usePowerlinesContext.__type = [
|
|
45
|
-
() => __ΩPowerlinesContextInterface,
|
|
46
|
-
"usePowerlinesContext",
|
|
47
|
-
"Hook to access the Powerlines Context.",
|
|
48
|
-
"PP\"\"o!#,J/\"?#"
|
|
49
|
-
];
|
|
50
|
-
/**
|
|
51
|
-
* Hook to safely access the {@link PluginContext | Powerlines context}.
|
|
52
|
-
*
|
|
53
|
-
* @returns The Powerlines context or null if not set.
|
|
54
|
-
*/
|
|
55
|
-
function usePowerlinesSafe() {
|
|
56
|
-
return (usePowerlinesContext.Ω = [["PluginContext", "\"w!"]], usePowerlinesContext())?.value ?? null;
|
|
57
|
-
}
|
|
58
|
-
usePowerlinesSafe.__type = [
|
|
59
|
-
"usePowerlinesSafe",
|
|
60
|
-
"Hook to safely access the {@link PluginContext | Powerlines context}.",
|
|
61
|
-
"PP\",J/!?\""
|
|
62
|
-
];
|
|
63
|
-
/**
|
|
64
|
-
* Hook to access the {@link PluginContext | Powerlines context}.
|
|
65
|
-
*
|
|
66
|
-
* @returns The Powerlines context.
|
|
67
|
-
*/
|
|
68
|
-
function usePowerlines() {
|
|
69
|
-
const powerlines = (usePowerlinesSafe.Ω = [["PluginContext", "\"w!"]], usePowerlinesSafe());
|
|
70
|
-
if (!powerlines) throw new Error("Powerlines - Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
|
|
71
|
-
return powerlines;
|
|
72
|
-
}
|
|
73
|
-
usePowerlines.__type = [
|
|
74
|
-
"usePowerlines",
|
|
75
|
-
"Hook to access the {@link PluginContext | Powerlines context}.",
|
|
76
|
-
"P\"/!?\""
|
|
77
|
-
];
|
|
78
|
-
/**
|
|
79
|
-
* Hook to safely access the render context's metadata.
|
|
80
|
-
*
|
|
81
|
-
* @returns The Powerlines context or null if not set.
|
|
82
|
-
*/
|
|
83
|
-
function useMetaSafe() {
|
|
84
|
-
return (usePowerlinesContext.Ω = [["PluginContext", "\"w!"], [
|
|
85
|
-
() => __ΩRecord,
|
|
86
|
-
() => __ΩMetaItem,
|
|
87
|
-
"&n\"o!#"
|
|
88
|
-
]], usePowerlinesContext())?.meta ?? null;
|
|
89
|
-
}
|
|
90
|
-
useMetaSafe.__type = [
|
|
91
|
-
"useMetaSafe",
|
|
92
|
-
"Hook to safely access the render context's metadata.",
|
|
93
|
-
"PP\",J/!?\""
|
|
94
|
-
];
|
|
95
|
-
/**
|
|
96
|
-
* Hook to access the render context's metadata.
|
|
97
|
-
*
|
|
98
|
-
* @returns The Powerlines context.
|
|
99
|
-
*/
|
|
100
|
-
function useMeta() {
|
|
101
|
-
const meta = (useMetaSafe.Ω = [[
|
|
102
|
-
() => __ΩRecord,
|
|
103
|
-
() => __ΩMetaItem,
|
|
104
|
-
"&n\"o!#"
|
|
105
|
-
]], useMetaSafe());
|
|
106
|
-
if (!meta) throw new Error("Powerlines metadata is not available in the rendering context. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
|
|
107
|
-
return meta;
|
|
108
|
-
}
|
|
109
|
-
useMeta.__type = [
|
|
110
|
-
"useMeta",
|
|
111
|
-
"Hook to access the render context's metadata.",
|
|
112
|
-
"P\"/!?\""
|
|
113
|
-
];
|
|
114
|
-
|
|
115
|
-
//#endregion
|
|
116
|
-
exports.__ΩPowerlinesContextInterface = __ΩPowerlinesContextInterface;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { unctx } from "../../internal/unctx.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../plugin-alloy/src/core/contexts/context.ts
|
|
4
|
-
const __ΩRecord = [
|
|
5
|
-
"K",
|
|
6
|
-
"T",
|
|
7
|
-
"Record",
|
|
8
|
-
"l'e#\"Rb!b\"Pde\"!N#!w#y"
|
|
9
|
-
];
|
|
10
|
-
const __ΩMetaItem = [
|
|
11
|
-
"builtin",
|
|
12
|
-
"entry",
|
|
13
|
-
"kind",
|
|
14
|
-
"The kind of metadata item.",
|
|
15
|
-
"skipFormat",
|
|
16
|
-
"Whether to skip formatting for this output.",
|
|
17
|
-
"StoragePreset",
|
|
18
|
-
"storage",
|
|
19
|
-
"The storage preset or adapter name for the output files.",
|
|
20
|
-
"MetaItem",
|
|
21
|
-
"PP.!.\"&J4#8?$)4%8?&P\"w'&J4(8?)&\"LMw*y"
|
|
22
|
-
];
|
|
23
|
-
const __ΩPowerlinesContextInterface = [
|
|
24
|
-
"PluginContext",
|
|
25
|
-
"TContext",
|
|
26
|
-
() => __ΩRecord,
|
|
27
|
-
() => __ΩMetaItem,
|
|
28
|
-
"TMeta",
|
|
29
|
-
"value",
|
|
30
|
-
"The current Powerlines context.",
|
|
31
|
-
"meta",
|
|
32
|
-
"The current render metadata.",
|
|
33
|
-
"PowerlinesContextInterface",
|
|
34
|
-
"\"w!c\"&n$o##c%Pe\"!4&?'e\"\"4(?)Mw*y"
|
|
35
|
-
];
|
|
36
|
-
/**
|
|
37
|
-
* Hook to access the Powerlines Context.
|
|
38
|
-
*
|
|
39
|
-
* @returns The Context.
|
|
40
|
-
*/
|
|
41
|
-
function usePowerlinesContext() {
|
|
42
|
-
return unctx.tryUse();
|
|
43
|
-
}
|
|
44
|
-
usePowerlinesContext.__type = [
|
|
45
|
-
() => __ΩPowerlinesContextInterface,
|
|
46
|
-
"usePowerlinesContext",
|
|
47
|
-
"Hook to access the Powerlines Context.",
|
|
48
|
-
"PP\"\"o!#,J/\"?#"
|
|
49
|
-
];
|
|
50
|
-
/**
|
|
51
|
-
* Hook to safely access the {@link PluginContext | Powerlines context}.
|
|
52
|
-
*
|
|
53
|
-
* @returns The Powerlines context or null if not set.
|
|
54
|
-
*/
|
|
55
|
-
function usePowerlinesSafe() {
|
|
56
|
-
return (usePowerlinesContext.Ω = [["PluginContext", "\"w!"]], usePowerlinesContext())?.value ?? null;
|
|
57
|
-
}
|
|
58
|
-
usePowerlinesSafe.__type = [
|
|
59
|
-
"usePowerlinesSafe",
|
|
60
|
-
"Hook to safely access the {@link PluginContext | Powerlines context}.",
|
|
61
|
-
"PP\",J/!?\""
|
|
62
|
-
];
|
|
63
|
-
/**
|
|
64
|
-
* Hook to access the {@link PluginContext | Powerlines context}.
|
|
65
|
-
*
|
|
66
|
-
* @returns The Powerlines context.
|
|
67
|
-
*/
|
|
68
|
-
function usePowerlines() {
|
|
69
|
-
const powerlines = (usePowerlinesSafe.Ω = [["PluginContext", "\"w!"]], usePowerlinesSafe());
|
|
70
|
-
if (!powerlines) throw new Error("Powerlines - Context is not set. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
|
|
71
|
-
return powerlines;
|
|
72
|
-
}
|
|
73
|
-
usePowerlines.__type = [
|
|
74
|
-
"usePowerlines",
|
|
75
|
-
"Hook to access the {@link PluginContext | Powerlines context}.",
|
|
76
|
-
"P\"/!?\""
|
|
77
|
-
];
|
|
78
|
-
/**
|
|
79
|
-
* Hook to safely access the render context's metadata.
|
|
80
|
-
*
|
|
81
|
-
* @returns The Powerlines context or null if not set.
|
|
82
|
-
*/
|
|
83
|
-
function useMetaSafe() {
|
|
84
|
-
return (usePowerlinesContext.Ω = [["PluginContext", "\"w!"], [
|
|
85
|
-
() => __ΩRecord,
|
|
86
|
-
() => __ΩMetaItem,
|
|
87
|
-
"&n\"o!#"
|
|
88
|
-
]], usePowerlinesContext())?.meta ?? null;
|
|
89
|
-
}
|
|
90
|
-
useMetaSafe.__type = [
|
|
91
|
-
"useMetaSafe",
|
|
92
|
-
"Hook to safely access the render context's metadata.",
|
|
93
|
-
"PP\",J/!?\""
|
|
94
|
-
];
|
|
95
|
-
/**
|
|
96
|
-
* Hook to access the render context's metadata.
|
|
97
|
-
*
|
|
98
|
-
* @returns The Powerlines context.
|
|
99
|
-
*/
|
|
100
|
-
function useMeta() {
|
|
101
|
-
const meta = (useMetaSafe.Ω = [[
|
|
102
|
-
() => __ΩRecord,
|
|
103
|
-
() => __ΩMetaItem,
|
|
104
|
-
"&n\"o!#"
|
|
105
|
-
]], useMetaSafe());
|
|
106
|
-
if (!meta) throw new Error("Powerlines metadata is not available in the rendering context. Please make sure the Alloy components are being provided to an invocation of the `render` function added to plugins by `@powerlines/plugin-alloy`.");
|
|
107
|
-
return meta;
|
|
108
|
-
}
|
|
109
|
-
useMeta.__type = [
|
|
110
|
-
"useMeta",
|
|
111
|
-
"Hook to access the render context's metadata.",
|
|
112
|
-
"P\"/!?\""
|
|
113
|
-
];
|
|
114
|
-
|
|
115
|
-
//#endregion
|
|
116
|
-
export { __ΩPowerlinesContextInterface };
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_output = require('./core/components/output.cjs');
|
|
3
|
-
const require_unctx = require('./internal/unctx.cjs');
|
|
4
|
-
let __alloy_js_core = require("@alloy-js/core");
|
|
5
|
-
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
6
|
-
let __alloy_js_rollup_plugin = require("@alloy-js/rollup-plugin");
|
|
7
|
-
__alloy_js_rollup_plugin = require_rolldown_runtime.__toESM(__alloy_js_rollup_plugin);
|
|
8
|
-
let __stryke_json_storm_json = require("@stryke/json/storm-json");
|
|
9
|
-
let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
10
|
-
|
|
11
|
-
//#region ../plugin-alloy/src/index.tsx
|
|
12
|
-
/**
|
|
13
|
-
* Alloy-js plugin for Powerlines.
|
|
14
|
-
*
|
|
15
|
-
* @param options - The Alloy-js plugin user configuration options.
|
|
16
|
-
* @returns A Powerlines plugin that integrates Alloy-js transformations.
|
|
17
|
-
*/
|
|
18
|
-
const plugin = (options = {}) => {
|
|
19
|
-
return [{
|
|
20
|
-
name: "alloy:config",
|
|
21
|
-
config() {
|
|
22
|
-
this.debug("Updating configuration options to support Alloy-js builds.");
|
|
23
|
-
return {
|
|
24
|
-
alloy: {
|
|
25
|
-
typescript: true,
|
|
26
|
-
...options
|
|
27
|
-
},
|
|
28
|
-
build: {
|
|
29
|
-
inputOptions: { transform: { jsx: "preserve" } },
|
|
30
|
-
plugins: [(0, __alloy_js_rollup_plugin.default)()],
|
|
31
|
-
external: [/^@alloy-js\//],
|
|
32
|
-
noExternal: ["@powerlines/plugin-alloy"]
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
async configResolved() {
|
|
37
|
-
this.debug("Ensuring TypeScript configuration is set up for Alloy-js.");
|
|
38
|
-
if (this.tsconfig.tsconfigJson.compilerOptions?.jsx !== "preserve" || this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource !== "@alloy-js/core") {
|
|
39
|
-
this.tsconfig.tsconfigJson.compilerOptions ??= {};
|
|
40
|
-
if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== "preserve") this.tsconfig.tsconfigJson.compilerOptions.jsx = "preserve";
|
|
41
|
-
if (this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !== "@alloy-js/core") this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource = "@alloy-js/core";
|
|
42
|
-
await this.fs.write(this.tsconfig.tsconfigFilePath, __stryke_json_storm_json.StormJSON.stringify(this.tsconfig.tsconfigJson));
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}, {
|
|
46
|
-
name: "alloy:attach-render",
|
|
47
|
-
configResolved: {
|
|
48
|
-
order: "pre",
|
|
49
|
-
async handler() {
|
|
50
|
-
this.debug("Attaching the `render` method to the context object.");
|
|
51
|
-
this.render = async (children) => {
|
|
52
|
-
const meta = {};
|
|
53
|
-
await require_unctx.unctx.callAsync({
|
|
54
|
-
value: this,
|
|
55
|
-
meta
|
|
56
|
-
}, async () => {
|
|
57
|
-
const _self$ = this;
|
|
58
|
-
await (0, __alloy_js_core.traverseOutput)(await (0, __alloy_js_core.renderAsync)((0, __alloy_js_core_jsx_runtime.createComponent)(require_output.Output, {
|
|
59
|
-
context: _self$,
|
|
60
|
-
meta,
|
|
61
|
-
get basePath() {
|
|
62
|
-
return _self$.workspaceConfig.workspaceRoot;
|
|
63
|
-
},
|
|
64
|
-
children
|
|
65
|
-
})), {
|
|
66
|
-
visitDirectory: (directory) => {
|
|
67
|
-
if (this.fs.existsSync(directory.path)) return;
|
|
68
|
-
this.fs.mkdirSync(directory.path);
|
|
69
|
-
},
|
|
70
|
-
visitFile: (file) => {
|
|
71
|
-
if ("contents" in file) {
|
|
72
|
-
const metadata = meta[file.path] ?? {};
|
|
73
|
-
if (metadata.kind === "builtin") {
|
|
74
|
-
if (!metadata.id) throw new Error(`Built-in file "${file.path}" is missing its ID in the render metadata.`);
|
|
75
|
-
this.emitBuiltinSync(file.contents, metadata.id, {
|
|
76
|
-
skipFormat: metadata.skipFormat,
|
|
77
|
-
storage: metadata.storage,
|
|
78
|
-
extension: (0, __stryke_path_file_path_fns.findFileExtension)(file.path)
|
|
79
|
-
});
|
|
80
|
-
} else if (metadata.kind === "entry") this.emitEntrySync(file.contents, file.path, {
|
|
81
|
-
skipFormat: metadata.skipFormat,
|
|
82
|
-
storage: metadata.storage,
|
|
83
|
-
...metadata.typeDefinition ?? {}
|
|
84
|
-
});
|
|
85
|
-
else this.emitSync(file.contents, file.path, metadata);
|
|
86
|
-
} else this.fs.copySync(file.sourcePath, file.path);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}];
|
|
94
|
-
};
|
|
95
|
-
var src_default = plugin;
|
|
96
|
-
|
|
97
|
-
//#endregion
|
|
98
|
-
exports.default = src_default;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { Output as Output$1 } from "./core/components/output.mjs";
|
|
2
|
-
import { unctx } from "./internal/unctx.mjs";
|
|
3
|
-
import { renderAsync, traverseOutput } from "@alloy-js/core";
|
|
4
|
-
import { createComponent } from "@alloy-js/core/jsx-runtime";
|
|
5
|
-
import rollupPlugin from "@alloy-js/rollup-plugin";
|
|
6
|
-
import { StormJSON } from "@stryke/json/storm-json";
|
|
7
|
-
import { findFileExtension } from "@stryke/path/file-path-fns";
|
|
8
|
-
|
|
9
|
-
//#region ../plugin-alloy/src/index.tsx
|
|
10
|
-
/**
|
|
11
|
-
* Alloy-js plugin for Powerlines.
|
|
12
|
-
*
|
|
13
|
-
* @param options - The Alloy-js plugin user configuration options.
|
|
14
|
-
* @returns A Powerlines plugin that integrates Alloy-js transformations.
|
|
15
|
-
*/
|
|
16
|
-
const plugin = (options = {}) => {
|
|
17
|
-
return [{
|
|
18
|
-
name: "alloy:config",
|
|
19
|
-
config() {
|
|
20
|
-
this.debug("Updating configuration options to support Alloy-js builds.");
|
|
21
|
-
return {
|
|
22
|
-
alloy: {
|
|
23
|
-
typescript: true,
|
|
24
|
-
...options
|
|
25
|
-
},
|
|
26
|
-
build: {
|
|
27
|
-
inputOptions: { transform: { jsx: "preserve" } },
|
|
28
|
-
plugins: [rollupPlugin()],
|
|
29
|
-
external: [/^@alloy-js\//],
|
|
30
|
-
noExternal: ["@powerlines/plugin-alloy"]
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
async configResolved() {
|
|
35
|
-
this.debug("Ensuring TypeScript configuration is set up for Alloy-js.");
|
|
36
|
-
if (this.tsconfig.tsconfigJson.compilerOptions?.jsx !== "preserve" || this.tsconfig.tsconfigJson.compilerOptions?.jsxImportSource !== "@alloy-js/core") {
|
|
37
|
-
this.tsconfig.tsconfigJson.compilerOptions ??= {};
|
|
38
|
-
if (this.tsconfig.tsconfigJson.compilerOptions.jsx !== "preserve") this.tsconfig.tsconfigJson.compilerOptions.jsx = "preserve";
|
|
39
|
-
if (this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource !== "@alloy-js/core") this.tsconfig.tsconfigJson.compilerOptions.jsxImportSource = "@alloy-js/core";
|
|
40
|
-
await this.fs.write(this.tsconfig.tsconfigFilePath, StormJSON.stringify(this.tsconfig.tsconfigJson));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}, {
|
|
44
|
-
name: "alloy:attach-render",
|
|
45
|
-
configResolved: {
|
|
46
|
-
order: "pre",
|
|
47
|
-
async handler() {
|
|
48
|
-
this.debug("Attaching the `render` method to the context object.");
|
|
49
|
-
this.render = async (children) => {
|
|
50
|
-
const meta = {};
|
|
51
|
-
await unctx.callAsync({
|
|
52
|
-
value: this,
|
|
53
|
-
meta
|
|
54
|
-
}, async () => {
|
|
55
|
-
const _self$ = this;
|
|
56
|
-
await traverseOutput(await renderAsync(createComponent(Output$1, {
|
|
57
|
-
context: _self$,
|
|
58
|
-
meta,
|
|
59
|
-
get basePath() {
|
|
60
|
-
return _self$.workspaceConfig.workspaceRoot;
|
|
61
|
-
},
|
|
62
|
-
children
|
|
63
|
-
})), {
|
|
64
|
-
visitDirectory: (directory) => {
|
|
65
|
-
if (this.fs.existsSync(directory.path)) return;
|
|
66
|
-
this.fs.mkdirSync(directory.path);
|
|
67
|
-
},
|
|
68
|
-
visitFile: (file) => {
|
|
69
|
-
if ("contents" in file) {
|
|
70
|
-
const metadata = meta[file.path] ?? {};
|
|
71
|
-
if (metadata.kind === "builtin") {
|
|
72
|
-
if (!metadata.id) throw new Error(`Built-in file "${file.path}" is missing its ID in the render metadata.`);
|
|
73
|
-
this.emitBuiltinSync(file.contents, metadata.id, {
|
|
74
|
-
skipFormat: metadata.skipFormat,
|
|
75
|
-
storage: metadata.storage,
|
|
76
|
-
extension: findFileExtension(file.path)
|
|
77
|
-
});
|
|
78
|
-
} else if (metadata.kind === "entry") this.emitEntrySync(file.contents, file.path, {
|
|
79
|
-
skipFormat: metadata.skipFormat,
|
|
80
|
-
storage: metadata.storage,
|
|
81
|
-
...metadata.typeDefinition ?? {}
|
|
82
|
-
});
|
|
83
|
-
else this.emitSync(file.contents, file.path, metadata);
|
|
84
|
-
} else this.fs.copySync(file.sourcePath, file.path);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}];
|
|
92
|
-
};
|
|
93
|
-
var src_default = plugin;
|
|
94
|
-
|
|
95
|
-
//#endregion
|
|
96
|
-
export { src_default as default };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_context = require('../core/contexts/context.cjs');
|
|
3
|
-
let unctx = require("unctx");
|
|
4
|
-
|
|
5
|
-
//#region ../plugin-alloy/src/internal/unctx.ts
|
|
6
|
-
const unctx$1 = (unctx.createContext.Ω = [[() => require_context.__ΩPowerlinesContextInterface, "\"\"o!#"]], (0, unctx.createContext)());
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
exports.unctx = unctx$1;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { __ΩPowerlinesContextInterface } from "../core/contexts/context.mjs";
|
|
2
|
-
import { createContext } from "unctx";
|
|
3
|
-
|
|
4
|
-
//#region ../plugin-alloy/src/internal/unctx.ts
|
|
5
|
-
const unctx = (createContext.Ω = [[() => __ΩPowerlinesContextInterface, "\"\"o!#"]], createContext());
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
export { unctx };
|