From 879d9fb44617cb51a9f8309eb22a42ed3d7495bc Mon Sep 17 00:00:00 2001 From: Chris Campbell Date: Mon, 19 Aug 2024 12:32:39 -0700 Subject: [PATCH] build: update ci-build script so that it includes all available example packages (#509) Fixes #508 --- examples/house-game/package.json | 1 + examples/house-game/packages/app/.eslintignore | 1 + examples/house-game/packages/app/.eslintrc.cjs | 2 +- examples/house-game/packages/app/.prettierignore | 1 + examples/house-game/packages/app/package.json | 4 ++-- 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 +++++++---- scripts/ci-build | 4 ++-- 9 files changed, 18 insertions(+), 12 deletions(-) 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" }, 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 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", 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. 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