Skip to content

Commit d70c6e4

Browse files
authored
Merge pull request #2829 from quadratichq/qa
QA Apr 26
2 parents 18378dc + d665479 commit d70c6e4

File tree

291 files changed

+14984
-3679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+14984
-3679
lines changed

.env.docker

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ AWS_S3_ACCESS_KEY_ID=AWS_S3_ACCESS_KEY_ID
109109
AWS_S3_SECRET_ACCESS_KEY=AWS_S3_SECRET_ACCESS_KEY
110110

111111
# gcp
112-
GCP_REGION=us-east5
112+
GCP_REGION=us-central1
113+
GCP_REGION_ANTHROPIC=us-east5
113114
GCP_PROJECT_ID=GCP_PROJECT_ID
114115
GCP_CLIENT_EMAIL=GCP_CLIENT_EMAIL
115116
GCP_PRIVATE_KEY=GCP_PRIVATE_KEY
@@ -127,4 +128,4 @@ ECR_OR_BUILD=build
127128
CLIENT_DEV=false
128129

129130
ECR_URL=public.ecr.aws/z7e3d4w1
130-
IMAGE_TAG=latest
131+
IMAGE_TAG=latest

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@
191191
"jest.rootPath": "quadratic-client",
192192
"typescript.preferences.importModuleSpecifier": "non-relative",
193193
"typescript.preferences.preferTypeOnlyAutoImports": true,
194+
"typescript.preferences.autoImportFileExcludePatterns": [
195+
"**/node_modules/@mui/**",
196+
"**/node_modules/@radix-ui/**"
197+
],
194198
"editor.defaultFormatter": null,
195199
"[rust]": {
196200
"editor.defaultFormatter": "rust-lang.rust-analyzer",

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.7.1
1+
0.8.0

dev/cli.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ export class CLI {
1212
.option("-m, --multiplayer", "Watch the quadratic-multiplayer directory")
1313
.option("-f, --files", "Watch the quadratic-files directory")
1414
.option("-n, --connection", "Watch the quadratic-connection directory")
15+
.option("-s, --shared", "Watch the quadratic-shared directory")
1516
.option("-y, --python", "Watch the quadratic-kernels/python-wasm directory")
1617
.option("-l, --all", "Watch all directories")
17-
.option("-s, --skipTypes", "Skip WASM types compilation")
18+
.option("-t, --skipTypes", "Skip WASM types compilation")
1819
.option("-p, --perf", "Run quadratic-core in perf mode (slower to link but faster runtime)")
1920
.option("-R, --hideReact", "Hide React output")
2021
.option("-A, --hideAPI", "Hide React output")
@@ -25,6 +26,7 @@ export class CLI {
2526
.option("-N, --hideConnection", "Hide Connection output")
2627
.option("-Y, --hidePython", "Hide Python output")
2728
.option("-E, --hideRustClient", "Hide RustClient")
29+
.option("-S, --hideShared", "Hide Shared output")
2830
.option("-L, --servicesLocal", "Set Redis & Postgres as running locally")
2931
.option("-D, --dockerDev", "Run dev in docker")
3032
.option("-d, --dark", "Use dark theme")
@@ -39,6 +41,7 @@ export class CLI {
3941
this.options.files = true;
4042
this.options.connection = true;
4143
this.options.python = true;
44+
this.options.shared = true;
4245
}
4346
}
4447
}

dev/cli.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export class CLI {
99
files: boolean;
1010
connection: boolean;
1111
python: boolean;
12+
shared: boolean;
1213
skipTypes: boolean;
1314
all: boolean;
1415
perf: boolean;
@@ -20,6 +21,7 @@ export class CLI {
2021
hideFiles: boolean;
2122
hideConnection: boolean;
2223
hidePython: boolean;
24+
hideShared: boolean;
2325
servicesLocal: boolean;
2426
dockerDev: boolean;
2527
dark: boolean;
@@ -30,23 +32,24 @@ export class CLI {
3032
program
3133
.name("node dev")
3234
.description(
33-
"Runs the Quadratic dev server. By default, only React runs in watch mode."
35+
"Runs the Quadratic dev server. By default, only React runs in watch mode.",
3436
)
3537
.option("-a, --api", "Watch the quadratic-api directory")
3638
.option("-r, --react", "Do NOT watch quadratic-client (React)")
3739
.option("-c, --core", "Watch the quadratic-core directory")
3840
.option("-m, --multiplayer", "Watch the quadratic-multiplayer directory")
3941
.option("-f, --files", "Watch the quadratic-files directory")
4042
.option("-n, --connection", "Watch the quadratic-connection directory")
43+
.option("-s, --shared", "Watch the quadratic-shared directory")
4144
.option(
4245
"-y, --python",
43-
"Watch the quadratic-kernels/python-wasm directory"
46+
"Watch the quadratic-kernels/python-wasm directory",
4447
)
4548
.option("-l, --all", "Watch all directories")
46-
.option("-s, --skipTypes", "Skip WASM types compilation")
49+
.option("-t, --skipTypes", "Skip WASM types compilation")
4750
.option(
4851
"-p, --perf",
49-
"Run quadratic-core in perf mode (slower to link but faster runtime)"
52+
"Run quadratic-core in perf mode (slower to link but faster runtime)",
5053
)
5154
.option("-R, --hideReact", "Hide React output")
5255
.option("-A, --hideAPI", "Hide React output")
@@ -57,6 +60,7 @@ export class CLI {
5760
.option("-N, --hideConnection", "Hide Connection output")
5861
.option("-Y, --hidePython", "Hide Python output")
5962
.option("-E, --hideRustClient", "Hide RustClient")
63+
.option("-S, --hideShared", "Hide Shared output")
6064
.option("-L, --servicesLocal", "Set Redis & Postgres as running locally")
6165
.option("-D, --dockerDev", "Run dev in docker")
6266
.option("-d, --dark", "Use dark theme")
@@ -72,6 +76,7 @@ export class CLI {
7276
this.options.files = true;
7377
this.options.connection = true;
7478
this.options.python = true;
79+
this.options.shared = true;
7580
}
7681
}
7782
}

dev/constants.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ export const COMPONENTS = {
5353
dark: "gray",
5454
name: "Redis",
5555
},
56+
shared: {
57+
color: "gray",
58+
dark: 'gray',
59+
shortcut: 's',
60+
name: 'Shared',
61+
}
5662
};
5763
export const SPACE = " ";
5864
export const DONE = "✓";

dev/constants.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ export const COMPONENTS = {
5353
dark: "gray",
5454
name: "Redis",
5555
},
56+
shared: {
57+
color: "gray",
58+
dark: 'gray',
59+
shortcut: 's',
60+
name: 'Shared',
61+
}
5662
};
5763

5864
export const SPACE = " ";

dev/control.js

Lines changed: 57 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class Control {
1616
db;
1717
npm;
1818
rust;
19+
shared;
1920
signals = {};
2021
status = {
2122
client: false,
@@ -30,6 +31,7 @@ export class Control {
3031
npm: false,
3132
postgres: false,
3233
redis: false,
34+
shared: false,
3335
};
3436
constructor(cli) {
3537
this.cli = cli;
@@ -48,6 +50,7 @@ export class Control {
4850
this.kill("files"),
4951
this.kill("connection"),
5052
this.kill("python"),
53+
this.kill("shared"),
5154
]);
5255
process.exit(0);
5356
}
@@ -153,7 +156,7 @@ export class Control {
153156
this.status.types = false;
154157
await this.kill("types");
155158
if (!this.cli.options.skipTypes || restart) {
156-
this.types = spawn("npm run compile --workspace=quadratic-shared && npm run build:wasm:types", { shell: true });
159+
this.types = spawn("npm run build:wasm:types", { shell: true });
157160
this.ui.printOutput("types", (data) => {
158161
this.handleResponse("types", data, {
159162
success: "Running ",
@@ -287,11 +290,7 @@ export class Control {
287290
this.signals.multiplayer = new AbortController();
288291
this.ui.print("multiplayer");
289292
this.multiplayer = spawn("cargo", this.cli.options.multiplayer
290-
? [
291-
"watch",
292-
"-x",
293-
"run -p quadratic-multiplayer --target-dir=target",
294-
]
293+
? ["watch", "-x", "run -p quadratic-multiplayer --target-dir=target"]
295294
: ["run", "-p", "quadratic-multiplayer", "--target-dir=target"], {
296295
signal: this.signals.multiplayer.signal,
297296
cwd: "quadratic-multiplayer",
@@ -325,11 +324,7 @@ export class Control {
325324
catch (e) { }
326325
this.signals.files = new AbortController();
327326
this.files = spawn("cargo", this.cli.options.files
328-
? [
329-
"watch",
330-
"-x",
331-
"run -p quadratic-files --target-dir=target",
332-
]
327+
? ["watch", "-x", "run -p quadratic-files --target-dir=target"]
333328
: ["run", "-p", "quadratic-files", "--target-dir=target"], {
334329
signal: this.signals.files.signal,
335330
cwd: "quadratic-files",
@@ -363,6 +358,55 @@ export class Control {
363358
this.status.files = "killed";
364359
}
365360
}
361+
async runShared(restart) {
362+
if (this.quitting)
363+
return;
364+
if (this.status.shared === "killed")
365+
return;
366+
this.status.shared = false;
367+
this.ui.print("shared");
368+
await this.kill("shared");
369+
let firstRun = true;
370+
this.signals.shared = new AbortController();
371+
this.shared = spawn(`npm run ${this.cli.options.shared ? "watch" : "compile"} --workspace=quadratic-shared`, {
372+
signal: this.signals.shared.signal,
373+
shell: true,
374+
});
375+
this.ui.printOutput("shared", (data) => {
376+
this.handleResponse("shared", data, {
377+
success: [" 0 errors.", "successfully"],
378+
error: ["error"],
379+
start: "Starting",
380+
}, () => {
381+
if (firstRun && !restart) {
382+
firstRun = false;
383+
if (this.status.db !== "killed" && !this.db) {
384+
this.runDb();
385+
}
386+
}
387+
});
388+
});
389+
}
390+
async restartShared() {
391+
this.cli.options.shared = !this.cli.options.shared;
392+
if (this.shared) {
393+
this.runShared(true);
394+
}
395+
}
396+
async killShared() {
397+
if (this.status.shared === "killed") {
398+
this.status.shared = false;
399+
this.ui.print("shared", "restarting...");
400+
this.runShared();
401+
}
402+
else {
403+
if (this.shared) {
404+
await this.kill("shared");
405+
this.ui.print("shared", "killed", "red");
406+
}
407+
this.status.shared = "killed";
408+
}
409+
}
366410
async runConnection() {
367411
if (this.quitting)
368412
return;
@@ -379,11 +423,7 @@ export class Control {
379423
catch (e) { }
380424
this.signals.connection = new AbortController();
381425
this.connection = spawn("cargo", this.cli.options.connection
382-
? [
383-
"watch",
384-
"-x",
385-
"run -p quadratic-connection --target-dir=target",
386-
]
426+
? ["watch", "-x", "run -p quadratic-connection --target-dir=target"]
387427
: ["run", "-p", "quadratic-connection", "--target-dir=target"], {
388428
signal: this.signals.connection.signal,
389429
cwd: "quadratic-connection",
@@ -543,7 +583,7 @@ export class Control {
543583
this.ui = ui;
544584
this.checkServices();
545585
this.runRust();
546-
this.runDb();
547586
this.runPython();
587+
this.runShared();
548588
}
549589
}

0 commit comments

Comments
 (0)