Skip to content

Commit

Permalink
fix(typings): incorrect or outdated type definitions (#1513)
Browse files Browse the repository at this point in the history
Relates to #1266

- The `vite-plugin-dts` was removed and instead we use `vue-tsc` for the
generation of the type definitions.
- The plugin uses an outdated version of the
[`@vue/language-core`](https://www.npmjs.com/package/%40vue%2Flanguage-core)
package
 - Added typings to all `.eslintrc.cjs` files
  • Loading branch information
JoCa96 authored Jul 4, 2024
1 parent cfd1381 commit bf1e992
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 313 deletions.
8 changes: 8 additions & 0 deletions .changeset/honest-shrimps-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"sit-onyx": patch
---

fix(typings): incorrect or outdated type definitions

- The `vite-plugin-dts` was removed and instead we use `vue-tsc` for the generation of the type definitions.
- The plugin used an outdated version of the [`@vue/language-core`](https://www.npmjs.com/package/%40vue%2Flanguage-core) package
3 changes: 3 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// see: https://github.com/vuejs/eslint-config-typescript#installation
require("@rushstack/eslint-patch/modern-module-resolution");

/**
* @type {import('eslint').ESLint.ConfigData}
*/
module.exports = {
root: true,
parserOptions: {
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ eslint-results.sarif
.output

# Development config
.env*
.env*

# typescript
*.tsbuildinfo
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"storybook": "^8.1.11",
"typescript": "~5.5.3",
"vite": "^5.3.3",
"vite-plugin-dts": "^3.9.1",
"vitest": "^1.6.0",
"vue": "^3.4.31",
"vue-tsc": "^2.0.24"
Expand Down
3 changes: 3 additions & 0 deletions packages/eslint-plugin/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @type {import('eslint').ESLint.ConfigData}
*/
module.exports = {
root: false, // will be merged with our global config
env: {
Expand Down
3 changes: 3 additions & 0 deletions packages/headless/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* eslint-env node */

/**
* @type {import('eslint').ESLint.ConfigData}
*/
module.exports = {
root: false, // will be merged with our global config
extends: ["plugin:playwright/recommended"],
Expand Down
3 changes: 3 additions & 0 deletions packages/sit-onyx/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* eslint-env node */

/**
* @type {import('eslint').ESLint.ConfigData}
*/
module.exports = {
root: false, // will be merged with our global config
extends: ["plugin:playwright/recommended"],
Expand Down
6 changes: 2 additions & 4 deletions packages/sit-onyx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@
"scripts": {
"start": "pnpm run dev",
"dev": "storybook dev -p 6006 --no-open",
"build": "pnpm run '/type-check|build-only/'",
"build": "vite build && vue-tsc -p tsconfig.app.json --composite false",
"build:storybook": "storybook build",
"preview": "vite serve storybook-static",
"test": "vitest",
"test:coverage": "vitest run --coverage",
"test:components": "playwright install && playwright test",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false"
"test:components": "playwright install && playwright test"
},
"peerDependencies": {
"@fontsource-variable/source-code-pro": ">= 5",
Expand Down
5 changes: 3 additions & 2 deletions packages/sit-onyx/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"extends": "@vue/tsconfig/tsconfig.dom.json",
"include": ["env.d.ts", "src/**/*", "src/i18n/locales/en-US.json"],
"extends": ["@vue/tsconfig/tsconfig.dom.json", "@vue/tsconfig/tsconfig.lib.json"],
"include": ["env.d.ts", "src/**/*", "src/i18n/locales/*.json"],
"exclude": ["src/**/*.ct.*", "src/**/*.spec.*", "src/**/*.stories.ts"],
"compilerOptions": {
"composite": true,
"rootDir": "./src",
"outDir": "./dist",
"baseUrl": "."
}
}
1 change: 1 addition & 0 deletions packages/sit-onyx/tsconfig.vitest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"extends": "./tsconfig.app.json",
"include": ["src/**/*.spec.*"],
"exclude": [],
"compilerOptions": {
"composite": true,
Expand Down
3 changes: 1 addition & 2 deletions packages/sit-onyx/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
import vue from "@vitejs/plugin-vue";
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";
import packageJson from "./package.json";
import { vuePluginOptions } from "./playwright.config";

// https://vitejs.dev/config
export default defineConfig({
plugins: [vue(vuePluginOptions), dts({ tsconfigPath: getFilePath("./tsconfig.app.json") })],
plugins: [vue(vuePluginOptions)],
build: {
lib: {
entry: getFilePath("./src/index.ts"),
Expand Down
Loading

0 comments on commit bf1e992

Please sign in to comment.