mirror of
https://github.com/tenrok/axios.git
synced 2026-05-27 14:47:43 +03:00
@@ -0,0 +1,42 @@
|
||||
import fs from 'fs';
|
||||
import assert from 'assert';
|
||||
import axios from '../index.js';
|
||||
import axiosBuild from '../dist/node/axios.cjs';
|
||||
import inquirer from 'inquirer';
|
||||
|
||||
const {version, name} = JSON.parse(fs.readFileSync('./package.json'));
|
||||
|
||||
console.log('Checking versions...\n----------------------------')
|
||||
|
||||
console.log(`Package version: v${version}`);
|
||||
console.log(`Axios version: v${axios.VERSION}`);
|
||||
console.log(`Axios build version: v${axiosBuild.VERSION}`);
|
||||
console.log(`----------------------------`);
|
||||
|
||||
assert.strictEqual(version, axios.VERSION, `Version mismatch between package and Axios`);
|
||||
assert.strictEqual(version, axiosBuild.VERSION, `Version mismatch between package and build`);
|
||||
|
||||
console.log('PASSED\n');
|
||||
|
||||
const choices = [
|
||||
`Yes, let's release Axios v${version} to npm`,
|
||||
`No, don't do an npm release - I'll do it myself`
|
||||
];
|
||||
|
||||
inquirer
|
||||
.prompt([
|
||||
{
|
||||
type: 'list',
|
||||
name: 'release',
|
||||
message: `You have requested an npm release for ${name.toUpperCase()} v${version}. Are you sure?`,
|
||||
choices
|
||||
}
|
||||
])
|
||||
.then((answers) => {
|
||||
if (choices.indexOf(answers.release)) {
|
||||
console.warn('terminate...');
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Generated
+10956
-169
File diff suppressed because it is too large
Load Diff
+42
-4
@@ -30,15 +30,22 @@
|
||||
"test:exports": "node bin/ssl_hotfix.js mocha test/module/test.js --timeout 30000 --exit",
|
||||
"test:karma": "node bin/ssl_hotfix.js cross-env LISTEN_ADDR=:: karma start karma.conf.cjs --single-run",
|
||||
"test:karma:server": "node bin/ssl_hotfix.js cross-env karma start karma.conf.cjs",
|
||||
"test:build:version": "node ./bin/check-build-version.js",
|
||||
"start": "node ./sandbox/server.js",
|
||||
"preversion": "gulp version && npm test",
|
||||
"version": "npm run build && git add dist && git add package.json",
|
||||
"prepublishOnly": "npm test",
|
||||
"prepublishOnly": "npm run test:build:version",
|
||||
"postpublish": "git push && git push --tags",
|
||||
"build": "gulp clear && cross-env NODE_ENV=production rollup -c -m",
|
||||
"examples": "node ./examples/server.js",
|
||||
"coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
|
||||
"fix": "eslint --fix lib/**/*.js"
|
||||
"fix": "eslint --fix lib/**/*.js",
|
||||
"prepare": "husky install && npm run prepare:hooks",
|
||||
"prepare:hooks": "npx husky add .husky/commit-msg \"npx commitlint --edit $1\"",
|
||||
"release:dry": "release-it --dry-run",
|
||||
"release:info": "release-it --release-version",
|
||||
"prerelease": "release-it --preRelease=beta",
|
||||
"release": "release-it"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -60,6 +67,9 @@
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.18.2",
|
||||
"@babel/preset-env": "^7.18.2",
|
||||
"@commitlint/cli": "^17.3.0",
|
||||
"@commitlint/config-conventional": "^17.3.0",
|
||||
"@release-it/conventional-changelog": "^5.1.1",
|
||||
"@rollup/plugin-babel": "^5.3.1",
|
||||
"@rollup/plugin-commonjs": "^15.1.0",
|
||||
"@rollup/plugin-json": "^4.1.0",
|
||||
@@ -78,6 +88,8 @@
|
||||
"fs-extra": "^10.1.0",
|
||||
"get-stream": "^3.0.0",
|
||||
"gulp": "^4.0.2",
|
||||
"husky": "^8.0.2",
|
||||
"inquirer": "^9.1.4",
|
||||
"istanbul-instrumenter-loader": "^3.0.1",
|
||||
"jasmine-core": "^2.4.1",
|
||||
"karma": "^6.3.17",
|
||||
@@ -93,6 +105,7 @@
|
||||
"minimist": "^1.2.6",
|
||||
"mocha": "^10.0.0",
|
||||
"multer": "^1.4.4",
|
||||
"release-it": "^15.5.1",
|
||||
"rollup": "^2.67.0",
|
||||
"rollup-plugin-auto-external": "^2.0.0",
|
||||
"rollup-plugin-bundle-size": "^1.0.3",
|
||||
@@ -137,5 +150,30 @@
|
||||
"Ben Carp (https://github.com/carpben)",
|
||||
"Daniel Lopretto (https://github.com/timemachine3030)"
|
||||
],
|
||||
"sideEffects": false
|
||||
}
|
||||
"sideEffects": false,
|
||||
"release-it": {
|
||||
"github": {
|
||||
"release": true
|
||||
},
|
||||
"npm": {
|
||||
"publish": true,
|
||||
"ignoreVersion": false
|
||||
},
|
||||
"plugins": {
|
||||
"@release-it/conventional-changelog": {
|
||||
"preset": "angular",
|
||||
"infile": "CHANGELOG.md"
|
||||
}
|
||||
},
|
||||
"hooks": {
|
||||
"before:init": "npm test",
|
||||
"after:bump": "npm run build",
|
||||
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
|
||||
}
|
||||
},
|
||||
"commitlint": {
|
||||
"extends": [
|
||||
"@commitlint/config-conventional"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user