@jujulego/jill 2.4.0-alpha.5 → 2.4.0
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 +8 -11
- package/dist/commands/each.d.ts +9 -6
- package/dist/commands/group.d.ts +2 -2
- package/dist/commands/run.d.ts +6 -4
- package/dist/{core.plugin-ED-2XO_T.js → core.plugin-eIXhcLId.js} +119 -148
- package/dist/core.plugin-eIXhcLId.js.map +1 -0
- package/dist/filters/scripts.filter.d.ts +2 -1
- package/dist/index.d.ts +1 -5
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/{ink-command-HSaTNbaX.js → ink-command-8BDSCbqp.js} +30 -190
- package/dist/ink-command-8BDSCbqp.js.map +1 -0
- package/dist/jill.application-8LJ2a7MD.js +636 -0
- package/dist/jill.application-8LJ2a7MD.js.map +1 -0
- package/dist/main.js +10 -8
- package/dist/main.js.map +1 -1
- package/dist/tasks/errors.d.ts +4 -0
- package/dist/tasks/{task-expr.service.d.ts → task-expression.service.d.ts} +2 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/ui/hooks/useFlatTaskTree.d.ts +14 -0
- package/dist/ui/hooks/useIsVerbose.d.ts +1 -0
- package/dist/ui/hooks/useStdoutDimensions.d.ts +4 -0
- package/dist/ui/task-tree-completed.d.ts +5 -0
- package/dist/ui/task-tree-full-spinner.d.ts +5 -0
- package/dist/ui/task-tree-scrollable-spinner.d.ts +5 -0
- package/dist/ui/task-tree-spinner.d.ts +5 -0
- package/dist/ui/task-tree-stats.d.ts +5 -0
- package/dist/{workspace-tree-DEg4wm69.js → workspace-tree-1zFRh2Fq.js} +86 -128
- package/dist/workspace-tree-1zFRh2Fq.js.map +1 -0
- package/package.json +17 -15
- package/dist/core.plugin-ED-2XO_T.js.map +0 -1
- package/dist/ink-command-HSaTNbaX.js.map +0 -1
- package/dist/jill.application-nR6EmV7y.js +0 -279
- package/dist/jill.application-nR6EmV7y.js.map +0 -1
- package/dist/ui/group-task-spinner.d.ts +0 -5
- package/dist/ui/task-manager-spinner.d.ts +0 -5
- package/dist/workspace-tree-DEg4wm69.js.map +0 -1
package/README.md
CHANGED
|
@@ -11,9 +11,9 @@ Zero-config monorepo cli
|
|
|
11
11
|
Jill uses the `workspaces` attribute of your root package.json manifest to build your workspaces dependency tree.
|
|
12
12
|
That done it can offer you various utilities:
|
|
13
13
|
- `jill list` prints a list of all your workspaces, with many useful filters
|
|
14
|
-
- `jill run`
|
|
15
|
-
- `jill
|
|
16
|
-
|
|
14
|
+
- `jill run` Run a task expression in a workspace, after having built all its dependencies.
|
|
15
|
+
- `jill group` Deprecated in favor of run
|
|
16
|
+
- `jill each` Run a task expression in many workspace, after having built all theirs dependencies.
|
|
17
17
|
- `jill tree` prints current workspace's local dependency tree
|
|
18
18
|
|
|
19
19
|
It supports both `npm` and `yarn`.
|
|
@@ -24,10 +24,7 @@ Jill will run hook script like npm do, for both npm and yarn. As npm, when you t
|
|
|
24
24
|
|
|
25
25
|
This feature can be disabled using the `--no-hooks` option: `jill run --no-hooks test`.
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
- `jill group` same as `run` but allows to run multiple scripts in sequence or in parallel using the task syntax
|
|
29
|
-
|
|
30
|
-
#### Task syntax _(only supported by `jill group` command yet)_
|
|
27
|
+
#### Task expression syntax
|
|
31
28
|
Allows to instruct multiple tasks with the given orchestration. The orchestration is given by the following operators:
|
|
32
29
|
- `&&` in sequence
|
|
33
30
|
- `||` fallbacks
|
|
@@ -36,22 +33,22 @@ Allows to instruct multiple tasks with the given orchestration. The orchestratio
|
|
|
36
33
|
##### Examples:
|
|
37
34
|
- This will run scripts **taskA**, **taskB** and **taskC** in order, one after another.
|
|
38
35
|
```shell
|
|
39
|
-
jill
|
|
36
|
+
jill run 'taskA && taskB && taskC'
|
|
40
37
|
```
|
|
41
38
|
|
|
42
39
|
- This will run first **taskA**, if it fails it will run **taskB**, then **taskC** in order, until one succeed.
|
|
43
40
|
```shell
|
|
44
|
-
jill
|
|
41
|
+
jill run 'taskA || taskB || taskC'
|
|
45
42
|
```
|
|
46
43
|
|
|
47
44
|
- This will run scripts **taskA**, **taskB** and **taskC** in parallel.
|
|
48
45
|
```shell
|
|
49
|
-
jill
|
|
46
|
+
jill run 'taskA // taskB // taskC'
|
|
50
47
|
```
|
|
51
48
|
|
|
52
49
|
- And you can create more complex flows: this will run **taskA** and **taskB** in parallel, and then **taskC** when both tasks are ended
|
|
53
50
|
```shell
|
|
54
|
-
jill
|
|
51
|
+
jill run '(taskA // taskB) && taskC'
|
|
55
52
|
```
|
|
56
53
|
|
|
57
54
|
## Installation
|
package/dist/commands/each.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ import { type ArgumentsCamelCase, type Argv } from 'yargs';
|
|
|
3
3
|
import { TaskCommand } from '@/src/modules/task-command.tsx';
|
|
4
4
|
import { type Project } from '@/src/project/project.ts';
|
|
5
5
|
import { type WorkspaceDepsMode } from '@/src/project/workspace.ts';
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { TaskExpressionService } from '@/src/tasks/task-expression.service.ts';
|
|
7
|
+
export interface EachCommandArgs {
|
|
8
|
+
expr: string;
|
|
8
9
|
'build-script': string;
|
|
9
10
|
'deps-mode': WorkspaceDepsMode;
|
|
10
11
|
'allow-no-workspaces'?: boolean;
|
|
@@ -13,10 +14,12 @@ export interface IEachCommandArgs {
|
|
|
13
14
|
'affected-rev-fallback': string;
|
|
14
15
|
'affected-rev-sort'?: string;
|
|
15
16
|
}
|
|
16
|
-
export declare class EachCommand extends TaskCommand<
|
|
17
|
+
export declare class EachCommand extends TaskCommand<EachCommandArgs> {
|
|
17
18
|
private readonly logger;
|
|
19
|
+
private readonly taskExpression;
|
|
18
20
|
readonly project: Project;
|
|
19
|
-
constructor(logger: Logger);
|
|
20
|
-
builder(parser: Argv): Argv<
|
|
21
|
-
prepare(
|
|
21
|
+
constructor(logger: Logger, taskExpression: TaskExpressionService);
|
|
22
|
+
builder(parser: Argv): Argv<EachCommandArgs>;
|
|
23
|
+
prepare(argv: ArgumentsCamelCase<EachCommandArgs>): AsyncGenerator<import("@jujulego/tasks").Task<import("@jujulego/tasks").TaskContext>, void, unknown>;
|
|
24
|
+
private _preparePipeline;
|
|
22
25
|
}
|
package/dist/commands/group.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ArgumentsCamelCase, type Argv } from 'yargs';
|
|
2
2
|
import { TaskCommand } from '@/src/modules/task-command.tsx';
|
|
3
3
|
import { type Workspace, type WorkspaceDepsMode } from '@/src/project/workspace.ts';
|
|
4
|
-
import {
|
|
4
|
+
import { TaskExpressionService, type TaskTree } from '@/src/tasks/task-expression.service.ts';
|
|
5
5
|
export interface IGroupCommandArgs {
|
|
6
6
|
script: TaskTree;
|
|
7
7
|
'build-script': string;
|
|
@@ -10,7 +10,7 @@ export interface IGroupCommandArgs {
|
|
|
10
10
|
export declare class GroupCommand extends TaskCommand<IGroupCommandArgs> {
|
|
11
11
|
private readonly taskExpr;
|
|
12
12
|
readonly workspace: Workspace;
|
|
13
|
-
constructor(taskExpr:
|
|
13
|
+
constructor(taskExpr: TaskExpressionService);
|
|
14
14
|
builder(parser: Argv): Argv<IGroupCommandArgs>;
|
|
15
15
|
prepare(args: ArgumentsCamelCase<IGroupCommandArgs>): AsyncGenerator<import("@jujulego/tasks").Task<import("@jujulego/tasks").TaskContext>, void, unknown>;
|
|
16
16
|
}
|
package/dist/commands/run.d.ts
CHANGED
|
@@ -2,21 +2,23 @@ import { Logger } from '@jujulego/logger';
|
|
|
2
2
|
import { type ArgumentsCamelCase, type Argv } from 'yargs';
|
|
3
3
|
import { TaskCommand } from '@/src/modules/task-command.tsx';
|
|
4
4
|
import { type Workspace, type WorkspaceDepsMode } from '@/src/project/workspace.ts';
|
|
5
|
+
import { TaskExpressionService } from '@/src/tasks/task-expression.service.ts';
|
|
5
6
|
export interface IRunCommandArgs {
|
|
6
|
-
|
|
7
|
+
expr: string;
|
|
7
8
|
'build-script': string;
|
|
8
9
|
'deps-mode': WorkspaceDepsMode;
|
|
9
10
|
}
|
|
10
11
|
export declare class RunCommand extends TaskCommand<IRunCommandArgs> {
|
|
11
12
|
private readonly logger;
|
|
13
|
+
private readonly taskExpression;
|
|
12
14
|
readonly workspace: Workspace;
|
|
13
|
-
constructor(logger: Logger);
|
|
15
|
+
constructor(logger: Logger, taskExpression: TaskExpressionService);
|
|
14
16
|
builder(parser: Argv): Argv<import("@/src/modules/task-command.tsx").ITaskCommandArgs & {
|
|
15
|
-
|
|
17
|
+
expr: string;
|
|
16
18
|
} & {
|
|
17
19
|
"build-script": string;
|
|
18
20
|
} & {
|
|
19
21
|
"deps-mode": "all";
|
|
20
22
|
}>;
|
|
21
|
-
prepare(args: ArgumentsCamelCase<IRunCommandArgs>): AsyncGenerator<import("
|
|
23
|
+
prepare(args: ArgumentsCamelCase<IRunCommandArgs>): AsyncGenerator<import("@jujulego/tasks").Task<import("@jujulego/tasks").TaskContext>, void, unknown>;
|
|
22
24
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { _ } from '@swc/helpers/_/_ts_decorate';
|
|
2
|
+
import { _ as _$1 } from '@swc/helpers/_/_ts_param';
|
|
1
3
|
import { Logger } from '@jujulego/logger';
|
|
2
4
|
import { inject } from 'inversify';
|
|
3
5
|
import symbols from 'log-symbols';
|
|
4
|
-
import { b as LazyCurrentProject, L as LoadProject, S as ScriptsFilter, a as PrivateFilter, A as AffectedFilter, P as Pipeline, d as LazyCurrentWorkspace, c as LoadWorkspace,
|
|
5
|
-
import {
|
|
6
|
-
import { T as TaskCommand } from './jill.application-
|
|
6
|
+
import { b as LazyCurrentProject, L as LoadProject, T as TaskExpressionService, k as TaskExpressionError, l as TaskSyntaxError, S as ScriptsFilter, a as PrivateFilter, A as AffectedFilter, P as Pipeline, d as LazyCurrentWorkspace, c as LoadWorkspace, W as WorkspaceTree, f as Plugin } from './workspace-tree-1zFRh2Fq.js';
|
|
7
|
+
import { f as Command, E as ExitException, I as InkCommand, y as printJson, a as List } from './ink-command-8BDSCbqp.js';
|
|
8
|
+
import { T as TaskCommand } from './jill.application-8LJ2a7MD.js';
|
|
7
9
|
import { jsx } from 'react/jsx-runtime';
|
|
8
10
|
import chalk from 'chalk';
|
|
9
11
|
import path from 'node:path';
|
|
@@ -35,29 +37,20 @@ import '@jujulego/aegis';
|
|
|
35
37
|
import '@jujulego/quick-tag';
|
|
36
38
|
import 'chalk-template';
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
40
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
41
|
-
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
42
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
43
|
-
}
|
|
44
|
-
function _ts_param$3(paramIndex, decorator) {
|
|
45
|
-
return function(target, key) {
|
|
46
|
-
decorator(target, key, paramIndex);
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
let EachCommand = class EachCommand extends TaskCommand {
|
|
40
|
+
class EachCommand extends TaskCommand {
|
|
50
41
|
// Constructor
|
|
51
|
-
constructor(logger){
|
|
42
|
+
constructor(logger, taskExpression){
|
|
52
43
|
super();
|
|
53
44
|
this.logger = logger;
|
|
45
|
+
this.taskExpression = taskExpression;
|
|
54
46
|
}
|
|
55
47
|
// Methods
|
|
56
48
|
builder(parser) {
|
|
57
49
|
return this.addTaskOptions(parser)// Run options
|
|
58
|
-
.positional("
|
|
50
|
+
.positional("expr", {
|
|
59
51
|
type: "string",
|
|
60
|
-
demandOption: true
|
|
52
|
+
demandOption: true,
|
|
53
|
+
desc: "Script or task expression"
|
|
61
54
|
}).option("build-script", {
|
|
62
55
|
default: "build",
|
|
63
56
|
desc: "Script to use to build dependencies"
|
|
@@ -73,7 +66,7 @@ let EachCommand = class EachCommand extends TaskCommand {
|
|
|
73
66
|
}).option("allow-no-workspaces", {
|
|
74
67
|
type: "boolean",
|
|
75
68
|
default: false,
|
|
76
|
-
desc: "Allow no matching workspaces.
|
|
69
|
+
desc: "Allow no matching workspaces. Without it jill will exit with code 1 if no workspace matches"
|
|
77
70
|
})// Filters
|
|
78
71
|
.option("private", {
|
|
79
72
|
type: "boolean",
|
|
@@ -99,64 +92,75 @@ let EachCommand = class EachCommand extends TaskCommand {
|
|
|
99
92
|
"unknown-options-as-args": true
|
|
100
93
|
});
|
|
101
94
|
}
|
|
102
|
-
async *prepare(
|
|
103
|
-
// Setup pipeline
|
|
104
|
-
const pipeline = new Pipeline();
|
|
105
|
-
pipeline.add(new ScriptsFilter([
|
|
106
|
-
args.script
|
|
107
|
-
]));
|
|
108
|
-
if (args.private !== undefined) {
|
|
109
|
-
pipeline.add(new PrivateFilter(args.private));
|
|
110
|
-
}
|
|
111
|
-
if (args.affected !== undefined) {
|
|
112
|
-
pipeline.add(new AffectedFilter(args.affected, args.affectedRevFallback, args.affectedRevSort));
|
|
113
|
-
}
|
|
114
|
-
// Extract arguments
|
|
115
|
-
const rest = args._.map((arg)=>arg.toString());
|
|
116
|
-
if (rest[0] === "each") {
|
|
117
|
-
rest.splice(0, 1);
|
|
118
|
-
}
|
|
119
|
-
// Create script tasks
|
|
95
|
+
async *prepare(argv) {
|
|
120
96
|
let empty = true;
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
97
|
+
try {
|
|
98
|
+
// Extract expression
|
|
99
|
+
const expr = argv._.map((arg)=>arg.toString());
|
|
100
|
+
if (expr[0] === "each") {
|
|
101
|
+
expr.splice(0, 1);
|
|
102
|
+
}
|
|
103
|
+
expr.unshift(argv.expr);
|
|
104
|
+
const tree = this.taskExpression.parse(expr.join(" "));
|
|
105
|
+
const scripts = Array.from(this.taskExpression.extractScripts(tree));
|
|
106
|
+
// Create script tasks
|
|
107
|
+
const pipeline = this._preparePipeline(argv, scripts);
|
|
108
|
+
for await (const wks of pipeline.filter(this.project.workspaces())){
|
|
109
|
+
const task = await this.taskExpression.buildTask(tree.roots[0], wks, {
|
|
110
|
+
buildScript: argv.buildScript,
|
|
111
|
+
buildDeps: argv.depsMode
|
|
112
|
+
});
|
|
113
|
+
if (task) {
|
|
114
|
+
yield task;
|
|
115
|
+
empty = false;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
} catch (err) {
|
|
119
|
+
if (err instanceof TaskExpressionError) {
|
|
120
|
+
this.logger.error(err.message);
|
|
121
|
+
throw new ExitException(1);
|
|
122
|
+
}
|
|
123
|
+
if (err instanceof TaskSyntaxError) {
|
|
124
|
+
this.logger.error(`Syntax error in task expression: ${err.message}`);
|
|
125
|
+
throw new ExitException(1);
|
|
129
126
|
}
|
|
127
|
+
throw err;
|
|
130
128
|
}
|
|
131
129
|
if (empty) {
|
|
132
130
|
this.logger.error(`${symbols.error} No matching workspace found !`);
|
|
133
|
-
if (
|
|
131
|
+
if (argv.allowNoWorkspaces === false) {
|
|
134
132
|
throw new ExitException(1);
|
|
135
133
|
}
|
|
136
134
|
}
|
|
137
135
|
}
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
_preparePipeline(argv, scripts) {
|
|
137
|
+
const pipeline = new Pipeline();
|
|
138
|
+
pipeline.add(new ScriptsFilter(scripts, true));
|
|
139
|
+
if (argv.private !== undefined) {
|
|
140
|
+
pipeline.add(new PrivateFilter(argv.private));
|
|
141
|
+
}
|
|
142
|
+
if (argv.affected !== undefined) {
|
|
143
|
+
pipeline.add(new AffectedFilter(argv.affected, argv.affectedRevFallback, argv.affectedRevSort));
|
|
144
|
+
}
|
|
145
|
+
return pipeline;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
_([
|
|
140
149
|
LazyCurrentProject()
|
|
141
150
|
], EachCommand.prototype, "project", void 0);
|
|
142
|
-
EachCommand =
|
|
151
|
+
EachCommand = _([
|
|
143
152
|
Command({
|
|
144
|
-
command: "each <
|
|
145
|
-
describe: "Run
|
|
153
|
+
command: "each <expr>",
|
|
154
|
+
describe: "Run a task expression in many workspace, after having built all theirs dependencies.",
|
|
146
155
|
middlewares: [
|
|
147
156
|
LoadProject
|
|
148
157
|
]
|
|
149
158
|
}),
|
|
150
|
-
|
|
159
|
+
_$1(0, inject(Logger)),
|
|
160
|
+
_$1(1, inject(TaskExpressionService))
|
|
151
161
|
], EachCommand);
|
|
152
162
|
|
|
153
|
-
|
|
154
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
155
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
156
|
-
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
157
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
158
|
-
}
|
|
159
|
-
let ExecCommand = class ExecCommand extends TaskCommand {
|
|
163
|
+
class ExecCommand extends TaskCommand {
|
|
160
164
|
// Methods
|
|
161
165
|
builder(parser) {
|
|
162
166
|
return this.addTaskOptions(parser).positional("command", {
|
|
@@ -193,11 +197,11 @@ let ExecCommand = class ExecCommand extends TaskCommand {
|
|
|
193
197
|
});
|
|
194
198
|
yield task;
|
|
195
199
|
}
|
|
196
|
-
}
|
|
197
|
-
|
|
200
|
+
}
|
|
201
|
+
_([
|
|
198
202
|
LazyCurrentWorkspace()
|
|
199
203
|
], ExecCommand.prototype, "workspace", void 0);
|
|
200
|
-
ExecCommand =
|
|
204
|
+
ExecCommand = _([
|
|
201
205
|
Command({
|
|
202
206
|
command: "exec <command>",
|
|
203
207
|
aliases: [
|
|
@@ -211,18 +215,7 @@ ExecCommand = _ts_decorate$5([
|
|
|
211
215
|
})
|
|
212
216
|
], ExecCommand);
|
|
213
217
|
|
|
214
|
-
|
|
215
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
216
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
217
|
-
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
218
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
219
|
-
}
|
|
220
|
-
function _ts_param$2(paramIndex, decorator) {
|
|
221
|
-
return function(target, key) {
|
|
222
|
-
decorator(target, key, paramIndex);
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
let GroupCommand = class GroupCommand extends TaskCommand {
|
|
218
|
+
class GroupCommand extends TaskCommand {
|
|
226
219
|
// Constructor
|
|
227
220
|
constructor(taskExpr){
|
|
228
221
|
super();
|
|
@@ -256,33 +249,23 @@ let GroupCommand = class GroupCommand extends TaskCommand {
|
|
|
256
249
|
});
|
|
257
250
|
yield group;
|
|
258
251
|
}
|
|
259
|
-
}
|
|
260
|
-
|
|
252
|
+
}
|
|
253
|
+
_([
|
|
261
254
|
LazyCurrentWorkspace()
|
|
262
255
|
], GroupCommand.prototype, "workspace", void 0);
|
|
263
|
-
GroupCommand =
|
|
256
|
+
GroupCommand = _([
|
|
264
257
|
Command({
|
|
265
258
|
command: "group <script..>",
|
|
266
259
|
describe: "Run many scripts inside a workspace (experimental)",
|
|
260
|
+
deprecated: true,
|
|
267
261
|
middlewares: [
|
|
268
262
|
LoadProject,
|
|
269
263
|
LoadWorkspace
|
|
270
264
|
]
|
|
271
265
|
}),
|
|
272
|
-
|
|
266
|
+
_$1(0, inject(TaskExpressionService))
|
|
273
267
|
], GroupCommand);
|
|
274
268
|
|
|
275
|
-
function _ts_decorate$3(decorators, target, key, desc) {
|
|
276
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
277
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
278
|
-
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
279
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
280
|
-
}
|
|
281
|
-
function _ts_param$1(paramIndex, decorator) {
|
|
282
|
-
return function(target, key) {
|
|
283
|
-
decorator(target, key, paramIndex);
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
269
|
// Constants
|
|
287
270
|
const LONG_ATTRIBUTES = [
|
|
288
271
|
"name",
|
|
@@ -320,7 +303,7 @@ function buildExtractor(attrs) {
|
|
|
320
303
|
return data;
|
|
321
304
|
};
|
|
322
305
|
}
|
|
323
|
-
|
|
306
|
+
class ListCommand extends InkCommand {
|
|
324
307
|
// Constructor
|
|
325
308
|
constructor(logger){
|
|
326
309
|
super();
|
|
@@ -485,11 +468,11 @@ let ListCommand = class ListCommand extends InkCommand {
|
|
|
485
468
|
return 0;
|
|
486
469
|
};
|
|
487
470
|
}
|
|
488
|
-
}
|
|
489
|
-
|
|
471
|
+
}
|
|
472
|
+
_([
|
|
490
473
|
LazyCurrentProject()
|
|
491
474
|
], ListCommand.prototype, "project", void 0);
|
|
492
|
-
ListCommand =
|
|
475
|
+
ListCommand = _([
|
|
493
476
|
Command({
|
|
494
477
|
command: "list",
|
|
495
478
|
aliases: [
|
|
@@ -500,31 +483,22 @@ ListCommand = _ts_decorate$3([
|
|
|
500
483
|
LoadProject
|
|
501
484
|
]
|
|
502
485
|
}),
|
|
503
|
-
|
|
486
|
+
_$1(0, inject(Logger))
|
|
504
487
|
], ListCommand);
|
|
505
488
|
|
|
506
|
-
|
|
507
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
508
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
509
|
-
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
510
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
511
|
-
}
|
|
512
|
-
function _ts_param(paramIndex, decorator) {
|
|
513
|
-
return function(target, key) {
|
|
514
|
-
decorator(target, key, paramIndex);
|
|
515
|
-
};
|
|
516
|
-
}
|
|
517
|
-
let RunCommand = class RunCommand extends TaskCommand {
|
|
489
|
+
class RunCommand extends TaskCommand {
|
|
518
490
|
// Constructor
|
|
519
|
-
constructor(logger){
|
|
491
|
+
constructor(logger, taskExpression){
|
|
520
492
|
super();
|
|
521
493
|
this.logger = logger;
|
|
494
|
+
this.taskExpression = taskExpression;
|
|
522
495
|
}
|
|
523
496
|
// Methods
|
|
524
497
|
builder(parser) {
|
|
525
|
-
return this.addTaskOptions(parser).positional("
|
|
498
|
+
return this.addTaskOptions(parser).positional("expr", {
|
|
526
499
|
type: "string",
|
|
527
|
-
demandOption: true
|
|
500
|
+
demandOption: true,
|
|
501
|
+
desc: "Script or task expression"
|
|
528
502
|
}).option("build-script", {
|
|
529
503
|
default: "build",
|
|
530
504
|
desc: "Script to use to build dependencies"
|
|
@@ -543,57 +517,60 @@ let RunCommand = class RunCommand extends TaskCommand {
|
|
|
543
517
|
});
|
|
544
518
|
}
|
|
545
519
|
async *prepare(args) {
|
|
546
|
-
// Extract
|
|
547
|
-
const
|
|
548
|
-
if (
|
|
549
|
-
|
|
520
|
+
// Extract expression
|
|
521
|
+
const expr = args._.map((arg)=>arg.toString());
|
|
522
|
+
if (expr[0] === "run") {
|
|
523
|
+
expr.splice(0, 1);
|
|
550
524
|
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
525
|
+
expr.unshift(args.expr);
|
|
526
|
+
// Parse task expression
|
|
527
|
+
try {
|
|
528
|
+
const tree = this.taskExpression.parse(expr.join(" "));
|
|
529
|
+
yield await this.taskExpression.buildTask(tree.roots[0], this.workspace, {
|
|
530
|
+
buildScript: args.buildScript,
|
|
531
|
+
buildDeps: args.depsMode
|
|
532
|
+
});
|
|
533
|
+
} catch (err) {
|
|
534
|
+
if (err instanceof TaskExpressionError) {
|
|
535
|
+
this.logger.error(err.message);
|
|
536
|
+
throw new ExitException(1);
|
|
537
|
+
}
|
|
538
|
+
if (err instanceof TaskSyntaxError) {
|
|
539
|
+
this.logger.error(`Syntax error in task expression: ${err.message}`);
|
|
540
|
+
throw new ExitException(1);
|
|
541
|
+
}
|
|
542
|
+
throw err;
|
|
561
543
|
}
|
|
562
544
|
}
|
|
563
|
-
}
|
|
564
|
-
|
|
545
|
+
}
|
|
546
|
+
_([
|
|
565
547
|
LazyCurrentWorkspace()
|
|
566
548
|
], RunCommand.prototype, "workspace", void 0);
|
|
567
|
-
RunCommand =
|
|
549
|
+
RunCommand = _([
|
|
568
550
|
Command({
|
|
569
|
-
command: "run <
|
|
570
|
-
describe: "Run
|
|
551
|
+
command: "run <expr>",
|
|
552
|
+
describe: "Run a task expression in a workspace, after having built all its dependencies.",
|
|
571
553
|
middlewares: [
|
|
572
554
|
LoadProject,
|
|
573
555
|
LoadWorkspace
|
|
574
556
|
]
|
|
575
557
|
}),
|
|
576
|
-
|
|
558
|
+
_$1(0, inject(Logger)),
|
|
559
|
+
_$1(1, inject(TaskExpressionService))
|
|
577
560
|
], RunCommand);
|
|
578
561
|
|
|
579
|
-
|
|
580
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
581
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
582
|
-
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
583
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
584
|
-
}
|
|
585
|
-
let TreeCommand = class TreeCommand extends InkCommand {
|
|
562
|
+
class TreeCommand extends InkCommand {
|
|
586
563
|
// Methods
|
|
587
564
|
*render() {
|
|
588
565
|
yield /*#__PURE__*/ jsx(WorkspaceTree, {
|
|
589
566
|
workspace: this.workspace
|
|
590
567
|
});
|
|
591
568
|
}
|
|
592
|
-
}
|
|
593
|
-
|
|
569
|
+
}
|
|
570
|
+
_([
|
|
594
571
|
LazyCurrentWorkspace()
|
|
595
572
|
], TreeCommand.prototype, "workspace", void 0);
|
|
596
|
-
TreeCommand =
|
|
573
|
+
TreeCommand = _([
|
|
597
574
|
Command({
|
|
598
575
|
command: "tree",
|
|
599
576
|
describe: "Print workspace dependency tree",
|
|
@@ -604,15 +581,9 @@ TreeCommand = _ts_decorate$1([
|
|
|
604
581
|
})
|
|
605
582
|
], TreeCommand);
|
|
606
583
|
|
|
607
|
-
|
|
608
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
609
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
610
|
-
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
611
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
584
|
+
class CorePlugin {
|
|
612
585
|
}
|
|
613
|
-
|
|
614
|
-
};
|
|
615
|
-
CorePlugin = _ts_decorate([
|
|
586
|
+
CorePlugin = _([
|
|
616
587
|
Plugin({
|
|
617
588
|
name: "core",
|
|
618
589
|
commands: [
|
|
@@ -627,4 +598,4 @@ CorePlugin = _ts_decorate([
|
|
|
627
598
|
], CorePlugin);
|
|
628
599
|
|
|
629
600
|
export { CorePlugin };
|
|
630
|
-
//# sourceMappingURL=core.plugin-
|
|
601
|
+
//# sourceMappingURL=core.plugin-eIXhcLId.js.map
|