Skip to content

Commit a9b4c99

Browse files
hashhash
authored andcommitted
Autonomous tsconfig.json to be compatible with TSGo
1 parent c00e944 commit a9b4c99

6 files changed

Lines changed: 10 additions & 34 deletions

File tree

libs/@hashintel/petrinaut/eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ export default [
77
parserOptions: {
88
projectService: {
99
allowDefaultProject: [
10-
"assets.d.ts",
1110
"panda.config.ts",
1211
"postcss.config.cjs",
1312
"vite.config.ts",
13+
"vite.site.config.ts",
1414
],
1515
},
1616
tsconfigRootDir: import.meta.dirname,

libs/@hashintel/petrinaut/src/playback/provider.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -414,20 +414,13 @@ export const PlaybackProvider: React.FC<PlaybackProviderProps> = ({
414414

415415
const play: PlaybackContextValue["play"] = async () => {
416416
const simState = simulationStateRef.current;
417-
console.log(
418-
"[Petrinaut:Debug] PlaybackProvider.play() called, simState:",
419-
simState,
420-
);
421417
const state = stateValuesRef.current;
422418
const { maxFramesAhead, batchSize } = getPlayModeBackpressure(
423419
state.playMode,
424420
);
425421

426422
// Initialize simulation if not run yet
427423
if (simState === "NotRun") {
428-
console.log(
429-
"[Petrinaut:Debug] PlaybackProvider.play() -> calling initialize (simState was NotRun)",
430-
);
431424
await initialize({
432425
seed: Date.now(),
433426
dt: dtRef.current,
@@ -436,9 +429,6 @@ export const PlaybackProvider: React.FC<PlaybackProviderProps> = ({
436429
});
437430
// Initialization complete - start simulation
438431
// The effect will set playbackState to "Playing" when simulation starts running
439-
console.log(
440-
"[Petrinaut:Debug] PlaybackProvider.play() -> initialization complete, calling runSimulation()",
441-
);
442432
runSimulation();
443433
return;
444434
}

libs/@hashintel/petrinaut/src/simulation/provider.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@ export const SimulationProvider: React.FC<SimulationProviderProps> = ({
101101

102102
// Reinitialize when petriNetId changes
103103
useEffect(() => {
104-
console.log(
105-
"[Petrinaut:Debug] SimulationProvider: petriNetId changed to",
106-
petriNetId,
107-
"- calling reset()",
108-
);
109104
workerActions.reset();
110105
setStateValues(INITIAL_STATE_VALUES);
111106
}, [petriNetId, workerActions]);
@@ -160,9 +155,6 @@ export const SimulationProvider: React.FC<SimulationProviderProps> = ({
160155

161156
// Delegate to worker (maxTime is immutable once set at initialization)
162157
// Returns a promise that resolves when initialization is complete
163-
console.log(
164-
"[Petrinaut:Debug] SimulationProvider.initialize() called, delegating to worker",
165-
);
166158
return workerActions.initialize({
167159
sdcpn,
168160
initialMarking: currentState.initialMarking,

libs/@hashintel/petrinaut/src/simulation/worker/use-simulation-worker.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ export function useSimulationWorker(): {
137137

138138
switch (message.type) {
139139
case "ready":
140-
console.log(
141-
"[Petrinaut:Debug] Worker sent 'ready' message, resolving pending init",
142-
);
143140
setState((prev) => ({
144141
...prev,
145142
status: prev.status === "initializing" ? "ready" : prev.status,
@@ -180,10 +177,6 @@ export function useSimulationWorker(): {
180177
break;
181178

182179
case "error":
183-
console.error(
184-
"[Petrinaut:Debug] Worker sent 'error' message:",
185-
message.message,
186-
);
187180
setState((prev) => ({
188181
...prev,
189182
status: "error",
@@ -211,7 +204,6 @@ export function useSimulationWorker(): {
211204
workerRef.current = worker;
212205

213206
return () => {
214-
console.log("[Petrinaut:Debug] Worker terminated (useEffect cleanup)");
215207
worker.terminate();
216208
};
217209
}, []);
@@ -234,14 +226,10 @@ export function useSimulationWorker(): {
234226
}) => {
235227
// Cancel any pending initialization
236228
if (pendingInitRef.current) {
237-
console.warn(
238-
"[Petrinaut:Debug] Cancelling pending initialization - new initialize() called before previous resolved",
239-
);
240229
pendingInitRef.current.reject(new Error("Initialization cancelled"));
241230
pendingInitRef.current = null;
242231
}
243232

244-
console.log("[Petrinaut:Debug] useSimulationWorker.initialize() called");
245233
setState({
246234
status: "initializing",
247235
frames: [],
@@ -299,7 +287,6 @@ export function useSimulationWorker(): {
299287
};
300288

301289
const reset: WorkerActions["reset"] = () => {
302-
console.log("[Petrinaut:Debug] useSimulationWorker.reset() called");
303290
postMessage({ type: "stop" });
304291
setState(initialState);
305292
};

libs/@hashintel/petrinaut/tsconfig.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
{
2-
"extends": "@local/tsconfig/legacy-base-tsconfig-to-refactor.json",
32
"compilerOptions": {
43
"jsx": "react-jsx",
4+
"target": "es2024",
55
"lib": ["dom", "dom.iterable", "ESNext"],
66
"module": "preserve",
77
"moduleResolution": "bundler",
8+
"strict": true,
9+
"esModuleInterop": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"noFallthroughCasesInSwitch": true,
12+
"noUncheckedIndexedAccess": true,
13+
"resolveJsonModule": true,
814
"noEmit": true,
915
"skipLibCheck": true,
1016
"declaration": true,

libs/@hashintel/petrinaut/vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import react from "@vitejs/plugin-react";
2+
// eslint-disable-next-line import/no-extraneous-dependencies
3+
import { replacePlugin } from "rolldown/plugins";
24
import { defineConfig, esmExternalRequirePlugin } from "vite";
35
import dts from "vite-plugin-dts";
4-
import { replacePlugin } from "rolldown/plugins";
56

67
/**
78
* Library build config

0 commit comments

Comments
 (0)