Skip to content

Commit 0bef133

Browse files
authored
feat!: locked versions with lerna
1 parent 83fdb39 commit 0bef133

14 files changed

Lines changed: 8484 additions & 7349 deletions

File tree

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit "$1"

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install lint-staged

CONTRIBUTING.md

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,22 @@ In general:
3939

4040
### pre-requisites
4141

42-
- [Yarn](https://yarnpkg.com/lang/en/docs/install/) >= 1.4.2
43-
- Yarn rather than npm is needed as this mono-repo uses [yarn workspaces](https://yarnpkg.com/lang/en/docs/workspaces/).
44-
- A [maintained version](https://nodejs.org/en/about/releases/) of node.js
42+
- [pnpm](https://pnpm.io/installation) >= 8
43+
- An [LTS version](https://nodejs.org/en/about/releases/) of node.js
4544
- This package is targeted and tested on modern/supported versions of node.js only.
46-
Which means 10+ at the time of writing this document.
47-
- [commitizen](https://github.com/commitizen/cz-cli#installing-the-command-line-tool) for managing commit messages.
4845

4946
### Initial Setup
5047

5148
The initial setup is trivial:
5249

5350
- clone this repo
54-
- `yarn`
51+
- `pnpm i`
5552

5653
### Committing Changes
5754

5855
This project enforces [Angular style](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit) commit message conventions
5956
using a pre-commit hook.
6057

61-
It is recommended to use `git cz` command to construct the commit messages.
62-
63-
- requires [commitizen](https://github.com/commitizen/cz-cli#installing-the-command-line-tool) to be installed.
64-
6558
### Formatting.
6659

6760
[Prettier](https://prettier.io/) is used to ensure consistent code formatting in this repository.
@@ -78,7 +71,7 @@ as the Parser initialization (which happens once per process) can take 10-20ms.
7871
[mocha]: https://mochajs.org/
7972
[istanbul]: https://istanbul.js.org/
8073

81-
- To run the tests run `yarn test` in a specific subpackage.
74+
- To run the tests run `pnpm test` in a specific subpackage.
8275

8376
### Test Coverage
8477

@@ -94,25 +87,24 @@ as the Parser initialization (which happens once per process) can take 10-20ms.
9487
This project does not use any compilation step (Babel/TypeScript), this means that the full build
9588
does not generate any artifacts for runtime.
9689

97-
- To run the full **C**ontinuous **I**ntegration build run `yarn ci` in in either the top level package or a specific subpackage.
90+
- To run the full **C**ontinuous **I**ntegration build run `pnpm ci` in in either the top level package or a specific subpackage.
9891

9992
### Release Life-Cycle.
10093

101-
This monorepo uses Lerna's [independent][lerna-mode] mode support a separate life-cycle (version number)
102-
for each package and automatically generate the changelog by adhering to [Conventional Commits][cc]
94+
This monorepo uses Lerna's [fixed / locked][lerna-mode] mode
95+
and automatically generates the changelog by adhering to [Conventional Commits][cc]
10396

104-
[lerna-mode]: https://github.com/lerna/lerna#independent-mode
97+
[lerna-mode]: https://lerna.js.org/docs/features/version-and-publish#fixedlocked-mode-default
10598
[cc]: https://www.conventionalcommits.org/en/v1.0.0/
10699

107100
### Release Process
108101

109102
Performing a release requires push permissions to this repository.
110103

111104
- Ensure you are on `master` branch and synced with origin.
112-
- `yarn run lerna:version`
105+
- `pnpm run release:version`
113106
- Follow the lerna CLI instructions.
114-
- Track the `RELEASE` tag build on circle-ci.
115-
- https://circleci.com/gh/SAP/vscode-logging.
116-
- Once the tag build has finished successfully inspect the npm registry to see the new versions
117-
for all the changed packages of this mono-repo.
107+
- Track the `release` build on github actions
108+
- Once the `release` build has finished successfully inspect the npm registry to see the new versions
109+
for all the **changed** packages of this mono-repo.
118110
- `npm view [package-name] version`

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
[![CircleCI](https://circleci.com/gh/SAP/vscode-logging.svg?style=svg)](https://circleci.com/gh/SAP/vscode-logging)
2-
[![Coverage Status](https://coveralls.io/repos/github/SAP/vscode-logging/badge.svg?branch=master)](https://coveralls.io/github/SAP/vscode-logging?branch=master)
1+
[![Continuous Integration](https://github.com/SAP/vscode-logging/actions/workflows/ci.yml/badge.svg)](https://github.com/SAP/vscode-logging/actions/workflows/ci.yml)
32
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
4-
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
5-
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=SAP/vscode-logging)](https://dependabot.com)
63
[![REUSE status](https://api.reuse.software/badge/github.com/SAP/vscode-logging)](https://api.reuse.software/info/github.com/SAP/vscode-logging)
7-
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/SAP/vscode-logging.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/SAP/vscode-logging/context:javascript)
84

95
# VSCode-Logging
106

examples/extension-wrapper/src/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function registerCommands(
77
let logMessagesCounter = 1;
88
const commandSubscription = commands.registerCommand(
99
"extension.helloWorld",
10-
// By providing a real function name rather then a `fat arrow` ( ()=>{} )
10+
// By providing a real function name rather than a `fat arrow` ( ()=>{} )
1111
// The `sourceLocationTracking` can provide a meaningful output.
1212
function registerCallback() {
1313
window.showInformationMessage("Hello Cruel World!");

examples/extension/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"@vscode-logging/logger": "^1.2.3"
5454
},
5555
"devDependencies": {
56-
"@types/node": "10.x",
5756
"@types/vscode": "^1.32.0"
5857
}
5958
}

lerna.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
{
22
"packages": ["packages/*", "examples/*"],
33
"useWorkspaces": true,
4-
"npmClient": "yarn",
5-
"version": "independent",
4+
"npmClient": "npm",
65
"command": {
76
"publish": {
87
"conventionalCommits": true
98
},
109
"version": {
11-
"allowBranch": "master",
12-
"message": "chore(release): release"
10+
"message": "chore(release): release %s"
1311
}
14-
}
12+
},
13+
"version": "1.2.5"
1514
}

package.json

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,55 @@
77
"examples/*"
88
]
99
},
10+
"engines": {
11+
"node": ">=18",
12+
"pnpm": ">=8"
13+
},
1014
"scripts": {
11-
"lerna:version": "yarn && lerna version && yarn run circle:release",
12-
"circle:release": "git tag -d RELEASE && git tag RELEASE && git push --delete origin RELEASE && git push --tags",
13-
"lerna:publish": "lerna publish from-git --yes",
14-
"ci": "npm-run-all format:validate ci:subpackages legal:* coverage:merge",
15+
"version": "pnpm install && git add pnpm-lock.yaml",
16+
"preinstall": "npx only-allow pnpm",
17+
"prepare": "husky install",
18+
"release:version": "lerna version",
19+
"release:publish": "lerna publish from-git --yes --no-verify-access",
20+
"ci": "npm-run-all format:validate ci:subpackages legal:* coverage:merge",
21+
"ci:subpackages": "lerna run ci",
1522
"format:fix": "prettier --write --ignore-path .gitignore \"**/*.@(ts|js|json|md)\"",
1623
"format:validate": "prettier --check --ignore-path .gitignore \"**/*.@(ts|js|json|md)\"",
1724
"coverage:merge": "node ./scripts/merge-coverage",
18-
"ci:subpackages": "lerna run ci",
19-
"legal:delete": "lerna exec \"shx rm -rf .reuse LICENSES\" || true",
20-
"legal:copy": "lerna exec \"shx cp -r ../../.reuse .reuse && shx cp -r ../../LICENSES LICENSES\""
25+
"legal:copy-reuse": "pnpm -r exec -- shx cp -r ../../.reuse .reuse",
26+
"legal:copy-license": "pnpm -r exec -- shx cp -r ../../LICENSES LICENSES"
27+
},
28+
"commitlint": {
29+
"extends": [
30+
"@commitlint/config-conventional"
31+
]
32+
},
33+
"lint-staged": {
34+
"*.{js,ts,json,md}": [
35+
"prettier --write"
36+
],
37+
"*.{ts,js}": [
38+
"eslint --fix --max-warnings=0 --ignore-pattern=!.*"
39+
]
2140
},
2241
"devDependencies": {
23-
"@commitlint/cli": "12.1.1",
24-
"@commitlint/config-conventional": "11.0.0",
25-
"@types/chai": "4.2.14",
26-
"@types/mocha": "8.0.1",
27-
"chai": "4.2.0",
28-
"chai-exclude": "2.0.2",
29-
"coveralls": "3.1.0",
42+
"@commitlint/cli": "18.4.3",
43+
"@commitlint/config-conventional": "18.4.3",
44+
"@types/chai": "4.3.11",
45+
"@types/mocha": "10.0.6",
46+
"@types/node": "18.15.3",
47+
"chai": "4.3.10",
48+
"chai-exclude": "2.1.0",
3049
"cz-conventional-changelog": "3.3.0",
31-
"husky": "4.3.5",
50+
"husky": "8.0.3",
3251
"lerna": "3.20.2",
33-
"lint-staged": "10.5.3",
34-
"mocha": "7.0.1",
52+
"lint-staged": "15.2.0",
53+
"mocha": "10.2.0",
3554
"npm-run-all": "4.1.5",
3655
"nyc": "15.1.0",
3756
"prettier": "1.19.1",
38-
"rimraf": "^3.0.2",
39-
"shx": "0.3.2",
40-
"typescript": "4.1.2"
41-
},
42-
"husky": {
43-
"hooks": {
44-
"pre-commit": "lint-staged",
45-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
46-
}
47-
},
48-
"lint-staged": {
49-
"*.{ts,js,md,json}": [
50-
"prettier --write"
51-
]
52-
},
53-
"config": {
54-
"commitizen": {
55-
"path": "./node_modules/cz-conventional-changelog"
56-
}
57-
},
58-
"commitlint": {
59-
"extends": [
60-
"@commitlint/config-conventional"
61-
]
57+
"rimraf": "5.0.5",
58+
"shx": "0.3.4",
59+
"typescript": "5.3.3"
6260
}
6361
}

packages/logger/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@
1818
"typings": "./api.d.ts",
1919
"dependencies": {
2020
"@vscode-logging/types": "^0.1.4",
21-
"fast-safe-stringify": "2.0.7",
22-
"fs-extra": "9.1.0",
23-
"lodash": "^4.17.21",
21+
"fast-safe-stringify": "2.1.1",
22+
"fs-extra": "11.2.0",
23+
"lodash": "4.17.21",
2424
"stacktrace-js": "2.0.2",
25-
"streamroller": "2.2.3",
26-
"triple-beam": "1.3.0",
27-
"winston": "3.3.3",
28-
"winston-transport": "4.3.0"
25+
"streamroller": "3.1.5",
26+
"triple-beam": "1.4.1",
27+
"winston": "3.11.0",
28+
"winston-transport": "4.6.0"
2929
},
3030
"devDependencies": {
31-
"@types/fs-extra": "^9.0.4",
31+
"@types/fs-extra": "11.0.4",
3232
"@types/vscode": "1.51.0",
3333
"proxyquire": "2.1.3",
34-
"sinon": "^9.0.2",
35-
"sinon-chai": "^3.5.0"
34+
"sinon": "17.0.1",
35+
"sinon-chai": "3.7.0"
3636
},
3737
"scripts": {
3838
"ci": "npm-run-all type-check coverage:*",

packages/types/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"compilerOptions": {
3-
"noEmit": true
3+
"noEmit": true,
4+
"target": "ES2015"
45
},
56
"include": ["./"]
67
}

0 commit comments

Comments
 (0)