Skip to content

Commit

Permalink
build: update build dependency & remove wrench (#2125)
Browse files Browse the repository at this point in the history
  • Loading branch information
vthinkxie authored Sep 11, 2018
1 parent 2fde383 commit 3c6215f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 32 deletions.
7 changes: 3 additions & 4 deletions build_scripts/generate-less.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const fs = require('fs');
const fs = require('fs-extra');
const path = require('path');
const wrench = require('wrench');
const less = require('less');
const LessPluginCleanCSS = require('less-plugin-clean-css');

Expand Down Expand Up @@ -29,11 +28,11 @@ let componentsLessContent = '';
targetFolder.forEach(dir => {
if (fs.existsSync(`${sourcePath}/${dir}/style/index.less`)) {
componentsLessContent += `@import "./${path.join(dir, 'style', 'index.less')}";\n`
wrench.copyDirSyncRecursive(`${sourcePath}/${dir}/style`, `${targetPath}/${dir}/style`);
fs.copySync(`${sourcePath}/${dir}/style`, `${targetPath}/${dir}/style`);
}
}
)
wrench.copyDirSyncRecursive(path.resolve(sourcePath, 'style'), path.resolve(targetPath, 'style'));
fs.copySync(path.resolve(sourcePath, 'style'), path.resolve(targetPath, 'style'));
fs.writeFileSync(`${targetPath}/components.less`, componentsLessContent);
fs.writeFileSync(`${targetPath}/ng-zorro-antd.less`, fs.readFileSync(`${sourcePath}/ng-zorro-antd.less`));

Expand Down
41 changes: 20 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"schematic:tsc": "tsc -p schematics/tsconfig.json",
"schematic:build": "node ./schematics_script/set-theme.js && node ./schematics_script/set-version.js && npm run schematic:tsc && node schematics_script/copy-resources",
"ng": "ng",
"start": "ng serve -p 0",
"start": "ng serve -port 0",
"build": "node site_scripts/generate-site init && ng build",
"doc": "npm run site:init && node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build --prod --build-optimizer",
"helper": "bash ./release-helper.sh",
Expand Down Expand Up @@ -52,44 +52,48 @@
"date-fns": "^1.29.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.6.0",
"@angular-devkit/build-angular": "~0.8.0",
"@angular/cli": "~6.2.1",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.3.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~2.9.2",
"@angular-devkit/core": "^0.6.0",
"@angular-devkit/schematics": "^0.6.0",
"@angular/animations": "^6.0.0",
"@angular/cli": "~6.0.0",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/compiler-cli": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/language-service": "^6.0.0",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/router": "^6.0.0",
"@schematics/angular": "^0.6.0",
"@stackblitz/sdk": "^1.1.1",
"@types/hammerjs": "^2.0.35",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"antd-theme-generator": "^1.0.7",
"chalk": "^2.4.1",
"classlist.js": "^1.1.20150312",
"codecov": "^3.0.0",
"codelyzer": "~4.2.1",
"conventional-changelog-cli": "^2.0.1",
"core-js": "^2.5.4",
"fs-extra": "^6.0.1",
"hammerjs": "^2.0.8",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "~1.4.2",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"less": "^2.7.3",
"less-plugin-clean-css": "^1.5.1",
"marked": "^0.3.6",
Expand All @@ -98,7 +102,6 @@
"node-prismjs": "^0.1.1",
"parse5": "^4.0.0",
"prismjs": "^1.10.0",
"protractor": "~5.3.0",
"readline-sync": "^1.4.9",
"remark": "^8.0.0",
"rollup": "^0.49.2",
Expand All @@ -107,11 +110,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-uglify": "^2.0.1",
"rxjs": "^6.0.0",
"ts-node": "~5.0.1",
"tslib": "^1.9.0",
"tslint": "~5.9.1",
"typescript": "~2.7.2",
"wrench": "^1.5.9",
"yaml-front-matter": "^3.4.0",
"zone.js": "^0.8.26"
},
Expand Down
13 changes: 6 additions & 7 deletions site_scripts/generate-site.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const fs = require('fs');
const fs = require('fs-extra');
const path = require('path');
const wrench = require('wrench');
const parseDocMdUtil = require('./utils/parse-doc-md');
const parseDemoMdUtil = require('./utils/parse-demo-md');
const nameWithoutSuffixUtil = require('./utils/name-without-suffix');
Expand All @@ -15,13 +14,13 @@ const isSyncSpecific = target && (target !== 'init');
const showCasePath = path.resolve(__dirname, '../site');

if (!target) {
wrench.rmdirSyncRecursive(`${showCasePath}/src`, true);
wrench.copyDirSyncRecursive(path.resolve(__dirname, '_site/src'), `${showCasePath}/src`);
fs.removeSync(`${showCasePath}/src`);
fs.copySync(path.resolve(__dirname, '_site/src'), `${showCasePath}/src`);
} else if (target === 'init') {
wrench.rmdirSyncRecursive(`${showCasePath}`, true);
wrench.copyDirSyncRecursive(path.resolve(__dirname, '_site'), `${showCasePath}`);
fs.removeSync(`${showCasePath}`);
fs.copySync(path.resolve(__dirname, '_site'), `${showCasePath}`);
} else {
wrench.rmdirSyncRecursive(`${showCasePath}/src/app/${target}`, true);
fs.removeSync(`${showCasePath}/src/app/${target}`);
}
const showCaseTargetPath = `${showCasePath}/src/app/`;
// 读取components文件夹
Expand Down

0 comments on commit 3c6215f

Please sign in to comment.