@gadgetinc/ggt 0.0.0-alpha.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/LICENSE +7 -0
- package/README.md +177 -0
- package/assets/favicon-128@4x.png +0 -0
- package/bin/dev +20 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +7 -0
- package/bin/run.cmd +3 -0
- package/dist/commands/help.d.ts +16 -0
- package/dist/commands/help.js +37 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/commands/login.d.ts +7 -0
- package/dist/commands/login.js +36 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +7 -0
- package/dist/commands/logout.js +41 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/sync.d.ts +64 -0
- package/dist/commands/sync.js +534 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/whoami.d.ts +7 -0
- package/dist/commands/whoami.js +45 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/base-command.d.ts +87 -0
- package/dist/lib/base-command.js +318 -0
- package/dist/lib/base-command.js.map +1 -0
- package/dist/lib/client.d.ts +39 -0
- package/dist/lib/client.js +155 -0
- package/dist/lib/client.js.map +1 -0
- package/dist/lib/env.d.ts +10 -0
- package/dist/lib/env.js +25 -0
- package/dist/lib/env.js.map +1 -0
- package/dist/lib/errors.d.ts +74 -0
- package/dist/lib/errors.js +320 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/fs-utils.d.ts +18 -0
- package/dist/lib/fs-utils.js +108 -0
- package/dist/lib/fs-utils.js.map +1 -0
- package/dist/lib/help.d.ts +14 -0
- package/dist/lib/help.js +30 -0
- package/dist/lib/help.js.map +1 -0
- package/dist/lib/sleep.d.ts +5 -0
- package/dist/lib/sleep.js +23 -0
- package/dist/lib/sleep.js.map +1 -0
- package/dist/lib/types.d.ts +9 -0
- package/dist/lib/types.js +3 -0
- package/dist/lib/types.js.map +1 -0
- package/package.json +107 -0
package/dist/lib/help.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
class Help extends core_1.Help {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
Object.defineProperty(this, "CommandHelpClass", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
configurable: true,
|
|
10
|
+
writable: true,
|
|
11
|
+
value: CommandHelp
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.default = Help;
|
|
16
|
+
class CommandHelp extends core_1.CommandHelp {
|
|
17
|
+
/**
|
|
18
|
+
* By default, oclif tries to format the description so that it fit's within the terminal window. However, if the description is already
|
|
19
|
+
* formatted with `dedent`, then the description gets mangled and the help output is not pretty.
|
|
20
|
+
*
|
|
21
|
+
* This overrides the default behavior to just use the description as-is if it already exists.
|
|
22
|
+
*/
|
|
23
|
+
description() {
|
|
24
|
+
if (this.command.description) {
|
|
25
|
+
return this.command.description;
|
|
26
|
+
}
|
|
27
|
+
return super.description();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=help.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/lib/help.ts"],"names":[],"mappings":";;AAAA,sCAAiF;AAEjF,MAAqB,IAAK,SAAQ,WAAS;IAA3C;;QACE;;;;mBAA4B,WAAW;WAAC;IAC1C,CAAC;CAAA;AAFD,uBAEC;AAED,MAAM,WAAY,SAAQ,kBAAgB;IACxC;;;;;OAKG;IACgB,WAAW;QAC5B,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;YAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;SACjC;QACD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;IAC7B,CAAC;CACF","sourcesContent":["import { CommandHelp as OclifCommandHelp, Help as OclifHelp } from \"@oclif/core\";\n\nexport default class Help extends OclifHelp {\n override CommandHelpClass = CommandHelp;\n}\n\nclass CommandHelp extends OclifCommandHelp {\n /**\n * By default, oclif tries to format the description so that it fit's within the terminal window. However, if the description is already\n * formatted with `dedent`, then the description gets mangled and the help output is not pretty.\n *\n * This overrides the default behavior to just use the description as-is if it already exists.\n */\n protected override description(): string | undefined {\n if (this.command.description) {\n return this.command.description;\n }\n return super.description();\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sleepUntil = exports.sleep = void 0;
|
|
4
|
+
function sleep(ms = 0) {
|
|
5
|
+
return new Promise((resolve) => (ms == 0 ? setImmediate(resolve) : setTimeout(resolve, ms)));
|
|
6
|
+
}
|
|
7
|
+
exports.sleep = sleep;
|
|
8
|
+
async function sleepUntil(fn, { interval = 0, timeout = process.env["CI"] ? 2500 : 500 } = {}) {
|
|
9
|
+
const start = isFinite(timeout) && Date.now();
|
|
10
|
+
// eslint-disable-next-line no-constant-condition
|
|
11
|
+
while (true) {
|
|
12
|
+
if (fn())
|
|
13
|
+
return;
|
|
14
|
+
await sleep(interval);
|
|
15
|
+
if (start && Date.now() - start > timeout) {
|
|
16
|
+
const error = new Error(`Timed out after ${timeout} milliseconds`);
|
|
17
|
+
Error.captureStackTrace(error, sleepUntil);
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.sleepUntil = sleepUntil;
|
|
23
|
+
//# sourceMappingURL=sleep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../src/lib/sleep.ts"],"names":[],"mappings":";;;AAAA,SAAgB,KAAK,CAAC,EAAE,GAAG,CAAC;IAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAC/F,CAAC;AAFD,sBAEC;AAEM,KAAK,UAAU,UAAU,CAAC,EAAiB,EAAE,EAAE,QAAQ,GAAG,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE;IACjH,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;IAE9C,iDAAiD;IACjD,OAAO,IAAI,EAAE;QACX,IAAI,EAAE,EAAE;YAAE,OAAO;QACjB,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEtB,IAAI,KAAK,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,OAAO,EAAE;YACzC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,mBAAmB,OAAO,eAAe,CAAC,CAAC;YACnE,KAAK,CAAC,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;YAC3C,MAAM,KAAK,CAAC;SACb;KACF;AACH,CAAC;AAdD,gCAcC","sourcesContent":["export function sleep(ms = 0): Promise<void> {\n return new Promise((resolve) => (ms == 0 ? setImmediate(resolve) : setTimeout(resolve, ms)));\n}\n\nexport async function sleepUntil(fn: () => boolean, { interval = 0, timeout = process.env[\"CI\"] ? 2500 : 500 } = {}): Promise<void> {\n const start = isFinite(timeout) && Date.now();\n\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (fn()) return;\n await sleep(interval);\n\n if (start && Date.now() - start > timeout) {\n const error = new Error(`Timed out after ${timeout} milliseconds`);\n Error.captureStackTrace(error, sleepUntil);\n throw error;\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface User {\n email: string;\n name?: string;\n}\n\nexport interface App {\n id: string;\n name: string;\n slug: string;\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gadgetinc/ggt",
|
|
3
|
+
"version": "0.0.0-alpha.0",
|
|
4
|
+
"description": "The command-line interface for Gadget",
|
|
5
|
+
"homepage": "https://github.com/gadget-inc/ggt",
|
|
6
|
+
"bugs": "https://github.com/gadget-inc/ggt/issues",
|
|
7
|
+
"repository": "gadget-inc/ggt",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"author": "Gadget Authors",
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"bin": {
|
|
12
|
+
"ggt": "./bin/run"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"/assets",
|
|
16
|
+
"/bin",
|
|
17
|
+
"/dist",
|
|
18
|
+
"/npm-shrinkwrap.json",
|
|
19
|
+
"/oclif.manifest.json"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "shx rm -rf dist && tsc -b && oclif readme && prettier --write README.md",
|
|
23
|
+
"postinstall": "patch-package",
|
|
24
|
+
"lint": "npm run lint:prettier && npm run lint:eslint && npm run lint:cspell",
|
|
25
|
+
"lint:cspell": "cspell --no-progress --show-suggestions --show-context '**'",
|
|
26
|
+
"lint:eslint": "eslint --quiet .",
|
|
27
|
+
"lint:eslint:fix": "eslint --quiet --fix .",
|
|
28
|
+
"lint:fix": "npm run lint:prettier:fix && npm run lint:eslint:fix",
|
|
29
|
+
"lint:prettier": "prettier --check .",
|
|
30
|
+
"lint:prettier:fix": "prettier --check --write .",
|
|
31
|
+
"test": "jest",
|
|
32
|
+
"typecheck": "tsc --noEmit"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@oclif/core": "^1.13.3",
|
|
36
|
+
"@oclif/errors": "^1.3.5",
|
|
37
|
+
"chokidar": "^3.5.3",
|
|
38
|
+
"clean-stack": "^3.0.1",
|
|
39
|
+
"debug": "^4.3.4",
|
|
40
|
+
"fs-extra": "^10.1.0",
|
|
41
|
+
"get-port": "^5.1.1",
|
|
42
|
+
"got": "^11.8.5",
|
|
43
|
+
"graphql": "^16.5.0",
|
|
44
|
+
"graphql-ws": "^5.9.1",
|
|
45
|
+
"ignore": "^5.2.0",
|
|
46
|
+
"inquirer": "^8.2.4",
|
|
47
|
+
"lodash": "^4.17.21",
|
|
48
|
+
"new-github-issue-url": "^0.2.1",
|
|
49
|
+
"node-notifier": "^10.0.1",
|
|
50
|
+
"normalize-path": "^3.0.0",
|
|
51
|
+
"open": "^8.4.0",
|
|
52
|
+
"p-map": "^4.0.0",
|
|
53
|
+
"p-queue": "^6.6.2",
|
|
54
|
+
"patch-package": "^6.4.7",
|
|
55
|
+
"serialize-error": "^8.1.0",
|
|
56
|
+
"ts-dedent": "^2.2.0",
|
|
57
|
+
"ws": "^8.8.1"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@gadgetinc/prettier-config": "*",
|
|
61
|
+
"@oclif/plugin-plugins": "^2.1.0",
|
|
62
|
+
"@oclif/test": "^2.1.0",
|
|
63
|
+
"@swc/core": "^1.2.223",
|
|
64
|
+
"@swc/helpers": "^0.4.3",
|
|
65
|
+
"@swc/jest": "^0.2.22",
|
|
66
|
+
"@types/debug": "^4.1.7",
|
|
67
|
+
"@types/fs-extra": "^9.0.13",
|
|
68
|
+
"@types/inquirer": "^8.2.1",
|
|
69
|
+
"@types/jest": "^28.1.6",
|
|
70
|
+
"@types/lodash": "^4.14.182",
|
|
71
|
+
"@types/node": "^18.6.3",
|
|
72
|
+
"@types/node-notifier": "^8.0.2",
|
|
73
|
+
"@types/normalize-path": "^3.0.0",
|
|
74
|
+
"@types/ws": "^8.5.3",
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
|
76
|
+
"@typescript-eslint/parser": "^5.32.0",
|
|
77
|
+
"cspell": "^6.6.0",
|
|
78
|
+
"eslint": "^8.21.0",
|
|
79
|
+
"eslint-config-prettier": "^8.5.0",
|
|
80
|
+
"eslint-plugin-import": "^2.26.0",
|
|
81
|
+
"eslint-plugin-jest": "^26.7.0",
|
|
82
|
+
"eslint-plugin-lodash": "^7.4.0",
|
|
83
|
+
"jest": "^28.1.3",
|
|
84
|
+
"jest-extended": "^3.0.1",
|
|
85
|
+
"nock": "^13.2.9",
|
|
86
|
+
"oclif": "^3.1.2",
|
|
87
|
+
"prettier": "^2.7.1",
|
|
88
|
+
"prettier-plugin-packagejson": "^2.2.18",
|
|
89
|
+
"shx": "^0.3.4",
|
|
90
|
+
"ts-node": "^10.9.1",
|
|
91
|
+
"tslib": "^2.4.0",
|
|
92
|
+
"type-fest": "^2.18.0",
|
|
93
|
+
"typescript": "^4.7.4"
|
|
94
|
+
},
|
|
95
|
+
"engines": {
|
|
96
|
+
"node": ">=16.0.0"
|
|
97
|
+
},
|
|
98
|
+
"oclif": {
|
|
99
|
+
"bin": "ggt",
|
|
100
|
+
"dirname": "ggt",
|
|
101
|
+
"commands": "./dist/commands",
|
|
102
|
+
"plugins": [],
|
|
103
|
+
"helpClass": "./dist/lib/help",
|
|
104
|
+
"topicSeparator": " ",
|
|
105
|
+
"topics": {}
|
|
106
|
+
}
|
|
107
|
+
}
|