@jujulego/jill 1.1.18 → 2.0.0-beta.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/dist/application.context.d.ts +28 -0
- package/dist/application.context.d.ts.map +1 -0
- package/dist/application.context.js +30 -0
- package/dist/application.context.js.map +1 -0
- package/dist/application.d.ts +7 -0
- package/dist/application.d.ts.map +1 -0
- package/dist/application.js +125 -0
- package/dist/application.js.map +1 -0
- package/dist/command.d.ts +7 -20
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +17 -62
- package/dist/command.js.map +1 -0
- package/dist/commands/each.command.d.ts +14 -13
- package/dist/commands/each.command.d.ts.map +1 -0
- package/dist/commands/each.command.js +144 -81
- package/dist/commands/each.command.js.map +1 -0
- package/dist/commands/list.command.d.ts +17 -14
- package/dist/commands/list.command.d.ts.map +1 -0
- package/dist/commands/list.command.js +199 -122
- package/dist/commands/list.command.js.map +1 -0
- package/dist/commands/run.command.d.ts +10 -11
- package/dist/commands/run.command.d.ts.map +1 -0
- package/dist/commands/run.command.js +73 -39
- package/dist/commands/run.command.js.map +1 -0
- package/dist/commands/tree.command.d.ts +7 -0
- package/dist/commands/tree.command.d.ts.map +1 -0
- package/dist/commands/tree.command.js +35 -0
- package/dist/commands/tree.command.js.map +1 -0
- package/dist/components/List.d.ts +9 -0
- package/dist/components/List.d.ts.map +1 -0
- package/dist/components/List.js +57 -0
- package/dist/components/List.js.map +1 -0
- package/dist/components/StaticLogs.d.ts +2 -0
- package/dist/components/StaticLogs.d.ts.map +1 -0
- package/dist/components/StaticLogs.js +77 -0
- package/dist/components/StaticLogs.js.map +1 -0
- package/dist/components/TaskSetSpinner.d.ts +6 -0
- package/dist/components/TaskSetSpinner.d.ts.map +1 -0
- package/dist/components/TaskSetSpinner.js +41 -0
- package/dist/components/TaskSetSpinner.js.map +1 -0
- package/dist/components/TaskSpinner.d.ts +6 -0
- package/dist/components/TaskSpinner.d.ts.map +1 -0
- package/dist/components/TaskSpinner.js +72 -0
- package/dist/components/TaskSpinner.js.map +1 -0
- package/dist/components/WorkspaceTree.d.ts +8 -0
- package/dist/components/WorkspaceTree.d.ts.map +1 -0
- package/dist/components/WorkspaceTree.js +153 -0
- package/dist/components/WorkspaceTree.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +48 -21
- package/dist/main.js.map +1 -0
- package/dist/wrapper.d.ts +6 -0
- package/dist/wrapper.d.ts.map +1 -0
- package/dist/wrapper.js +30 -0
- package/dist/wrapper.js.map +1 -0
- package/dist/wrappers/project.wrapper.d.ts +7 -0
- package/dist/wrappers/project.wrapper.d.ts.map +1 -0
- package/dist/wrappers/project.wrapper.js +105 -0
- package/dist/wrappers/project.wrapper.js.map +1 -0
- package/dist/wrappers/workspace.wrapper.d.ts +5 -0
- package/dist/wrappers/workspace.wrapper.d.ts.map +1 -0
- package/dist/wrappers/workspace.wrapper.js +108 -0
- package/dist/wrappers/workspace.wrapper.js.map +1 -0
- package/package.json +43 -30
- package/dist/base.command.d.ts +0 -8
- package/dist/base.command.js +0 -33
- package/dist/commands/info.command.d.ts +0 -9
- package/dist/commands/info.command.js +0 -83
- package/dist/filters/affected.d.ts +0 -10
- package/dist/filters/affected.js +0 -80
- package/dist/filters/filter.d.ts +0 -8
- package/dist/filters/filter.js +0 -36
- package/dist/filters/index.d.ts +0 -2
- package/dist/filters/index.js +0 -22
- package/dist/logger.d.ts +0 -15
- package/dist/logger.js +0 -99
- package/dist/myr/commands/kill.command.d.ts +0 -11
- package/dist/myr/commands/kill.command.js +0 -52
- package/dist/myr/commands/list.command.d.ts +0 -18
- package/dist/myr/commands/list.command.js +0 -127
- package/dist/myr/commands/logs.command.d.ts +0 -11
- package/dist/myr/commands/logs.command.js +0 -83
- package/dist/myr/commands/spawn.command.d.ts +0 -11
- package/dist/myr/commands/spawn.command.js +0 -45
- package/dist/myr/commands/stop.command.d.ts +0 -7
- package/dist/myr/commands/stop.command.js +0 -43
- package/dist/myr/myr-client.d.ts +0 -22
- package/dist/myr/myr-client.js +0 -234
- package/dist/myr/myr.command.d.ts +0 -8
- package/dist/myr/myr.command.js +0 -46
- package/dist/myr/myr.process.d.ts +0 -1
- package/dist/myr/myr.process.js +0 -43
- package/dist/myr/watch.command.d.ts +0 -13
- package/dist/myr/watch.command.js +0 -87
- package/dist/pipeline.d.ts +0 -9
- package/dist/pipeline.js +0 -53
- package/dist/plugin.d.ts +0 -11
- package/dist/plugin.js +0 -40
- package/dist/project.command.d.ts +0 -13
- package/dist/project.command.js +0 -58
- package/dist/task-logger.d.ts +0 -14
- package/dist/task-logger.js +0 -66
- package/dist/utils/cli-list.d.ts +0 -15
- package/dist/utils/cli-list.js +0 -87
- package/dist/workspace.command.d.ts +0 -12
- package/dist/workspace.command.js +0 -55
package/dist/index.js
CHANGED
|
@@ -9,12 +9,6 @@ Object.defineProperty(exports, "EachCommand", {
|
|
|
9
9
|
return _each.EachCommand;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "InfoCommand", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _info.InfoCommand;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
12
|
Object.defineProperty(exports, "ListCommand", {
|
|
19
13
|
enumerable: true,
|
|
20
14
|
get: function () {
|
|
@@ -27,12 +21,18 @@ Object.defineProperty(exports, "RunCommand", {
|
|
|
27
21
|
return _run.RunCommand;
|
|
28
22
|
}
|
|
29
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "TreeCommand", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _tree.TreeCommand;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
30
|
|
|
31
31
|
var _each = require("./commands/each.command");
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _tree = require("./commands/tree.command");
|
|
34
34
|
|
|
35
35
|
var _list = require("./commands/list.command");
|
|
36
36
|
|
|
37
37
|
var _run = require("./commands/run.command");
|
|
38
|
-
//# sourceMappingURL=
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA","file":"index.js","sourcesContent":["export { EachCommand } from './commands/each.command';\nexport { TreeCommand } from './commands/tree.command';\nexport { ListCommand } from './commands/list.command';\nexport { RunCommand } from './commands/run.command';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["main.tsx"],"names":[],"mappings":"","file":"main.d.ts","sourcesContent":["import { render } from 'ink';\nimport { StrictMode } from 'react';\n\nimport { Application } from './application';\nimport { EachCommand } from './commands/each.command';\nimport { ListCommand } from './commands/list.command';\nimport { RunCommand } from './commands/run.command';\nimport { TreeCommand } from './commands/tree.command';\nimport { StaticLogs } from './components/StaticLogs';\n\n// Bootstrap\n(async () => {\n const { waitUntilExit } = render(\n <StrictMode>\n <StaticLogs />\n <Application name=\"jill\" commands={[\n EachCommand,\n ListCommand,\n RunCommand,\n TreeCommand\n ]} />\n </StrictMode>\n );\n\n await waitUntilExit();\n})();\n"]}
|
package/dist/main.js
CHANGED
|
@@ -1,38 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _ink = require("ink");
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
|
|
9
|
+
var _application = require("./application");
|
|
8
10
|
|
|
9
|
-
var
|
|
11
|
+
var _each = require("./commands/each.command");
|
|
10
12
|
|
|
11
13
|
var _list = require("./commands/list.command");
|
|
12
14
|
|
|
13
15
|
var _run = require("./commands/run.command");
|
|
14
16
|
|
|
15
|
-
var
|
|
17
|
+
var _tree = require("./commands/tree.command");
|
|
16
18
|
|
|
17
|
-
var
|
|
19
|
+
var _StaticLogs = require("./components/StaticLogs");
|
|
18
20
|
|
|
19
|
-
var
|
|
21
|
+
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
22
|
+
function adopt(value) {
|
|
23
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
24
|
+
resolve(value);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
20
27
|
|
|
21
|
-
|
|
28
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
29
|
+
function fulfilled(value) {
|
|
30
|
+
try {
|
|
31
|
+
step(generator.next(value));
|
|
32
|
+
} catch (e) {
|
|
33
|
+
reject(e);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
22
36
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
function rejected(value) {
|
|
38
|
+
try {
|
|
39
|
+
step(generator["throw"](value));
|
|
40
|
+
} catch (e) {
|
|
41
|
+
reject(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
29
44
|
|
|
30
|
-
|
|
45
|
+
function step(result) {
|
|
46
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
47
|
+
}
|
|
31
48
|
|
|
32
|
-
|
|
49
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
50
|
+
});
|
|
51
|
+
};
|
|
33
52
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
53
|
+
// Bootstrap
|
|
54
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
55
|
+
const {
|
|
56
|
+
waitUntilExit
|
|
57
|
+
} = (0, _ink.render)((0, _jsxRuntime.jsxs)(_react.StrictMode, {
|
|
58
|
+
children: [(0, _jsxRuntime.jsx)(_StaticLogs.StaticLogs, {}), (0, _jsxRuntime.jsx)(_application.Application, {
|
|
59
|
+
name: "jill",
|
|
60
|
+
commands: [_each.EachCommand, _list.ListCommand, _run.RunCommand, _tree.TreeCommand]
|
|
61
|
+
})]
|
|
62
|
+
}));
|
|
63
|
+
yield waitUntilExit();
|
|
64
|
+
}))();
|
|
65
|
+
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["main.js","main.tsx"],"names":["__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","waitUntilExit","StrictMode","children","StaticLogs","Application","name","commands","EachCommand","ListCommand","RunCommand","TreeCommand"],"mappings":";;AASA;;ACTA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;ADRA,IAAIA,SAAS,GAAI,UAAQ,SAAKA,SAAd,IAA4B,UAAUC,OAAV,EAAmBC,UAAnB,EAA+BC,CAA/B,EAAkCC,SAAlC,EAA6C;AACrF,WAASC,KAAT,CAAeC,KAAf,EAAsB;AAAE,WAAOA,KAAK,YAAYH,CAAjB,GAAqBG,KAArB,GAA6B,IAAIH,CAAJ,CAAM,UAAUI,OAAV,EAAmB;AAAEA,MAAAA,OAAO,CAACD,KAAD,CAAP;AAAiB,KAA5C,CAApC;AAAoF;;AAC5G,SAAO,KAAKH,CAAC,KAAKA,CAAC,GAAGK,OAAT,CAAN,EAAyB,UAAUD,OAAV,EAAmBE,MAAnB,EAA2B;AACvD,aAASC,SAAT,CAAmBJ,KAAnB,EAA0B;AAAE,UAAI;AAAEK,QAAAA,IAAI,CAACP,SAAS,CAACQ,IAAV,CAAeN,KAAf,CAAD,CAAJ;AAA8B,OAApC,CAAqC,OAAOO,CAAP,EAAU;AAAEJ,QAAAA,MAAM,CAACI,CAAD,CAAN;AAAY;AAAE;;AAC3F,aAASC,QAAT,CAAkBR,KAAlB,EAAyB;AAAE,UAAI;AAAEK,QAAAA,IAAI,CAACP,SAAS,CAAC,OAAD,CAAT,CAAmBE,KAAnB,CAAD,CAAJ;AAAkC,OAAxC,CAAyC,OAAOO,CAAP,EAAU;AAAEJ,QAAAA,MAAM,CAACI,CAAD,CAAN;AAAY;AAAE;;AAC9F,aAASF,IAAT,CAAcI,MAAd,EAAsB;AAAEA,MAAAA,MAAM,CAACC,IAAP,GAAcT,OAAO,CAACQ,MAAM,CAACT,KAAR,CAArB,GAAsCD,KAAK,CAACU,MAAM,CAACT,KAAR,CAAL,CAAoBW,IAApB,CAAyBP,SAAzB,EAAoCI,QAApC,CAAtC;AAAsF;;AAC9GH,IAAAA,IAAI,CAAC,CAACP,SAAS,GAAGA,SAAS,CAACc,KAAV,CAAgBjB,OAAhB,EAAyBC,UAAU,IAAI,EAAvC,CAAb,EAAyDU,IAAzD,EAAD,CAAJ;AACH,GALM,CAAP;AAMH,CARD;;ACUA;AACA,CAAC,MAAWZ,SAAA,CAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;AACV,QAAM;AAAEmB,IAAAA;AAAF,MAAoB,iBACxB,sBAACC,iBAAD,EAAW;AAAAC,IAAAA,QAAA,EAAA,CACT,qBAACC,sBAAD,EAAW,EAAX,CADS,EAET,qBAACC,wBAAD,EAAY;AAACC,MAAAA,IAAI,EAAC,MAAN;AAAaC,MAAAA,QAAQ,EAAE,CACjCC,iBADiC,EAEjCC,iBAFiC,EAGjCC,eAHiC,EAIjCC,iBAJiC;AAAvB,KAAZ,CAFS;AAAA,GAAX,CADwB,CAA1B;AAYA,QAAMV,aAAa,EAAnB;AACD,CAdW,CAAZ","file":"main.js","sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { render } from 'ink';\nimport { StrictMode } from 'react';\nimport { Application } from './application';\nimport { EachCommand } from './commands/each.command';\nimport { ListCommand } from './commands/list.command';\nimport { RunCommand } from './commands/run.command';\nimport { TreeCommand } from './commands/tree.command';\nimport { StaticLogs } from './components/StaticLogs';\n// Bootstrap\n(() => __awaiter(void 0, void 0, void 0, function* () {\n const { waitUntilExit } = render(_jsxs(StrictMode, { children: [_jsx(StaticLogs, {}), _jsx(Application, { name: \"jill\", commands: [\n EachCommand,\n ListCommand,\n RunCommand,\n TreeCommand\n ] })] }));\n yield waitUntilExit();\n}))();","import { render } from 'ink';\nimport { StrictMode } from 'react';\n\nimport { Application } from './application';\nimport { EachCommand } from './commands/each.command';\nimport { ListCommand } from './commands/list.command';\nimport { RunCommand } from './commands/run.command';\nimport { TreeCommand } from './commands/tree.command';\nimport { StaticLogs } from './components/StaticLogs';\n\n// Bootstrap\n(async () => {\n const { waitUntilExit } = render(\n <StrictMode>\n <StaticLogs />\n <Application name=\"jill\" commands={[\n EachCommand,\n ListCommand,\n RunCommand,\n TreeCommand\n ]} />\n </StrictMode>\n );\n\n await waitUntilExit();\n})();\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { BuilderWrapper, CommandComponent, UseArgsHook } from './application.context';
|
|
3
|
+
import { CommandUtils } from './command';
|
|
4
|
+
export declare type CommandWrapper<A> = <Args>(utils: CommandUtils<Args>) => CommandUtils<Omit<Args, keyof A> & A>;
|
|
5
|
+
export declare type WrapperComponent<A> = <Args>(useArgs: UseArgsHook<A>, Wrapped: CommandComponent<Args>) => ReactElement;
|
|
6
|
+
export declare function commandWrapper<A>(name: string, builder: BuilderWrapper<A>, wrapper: WrapperComponent<A>): CommandWrapper<A>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAW,gBAAgB,EAAW,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,oBAAY,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,KAAK,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3G,oBAAY,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,YAAY,CAAC;AAGnH,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAoB3H","file":"wrapper.d.ts","sourcesContent":["import { FC, ReactElement } from 'react';\n\nimport { BuilderWrapper, Command, CommandComponent, useArgs, UseArgsHook } from './application.context';\nimport { CommandUtils } from './command';\n\n// Types\nexport type CommandWrapper<A> = <Args>(utils: CommandUtils<Args>) => CommandUtils<Omit<Args, keyof A> & A>;\nexport type WrapperComponent<A> = <Args>(useArgs: UseArgsHook<A>, Wrapped: CommandComponent<Args>) => ReactElement;\n\n// Wrapper generator\nexport function commandWrapper<A>(name: string, builder: BuilderWrapper<A>, wrapper: WrapperComponent<A>): CommandWrapper<A> {\n return <Args>(utils: CommandUtils<Args>): CommandUtils<Omit<Args, keyof A> & A> => ({\n useArgs: () => useArgs<Args & A>(),\n wrapper: (Component: FC): CommandComponent<Omit<Args, keyof A> & A> => {\n const Wrapped = utils.wrapper(Component);\n\n // Update builder\n const command: Command<Omit<Args, keyof A> & A> = {\n ...Wrapped.command,\n builder: (yargs) => builder(Wrapped.command.builder(yargs))\n };\n\n // Component wrapper\n const Wrapper: FC = () => wrapper(() => useArgs<A>(), Wrapped);\n\n Wrapper.displayName = `${name}(${Wrapped.displayName || Wrapped.name})`;\n\n return Object.assign(Wrapper, { command });\n },\n });\n}\n"]}
|
package/dist/wrapper.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.commandWrapper = commandWrapper;
|
|
7
|
+
|
|
8
|
+
var _application = require("./application.context");
|
|
9
|
+
|
|
10
|
+
// Wrapper generator
|
|
11
|
+
function commandWrapper(name, builder, wrapper) {
|
|
12
|
+
return utils => ({
|
|
13
|
+
useArgs: () => (0, _application.useArgs)(),
|
|
14
|
+
wrapper: Component => {
|
|
15
|
+
const Wrapped = utils.wrapper(Component); // Update builder
|
|
16
|
+
|
|
17
|
+
const command = Object.assign(Object.assign({}, Wrapped.command), {
|
|
18
|
+
builder: yargs => builder(Wrapped.command.builder(yargs))
|
|
19
|
+
}); // Component wrapper
|
|
20
|
+
|
|
21
|
+
const Wrapper = () => wrapper(() => (0, _application.useArgs)(), Wrapped);
|
|
22
|
+
|
|
23
|
+
Wrapper.displayName = `${name}(${Wrapped.displayName || Wrapped.name})`;
|
|
24
|
+
return Object.assign(Wrapper, {
|
|
25
|
+
command
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=wrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["wrapper.ts"],"names":["commandWrapper","name","builder","wrapper","utils","useArgs","Component","Wrapped","command","Object","assign","yargs","Wrapper","displayName"],"mappings":";;;;;;;AAEA;;AAOA;AACM,SAAUA,cAAV,CAA4BC,IAA5B,EAA0CC,OAA1C,EAAsEC,OAAtE,EAAkG;AACtG,SAAcC,KAAP,KAA6E;AAClFC,IAAAA,OAAO,EAAE,MAAM,2BADmE;AAElFF,IAAAA,OAAO,EAAGG,SAAD,IAA6D;AACpE,YAAMC,OAAO,GAAGH,KAAK,CAACD,OAAN,CAAcG,SAAd,CAAhB,CADoE,CAGpE;;AACA,YAAME,OAAO,GAAAC,MAAA,CAAAC,MAAA,CAAAD,MAAA,CAAAC,MAAA,CAAA,EAAA,EACRH,OAAO,CAACC,OADA,CAAA,EACO;AAClBN,QAAAA,OAAO,EAAGS,KAAD,IAAWT,OAAO,CAACK,OAAO,CAACC,OAAR,CAAgBN,OAAhB,CAAwBS,KAAxB,CAAD;AADT,OADP,CAAb,CAJoE,CASpE;;AACA,YAAMC,OAAO,GAAO,MAAMT,OAAO,CAAC,MAAM,2BAAP,EAAqBI,OAArB,CAAjC;;AAEAK,MAAAA,OAAO,CAACC,WAAR,GAAsB,GAAGZ,IAAI,IAAIM,OAAO,CAACM,WAAR,IAAuBN,OAAO,CAACN,IAAI,GAApE;AAEA,aAAOQ,MAAM,CAACC,MAAP,CAAcE,OAAd,EAAuB;AAAEJ,QAAAA;AAAF,OAAvB,CAAP;AACD;AAjBiF,GAA7E,CAAP;AAmBD","file":"wrapper.js","sourcesContent":["import { FC, ReactElement } from 'react';\n\nimport { BuilderWrapper, Command, CommandComponent, useArgs, UseArgsHook } from './application.context';\nimport { CommandUtils } from './command';\n\n// Types\nexport type CommandWrapper<A> = <Args>(utils: CommandUtils<Args>) => CommandUtils<Omit<Args, keyof A> & A>;\nexport type WrapperComponent<A> = <Args>(useArgs: UseArgsHook<A>, Wrapped: CommandComponent<Args>) => ReactElement;\n\n// Wrapper generator\nexport function commandWrapper<A>(name: string, builder: BuilderWrapper<A>, wrapper: WrapperComponent<A>): CommandWrapper<A> {\n return <Args>(utils: CommandUtils<Args>): CommandUtils<Omit<Args, keyof A> & A> => ({\n useArgs: () => useArgs<Args & A>(),\n wrapper: (Component: FC): CommandComponent<Omit<Args, keyof A> & A> => {\n const Wrapped = utils.wrapper(Component);\n\n // Update builder\n const command: Command<Omit<Args, keyof A> & A> = {\n ...Wrapped.command,\n builder: (yargs) => builder(Wrapped.command.builder(yargs))\n };\n\n // Component wrapper\n const Wrapper: FC = () => wrapper(() => useArgs<A>(), Wrapped);\n\n Wrapper.displayName = `${name}(${Wrapped.displayName || Wrapped.name})`;\n\n return Object.assign(Wrapper, { command });\n },\n });\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PackageManager, Project } from '@jujulego/jill-core';
|
|
2
|
+
export declare function useProject(): Project;
|
|
3
|
+
export declare const withProject: import("../wrapper").CommandWrapper<{
|
|
4
|
+
project: string | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
"package-manager": PackageManager | undefined;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["wrappers/project.wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAW9D,wBAAgB,UAAU,IAAI,OAAO,CAQpC;AAGD,eAAO,MAAM,WAAW;;;;EAwCvB,CAAC","file":"project.wrapper.d.ts","sourcesContent":["import { PackageManager, Project } from '@jujulego/jill-core';\nimport { Text } from 'ink';\nimport Spinner from 'ink-spinner';\nimport { createContext, useContext, useEffect, useState } from 'react';\n\nimport { commandWrapper } from '../wrapper';\n\n// Context\nconst ProjectContext = createContext<Project | null>(null);\n\n// Hooks\nexport function useProject(): Project {\n const prj = useContext(ProjectContext);\n\n if (!prj) {\n throw new Error('To use the useProject hook you must wrap your command with the withProject wrapper');\n }\n\n return prj;\n}\n\n// Wrapper\nexport const withProject = commandWrapper(\n 'withProject',\n (yargs) => yargs\n .option('project', {\n alias: 'p',\n type: 'string',\n description: 'Project root directory'\n })\n .option('package-manager', {\n choices: ['yarn', 'npm'],\n default: undefined as PackageManager | undefined,\n type: 'string',\n description: 'Force package manager'\n }),\n (useArgs, Wrapped) => {\n const args = useArgs();\n\n // State\n const [project, setProject] = useState<Project>();\n\n // Effects\n useEffect(() => void (async () => {\n const dir = args.project ?? await Project.searchProjectRoot(process.cwd());\n\n setProject(await new Project(dir, {\n packageManager: args['package-manager']\n }));\n })(), [args]);\n\n // Render\n if (!project) {\n return <Text><Spinner /> Loading project ...</Text>;\n }\n\n return (\n <ProjectContext.Provider value={project}>\n <Wrapped />\n </ProjectContext.Provider>\n );\n }\n);\n"]}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useProject = useProject;
|
|
7
|
+
exports.withProject = void 0;
|
|
8
|
+
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
|
|
11
|
+
var _jillCore = require("@jujulego/jill-core");
|
|
12
|
+
|
|
13
|
+
var _ink = require("ink");
|
|
14
|
+
|
|
15
|
+
var _inkSpinner = _interopRequireDefault(require("ink-spinner"));
|
|
16
|
+
|
|
17
|
+
var _react = require("react");
|
|
18
|
+
|
|
19
|
+
var _wrapper = require("../wrapper");
|
|
20
|
+
|
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
+
|
|
23
|
+
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
24
|
+
function adopt(value) {
|
|
25
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
26
|
+
resolve(value);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) {
|
|
32
|
+
try {
|
|
33
|
+
step(generator.next(value));
|
|
34
|
+
} catch (e) {
|
|
35
|
+
reject(e);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function rejected(value) {
|
|
40
|
+
try {
|
|
41
|
+
step(generator["throw"](value));
|
|
42
|
+
} catch (e) {
|
|
43
|
+
reject(e);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function step(result) {
|
|
48
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Context
|
|
56
|
+
const ProjectContext = /*#__PURE__*/(0, _react.createContext)(null); // Hooks
|
|
57
|
+
|
|
58
|
+
function useProject() {
|
|
59
|
+
const prj = (0, _react.useContext)(ProjectContext);
|
|
60
|
+
|
|
61
|
+
if (!prj) {
|
|
62
|
+
throw new Error('To use the useProject hook you must wrap your command with the withProject wrapper');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return prj;
|
|
66
|
+
} // Wrapper
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
const withProject = (0, _wrapper.commandWrapper)('withProject', yargs => yargs.option('project', {
|
|
70
|
+
alias: 'p',
|
|
71
|
+
type: 'string',
|
|
72
|
+
description: 'Project root directory'
|
|
73
|
+
}).option('package-manager', {
|
|
74
|
+
choices: ['yarn', 'npm'],
|
|
75
|
+
default: undefined,
|
|
76
|
+
type: 'string',
|
|
77
|
+
description: 'Force package manager'
|
|
78
|
+
}), (useArgs, Wrapped) => {
|
|
79
|
+
const args = useArgs(); // State
|
|
80
|
+
|
|
81
|
+
const [project, setProject] = (0, _react.useState)(); // Effects
|
|
82
|
+
|
|
83
|
+
(0, _react.useEffect)(() => void (() => __awaiter(void 0, void 0, void 0, function* () {
|
|
84
|
+
var _a;
|
|
85
|
+
|
|
86
|
+
const dir = (_a = args.project) !== null && _a !== void 0 ? _a : yield _jillCore.Project.searchProjectRoot(process.cwd());
|
|
87
|
+
setProject(yield new _jillCore.Project(dir, {
|
|
88
|
+
packageManager: args['package-manager']
|
|
89
|
+
}));
|
|
90
|
+
}))(), [args]); // Render
|
|
91
|
+
|
|
92
|
+
if (!project) {
|
|
93
|
+
return (0, _jsxRuntime.jsxs)(_ink.Text, {
|
|
94
|
+
children: [(0, _jsxRuntime.jsx)(_inkSpinner.default, {}), " Loading project ..."]
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return (0, _jsxRuntime.jsx)(ProjectContext.Provider, Object.assign({
|
|
99
|
+
value: project
|
|
100
|
+
}, {
|
|
101
|
+
children: (0, _jsxRuntime.jsx)(Wrapped, {})
|
|
102
|
+
}));
|
|
103
|
+
});
|
|
104
|
+
exports.withProject = withProject;
|
|
105
|
+
//# sourceMappingURL=project.wrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["wrappers/project.wrapper.js","wrappers/project.wrapper.tsx"],"names":["__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","ProjectContext","useProject","prj","Error","withProject","yargs","option","alias","type","description","choices","default","undefined","useArgs","Wrapped","args","project","setProject","_a","dir","Project","searchProjectRoot","process","cwd","packageManager","Text","children","Spinner","Provider","Object","assign"],"mappings":";;;;;;;;AASA;;ACTA;;AACA;;AACA;;AACA;;AAEA;;;;ADLA,IAAIA,SAAS,GAAI,UAAQ,SAAKA,SAAd,IAA4B,UAAUC,OAAV,EAAmBC,UAAnB,EAA+BC,CAA/B,EAAkCC,SAAlC,EAA6C;AACrF,WAASC,KAAT,CAAeC,KAAf,EAAsB;AAAE,WAAOA,KAAK,YAAYH,CAAjB,GAAqBG,KAArB,GAA6B,IAAIH,CAAJ,CAAM,UAAUI,OAAV,EAA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,EAAR,CAAD,EAAY,sBAAZ;AAAA,KAAL,CAAP;AACD;;AAED,SACE,qBAAC3B,cAAc,CAAC4B,QAAhB,EAAwBC,MAAA,CAAAC,MAAA,CAAA;AAAC3C,IAAAA,KAAK,EAAE6B;AAAR,GAAA,EAAe;AAAAU,IAAAA,QAAA,EACrC,qBAACZ,OAAD,EAAQ,EAAR;AADqC,GAAf,CAAxB,CADF;AAKD,CAvCwB,CAApB","file":"project.wrapper.js","sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Project } from '@jujulego/jill-core';\nimport { Text } from 'ink';\nimport Spinner from 'ink-spinner';\nimport { createContext, useContext, useEffect, useState } from 'react';\nimport { commandWrapper } from '../wrapper';\n// Context\nconst ProjectContext = createContext(null);\n// Hooks\nexport function useProject() {\n const prj = useContext(ProjectContext);\n if (!prj) {\n throw new Error('To use the useProject hook you must wrap your command with the withProject wrapper');\n }\n return prj;\n}\n// Wrapper\nexport const withProject = commandWrapper('withProject', (yargs) => yargs\n .option('project', {\n alias: 'p',\n type: 'string',\n description: 'Project root directory'\n})\n .option('package-manager', {\n choices: ['yarn', 'npm'],\n default: undefined,\n type: 'string',\n description: 'Force package manager'\n}), (useArgs, Wrapped) => {\n const args = useArgs();\n // State\n const [project, setProject] = useState();\n // Effects\n useEffect(() => void (() => __awaiter(void 0, void 0, void 0, function* () {\n var _a;\n const dir = (_a = args.project) !== null && _a !== void 0 ? _a : yield Project.searchProjectRoot(process.cwd());\n setProject(yield new Project(dir, {\n packageManager: args['package-manager']\n }));\n }))(), [args]);\n // Render\n if (!project) {\n return _jsxs(Text, { children: [_jsx(Spinner, {}), \" Loading project ...\"] });\n }\n return (_jsx(ProjectContext.Provider, Object.assign({ value: project }, { children: _jsx(Wrapped, {}) })));\n});","import { PackageManager, Project } from '@jujulego/jill-core';\nimport { Text } from 'ink';\nimport Spinner from 'ink-spinner';\nimport { createContext, useContext, useEffect, useState } from 'react';\n\nimport { commandWrapper } from '../wrapper';\n\n// Context\nconst ProjectContext = createContext<Project | null>(null);\n\n// Hooks\nexport function useProject(): Project {\n const prj = useContext(ProjectContext);\n\n if (!prj) {\n throw new Error('To use the useProject hook you must wrap your command with the withProject wrapper');\n }\n\n return prj;\n}\n\n// Wrapper\nexport const withProject = commandWrapper(\n 'withProject',\n (yargs) => yargs\n .option('project', {\n alias: 'p',\n type: 'string',\n description: 'Project root directory'\n })\n .option('package-manager', {\n choices: ['yarn', 'npm'],\n default: undefined as PackageManager | undefined,\n type: 'string',\n description: 'Force package manager'\n }),\n (useArgs, Wrapped) => {\n const args = useArgs();\n\n // State\n const [project, setProject] = useState<Project>();\n\n // Effects\n useEffect(() => void (async () => {\n const dir = args.project ?? await Project.searchProjectRoot(process.cwd());\n\n setProject(await new Project(dir, {\n packageManager: args['package-manager']\n }));\n })(), [args]);\n\n // Render\n if (!project) {\n return <Text><Spinner /> Loading project ...</Text>;\n }\n\n return (\n <ProjectContext.Provider value={project}>\n <Wrapped />\n </ProjectContext.Provider>\n );\n }\n);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["wrappers/workspace.wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAahD,wBAAgB,YAAY,IAAI,SAAS,CAQxC;AAGD,eAAO,MAAM,aAAa;;EAmCzB,CAAC","file":"workspace.wrapper.d.ts","sourcesContent":["import { Workspace } from '@jujulego/jill-core';\nimport { Text } from 'ink';\nimport Spinner from 'ink-spinner';\nimport { createContext, useContext, useEffect, useState } from 'react';\n\nimport { commandWrapper } from '../wrapper';\nimport { useProject } from './project.wrapper';\nimport logSymbols from 'log-symbols';\n\n// Context\nconst WorkspaceContext = createContext<Workspace | null>(null);\n\n// Hooks\nexport function useWorkspace(): Workspace {\n const wks = useContext(WorkspaceContext);\n\n if (!wks) {\n throw new Error('To use the useWorkspace hook you must wrap your command with the withWorkspace wrapper');\n }\n\n return wks;\n}\n\n// Wrapper\nexport const withWorkspace = commandWrapper(\n 'withWorkspace',\n (yargs) => yargs\n .option('workspace', {\n alias: 'w',\n type: 'string',\n desc: 'Workspace to use'\n }),\n (useArgs, Wrapped) => {\n const { workspace } = useArgs();\n const project = useProject();\n\n // State\n const [wks, setWks] = useState<Workspace | null>();\n\n // Effects\n useEffect(() => void (async () => {\n setWks(await (workspace ? project.workspace(workspace) : project.currentWorkspace()));\n })(), [workspace]);\n\n // Render\n if (wks === undefined) {\n return <Text><Spinner /> Loading \"{workspace || '.'}\" workspace</Text>;\n }\n\n if (wks === null) {\n return <Text color=\"red\">{logSymbols.error} Workspace \"{workspace || '.'}\" not found</Text>;\n }\n\n return (\n <WorkspaceContext.Provider value={wks}>\n <Wrapped />\n </WorkspaceContext.Provider>\n );\n }\n);\n"]}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useWorkspace = useWorkspace;
|
|
7
|
+
exports.withWorkspace = void 0;
|
|
8
|
+
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
|
|
11
|
+
var _ink = require("ink");
|
|
12
|
+
|
|
13
|
+
var _inkSpinner = _interopRequireDefault(require("ink-spinner"));
|
|
14
|
+
|
|
15
|
+
var _react = require("react");
|
|
16
|
+
|
|
17
|
+
var _wrapper = require("../wrapper");
|
|
18
|
+
|
|
19
|
+
var _project = require("./project.wrapper");
|
|
20
|
+
|
|
21
|
+
var _logSymbols = _interopRequireDefault(require("log-symbols"));
|
|
22
|
+
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
+
|
|
25
|
+
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) {
|
|
27
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
28
|
+
resolve(value);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
+
function fulfilled(value) {
|
|
34
|
+
try {
|
|
35
|
+
step(generator.next(value));
|
|
36
|
+
} catch (e) {
|
|
37
|
+
reject(e);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function rejected(value) {
|
|
42
|
+
try {
|
|
43
|
+
step(generator["throw"](value));
|
|
44
|
+
} catch (e) {
|
|
45
|
+
reject(e);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function step(result) {
|
|
50
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// Context
|
|
58
|
+
const WorkspaceContext = /*#__PURE__*/(0, _react.createContext)(null); // Hooks
|
|
59
|
+
|
|
60
|
+
function useWorkspace() {
|
|
61
|
+
const wks = (0, _react.useContext)(WorkspaceContext);
|
|
62
|
+
|
|
63
|
+
if (!wks) {
|
|
64
|
+
throw new Error('To use the useWorkspace hook you must wrap your command with the withWorkspace wrapper');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return wks;
|
|
68
|
+
} // Wrapper
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
const withWorkspace = (0, _wrapper.commandWrapper)('withWorkspace', yargs => yargs.option('workspace', {
|
|
72
|
+
alias: 'w',
|
|
73
|
+
type: 'string',
|
|
74
|
+
desc: 'Workspace to use'
|
|
75
|
+
}), (useArgs, Wrapped) => {
|
|
76
|
+
const {
|
|
77
|
+
workspace
|
|
78
|
+
} = useArgs();
|
|
79
|
+
const project = (0, _project.useProject)(); // State
|
|
80
|
+
|
|
81
|
+
const [wks, setWks] = (0, _react.useState)(); // Effects
|
|
82
|
+
|
|
83
|
+
(0, _react.useEffect)(() => void (() => __awaiter(void 0, void 0, void 0, function* () {
|
|
84
|
+
setWks(yield workspace ? project.workspace(workspace) : project.currentWorkspace());
|
|
85
|
+
}))(), [workspace]); // Render
|
|
86
|
+
|
|
87
|
+
if (wks === undefined) {
|
|
88
|
+
return (0, _jsxRuntime.jsxs)(_ink.Text, {
|
|
89
|
+
children: [(0, _jsxRuntime.jsx)(_inkSpinner.default, {}), " Loading \"", workspace || '.', "\" workspace"]
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (wks === null) {
|
|
94
|
+
return (0, _jsxRuntime.jsxs)(_ink.Text, Object.assign({
|
|
95
|
+
color: "red"
|
|
96
|
+
}, {
|
|
97
|
+
children: [_logSymbols.default.error, " Workspace \"", workspace || '.', "\" not found"]
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return (0, _jsxRuntime.jsx)(WorkspaceContext.Provider, Object.assign({
|
|
102
|
+
value: wks
|
|
103
|
+
}, {
|
|
104
|
+
children: (0, _jsxRuntime.jsx)(Wrapped, {})
|
|
105
|
+
}));
|
|
106
|
+
});
|
|
107
|
+
exports.withWorkspace = withWorkspace;
|
|
108
|
+
//# sourceMappingURL=workspace.wrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["wrappers/workspace.wrapper.js","wrappers/workspace.wrapper.tsx"],"names":["__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","WorkspaceContext","useWorkspace","wks","Error","withWorkspace","yargs","option","alias","type","desc","useArgs","Wrapped","workspace","project","setWks","currentWorkspace","undefined","Text","children","Spinner","Object","assign","color","logSymbols","error","Provider"],"mappings":";;;;;;;;AASA;;ACRA;;AACA;;AACA;;AAEA;;AACA;;AACA;;;;ADPA,IAAIA,SAAS,GAAI,UAAQ,SAAKA,SAAd,IAA4B,UAAUC,OAAV,EAAmBC,UAAnB,EAA+BC,CAA/B,EAAkCC,SAAlC,EAA6C;AACrF,WAASC,KAAT,CAAeC,KAAf,EAAsB;AAAE,WAAOA,KAAK,YAAYH,CAAjB,GAAqBG,KAArB,GAA6B,IAAIH,CAAJ,CAAM,UAAUI,OAAV,EAAmB;AAAEA,MAAAA,OAAO,CAACD,KAAD,CAAP;AAAiB,KAA5C,CAApC;AAAoF;;AAC5G,SAAO,KAAKH,CAAC,KAAKA,CAAC,GAAGK,OAAT,CAAN,EAAyB,UAAUD,OAAV,EAAmBE,MAAnB,EAA2B;AACvD,aAASC,SAAT,CAAmBJ,KAAnB,EAA0B;AAAE,UAAI;AAAEK,QAAAA,IAAI,CAACP,SAAS,CAACQ,IAAV,CAAeN,KAAf,CAAD,CAAJ;AAA8B,OAApC,CAAqC,OAAOO,CAAP,EAAU;AAAEJ,QAAAA,MAAM,CAACI,CAAD,CAAN;AAAY;AAAE;;AAC3F,aAASC,QAAT,CAAkBR,KAAlB,EAAyB;AAAE,UAAI;AAAEK,QAAAA,IAAI,CAACP,SAAS,CAAC,OAAD,CAAT,CAAmBE,KAAnB,CAAD,CAAJ;AAAkC,OAAxC,CAAyC,OAAOO,CAAP,EAAU;AAAEJ,QAAAA,MAAM,CAACI,CAAD,CAAN;AAAY;AAAE;;AAC9F,aAASF,IAAT,CAAcI,MAAd,EAAsB;AAAEA,MAAAA,MAAM,CAACC,IAAP,GAAcT,OAAO,CAACQ,MAAM,CAACT,KA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SAAD,CAFN,EARmB,CAYnB;;AACA,MAAIV,GAAG,KAAKc,SAAZ,EAAuB;AACrB,WAAO,sBAACC,SAAD,EAAK;AAAAC,MAAAA,QAAA,EAAA,CAAC,qBAACC,mBAAD,EAAQ,EAAR,CAAD,EAAY,aAAZ,EAAuBP,SAAS,IAAI,GAApC,EAAuC,cAAvC;AAAA,KAAL,CAAP;AACD;;AAED,MAAIV,GAAG,KAAK,IAAZ,EAAkB;AAChB,WAAO,sBAACe,SAAD,EAAKG,MAAA,CAAAC,MAAA,CAAA;AAACC,MAAAA,KAAK,EAAC;AAAP,KAAA,EAAY;AAAAJ,MAAAA,QAAA,EAAA,CAAEK,oBAAWC,KAAb,EAAkB,eAAlB,EAAgCZ,SAAS,IAAI,GAA7C,EAAgD,cAAhD;AAAA,KAAZ,CAAL,CAAP;AACD;;AAED,SACE,qBAACZ,gBAAgB,CAACyB,QAAlB,EAA0BL,MAAA,CAAAC,MAAA,CAAA;AAAClC,IAAAA,KAAK,EAAEe;AAAR,GAAA,EAAW;AAAAgB,IAAAA,QAAA,EACnC,qBAACP,OAAD,EAAQ,EAAR;AADmC,GAAX,CAA1B,CADF;AAKD,CAlC0B,CAAtB","file":"workspace.wrapper.js","sourcesContent":["var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Text } from 'ink';\nimport Spinner from 'ink-spinner';\nimport { createContext, useContext, useEffect, useState } from 'react';\nimport { commandWrapper } from '../wrapper';\nimport { useProject } from './project.wrapper';\nimport logSymbols from 'log-symbols';\n// Context\nconst WorkspaceContext = createContext(null);\n// Hooks\nexport function useWorkspace() {\n const wks = useContext(WorkspaceContext);\n if (!wks) {\n throw new Error('To use the useWorkspace hook you must wrap your command with the withWorkspace wrapper');\n }\n return wks;\n}\n// Wrapper\nexport const withWorkspace = commandWrapper('withWorkspace', (yargs) => yargs\n .option('workspace', {\n alias: 'w',\n type: 'string',\n desc: 'Workspace to use'\n}), (useArgs, Wrapped) => {\n const { workspace } = useArgs();\n const project = useProject();\n // State\n const [wks, setWks] = useState();\n // Effects\n useEffect(() => void (() => __awaiter(void 0, void 0, void 0, function* () {\n setWks(yield (workspace ? project.workspace(workspace) : project.currentWorkspace()));\n }))(), [workspace]);\n // Render\n if (wks === undefined) {\n return _jsxs(Text, { children: [_jsx(Spinner, {}), \" Loading \\\"\", workspace || '.', \"\\\" workspace\"] });\n }\n if (wks === null) {\n return _jsxs(Text, Object.assign({ color: \"red\" }, { children: [logSymbols.error, \" Workspace \\\"\", workspace || '.', \"\\\" not found\"] }));\n }\n return (_jsx(WorkspaceContext.Provider, Object.assign({ value: wks }, { children: _jsx(Wrapped, {}) })));\n});","import { Workspace } from '@jujulego/jill-core';\nimport { Text } from 'ink';\nimport Spinner from 'ink-spinner';\nimport { createContext, useContext, useEffect, useState } from 'react';\n\nimport { commandWrapper } from '../wrapper';\nimport { useProject } from './project.wrapper';\nimport logSymbols from 'log-symbols';\n\n// Context\nconst WorkspaceContext = createContext<Workspace | null>(null);\n\n// Hooks\nexport function useWorkspace(): Workspace {\n const wks = useContext(WorkspaceContext);\n\n if (!wks) {\n throw new Error('To use the useWorkspace hook you must wrap your command with the withWorkspace wrapper');\n }\n\n return wks;\n}\n\n// Wrapper\nexport const withWorkspace = commandWrapper(\n 'withWorkspace',\n (yargs) => yargs\n .option('workspace', {\n alias: 'w',\n type: 'string',\n desc: 'Workspace to use'\n }),\n (useArgs, Wrapped) => {\n const { workspace } = useArgs();\n const project = useProject();\n\n // State\n const [wks, setWks] = useState<Workspace | null>();\n\n // Effects\n useEffect(() => void (async () => {\n setWks(await (workspace ? project.workspace(workspace) : project.currentWorkspace()));\n })(), [workspace]);\n\n // Render\n if (wks === undefined) {\n return <Text><Spinner /> Loading \"{workspace || '.'}\" workspace</Text>;\n }\n\n if (wks === null) {\n return <Text color=\"red\">{logSymbols.error} Workspace \"{workspace || '.'}\" not found</Text>;\n }\n\n return (\n <WorkspaceContext.Provider value={wks}>\n <Wrapped />\n </WorkspaceContext.Provider>\n );\n }\n);\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jujulego/jill",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,22 +18,34 @@
|
|
|
18
18
|
"clean": "gulp clean",
|
|
19
19
|
"build": "gulp build",
|
|
20
20
|
"watch": "gulp watch",
|
|
21
|
-
"start": "ts-node src/main.
|
|
21
|
+
"start": "ts-node src/main.tsx",
|
|
22
22
|
"test": "jest"
|
|
23
23
|
},
|
|
24
24
|
"engines": {
|
|
25
25
|
"node": "^14"
|
|
26
26
|
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@jujulego/jill-myr": "1.2.1"
|
|
29
|
+
},
|
|
30
|
+
"peerDependenciesMeta": {
|
|
31
|
+
"@jujulego/jill-myr": {
|
|
32
|
+
"optional": true
|
|
33
|
+
}
|
|
34
|
+
},
|
|
27
35
|
"dependencies": {
|
|
28
|
-
"@jujulego/jill-
|
|
29
|
-
"@jujulego/jill-
|
|
36
|
+
"@jujulego/jill-common": "^2.0.0-beta.1",
|
|
37
|
+
"@jujulego/jill-core": "^2.0.0-beta.1",
|
|
30
38
|
"@repeaterjs/repeater": "^3.0.4",
|
|
31
39
|
"chalk": "^4.1.1",
|
|
32
|
-
"graphql": "^
|
|
33
|
-
"graphql-request": "^
|
|
40
|
+
"graphql": "^16.0.0",
|
|
41
|
+
"graphql-request": "^4.0.0",
|
|
34
42
|
"graphql-tag": "^2.12.6",
|
|
35
43
|
"graphql-ws": "^5.5.5",
|
|
44
|
+
"ink": "^3.2.0",
|
|
45
|
+
"ink-spinner": "^4.0.3",
|
|
46
|
+
"log-symbols": "^4.1.0",
|
|
36
47
|
"ora": "^5.4.1",
|
|
48
|
+
"react": "^17.0.2",
|
|
37
49
|
"slugify": "^1.6.0",
|
|
38
50
|
"winston": "^3.3.3",
|
|
39
51
|
"winston-transport": "^4.4.0",
|
|
@@ -41,33 +53,34 @@
|
|
|
41
53
|
"yargs": "^17.0.1"
|
|
42
54
|
},
|
|
43
55
|
"devDependencies": {
|
|
44
|
-
"@babel/core": "7.
|
|
45
|
-
"@babel/plugin-proposal-class-properties": "7.16.
|
|
46
|
-
"@babel/preset-env": "7.16.
|
|
47
|
-
"@babel/preset-
|
|
48
|
-
"@babel/runtime": "7.
|
|
56
|
+
"@babel/core": "7.17.5",
|
|
57
|
+
"@babel/plugin-proposal-class-properties": "7.16.7",
|
|
58
|
+
"@babel/preset-env": "7.16.11",
|
|
59
|
+
"@babel/preset-react": "7.16.7",
|
|
60
|
+
"@babel/runtime": "7.17.2",
|
|
49
61
|
"@types/gulp": "4.0.9",
|
|
50
|
-
"@types/
|
|
51
|
-
"@types/
|
|
52
|
-
"@types/
|
|
53
|
-
"@types/
|
|
54
|
-
"@types/ws": "8.2
|
|
55
|
-
"@types/yargs": "17.0.
|
|
56
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
57
|
-
"@typescript-eslint/parser": "5.
|
|
62
|
+
"@types/jest": "27.4.1",
|
|
63
|
+
"@types/node": "14.18.12",
|
|
64
|
+
"@types/normalize-package-data": "2.4.1",
|
|
65
|
+
"@types/react": "17.0.39",
|
|
66
|
+
"@types/ws": "8.5.2",
|
|
67
|
+
"@types/yargs": "17.0.9",
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "5.14.0",
|
|
69
|
+
"@typescript-eslint/parser": "5.14.0",
|
|
58
70
|
"del": "6.0.0",
|
|
59
|
-
"eslint": "
|
|
60
|
-
"eslint-plugin-jest": "
|
|
71
|
+
"eslint": "8.10.0",
|
|
72
|
+
"eslint-plugin-jest": "26.1.1",
|
|
61
73
|
"eslint-plugin-workspaces": "0.7.0",
|
|
62
74
|
"gulp": "4.0.2",
|
|
63
|
-
"gulp-babel": "8.0.0",
|
|
64
75
|
"gulp-cli": "2.3.0",
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"msw": "0.
|
|
69
|
-
"
|
|
70
|
-
"ts-
|
|
71
|
-
"
|
|
72
|
-
|
|
76
|
+
"ink-testing-library": "2.1.0",
|
|
77
|
+
"jest": "27.5.1",
|
|
78
|
+
"jill-tools": "0.0.0",
|
|
79
|
+
"msw": "0.39.0",
|
|
80
|
+
"normalize-package-data": "3.0.3",
|
|
81
|
+
"ts-jest": "27.1.3",
|
|
82
|
+
"ts-node": "10.7.0",
|
|
83
|
+
"typescript": "4.6.2"
|
|
84
|
+
},
|
|
85
|
+
"stableVersion": "1.2.0"
|
|
73
86
|
}
|
package/dist/base.command.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Arguments, Awaitable, Builder, Command } from './command';
|
|
2
|
-
export interface BaseArgs {
|
|
3
|
-
verbose: number;
|
|
4
|
-
}
|
|
5
|
-
export declare abstract class BaseCommand<A extends BaseArgs> extends Command<BaseArgs> {
|
|
6
|
-
protected define<T, U>(builder: Builder<T, U>): Builder<T, U & BaseArgs>;
|
|
7
|
-
protected run(args: Arguments<A>): Awaitable<number | void>;
|
|
8
|
-
}
|
package/dist/base.command.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BaseCommand = void 0;
|
|
7
|
-
|
|
8
|
-
var _command = require("./command");
|
|
9
|
-
|
|
10
|
-
// Command
|
|
11
|
-
class BaseCommand extends _command.Command {
|
|
12
|
-
// Methods
|
|
13
|
-
define(builder) {
|
|
14
|
-
return y => builder(y).option('verbose', {
|
|
15
|
-
alias: 'v',
|
|
16
|
-
type: 'count',
|
|
17
|
-
description: 'Set verbosity level (1 for verbose, 2 for debug)'
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
run(args) {
|
|
22
|
-
// Setup logger verbosity
|
|
23
|
-
if (args.verbose === 1) {
|
|
24
|
-
this.logger.level = 'verbose';
|
|
25
|
-
} else if (args.verbose >= 2) {
|
|
26
|
-
this.logger.level = 'debug';
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
exports.BaseCommand = BaseCommand;
|
|
33
|
-
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImJhc2UuY29tbWFuZC50cyJdLCJuYW1lcyI6WyJCYXNlQ29tbWFuZCIsIkNvbW1hbmQiLCJkZWZpbmUiLCJidWlsZGVyIiwieSIsIm9wdGlvbiIsImFsaWFzIiwidHlwZSIsImRlc2NyaXB0aW9uIiwicnVuIiwiYXJncyIsInZlcmJvc2UiLCJsb2dnZXIiLCJsZXZlbCJdLCJtYXBwaW5ncyI6Ijs7Ozs7OztBQUFBOztBQU9BO0FBQ08sTUFBZUEsV0FBZixTQUF1REMsZ0JBQXZELENBQXlFO0FBQzlFO0FBQ1VDLEVBQUFBLE1BQU0sQ0FBT0MsT0FBUCxFQUF5RDtBQUN2RSxXQUFPQyxDQUFDLElBQUlELE9BQU8sQ0FBQ0MsQ0FBRCxDQUFQLENBQ1RDLE1BRFMsQ0FDRixTQURFLEVBQ1M7QUFDakJDLE1BQUFBLEtBQUssRUFBRSxHQURVO0FBRWpCQyxNQUFBQSxJQUFJLEVBQUUs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