chore: update npm publish script
parent
68a9472ac1
commit
dc6acbb271
|
@ -0,0 +1,3 @@
|
|||
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
|
||||
loglevel=info
|
||||
registry=https://registry.npmjs.org/
|
|
@ -5,8 +5,10 @@ node_js:
|
|||
before_script:
|
||||
- npm install vue vue-template-compiler
|
||||
script:
|
||||
- cp ./scripts/.npmrc.template $HOME/.npmrc
|
||||
- COVERAGE=true npm run test
|
||||
- npm run codecov
|
||||
- npm run pub-with-ci
|
||||
- bash ./scripts/deploy-to-gh-pages.sh
|
||||
env:
|
||||
matrix:
|
||||
|
|
|
@ -25,6 +25,7 @@ const fs = require('fs')
|
|||
const rimraf = require('rimraf')
|
||||
const replaceLib = require('./replaceLib')
|
||||
const stripCode = require('gulp-strip-code')
|
||||
const compareVersions = require('compare-versions')
|
||||
|
||||
const cwd = process.cwd()
|
||||
const libDir = path.join(cwd, 'lib')
|
||||
|
@ -173,7 +174,6 @@ function githubRelease () {
|
|||
const [_, owner, repo] = execSync('git remote get-url origin') // eslint-disable-line
|
||||
.toString()
|
||||
.match(/github.com[:/](.+)\/(.+)\.git/)
|
||||
|
||||
github.repos.createRelease({
|
||||
owner,
|
||||
repo,
|
||||
|
@ -236,6 +236,9 @@ function pub (done) {
|
|||
}
|
||||
})
|
||||
}
|
||||
// gulp.task('test', () => {
|
||||
// githubRelease()
|
||||
// })
|
||||
|
||||
gulp.task('dist', ['compile'], (done) => {
|
||||
dist(done)
|
||||
|
@ -261,6 +264,43 @@ gulp.task('pub', ['check-git', 'compile'], (done) => {
|
|||
}
|
||||
})
|
||||
|
||||
gulp.task('pub-with-ci', (done) => {
|
||||
if (process.env.NPM_TOKEN) {
|
||||
console.log('NPM token found, skip')
|
||||
} else {
|
||||
const github = new GitHub()
|
||||
github.authenticate({
|
||||
type: 'oauth',
|
||||
token: process.env.GITHUB_TOKEN,
|
||||
})
|
||||
const [_, owner, repo] = execSync('git remote get-url origin') // eslint-disable-line
|
||||
.toString()
|
||||
.match(/github.com[:/](.+)\/(.+)\.git/)
|
||||
const getLatestRelease = github.repos.getLatestRelease({
|
||||
owner,
|
||||
repo,
|
||||
})
|
||||
const getCommits = github.repos.getCommits({
|
||||
owner,
|
||||
repo,
|
||||
per_page: 1,
|
||||
})
|
||||
Promise.all([getLatestRelease, getCommits]).then(([latestRelease, commits]) => {
|
||||
const preVersion = latestRelease.data.tag_name
|
||||
const { version } = packageJson
|
||||
const [_, newVersion] = commits.data[0].commit.message.trim().match(/bump (.+)/) || []
|
||||
if (compareVersions(version, preVersion) === 1 && newVersion && newVersion.trim() === version) {
|
||||
gulp.run('pub', (err) => {
|
||||
err && console.log('err', err)
|
||||
done()
|
||||
})
|
||||
} else {
|
||||
console.log('donot need publish' + version)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
function reportError () {
|
||||
console.log(chalk.bgRed('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'))
|
||||
console.log(chalk.bgRed('!! `npm publish` is forbidden for this package. !!'))
|
||||
|
|
348
package.json
348
package.json
|
@ -1,175 +1,177 @@
|
|||
{
|
||||
"name": "vue-antd-ui",
|
||||
"version": "0.7.1",
|
||||
"title": "Ant Design Vue",
|
||||
"description": "An enterprise-class UI design language and Vue-based implementation",
|
||||
"keywords": [
|
||||
"ant",
|
||||
"design",
|
||||
"antd",
|
||||
"vue",
|
||||
"vueComponent",
|
||||
"component",
|
||||
"components",
|
||||
"ui",
|
||||
"framework",
|
||||
"frontend"
|
||||
],
|
||||
"main": "dist/antd.min.js",
|
||||
"files": [
|
||||
"dist",
|
||||
"lib",
|
||||
"es"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "NODE_ENV=development ENTRY_INDEX=dev ./node_modules/.bin/webpack-dev-server --open --hot --port 3001",
|
||||
"start": "NODE_ENV=development ./node_modules/.bin/webpack-dev-server --open --hot",
|
||||
"test": "jest --config .jest.js",
|
||||
"site": "node scripts/run.js site-dist",
|
||||
"copy": "node scripts/run.js copy-html",
|
||||
"compile": "node antd-tools/cli/run.js compile",
|
||||
"pub": "node antd-tools/cli/run.js pub",
|
||||
"prepublish": "node antd-tools/cli/run.js guard",
|
||||
"pre-publish": "npm run test && node ./scripts/prepub",
|
||||
"dist": "node antd-tools/cli/run.js dist",
|
||||
"lint": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue ./components",
|
||||
"lint:style": "stylelint \"./examples/**/*.less\" --fix --syntax less",
|
||||
"commitmsg": "commitlint -x @commitlint/config-conventional -e $GIT_PARAMS",
|
||||
"codecov": "codecov"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vueComponent/ant-design.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vueComponent/ant-design/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vueComponent/ant-design",
|
||||
"pre-commit": [
|
||||
"lint:style",
|
||||
"lint"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"vue": ">=2.5.0",
|
||||
"vue-template-compiler": ">=2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^6.2.0",
|
||||
"@commitlint/config-conventional": "^6.1.3",
|
||||
"@octokit/rest": "^15.4.1",
|
||||
"@vue/server-test-utils": "1.0.0-beta.16",
|
||||
"@vue/test-utils": "1.0.0-beta.16",
|
||||
"autoprefixer": "^8.1.0",
|
||||
"babel-cli": "^6.26.0",
|
||||
"babel-core": "^6.26.0",
|
||||
"babel-eslint": "^8.0.1",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||
"babel-jest": "^22.4.3",
|
||||
"babel-loader": "^7.1.2",
|
||||
"babel-plugin-add-module-exports": "^0.2.1",
|
||||
"babel-plugin-import": "^1.1.1",
|
||||
"babel-plugin-istanbul": "^4.1.1",
|
||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
||||
"babel-plugin-syntax-jsx": "^6.18.0",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"babel-plugin-transform-decorators": "^6.24.1",
|
||||
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
||||
"babel-plugin-transform-es3-member-expression-literals": "^6.22.0",
|
||||
"babel-plugin-transform-es3-property-literals": "^6.22.0",
|
||||
"babel-plugin-transform-object-assign": "^6.22.0",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-plugin-transform-runtime": "~6.23.0",
|
||||
"babel-plugin-transform-vue-jsx": "^3.7.0",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"case-sensitive-paths-webpack-plugin": "^2.1.2",
|
||||
"chalk": "^2.3.2",
|
||||
"cheerio": "^1.0.0-rc.2",
|
||||
"codecov": "^3.0.0",
|
||||
"colorful": "^2.1.0",
|
||||
"commander": "^2.15.0",
|
||||
"cross-env": "^5.1.4",
|
||||
"css-loader": "^0.28.7",
|
||||
"deep-assign": "^2.0.0",
|
||||
"eslint": "^4.7.2",
|
||||
"eslint-plugin-html": "^3.2.2",
|
||||
"eslint-plugin-vue": "^3.13.0",
|
||||
"eslint-plugin-vue-libs": "^1.2.1",
|
||||
"extract-text-webpack-plugin": "^3.0.2",
|
||||
"fetch-jsonp": "^1.1.3",
|
||||
"glob": "^7.1.2",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-babel": "^7.0.0",
|
||||
"gulp-strip-code": "^0.1.4",
|
||||
"highlight.js": "^9.12.0",
|
||||
"html-webpack-plugin": "^2.30.1",
|
||||
"husky": "^0.14.3",
|
||||
"istanbul-instrumenter-loader": "^3.0.0",
|
||||
"jest": "^22.4.3",
|
||||
"jest-serializer-vue": "^1.0.0",
|
||||
"jsonp": "^0.2.1",
|
||||
"less": "^2.7.2",
|
||||
"less-loader": "^4.0.5",
|
||||
"less-plugin-npm-import": "^2.1.0",
|
||||
"markdown-it": "^8.4.0",
|
||||
"markdown-it-anchor": "^4.0.0",
|
||||
"marked": "^0.3.7",
|
||||
"merge2": "^1.2.1",
|
||||
"minimist": "^1.2.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"mockdate": "^2.0.2",
|
||||
"moment-timezone": "^0.5.17",
|
||||
"nprogress": "^0.2.0",
|
||||
"postcss": "^6.0.20",
|
||||
"postcss-loader": "^2.1.2",
|
||||
"pre-commit": "^1.2.2",
|
||||
"querystring": "^0.2.0",
|
||||
"raw-loader": "^1.0.0-beta.0",
|
||||
"reqwest": "^2.0.5",
|
||||
"rimraf": "^2.6.2",
|
||||
"rucksack-css": "^1.0.2",
|
||||
"selenium-server": "^3.0.1",
|
||||
"semver": "^5.3.0",
|
||||
"style-loader": "^0.18.2",
|
||||
"stylelint": "^8.1.1",
|
||||
"stylelint-config-standard": "^17.0.0",
|
||||
"through2": "^2.0.3",
|
||||
"vue": "^2.5.16",
|
||||
"vue-antd-md-loader": "^1.0.3",
|
||||
"vue-clipboard2": "0.0.8",
|
||||
"vue-infinite-scroll": "^2.0.2",
|
||||
"vue-jest": "^2.5.0",
|
||||
"vue-loader": "^13.0.5",
|
||||
"vue-router": "^3.0.1",
|
||||
"vue-server-renderer": "^2.5.16",
|
||||
"vue-template-compiler": "^2.5.16",
|
||||
"vue-virtual-scroller": "^0.12.0",
|
||||
"webpack": "^3.11.0",
|
||||
"webpack-chunk-hash": "^0.5.0",
|
||||
"webpack-dev-server": "^2.8.2",
|
||||
"webpack-merge": "^4.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"add-dom-event-listener": "^1.0.2",
|
||||
"array-tree-filter": "^2.1.0",
|
||||
"async-validator": "^1.8.2",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||
"babel-runtime": "6.x",
|
||||
"classnames": "^2.2.5",
|
||||
"component-classes": "^1.2.6",
|
||||
"dom-align": "^1.6.7",
|
||||
"dom-closest": "^0.2.0",
|
||||
"dom-scroll-into-view": "^1.2.1",
|
||||
"enquire.js": "^2.1.6",
|
||||
"json2mq": "^0.2.0",
|
||||
"is-negative-zero": "^2.0.0",
|
||||
"lodash": "^4.17.5",
|
||||
"moment": "^2.21.0",
|
||||
"omit.js": "^1.0.0",
|
||||
"resize-observer-polyfill": "^1.5.0",
|
||||
"shallow-equal": "^1.0.0",
|
||||
"shallowequal": "^1.0.2",
|
||||
"warning": "^3.0.0"
|
||||
}
|
||||
"name": "vue-antd-ui",
|
||||
"version": "0.7.1",
|
||||
"title": "Ant Design Vue",
|
||||
"description": "An enterprise-class UI design language and Vue-based implementation",
|
||||
"keywords": [
|
||||
"ant",
|
||||
"design",
|
||||
"antd",
|
||||
"vue",
|
||||
"vueComponent",
|
||||
"component",
|
||||
"components",
|
||||
"ui",
|
||||
"framework",
|
||||
"frontend"
|
||||
],
|
||||
"main": "dist/antd.min.js",
|
||||
"files": [
|
||||
"dist",
|
||||
"lib",
|
||||
"es"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "NODE_ENV=development ENTRY_INDEX=dev ./node_modules/.bin/webpack-dev-server --open --hot --port 3001",
|
||||
"start": "NODE_ENV=development ./node_modules/.bin/webpack-dev-server --open --hot",
|
||||
"test": "jest --config .jest.js",
|
||||
"site": "node scripts/run.js site-dist",
|
||||
"copy": "node scripts/run.js copy-html",
|
||||
"compile": "node antd-tools/cli/run.js compile",
|
||||
"pub": "node antd-tools/cli/run.js pub",
|
||||
"pub-with-ci": "node antd-tools/cli/run.js pub-with-ci",
|
||||
"prepublish": "node antd-tools/cli/run.js guard",
|
||||
"pre-publish": "node ./scripts/prepub",
|
||||
"dist": "node antd-tools/cli/run.js dist",
|
||||
"lint": "eslint -c ./.eslintrc --fix --ext .jsx,.js,.vue ./components",
|
||||
"lint:style": "stylelint \"./examples/**/*.less\" --fix --syntax less",
|
||||
"commitmsg": "commitlint -x @commitlint/config-conventional -e $GIT_PARAMS",
|
||||
"codecov": "codecov"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vueComponent/ant-design.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vueComponent/ant-design/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vueComponent/ant-design",
|
||||
"pre-commit": [
|
||||
"lint:style",
|
||||
"lint"
|
||||
],
|
||||
"peerDependencies": {
|
||||
"vue": ">=2.5.0",
|
||||
"vue-template-compiler": ">=2.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^6.2.0",
|
||||
"@commitlint/config-conventional": "^6.1.3",
|
||||
"@octokit/rest": "^15.4.1",
|
||||
"@vue/server-test-utils": "1.0.0-beta.16",
|
||||
"@vue/test-utils": "1.0.0-beta.16",
|
||||
"autoprefixer": "^8.1.0",
|
||||
"babel-cli": "^6.26.0",
|
||||
"babel-core": "^6.26.0",
|
||||
"babel-eslint": "^8.0.1",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||
"babel-jest": "^22.4.3",
|
||||
"babel-loader": "^7.1.2",
|
||||
"babel-plugin-add-module-exports": "^0.2.1",
|
||||
"babel-plugin-import": "^1.1.1",
|
||||
"babel-plugin-istanbul": "^4.1.1",
|
||||
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
||||
"babel-plugin-syntax-jsx": "^6.18.0",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"babel-plugin-transform-decorators": "^6.24.1",
|
||||
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
||||
"babel-plugin-transform-es3-member-expression-literals": "^6.22.0",
|
||||
"babel-plugin-transform-es3-property-literals": "^6.22.0",
|
||||
"babel-plugin-transform-object-assign": "^6.22.0",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"babel-plugin-transform-runtime": "~6.23.0",
|
||||
"babel-plugin-transform-vue-jsx": "^3.7.0",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"case-sensitive-paths-webpack-plugin": "^2.1.2",
|
||||
"chalk": "^2.3.2",
|
||||
"cheerio": "^1.0.0-rc.2",
|
||||
"codecov": "^3.0.0",
|
||||
"colorful": "^2.1.0",
|
||||
"commander": "^2.15.0",
|
||||
"compare-versions": "^3.3.0",
|
||||
"cross-env": "^5.1.4",
|
||||
"css-loader": "^0.28.7",
|
||||
"deep-assign": "^2.0.0",
|
||||
"eslint": "^4.7.2",
|
||||
"eslint-plugin-html": "^3.2.2",
|
||||
"eslint-plugin-vue": "^3.13.0",
|
||||
"eslint-plugin-vue-libs": "^1.2.1",
|
||||
"extract-text-webpack-plugin": "^3.0.2",
|
||||
"fetch-jsonp": "^1.1.3",
|
||||
"glob": "^7.1.2",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-babel": "^7.0.0",
|
||||
"gulp-strip-code": "^0.1.4",
|
||||
"highlight.js": "^9.12.0",
|
||||
"html-webpack-plugin": "^2.30.1",
|
||||
"husky": "^0.14.3",
|
||||
"istanbul-instrumenter-loader": "^3.0.0",
|
||||
"jest": "^22.4.3",
|
||||
"jest-serializer-vue": "^1.0.0",
|
||||
"jsonp": "^0.2.1",
|
||||
"less": "^2.7.2",
|
||||
"less-loader": "^4.0.5",
|
||||
"less-plugin-npm-import": "^2.1.0",
|
||||
"markdown-it": "^8.4.0",
|
||||
"markdown-it-anchor": "^4.0.0",
|
||||
"marked": "^0.3.7",
|
||||
"merge2": "^1.2.1",
|
||||
"minimist": "^1.2.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"mockdate": "^2.0.2",
|
||||
"moment-timezone": "^0.5.17",
|
||||
"nprogress": "^0.2.0",
|
||||
"postcss": "^6.0.20",
|
||||
"postcss-loader": "^2.1.2",
|
||||
"pre-commit": "^1.2.2",
|
||||
"querystring": "^0.2.0",
|
||||
"raw-loader": "^1.0.0-beta.0",
|
||||
"reqwest": "^2.0.5",
|
||||
"rimraf": "^2.6.2",
|
||||
"rucksack-css": "^1.0.2",
|
||||
"selenium-server": "^3.0.1",
|
||||
"semver": "^5.3.0",
|
||||
"style-loader": "^0.18.2",
|
||||
"stylelint": "^8.1.1",
|
||||
"stylelint-config-standard": "^17.0.0",
|
||||
"through2": "^2.0.3",
|
||||
"vue": "^2.5.16",
|
||||
"vue-antd-md-loader": "^1.0.3",
|
||||
"vue-clipboard2": "0.0.8",
|
||||
"vue-infinite-scroll": "^2.0.2",
|
||||
"vue-jest": "^2.5.0",
|
||||
"vue-loader": "^13.0.5",
|
||||
"vue-router": "^3.0.1",
|
||||
"vue-server-renderer": "^2.5.16",
|
||||
"vue-template-compiler": "^2.5.16",
|
||||
"vue-virtual-scroller": "^0.12.0",
|
||||
"webpack": "^3.11.0",
|
||||
"webpack-chunk-hash": "^0.5.0",
|
||||
"webpack-dev-server": "^2.8.2",
|
||||
"webpack-merge": "^4.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"add-dom-event-listener": "^1.0.2",
|
||||
"array-tree-filter": "^2.1.0",
|
||||
"async-validator": "^1.8.2",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||
"babel-runtime": "6.x",
|
||||
"classnames": "^2.2.5",
|
||||
"component-classes": "^1.2.6",
|
||||
"dom-align": "^1.6.7",
|
||||
"dom-closest": "^0.2.0",
|
||||
"dom-scroll-into-view": "^1.2.1",
|
||||
"enquire.js": "^2.1.6",
|
||||
"json2mq": "^0.2.0",
|
||||
"is-negative-zero": "^2.0.0",
|
||||
"lodash": "^4.17.5",
|
||||
"moment": "^2.21.0",
|
||||
"omit.js": "^1.0.0",
|
||||
"resize-observer-polyfill": "^1.5.0",
|
||||
"shallow-equal": "^1.0.0",
|
||||
"shallowequal": "^1.0.2",
|
||||
"warning": "^3.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
|
||||
loglevel=info
|
||||
registry=https://registry.npmjs.org/
|
Loading…
Reference in New Issue