@enspirit/emb 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/src/cli/commands/up.js +0 -3
- package/dist/src/docker/operations/images/BuildImageOperation.d.ts +7 -2
- package/dist/src/docker/operations/images/BuildImageOperation.js +61 -9
- package/dist/src/docker/operations/images/PushImagesOperation.d.ts +14 -0
- package/dist/src/docker/operations/images/PushImagesOperation.js +22 -0
- package/dist/src/docker/resources/DockerImageResource.js +24 -25
- package/dist/src/errors.d.ts +5 -0
- package/dist/src/errors.js +9 -0
- package/dist/src/monorepo/monorepo.d.ts +3 -1
- package/dist/src/monorepo/monorepo.js +5 -2
- package/dist/src/monorepo/operations/fs/CreateFileOperation.d.ts +3 -1
- package/dist/src/monorepo/operations/fs/CreateFileOperation.js +3 -1
- package/dist/src/monorepo/operations/resources/BuildResourcesOperation.d.ts +3 -6
- package/dist/src/monorepo/operations/resources/BuildResourcesOperation.js +20 -31
- package/dist/src/monorepo/operations/shell/ExecuteLocalCommandOperation.d.ts +2 -2
- package/dist/src/monorepo/operations/shell/ExecuteLocalCommandOperation.js +3 -1
- package/dist/src/monorepo/operations/tasks/RunTasksOperation.js +0 -2
- package/dist/src/monorepo/resources/FileResourceBuilder.d.ts +15 -0
- package/dist/src/monorepo/resources/FileResourceBuilder.js +19 -0
- package/dist/src/monorepo/resources/ResourceFactory.d.ts +7 -29
- package/dist/src/monorepo/resources/ResourceFactory.js +5 -5
- package/dist/src/monorepo/resources/abstract/AbstractResourceBuilder.d.ts +23 -0
- package/dist/src/monorepo/resources/abstract/AbstractResourceBuilder.js +18 -0
- package/dist/src/monorepo/resources/abstract/SentinelFileBasedBuilder.d.ts +27 -0
- package/dist/src/monorepo/resources/abstract/SentinelFileBasedBuilder.js +46 -0
- package/dist/src/monorepo/resources/abstract/index.d.ts +2 -0
- package/dist/src/monorepo/resources/abstract/index.js +2 -0
- package/dist/src/monorepo/resources/index.d.ts +3 -1
- package/dist/src/monorepo/resources/index.js +3 -1
- package/dist/src/monorepo/resources/types.d.ts +36 -0
- package/dist/src/monorepo/types.d.ts +3 -1
- package/dist/src/operations/abstract/AbstractOperation.d.ts +5 -5
- package/dist/src/operations/types.d.ts +1 -1
- package/oclif.manifest.json +117 -117
- package/package.json +1 -1
- package/dist/src/monorepo/resources/FileResource.js +0 -17
- /package/dist/src/monorepo/resources/{FileResource.d.ts → types.js} +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ResourceInfo } from '../../../index.js';
|
|
2
|
+
import { Writable } from 'node:stream';
|
|
3
|
+
import { IOperation } from '../../../operations/types.js';
|
|
4
|
+
import { ResourceBuildContext } from '../ResourceFactory.js';
|
|
5
|
+
import { IResourceBuilder } from '../types.js';
|
|
6
|
+
export declare abstract class AbstractResourceBuilder<I, O, R> implements IResourceBuilder<I, O, R> {
|
|
7
|
+
protected context: ResourceBuildContext<I>;
|
|
8
|
+
constructor(context: ResourceBuildContext<I>);
|
|
9
|
+
abstract _build(resource: ResourceInfo<I>, out?: Writable): Promise<{
|
|
10
|
+
input: I;
|
|
11
|
+
operation: IOperation<I, O>;
|
|
12
|
+
}>;
|
|
13
|
+
build(resource: ResourceInfo<I>, out?: Writable): Promise<{
|
|
14
|
+
input: I;
|
|
15
|
+
operation: IOperation<I, O>;
|
|
16
|
+
}>;
|
|
17
|
+
abstract _mustBuild?(resource: ResourceInfo<I>): Promise<R | undefined> | undefined;
|
|
18
|
+
mustBuild(resource: ResourceInfo<I>): Promise<R | undefined>;
|
|
19
|
+
_publish?(resource: ResourceInfo<I>, out?: Writable): Promise<void>;
|
|
20
|
+
publish?(resource: ResourceInfo<I>, out?: Writable): Promise<void>;
|
|
21
|
+
abstract _commit(resource: ResourceInfo<I>, output: O, reason: R): Promise<void>;
|
|
22
|
+
commit(resource: ResourceInfo<I>, output: O, reason: R): Promise<void>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class AbstractResourceBuilder {
|
|
2
|
+
context;
|
|
3
|
+
constructor(context) {
|
|
4
|
+
this.context = context;
|
|
5
|
+
}
|
|
6
|
+
build(resource, out) {
|
|
7
|
+
return this._build(resource, out);
|
|
8
|
+
}
|
|
9
|
+
async mustBuild(resource) {
|
|
10
|
+
return this._mustBuild?.(resource);
|
|
11
|
+
}
|
|
12
|
+
async publish(resource, out) {
|
|
13
|
+
return this._publish?.(resource, out);
|
|
14
|
+
}
|
|
15
|
+
async commit(resource, output, reason) {
|
|
16
|
+
return this._commit?.(resource, output, reason);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ResourceInfo } from '../../../index.js';
|
|
2
|
+
import { Writable } from 'node:stream';
|
|
3
|
+
import { IOperation } from '../../../operations/types.js';
|
|
4
|
+
import { AbstractResourceBuilder } from './AbstractResourceBuilder.js';
|
|
5
|
+
export type SentinelFile<T> = {
|
|
6
|
+
mtime: number;
|
|
7
|
+
data?: T;
|
|
8
|
+
};
|
|
9
|
+
export declare abstract class SentinelFileBasedBuilder<I, O, SentinelData extends {
|
|
10
|
+
mtime: number;
|
|
11
|
+
}> extends AbstractResourceBuilder<I, O, SentinelData> {
|
|
12
|
+
private lastSentinelFile?;
|
|
13
|
+
private newSentinelData?;
|
|
14
|
+
/**
|
|
15
|
+
* Checks wether or not the sentinel file is more recent
|
|
16
|
+
* that the output of the builder's sentinel data
|
|
17
|
+
*/
|
|
18
|
+
mustBuild(resource: ResourceInfo<I>): Promise<SentinelData | undefined>;
|
|
19
|
+
build(resource: ResourceInfo<I>, out?: Writable): Promise<{
|
|
20
|
+
input: I;
|
|
21
|
+
operation: IOperation<I, O>;
|
|
22
|
+
}>;
|
|
23
|
+
private get sentinelFileName();
|
|
24
|
+
private storeSentinelData;
|
|
25
|
+
private readSentinel;
|
|
26
|
+
_commit(_resource: ResourceInfo<I>, _output: O, reason: SentinelData): Promise<void>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AbstractResourceBuilder } from './AbstractResourceBuilder.js';
|
|
2
|
+
export class SentinelFileBasedBuilder extends AbstractResourceBuilder {
|
|
3
|
+
lastSentinelFile;
|
|
4
|
+
newSentinelData;
|
|
5
|
+
/**
|
|
6
|
+
* Checks wether or not the sentinel file is more recent
|
|
7
|
+
* that the output of the builder's sentinel data
|
|
8
|
+
*/
|
|
9
|
+
async mustBuild(resource) {
|
|
10
|
+
if (!this._mustBuild) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
this.lastSentinelFile = await this.readSentinel();
|
|
14
|
+
this.newSentinelData = await this._mustBuild(resource);
|
|
15
|
+
if (!(this.lastSentinelFile && this.newSentinelData)) {
|
|
16
|
+
return this.newSentinelData;
|
|
17
|
+
}
|
|
18
|
+
if (this.lastSentinelFile.mtime < this.newSentinelData.mtime) {
|
|
19
|
+
return this.newSentinelData;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async build(resource, out) {
|
|
23
|
+
return this._build(resource, out);
|
|
24
|
+
}
|
|
25
|
+
get sentinelFileName() {
|
|
26
|
+
const { monorepo, config } = this.context;
|
|
27
|
+
return `sentinels/flavors/${monorepo.currentFlavor}/${config.component}/${config.name}.built`;
|
|
28
|
+
}
|
|
29
|
+
async storeSentinelData(data) {
|
|
30
|
+
await this.context.monorepo.store.writeFile(this.sentinelFileName, JSON.stringify(data));
|
|
31
|
+
}
|
|
32
|
+
async readSentinel() {
|
|
33
|
+
const stats = await this.context.monorepo.store.stat(this.sentinelFileName, false);
|
|
34
|
+
if (!stats) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
const data = await this.context.monorepo.store.readFile(this.sentinelFileName, false);
|
|
38
|
+
return {
|
|
39
|
+
data: data ? JSON.parse(data) : data,
|
|
40
|
+
mtime: stats.mtime.getTime(),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async _commit(_resource, _output, reason) {
|
|
44
|
+
this.storeSentinelData(reason);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ResourceInfo } from '../../index.js';
|
|
2
|
+
import { Writable } from 'node:stream';
|
|
3
|
+
import { IOperation } from '../../operations/types.js';
|
|
4
|
+
export type IResourceBuilder<Input, Output, Reason> = {
|
|
5
|
+
/**
|
|
6
|
+
* Returns input and operation required to actually
|
|
7
|
+
* build the resources.
|
|
8
|
+
* This allows the dry-run mechanism to be implemented outside
|
|
9
|
+
* resource implementations
|
|
10
|
+
*
|
|
11
|
+
* @param resource The resource config
|
|
12
|
+
* @param out The Writable to use to write logs
|
|
13
|
+
*/
|
|
14
|
+
build(resource: ResourceInfo<Input>, out?: Writable): Promise<{
|
|
15
|
+
input: Input;
|
|
16
|
+
operation: IOperation<Input, Output>;
|
|
17
|
+
}>;
|
|
18
|
+
mustBuild?: (resource: ResourceInfo<Input>) => Promise<Reason | undefined>;
|
|
19
|
+
/**
|
|
20
|
+
* Resource builders will be informed when a successful build of resource
|
|
21
|
+
* has been produced through them
|
|
22
|
+
*
|
|
23
|
+
* This allows them to store metadata to improve their caching algorithm
|
|
24
|
+
*/
|
|
25
|
+
commit?: (resource: ResourceInfo<Input>, output: Output, reason: Reason) => Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Similar to .build(), must return input and operation required to actually
|
|
28
|
+
* publish the resources.
|
|
29
|
+
* This allows the dry-run mechanism to be implemented outside
|
|
30
|
+
* resource implementations
|
|
31
|
+
*
|
|
32
|
+
* @param resource The resource config
|
|
33
|
+
* @param out The Writable to use to write logs
|
|
34
|
+
*/
|
|
35
|
+
publish?(resource: ResourceInfo<Input>, out?: Writable): Promise<void>;
|
|
36
|
+
};
|
|
@@ -4,7 +4,9 @@ export type ComponentIdentifiable<T> = T & {
|
|
|
4
4
|
name: string;
|
|
5
5
|
component: string;
|
|
6
6
|
};
|
|
7
|
-
export type ResourceInfo = ComponentIdentifiable<IResourceConfig
|
|
7
|
+
export type ResourceInfo<T = unknown> = ComponentIdentifiable<IResourceConfig> & {
|
|
8
|
+
params?: T;
|
|
9
|
+
};
|
|
8
10
|
export type Resources = {
|
|
9
11
|
[k: string]: ResourceInfo;
|
|
10
12
|
};
|
|
@@ -3,10 +3,10 @@ import * as z from 'zod';
|
|
|
3
3
|
import { IOperation } from '../index.js';
|
|
4
4
|
export type OpInput<A extends AbstractOperation<z.Schema, unknown>> = A extends AbstractOperation<infer I, unknown> ? z.infer<I> : never;
|
|
5
5
|
export type OpOutput<A extends AbstractOperation<z.Schema, unknown>> = A extends AbstractOperation<z.Schema, infer O> ? O : never;
|
|
6
|
-
export declare abstract class AbstractOperation<
|
|
7
|
-
protected inputSchema:
|
|
6
|
+
export declare abstract class AbstractOperation<I extends z.Schema, O> implements IOperation<z.infer<I>, O> {
|
|
7
|
+
protected inputSchema: I;
|
|
8
8
|
protected context: EmbContext;
|
|
9
|
-
constructor(inputSchema:
|
|
10
|
-
protected abstract _run(input: z.infer<
|
|
11
|
-
run(input:
|
|
9
|
+
constructor(inputSchema: I);
|
|
10
|
+
protected abstract _run(input: z.infer<I>): Promise<O>;
|
|
11
|
+
run(input: z.infer<I>): Promise<O>;
|
|
12
12
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -268,10 +268,12 @@
|
|
|
268
268
|
"shell.js"
|
|
269
269
|
]
|
|
270
270
|
},
|
|
271
|
-
"
|
|
272
|
-
"aliases": [
|
|
271
|
+
"containers": {
|
|
272
|
+
"aliases": [
|
|
273
|
+
"ps"
|
|
274
|
+
],
|
|
273
275
|
"args": {},
|
|
274
|
-
"description": "
|
|
276
|
+
"description": "List docker containers.",
|
|
275
277
|
"examples": [
|
|
276
278
|
"<%= config.bin %> <%= command.id %>"
|
|
277
279
|
],
|
|
@@ -283,21 +285,22 @@
|
|
|
283
285
|
"allowNo": false,
|
|
284
286
|
"type": "boolean"
|
|
285
287
|
},
|
|
286
|
-
"
|
|
287
|
-
"
|
|
288
|
-
"
|
|
288
|
+
"all": {
|
|
289
|
+
"char": "a",
|
|
290
|
+
"description": "Retun all containers. By default, only running containers are shown",
|
|
291
|
+
"name": "all",
|
|
289
292
|
"required": false,
|
|
290
|
-
"
|
|
291
|
-
"
|
|
292
|
-
"type": "option"
|
|
293
|
+
"allowNo": false,
|
|
294
|
+
"type": "boolean"
|
|
293
295
|
}
|
|
294
296
|
},
|
|
295
297
|
"hasDynamicHelp": false,
|
|
296
298
|
"hiddenAliases": [],
|
|
297
|
-
"id": "
|
|
299
|
+
"id": "containers",
|
|
298
300
|
"pluginAlias": "@enspirit/emb",
|
|
299
301
|
"pluginName": "@enspirit/emb",
|
|
300
302
|
"pluginType": "core",
|
|
303
|
+
"strict": true,
|
|
301
304
|
"enableJsonFlag": true,
|
|
302
305
|
"isESM": true,
|
|
303
306
|
"relativePath": [
|
|
@@ -305,16 +308,14 @@
|
|
|
305
308
|
"src",
|
|
306
309
|
"cli",
|
|
307
310
|
"commands",
|
|
308
|
-
"
|
|
309
|
-
"
|
|
311
|
+
"containers",
|
|
312
|
+
"index.js"
|
|
310
313
|
]
|
|
311
314
|
},
|
|
312
|
-
"containers": {
|
|
313
|
-
"aliases": [
|
|
314
|
-
"ps"
|
|
315
|
-
],
|
|
315
|
+
"containers:prune": {
|
|
316
|
+
"aliases": [],
|
|
316
317
|
"args": {},
|
|
317
|
-
"description": "
|
|
318
|
+
"description": "Prune containers.",
|
|
318
319
|
"examples": [
|
|
319
320
|
"<%= config.bin %> <%= command.id %>"
|
|
320
321
|
],
|
|
@@ -325,19 +326,11 @@
|
|
|
325
326
|
"name": "json",
|
|
326
327
|
"allowNo": false,
|
|
327
328
|
"type": "boolean"
|
|
328
|
-
},
|
|
329
|
-
"all": {
|
|
330
|
-
"char": "a",
|
|
331
|
-
"description": "Retun all containers. By default, only running containers are shown",
|
|
332
|
-
"name": "all",
|
|
333
|
-
"required": false,
|
|
334
|
-
"allowNo": false,
|
|
335
|
-
"type": "boolean"
|
|
336
329
|
}
|
|
337
330
|
},
|
|
338
331
|
"hasDynamicHelp": false,
|
|
339
332
|
"hiddenAliases": [],
|
|
340
|
-
"id": "containers",
|
|
333
|
+
"id": "containers:prune",
|
|
341
334
|
"pluginAlias": "@enspirit/emb",
|
|
342
335
|
"pluginName": "@enspirit/emb",
|
|
343
336
|
"pluginType": "core",
|
|
@@ -350,13 +343,13 @@
|
|
|
350
343
|
"cli",
|
|
351
344
|
"commands",
|
|
352
345
|
"containers",
|
|
353
|
-
"
|
|
346
|
+
"prune.js"
|
|
354
347
|
]
|
|
355
348
|
},
|
|
356
|
-
"
|
|
349
|
+
"config:print": {
|
|
357
350
|
"aliases": [],
|
|
358
351
|
"args": {},
|
|
359
|
-
"description": "
|
|
352
|
+
"description": "Print the current config.",
|
|
360
353
|
"examples": [
|
|
361
354
|
"<%= config.bin %> <%= command.id %>"
|
|
362
355
|
],
|
|
@@ -367,15 +360,22 @@
|
|
|
367
360
|
"name": "json",
|
|
368
361
|
"allowNo": false,
|
|
369
362
|
"type": "boolean"
|
|
363
|
+
},
|
|
364
|
+
"flavor": {
|
|
365
|
+
"description": "Specify the flavor to use.",
|
|
366
|
+
"name": "flavor",
|
|
367
|
+
"required": false,
|
|
368
|
+
"hasDynamicHelp": false,
|
|
369
|
+
"multiple": false,
|
|
370
|
+
"type": "option"
|
|
370
371
|
}
|
|
371
372
|
},
|
|
372
373
|
"hasDynamicHelp": false,
|
|
373
374
|
"hiddenAliases": [],
|
|
374
|
-
"id": "
|
|
375
|
+
"id": "config:print",
|
|
375
376
|
"pluginAlias": "@enspirit/emb",
|
|
376
377
|
"pluginName": "@enspirit/emb",
|
|
377
378
|
"pluginType": "core",
|
|
378
|
-
"strict": true,
|
|
379
379
|
"enableJsonFlag": true,
|
|
380
380
|
"isESM": true,
|
|
381
381
|
"relativePath": [
|
|
@@ -383,8 +383,8 @@
|
|
|
383
383
|
"src",
|
|
384
384
|
"cli",
|
|
385
385
|
"commands",
|
|
386
|
-
"
|
|
387
|
-
"
|
|
386
|
+
"config",
|
|
387
|
+
"print.js"
|
|
388
388
|
]
|
|
389
389
|
},
|
|
390
390
|
"images:delete": {
|
|
@@ -520,12 +520,18 @@
|
|
|
520
520
|
"prune.js"
|
|
521
521
|
]
|
|
522
522
|
},
|
|
523
|
-
"
|
|
523
|
+
"resources:build": {
|
|
524
524
|
"aliases": [],
|
|
525
|
-
"args": {
|
|
526
|
-
|
|
525
|
+
"args": {
|
|
526
|
+
"component": {
|
|
527
|
+
"description": "List of resources to build (defaults to all)",
|
|
528
|
+
"name": "component",
|
|
529
|
+
"required": false
|
|
530
|
+
}
|
|
531
|
+
},
|
|
532
|
+
"description": "Build the resources of the monorepo",
|
|
527
533
|
"examples": [
|
|
528
|
-
"<%= config.bin %> <%= command.id %>"
|
|
534
|
+
"<%= config.bin %> <%= command.id %> build --flavor development"
|
|
529
535
|
],
|
|
530
536
|
"flags": {
|
|
531
537
|
"json": {
|
|
@@ -534,15 +540,38 @@
|
|
|
534
540
|
"name": "json",
|
|
535
541
|
"allowNo": false,
|
|
536
542
|
"type": "boolean"
|
|
543
|
+
},
|
|
544
|
+
"flavor": {
|
|
545
|
+
"description": "Specify the flavor to use.",
|
|
546
|
+
"name": "flavor",
|
|
547
|
+
"required": false,
|
|
548
|
+
"hasDynamicHelp": false,
|
|
549
|
+
"multiple": false,
|
|
550
|
+
"type": "option"
|
|
551
|
+
},
|
|
552
|
+
"dry-run": {
|
|
553
|
+
"description": "Do not build the resources but only produce build meta information",
|
|
554
|
+
"name": "dry-run",
|
|
555
|
+
"required": false,
|
|
556
|
+
"allowNo": false,
|
|
557
|
+
"type": "boolean"
|
|
558
|
+
},
|
|
559
|
+
"force": {
|
|
560
|
+
"char": "f",
|
|
561
|
+
"description": "Bypass the cache and force the build",
|
|
562
|
+
"name": "force",
|
|
563
|
+
"required": false,
|
|
564
|
+
"allowNo": false,
|
|
565
|
+
"type": "boolean"
|
|
537
566
|
}
|
|
538
567
|
},
|
|
539
568
|
"hasDynamicHelp": false,
|
|
540
569
|
"hiddenAliases": [],
|
|
541
|
-
"id": "
|
|
570
|
+
"id": "resources:build",
|
|
542
571
|
"pluginAlias": "@enspirit/emb",
|
|
543
572
|
"pluginName": "@enspirit/emb",
|
|
544
573
|
"pluginType": "core",
|
|
545
|
-
"strict":
|
|
574
|
+
"strict": false,
|
|
546
575
|
"enableJsonFlag": true,
|
|
547
576
|
"isESM": true,
|
|
548
577
|
"relativePath": [
|
|
@@ -550,20 +579,14 @@
|
|
|
550
579
|
"src",
|
|
551
580
|
"cli",
|
|
552
581
|
"commands",
|
|
553
|
-
"
|
|
554
|
-
"
|
|
582
|
+
"resources",
|
|
583
|
+
"build.js"
|
|
555
584
|
]
|
|
556
585
|
},
|
|
557
|
-
"
|
|
586
|
+
"resources": {
|
|
558
587
|
"aliases": [],
|
|
559
|
-
"args": {
|
|
560
|
-
|
|
561
|
-
"description": "List of tasks to run. You can provide either ids or names (eg: component:task or task)",
|
|
562
|
-
"name": "task",
|
|
563
|
-
"required": true
|
|
564
|
-
}
|
|
565
|
-
},
|
|
566
|
-
"description": "Run tasks.",
|
|
588
|
+
"args": {},
|
|
589
|
+
"description": "List resources.",
|
|
567
590
|
"examples": [
|
|
568
591
|
"<%= config.bin %> <%= command.id %>"
|
|
569
592
|
],
|
|
@@ -575,33 +598,21 @@
|
|
|
575
598
|
"allowNo": false,
|
|
576
599
|
"type": "boolean"
|
|
577
600
|
},
|
|
578
|
-
"
|
|
579
|
-
"
|
|
580
|
-
"
|
|
581
|
-
"
|
|
601
|
+
"flavor": {
|
|
602
|
+
"description": "Specify the flavor to use.",
|
|
603
|
+
"name": "flavor",
|
|
604
|
+
"required": false,
|
|
582
605
|
"hasDynamicHelp": false,
|
|
583
606
|
"multiple": false,
|
|
584
|
-
"options": [
|
|
585
|
-
"container",
|
|
586
|
-
"local"
|
|
587
|
-
],
|
|
588
607
|
"type": "option"
|
|
589
|
-
},
|
|
590
|
-
"all-matching": {
|
|
591
|
-
"char": "a",
|
|
592
|
-
"description": "Run all tasks matching (when multiple matches)",
|
|
593
|
-
"name": "all-matching",
|
|
594
|
-
"allowNo": false,
|
|
595
|
-
"type": "boolean"
|
|
596
608
|
}
|
|
597
609
|
},
|
|
598
610
|
"hasDynamicHelp": false,
|
|
599
611
|
"hiddenAliases": [],
|
|
600
|
-
"id": "
|
|
612
|
+
"id": "resources",
|
|
601
613
|
"pluginAlias": "@enspirit/emb",
|
|
602
614
|
"pluginName": "@enspirit/emb",
|
|
603
615
|
"pluginType": "core",
|
|
604
|
-
"strict": false,
|
|
605
616
|
"enableJsonFlag": true,
|
|
606
617
|
"isESM": true,
|
|
607
618
|
"relativePath": [
|
|
@@ -609,22 +620,16 @@
|
|
|
609
620
|
"src",
|
|
610
621
|
"cli",
|
|
611
622
|
"commands",
|
|
612
|
-
"
|
|
613
|
-
"
|
|
623
|
+
"resources",
|
|
624
|
+
"index.js"
|
|
614
625
|
]
|
|
615
626
|
},
|
|
616
|
-
"
|
|
627
|
+
"tasks": {
|
|
617
628
|
"aliases": [],
|
|
618
|
-
"args": {
|
|
619
|
-
|
|
620
|
-
"description": "List of resources to build (defaults to all)",
|
|
621
|
-
"name": "component",
|
|
622
|
-
"required": false
|
|
623
|
-
}
|
|
624
|
-
},
|
|
625
|
-
"description": "Build the resources of the monorepo",
|
|
629
|
+
"args": {},
|
|
630
|
+
"description": "List tasks.",
|
|
626
631
|
"examples": [
|
|
627
|
-
"<%= config.bin %> <%= command.id %>
|
|
632
|
+
"<%= config.bin %> <%= command.id %>"
|
|
628
633
|
],
|
|
629
634
|
"flags": {
|
|
630
635
|
"json": {
|
|
@@ -633,38 +638,15 @@
|
|
|
633
638
|
"name": "json",
|
|
634
639
|
"allowNo": false,
|
|
635
640
|
"type": "boolean"
|
|
636
|
-
},
|
|
637
|
-
"flavor": {
|
|
638
|
-
"description": "Specify the flavor to use.",
|
|
639
|
-
"name": "flavor",
|
|
640
|
-
"required": false,
|
|
641
|
-
"hasDynamicHelp": false,
|
|
642
|
-
"multiple": false,
|
|
643
|
-
"type": "option"
|
|
644
|
-
},
|
|
645
|
-
"dry-run": {
|
|
646
|
-
"description": "Do not build the resources but only produce build meta information",
|
|
647
|
-
"name": "dry-run",
|
|
648
|
-
"required": false,
|
|
649
|
-
"allowNo": false,
|
|
650
|
-
"type": "boolean"
|
|
651
|
-
},
|
|
652
|
-
"force": {
|
|
653
|
-
"char": "f",
|
|
654
|
-
"description": "Bypass the cache and force the build",
|
|
655
|
-
"name": "force",
|
|
656
|
-
"required": false,
|
|
657
|
-
"allowNo": false,
|
|
658
|
-
"type": "boolean"
|
|
659
641
|
}
|
|
660
642
|
},
|
|
661
643
|
"hasDynamicHelp": false,
|
|
662
644
|
"hiddenAliases": [],
|
|
663
|
-
"id": "
|
|
645
|
+
"id": "tasks",
|
|
664
646
|
"pluginAlias": "@enspirit/emb",
|
|
665
647
|
"pluginName": "@enspirit/emb",
|
|
666
648
|
"pluginType": "core",
|
|
667
|
-
"strict":
|
|
649
|
+
"strict": true,
|
|
668
650
|
"enableJsonFlag": true,
|
|
669
651
|
"isESM": true,
|
|
670
652
|
"relativePath": [
|
|
@@ -672,14 +654,20 @@
|
|
|
672
654
|
"src",
|
|
673
655
|
"cli",
|
|
674
656
|
"commands",
|
|
675
|
-
"
|
|
676
|
-
"
|
|
657
|
+
"tasks",
|
|
658
|
+
"index.js"
|
|
677
659
|
]
|
|
678
660
|
},
|
|
679
|
-
"
|
|
661
|
+
"tasks:run": {
|
|
680
662
|
"aliases": [],
|
|
681
|
-
"args": {
|
|
682
|
-
|
|
663
|
+
"args": {
|
|
664
|
+
"task": {
|
|
665
|
+
"description": "List of tasks to run. You can provide either ids or names (eg: component:task or task)",
|
|
666
|
+
"name": "task",
|
|
667
|
+
"required": true
|
|
668
|
+
}
|
|
669
|
+
},
|
|
670
|
+
"description": "Run tasks.",
|
|
683
671
|
"examples": [
|
|
684
672
|
"<%= config.bin %> <%= command.id %>"
|
|
685
673
|
],
|
|
@@ -691,21 +679,33 @@
|
|
|
691
679
|
"allowNo": false,
|
|
692
680
|
"type": "boolean"
|
|
693
681
|
},
|
|
694
|
-
"
|
|
695
|
-
"
|
|
696
|
-
"
|
|
697
|
-
"
|
|
682
|
+
"executor": {
|
|
683
|
+
"char": "x",
|
|
684
|
+
"description": "Where to run the task. (experimental!)",
|
|
685
|
+
"name": "executor",
|
|
698
686
|
"hasDynamicHelp": false,
|
|
699
687
|
"multiple": false,
|
|
688
|
+
"options": [
|
|
689
|
+
"container",
|
|
690
|
+
"local"
|
|
691
|
+
],
|
|
700
692
|
"type": "option"
|
|
693
|
+
},
|
|
694
|
+
"all-matching": {
|
|
695
|
+
"char": "a",
|
|
696
|
+
"description": "Run all tasks matching (when multiple matches)",
|
|
697
|
+
"name": "all-matching",
|
|
698
|
+
"allowNo": false,
|
|
699
|
+
"type": "boolean"
|
|
701
700
|
}
|
|
702
701
|
},
|
|
703
702
|
"hasDynamicHelp": false,
|
|
704
703
|
"hiddenAliases": [],
|
|
705
|
-
"id": "
|
|
704
|
+
"id": "tasks:run",
|
|
706
705
|
"pluginAlias": "@enspirit/emb",
|
|
707
706
|
"pluginName": "@enspirit/emb",
|
|
708
707
|
"pluginType": "core",
|
|
708
|
+
"strict": false,
|
|
709
709
|
"enableJsonFlag": true,
|
|
710
710
|
"isESM": true,
|
|
711
711
|
"relativePath": [
|
|
@@ -713,10 +713,10 @@
|
|
|
713
713
|
"src",
|
|
714
714
|
"cli",
|
|
715
715
|
"commands",
|
|
716
|
-
"
|
|
717
|
-
"
|
|
716
|
+
"tasks",
|
|
717
|
+
"run.js"
|
|
718
718
|
]
|
|
719
719
|
}
|
|
720
720
|
},
|
|
721
|
-
"version": "0.4.
|
|
721
|
+
"version": "0.4.2"
|
|
722
722
|
}
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { CreateFileOperation } from '../index.js';
|
|
2
|
-
import { ResourceFactory } from './ResourceFactory.js';
|
|
3
|
-
// Bring better abstraction and register as part of the plugin initialization
|
|
4
|
-
ResourceFactory.register('file', async ({ config, component }) => {
|
|
5
|
-
return {
|
|
6
|
-
async build() {
|
|
7
|
-
const fromConfig = (config.params || {});
|
|
8
|
-
const input = {
|
|
9
|
-
path: component.join(fromConfig?.path || config.name),
|
|
10
|
-
};
|
|
11
|
-
return {
|
|
12
|
-
input,
|
|
13
|
-
operation: new CreateFileOperation(),
|
|
14
|
-
};
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
});
|
|
File without changes
|