Skip to content

Commit

Permalink
chroe: update to version number
Browse files Browse the repository at this point in the history
  • Loading branch information
azaleta authored and sxzz committed Oct 22, 2022
1 parent be3d1d4 commit ca7d930
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ Components({
exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],

// The dts file have different namespace if the vue is version 2.7
vueVersion: '2.7.0'
version: 2.7
})
```

Expand Down
2 changes: 1 addition & 1 deletion src/core/declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export function getDeclaration(ctx: Context, filepath: string, originalImports?:
directive: stringifyDeclarationImports({ ...originalImports?.directive, ...imports.directive }),
}

const isVue27 = ctx.options.vueVersion ? ctx.options.vueVersion.startsWith('2.7') : false
const isVue27 = ctx.options.version ? ctx.options.version === 2.7 : false
const dtsHead = isVue27
? `
export {}
Expand Down
2 changes: 1 addition & 1 deletion src/core/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getPackageInfoSync, isPackageExists } from 'local-pkg'
import type { ComponentResolver, ComponentResolverObject, Options, ResolvedOptions } from '../types'
import { detectTypeImports } from './type-imports/detect'

export const defaultOptions: Omit<Required<Options>, 'include' | 'exclude' | 'transformer' | 'globs' | 'directives' | 'types' | 'vueVersion'> = {
export const defaultOptions: Omit<Required<Options>, 'include' | 'exclude' | 'transformer' | 'globs' | 'directives' | 'types' | 'version'> = {
dirs: 'src/components',
extensions: 'vue',
deep: true,
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export interface Options {
/**
* Passing Project Vue Version for Declaration
*/
vueVersion?: String
version?: number
}

export type ResolvedOptions = Omit<
Expand Down
2 changes: 1 addition & 1 deletion test/dts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const _directive_loading = _resolveDirective("loading")`
resolvers: resolver,
directives: true,
})
ctx.options.vueVersion = '2.7.1'
ctx.options.version = 2.7
const code = 'const _component_test_comp = _resolveComponent("test-comp")'
await ctx.transform(code, '')

Expand Down

0 comments on commit ca7d930

Please sign in to comment.