Skip to content

Commit

Permalink
bump version to go with changes in RC-898
Browse files Browse the repository at this point in the history
  • Loading branch information
zachwreed committed Nov 27, 2023
1 parent 95d4f51 commit 2ac7f2c
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 196 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ imported into Postman so that you can get started on making requests to Lob API.

## How to bump version

For a MAJOR breaking change on the api, you should bump the first number i.e. `1.xx.xx` -> `2.xx.xx`. For a MINOR change, you should bump the second set of numbers `1.13.x` -> `1.14.0`. For a PATCH change (You are changing a typo or something that doesn't affect logic) you should bump the final set of numbers i.e. `x.xx.10` -> `x.xx.11`.
When bumping the version there are three key areas where the version should be bumped. The first is `package.json`, the second is the `package-lock.json`, and the final, is `lob-api-public.yml`. These all have a property called `version` that should be bumped based on the criteria above.
Run `npm run bump-version <<newversion> | major | minor | patch>`

When bumping the version there are three key areas where the `version` should be bumped. Verify that these versions are updated after running the script
1. `package.json`
2. `package-lock.json`
3. `lob-api-public.yml`

The final step is to ensure you run `npm run bundle && npm run pretty && npm run redoc` to actually appply these changes.
2 changes: 1 addition & 1 deletion dist/lob-api-bundled.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.0.3
info:
title: Lob
version: 1.19.21
version: 1.19.22
description: >
The Lob API is organized around REST. Our API is designed to have
predictable, resource-oriented URLs and uses HTTP response codes to indicate
Expand Down
28 changes: 14 additions & 14 deletions docs/index.html

Large diffs are not rendered by default.

187 changes: 19 additions & 168 deletions lob-api-public.yml

Large diffs are not rendered by default.

98 changes: 89 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lob/openapi",
"version": "1.19.21",
"version": "1.19.22",
"engines": {
"node": ">=14.16.0",
"npm": ">=7.9.0"
Expand Down Expand Up @@ -54,6 +54,7 @@
}
},
"scripts": {
"bump-version": "npm version $1 --no-git-tag-version && npm install && node ./scripts/yml-version-bump.js",
"build": "webpack --config webpack.config.js",
"bundle": "openapi bundle -o dist/$npm_package_config_bundlefile $npm_package_config_specfile",
"clean": "rm -rf dist",
Expand Down Expand Up @@ -112,7 +113,8 @@
"waypoints": "^4.0.1",
"webpack": "^5.72.1",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^4.9.0"
"webpack-dev-server": "^4.9.0",
"yaml": "^2.3.4"
},
"dependencies": {
"@redocly/cli": "^1.0.0-beta.102",
Expand Down
37 changes: 37 additions & 0 deletions scripts/yml-version-bump.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const fs = require("fs");
const YAML = require("yaml");
const { version } = require("../package.json");

/**
* @typedef {Object} LobApiPublicYamlInfo
* @property {string} version
*/

/**
* @typedef {Object} LobApiPublicYaml
* @property {LobApiPublicYamlInfo} info
*/

const updateLobApiPublicYmlVersion = async () => {
try {
const file = await fs.promises.readFile("./lob-api-public.yml", "utf8");
/** @type LobApiPublicYaml */
const lobApiPublic = YAML.parse(file);
lobApiPublic.info.version = version;
await fs.promises.writeFile(
"./lob-api-public.yml",
YAML.stringify(lobApiPublic, {
minContentWidth: 0,
lineWidth: 0,
})
);
console.log(`updated version in lob-api-public.yml to ${version}`);
} catch (err) {
console.error(
`error updating version in lob-api-public.yml to ${version}`,
err
);
}
};

updateLobApiPublicYmlVersion();

0 comments on commit 2ac7f2c

Please sign in to comment.