Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update ts-morph to 24.0 to match TS 5.6.2 #3036

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/twenty-badgers-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@pandacss/extractor': minor
'@pandacss/config': minor
'@pandacss/parser': minor
'@pandacss/types': minor
'@pandacss/node': minor
---

BREAKING: Update ts-morph to v24.0.0 to support TS 5.6.2
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
"lint-staged": "15.2.10",
"mdx-local-link-checker": "2.1.1",
"rimraf": "5.0.10",
"ts-morph": "21.0.1",
"ts-morph": "24.0.0",
"tsup": "8.0.2",
"tsx": "4.7.1",
"typescript": "5.3.3",
"typescript": "5.6.2",
"vite-tsconfig-paths": "4.3.1",
"vitest": "1.5.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"escalade": "3.1.2",
"merge-anything": "5.1.7",
"microdiff": "1.3.2",
"typescript": "5.3.3"
"typescript": "5.6.2"
},
"devDependencies": {
"pkg-types": "1.0.3"
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/plugins/optimize-lightningcss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default function optimizeLightCss(code: string | Root, options: OptimizeO

const codeStr = typeof code === 'string' ? code : code.toString()
const result = transform({
code: Buffer.from(codeStr),
// https://stackoverflow.com/questions/78790943/in-typescript-5-6-buffer-is-not-assignable-to-arraybufferview-or-uint8arr
code: Buffer.from(codeStr) as any as Uint8Array,
minify,
sourceMap: false,
filename: 'styles.css',
Expand Down
2 changes: 1 addition & 1 deletion packages/extractor/__tests__/extract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { default as ExtractSample } from './samples/ExtractSample?raw'

const project = createProject()

let sourceFile: SourceFile
let sourceFile: SourceFile | undefined
afterEach(() => {
if (!sourceFile) return

Expand Down
2 changes: 1 addition & 1 deletion packages/extractor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@
"dependencies": {
"@pandacss/shared": "workspace:*",
"ts-evaluator": "1.2.0",
"ts-morph": "21.0.1"
"ts-morph": "24.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"pluralize": "8.0.0",
"postcss": "8.4.49",
"prettier": "3.2.5",
"ts-morph": "21.0.1",
"ts-morph": "24.0.0",
"ts-pattern": "5.0.8",
"tsconfck": "3.0.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@pandacss/types": "workspace:*",
"@vue/compiler-sfc": "3.4.19",
"magic-string": "0.30.14",
"ts-morph": "21.0.1",
"ts-morph": "24.0.0",
"ts-pattern": "5.0.8"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/src/vue-to-tsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const NodeTypes = {
export const vueToTsx = (code: string) => {
try {
const parsed = parse(code)
const fileStr = new MagicString(`<template>${parsed.descriptor.template?.content}</template>` ?? '')
const fileStr = new MagicString(`<template>${parsed.descriptor.template?.content}</template>`)

const rewriteProp = (prop: BaseElementNode['props'][number]) => {
if (
Expand Down
6 changes: 3 additions & 3 deletions packages/shared/src/traverse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ export function traverse(obj: any, callback: CallbackFn, options: TraverseOption
const keys = Object.keys(currentItem.value)
for (let i = keys.length - 1; i >= 0; i--) {
const key = keys[i]
const value = currentItem.value[key]
const value = (currentItem.value as Record<string, unknown>)[key]

const path = currentItem.path ? currentItem.path + separator + key : key
const paths = currentItem.paths.concat(key)

stack.push({
value,
value: value as Record<string, unknown>,
path,
paths,
depth: currentItem.depth + 1,
parent: currentItem.value,
parent: currentItem.value as Record<string, unknown>,
key,
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
"microdiff": "1.3.2",
"ncp": "2.0.0",
"pkg-types": "1.0.3",
"ts-morph": "21.0.1"
"ts-morph": "24.0.0"
}
}
3 changes: 2 additions & 1 deletion packages/types/scripts/build.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import fs from 'fs'
import path from 'path'

Expand All @@ -19,7 +20,7 @@ export const main = () => {
files.forEach((file) => {
const destFile = path.join('dist', file.endsWith('.d.ts') ? file : toDts(file))
getOrCreateDir('dist')
const content = fs.readFileSync(path.join('src', file))
const content = fs.readFileSync(path.join('src', file as string))
fs.writeFileSync(destFile, content)
})
}
Expand Down
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"react-live-runner": "1.0.7",
"sucrase": "3.35.0",
"ts-pattern": "5.0.8",
"typescript": "5.3.3",
"typescript": "5.6.2",
"usehooks-ts": "2.14.0",
"util": "0.12.5",
"zod": "3.22.4"
Expand Down
Loading
Loading