Skip to content

Commit

Permalink
fix: upgrade to vite 5.x + upgrade related packages (#519)
Browse files Browse the repository at this point in the history
Fixes #518
  • Loading branch information
chrispcampbell authored Aug 23, 2024
1 parent 573ff15 commit b89d013
Show file tree
Hide file tree
Showing 31 changed files with 1,354 additions and 1,027 deletions.
2 changes: 1 addition & 1 deletion examples/hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"@sdeverywhere/cli": "^0.7.23",
"@sdeverywhere/plugin-check": "^0.3.5",
"@sdeverywhere/plugin-worker": "^0.2.3",
"vite": "^4.4.9"
"vite": "^5.4.2"
}
}
16 changes: 8 additions & 8 deletions examples/house-game/packages/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-warnings --output human --compiler-warnings \"a11y-click-events-have-key-events:ignore,a11y-no-noninteractive-tabindex:ignore\"",
"lint:svelte": "svelte-check --fail-on-warnings --output human --compiler-warnings \"a11y-click-events-have-key-events:ignore,a11y-no-noninteractive-tabindex:ignore,a11y-no-static-element-interactions:ignore\"",
"lint": "run-s lint:ts lint:svelte",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write .",
Expand All @@ -23,14 +23,14 @@
"chart.js": "^2.9.4"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.4.5",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@types/chart.js": "^2.9.34",
"postcss": "^8.4.31",
"sass": "^1.34.1",
"svelte": "^3.59.2",
"svelte-check": "^3.5.1",
"svelte-preprocess": "^5.0.4",
"vite": "^4.4.9"
"postcss": "^8.4.41",
"sass": "^1.77.8",
"svelte": "^4.2.19",
"svelte-check": "^3.8.6",
"svelte-preprocess": "^6.0.2",
"vite": "^5.4.2"
},
"author": "Climate Interactive",
"license": "MIT",
Expand Down
14 changes: 8 additions & 6 deletions examples/house-game/packages/app/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import sveltePreprocess from 'svelte-preprocess'
import { sveltePreprocess } from 'svelte-preprocess'

export default {
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
switch (warning.code) {
case 'a11y-click-events-have-key-events':
case 'a11y-no-noninteractive-tabindex':
case 'a11y-no-static-element-interactions':
return
default:
break
}

// Handle all other warnings normally
Expand Down
2 changes: 2 additions & 0 deletions examples/house-game/packages/app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"isolatedModules": true,
"verbatimModuleSyntax": true,
"skipLibCheck": true,
"allowJs": true,
"noImplicitAny": false,
Expand Down
18 changes: 9 additions & 9 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-warnings --output human --compiler-warnings \"a11y-click-events-have-key-events:ignore,a11y-no-noninteractive-tabindex:ignore\"",
"lint:svelte": "svelte-check --fail-on-warnings --output human --compiler-warnings \"a11y-click-events-have-key-events:ignore,a11y-no-noninteractive-tabindex:ignore,a11y-no-static-element-interactions:ignore\"",
"lint": "run-s lint:ts lint:svelte",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write .",
Expand All @@ -23,14 +23,14 @@
"@sdeverywhere/sample-check-tests": "workspace:*"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.4.5",
"postcss": "^8.4.31",
"pug": "^3.0.1",
"sass": "^1.34.1",
"svelte": "^3.59.2",
"svelte-check": "^3.5.1",
"svelte-preprocess": "^5.0.4",
"vite": "^4.4.9"
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"postcss": "^8.4.41",
"pug": "^3.0.3",
"sass": "^1.77.8",
"svelte": "^4.2.19",
"svelte-check": "^3.8.6",
"svelte-preprocess": "^6.0.2",
"vite": "^5.4.2"
},
"author": "Climate Interactive",
"license": "MIT",
Expand Down
14 changes: 8 additions & 6 deletions examples/sample-check-app/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import sveltePreprocess from 'svelte-preprocess'
import { sveltePreprocess } from 'svelte-preprocess'

export default {
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
switch (warning.code) {
case 'a11y-click-events-have-key-events':
case 'a11y-no-noninteractive-tabindex':
case 'a11y-no-static-element-interactions':
return
default:
break
}

// Handle all other warnings normally
Expand Down
3 changes: 2 additions & 1 deletion examples/sample-check-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"files": [
"dist/**"
],
"type": "module",
"module": "dist/index.js",
"types": "types/index.d.ts",
"scripts": {
Expand All @@ -26,7 +27,7 @@
"assert-never": "^1.2.1"
},
"devDependencies": {
"vite": "^4.4.9"
"vite": "^5.4.2"
},
"author": "Climate Interactive",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion examples/sample-check-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"assert-never": "^1.2.1"
},
"devDependencies": {
"vite": "^4.4.9"
"vite": "^5.4.2"
},
"author": "Climate Interactive",
"license": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions examples/sample-check-tests/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import type {

import { createBaseComparisonSpecs } from './comparisons/comparison-specs'

const checksYamlGlob = import.meta.glob('./checks/*.yaml', { eager: true, as: 'raw' })
const checksYaml = Object.values(checksYamlGlob)
const checksYamlGlob = import.meta.glob('./checks/*.yaml', { eager: true, query: '?raw', import: 'default' })
const checksYaml = Object.values(checksYamlGlob) as string[]

const comparisonsYamlGlob = import.meta.glob('./comparisons/*.yaml', { eager: true, as: 'raw' })
const comparisonsYamlGlob = import.meta.glob('./comparisons/*.yaml', { eager: true, query: '?raw', import: 'default' })
const comparisonsYaml: ComparisonSpecsSource[] = Object.entries(comparisonsYamlGlob).map(entry => {
return {
kind: 'yaml',
filename: entry[0],
content: entry[1]
content: entry[1] as string
}
})

Expand Down
2 changes: 1 addition & 1 deletion examples/template-default/packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
},
"devDependencies": {
"@types/chart.js": "^2.9.34",
"vite": "^4.4.9"
"vite": "^5.4.2"
}
}
2 changes: 1 addition & 1 deletion examples/template-default/packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
},
"devDependencies": {
"typescript": "^5.2.2",
"vite": "^4.4.9"
"vite": "^5.4.2"
}
}
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@
"test": "run-s test:pkgs test:c-int test:js-int"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"eslint": "^8.48.0",
"eslint-config-prettier": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.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": "^7.2.0",
"tsup": "^8.2.4",
"typedoc": "0.25.0",
"typedoc-plugin-markdown": "3.16.0",
"typescript": "^5.2.2",
"vitest": "^0.34.3"
"vitest": "^2.0.5"
},
"pnpm": {
"peerDependencyRules": {
Expand Down
2 changes: 1 addition & 1 deletion packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"precommit": "../../scripts/precommit",
"test": "vitest run",
"test:watch": "vitest",
"test:ci": "vitest --threads=false --test-timeout=10000 run",
"test:ci": "vitest --pool=forks --test-timeout=10000 run",
"type-check": "tsc --noEmit -p tsconfig-test.json",
"build": "tsup",
"docs": "../../scripts/gen-docs.js",
Expand Down
30 changes: 15 additions & 15 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-warnings --output human --compiler-warnings \"a11y-click-events-have-key-events:ignore,a11y-no-noninteractive-tabindex:ignore\"",
"lint:svelte": "svelte-check --fail-on-warnings --output human --compiler-warnings \"a11y-click-events-have-key-events:ignore,a11y-no-noninteractive-tabindex:ignore,a11y-no-static-element-interactions:ignore\"",
"lint": "run-s lint:ts lint:svelte",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write .",
Expand All @@ -26,27 +26,27 @@
"ci:build": "run-s clean lint prettier:check test:ci type-check build docs"
},
"dependencies": {
"@sdeverywhere/check-core": "^0.1.2",
"@fortawesome/free-regular-svg-icons": "^6.1.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
"@juggle/resize-observer": "^3.3.0",
"@juggle/resize-observer": "^3.4.0",
"@sdeverywhere/check-core": "^0.1.2",
"assert-never": "^1.2.1",
"chart.js": "^2.9.4",
"copy-text-to-clipboard": "^3.0.1",
"fontfaceobserver": "^2.1.0"
"copy-text-to-clipboard": "^3.2.0",
"fontfaceobserver": "^2.3.0"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.4.5",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@types/chart.js": "^2.9.34",
"@types/fontfaceobserver": "^0.0.6",
"postcss": "^8.4.31",
"pug": "^3.0.1",
"sass": "^1.34.1",
"svelte": "^3.59.2",
"svelte-awesome": "^3.0.0",
"svelte-check": "^3.5.1",
"svelte-preprocess": "^5.0.4",
"vite": "^4.4.9"
"@types/fontfaceobserver": "^2.1.3",
"postcss": "^8.4.41",
"pug": "^3.0.3",
"sass": "^1.77.8",
"svelte": "^4.2.19",
"svelte-awesome": "^3.3.1",
"svelte-check": "^3.8.6",
"svelte-preprocess": "^6.0.2",
"vite": "^5.4.2"
},
"devDependenciesComments": {
"svelte-awesome": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script lang='ts'>
import { slide } from 'svelte/transition'
import Icon from 'svelte-awesome'
import Icon from 'svelte-awesome/components/Icon.svelte'
import { faLightbulb } from '@fortawesome/free-regular-svg-icons'
import type { WizardCardDescViewModel } from './wizard-card-desc-vm'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script lang='ts'>
import { slide } from 'svelte/transition'
import Icon from 'svelte-awesome'
import Icon from 'svelte-awesome/components/Icon.svelte'
import { faArrowRightToBracket } from '@fortawesome/free-solid-svg-icons'
import type { WizardCardInputsViewModel } from './wizard-card-inputs-vm'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script lang='ts'>
import { slide } from 'svelte/transition'
import Icon from 'svelte-awesome'
import Icon from 'svelte-awesome/components/Icon.svelte'
import { faArrowRightFromBracket } from '@fortawesome/free-solid-svg-icons'
import SearchList from './search-list.svelte'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<script lang='ts'>
import { slide } from 'svelte/transition'
import Icon from 'svelte-awesome'
import Icon from 'svelte-awesome/components/Icon.svelte'
import { faCircleCheck } from '@fortawesome/free-regular-svg-icons'
import Selector from '../_shared/selector.svelte'
Expand Down
14 changes: 8 additions & 6 deletions packages/check-ui-shell/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import sveltePreprocess from 'svelte-preprocess'
import { sveltePreprocess } from 'svelte-preprocess'

export default {
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
switch (warning.code) {
case 'a11y-click-events-have-key-events':
case 'a11y-no-noninteractive-tabindex':
case 'a11y-no-static-element-interactions':
return
default:
break
}

// Handle all other warnings normally
Expand Down
3 changes: 0 additions & 3 deletions packages/check-ui-shell/tsconfig-build.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// This contains the TypeScript configuration for production builds.
{
"extends": "./tsconfig-base.json",
"compilerOptions": {
"skipLibCheck": true
},
"include": ["src/**/*"],
"exclude": ["src/**/_test/**/*", "**/*.spec.ts"]
}
2 changes: 1 addition & 1 deletion packages/create/src/step-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export async function chooseInstallDeps(projDir: string, args: Arguments, pkgMan
})
installSpinner.text = green('Packages installed!')
installSpinner.succeed()
} catch (e) {
} catch {
installSpinner.text = yellow(
`There was an error installing packages. Try running ${cyan(
`${pkgManager} install`
Expand Down
2 changes: 1 addition & 1 deletion packages/create/src/step-git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export async function chooseGitInit(projDir: string, args: Arguments): Promise<v
try {
await execaCommand('git init', { cwd: projDir })
ora().succeed(green('Git repository initialized!'))
} catch (e) {
} catch {
ora().warn(
yellow(
`There was a problem initializing the Git repository, but no problem, you can run ${cyan(`git init`)} later.`
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 @@ -47,7 +47,7 @@
"chokidar": "^3.5.3",
"picocolors": "^1.0.0",
"rollup": "^2.76.0",
"vite": "4.4.9"
"vite": "5.4.2"
},
"dependenciesComments": {
"rollup": [
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-check/template-tests/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import type {
// errors if it is invalid (not a literal).
const yamlGlob = import.meta.glob('./__YAML_PATH__', {
eager: true,
as: 'raw'
query: '?raw',
import: 'default'
})
const tests: string[] = []
for (const yamlKey of Object.keys(yamlGlob)) {
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"byline": "^5.0.0",
"csv-parse": "^5.3.3",
"sanitize-html": "^2.7.1"
"sanitize-html": "^2.13.0"
},
"peerDependencies": {
"@sdeverywhere/build": "^0.3.5"
Expand All @@ -46,7 +46,7 @@
"@types/dedent": "^0.7.0",
"@types/marked": "^4.0.1",
"@types/node": "^20.5.7",
"@types/sanitize-html": "^2.6.2",
"@types/sanitize-html": "^2.13.0",
"@types/temp": "^0.9.1",
"dedent": "^0.7.0",
"temp": "^0.9.4"
Expand Down
Loading

0 comments on commit b89d013

Please sign in to comment.