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