Skip to content

Commit

Permalink
ci(typescript): bump typescript version to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Isokaeder committed Jan 14, 2025
1 parent d609beb commit 1d98ca2
Show file tree
Hide file tree
Showing 10 changed files with 153 additions and 219 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
"stylelint-csstree-validator": "^3.0.0",
"stylelint-prettier": "^4.0.2",
"turbo": "^1.13.3",
"typescript": "5.4.4",
"typescript-eslint": "^7.8.0"
"typescript": "^5.7.2",
"typescript-eslint": "^8.20.0"
},
"engines": {
"node": "20"
Expand Down
2 changes: 1 addition & 1 deletion packages/documentation/data/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const makeComponentMenuItem = (component: {
component.meta.deprecated === null ? null : Tag.DEPRECATED,
component.meta.typeScript === null ? null : Tag.TS,
component.meta.typeScript?.schema ? Tag.ZOD : null,
].filter((x) => x !== null) as Tag[],
].filter((x) => x !== null),
})

export const menu: Array<Section> = [
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"eslint-plugin-vue": "^9.32.0",
"globals": "^15.14.0",
"jsonc-eslint-parser": "^2.4.0",
"typescript-eslint": "^8.19.1",
"typescript-eslint": "^8.20.0",
"vue-eslint-parser": "^9.4.3"
},
"description": "ESLint config for 3YOURMIND",
Expand Down
8 changes: 4 additions & 4 deletions packages/kotti-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@
"vitest": "^1.6.0",
"vue": "^2.7",
"vue-template-compiler": "^2.7",
"vue-tsc": "^1.8.22"
"vue-tsc": "^2.2.0"
},
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"types": "./dist/types/index.d.ts",
"default": "./dist/kotti-ui.js"
},
"require": {
"types": "./dist/index.d.cts",
"types": "./dist/types/index.d.cts",
"default": "./dist/kotti-ui.cjs"
}
},
Expand Down Expand Up @@ -97,6 +97,6 @@
],
"style": "./dist/style.css",
"type": "module",
"types": "./dist/index.d.ts",
"types": "./dist/types/index.d.ts",
"version": "8.3.2"
}
10 changes: 6 additions & 4 deletions packages/kotti-ui/scripts/build-vue-tsc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
set -euo pipefail

# this directory is assumed to exist, so create it
mkdir -p dist
mkdir -p dist/types

# delete all output files of vue-tsc in dist folder:
## - *.d.ts
find ./dist -type f -name "*.d.ts" -delete
find ./dist/types -type f -name "*.d.ts" -delete
## - *.cts
find ./dist -type f -name "*.cts" -delete
## - empty directories that previously contained the above files
find ./dist -type d -empty -delete
find ./dist/types -type d -empty -delete

rm ./dist/types/tsconfig.tsbuildinfo

# generate types
vue-tsc --declaration --emitDeclarationOnly

# HACK: duplicate index.d.ts in order to calm down publint
cp ./dist/index.d.ts ./dist/index.d.cts
cp ./dist/types/index.d.ts ./dist/types/index.d.cts
1 change: 1 addition & 0 deletions packages/kotti-ui/source/kotti-comment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const KtComment = attachMeta(
},
},
)

export const KtCommentInput = attachMeta(
makeInstallable(KtCommentInputVue as ComponentPublicInstanceConstructor),
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ export const simpleHash = (strings: string[]): string => {
// eslint-disable-next-line sonarjs/no-alphabetical-sort
for (const string of [...strings].sort()) {
for (let charIndex = 0; charIndex < string.length; charIndex++) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const char = result[charIndex]!
// string.length is added to make collisions less likely (e.g. foo + fooBar = baz + bazBar without this)

result[charIndex] ^= string.charCodeAt(charIndex) + string.length
result[charIndex] = char ^ (string.charCodeAt(charIndex) + string.length)
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/kotti-ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true, // FIXME: disable in development
"noUnusedParameters": true, // FIXME: disable in development
"outDir": "dist",
"outDir": "dist/types",
"paths": {
/**
* Without specifying this path, resolution of vue/types/v3-component-public-instance fails:
Expand All @@ -32,7 +32,7 @@
"sourceMap": true,
"strict": true,
"target": "ESNext",
"tsBuildInfoFile": "dist/tsconfig.tsbuildinfo"
"tsBuildInfoFile": "dist/types/tsconfig.tsbuildinfo"
},
"exclude": ["node_modules", "dist"],
"include": [
Expand Down
4 changes: 2 additions & 2 deletions packages/kotti-ui/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"outputs": ["dist/kotti-ui.*", "dist/variables.scss", "dist/style.css"]
},
"build:vue-tsc": {
"dependsOn": ["^build"],
"dependsOn": ["^build", "build:vite"],
"inputs": ["source/**", "tsconfig*.json"],
"outputMode": "new-only",
"outputs": ["dist/**/*.{cts,d.ts}"]
"outputs": ["dist/types/**/*.{cts,d.ts}"]
},
"test": {
"dependsOn": ["^build"],
Expand Down
Loading

0 comments on commit 1d98ca2

Please sign in to comment.