depflow 3.0.0-dev.10 → 3.0.0-dev.12

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 (175) hide show
  1. package/README.md +513 -117
  2. package/dist/builder/Builder.d.ts +279 -0
  3. package/dist/builder/Builder.js +391 -0
  4. package/dist/builder/Builder.js.map +1 -0
  5. package/dist/cli/Actions.d.ts +187 -0
  6. package/dist/cli/Actions.js +793 -0
  7. package/dist/cli/Actions.js.map +1 -0
  8. package/dist/cli/CLI.d.ts +170 -0
  9. package/dist/cli/CLI.js +231 -0
  10. package/dist/cli/CLI.js.map +1 -0
  11. package/dist/cli/DepflowCLI.d.ts +62 -0
  12. package/dist/cli/DepflowCLI.js +229 -0
  13. package/dist/cli/DepflowCLI.js.map +1 -0
  14. package/dist/cli/Flags.d.ts +106 -0
  15. package/dist/cli/Flags.js +125 -0
  16. package/dist/cli/Flags.js.map +1 -0
  17. package/dist/cli/bin.js +63 -0
  18. package/dist/cli/bin.js.map +1 -0
  19. package/dist/config/Config.d.ts +690 -0
  20. package/dist/config/Config.js +45 -0
  21. package/dist/config/Config.js.map +1 -0
  22. package/dist/config/ImportMap.d.ts +60 -0
  23. package/dist/config/ImportMap.js +66 -0
  24. package/dist/config/ImportMap.js.map +1 -0
  25. package/dist/config/JsonSchema.d.ts +12 -0
  26. package/dist/config/JsonSchema.js +26 -0
  27. package/dist/config/JsonSchema.js.map +1 -0
  28. package/dist/config/Settings.d.ts +201 -0
  29. package/dist/config/Settings.js +191 -0
  30. package/dist/config/Settings.js.map +1 -0
  31. package/dist/config/TSConfig.d.ts +73 -0
  32. package/dist/config/TSConfig.js +73 -0
  33. package/dist/config/TSConfig.js.map +1 -0
  34. package/dist/config/codecs/JsonCodec.d.ts +30 -0
  35. package/dist/config/codecs/JsonCodec.js +31 -0
  36. package/dist/config/codecs/JsonCodec.js.map +1 -0
  37. package/dist/config/codecs/YamlCodec.d.ts +62 -0
  38. package/dist/config/codecs/YamlCodec.js +89 -0
  39. package/dist/config/codecs/YamlCodec.js.map +1 -0
  40. package/dist/dependency/DepUtils.d.ts +78 -0
  41. package/dist/dependency/DepUtils.js +122 -0
  42. package/dist/dependency/DepUtils.js.map +1 -0
  43. package/dist/dependency/Dependency.d.ts +81 -0
  44. package/dist/dependency/Dependency.js +71 -0
  45. package/dist/dependency/Dependency.js.map +1 -0
  46. package/dist/dependency/Git.d.ts +75 -0
  47. package/dist/dependency/Git.js +97 -0
  48. package/dist/dependency/Git.js.map +1 -0
  49. package/dist/dependency/GitDependency.d.ts +30 -0
  50. package/dist/dependency/GitDependency.js +79 -0
  51. package/dist/dependency/GitDependency.js.map +1 -0
  52. package/dist/dependency/NpmDependency.d.ts +27 -0
  53. package/dist/dependency/NpmDependency.js +91 -0
  54. package/dist/dependency/NpmDependency.js.map +1 -0
  55. package/{build/support/PathResolver → dist/resolve}/AliasCompiler.d.ts +18 -5
  56. package/{build/support/PathResolver → dist/resolve}/AliasCompiler.js +31 -9
  57. package/dist/resolve/AliasCompiler.js.map +1 -0
  58. package/{build/support/PathResolver → dist/resolve}/PathResolver.d.ts +25 -8
  59. package/dist/resolve/PathResolver.js +133 -0
  60. package/dist/resolve/PathResolver.js.map +1 -0
  61. package/dist/resolve/PathRewriter.d.ts +24 -0
  62. package/{build/support/PathResolver → dist/resolve}/PathRewriter.js +21 -11
  63. package/dist/resolve/PathRewriter.js.map +1 -0
  64. package/{build → dist}/schema/Config/Builder.d.ts +114 -49
  65. package/dist/schema/Config/Builder.js +78 -0
  66. package/dist/schema/Config/Builder.js.map +1 -0
  67. package/{build → dist}/schema/Config/Config.d.ts +169 -78
  68. package/dist/schema/Config/Config.js +62 -0
  69. package/dist/schema/Config/Config.js.map +1 -0
  70. package/{build → dist}/schema/Config/Dependency.d.ts +219 -89
  71. package/dist/schema/Config/Dependency.js +80 -0
  72. package/dist/schema/Config/Dependency.js.map +1 -0
  73. package/{build → dist}/schema/Config/Extractor.d.ts +41 -17
  74. package/dist/schema/Config/Extractor.js +43 -0
  75. package/dist/schema/Config/Extractor.js.map +1 -0
  76. package/{build → dist}/schema/Config/Resolver.d.ts +25 -8
  77. package/dist/schema/Config/Resolver.js +43 -0
  78. package/dist/schema/Config/Resolver.js.map +1 -0
  79. package/{build → dist}/schema/Config/Transform.d.ts +22 -5
  80. package/dist/schema/Config/Transform.js +51 -0
  81. package/dist/schema/Config/Transform.js.map +1 -0
  82. package/dist/schema/Defaults.d.ts +20 -0
  83. package/dist/schema/Defaults.js +24 -0
  84. package/dist/schema/Defaults.js.map +1 -0
  85. package/dist/schema/ImportMap.d.ts +30 -0
  86. package/dist/schema/ImportMap.js +28 -0
  87. package/dist/schema/ImportMap.js.map +1 -0
  88. package/{build → dist}/schema/TSConfig.d.ts +23 -9
  89. package/dist/schema/TSConfig.js +39 -0
  90. package/dist/schema/TSConfig.js.map +1 -0
  91. package/{build → dist}/schema/schema.d.ts +11 -2
  92. package/{build → dist}/schema/schema.js +11 -2
  93. package/dist/schema/schema.js.map +1 -0
  94. package/dist/task/Command.d.ts +287 -0
  95. package/dist/task/Command.js +404 -0
  96. package/dist/task/Command.js.map +1 -0
  97. package/dist/task/Group.d.ts +15 -0
  98. package/dist/task/Group.js +29 -0
  99. package/dist/task/Group.js.map +1 -0
  100. package/dist/task/OutputPolicy.d.ts +262 -0
  101. package/dist/task/OutputPolicy.js +364 -0
  102. package/dist/task/OutputPolicy.js.map +1 -0
  103. package/dist/task/Task.d.ts +210 -0
  104. package/dist/task/Task.js +312 -0
  105. package/dist/task/Task.js.map +1 -0
  106. package/package.json +14 -10
  107. package/.gitignore +0 -7
  108. package/build/cli/DepFLowCLI.d.ts +0 -16
  109. package/build/cli/DepFLowCLI.js +0 -254
  110. package/build/cli/DepFLowCLI.js.map +0 -1
  111. package/build/cli/bin.js +0 -38
  112. package/build/cli/bin.js.map +0 -1
  113. package/build/config/Config.d.ts +0 -28
  114. package/build/config/Config.js +0 -46
  115. package/build/config/Config.js.map +0 -1
  116. package/build/config/ImportMap.d.ts +0 -51
  117. package/build/config/ImportMap.js +0 -97
  118. package/build/config/ImportMap.js.map +0 -1
  119. package/build/config/TSConfig.d.ts +0 -54
  120. package/build/config/TSConfig.js +0 -104
  121. package/build/config/TSConfig.js.map +0 -1
  122. package/build/schema/Config/Builder.js +0 -48
  123. package/build/schema/Config/Builder.js.map +0 -1
  124. package/build/schema/Config/Config.js +0 -20
  125. package/build/schema/Config/Config.js.map +0 -1
  126. package/build/schema/Config/Dependency.js +0 -25
  127. package/build/schema/Config/Dependency.js.map +0 -1
  128. package/build/schema/Config/Extractor.js +0 -25
  129. package/build/schema/Config/Extractor.js.map +0 -1
  130. package/build/schema/Config/Resolver.js +0 -25
  131. package/build/schema/Config/Resolver.js.map +0 -1
  132. package/build/schema/Config/Transform.js +0 -27
  133. package/build/schema/Config/Transform.js.map +0 -1
  134. package/build/schema/ImportMap.d.ts +0 -22
  135. package/build/schema/ImportMap.js +0 -12
  136. package/build/schema/ImportMap.js.map +0 -1
  137. package/build/schema/TSConfig.js +0 -19
  138. package/build/schema/TSConfig.js.map +0 -1
  139. package/build/schema/schema.js.map +0 -1
  140. package/build/support/Builder/Builder.d.ts +0 -46
  141. package/build/support/Builder/Builder.js +0 -116
  142. package/build/support/Builder/Builder.js.map +0 -1
  143. package/build/support/Dependency/Dependency.d.ts +0 -38
  144. package/build/support/Dependency/Dependency.js +0 -14
  145. package/build/support/Dependency/Dependency.js.map +0 -1
  146. package/build/support/Dependency/GitDependency.d.ts +0 -20
  147. package/build/support/Dependency/GitDependency.js +0 -67
  148. package/build/support/Dependency/GitDependency.js.map +0 -1
  149. package/build/support/Dependency/NpmDependency.d.ts +0 -18
  150. package/build/support/Dependency/NpmDependency.js +0 -65
  151. package/build/support/Dependency/NpmDependency.js.map +0 -1
  152. package/build/support/Git.d.ts +0 -53
  153. package/build/support/Git.js +0 -86
  154. package/build/support/Git.js.map +0 -1
  155. package/build/support/PathResolver/AliasCompiler.js.map +0 -1
  156. package/build/support/PathResolver/PathResolver.js +0 -105
  157. package/build/support/PathResolver/PathResolver.js.map +0 -1
  158. package/build/support/PathResolver/PathRewriter.d.ts +0 -18
  159. package/build/support/PathResolver/PathRewriter.js.map +0 -1
  160. package/build/support/PathResolver/Utils.d.ts +0 -36
  161. package/build/support/PathResolver/Utils.js +0 -45
  162. package/build/support/PathResolver/Utils.js.map +0 -1
  163. package/build/support/Task/Command.d.ts +0 -49
  164. package/build/support/Task/Command.js +0 -100
  165. package/build/support/Task/Command.js.map +0 -1
  166. package/build/support/Task/Task.d.ts +0 -84
  167. package/build/support/Task/Task.js +0 -145
  168. package/build/support/Task/Task.js.map +0 -1
  169. package/build/support/Utils.d.ts +0 -40
  170. package/build/support/Utils.js +0 -138
  171. package/build/support/Utils.js.map +0 -1
  172. package/build/support/Validator.d.ts +0 -22
  173. package/build/support/Validator.js +0 -28
  174. package/build/support/Validator.js.map +0 -1
  175. /package/{build → dist}/cli/bin.d.ts +0 -0
@@ -1,21 +1,28 @@
1
- import { Schema } from '@netfeez/common';
1
+ /**
2
+ * @author NetFeez <netfeez.dev@gmail.com>.
3
+ * @description Schema definitions for build steps: run, extract and transform entries.
4
+ * @license Apache-2.0
5
+ */
6
+ import Schema from '@netfeez/schema';
2
7
  export declare const RunEntry: Schema<{
3
8
  readonly type: "object";
4
9
  readonly required: true;
5
- readonly properties: {
10
+ readonly keys: {
6
11
  readonly maxTimeMs: {
7
12
  readonly type: "number";
8
13
  readonly default: 60000;
9
14
  readonly minimum: -1;
15
+ readonly description: "Maximum execution time for the run step in milliseconds. A value of -1 disables the limit.";
10
16
  };
11
17
  readonly allowFails: {
12
18
  readonly type: "boolean";
13
19
  readonly default: false;
20
+ readonly description: "Whether failed commands within the step are tolerated. Defaults to false.";
14
21
  };
15
22
  readonly run: {
16
23
  readonly type: "union";
17
24
  readonly required: true;
18
- readonly union: [{
25
+ readonly union: readonly [{
19
26
  readonly type: "string";
20
27
  }, {
21
28
  readonly type: "array";
@@ -23,6 +30,7 @@ export declare const RunEntry: Schema<{
23
30
  readonly type: "string";
24
31
  };
25
32
  }];
33
+ readonly description: "Shell command or list of shell commands to execute.";
26
34
  };
27
35
  };
28
36
  }>;
@@ -31,81 +39,92 @@ export declare namespace RunEntry { }
31
39
  export declare const ExtractEntry: Schema<{
32
40
  readonly type: "object";
33
41
  readonly required: true;
34
- readonly properties: {
42
+ readonly keys: {
35
43
  readonly extract: {
36
44
  readonly type: "union";
37
45
  readonly required: true;
38
- readonly union: [{
46
+ readonly union: readonly [{
39
47
  readonly type: "string";
40
48
  }, {
41
49
  readonly type: "object";
42
50
  readonly required: true;
43
- readonly allowAdditionalProperties: {
51
+ readonly additional: {
44
52
  readonly type: "union";
45
53
  readonly required: true;
46
- readonly union: [{
54
+ readonly union: readonly [{
47
55
  readonly type: "string";
48
56
  readonly required: true;
49
57
  }, {
50
58
  readonly type: "object";
51
59
  readonly required: true;
52
- readonly properties: {
60
+ readonly keys: {
53
61
  readonly to: {
54
62
  readonly type: "string";
55
63
  readonly required: true;
64
+ readonly description: "Destination folder to which the matched files are copied. A relative path is resolved against the project root, an absolute one is used as it stands.";
56
65
  };
57
66
  readonly map: {
58
- readonly required: false;
59
67
  readonly type: "union";
60
- readonly union: [{
68
+ readonly union: readonly [{
61
69
  readonly type: "string";
62
70
  }, {
63
71
  readonly type: "object";
64
- readonly properties: {
72
+ readonly keys: {
65
73
  readonly search: {
66
74
  readonly type: "string";
67
75
  readonly required: true;
76
+ readonly description: "The regular expression pattern to search for in the file content.";
68
77
  };
69
78
  readonly flags: {
70
79
  readonly type: "string";
71
80
  readonly default: "g";
72
81
  readonly pattern: RegExp;
82
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
73
83
  };
74
84
  readonly replace: {
75
85
  readonly type: "string";
76
86
  readonly required: true;
87
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
77
88
  };
78
89
  };
79
90
  }];
91
+ readonly required: false;
92
+ readonly description: "Transformation applied to the destination path of the extracted files.";
80
93
  };
81
94
  readonly transform: {
82
- readonly required: false;
83
95
  readonly type: "union";
84
- readonly union: [{
96
+ readonly union: readonly [{
85
97
  readonly type: "string";
86
98
  }, {
87
99
  readonly type: "object";
88
- readonly properties: {
100
+ readonly keys: {
89
101
  readonly search: {
90
102
  readonly type: "string";
91
103
  readonly required: true;
104
+ readonly description: "The regular expression pattern to search for in the file content.";
92
105
  };
93
106
  readonly flags: {
94
107
  readonly type: "string";
95
108
  readonly default: "g";
96
109
  readonly pattern: RegExp;
110
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
97
111
  };
98
112
  readonly replace: {
99
113
  readonly type: "string";
100
114
  readonly required: true;
115
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
101
116
  };
102
117
  };
103
118
  }];
119
+ readonly required: false;
120
+ readonly description: "Transformation applied to the content of the extracted files.";
104
121
  };
105
122
  };
106
123
  }];
107
124
  };
125
+ readonly description: "Mapping of source glob patterns, relative to the folder the pipeline works in, to extraction entries, each describing where and how files are extracted.";
108
126
  }];
127
+ readonly description: "Destination folder for the extracted files or an extraction mapping.";
109
128
  };
110
129
  };
111
130
  }>;
@@ -114,29 +133,34 @@ export declare namespace ExtractEntry { }
114
133
  export declare const TransformEntry: Schema<{
115
134
  readonly type: "object";
116
135
  readonly required: true;
117
- readonly properties: {
136
+ readonly keys: {
118
137
  readonly transform: {
119
138
  readonly type: "object";
120
139
  readonly required: true;
121
- readonly properties: {
140
+ readonly keys: {
122
141
  readonly search: {
123
142
  readonly type: "string";
124
143
  readonly required: true;
144
+ readonly description: "The regular expression pattern to search for in the file content.";
125
145
  };
126
146
  readonly flags: {
127
147
  readonly type: "string";
128
148
  readonly default: "g";
129
149
  readonly pattern: RegExp;
150
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
130
151
  };
131
152
  readonly replace: {
132
153
  readonly type: "string";
133
154
  readonly required: true;
155
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
134
156
  };
135
157
  readonly glob: {
136
158
  readonly type: "string";
137
159
  readonly required: true;
160
+ readonly description: "Glob pattern matching the files to which the global transformation is applied.";
138
161
  };
139
162
  };
163
+ readonly description: "Global transformation to apply over the files matched by the glob pattern.";
140
164
  };
141
165
  };
142
166
  }>;
@@ -145,23 +169,25 @@ export declare namespace TransformEntry { }
145
169
  export declare const BuilderEntry: Schema<{
146
170
  readonly type: "union";
147
171
  readonly required: true;
148
- readonly union: [{
172
+ readonly union: readonly [{
149
173
  readonly type: "object";
150
174
  readonly required: true;
151
- readonly properties: {
175
+ readonly keys: {
152
176
  readonly maxTimeMs: {
153
177
  readonly type: "number";
154
178
  readonly default: 60000;
155
179
  readonly minimum: -1;
180
+ readonly description: "Maximum execution time for the run step in milliseconds. A value of -1 disables the limit.";
156
181
  };
157
182
  readonly allowFails: {
158
183
  readonly type: "boolean";
159
184
  readonly default: false;
185
+ readonly description: "Whether failed commands within the step are tolerated. Defaults to false.";
160
186
  };
161
187
  readonly run: {
162
188
  readonly type: "union";
163
189
  readonly required: true;
164
- readonly union: [{
190
+ readonly union: readonly [{
165
191
  readonly type: "string";
166
192
  }, {
167
193
  readonly type: "array";
@@ -169,143 +195,163 @@ export declare const BuilderEntry: Schema<{
169
195
  readonly type: "string";
170
196
  };
171
197
  }];
198
+ readonly description: "Shell command or list of shell commands to execute.";
172
199
  };
173
200
  };
174
201
  }, {
175
202
  readonly type: "object";
176
203
  readonly required: true;
177
- readonly properties: {
204
+ readonly keys: {
178
205
  readonly extract: {
179
206
  readonly type: "union";
180
207
  readonly required: true;
181
- readonly union: [{
208
+ readonly union: readonly [{
182
209
  readonly type: "string";
183
210
  }, {
184
211
  readonly type: "object";
185
212
  readonly required: true;
186
- readonly allowAdditionalProperties: {
213
+ readonly additional: {
187
214
  readonly type: "union";
188
215
  readonly required: true;
189
- readonly union: [{
216
+ readonly union: readonly [{
190
217
  readonly type: "string";
191
218
  readonly required: true;
192
219
  }, {
193
220
  readonly type: "object";
194
221
  readonly required: true;
195
- readonly properties: {
222
+ readonly keys: {
196
223
  readonly to: {
197
224
  readonly type: "string";
198
225
  readonly required: true;
226
+ readonly description: "Destination folder to which the matched files are copied. A relative path is resolved against the project root, an absolute one is used as it stands.";
199
227
  };
200
228
  readonly map: {
201
- readonly required: false;
202
229
  readonly type: "union";
203
- readonly union: [{
230
+ readonly union: readonly [{
204
231
  readonly type: "string";
205
232
  }, {
206
233
  readonly type: "object";
207
- readonly properties: {
234
+ readonly keys: {
208
235
  readonly search: {
209
236
  readonly type: "string";
210
237
  readonly required: true;
238
+ readonly description: "The regular expression pattern to search for in the file content.";
211
239
  };
212
240
  readonly flags: {
213
241
  readonly type: "string";
214
242
  readonly default: "g";
215
243
  readonly pattern: RegExp;
244
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
216
245
  };
217
246
  readonly replace: {
218
247
  readonly type: "string";
219
248
  readonly required: true;
249
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
220
250
  };
221
251
  };
222
252
  }];
253
+ readonly required: false;
254
+ readonly description: "Transformation applied to the destination path of the extracted files.";
223
255
  };
224
256
  readonly transform: {
225
- readonly required: false;
226
257
  readonly type: "union";
227
- readonly union: [{
258
+ readonly union: readonly [{
228
259
  readonly type: "string";
229
260
  }, {
230
261
  readonly type: "object";
231
- readonly properties: {
262
+ readonly keys: {
232
263
  readonly search: {
233
264
  readonly type: "string";
234
265
  readonly required: true;
266
+ readonly description: "The regular expression pattern to search for in the file content.";
235
267
  };
236
268
  readonly flags: {
237
269
  readonly type: "string";
238
270
  readonly default: "g";
239
271
  readonly pattern: RegExp;
272
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
240
273
  };
241
274
  readonly replace: {
242
275
  readonly type: "string";
243
276
  readonly required: true;
277
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
244
278
  };
245
279
  };
246
280
  }];
281
+ readonly required: false;
282
+ readonly description: "Transformation applied to the content of the extracted files.";
247
283
  };
248
284
  };
249
285
  }];
250
286
  };
287
+ readonly description: "Mapping of source glob patterns, relative to the folder the pipeline works in, to extraction entries, each describing where and how files are extracted.";
251
288
  }];
289
+ readonly description: "Destination folder for the extracted files or an extraction mapping.";
252
290
  };
253
291
  };
254
292
  }, {
255
293
  readonly type: "object";
256
294
  readonly required: true;
257
- readonly properties: {
295
+ readonly keys: {
258
296
  readonly transform: {
259
297
  readonly type: "object";
260
298
  readonly required: true;
261
- readonly properties: {
299
+ readonly keys: {
262
300
  readonly search: {
263
301
  readonly type: "string";
264
302
  readonly required: true;
303
+ readonly description: "The regular expression pattern to search for in the file content.";
265
304
  };
266
305
  readonly flags: {
267
306
  readonly type: "string";
268
307
  readonly default: "g";
269
308
  readonly pattern: RegExp;
309
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
270
310
  };
271
311
  readonly replace: {
272
312
  readonly type: "string";
273
313
  readonly required: true;
314
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
274
315
  };
275
316
  readonly glob: {
276
317
  readonly type: "string";
277
318
  readonly required: true;
319
+ readonly description: "Glob pattern matching the files to which the global transformation is applied.";
278
320
  };
279
321
  };
322
+ readonly description: "Global transformation to apply over the files matched by the glob pattern.";
280
323
  };
281
324
  };
282
325
  }];
326
+ readonly description: "A single build step: run commands, extract files or apply a global transformation.";
283
327
  }>;
284
328
  export type BuilderEntry = typeof BuilderEntry.infer;
285
329
  export declare namespace BuilderEntry { }
286
330
  export declare const Builder: Schema<{
287
331
  readonly type: "array";
288
- readonly default: [];
332
+ readonly default: never[];
289
333
  readonly items: {
290
334
  readonly type: "union";
291
335
  readonly required: true;
292
- readonly union: [{
336
+ readonly union: readonly [{
293
337
  readonly type: "object";
294
338
  readonly required: true;
295
- readonly properties: {
339
+ readonly keys: {
296
340
  readonly maxTimeMs: {
297
341
  readonly type: "number";
298
342
  readonly default: 60000;
299
343
  readonly minimum: -1;
344
+ readonly description: "Maximum execution time for the run step in milliseconds. A value of -1 disables the limit.";
300
345
  };
301
346
  readonly allowFails: {
302
347
  readonly type: "boolean";
303
348
  readonly default: false;
349
+ readonly description: "Whether failed commands within the step are tolerated. Defaults to false.";
304
350
  };
305
351
  readonly run: {
306
352
  readonly type: "union";
307
353
  readonly required: true;
308
- readonly union: [{
354
+ readonly union: readonly [{
309
355
  readonly type: "string";
310
356
  }, {
311
357
  readonly type: "array";
@@ -313,118 +359,137 @@ export declare const Builder: Schema<{
313
359
  readonly type: "string";
314
360
  };
315
361
  }];
362
+ readonly description: "Shell command or list of shell commands to execute.";
316
363
  };
317
364
  };
318
365
  }, {
319
366
  readonly type: "object";
320
367
  readonly required: true;
321
- readonly properties: {
368
+ readonly keys: {
322
369
  readonly extract: {
323
370
  readonly type: "union";
324
371
  readonly required: true;
325
- readonly union: [{
372
+ readonly union: readonly [{
326
373
  readonly type: "string";
327
374
  }, {
328
375
  readonly type: "object";
329
376
  readonly required: true;
330
- readonly allowAdditionalProperties: {
377
+ readonly additional: {
331
378
  readonly type: "union";
332
379
  readonly required: true;
333
- readonly union: [{
380
+ readonly union: readonly [{
334
381
  readonly type: "string";
335
382
  readonly required: true;
336
383
  }, {
337
384
  readonly type: "object";
338
385
  readonly required: true;
339
- readonly properties: {
386
+ readonly keys: {
340
387
  readonly to: {
341
388
  readonly type: "string";
342
389
  readonly required: true;
390
+ readonly description: "Destination folder to which the matched files are copied. A relative path is resolved against the project root, an absolute one is used as it stands.";
343
391
  };
344
392
  readonly map: {
345
- readonly required: false;
346
393
  readonly type: "union";
347
- readonly union: [{
394
+ readonly union: readonly [{
348
395
  readonly type: "string";
349
396
  }, {
350
397
  readonly type: "object";
351
- readonly properties: {
398
+ readonly keys: {
352
399
  readonly search: {
353
400
  readonly type: "string";
354
401
  readonly required: true;
402
+ readonly description: "The regular expression pattern to search for in the file content.";
355
403
  };
356
404
  readonly flags: {
357
405
  readonly type: "string";
358
406
  readonly default: "g";
359
407
  readonly pattern: RegExp;
408
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
360
409
  };
361
410
  readonly replace: {
362
411
  readonly type: "string";
363
412
  readonly required: true;
413
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
364
414
  };
365
415
  };
366
416
  }];
417
+ readonly required: false;
418
+ readonly description: "Transformation applied to the destination path of the extracted files.";
367
419
  };
368
420
  readonly transform: {
369
- readonly required: false;
370
421
  readonly type: "union";
371
- readonly union: [{
422
+ readonly union: readonly [{
372
423
  readonly type: "string";
373
424
  }, {
374
425
  readonly type: "object";
375
- readonly properties: {
426
+ readonly keys: {
376
427
  readonly search: {
377
428
  readonly type: "string";
378
429
  readonly required: true;
430
+ readonly description: "The regular expression pattern to search for in the file content.";
379
431
  };
380
432
  readonly flags: {
381
433
  readonly type: "string";
382
434
  readonly default: "g";
383
435
  readonly pattern: RegExp;
436
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
384
437
  };
385
438
  readonly replace: {
386
439
  readonly type: "string";
387
440
  readonly required: true;
441
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
388
442
  };
389
443
  };
390
444
  }];
445
+ readonly required: false;
446
+ readonly description: "Transformation applied to the content of the extracted files.";
391
447
  };
392
448
  };
393
449
  }];
394
450
  };
451
+ readonly description: "Mapping of source glob patterns, relative to the folder the pipeline works in, to extraction entries, each describing where and how files are extracted.";
395
452
  }];
453
+ readonly description: "Destination folder for the extracted files or an extraction mapping.";
396
454
  };
397
455
  };
398
456
  }, {
399
457
  readonly type: "object";
400
458
  readonly required: true;
401
- readonly properties: {
459
+ readonly keys: {
402
460
  readonly transform: {
403
461
  readonly type: "object";
404
462
  readonly required: true;
405
- readonly properties: {
463
+ readonly keys: {
406
464
  readonly search: {
407
465
  readonly type: "string";
408
466
  readonly required: true;
467
+ readonly description: "The regular expression pattern to search for in the file content.";
409
468
  };
410
469
  readonly flags: {
411
470
  readonly type: "string";
412
471
  readonly default: "g";
413
472
  readonly pattern: RegExp;
473
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
414
474
  };
415
475
  readonly replace: {
416
476
  readonly type: "string";
417
477
  readonly required: true;
478
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
418
479
  };
419
480
  readonly glob: {
420
481
  readonly type: "string";
421
482
  readonly required: true;
483
+ readonly description: "Glob pattern matching the files to which the global transformation is applied.";
422
484
  };
423
485
  };
486
+ readonly description: "Global transformation to apply over the files matched by the glob pattern.";
424
487
  };
425
488
  };
426
489
  }];
490
+ readonly description: "A single build step: run commands, extract files or apply a global transformation.";
427
491
  };
492
+ readonly description: "Ordered pipeline of build steps applied when a dependency is built.";
428
493
  }>;
429
494
  export type Builder = typeof Builder.infer;
430
495
  export declare namespace Builder { }
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @author NetFeez <netfeez.dev@gmail.com>.
3
+ * @description Schema definitions for build steps: run, extract and transform entries.
4
+ * @license Apache-2.0
5
+ */
6
+ import Schema from '@netfeez/schema';
7
+ import { GlobalTransform } from './Transform.js';
8
+ import Extractor from './Extractor.js';
9
+ import Defaults from '../Defaults.js';
10
+ export const RunEntry = new Schema({
11
+ type: 'object',
12
+ required: true,
13
+ keys: {
14
+ maxTimeMs: {
15
+ type: 'number',
16
+ default: 60000,
17
+ minimum: -1,
18
+ description: 'Maximum execution time for the run step in milliseconds. A value of -1 disables the limit.'
19
+ },
20
+ allowFails: {
21
+ type: 'boolean',
22
+ default: false,
23
+ description: 'Whether failed commands within the step are tolerated. Defaults to false.'
24
+ },
25
+ run: {
26
+ type: 'union',
27
+ required: true,
28
+ union: [
29
+ { type: 'string' },
30
+ { type: 'array', items: { type: 'string' } }
31
+ ],
32
+ description: 'Shell command or list of shell commands to execute.'
33
+ }
34
+ }
35
+ });
36
+ export const ExtractEntry = new Schema({
37
+ type: 'object',
38
+ required: true,
39
+ keys: {
40
+ extract: {
41
+ type: 'union',
42
+ required: true,
43
+ union: [
44
+ { type: 'string' },
45
+ Extractor.definition
46
+ ],
47
+ description: 'Destination folder for the extracted files or an extraction mapping.'
48
+ }
49
+ }
50
+ });
51
+ export const TransformEntry = new Schema({
52
+ type: 'object',
53
+ required: true,
54
+ keys: {
55
+ transform: {
56
+ ...GlobalTransform.definition,
57
+ description: 'Global transformation to apply over the files matched by the glob pattern.'
58
+ }
59
+ }
60
+ });
61
+ export const BuilderEntry = new Schema({
62
+ type: 'union',
63
+ required: true,
64
+ union: [
65
+ RunEntry.definition,
66
+ ExtractEntry.definition,
67
+ TransformEntry.definition
68
+ ],
69
+ description: 'A single build step: run commands, extract files or apply a global transformation.'
70
+ });
71
+ export const Builder = new Schema({
72
+ type: 'array',
73
+ get default() { return Defaults.array(); },
74
+ items: BuilderEntry.definition,
75
+ description: 'Ordered pipeline of build steps applied when a dependency is built.'
76
+ });
77
+ export default Builder;
78
+ //# sourceMappingURL=Builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Builder.js","sourceRoot":"","sources":["../../../src/schema/Config/Builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC;IAC/B,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF,SAAS,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,CAAC,CAAC;YACX,WAAW,EAAE,4FAA4F;SAC5G;QACD,UAAU,EAAE;YACR,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;YACd,WAAW,EAAE,2EAA2E;SAC3F;QACD,GAAG,EAAE;YACD,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE;gBACH,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAClB,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;aAC/C;YACD,WAAW,EAAE,qDAAqD;SACrE;KACJ;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC;IACnC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF,OAAO,EAAE;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE;gBACH,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAClB,SAAS,CAAC,UAAU;aACvB;YACD,WAAW,EAAE,sEAAsE;SACtF;KACJ;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC;IACrC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF,SAAS,EAAE;YACP,GAAG,eAAe,CAAC,UAAU;YAC7B,WAAW,EAAE,4EAA4E;SAC5F;KACJ;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC;IACnC,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACH,QAAQ,CAAC,UAAU;QACnB,YAAY,CAAC,UAAU;QACvB,cAAc,CAAC,UAAU;KAC5B;IACD,WAAW,EAAE,oFAAoF;CACpG,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC;IAC9B,IAAI,EAAE,OAAO;IACb,IAAI,OAAO,KAAK,OAAO,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC1C,KAAK,EAAE,YAAY,CAAC,UAAU;IAC9B,WAAW,EAAE,qEAAqE;CACrF,CAAC,CAAC;AAIH,eAAe,OAAO,CAAC"}