Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit14d868c

Browse files
committed
feat: enableisolatedDeclarations
1 parentc14ccee commit14d868c

File tree

190 files changed

+532
-327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+532
-327
lines changed

‎macros/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function getPkgName(filePath: string) {
1212
returnpkgName
1313
}
1414

15-
exportconstgeneratePluginName=defineMacro(function(){
15+
exportconstgeneratePluginName:()=>string=defineMacro(function(){
1616
constpkgName=getPkgName(this.id)
1717
return`unplugin-vue-${pkgName}`
1818
})

‎macros/repo.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
exportconstdocsLink='https://vue-macros.dev'
22
exportconstgithubRepo='vue-macros/vue-macros'
3-
exportconstgithubLink=`https://github.com/${githubRepo}`
3+
exportconstgithubLink:'https://github.com/vue-macros/vue-macros'=`https://github.com/${githubRepo}`

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"tsx":"^4.15.7",
6161
"typescript":"~5.5.2",
6262
"unocss":"^0.61.0",
63-
"unplugin-macros":"^0.13.0",
63+
"unplugin-macros":"^0.13.1",
6464
"unplugin-raw":"^0.2.0",
6565
"vite":"^5.3.1",
6666
"vitest":"^1.6.0",

‎packages/api/src/resolve.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ import { type ResolveTSFileIdImpl, tsFileCache } from './ts'
77
importtype{PluginContext}from'rollup'
88
importtype{ModuleNode,Plugin}from'vite'
99

10-
exportconstdeepImportRE=/^([^@][^/]*)\/|^(@[^/]+\/[^/]+)\//
10+
exportconstdeepImportRE:RegExp=/^([^@][^/]*)\/|^(@[^/]+\/[^/]+)\//
1111

12-
exportconstRollupResolve=()=>{
12+
exportconstRollupResolve=():{
13+
resolve:(ctx:PluginContext)=>ResolveTSFileIdImpl
14+
handleHotUpdate:NonNullable<Plugin['handleHotUpdate']>
15+
}=>{
1316
constreferencedFiles=newMap<
1417
string/* file */,
1518
Set<string/* importer */>

‎packages/api/src/ts/namespace.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { type TSScope, getTSFile, resolveTSScope } from './scope'
66
import{isTSDeclaration}from'./is'
77
import{resolveTSFileId}from'./resolve-file'
88

9-
exportconstnamespaceSymbol=Symbol('namespace')
9+
exportconstnamespaceSymbol:unique symbol=Symbol('namespace')
1010
exporttypeTSNamespace={
1111
[Kinstring]:TSResolvedType|TSNamespace|undefined
1212
}&{[namespaceSymbol]:true}

‎packages/api/src/ts/property.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export async function resolveTSProperties({
206206
}
207207
}
208208

209-
exportfunctiongetTSPropertiesKeys(properties:TSProperties){
209+
exportfunctiongetTSPropertiesKeys(properties:TSProperties):string[]{
210210
return[
211211
...newSet([
212212
...Object.keys(properties.properties),

‎packages/api/src/ts/resolve-file.ts‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ export type ResolveTSFileIdImpl = (
55
id:string,
66
importer:string,
77
)=>Promise<string|undefined>|string|undefined
8-
letresolveTSFileIdImpl:ResolveTSFileIdImpl=resolveTSFileIdNode
9-
exportfunctionresolveTSFileId(id:string,importer:string){
8+
9+
exportconstresolveTSFileId:ResolveTSFileIdImpl=(id,importer)=>{
1010
returnresolveTSFileIdImpl(id,importer)
1111
}
1212

1313
/**
1414
*@limitation don't node_modules and JavaScript file
1515
*/
16-
exportfunctionresolveTSFileIdNode(id:string,importer:string){
16+
exportconstresolveTSFileIdNode:ResolveTSFileIdImpl=(
17+
id:string,
18+
importer:string,
19+
)=>{
1720
functiontryResolve(id:string,importer:string){
1821
constfilePath=path.resolve(importer,'..',id)
1922
if(!existsSync(filePath))return
@@ -29,6 +32,8 @@ export function resolveTSFileIdNode(id: string, importer: string) {
2932
)
3033
}
3134

32-
exportfunctionsetResolveTSFileIdImpl(impl:ResolveTSFileIdImpl){
35+
letresolveTSFileIdImpl:ResolveTSFileIdImpl=resolveTSFileIdNode
36+
37+
exportfunctionsetResolveTSFileIdImpl(impl:ResolveTSFileIdImpl):void{
3338
resolveTSFileIdImpl=impl
3439
}

‎packages/api/src/ts/resolve.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export async function resolveTSLiteralType({
114114
exportfunctionresolveTypeElements(
115115
scope:TSScope,
116116
elements:Array<TSTypeElement>,
117-
){
117+
):TSProperties{
118118
constproperties:TSProperties={
119119
callSignatures:[],
120120
constructSignatures:[],
@@ -278,7 +278,7 @@ export async function resolveTSIndexedAccessType(
278278
exportasyncfunctionresolveTSTypeOperator(
279279
{ scope, type}:TSResolvedType<TSTypeOperator>,
280280
stacks:TSResolvedType<any>[]=[],
281-
){
281+
):Promise<StringLiteral[]|undefined>{
282282
if(type.operator!=='keyof')returnundefined
283283

284284
constresolved=awaitresolveTSReferencedType(

‎packages/api/src/vue/utils.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export async function inferRuntimeType(
136136
return[UNKNOWN_TYPE]
137137
}
138138

139-
exportfunctionattachNodeLoc(node:Node,newNode:Node){
139+
exportfunctionattachNodeLoc(node:Node,newNode:Node):void{
140140
newNode.start=node.start
141141
newNode.end=node.end
142142
}
@@ -145,7 +145,7 @@ export function genRuntimePropDefinition(
145145
types:string[]|undefined,
146146
isProduction:boolean,
147147
properties:string[],
148-
){
148+
):string{
149149
lettype:string|undefined
150150
letskipCheck=false
151151

‎packages/better-define/src/core/index.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import{
2+
typeCodeTransform,
23
DEFINE_EMITS,
34
MagicStringAST,
45
escapeKey,
@@ -17,7 +18,7 @@ export async function transformBetterDefine(
1718
code:string,
1819
id:string,
1920
isProduction=false,
20-
){
21+
):Promise<CodeTransform|undefined>{
2122
consts=newMagicStringAST(code)
2223
constsfc=parseSFC(code,id)
2324
if(!sfc.scriptSetup)return

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp