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

Commitefa3950

Browse files
committed
refactor: remove dependency on @vue/compiler-sfc
So that users won't be bothered by the peer dependency warning even ifnpm did the wrong hoistingFixesvuejs/vue-cli#5940
1 parentea7fe31 commitefa3950

File tree

6 files changed

+1930
-1953
lines changed

6 files changed

+1930
-1953
lines changed

‎bin/vue-codemod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const { _: files, transformation: transformationName, params } = yargs
3131

3232
// TODO: port the `Runner` interface of jscodeshift
3333
asyncfunctionmain(){
34-
constresolvedPaths=globby.sync(files)
34+
constresolvedPaths=globby.sync(filesasstring[])
3535
consttransformationModule=loadTransformationModule(transformationName)
3636

3737
log(`Processing${resolvedPaths.length} files…`)

‎package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@
2323
"dependencies": {
2424
"@babel/core":"^7.10.3",
2525
"@babel/preset-env":"^7.10.3",
26+
"@babel/types":"^7.12.12",
2627
"@types/jscodeshift":"^0.7.1",
27-
"@vue/compiler-sfc":"^3.0.0-beta.15",
28+
"@vue/compiler-core":"^3.0.4",
29+
"@vue/compiler-dom":"^3.0.4",
2830
"debug":"^4.1.1",
2931
"globby":"^10.0.2",
3032
"inquirer":"^7.0.3",
3133
"jscodeshift":"^0.10.0",
32-
"vue":"^3.0.0-beta.15",
34+
"lru-cache":"^6.0.0",
35+
"source-map":"^0.6.1",
3336
"yargs":"^15.3.1"
3437
},
3538
"devDependencies": {

‎src/runTransformation.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
importjscodeshift,{Transform,Parser}from'jscodeshift'
22
//@ts-ignore
33
importgetParserfrom'jscodeshift/src/getParser'
4-
import{parseasparseSFC,SFCDescriptor}from'@vue/compiler-sfc'
5-
importstringifySFCDescriptorfrom'./stringify-sfc-descriptor'
64
importcreateDebugfrom'debug'
75

6+
import{parseasparseSFC,stringifyasstringifySFC}from'./sfcUtils'
7+
importtype{SFCDescriptor}from'./sfcUtils'
8+
89
importVueTransformationfrom'./VueTransformation'
910

1011
constdebug=createDebug('vue-codemod')
@@ -105,7 +106,7 @@ export default function runTransformation(
105106
}
106107

107108
descriptor!.script!.content=out
108-
returnstringifySFCDescriptor(descriptor!)
109+
returnstringifySFC(descriptor!)
109110
}
110111

111112
returnout

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp