@enspirit/emb 0.0.9 → 0.1.1
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/README.md +50 -28
- package/dist/src/cli/abstract/BaseCommand.d.ts +6 -0
- package/dist/src/cli/abstract/BaseCommand.js +33 -0
- package/dist/src/cli/abstract/FlavouredCommand.d.ts +2 -1
- package/dist/src/cli/abstract/FlavouredCommand.js +4 -3
- package/dist/src/cli/abstract/index.d.ts +1 -0
- package/dist/src/cli/abstract/index.js +1 -0
- package/dist/src/cli/commands/clean.d.ts +2 -2
- package/dist/src/cli/commands/clean.js +7 -6
- package/dist/src/cli/commands/components/index.d.ts +5 -4
- package/dist/src/cli/commands/components/index.js +13 -15
- package/dist/src/cli/commands/config/print.d.ts +2 -2
- package/dist/src/cli/commands/containers/index.d.ts +2 -2
- package/dist/src/cli/commands/containers/index.js +3 -3
- package/dist/src/cli/commands/containers/prune.d.ts +2 -2
- package/dist/src/cli/commands/containers/prune.js +2 -2
- package/dist/src/cli/commands/images/delete.d.ts +2 -2
- package/dist/src/cli/commands/images/delete.js +3 -2
- package/dist/src/cli/commands/images/index.d.ts +2 -2
- package/dist/src/cli/commands/images/index.js +3 -3
- package/dist/src/cli/commands/images/prune.d.ts +2 -2
- package/dist/src/cli/commands/images/prune.js +3 -2
- package/dist/src/cli/commands/{components → resources}/build.d.ts +3 -3
- package/dist/src/cli/commands/{components → resources}/build.js +11 -10
- package/dist/src/cli/commands/resources/index.d.ts +9 -0
- package/dist/src/cli/commands/resources/index.js +28 -0
- package/dist/src/cli/commands/tasks/index.d.ts +2 -2
- package/dist/src/cli/commands/tasks/index.js +4 -4
- package/dist/src/cli/commands/tasks/run.d.ts +2 -2
- package/dist/src/cli/commands/tasks/run.js +12 -5
- package/dist/src/cli/commands/up.js +5 -4
- package/dist/src/cli/hooks/init.js +1 -26
- package/dist/src/cli/utils.d.ts +1 -0
- package/dist/src/cli/utils.js +26 -0
- package/dist/src/config/convert.d.ts +2 -4
- package/dist/src/config/convert.js +12 -35
- package/dist/src/config/index.d.ts +3 -4
- package/dist/src/config/index.js +2 -3
- package/dist/src/config/schema.d.ts +71 -46
- package/dist/src/config/schema.json +187 -97
- package/dist/src/config/types.d.ts +13 -46
- package/dist/src/config/types.js +1 -1
- package/dist/src/config/validation.d.ts +3 -3
- package/dist/src/config/validation.js +12 -9
- package/dist/src/context.d.ts +1 -1
- package/dist/src/context.js +1 -0
- package/dist/src/docker/images/index.d.ts +0 -1
- package/dist/src/docker/images/index.js +0 -1
- package/dist/src/docker/index.d.ts +1 -1
- package/dist/src/docker/index.js +1 -1
- package/dist/src/docker/operations/containers/ExecContainerOperation.js +2 -1
- package/dist/src/docker/operations/images/BuildImageOperation.d.ts +7 -8
- package/dist/src/docker/operations/images/BuildImageOperation.js +16 -10
- package/dist/src/docker/resources/DockerImageResource.js +62 -0
- package/dist/src/docker/resources/index.d.ts +1 -0
- package/dist/src/docker/resources/index.js +1 -0
- package/dist/src/docker/utils.d.ts +1 -7
- package/dist/src/docker/utils.js +3 -7
- package/dist/src/errors.d.ts +9 -6
- package/dist/src/errors.js +15 -9
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +2 -0
- package/dist/src/monorepo/component.d.ts +14 -21
- package/dist/src/monorepo/component.js +40 -63
- package/dist/src/monorepo/config.d.ts +13 -15
- package/dist/src/monorepo/config.js +15 -46
- package/dist/src/monorepo/index.d.ts +1 -0
- package/dist/src/monorepo/index.js +1 -0
- package/dist/src/monorepo/monorepo.d.ts +13 -10
- package/dist/src/monorepo/monorepo.js +77 -19
- package/dist/src/monorepo/operations/components/index.d.ts +0 -1
- package/dist/src/monorepo/operations/components/index.js +0 -1
- package/dist/src/monorepo/operations/fs/CreateFileOperation.d.ts +11 -0
- package/dist/src/monorepo/operations/fs/CreateFileOperation.js +31 -0
- package/dist/src/monorepo/operations/fs/index.d.ts +1 -0
- package/dist/src/monorepo/operations/fs/index.js +1 -0
- package/dist/src/monorepo/operations/index.d.ts +1 -0
- package/dist/src/monorepo/operations/index.js +1 -0
- package/dist/src/monorepo/operations/resources/BuildResourcesOperation.d.ts +27 -0
- package/dist/src/monorepo/operations/resources/BuildResourcesOperation.js +146 -0
- package/dist/src/monorepo/operations/tasks/RunTasksOperation.js +1 -1
- package/dist/src/monorepo/plugins/{ComponentDiscoverPlugin.d.ts → AutoDockerPlugin.d.ts} +4 -4
- package/dist/src/monorepo/plugins/AutoDockerPlugin.js +46 -0
- package/dist/src/monorepo/plugins/EmbfileLoaderPlugin.js +12 -2
- package/dist/src/monorepo/plugins/index.d.ts +1 -1
- package/dist/src/monorepo/plugins/index.js +3 -3
- package/dist/src/monorepo/resources/FileResource.d.ts +1 -0
- package/dist/src/monorepo/resources/FileResource.js +13 -0
- package/dist/src/monorepo/resources/ResourceFactory.d.ts +23 -0
- package/dist/src/monorepo/resources/ResourceFactory.js +16 -0
- package/dist/src/monorepo/resources/index.d.ts +1 -0
- package/dist/src/monorepo/resources/index.js +1 -0
- package/dist/src/monorepo/store/index.d.ts +1 -1
- package/dist/src/monorepo/store/index.js +10 -2
- package/dist/src/monorepo/taskManagerFactory.d.ts +2 -2
- package/dist/src/monorepo/taskManagerFactory.js +1 -2
- package/dist/src/monorepo/types.d.ts +18 -5
- package/dist/src/monorepo/utils/{findRunOrder.d.ts → EMBCollection.d.ts} +3 -9
- package/dist/src/monorepo/utils/EMBCollection.js +101 -0
- package/dist/src/monorepo/utils/graph.d.ts +15 -0
- package/dist/src/monorepo/utils/graph.js +84 -0
- package/dist/src/monorepo/utils/index.d.ts +7 -1
- package/dist/src/monorepo/utils/index.js +14 -1
- package/dist/src/monorepo/utils/types.d.ts +2 -0
- package/dist/src/monorepo/utils/types.js +1 -0
- package/dist/src/operations/abstract/AbstractOperation.d.ts +3 -1
- package/dist/src/operations/abstract/AbstractOperation.js +3 -0
- package/dist/src/operations/types.d.ts +1 -1
- package/dist/src/prerequisites/GitPrerequisitePlugin.d.ts +1 -2
- package/dist/src/prerequisites/GitPrerequisitePlugin.js +3 -3
- package/dist/src/prerequisites/types.d.ts +2 -2
- package/dist/src/utils/TemplateExpander.d.ts +2 -1
- package/dist/src/utils/TemplateExpander.js +3 -1
- package/oclif.manifest.json +126 -89
- package/package.json +7 -2
- package/dist/src/docker/images/buildImage.d.ts +0 -19
- package/dist/src/docker/images/buildImage.js +0 -64
- package/dist/src/docker/types.d.ts +0 -14
- package/dist/src/monorepo/operations/components/BuildComponentsOperation.d.ts +0 -23
- package/dist/src/monorepo/operations/components/BuildComponentsOperation.js +0 -157
- package/dist/src/monorepo/plugins/ComponentDiscoverPlugin.js +0 -44
- package/dist/src/monorepo/project.d.ts +0 -6
- package/dist/src/monorepo/project.js +0 -8
- package/dist/src/monorepo/utils/findRunOrder.js +0 -165
- /package/dist/src/docker/{types.js → resources/DockerImageResource.d.ts} +0 -0
package/oclif.manifest.json
CHANGED
|
@@ -70,7 +70,6 @@
|
|
|
70
70
|
"pluginAlias": "@enspirit/emb",
|
|
71
71
|
"pluginName": "@enspirit/emb",
|
|
72
72
|
"pluginType": "core",
|
|
73
|
-
"strict": true,
|
|
74
73
|
"enableJsonFlag": true,
|
|
75
74
|
"isESM": true,
|
|
76
75
|
"relativePath": [
|
|
@@ -118,7 +117,6 @@
|
|
|
118
117
|
"pluginAlias": "@enspirit/emb",
|
|
119
118
|
"pluginName": "@enspirit/emb",
|
|
120
119
|
"pluginType": "core",
|
|
121
|
-
"strict": true,
|
|
122
120
|
"enableJsonFlag": true,
|
|
123
121
|
"isESM": true,
|
|
124
122
|
"relativePath": [
|
|
@@ -129,18 +127,12 @@
|
|
|
129
127
|
"up.js"
|
|
130
128
|
]
|
|
131
129
|
},
|
|
132
|
-
"components
|
|
130
|
+
"components": {
|
|
133
131
|
"aliases": [],
|
|
134
|
-
"args": {
|
|
135
|
-
|
|
136
|
-
"description": "List of components to build (defaults to all)",
|
|
137
|
-
"name": "component",
|
|
138
|
-
"required": false
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
"description": "Build the components of the monorepo",
|
|
132
|
+
"args": {},
|
|
133
|
+
"description": "List components.",
|
|
142
134
|
"examples": [
|
|
143
|
-
"<%= config.bin %> <%= command.id %>
|
|
135
|
+
"<%= config.bin %> <%= command.id %>"
|
|
144
136
|
],
|
|
145
137
|
"flags": {
|
|
146
138
|
"json": {
|
|
@@ -157,18 +149,46 @@
|
|
|
157
149
|
"hasDynamicHelp": false,
|
|
158
150
|
"multiple": false,
|
|
159
151
|
"type": "option"
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"hasDynamicHelp": false,
|
|
155
|
+
"hiddenAliases": [],
|
|
156
|
+
"id": "components",
|
|
157
|
+
"pluginAlias": "@enspirit/emb",
|
|
158
|
+
"pluginName": "@enspirit/emb",
|
|
159
|
+
"pluginType": "core",
|
|
160
|
+
"enableJsonFlag": true,
|
|
161
|
+
"isESM": true,
|
|
162
|
+
"relativePath": [
|
|
163
|
+
"dist",
|
|
164
|
+
"src",
|
|
165
|
+
"cli",
|
|
166
|
+
"commands",
|
|
167
|
+
"components",
|
|
168
|
+
"index.js"
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
"containers": {
|
|
172
|
+
"aliases": [
|
|
173
|
+
"ps"
|
|
174
|
+
],
|
|
175
|
+
"args": {},
|
|
176
|
+
"description": "List docker containers.",
|
|
177
|
+
"examples": [
|
|
178
|
+
"<%= config.bin %> <%= command.id %>"
|
|
179
|
+
],
|
|
180
|
+
"flags": {
|
|
181
|
+
"json": {
|
|
182
|
+
"description": "Format output as json.",
|
|
183
|
+
"helpGroup": "GLOBAL",
|
|
184
|
+
"name": "json",
|
|
165
185
|
"allowNo": false,
|
|
166
186
|
"type": "boolean"
|
|
167
187
|
},
|
|
168
|
-
"
|
|
169
|
-
"char": "
|
|
170
|
-
"description": "
|
|
171
|
-
"name": "
|
|
188
|
+
"all": {
|
|
189
|
+
"char": "a",
|
|
190
|
+
"description": "Retun all containers. By default, only running containers are shown",
|
|
191
|
+
"name": "all",
|
|
172
192
|
"required": false,
|
|
173
193
|
"allowNo": false,
|
|
174
194
|
"type": "boolean"
|
|
@@ -176,11 +196,11 @@
|
|
|
176
196
|
},
|
|
177
197
|
"hasDynamicHelp": false,
|
|
178
198
|
"hiddenAliases": [],
|
|
179
|
-
"id": "
|
|
199
|
+
"id": "containers",
|
|
180
200
|
"pluginAlias": "@enspirit/emb",
|
|
181
201
|
"pluginName": "@enspirit/emb",
|
|
182
202
|
"pluginType": "core",
|
|
183
|
-
"strict":
|
|
203
|
+
"strict": true,
|
|
184
204
|
"enableJsonFlag": true,
|
|
185
205
|
"isESM": true,
|
|
186
206
|
"relativePath": [
|
|
@@ -188,14 +208,14 @@
|
|
|
188
208
|
"src",
|
|
189
209
|
"cli",
|
|
190
210
|
"commands",
|
|
191
|
-
"
|
|
192
|
-
"
|
|
211
|
+
"containers",
|
|
212
|
+
"index.js"
|
|
193
213
|
]
|
|
194
214
|
},
|
|
195
|
-
"
|
|
215
|
+
"containers:prune": {
|
|
196
216
|
"aliases": [],
|
|
197
217
|
"args": {},
|
|
198
|
-
"description": "
|
|
218
|
+
"description": "Prune containers.",
|
|
199
219
|
"examples": [
|
|
200
220
|
"<%= config.bin %> <%= command.id %>"
|
|
201
221
|
],
|
|
@@ -206,19 +226,11 @@
|
|
|
206
226
|
"name": "json",
|
|
207
227
|
"allowNo": false,
|
|
208
228
|
"type": "boolean"
|
|
209
|
-
},
|
|
210
|
-
"flavor": {
|
|
211
|
-
"description": "Specify the flavor to use.",
|
|
212
|
-
"name": "flavor",
|
|
213
|
-
"required": false,
|
|
214
|
-
"hasDynamicHelp": false,
|
|
215
|
-
"multiple": false,
|
|
216
|
-
"type": "option"
|
|
217
229
|
}
|
|
218
230
|
},
|
|
219
231
|
"hasDynamicHelp": false,
|
|
220
232
|
"hiddenAliases": [],
|
|
221
|
-
"id": "
|
|
233
|
+
"id": "containers:prune",
|
|
222
234
|
"pluginAlias": "@enspirit/emb",
|
|
223
235
|
"pluginName": "@enspirit/emb",
|
|
224
236
|
"pluginType": "core",
|
|
@@ -230,8 +242,8 @@
|
|
|
230
242
|
"src",
|
|
231
243
|
"cli",
|
|
232
244
|
"commands",
|
|
233
|
-
"
|
|
234
|
-
"
|
|
245
|
+
"containers",
|
|
246
|
+
"prune.js"
|
|
235
247
|
]
|
|
236
248
|
},
|
|
237
249
|
"config:print": {
|
|
@@ -264,7 +276,6 @@
|
|
|
264
276
|
"pluginAlias": "@enspirit/emb",
|
|
265
277
|
"pluginName": "@enspirit/emb",
|
|
266
278
|
"pluginType": "core",
|
|
267
|
-
"strict": true,
|
|
268
279
|
"enableJsonFlag": true,
|
|
269
280
|
"isESM": true,
|
|
270
281
|
"relativePath": [
|
|
@@ -276,12 +287,10 @@
|
|
|
276
287
|
"print.js"
|
|
277
288
|
]
|
|
278
289
|
},
|
|
279
|
-
"
|
|
280
|
-
"aliases": [
|
|
281
|
-
"ps"
|
|
282
|
-
],
|
|
290
|
+
"images:delete": {
|
|
291
|
+
"aliases": [],
|
|
283
292
|
"args": {},
|
|
284
|
-
"description": "
|
|
293
|
+
"description": "Delete project images.",
|
|
285
294
|
"examples": [
|
|
286
295
|
"<%= config.bin %> <%= command.id %>"
|
|
287
296
|
],
|
|
@@ -293,10 +302,10 @@
|
|
|
293
302
|
"allowNo": false,
|
|
294
303
|
"type": "boolean"
|
|
295
304
|
},
|
|
296
|
-
"
|
|
297
|
-
"char": "
|
|
298
|
-
"description": "
|
|
299
|
-
"name": "
|
|
305
|
+
"force": {
|
|
306
|
+
"char": "f",
|
|
307
|
+
"description": "Remove the image even if it is being used by stopped containers or has other tags",
|
|
308
|
+
"name": "force",
|
|
300
309
|
"required": false,
|
|
301
310
|
"allowNo": false,
|
|
302
311
|
"type": "boolean"
|
|
@@ -304,7 +313,7 @@
|
|
|
304
313
|
},
|
|
305
314
|
"hasDynamicHelp": false,
|
|
306
315
|
"hiddenAliases": [],
|
|
307
|
-
"id": "
|
|
316
|
+
"id": "images:delete",
|
|
308
317
|
"pluginAlias": "@enspirit/emb",
|
|
309
318
|
"pluginName": "@enspirit/emb",
|
|
310
319
|
"pluginType": "core",
|
|
@@ -316,14 +325,14 @@
|
|
|
316
325
|
"src",
|
|
317
326
|
"cli",
|
|
318
327
|
"commands",
|
|
319
|
-
"
|
|
320
|
-
"
|
|
328
|
+
"images",
|
|
329
|
+
"delete.js"
|
|
321
330
|
]
|
|
322
331
|
},
|
|
323
|
-
"
|
|
332
|
+
"images": {
|
|
324
333
|
"aliases": [],
|
|
325
334
|
"args": {},
|
|
326
|
-
"description": "
|
|
335
|
+
"description": "List docker images.",
|
|
327
336
|
"examples": [
|
|
328
337
|
"<%= config.bin %> <%= command.id %>"
|
|
329
338
|
],
|
|
@@ -334,11 +343,19 @@
|
|
|
334
343
|
"name": "json",
|
|
335
344
|
"allowNo": false,
|
|
336
345
|
"type": "boolean"
|
|
346
|
+
},
|
|
347
|
+
"all": {
|
|
348
|
+
"char": "a",
|
|
349
|
+
"description": "Show all images. Only images from a final layer (no children) are shown by default.",
|
|
350
|
+
"name": "all",
|
|
351
|
+
"required": false,
|
|
352
|
+
"allowNo": false,
|
|
353
|
+
"type": "boolean"
|
|
337
354
|
}
|
|
338
355
|
},
|
|
339
356
|
"hasDynamicHelp": false,
|
|
340
357
|
"hiddenAliases": [],
|
|
341
|
-
"id": "
|
|
358
|
+
"id": "images",
|
|
342
359
|
"pluginAlias": "@enspirit/emb",
|
|
343
360
|
"pluginName": "@enspirit/emb",
|
|
344
361
|
"pluginType": "core",
|
|
@@ -350,14 +367,14 @@
|
|
|
350
367
|
"src",
|
|
351
368
|
"cli",
|
|
352
369
|
"commands",
|
|
353
|
-
"
|
|
354
|
-
"
|
|
370
|
+
"images",
|
|
371
|
+
"index.js"
|
|
355
372
|
]
|
|
356
373
|
},
|
|
357
|
-
"images:
|
|
374
|
+
"images:prune": {
|
|
358
375
|
"aliases": [],
|
|
359
376
|
"args": {},
|
|
360
|
-
"description": "
|
|
377
|
+
"description": "Prune project images.",
|
|
361
378
|
"examples": [
|
|
362
379
|
"<%= config.bin %> <%= command.id %>"
|
|
363
380
|
],
|
|
@@ -369,10 +386,10 @@
|
|
|
369
386
|
"allowNo": false,
|
|
370
387
|
"type": "boolean"
|
|
371
388
|
},
|
|
372
|
-
"
|
|
373
|
-
"char": "
|
|
374
|
-
"description": "
|
|
375
|
-
"name": "
|
|
389
|
+
"all": {
|
|
390
|
+
"char": "a",
|
|
391
|
+
"description": "Prune all images. When set to true all images will be pruned, not only dangling ones",
|
|
392
|
+
"name": "all",
|
|
376
393
|
"required": false,
|
|
377
394
|
"allowNo": false,
|
|
378
395
|
"type": "boolean"
|
|
@@ -380,7 +397,7 @@
|
|
|
380
397
|
},
|
|
381
398
|
"hasDynamicHelp": false,
|
|
382
399
|
"hiddenAliases": [],
|
|
383
|
-
"id": "images:
|
|
400
|
+
"id": "images:prune",
|
|
384
401
|
"pluginAlias": "@enspirit/emb",
|
|
385
402
|
"pluginName": "@enspirit/emb",
|
|
386
403
|
"pluginType": "core",
|
|
@@ -393,15 +410,21 @@
|
|
|
393
410
|
"cli",
|
|
394
411
|
"commands",
|
|
395
412
|
"images",
|
|
396
|
-
"
|
|
413
|
+
"prune.js"
|
|
397
414
|
]
|
|
398
415
|
},
|
|
399
|
-
"
|
|
416
|
+
"resources:build": {
|
|
400
417
|
"aliases": [],
|
|
401
|
-
"args": {
|
|
402
|
-
|
|
418
|
+
"args": {
|
|
419
|
+
"component": {
|
|
420
|
+
"description": "List of resources to build (defaults to all)",
|
|
421
|
+
"name": "component",
|
|
422
|
+
"required": false
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
"description": "Build the resources of the monorepo",
|
|
403
426
|
"examples": [
|
|
404
|
-
"<%= config.bin %> <%= command.id %>"
|
|
427
|
+
"<%= config.bin %> <%= command.id %> build --flavor development"
|
|
405
428
|
],
|
|
406
429
|
"flags": {
|
|
407
430
|
"json": {
|
|
@@ -411,10 +434,25 @@
|
|
|
411
434
|
"allowNo": false,
|
|
412
435
|
"type": "boolean"
|
|
413
436
|
},
|
|
414
|
-
"
|
|
415
|
-
"
|
|
416
|
-
"
|
|
417
|
-
"
|
|
437
|
+
"flavor": {
|
|
438
|
+
"description": "Specify the flavor to use.",
|
|
439
|
+
"name": "flavor",
|
|
440
|
+
"required": false,
|
|
441
|
+
"hasDynamicHelp": false,
|
|
442
|
+
"multiple": false,
|
|
443
|
+
"type": "option"
|
|
444
|
+
},
|
|
445
|
+
"dry-run": {
|
|
446
|
+
"description": "Do not build the resources but only produce build meta information",
|
|
447
|
+
"name": "dry-run",
|
|
448
|
+
"required": false,
|
|
449
|
+
"allowNo": false,
|
|
450
|
+
"type": "boolean"
|
|
451
|
+
},
|
|
452
|
+
"force": {
|
|
453
|
+
"char": "f",
|
|
454
|
+
"description": "Bypass the cache and force the build",
|
|
455
|
+
"name": "force",
|
|
418
456
|
"required": false,
|
|
419
457
|
"allowNo": false,
|
|
420
458
|
"type": "boolean"
|
|
@@ -422,11 +460,11 @@
|
|
|
422
460
|
},
|
|
423
461
|
"hasDynamicHelp": false,
|
|
424
462
|
"hiddenAliases": [],
|
|
425
|
-
"id": "
|
|
463
|
+
"id": "resources:build",
|
|
426
464
|
"pluginAlias": "@enspirit/emb",
|
|
427
465
|
"pluginName": "@enspirit/emb",
|
|
428
466
|
"pluginType": "core",
|
|
429
|
-
"strict":
|
|
467
|
+
"strict": false,
|
|
430
468
|
"enableJsonFlag": true,
|
|
431
469
|
"isESM": true,
|
|
432
470
|
"relativePath": [
|
|
@@ -434,14 +472,14 @@
|
|
|
434
472
|
"src",
|
|
435
473
|
"cli",
|
|
436
474
|
"commands",
|
|
437
|
-
"
|
|
438
|
-
"
|
|
475
|
+
"resources",
|
|
476
|
+
"build.js"
|
|
439
477
|
]
|
|
440
478
|
},
|
|
441
|
-
"
|
|
479
|
+
"resources": {
|
|
442
480
|
"aliases": [],
|
|
443
481
|
"args": {},
|
|
444
|
-
"description": "
|
|
482
|
+
"description": "List resources.",
|
|
445
483
|
"examples": [
|
|
446
484
|
"<%= config.bin %> <%= command.id %>"
|
|
447
485
|
],
|
|
@@ -453,22 +491,21 @@
|
|
|
453
491
|
"allowNo": false,
|
|
454
492
|
"type": "boolean"
|
|
455
493
|
},
|
|
456
|
-
"
|
|
457
|
-
"
|
|
458
|
-
"
|
|
459
|
-
"name": "all",
|
|
494
|
+
"flavor": {
|
|
495
|
+
"description": "Specify the flavor to use.",
|
|
496
|
+
"name": "flavor",
|
|
460
497
|
"required": false,
|
|
461
|
-
"
|
|
462
|
-
"
|
|
498
|
+
"hasDynamicHelp": false,
|
|
499
|
+
"multiple": false,
|
|
500
|
+
"type": "option"
|
|
463
501
|
}
|
|
464
502
|
},
|
|
465
503
|
"hasDynamicHelp": false,
|
|
466
504
|
"hiddenAliases": [],
|
|
467
|
-
"id": "
|
|
505
|
+
"id": "resources",
|
|
468
506
|
"pluginAlias": "@enspirit/emb",
|
|
469
507
|
"pluginName": "@enspirit/emb",
|
|
470
508
|
"pluginType": "core",
|
|
471
|
-
"strict": true,
|
|
472
509
|
"enableJsonFlag": true,
|
|
473
510
|
"isESM": true,
|
|
474
511
|
"relativePath": [
|
|
@@ -476,8 +513,8 @@
|
|
|
476
513
|
"src",
|
|
477
514
|
"cli",
|
|
478
515
|
"commands",
|
|
479
|
-
"
|
|
480
|
-
"
|
|
516
|
+
"resources",
|
|
517
|
+
"index.js"
|
|
481
518
|
]
|
|
482
519
|
},
|
|
483
520
|
"tasks": {
|
|
@@ -574,5 +611,5 @@
|
|
|
574
611
|
]
|
|
575
612
|
}
|
|
576
613
|
},
|
|
577
|
-
"version": "0.
|
|
614
|
+
"version": "0.1.1"
|
|
578
615
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enspirit/emb",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"keywords": ["monorepo", "docker", "taskrunner", "ci", "docker compose", "sentinel", "makefile"],
|
|
6
6
|
"author": "Louis Lambeau <louis.lambeau@enspirit.be>",
|
|
7
7
|
"license": "ISC",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"build": "rimraf dist && npm run build:types && npm run build:ts && npm run copy:proto",
|
|
14
14
|
"copy:proto": "cp -r src/docker/protobuf/*.proto dist/src/docker/protobuf/",
|
|
15
15
|
"build:ts": "tsc -b && tsc-alias",
|
|
16
|
+
"build:ts:watch": "tsc --watch",
|
|
16
17
|
"build:types": "json2ts src/config/schema.json > src/config/schema.ts",
|
|
17
18
|
"lint": "eslint",
|
|
18
19
|
"lint:fix": "eslint --fix",
|
|
@@ -22,9 +23,11 @@
|
|
|
22
23
|
"postpack": "shx rm -f oclif.manifest.json",
|
|
23
24
|
"posttest": "npm run lint",
|
|
24
25
|
"prepack": "oclif manifest && oclif readme",
|
|
25
|
-
"test": "npm run build:types && npm run test:unit",
|
|
26
|
+
"test": "npm run build:types && npm run test:unit && npm run test:integration",
|
|
26
27
|
"test:unit": "vitest run tests/unit",
|
|
28
|
+
"test:unit:watch": "vitest tests/unit",
|
|
27
29
|
"test:integration": "vitest run tests/integration",
|
|
30
|
+
"test:integration:watch": "vitest tests/integration",
|
|
28
31
|
"test:watch": "vitest",
|
|
29
32
|
"version": "oclif readme && git add README.md"
|
|
30
33
|
},
|
|
@@ -43,6 +46,7 @@
|
|
|
43
46
|
"dockerode": "^4.0.7",
|
|
44
47
|
"dotenv": "^17.2.1",
|
|
45
48
|
"execa": "^9.6.0",
|
|
49
|
+
"fast-json-patch": "^3.1.1",
|
|
46
50
|
"find-up": "^7.0.0",
|
|
47
51
|
"glob": "^11.0.3",
|
|
48
52
|
"graphlib": "^2.1.8",
|
|
@@ -111,6 +115,7 @@
|
|
|
111
115
|
"topics": {
|
|
112
116
|
"images": {"description": "List, delete, prune docker containers" },
|
|
113
117
|
"containers": {"description": "List, delete, prune docker images" },
|
|
118
|
+
"resources": {"description": "List, clean, build resources" },
|
|
114
119
|
"components": {"description": "List & build components resources" },
|
|
115
120
|
"config": {"description": "It's all about config" },
|
|
116
121
|
"tasks": {"description": "List and run tasks" }
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Writable } from 'node:stream';
|
|
2
|
-
import { DockerComponentBuild } from '../index.js';
|
|
3
|
-
import { Component } from '../../monorepo/index.js';
|
|
4
|
-
export type MobyTrace = {
|
|
5
|
-
aux: unknown;
|
|
6
|
-
error?: string;
|
|
7
|
-
id: string;
|
|
8
|
-
};
|
|
9
|
-
export type Progress = {
|
|
10
|
-
error?: string;
|
|
11
|
-
name?: string;
|
|
12
|
-
};
|
|
13
|
-
export type DockerBuildExtraOptions = {
|
|
14
|
-
output?: Writable;
|
|
15
|
-
};
|
|
16
|
-
export type BuildDockerImageOutput = DockerComponentBuild & {
|
|
17
|
-
traces: Array<MobyTrace>;
|
|
18
|
-
};
|
|
19
|
-
export declare const buildDockerImage: (component: Component, opts?: DockerBuildExtraOptions, progress?: (progress: Progress) => void) => Promise<BuildDockerImageOutput | undefined>;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { getContext } from '../../index.js';
|
|
2
|
-
import { decodeBuildkitStatusResponse, getSentinelFile, } from '../index.js';
|
|
3
|
-
import { FilePrerequisitePlugin } from '../../prerequisites/index.js';
|
|
4
|
-
export const buildDockerImage = async (component, opts = {}, progress) => {
|
|
5
|
-
const cmp = await component.toDockerBuild();
|
|
6
|
-
const files = (cmp.prerequisites || []).map((f) => f.path);
|
|
7
|
-
const { docker, monorepo } = getContext();
|
|
8
|
-
/** SENTINEL LOGIC */
|
|
9
|
-
// TODO: make configurable
|
|
10
|
-
const prereqPlugin = new FilePrerequisitePlugin();
|
|
11
|
-
const preBuildMeta = await prereqPlugin.meta(component, cmp.prerequisites, 'pre');
|
|
12
|
-
const sentinelFile = getSentinelFile(component);
|
|
13
|
-
let lastValue;
|
|
14
|
-
try {
|
|
15
|
-
lastValue = (await monorepo.store.readFile(sentinelFile)).toString();
|
|
16
|
-
}
|
|
17
|
-
catch {
|
|
18
|
-
lastValue = undefined;
|
|
19
|
-
}
|
|
20
|
-
if (lastValue) {
|
|
21
|
-
const diff = await prereqPlugin.diff(component, cmp.prerequisites, lastValue, preBuildMeta);
|
|
22
|
-
if (!diff) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
const stream = await docker.buildImage({
|
|
27
|
-
context: cmp.context,
|
|
28
|
-
src: [...files],
|
|
29
|
-
}, {
|
|
30
|
-
buildargs: cmp.buildArgs,
|
|
31
|
-
dockerfile: cmp.dockerfile,
|
|
32
|
-
labels: cmp.labels,
|
|
33
|
-
t: cmp.name + ':' + (cmp.tag || 'latest'),
|
|
34
|
-
target: cmp.target,
|
|
35
|
-
version: '2',
|
|
36
|
-
});
|
|
37
|
-
if (opts.output) {
|
|
38
|
-
stream.pipe(opts.output);
|
|
39
|
-
}
|
|
40
|
-
stream.on('close', async () => {
|
|
41
|
-
const sentinelValue = await prereqPlugin.meta(component, cmp.prerequisites, 'post');
|
|
42
|
-
await monorepo.store.writeFile(sentinelFile, sentinelValue);
|
|
43
|
-
});
|
|
44
|
-
return new Promise((resolve, reject) => {
|
|
45
|
-
docker.modem.followProgress(stream, (err, traces) => {
|
|
46
|
-
return err ? reject(err) : resolve({ ...cmp, traces });
|
|
47
|
-
}, async (trace) => {
|
|
48
|
-
if (trace.error) {
|
|
49
|
-
reject(new Error(trace.error));
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
try {
|
|
53
|
-
const { vertexes } = await decodeBuildkitStatusResponse(trace.aux);
|
|
54
|
-
vertexes.forEach((v) => {
|
|
55
|
-
progress?.(v);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
console.error(error);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FilePrerequisite } from '../prerequisites/index.js';
|
|
2
|
-
export type EnvVariable = {
|
|
3
|
-
name: string;
|
|
4
|
-
};
|
|
5
|
-
export interface DockerComponentBuild {
|
|
6
|
-
buildArgs?: Record<string, string>;
|
|
7
|
-
context: string;
|
|
8
|
-
dockerfile: string;
|
|
9
|
-
labels?: Record<string, string>;
|
|
10
|
-
name: string;
|
|
11
|
-
prerequisites: Array<FilePrerequisite>;
|
|
12
|
-
tag: string;
|
|
13
|
-
target?: string;
|
|
14
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import * as z from 'zod';
|
|
2
|
-
import { DockerComponentBuild } from '../../../docker/index.js';
|
|
3
|
-
import { AbstractOperation } from '../../../operations/index.js';
|
|
4
|
-
export type BuildComponentMeta = {
|
|
5
|
-
dryRun?: boolean;
|
|
6
|
-
cacheHit?: boolean;
|
|
7
|
-
force?: boolean;
|
|
8
|
-
build: DockerComponentBuild;
|
|
9
|
-
preBuildMeta?: string;
|
|
10
|
-
sentinelFile: string;
|
|
11
|
-
};
|
|
12
|
-
declare const schema: z.ZodObject<{
|
|
13
|
-
components: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
-
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
-
silent: z.ZodOptional<z.ZodBoolean>;
|
|
16
|
-
force: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
-
}, z.core.$strip>;
|
|
18
|
-
export declare class BuildComponentsOperation extends AbstractOperation<typeof schema, Record<string, BuildComponentMeta>> {
|
|
19
|
-
constructor();
|
|
20
|
-
protected _run(input: z.input<typeof schema>): Promise<Record<string, BuildComponentMeta>>;
|
|
21
|
-
private buildComponent;
|
|
22
|
-
}
|
|
23
|
-
export {};
|