chore: Typescript: Rewrite Configs (#21763)

This commit is contained in:
Maschga 2025-09-28 11:10:24 +02:00 • committed by GitHub
parent 44bcb6875b
commit 54419f9e7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 121 additions and 28 deletions

View file

@ -1,5 +1,7 @@
import { type Config } from "prettier";
export default {
printWidth: 100,
trailingComma: "es5",
plugins: ["prettier-plugin-sh"],
};
} satisfies Config;

View file

@ -1,12 +0,0 @@
/** @type { import('@storybook/vue3-vite').StorybookConfig } */
const config = {
stories: ["../assets/js/**/*.stories.@(js|ts)"],
addons: [
"@chromatic-com/storybook",
],
framework: {
name: "@storybook/vue3-vite",
options: {},
},
};
export default config;

10
.storybook/main.ts Normal file
View file

@ -0,0 +1,10 @@
import { StorybookConfig } from "@storybook/vue3-vite";
export default {
stories: ["../assets/js/**/*.stories.@(js|ts)"],
addons: ["@chromatic-com/storybook"],
framework: {
name: "@storybook/vue3-vite",
options: {},
},
} satisfies StorybookConfig;

View file

@ -1,4 +1,4 @@
import { setup } from "@storybook/vue3";
import { type Preview, setup } from "@storybook/vue3";
import "bootstrap/dist/css/bootstrap.min.css";
import smoothscroll from "smoothscroll-polyfill";
import setupI18n from "../assets/js/i18n";
@ -9,8 +9,7 @@ smoothscroll.polyfill();
watchThemeChanges();
// Setup global parameters
/** @type { import('@storybook/vue3').Preview } */
const preview = {
export default {
parameters: {
controls: {
matchers: {
@ -32,7 +31,7 @@ const preview = {
],
},
},
};
} satisfies Preview;
setup((app) => {
app.config.globalProperties.$hiddenFeatures = () => true;
@ -44,5 +43,3 @@ setup((app) => {
template: '<a :href="to"><slot /></a>',
});
});
export default preview;

View file

@ -1,6 +1,4 @@
{
"plugins": [
"prettier-plugin-sort-json"
],
"jsonRecursiveSort": true
}
"jsonRecursiveSort": true,
"plugins": ["prettier-plugin-sort-json"]
}

View file

@ -1,4 +0,0 @@
export default {
preset: "@vue/cli-plugin-unit-jest/presets/no-babel",
testMatch: ["**/*.spec.js"],
};

6
jest.config.ts Normal file
View file

@ -0,0 +1,6 @@
import { Config } from "@jest/types";
export default {
preset: "@vue/cli-plugin-unit-jest/presets/no-babel",
testMatch: ["**/*.spec.ts"],
} satisfies Config.InitialOptions;

94
package-lock.json generated
View file

@ -31,6 +31,7 @@
"@chromatic-com/storybook": "^4.2.0-next.1",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.13.0",
"@jest/types": "^29.6.3",
"@playwright/test": "^1.55.0",
"@storybook/vue3": "^10.0.0-beta.2",
"@storybook/vue3-vite": "^10.0.0-beta.2",
@ -58,6 +59,7 @@
"eslint-plugin-vue": "^10.4.0",
"globals": "^16.3.0",
"happy-dom": "^18.0.1",
"jiti": "^2.5.1",
"kill-port": "^2.0.1",
"license-compliance": "^3.0.1",
"mqtt": "^5.14.1",
@ -2466,6 +2468,37 @@
"node": ">=12"
}
},
"node_modules/@jest/schemas": {
"version": "29.6.3",
"resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz",
"integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@sinclair/typebox": "^0.27.8"
},
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
},
"node_modules/@jest/types": {
"version": "29.6.3",
"resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz",
"integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@jest/schemas": "^29.6.3",
"@types/istanbul-lib-coverage": "^2.0.0",
"@types/istanbul-reports": "^3.0.0",
"@types/node": "*",
"@types/yargs": "^17.0.8",
"chalk": "^4.0.0"
},
"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
}
},
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.13",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
@ -2985,6 +3018,13 @@
"dev": true,
"license": "BSD-3-Clause"
},
"node_modules/@sinclair/typebox": {
"version": "0.27.8",
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",
"integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==",
"dev": true,
"license": "MIT"
},
"node_modules/@storybook/builder-vite": {
"version": "10.0.0-beta.2",
"resolved": "https://registry.npmjs.org/@storybook/builder-vite/-/builder-vite-10.0.0-beta.2.tgz",
@ -3236,6 +3276,33 @@
"dev": true,
"license": "MIT"
},
"node_modules/@types/istanbul-lib-coverage": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz",
"integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==",
"dev": true,
"license": "MIT"
},
"node_modules/@types/istanbul-lib-report": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz",
"integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/istanbul-lib-coverage": "*"
}
},
"node_modules/@types/istanbul-reports": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz",
"integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/istanbul-lib-report": "*"
}
},
"node_modules/@types/json-schema": {
"version": "7.0.15",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
@ -3315,6 +3382,23 @@
"@types/node": "*"
}
},
"node_modules/@types/yargs": {
"version": "17.0.33",
"resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz",
"integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/yargs-parser": "*"
}
},
"node_modules/@types/yargs-parser": {
"version": "21.0.3",
"resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz",
"integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==",
"dev": true,
"license": "MIT"
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.43.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.43.0.tgz",
@ -7498,6 +7582,16 @@
"@pkgjs/parseargs": "^0.11.0"
}
},
"node_modules/jiti": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/jiti/-/jiti-2.5.1.tgz",
"integrity": "sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==",
"dev": true,
"license": "MIT",
"bin": {
"jiti": "lib/jiti-cli.mjs"
}
},
"node_modules/joi": {
"version": "17.13.3",
"resolved": "https://registry.npmjs.org/joi/-/joi-17.13.3.tgz",

View file

@ -49,6 +49,7 @@
"@chromatic-com/storybook": "^4.2.0-next.1",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.13.0",
"@jest/types": "^29.6.3",
"@playwright/test": "^1.55.0",
"@storybook/vue3": "^10.0.0-beta.2",
"@storybook/vue3-vite": "^10.0.0-beta.2",
@ -76,6 +77,7 @@
"eslint-plugin-vue": "^10.4.0",
"globals": "^16.3.0",
"happy-dom": "^18.0.1",
"jiti": "^2.5.1",
"kill-port": "^2.0.1",
"license-compliance": "^3.0.1",
"mqtt": "^5.14.1",