fix(cli): yeoman create failed

This commit is contained in:
chenjiahan 2020-03-08 08:08:35 +08:00
parent bd335b2931
commit b62b9d0311
3 changed files with 666 additions and 422 deletions

View File

@ -24,17 +24,19 @@
"author": "chenjiahan", "author": "chenjiahan",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"@types/fs-extra": "^8.0.1", "@types/fs-extra": "^8.1.0",
"@types/yeoman-environment": "^2.3.3",
"@types/yeoman-generator": "^3.1.4", "@types/yeoman-generator": "^3.1.4",
"release-it": "^12.4.3", "release-it": "^13.0.0",
"typescript": "^3.7.4" "typescript": "^3.8.3"
}, },
"dependencies": { "dependencies": {
"chalk": "^3.0.0", "chalk": "^3.0.0",
"consola": "^2.11.3", "consola": "^2.11.3",
"fs-extra": "^8.1.0", "fs-extra": "^8.1.0",
"inquirer": "^7.0.3", "inquirer": "^7.0.6",
"yeoman-generator": "^4.4.0" "yeoman-environment": "^2.8.0",
"yeoman-generator": "^4.6.0"
}, },
"release-it": { "release-it": {
"git": { "git": {

View File

@ -2,6 +2,7 @@ import chalk from 'chalk';
import consola from 'consola'; import consola from 'consola';
import { join } from 'path'; import { join } from 'path';
import { CWD, GENERATOR_DIR } from './constant'; import { CWD, GENERATOR_DIR } from './constant';
import Yeoman from 'yeoman-environment';
import Generator from 'yeoman-generator'; import Generator from 'yeoman-generator';
const TEMPLATES = join(GENERATOR_DIR, 'templates'); const TEMPLATES = join(GENERATOR_DIR, 'templates');
@ -23,9 +24,9 @@ export class VanGenerator extends Generator {
constructor(name: string) { constructor(name: string) {
super([], { super([], {
env: { env: Yeoman.createEnv([], {
cwd: join(CWD, name), cwd: join(CWD, name),
}, }),
resolved: GENERATOR_DIR, resolved: GENERATOR_DIR,
}); });

File diff suppressed because it is too large Load Diff