Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize #239

Merged
merged 12 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
32 changes: 12 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,22 @@ In general:

### pre-requisites

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

### Initial Setup

The initial setup is trivial:

- clone this repo
- `yarn`
- `pnpm i`

### Committing Changes

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

It is recommended to use `git cz` command to construct the commit messages.

- requires [commitizen](https://github.com/commitizen/cz-cli#installing-the-command-line-tool) to be installed.

### Formatting.

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

- To run the tests run `yarn test` in a specific subpackage.
- To run the tests run `pnpm test` in a specific subpackage.

### Test Coverage

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

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

### Release Life-Cycle.

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

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

### Release Process

Performing a release requires push permissions to this repository.

- Ensure you are on `master` branch and synced with origin.
- `yarn run lerna:version`
- `pnpm run release:version`
- Follow the lerna CLI instructions.
- Track the `RELEASE` tag build on circle-ci.
- https://circleci.com/gh/SAP/vscode-logging.
- Once the tag build has finished successfully inspect the npm registry to see the new versions
for all the changed packages of this mono-repo.
- Track the `release` build on github actions
- Once the `release` build has finished successfully inspect the npm registry to see the new versions
for all the **changed** packages of this mono-repo.
- `npm view [package-name] version`
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
[![CircleCI](https://circleci.com/gh/SAP/vscode-logging.svg?style=svg)](https://circleci.com/gh/SAP/vscode-logging)
[![Coverage Status](https://coveralls.io/repos/github/SAP/vscode-logging/badge.svg?branch=master)](https://coveralls.io/github/SAP/vscode-logging?branch=master)
[![Continuous Integration](https://github.com/SAP/vscode-logging/actions/workflows/ci.yml/badge.svg)](https://github.com/SAP/vscode-logging/actions/workflows/ci.yml)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=SAP/vscode-logging)](https://dependabot.com)
[![REUSE status](https://api.reuse.software/badge/github.com/SAP/vscode-logging)](https://api.reuse.software/info/github.com/SAP/vscode-logging)
[![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)

# VSCode-Logging

Expand Down
2 changes: 1 addition & 1 deletion examples/extension-wrapper/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function registerCommands(
let logMessagesCounter = 1;
const commandSubscription = commands.registerCommand(
"extension.helloWorld",
// By providing a real function name rather then a `fat arrow` ( ()=>{} )
// By providing a real function name rather than a `fat arrow` ( ()=>{} )
// The `sourceLocationTracking` can provide a meaningful output.
function registerCallback() {
window.showInformationMessage("Hello Cruel World!");
Expand Down
1 change: 0 additions & 1 deletion examples/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"@vscode-logging/logger": "^1.2.3"
},
"devDependencies": {
"@types/node": "10.x",
"@types/vscode": "^1.32.0"
}
}
9 changes: 4 additions & 5 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"packages": ["packages/*", "examples/*"],
"useWorkspaces": true,
"npmClient": "yarn",
"version": "independent",
"npmClient": "npm",
"command": {
"publish": {
"conventionalCommits": true
},
"version": {
"allowBranch": "master",
"message": "chore(release): release"
"message": "chore(release): release %s"
}
}
},
"version": "1.2.5"
}
80 changes: 39 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,55 @@
"examples/*"
]
},
"engines": {
"node": ">=18",
"pnpm": ">=8"
},
"scripts": {
"lerna:version": "yarn && lerna version && yarn run circle:release",
"circle:release": "git tag -d RELEASE && git tag RELEASE && git push --delete origin RELEASE && git push --tags",
"lerna:publish": "lerna publish from-git --yes",
"ci": "npm-run-all format:validate ci:subpackages legal:* coverage:merge",
"version": "pnpm install && git add pnpm-lock.yaml",
"preinstall": "npx only-allow pnpm",
"prepare": "husky install",
"release:version": "lerna version",
"release:publish": "lerna publish from-git --yes --no-verify-access",
"ci": "npm-run-all format:validate ci:subpackages legal:* coverage:merge",
"ci:subpackages": "lerna run ci",
"format:fix": "prettier --write --ignore-path .gitignore \"**/*.@(ts|js|json|md)\"",
"format:validate": "prettier --check --ignore-path .gitignore \"**/*.@(ts|js|json|md)\"",
"coverage:merge": "node ./scripts/merge-coverage",
"ci:subpackages": "lerna run ci",
"legal:delete": "lerna exec \"shx rm -rf .reuse LICENSES\" || true",
"legal:copy": "lerna exec \"shx cp -r ../../.reuse .reuse && shx cp -r ../../LICENSES LICENSES\""
"legal:copy-reuse": "pnpm -r exec -- shx cp -r ../../.reuse .reuse",
"legal:copy-license": "pnpm -r exec -- shx cp -r ../../LICENSES LICENSES"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"lint-staged": {
"*.{js,ts,json,md}": [
"prettier --write"
],
"*.{ts,js}": [
"eslint --fix --max-warnings=0 --ignore-pattern=!.*"
]
},
"devDependencies": {
"@commitlint/cli": "12.1.1",
"@commitlint/config-conventional": "11.0.0",
"@types/chai": "4.2.14",
"@types/mocha": "8.0.1",
"chai": "4.2.0",
"chai-exclude": "2.0.2",
"coveralls": "3.1.0",
"@commitlint/cli": "18.4.3",
"@commitlint/config-conventional": "18.4.3",
"@types/chai": "4.3.11",
"@types/mocha": "10.0.6",
"@types/node": "18.15.3",
"chai": "4.3.10",
"chai-exclude": "2.1.0",
"cz-conventional-changelog": "3.3.0",
"husky": "4.3.5",
"husky": "8.0.3",
"lerna": "3.20.2",
"lint-staged": "10.5.3",
"mocha": "7.0.1",
"lint-staged": "15.2.0",
"mocha": "10.2.0",
"npm-run-all": "4.1.5",
"nyc": "15.1.0",
"prettier": "1.19.1",
"rimraf": "^3.0.2",
"shx": "0.3.2",
"typescript": "4.1.2"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"lint-staged": {
"*.{ts,js,md,json}": [
"prettier --write"
]
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
"rimraf": "5.0.5",
"shx": "0.3.4",
"typescript": "5.3.3"
}
}
20 changes: 10 additions & 10 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@
"typings": "./api.d.ts",
"dependencies": {
"@vscode-logging/types": "^0.1.4",
"fast-safe-stringify": "2.0.7",
"fs-extra": "9.1.0",
"lodash": "^4.17.21",
"fast-safe-stringify": "2.1.1",
"fs-extra": "11.2.0",
"lodash": "4.17.21",
"stacktrace-js": "2.0.2",
"streamroller": "2.2.3",
"triple-beam": "1.3.0",
"winston": "3.3.3",
"winston-transport": "4.3.0"
"streamroller": "3.1.5",
"triple-beam": "1.4.1",
"winston": "3.11.0",
"winston-transport": "4.6.0"
},
"devDependencies": {
"@types/fs-extra": "^9.0.4",
"@types/fs-extra": "11.0.4",
"@types/vscode": "1.51.0",
"proxyquire": "2.1.3",
"sinon": "^9.0.2",
"sinon-chai": "^3.5.0"
"sinon": "17.0.1",
"sinon-chai": "3.7.0"
},
"scripts": {
"ci": "npm-run-all type-check coverage:*",
Expand Down
3 changes: 2 additions & 1 deletion packages/types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"noEmit": true
"noEmit": true,
"target": "ES2015"
},
"include": ["./"]
}
4 changes: 2 additions & 2 deletions packages/wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"@vscode-logging/types": "^0.1.4"
},
"devDependencies": {
"@types/lodash": "^4.14.167",
"@types/lodash": "4.14.202",
"@types/vscode": "1.52.0",
"lodash": "^4.17.21"
"lodash": "4.17.21"
},
"scripts": {
"ci": "npm-run-all clean compile coverage:*",
Expand Down
Loading
Loading