@oh-gc/cli 0.3.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.
Files changed (76) hide show
  1. package/README.md +186 -0
  2. package/bin/dev.js +19 -0
  3. package/bin/run.js +12 -0
  4. package/dist/api/client.d.ts +9 -0
  5. package/dist/api/client.js +57 -0
  6. package/dist/api/client.js.map +1 -0
  7. package/dist/api/issues.d.ts +60 -0
  8. package/dist/api/issues.js +30 -0
  9. package/dist/api/issues.js.map +1 -0
  10. package/dist/api/prs.d.ts +62 -0
  11. package/dist/api/prs.js +25 -0
  12. package/dist/api/prs.js.map +1 -0
  13. package/dist/api/releases.d.ts +33 -0
  14. package/dist/api/releases.js +41 -0
  15. package/dist/api/releases.js.map +1 -0
  16. package/dist/api/user.d.ts +8 -0
  17. package/dist/api/user.js +8 -0
  18. package/dist/api/user.js.map +1 -0
  19. package/dist/base-command.d.ts +6 -0
  20. package/dist/base-command.js +14 -0
  21. package/dist/base-command.js.map +1 -0
  22. package/dist/commands/auth/login.d.ts +9 -0
  23. package/dist/commands/auth/login.js +77 -0
  24. package/dist/commands/auth/login.js.map +1 -0
  25. package/dist/commands/auth/logout.d.ts +9 -0
  26. package/dist/commands/auth/logout.js +19 -0
  27. package/dist/commands/auth/logout.js.map +1 -0
  28. package/dist/commands/auth/status.d.ts +9 -0
  29. package/dist/commands/auth/status.js +37 -0
  30. package/dist/commands/auth/status.js.map +1 -0
  31. package/dist/commands/issue/comment.d.ts +13 -0
  32. package/dist/commands/issue/comment.js +99 -0
  33. package/dist/commands/issue/comment.js.map +1 -0
  34. package/dist/commands/issue/create.d.ts +13 -0
  35. package/dist/commands/issue/create.js +106 -0
  36. package/dist/commands/issue/create.js.map +1 -0
  37. package/dist/commands/issue/list.d.ts +13 -0
  38. package/dist/commands/issue/list.js +68 -0
  39. package/dist/commands/issue/list.js.map +1 -0
  40. package/dist/commands/issue/view.d.ts +12 -0
  41. package/dist/commands/issue/view.js +64 -0
  42. package/dist/commands/issue/view.js.map +1 -0
  43. package/dist/commands/pr/create.d.ts +14 -0
  44. package/dist/commands/pr/create.js +120 -0
  45. package/dist/commands/pr/create.js.map +1 -0
  46. package/dist/commands/pr/list.d.ts +14 -0
  47. package/dist/commands/pr/list.js +71 -0
  48. package/dist/commands/pr/list.js.map +1 -0
  49. package/dist/commands/pr/merge.d.ts +16 -0
  50. package/dist/commands/pr/merge.js +59 -0
  51. package/dist/commands/pr/merge.js.map +1 -0
  52. package/dist/commands/pr/view.d.ts +15 -0
  53. package/dist/commands/pr/view.js +57 -0
  54. package/dist/commands/pr/view.js.map +1 -0
  55. package/dist/commands/release/create.d.ts +16 -0
  56. package/dist/commands/release/create.js +194 -0
  57. package/dist/commands/release/create.js.map +1 -0
  58. package/dist/commands/repo/get-remote.d.ts +9 -0
  59. package/dist/commands/repo/get-remote.js +22 -0
  60. package/dist/commands/repo/get-remote.js.map +1 -0
  61. package/dist/commands/repo/set-remote.d.ts +12 -0
  62. package/dist/commands/repo/set-remote.js +20 -0
  63. package/dist/commands/repo/set-remote.js.map +1 -0
  64. package/dist/config/index.d.ts +3 -0
  65. package/dist/config/index.js +41 -0
  66. package/dist/config/index.js.map +1 -0
  67. package/dist/git/index.d.ts +11 -0
  68. package/dist/git/index.js +51 -0
  69. package/dist/git/index.js.map +1 -0
  70. package/dist/index.d.ts +7 -0
  71. package/dist/index.js +36 -0
  72. package/dist/index.js.map +1 -0
  73. package/dist/ui/index.d.ts +6 -0
  74. package/dist/ui/index.js +38 -0
  75. package/dist/ui/index.js.map +1 -0
  76. package/package.json +71 -0
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ export default class RepoSetRemote extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ remote: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../base-command");
5
+ const index_1 = require("../../git/index");
6
+ class RepoSetRemote extends base_command_1.BaseCommand {
7
+ async run() {
8
+ const { args } = await this.parse(RepoSetRemote);
9
+ (0, index_1.setConfiguredRemote)(args.remote);
10
+ this.log(`Remote set to "${args.remote}" in .gitcode`);
11
+ }
12
+ }
13
+ RepoSetRemote.description = 'Set which git remote gc uses for this repository';
14
+ RepoSetRemote.examples = ['<%= config.bin %> repo set-remote upstream'];
15
+ RepoSetRemote.args = {
16
+ remote: core_1.Args.string({ description: 'Git remote name', required: true }),
17
+ };
18
+ RepoSetRemote.flags = { ...base_command_1.BaseCommand.baseFlags };
19
+ exports.default = RepoSetRemote;
20
+ //# sourceMappingURL=set-remote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-remote.js","sourceRoot":"","sources":["../../../src/commands/repo/set-remote.ts"],"names":[],"mappings":";;AAAA,sCAAkC;AAClC,qDAAgD;AAChD,2CAAqD;AAErD,MAAqB,aAAc,SAAQ,0BAAW;IAQpD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QAChD,IAAA,2BAAmB,EAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAChC,IAAI,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,MAAM,eAAe,CAAC,CAAA;IACxD,CAAC;;AAXM,yBAAW,GAAG,kDAAkD,CAAA;AAChE,sBAAQ,GAAG,CAAC,4CAA4C,CAAC,CAAA;AACzD,kBAAI,GAAG;IACZ,MAAM,EAAE,WAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;CACxE,CAAA;AACM,mBAAK,GAAG,EAAE,GAAG,0BAAW,CAAC,SAAS,EAAE,CAAA;kBANxB,aAAa"}
@@ -0,0 +1,3 @@
1
+ export declare function getToken(): string | null;
2
+ export declare function setToken(token: string): void;
3
+ export declare function clearToken(): void;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getToken = getToken;
4
+ exports.setToken = setToken;
5
+ exports.clearToken = clearToken;
6
+ const node_fs_1 = require("node:fs");
7
+ const node_os_1 = require("node:os");
8
+ const node_path_1 = require("node:path");
9
+ function configDir() {
10
+ return (0, node_path_1.join)((0, node_os_1.homedir)(), '.config', 'gitcode-cli');
11
+ }
12
+ function configFile() {
13
+ return (0, node_path_1.join)(configDir(), 'config.json');
14
+ }
15
+ function readConfig() {
16
+ const file = configFile();
17
+ if (!(0, node_fs_1.existsSync)(file))
18
+ return {};
19
+ try {
20
+ return JSON.parse((0, node_fs_1.readFileSync)(file, 'utf8'));
21
+ }
22
+ catch {
23
+ return {};
24
+ }
25
+ }
26
+ function writeConfig(config) {
27
+ (0, node_fs_1.mkdirSync)(configDir(), { recursive: true });
28
+ (0, node_fs_1.writeFileSync)(configFile(), JSON.stringify(config, null, 2));
29
+ }
30
+ function getToken() {
31
+ return readConfig().token ?? null;
32
+ }
33
+ function setToken(token) {
34
+ writeConfig({ ...readConfig(), token });
35
+ }
36
+ function clearToken() {
37
+ const config = readConfig();
38
+ delete config.token;
39
+ writeConfig(config);
40
+ }
41
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";;AA+BA,4BAEC;AAED,4BAEC;AAED,gCAIC;AA3CD,qCAA4E;AAC5E,qCAAiC;AACjC,yCAAgC;AAEhC,SAAS,SAAS;IAChB,OAAO,IAAA,gBAAI,EAAC,IAAA,iBAAO,GAAE,EAAE,SAAS,EAAE,aAAa,CAAC,CAAA;AAClD,CAAC;AAED,SAAS,UAAU;IACjB,OAAO,IAAA,gBAAI,EAAC,SAAS,EAAE,EAAE,aAAa,CAAC,CAAA;AACzC,CAAC;AAMD,SAAS,UAAU;IACjB,MAAM,IAAI,GAAG,UAAU,EAAE,CAAA;IACzB,IAAI,CAAC,IAAA,oBAAU,EAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAA;IAChC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAW,CAAA;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,MAAc;IACjC,IAAA,mBAAS,EAAC,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAC3C,IAAA,uBAAa,EAAC,UAAU,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;AAC9D,CAAC;AAED,SAAgB,QAAQ;IACtB,OAAO,UAAU,EAAE,CAAC,KAAK,IAAI,IAAI,CAAA;AACnC,CAAC;AAED,SAAgB,QAAQ,CAAC,KAAa;IACpC,WAAW,CAAC,EAAE,GAAG,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;AACzC,CAAC;AAED,SAAgB,UAAU;IACxB,MAAM,MAAM,GAAG,UAAU,EAAE,CAAA;IAC3B,OAAO,MAAM,CAAC,KAAK,CAAA;IACnB,WAAW,CAAC,MAAM,CAAC,CAAA;AACrB,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare function getConfiguredRemote(): string;
2
+ export declare function setConfiguredRemote(remote: string): void;
3
+ export declare function getRemoteUrl(remote: string): string;
4
+ export declare function parseOwnerRepo(url: string): {
5
+ owner: string;
6
+ repo: string;
7
+ };
8
+ export declare function resolveRepo(): {
9
+ owner: string;
10
+ repo: string;
11
+ };
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getConfiguredRemote = getConfiguredRemote;
4
+ exports.setConfiguredRemote = setConfiguredRemote;
5
+ exports.getRemoteUrl = getRemoteUrl;
6
+ exports.parseOwnerRepo = parseOwnerRepo;
7
+ exports.resolveRepo = resolveRepo;
8
+ const node_child_process_1 = require("node:child_process");
9
+ const node_fs_1 = require("node:fs");
10
+ const GITCODE_FILE = '.gitcode';
11
+ function getConfiguredRemote() {
12
+ if ((0, node_fs_1.existsSync)(GITCODE_FILE)) {
13
+ try {
14
+ const data = JSON.parse((0, node_fs_1.readFileSync)(GITCODE_FILE, 'utf8'));
15
+ if (data.remote)
16
+ return data.remote;
17
+ }
18
+ catch {
19
+ // fall through to default
20
+ }
21
+ }
22
+ return 'origin';
23
+ }
24
+ function setConfiguredRemote(remote) {
25
+ const existing = (0, node_fs_1.existsSync)(GITCODE_FILE)
26
+ ? JSON.parse((0, node_fs_1.readFileSync)(GITCODE_FILE, 'utf8'))
27
+ : {};
28
+ existing.remote = remote;
29
+ (0, node_fs_1.writeFileSync)(GITCODE_FILE, JSON.stringify(existing, null, 2));
30
+ }
31
+ function getRemoteUrl(remote) {
32
+ try {
33
+ return (0, node_child_process_1.execSync)(`git remote get-url ${remote}`, { encoding: 'utf8' }).trim();
34
+ }
35
+ catch {
36
+ throw new Error(`Remote "${remote}" not found. Are you in a git repository?`);
37
+ }
38
+ }
39
+ function parseOwnerRepo(url) {
40
+ const match = url.match(/gitcode\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?$/);
41
+ if (!match) {
42
+ throw new Error(`Remote URL does not appear to be a GitCode repository: ${url}`);
43
+ }
44
+ return { owner: match[1], repo: match[2] };
45
+ }
46
+ function resolveRepo() {
47
+ const remote = getConfiguredRemote();
48
+ const url = getRemoteUrl(remote);
49
+ return parseOwnerRepo(url);
50
+ }
51
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRo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IACxC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAA;IACvE,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,0DAA0D,GAAG,EAAE,CAAC,CAAA;IAClF,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;AAC5C,CAAC;AAED,SAAgB,WAAW;IACzB,MAAM,MAAM,GAAG,mBAAmB,EAAE,CAAA;IACpC,MAAM,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC,CAAA;IAChC,OAAO,cAAc,CAAC,GAAG,CAAC,CAAA;AAC5B,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { apiRequest, GitCodeError } from './api/client';
2
+ export * from './api/issues';
3
+ export * from './api/prs';
4
+ export * from './api/releases';
5
+ export * from './api/user';
6
+ export { getToken, setToken, clearToken } from './config';
7
+ export { printTable, printJson, formatDate } from './ui';
package/dist/index.js ADDED
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.formatDate = exports.printJson = exports.printTable = exports.clearToken = exports.setToken = exports.getToken = exports.GitCodeError = exports.apiRequest = void 0;
18
+ // API exports for library usage
19
+ var client_1 = require("./api/client");
20
+ Object.defineProperty(exports, "apiRequest", { enumerable: true, get: function () { return client_1.apiRequest; } });
21
+ Object.defineProperty(exports, "GitCodeError", { enumerable: true, get: function () { return client_1.GitCodeError; } });
22
+ __exportStar(require("./api/issues"), exports);
23
+ __exportStar(require("./api/prs"), exports);
24
+ __exportStar(require("./api/releases"), exports);
25
+ __exportStar(require("./api/user"), exports);
26
+ // Config exports
27
+ var config_1 = require("./config");
28
+ Object.defineProperty(exports, "getToken", { enumerable: true, get: function () { return config_1.getToken; } });
29
+ Object.defineProperty(exports, "setToken", { enumerable: true, get: function () { return config_1.setToken; } });
30
+ Object.defineProperty(exports, "clearToken", { enumerable: true, get: function () { return config_1.clearToken; } });
31
+ // UI exports
32
+ var ui_1 = require("./ui");
33
+ Object.defineProperty(exports, "printTable", { enumerable: true, get: function () { return ui_1.printTable; } });
34
+ Object.defineProperty(exports, "printJson", { enumerable: true, get: function () { return ui_1.printJson; } });
35
+ Object.defineProperty(exports, "formatDate", { enumerable: true, get: function () { return ui_1.formatDate; } });
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gCAAgC;AAChC,uCAAuD;AAA9C,oGAAA,UAAU,OAAA;AAAE,sGAAA,YAAY,OAAA;AACjC,+CAA4B;AAC5B,4CAAyB;AACzB,iDAA8B;AAC9B,6CAA0B;AAE1B,iBAAiB;AACjB,mCAAyD;AAAhD,kGAAA,QAAQ,OAAA;AAAE,kGAAA,QAAQ,OAAA;AAAE,oGAAA,UAAU,OAAA;AAEvC,aAAa;AACb,2BAAwD;AAA/C,gGAAA,UAAU,OAAA;AAAE,+FAAA,SAAS,OAAA;AAAE,gGAAA,UAAU,OAAA"}
@@ -0,0 +1,6 @@
1
+ export interface TableRow {
2
+ [key: string]: string | number | null | undefined;
3
+ }
4
+ export declare function printJson(data: unknown): void;
5
+ export declare function printTable(rows: TableRow[], columns: string[]): void;
6
+ export declare function formatDate(iso: string): string;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.printJson = printJson;
4
+ exports.printTable = printTable;
5
+ exports.formatDate = formatDate;
6
+ function printJson(data) {
7
+ process.stdout.write(JSON.stringify(data, null, 2) + '\n');
8
+ }
9
+ function printTable(rows, columns) {
10
+ if (rows.length === 0) {
11
+ process.stdout.write('No results found.\n');
12
+ return;
13
+ }
14
+ const widths = columns.map((col) => {
15
+ const maxData = Math.max(...rows.map((r) => String(r[col] ?? '-').length));
16
+ return Math.max(col.length, maxData);
17
+ });
18
+ for (const row of rows) {
19
+ const line = columns
20
+ .map((col, i) => String(row[col] ?? '-').padEnd(widths[i]))
21
+ .join(' ');
22
+ process.stdout.write(line.trimEnd() + '\n');
23
+ }
24
+ }
25
+ function formatDate(iso) {
26
+ const diffMs = Date.now() - new Date(iso).getTime();
27
+ const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
28
+ if (diffDays === 0)
29
+ return 'today';
30
+ if (diffDays === 1)
31
+ return '1 day ago';
32
+ if (diffDays < 30)
33
+ return `${diffDays} days ago`;
34
+ if (diffDays < 365)
35
+ return `${Math.floor(diffDays / 30)} months ago`;
36
+ return `${Math.floor(diffDays / 365)} years ago`;
37
+ }
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":";;AAIA,8BAEC;AAED,gCAiBC;AAED,gCAQC;AA/BD,SAAgB,SAAS,CAAC,IAAa;IACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;AAC5D,CAAC;AAED,SAAgB,UAAU,CAAC,IAAgB,EA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,CAAA;IAClC,IAAI,QAAQ,KAAK,CAAC;QAAE,OAAO,WAAW,CAAA;IACtC,IAAI,QAAQ,GAAG,EAAE;QAAE,OAAO,GAAG,QAAQ,WAAW,CAAA;IAChD,IAAI,QAAQ,GAAG,GAAG;QAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC,aAAa,CAAA;IACpE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,YAAY,CAAA;AAClD,CAAC"}
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@oh-gc/cli",
3
+ "version": "0.3.0",
4
+ "description": "GitCode CLI — manage issues and PRs from the terminal",
5
+ "license": "MIT",
6
+ "author": "guozejun",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://gitcode.com/guozejun/ohos_gitcode_cli.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://gitcode.com/guozejun/ohos_gitcode_cli/issues"
13
+ },
14
+ "homepage": "https://gitcode.com/guozejun/ohos_gitcode_cli",
15
+ "keywords": [
16
+ "gitcode",
17
+ "cli",
18
+ "git",
19
+ "issue",
20
+ "pr",
21
+ "pull-request"
22
+ ],
23
+ "engines": {
24
+ "node": ">=18"
25
+ },
26
+ "main": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "bin": {
29
+ "oh-gc": "./bin/run.js"
30
+ },
31
+ "files": [
32
+ "bin/",
33
+ "dist/",
34
+ "!dist/**/*.test.*",
35
+ "README.md",
36
+ "LICENSE"
37
+ ],
38
+ "oclif": {
39
+ "bin": "oh-gc",
40
+ "dirname": "oh-gc",
41
+ "commands": "./dist/commands",
42
+ "plugins": []
43
+ },
44
+ "scripts": {
45
+ "build": "tsc --project tsconfig.json",
46
+ "dev": "node bin/dev.js",
47
+ "test": "jest",
48
+ "typecheck": "tsc --noEmit",
49
+ "pack:linux": "esbuild bin/run.js --bundle --platform=node --target=node18 --outfile=dist-bin/oh-gc --minify && chmod +x dist-bin/oh-gc && tar -czf dist-bin/oh-gc-linux-x64.tar.gz -C dist-bin oh-gc",
50
+ "pack:win": "cp dist-bin/oh-gc dist-bin/oh-gc.cmd && cd dist-bin && zip oh-gc-win-x64.zip oh-gc.cmd",
51
+ "pack": "npm run pack:linux && npm run pack:win",
52
+ "release": "node bin/run.js release:create",
53
+ "prepublishOnly": "npm run build && npm test",
54
+ "publish:npm": "npm publish --access public"
55
+ },
56
+ "dependencies": {
57
+ "@oclif/core": "^3",
58
+ "undici": "^6.24.1"
59
+ },
60
+ "devDependencies": {
61
+ "@types/jest": "^29",
62
+ "@types/node": "^20",
63
+ "@yao-pkg/pkg": "^6.13.1",
64
+ "esbuild": "^0.27.4",
65
+ "jest": "^29",
66
+ "jest-fetch-mock": "^3",
67
+ "ts-jest": "^29",
68
+ "ts-node": "^10",
69
+ "typescript": "^5"
70
+ }
71
+ }