Skip to content

Commit

Permalink
refactor: export all from common
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Aug 21, 2023
1 parent a3b8817 commit 7128dd5
Show file tree
Hide file tree
Showing 11 changed files with 318 additions and 369 deletions.
6 changes: 6 additions & 0 deletions .changeset/nasty-shoes-whisper.md
@@ -0,0 +1,6 @@
---
'@vue-macros/common': patch
'@vue-macros/api': patch
---

export all from common
2 changes: 1 addition & 1 deletion packages/api/src/index.ts
@@ -1,4 +1,4 @@
export { MagicString } from '@vue-macros/common'
export * from '@vue-macros/common'

export * from './vue'
export * from './resolve'
Expand Down
33 changes: 0 additions & 33 deletions packages/api/src/ts/create.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/api/src/ts/index.ts
@@ -1,4 +1,3 @@
export * from './create'
export * from './is'
export * from './namespace'
export * from './property'
Expand Down
12 changes: 8 additions & 4 deletions packages/api/src/ts/resolve.ts
@@ -1,4 +1,9 @@
import { resolveLiteral, resolveObjectKey } from '@vue-macros/common'
import {
createStringLiteral,
createTSUnionType,
resolveLiteral,
resolveObjectKey,
} from '@vue-macros/common'
import {
type BigIntLiteral,
type BooleanLiteral,
Expand All @@ -18,7 +23,6 @@ import {
type TemplateElement,
type TemplateLiteral,
} from '@babel/types'
import { createStringLiteral, createUnionType } from './create'
import { isTSNamespace } from './namespace'
import {
type TSProperties,
Expand Down Expand Up @@ -200,7 +204,7 @@ export async function resolveTSIndexedAccessType(
return undefined
}

return { type: createUnionType(types), scope }
return { type: createTSUnionType(types), scope }
} else if (
objectType.type !== 'TSInterfaceDeclaration' &&
objectType.type !== 'TSTypeLiteral' &&
Expand Down Expand Up @@ -268,7 +272,7 @@ export async function resolveTSIndexedAccessType(
if (indexes.length === 0) return undefined
if (optional) indexes.push({ type: 'TSUndefinedKeyword' })

return { type: createUnionType(indexes), scope }
return { type: createTSUnionType(indexes), scope }
}

export async function resolveTSTypeOperator(
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/package.json
Expand Up @@ -55,7 +55,7 @@
"unplugin-vue-macros": "workspace:*"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.3.1",
"@vitejs/plugin-vue": "^4.3.2",
"astro": "^2.10.12"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Expand Up @@ -56,7 +56,7 @@
"@babel/types": "^7.22.10",
"@rollup/pluginutils": "^5.0.3",
"@vue/compiler-sfc": "^3.3.4",
"ast-kit": "^0.9.5",
"ast-kit": "^0.10.0",
"local-pkg": "^0.4.3",
"magic-string-ast": "^0.3.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools/package.json
Expand Up @@ -59,7 +59,7 @@
},
"devDependencies": {
"@unocss/reset": "^0.55.2",
"@vitejs/plugin-vue": "^4.3.1",
"@vitejs/plugin-vue": "^4.3.2",
"get-port": "^7.0.0",
"unocss": "^0.55.2",
"vite": "^4.4.9"
Expand Down
2 changes: 1 addition & 1 deletion packages/reactivity-transform/package.json
Expand Up @@ -87,7 +87,7 @@
"@vue-macros/common": "workspace:*",
"@vue/compiler-core": "^3.3.4",
"@vue/shared": "^3.3.4",
"magic-string": "^0.30.2",
"magic-string": "^0.30.3",
"unplugin": "^1.4.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion playground/vue3/package.json
Expand Up @@ -19,7 +19,7 @@
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-node-resolve": "^15.2.0",
"@vitejs/plugin-vue": "^4.3.1",
"@vitejs/plugin-vue": "^4.3.2",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue-macros/boolean-prop": "workspace:*",
"@vue-macros/short-vmodel": "workspace:*",
Expand Down

0 comments on commit 7128dd5

Please sign in to comment.