Skip to content

Commit

Permalink
chore(deps): replace @mizchi/sucrase with sucrase
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbieGoede committed Nov 19, 2023
1 parent 1616839 commit 234739f
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
"dependencies": {
"@intlify/shared": "^9.7.0",
"@intlify/unplugin-vue-i18n": "^1.4.0",
"@mizchi/sucrase": "^4.1.0",
"@nuxt/kit": "^3.7.4",
"@vue/compiler-sfc": "^3.3.4",
"debug": "^4.3.4",
Expand All @@ -88,6 +87,7 @@
"knitwork": "^1.0.0",
"magic-string": "^0.30.4",
"pathe": "^1.1.1",
"sucrase": "^3.34.0",
"ufo": "^1.3.1",
"unplugin": "^1.5.0",
"vue-i18n": "9.6.5",
Expand Down
87 changes: 67 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { parse as parsePath, resolve, relative, normalize, join } from 'pathe'
import { parse as _parseCode } from '@babel/parser'
import { defu } from 'defu'
import { encodePath } from 'ufo'
// @ts-ignore
import { transform as stripType } from '@mizchi/sucrase'
import { transform as stripType } from 'sucrase'
import { isString, isRegExp, isFunction, isArray, isObject } from '@intlify/shared'
import { NUXT_I18N_MODULE_ID, TS_EXTENSIONS, EXECUTABLE_EXTENSIONS, NULL_HASH } from './constants'

Expand Down Expand Up @@ -180,7 +179,7 @@ export function readCode(absolutePath: string, ext: string) {
let code = readFileSync(absolutePath)
if (TS_EXTENSIONS.includes(ext)) {
const out = stripType(code, {
transforms: ['jsx'],
transforms: ['typescript', 'jsx'],
keepUnusedImports: true
})
code = out.code
Expand Down

0 comments on commit 234739f

Please sign in to comment.