Skip to content

Commit

Permalink
chore: upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Mar 20, 2024
1 parent 58174a4 commit 6fe5793
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 25 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.2.2",
"packageManager": "pnpm@8.15.5",
"description": "Vue JSX plugin for both Vue 2 and 3.",
"type": "commonjs",
"keywords": [
"unplugin",
"rollup",
Expand Down Expand Up @@ -82,7 +83,7 @@
"unplugin": "^1.10.0"
},
"devDependencies": {
"@sxzz/eslint-config": "^3.8.6",
"@sxzz/eslint-config": "^3.8.7",
"@sxzz/prettier-config": "^2.0.1",
"@types/babel__core": "^7.20.5",
"@types/node": "^20.11.30",
Expand Down
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

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

7 changes: 4 additions & 3 deletions src/core/options.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import process from 'node:process'
import { getPackageInfo } from 'local-pkg'
import { type VueJSXPluginOptions } from '@vue/babel-plugin-jsx'
import { type FilterPattern } from '@rollup/pluginutils'
import type { VueJSXPluginOptions } from '@vue/babel-plugin-jsx'
import type { FilterPattern } from '@rollup/pluginutils'

export type Vue2JSXOptions = {
functional?: boolean
Expand Down Expand Up @@ -30,7 +31,7 @@ export type OptionsResolved = Omit<Required<Options>, 'version'> & {
}

export async function resolveOption(
options: Options
options: Options,
): Promise<OptionsResolved> {
const root = options.root || process.cwd()
let version: 2 | 3
Expand Down
4 changes: 2 additions & 2 deletions src/core/vue2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import TS from '@babel/plugin-syntax-typescript'
// @ts-expect-error
import vue2Jsx from '@vue/babel-preset-jsx'
import { isTS } from './utils'
import { type OptionsResolved } from './options'
import type { OptionsResolved } from './options'

export const transformVue2 = (
code: string,
id: string,
options: OptionsResolved
options: OptionsResolved,
) => {
const transformOptions: TransformOptions = {
babelrc: false,
Expand Down
4 changes: 2 additions & 2 deletions src/core/vue3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import vue3Jsx from '@vue/babel-plugin-jsx'
// @ts-expect-error
import TS from '@babel/plugin-syntax-typescript'
import { isTS } from './utils'
import { type OptionsResolved } from './options'
import type { OptionsResolved } from './options'

export const transformVue3 = (
code: string,
id: string,
options: OptionsResolved
options: OptionsResolved,
) => {
const transformOptions: TransformOptions = {
babelrc: false,
Expand Down
4 changes: 2 additions & 2 deletions tests/vue2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ describe('Vue 2', () => {
await transform(`<input vModel={refa} />`, {
version: 2,
vModel: false,
})
}),
).toMatchSnapshot()
expect(
await transform(`<input vModel={refa} />`, {
version: 2,
vModel: true,
})
}),
).toMatchSnapshot()
})
})
6 changes: 3 additions & 3 deletions tests/vue3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { transformVue3 } from '../src/core/vue3'
const transform = async (
code: string,
isTS = false,
userOptions: Options = {}
userOptions: Options = {},
) => {
const options = await resolveOption({
version: 3,
Expand All @@ -31,13 +31,13 @@ describe('Vue 3', () => {
await transform(`<input on={{ click: a }} />`, false, {
version: 3,
transformOn: false,
})
}),
).toMatchSnapshot()
expect(
await transform(`<input on={{ click: a }} />`, false, {
version: 3,
transformOn: true,
})
}),
).toMatchSnapshot()
})
})
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"compilerOptions": {
"target": "es2022",
"lib": ["es2022"],
"jsx": "preserve",
"lib": ["es2022"],
"module": "esnext",
"moduleResolution": "node",
"types": ["node"],
"resolveJsonModule": true,
"esModuleInterop": true,
"types": ["node"],
"strict": true,
"exactOptionalPropertyTypes": true,
"noUnusedLocals": true,
"esModuleInterop": true,
"skipLibCheck": true
},
"include": ["src", "tests"]
Expand Down

0 comments on commit 6fe5793

Please sign in to comment.