Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs with edge case for building Staging environment with npm #5640

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: replace jscodeshift with vue-codemod (#5629)
  • Loading branch information
haoqunjiang authored Jul 1, 2020
commit 7f56846a2e54ee5b748232e8b5ae2411a147416d
1 change: 0 additions & 1 deletion packages/@vue/cli-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
}
},
"devDependencies": {
"@vue/compiler-sfc": "^3.0.0-beta.14",
"fibers": ">= 3.1.1 <5.0.0",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
Expand Down
10 changes: 5 additions & 5 deletions packages/@vue/cli/lib/Generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const sortObject = require('./util/sortObject')
const writeFileTree = require('./util/writeFileTree')
const inferRootOptions = require('./util/inferRootOptions')
const normalizeFilePaths = require('./util/normalizeFilePaths')
const runCodemod = require('./util/runCodemod')
const { runTransformation } = require('vue-codemod')
const {
semver,

Expand Down Expand Up @@ -277,19 +277,19 @@ module.exports = class Generator {
let imports = this.imports[file]
imports = imports instanceof Set ? Array.from(imports) : imports
if (imports && imports.length > 0) {
files[file] = runCodemod(
require('./util/codemods/injectImports'),
files[file] = runTransformation(
{ path: file, source: files[file] },
require('./util/codemods/injectImports'),
{ imports }
)
}

let injections = this.rootOptions[file]
injections = injections instanceof Set ? Array.from(injections) : injections
if (injections && injections.length > 0) {
files[file] = runCodemod(
require('./util/codemods/injectOptions'),
files[file] = runTransformation(
{ path: file, source: files[file] },
require('./util/codemods/injectOptions'),
{ injections }
)
}
Expand Down
6 changes: 3 additions & 3 deletions packages/@vue/cli/lib/GeneratorAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const deepmerge = require('deepmerge')
const resolve = require('resolve')
const { isBinaryFileSync } = require('isbinaryfile')
const mergeDeps = require('./util/mergeDeps')
const runCodemod = require('./util/runCodemod')
const { runTransformation } = require('vue-codemod')
const stringifyJS = require('./util/stringifyJS')
const ConfigTransform = require('./ConfigTransform')
const { semver, error, getPluginLink, toShortPluginId, loadModule } = require('@vue/cli-shared-utils')
Expand Down Expand Up @@ -395,12 +395,12 @@ class GeneratorAPI {
return
}

files[normalizedPath] = runCodemod(
codemod,
files[normalizedPath] = runTransformation(
{
path: this.resolve(normalizedPath),
source: files[normalizedPath]
},
codemod,
options
)
})
Expand Down
30 changes: 0 additions & 30 deletions packages/@vue/cli/lib/util/runCodemod.js

This file was deleted.

4 changes: 1 addition & 3 deletions packages/@vue/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"access": "public"
},
"dependencies": {
"@babel/preset-env": "^7.9.6",
"@vue/cli-shared-utils": "^4.4.6",
"@vue/cli-ui": "^4.4.6",
"@vue/cli-ui-addon-webpack": "^4.4.6",
Expand All @@ -45,7 +44,6 @@
"isbinaryfile": "^4.0.6",
"javascript-stringify": "^1.6.0",
"js-yaml": "^3.13.1",
"jscodeshift": "^0.10.0",
"leven": "^3.1.0",
"lodash.clonedeep": "^4.5.0",
"lru-cache": "^5.1.1",
Expand All @@ -56,7 +54,7 @@
"slash": "^3.0.0",
"validate-npm-package-name": "^3.0.0",
"vue": "^2.6.11",
"vue-jscodeshift-adapter": "^2.1.0",
"vue-codemod": "^0.0.4",
"yaml-front-matter": "^3.4.1"
},
"engines": {
Expand Down
Loading