Skip to content

Commit bb9c5f5

Browse files
committed
ggt debugger
1 parent 604554e commit bb9c5f5

File tree

14 files changed

+1556
-7
lines changed

14 files changed

+1556
-7
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup Node.js
1818
uses: actions/setup-node@v4
1919
with:
20-
node-version: 18
20+
node-version: 20
2121
cache: pnpm
2222

2323
- name: Install dependencies
@@ -38,7 +38,7 @@ jobs:
3838
- name: Setup Node.js
3939
uses: actions/setup-node@v4
4040
with:
41-
node-version: 18
41+
node-version: 20
4242
cache: pnpm
4343

4444
- name: Install dependencies
@@ -59,6 +59,7 @@ jobs:
5959
strategy:
6060
matrix:
6161
os: [ubuntu-latest, macos-latest, windows-latest]
62+
node: [20]
6263
runs-on: ${{ matrix.os }}
6364
steps:
6465
- name: Checkout repository
@@ -70,7 +71,7 @@ jobs:
7071
- name: Setup Node.js
7172
uses: actions/setup-node@v4
7273
with:
73-
node-version: 18
74+
node-version: ${{ matrix.node }}
7475
cache: pnpm
7576

7677
- name: Install dependencies

nix/flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
mkcert = pkgs.mkcert;
2020
nix-direnv = pkgs.nix-direnv;
2121
nixpkgs-fmt = pkgs.nixpkgs-fmt;
22-
nodejs = pkgs.nodejs-18_x;
22+
nodejs = pkgs.nodejs_20;
2323
yarn = pkgs.yarn.override { nodejs = flake.packages.nodejs; };
2424

2525
ggt = pkgs.writeShellScriptBin "ggt" ''

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"@types/pluralize": "^0.0.33",
6363
"@types/semver": "^7.5.8",
6464
"@types/set-cookie-parser": "^2.4.10",
65+
"@types/tcp-port-used": "^1.0.0",
6566
"@types/which": "^3.0.4",
6667
"@types/ws": "^8.5.14",
6768
"@typescript-eslint/eslint-plugin": "^8.11.0",
@@ -127,6 +128,7 @@
127128
"stdin-discarder": "^0.2.2",
128129
"string-width": "^7.2.0",
129130
"strip-ansi": "^7.1.0",
131+
"tcp-port-used": "^1.0.2",
130132
"terminal-link": "^4.0.0",
131133
"ts-dedent": "^2.2.0",
132134
"ts-node": "^10.9.2",
@@ -140,6 +142,6 @@
140142
},
141143
"packageManager": "[email protected]",
142144
"engines": {
143-
"node": ">=18.0.0"
145+
"node": ">=20.0.0"
144146
}
145147
}

pnpm-lock.yaml

Lines changed: 53 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/__support__/app.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,25 @@ export const testApp: Application = Object.freeze({
1717
id: 1n,
1818
name: "development",
1919
type: EnvironmentType.Development,
20+
nodeVersion: "22.15.0",
2021
},
2122
{
2223
id: 2n,
2324
name: "production",
2425
type: EnvironmentType.Production,
26+
nodeVersion: "22.15.0",
2527
},
2628
{
2729
id: 3n,
2830
name: "cool-environment-development",
2931
type: EnvironmentType.Development,
32+
nodeVersion: "22.15.0",
3033
},
3134
{
3235
id: 4n,
3336
name: "other-environment-development",
3437
type: EnvironmentType.Development,
38+
nodeVersion: "22.15.0",
3539
},
3640
],
3741
team: {

spec/__support__/context.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ export let testCtx: Context;
1111
*/
1212
export const mockContext = (): void => {
1313
beforeEach(() => {
14-
testCtx = Context.init({ name: "test" });
14+
const ctx = Context.init({ name: "test" });
15+
testCtx = ctx;
1516
return () => {
16-
testCtx.abort();
17+
ctx.abort();
1718
};
1819
});
1920
};

spec/commands/__snapshots__/root.spec.ts.snap

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,72 @@ Usage
112112
"
113113
`;
114114
115+
exports[`root > when debugger is given > prints the usage when --help is passed 1`] = `
116+
"Start a Chrome DevTools Protocol proxy server that connects to the Gadget debugger.
117+
This allows you to debug your Gadget app using VS Code, Chrome DevTools, or any other
118+
CDP-compatible debugger client.
119+
120+
Usage
121+
$ ggt debugger [DIRECTORY] [options]
122+
123+
DIRECTORY: The directory containing your Gadget app (default: current directory)
124+
125+
Options
126+
-a, --app <app_name> Selects the app to connect to. Default set on ".gadget/sync.json"
127+
-e, --env <env_name> Selects the environment to debug. Default set on ".gadget/sync.json"
128+
-p, --port <port> Local port for the inspector proxy (default: 9229)
129+
--configure <editor> Configure debugger for vscode, cursor
130+
--allow-unknown-directory Allow debugging in any directory
131+
--allow-different-app Allow debugging with a different app
132+
133+
Examples
134+
start debugger proxy for current environment
135+
$ ggt debugger
136+
137+
use a custom port
138+
$ ggt debugger --port 9230
139+
140+
debug a specific app and environment
141+
$ ggt debugger --app myApp --env development
142+
143+
configure VS Code debugger
144+
$ ggt debugger --configure vscode
145+
"
146+
`;
147+
148+
exports[`root > when debugger is given > prints the usage when -h is passed 1`] = `
149+
"Start a Chrome DevTools Protocol proxy server that connects to the Gadget debugger.
150+
This allows you to debug your Gadget app using VS Code, Chrome DevTools, or any other
151+
CDP-compatible debugger client.
152+
153+
Usage
154+
$ ggt debugger [DIRECTORY] [options]
155+
156+
DIRECTORY: The directory containing your Gadget app (default: current directory)
157+
158+
Options
159+
-a, --app <app_name> Selects the app to connect to. Default set on ".gadget/sync.json"
160+
-e, --env <env_name> Selects the environment to debug. Default set on ".gadget/sync.json"
161+
-p, --port <port> Local port for the inspector proxy (default: 9229)
162+
--configure <editor> Configure debugger for vscode, cursor
163+
--allow-unknown-directory Allow debugging in any directory
164+
--allow-different-app Allow debugging with a different app
165+
166+
Examples
167+
start debugger proxy for current environment
168+
$ ggt debugger
169+
170+
use a custom port
171+
$ ggt debugger --port 9230
172+
173+
debug a specific app and environment
174+
$ ggt debugger --app myApp --env development
175+
176+
configure VS Code debugger
177+
$ ggt debugger --configure vscode
178+
"
179+
`;
180+
115181
exports[`root > when deploy is given > prints the usage when --help is passed 1`] = `
116182
"Deploys your app to production.
117183

0 commit comments

Comments
 (0)