Skip to content

Commit

Permalink
build: upgrade to typescript 5.x + most recent svelte 3.x + other rel…
Browse files Browse the repository at this point in the history
…ated packages (#346)

Fixes #345
  • Loading branch information
chrispcampbell authored Sep 1, 2023
1 parent d9419ab commit 3fd5339
Show file tree
Hide file tree
Showing 26 changed files with 703 additions and 396 deletions.
8 changes: 4 additions & 4 deletions examples/sample-check-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"clean": "rm -rf public",
"lint:ts": "eslint src --max-warnings 0",
"lint:svelte": "svelte-check --fail-on-hints --fail-on-warnings --output human",
"lint:svelte": "svelte-check --fail-on-warnings --output human --compiler-warnings \"a11y-click-events-have-key-events:ignore,a11y-no-noninteractive-tabindex:ignore\"",
"lint": "run-s lint:ts lint:svelte",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write .",
Expand All @@ -27,9 +27,9 @@
"postcss": "^8.2.14",
"pug": "^3.0.1",
"sass": "^1.34.1",
"svelte": "^3.47.0",
"svelte-check": "^2.7.0",
"svelte-preprocess": "^4.10.6",
"svelte": "^3.59.2",
"svelte-check": "^3.5.1",
"svelte-preprocess": "^5.0.4",
"vite": "^3.1.3"
},
"author": "Climate Interactive",
Expand Down
14 changes: 13 additions & 1 deletion examples/sample-check-app/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import sveltePreprocess from 'svelte-preprocess'

export default {
preprocess: sveltePreprocess({})
preprocess: sveltePreprocess({}),
onwarn: (warning, defaultHandler) => {
// TODO: We should resolve these warnings instead of ignoring them
if (warning.code === 'a11y-click-events-have-key-events') {
return
}
if (warning.code === 'a11y-no-noninteractive-tabindex') {
return
}

// Handle all other warnings normally
defaultHandler(warning)
}
}
2 changes: 1 addition & 1 deletion examples/template-default/packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"target": "es6",
"moduleResolution": "node",
"isolatedModules": true,
"importsNotUsedAsValues": "error",
"verbatimModuleSyntax": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
"test": "run-s test:pkgs test:c-int test:js-int"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"eslint": "^8.14.0",
"eslint-config-prettier": "^8.5.0",
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"eslint": "^8.48.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-svelte3": "^4.0.0",
"glob": "^8.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.6.2",
"tsup": "^6.2.3",
"typedoc": "0.23.28",
"typedoc-plugin-markdown": "3.14.0",
"typescript": "^4.7.3",
"tsup": "^7.2.0",
"typedoc": "0.25.0",
"typedoc-plugin-markdown": "3.16.0",
"typescript": "^5.2.2",
"vitest": "^0.23.4"
},
"pnpm": {
Expand Down
2 changes: 1 addition & 1 deletion packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"devDependencies": {
"@types/cross-spawn": "^6.0.2",
"@types/folder-hash": "^4.0.1",
"@types/node": "^16.11.7"
"@types/node": "^20.5.7"
},
"author": "Climate Interactive",
"license": "MIT",
Expand Down
4 changes: 3 additions & 1 deletion packages/build/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ export default defineConfig({
dts: true,
splitting: false,
sourcemap: true,
clean: true
clean: true,
// Enable shims so that `import.meta.url` is translated to `__dirname` in CJS bundle
shims: true
})
8 changes: 4 additions & 4 deletions packages/check-ui-shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"scripts": {
"clean": "rm -rf dist",
"lint:ts": "eslint src --max-warnings 0",
"lint:svelte": "svelte-check --fail-on-hints --fail-on-warnings --output human",
"lint:svelte": "svelte-check --fail-on-warnings --output human --compiler-warnings \"a11y-click-events-have-key-events:ignore,a11y-no-noninteractive-tabindex:ignore\"",
"lint": "run-s lint:ts lint:svelte",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write .",
Expand Down Expand Up @@ -42,10 +42,10 @@
"postcss": "^8.2.14",
"pug": "^3.0.1",
"sass": "^1.34.1",
"svelte": "^3.47.0",
"svelte": "^3.59.2",
"svelte-awesome": "^3.0.0",
"svelte-check": "^2.7.0",
"svelte-preprocess": "^4.10.6",
"svelte-check": "^3.5.1",
"svelte-preprocess": "^5.0.4",
"vite": "^3.1.3"
},
"devDependenciesComments": {
Expand Down
14 changes: 13 additions & 1 deletion packages/check-ui-shell/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import sveltePreprocess from 'svelte-preprocess'

export default {
preprocess: sveltePreprocess({})
preprocess: sveltePreprocess({}),
onwarn: (warning, defaultHandler) => {
// TODO: We should resolve these warnings instead of ignoring them
if (warning.code === 'a11y-click-events-have-key-events') {
return
}
if (warning.code === 'a11y-no-noninteractive-tabindex') {
return
}

// Handle all other warnings normally
defaultHandler(warning)
}
}
1 change: 1 addition & 0 deletions packages/create/.prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist
CHANGELOG.md
2 changes: 1 addition & 1 deletion packages/create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"devDependencies": {
"@types/degit": "^2.8.3",
"@types/fs-extra": "^9.0.13",
"@types/node": "^16.11.7",
"@types/node": "^20.5.7",
"@types/prompts": "^2.0.14",
"@types/which-pm-runs": "^1.0.0",
"@types/yargs-parser": "^21.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/create/tests/step-directory.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const promptMessages = {
}

function runCreate(args: string[] = []) {
const { stdout, stdin } = execa('../bin/create-sde.js', [...args, '--dryrun'], { cwd: testsDir })
const { stdout, stdin } = execa('../bin/create-sde.js', [...args, '--dry-run'], { cwd: testsDir })
return {
stdin,
stdout
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-check/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
},
"devDependencies": {
"@sdeverywhere/build": "*",
"@types/node": "^16.11.7"
"@types/node": "^20.5.7"
},
"author": "Climate Interactive",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-check/template-bundle/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// Enable warnings for transpilation-unsafe code
"isolatedModules": true,
// Enable strict enforcement of `import type`
"importsNotUsedAsValues": "error",
"verbatimModuleSyntax": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-check/template-report/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// Enable warnings for transpilation-unsafe code
"isolatedModules": true,
// Enable strict enforcement of `import type`
"importsNotUsedAsValues": "error",
"verbatimModuleSyntax": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-check/template-tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// Enable warnings for transpilation-unsafe code
"isolatedModules": true,
// Enable strict enforcement of `import type`
"importsNotUsedAsValues": "error",
"verbatimModuleSyntax": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
Expand Down
4 changes: 3 additions & 1 deletion packages/plugin-check/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ export default defineConfig({
dts: true,
splitting: false,
sourcemap: true,
clean: true
clean: true,
// Enable shims so that `import.meta.url` is translated to `__dirname` in CJS bundle
shims: true
})
2 changes: 1 addition & 1 deletion packages/plugin-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@types/byline": "^4.2.33",
"@types/dedent": "^0.7.0",
"@types/marked": "^4.0.1",
"@types/node": "^16.11.7",
"@types/node": "^20.5.7",
"@types/sanitize-html": "^2.6.2",
"@types/temp": "^0.9.1",
"dedent": "^0.7.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/plugin-config/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ export default defineConfig({
dts: true,
splitting: false,
sourcemap: true,
clean: true
clean: true,
// Enable shims so that `import.meta.url` is translated to `__dirname` in CJS bundle
shims: true
})
2 changes: 1 addition & 1 deletion packages/plugin-wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"devDependencies": {
"@sdeverywhere/build": "*",
"@types/node": "^16.11.7"
"@types/node": "^20.5.7"
},
"author": "Climate Interactive",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
},
"devDependencies": {
"@sdeverywhere/build": "*",
"@types/node": "^16.11.7"
"@types/node": "^20.5.7"
},
"author": "Climate Interactive",
"license": "MIT",
Expand Down
4 changes: 3 additions & 1 deletion packages/plugin-worker/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ export default defineConfig({
dts: true,
splitting: false,
sourcemap: true,
clean: true
clean: true,
// Enable shims so that `import.meta.url` is translated to `__dirname` in CJS bundle
shims: true
})
28 changes: 14 additions & 14 deletions packages/runtime/docs/classes/ModelScheduler.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ The `ModelRunner` is pluggable to allow for running the model synchronously
(on the main JavaScript thread) or asynchronously (in a Web Worker or Node.js
worker thread).

## Constructors

### constructor

**new ModelScheduler**(`runner`, `userInputs`, `outputs`)

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `runner` | [`ModelRunner`](../interfaces/ModelRunner.md) | The model runner. |
| `userInputs` | [`InputValue`](../interfaces/InputValue.md)[] | The input values, in the same order as in the spec file passed to `sde`. |
| `outputs` | [`Outputs`](Outputs.md) | The structure into which the model outputs will be stored. |

## Properties

### onOutputsChanged
Expand All @@ -33,17 +47,3 @@ Called when `outputs` has been updated after a model run.
##### Returns

`void`

## Constructors

### constructor

**new ModelScheduler**(`runner`, `userInputs`, `outputs`)

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `runner` | [`ModelRunner`](../interfaces/ModelRunner.md) | The model runner. |
| `userInputs` | [`InputValue`](../interfaces/InputValue.md)[] | The input values, in the same order as in the spec file passed to `sde`. |
| `outputs` | [`Outputs`](Outputs.md) | The structure into which the model outputs will be stored. |
30 changes: 15 additions & 15 deletions packages/runtime/docs/classes/Outputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@

Represents the outputs from a model run.

## Constructors

### constructor

**new Outputs**(`varIds`, `startTime`, `endTime`, `saveFreq?`)

#### Parameters

| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `varIds` | `string`[] | `undefined` | The output variable identifiers. |
| `startTime` | `number` | `undefined` | The start time for the model. |
| `endTime` | `number` | `undefined` | The end time for the model. |
| `saveFreq` | `number` | `1` | The frequency with which output values are saved (aka `SAVEPER`). |

## Properties

### seriesLength
Expand Down Expand Up @@ -52,21 +67,6 @@ ___

The frequency with which output values are saved (aka `SAVEPER`).

## Constructors

### constructor

**new Outputs**(`varIds`, `startTime`, `endTime`, `saveFreq?`)

#### Parameters

| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `varIds` | `string`[] | `undefined` | The output variable identifiers. |
| `startTime` | `number` | `undefined` | The start time for the model. |
| `endTime` | `number` | `undefined` | The end time for the model. |
| `saveFreq` | `number` | `1` | The frequency with which output values are saved (aka `SAVEPER`). |

## Methods

### updateFromBuffer
Expand Down
24 changes: 12 additions & 12 deletions packages/runtime/docs/classes/WasmModel.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
An interface to the generated WebAssembly model. Allows for running the model with
a given set of input values, producing a set of output values.

## Constructors

### constructor

**new WasmModel**(`wasmModule`)

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `wasmModule` | [`WasmModule`](../interfaces/WasmModule.md) | The `WasmModule` that provides access to the native functions. |

## Properties

### startTime
Expand Down Expand Up @@ -37,18 +49,6 @@ ___

The number of save points for each output.

## Constructors

### constructor

**new WasmModel**(`wasmModule`)

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `wasmModule` | [`WasmModule`](../interfaces/WasmModule.md) | The `WasmModule` that provides access to the native functions. |

## Methods

### runModel
Expand Down
Loading

0 comments on commit 3fd5339

Please sign in to comment.