Browse Source

chore: add version script

pull/228/head
Ned Zimmerman 5 years ago
parent
commit
ca275473b3
  1. 19
      .versionrc.js
  2. 0
      CHANGELOG.md
  3. 10
      bin/version-readme.js
  4. 10
      bin/version-style.js
  5. 1649
      package-lock.json
  6. 4
      package.json

19
.versionrc.js

@ -0,0 +1,19 @@
module.exports = {
"scripts": {
postbump: "composer readme"
},
"skip": {
commit: true,
tag: true
},
"bumpFiles": [
{
filename: "style.css",
updater: "bin/version-style.js"
},
{
filename: "readme.txt",
updater: "bin/version-readme.js"
}
]
}

0
CHANGELOG.md

10
bin/version-readme.js

@ -0,0 +1,10 @@
module.exports.readVersion = function(contents) {
const pattern = /Stable tag:\s*([0-9]*.*)/i;
return contents.match(pattern)[1];
};
module.exports.writeVersion = function(contents, version) {
const pattern = /Stable tag:\s*([0-9]*.*)/i;
const oldVersion = contents.match(pattern)[1];
return contents.replace(oldVersion, version);
};

10
bin/version-style.js

@ -0,0 +1,10 @@
module.exports.readVersion = function(contents) {
const pattern = /Version:\s*([0-9]*.*)/i;
return contents.match(pattern)[1];
};
module.exports.writeVersion = function(contents, version) {
const pattern = /Version:\s*([0-9]*.*)/i;
const oldVersion = contents.match(pattern)[1];
return contents.replace(oldVersion, version);
};

1649
package-lock.json generated

File diff suppressed because it is too large Load Diff

4
package.json

@ -51,6 +51,7 @@
"prod": "npm run production", "prod": "npm run production",
"build:production": "npm run production", "build:production": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"release": "standard-version -a -t ''",
"rmdist": "rimraf dist", "rmdist": "rimraf dist",
"test": "npm run -s lint", "test": "npm run -s lint",
"lint": "npm run -s lint:scripts && npm run -s lint:styles", "lint": "npm run -s lint:scripts && npm run -s lint:styles",
@ -63,7 +64,8 @@
"devDependencies": { "devDependencies": {
"@commitlint/config-conventional": "^11.0.0", "@commitlint/config-conventional": "^11.0.0",
"commitlint": "^11.0.0", "commitlint": "^11.0.0",
"husky": "^4.3.0" "husky": "^4.3.0",
"standard-version": "^9.0.0"
}, },
"dependencies": { "dependencies": {
"aetna": "^1.0.0-alpha.26", "aetna": "^1.0.0-alpha.26",

Loading…
Cancel
Save