Skip to content

Commit

Permalink
issue #591: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gullerya committed Jan 19, 2021
1 parent 118b33c commit 45f6851
Show file tree
Hide file tree
Showing 5 changed files with 257 additions and 48 deletions.
11 changes: 0 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [1.0.6](https://github.com/Vonage/vivid/compare/v1.0.5...v1.0.6) (2021-01-19)

### [1.0.5](https://github.com/Vonage/vivid/compare/v1.1.0...v1.0.5) (2021-01-19)

## [1.1.0](https://github.com/Vonage/vivid/compare/v1.0.4...v1.1.0) (2021-01-19)


### Features

* testing stuff ([00aed6a](https://github.com/Vonage/vivid/commit/00aed6a510af379e94f3f18260908ebb252afa00))
* **autobump:** version automation ([c81eb0a](https://github.com/Vonage/vivid/commit/c81eb0ac24b97df33e94caf0152161a6a9d4f350))

## [1.0.4](https://github.com/Vonage/vivid/compare/v1.0.3...v1.0.4) (2021-01-19)

Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "1.0.6",
"version": "1.0.4",
"command": {
"publish": {
"conventionalCommits": true,
Expand Down
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@vivid/root",
"version": "1.1.0",
"private": true,
"description": "Web Components based on branded design system by Vonage, following open-wc recommendations",
"author": "Vonage",
Expand Down Expand Up @@ -46,10 +45,7 @@
"wca:json": "wca analyze components/*/src/*.?s --outFile custom-elements.json",
"wca:compile:json": "yarn compile && yarn wca:custom-elements",
"docs:spell-check": "spech readme.md docs/*.md",
"bump": "yarn lerna version --conventional-commits --exact --no-private --no-git-tag-version --no-push",
"bump-1": "conventional-changelog --preset angular --release-count 1 --pkg package.json",
"suggest": "node ./scripts/version-utils.mjs",
"rel": "standard-version"
"suggest": "node ./scripts/version-utils.mjs"
},
"devDependencies": {
"@open-wc/eslint-config": "^3.0.0",
Expand Down Expand Up @@ -118,7 +114,7 @@
"semver-diff": "^3.1.1",
"showdown": "^1.9.1",
"spech": "^0.2.1",
"standard-version": "^9.0.0",
"standard-version": "^9.1.0",
"tar-stream": "^2.1.4",
"tslib": "^2.0.3",
"typescript": "^4.1.3",
Expand Down Expand Up @@ -148,4 +144,4 @@
"engines": {
"node": ">=12.18.4"
}
}
}
34 changes: 13 additions & 21 deletions scripts/version-utils.mjs
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
import os from 'os';
import { exec } from 'child_process';
import standardVersion from 'standard-version';

const logExtractor = exec(`git log --tags --format="%d %s" --max-count=100`);
logExtractor.stdout.on('data', chunk => {
const { commits, reminder } = parseGitLogChunk(chunk);
});

/**
* results in object having:
* - an array of parsed commits
* - a leftover that should be kept for the next chunk
*/
function parseGitLogChunk(chunk) {
const result = { commits: [], reminder: '' };

for (const line of chunk.split(os.EOL)) {
if (!line) {
continue;
}
console.log(`-- ${line} --`);
standardVersion({
bumpFiles: [{ filename: 'lerna.json', type: 'json' }],
packageFiles: [{ filename: 'lerna.json', type: 'json' }],
skip: {
bump: true,
commit: true,
tag: true
}

return result;
}
}).then(r => {
console.log(r);
}).catch(err => {
console.error(`standard-version failed with message: ${err.message}`)
})
Loading

0 comments on commit 45f6851

Please sign in to comment.