From e3e68a6e80ed2cbf943505941257a4667808a5fa Mon Sep 17 00:00:00 2001 From: Chris Campbell Date: Mon, 19 Aug 2024 11:56:44 -0700 Subject: [PATCH 1/5] build: rename house-game-app `build` script to `bundle` This avoids having the app subpackage being built when using `pnpm build` or `pnpm -r build` --- examples/house-game/packages/app/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/house-game/packages/app/package.json b/examples/house-game/packages/app/package.json index e57625bb..9f02a588 100644 --- a/examples/house-game/packages/app/package.json +++ b/examples/house-game/packages/app/package.json @@ -13,9 +13,9 @@ "precommit": "../../scripts/precommit", "test": "echo No tests yet", "type-check": "tsc --noEmit", - "build": "vite build", + "bundle": "vite build", "dev": "vite", - "ci:build": "run-s clean lint prettier:check type-check build" + "ci:build": "run-s clean lint prettier:check type-check bundle" }, "dependencies": { "@sdeverywhere/runtime": "^0.2.2", From 0846898301827281de0853686d1e7d5668638e0d Mon Sep 17 00:00:00 2001 From: Chris Campbell Date: Mon, 19 Aug 2024 12:15:02 -0700 Subject: [PATCH 2/5] build: add clean script for house-game package --- examples/house-game/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/house-game/package.json b/examples/house-game/package.json index 28ffd8d4..96750e9d 100644 --- a/examples/house-game/package.json +++ b/examples/house-game/package.json @@ -4,6 +4,7 @@ "private": true, "type": "module", "scripts": { + "clean": "rm -rf ./sde-prep", "dev": "sde dev", "build": "sde bundle" }, From f458c679ae9dae5410bf85e432565ccb58246e10 Mon Sep 17 00:00:00 2001 From: Chris Campbell Date: Mon, 19 Aug 2024 12:22:49 -0700 Subject: [PATCH 3/5] build: update ci-build script so that it includes all available example packages --- scripts/ci-build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ci-build b/scripts/ci-build index aa974ccf..9fc6c647 100755 --- a/scripts/ci-build +++ b/scripts/ci-build @@ -31,8 +31,8 @@ function run_in_workspaces { --aggregate-output \ --reporter=append-only \ --workspace-concurrency=0 \ - --filter=./packages/** \ - --filter=./examples/sample-* \ + --filter="./packages/*" \ + --filter="./examples/**" \ -r $cmd \ ) 2>&1 From 7d864fc281b91e371e39e140d16cef4167cb1f7d Mon Sep 17 00:00:00 2001 From: Chris Campbell Date: Mon, 19 Aug 2024 12:23:13 -0700 Subject: [PATCH 4/5] build: fix eslint and prettier config files for house-game example --- examples/house-game/packages/app/.eslintignore | 1 + examples/house-game/packages/app/.eslintrc.cjs | 2 +- examples/house-game/packages/app/.prettierignore | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/house-game/packages/app/.eslintignore b/examples/house-game/packages/app/.eslintignore index a48cf0de..e2ba8d19 100644 --- a/examples/house-game/packages/app/.eslintignore +++ b/examples/house-game/packages/app/.eslintignore @@ -1 +1,2 @@ public +src/model/generated diff --git a/examples/house-game/packages/app/.eslintrc.cjs b/examples/house-game/packages/app/.eslintrc.cjs index 6532d5c4..fd6809d2 100644 --- a/examples/house-game/packages/app/.eslintrc.cjs +++ b/examples/house-game/packages/app/.eslintrc.cjs @@ -1,3 +1,3 @@ module.exports = { - extends: ['../../../.eslintrc-svelte-common.cjs'] + extends: ['../../../../.eslintrc-svelte-common.cjs'] } diff --git a/examples/house-game/packages/app/.prettierignore b/examples/house-game/packages/app/.prettierignore index 1f6c1701..1ed1115b 100644 --- a/examples/house-game/packages/app/.prettierignore +++ b/examples/house-game/packages/app/.prettierignore @@ -1,2 +1,3 @@ public +src/model/generated **/*.svelte From 3a0e66f12b9130466fb77d2e26ccc9153eb605bc Mon Sep 17 00:00:00 2001 From: Chris Campbell Date: Mon, 19 Aug 2024 12:24:03 -0700 Subject: [PATCH 5/5] build: fix lint warnings in house-game These were missed earlier due to the incorrect path for the eslint config file. --- examples/house-game/packages/app/src/app-vm.ts | 4 ++-- .../app/src/components/assumptions/assumptions-vm.ts | 2 +- .../house-game/packages/app/src/model/app-model.ts | 11 +++++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/examples/house-game/packages/app/src/app-vm.ts b/examples/house-game/packages/app/src/app-vm.ts index 0906daa6..e3419b55 100644 --- a/examples/house-game/packages/app/src/app-vm.ts +++ b/examples/house-game/packages/app/src/app-vm.ts @@ -1,8 +1,8 @@ import { derived, writable, type Readable, type Writable } from 'svelte/store' -import { AppModel, createAppModel } from './model/app-model' +import { type AppModel, createAppModel } from './model/app-model' -import { AssumptionsViewModel, createAssumptionsViewModel } from './components/assumptions/assumptions-vm' +import { type AssumptionsViewModel, createAssumptionsViewModel } from './components/assumptions/assumptions-vm' import type { GraphViewModel } from './components/graph/graph-vm' export async function createAppViewModel(): Promise { diff --git a/examples/house-game/packages/app/src/components/assumptions/assumptions-vm.ts b/examples/house-game/packages/app/src/components/assumptions/assumptions-vm.ts index 10d6e7fe..6eb70836 100644 --- a/examples/house-game/packages/app/src/components/assumptions/assumptions-vm.ts +++ b/examples/house-game/packages/app/src/components/assumptions/assumptions-vm.ts @@ -1,4 +1,4 @@ -import { ModelInputs } from '../../model/app-state' +import type { ModelInputs } from '../../model/app-state' export interface AssumptionRow { label: string diff --git a/examples/house-game/packages/app/src/model/app-model.ts b/examples/house-game/packages/app/src/model/app-model.ts index 9cece9d2..91975ac6 100644 --- a/examples/house-game/packages/app/src/model/app-model.ts +++ b/examples/house-game/packages/app/src/model/app-model.ts @@ -1,12 +1,15 @@ -import { Readable, Writable, get, writable } from 'svelte/store' +import type { Readable, Writable } from 'svelte/store' +import { get, writable } from 'svelte/store' -import type { ModelRunner, Point } from '@sdeverywhere/runtime' -import { Outputs, createLookupDef } from '@sdeverywhere/runtime' +import type { ModelRunner, Outputs, Point } from '@sdeverywhere/runtime' +import { createLookupDef } from '@sdeverywhere/runtime' import { spawnAsyncModelRunner } from '@sdeverywhere/runtime-async' +import type { AppState } from './app-state' +import { inputValuesForState, stateForIndex } from './app-state' + import modelWorkerJs from './generated/worker.js?raw' -import { AppState, inputValuesForState, stateForIndex } from './app-state' /** * Create an `AppModel` instance.