Skip to content

Commit 9a862fa

Browse files
authored
Merge pull request #68 from shiftcode/#67-format-everything
#67 format everything
2 parents e35fa3a + 71ec234 commit 9a862fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+136
-187
lines changed

.commitlintrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
extends:
2-
- "@commitlint/config-angular"
2+
- '@commitlint/config-angular'
33
rules:
44
'header-max-length': [2, 'always', 100]

.github/workflows/copilot-setup-steps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# https://docs.github.com/en/enterprise-cloud@latest/copilot/how-tos/use-copilot-agents/coding-agent/customize-the-agent-environment
22
# The copilot-setup-steps.yml workflow won't trigger unless it's present on your main branch.
3-
name: "Copilot Setup Steps"
3+
name: 'Copilot Setup Steps'
44

55
# Automatically run the setup steps when they are changed to allow for easy validation, and
66
# allow manual testing through the repository's "Actions" tab
@@ -33,4 +33,4 @@ jobs:
3333
cache: 'npm'
3434

3535
- name: GitHub registry Auth & Install Dependencies
36-
run: npm ci
36+
run: npm ci

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
name: Check for execution
3333
uses: shiftcode/[email protected]
3434
with:
35-
skipOnCommitMsg: "[skip_build]"
35+
skipOnCommitMsg: '[skip_build]'
3636
githubToken: ${{ secrets.GITHUB_TOKEN }}
3737
test:
3838
runs-on: ubuntu-latest

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npx lint-staged && npx lerna exec --concurrency 1 --stream lint-staged
1+
npx lerna exec --concurrency 1 --stream lint-staged && npx lint-staged

.lintstagedrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
./package.json:
22
- npx sort-package-json
3+
4+
'*':
5+
- npm run format:staged

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

README.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,37 @@
22

33
Public helper packages with commonly used utilities / helpers.
44

5+
> [![@shiftcode/branch-utilities](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fbranch-utilities%2Fpackage.json&label=%40shiftcode%2Fbranch-utilities)](packages/branch-utilities) \
6+
> functions to read information about the current branch either locally or inside Github actions.
57
6-
>[![@shiftcode/branch-utilities](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fbranch-utilities%2Fpackage.json&label=%40shiftcode%2Fbranch-utilities)](packages/branch-utilities) \
7-
>functions to read information about the current branch either locally or inside Github actions.
8+
> [![@shiftcode/eslint-config-recommended](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Feslint-config-recommended%2Fpackage.json&label=%40shiftcode%2Feslint-config-recommended)](packages/eslint-config-recommended) \
9+
> Our recommended config for eslint. We provide two versions, one for usage in node projects and one for Angular.
810
9-
>[![@shiftcode/eslint-config-recommended](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Feslint-config-recommended%2Fpackage.json&label=%40shiftcode%2Feslint-config-recommended)](packages/eslint-config-recommended) \
10-
>Our recommended config for eslint. We provide two versions, one for usage in node projects and one for Angular.
11+
> [![@shiftcode/eslint-plugin-rules](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Feslint-plugin-rules%2Fpackage.json&label=%40shiftcode%2Feslint-plugin-rules)](packages/eslint-plugin-rules) \
12+
> Contains some custom es lint rules. Those are used in our recommended eslint config.
1113
12-
>[![@shiftcode/eslint-plugin-rules](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Feslint-plugin-rules%2Fpackage.json&label=%40shiftcode%2Feslint-plugin-rules)](packages/eslint-plugin-rules) \
13-
>Contains some custom es lint rules. Those are used in our recommended eslint config.
14-
15-
>[![@shiftcode/publish-helper](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fpublish-helper%2Fpackage.json&label=%40shiftcode%2Fpublish-helper)](packages/publish-helper)\
16-
>scripts to prepare and publish libs inside mono-repos with lerna
14+
> [![@shiftcode/publish-helper](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fpublish-helper%2Fpackage.json&label=%40shiftcode%2Fpublish-helper)](packages/publish-helper)\
15+
> scripts to prepare and publish libs inside mono-repos with lerna
1716
18-
>[![@shiftcode/utilities](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Futilities%2Fpackage.json&label=%40shiftcode%2Futilities)](packages/utilities)\
19-
>various utility functions, constants and helper types - usable in Node and Browsers
17+
> [![@shiftcode/utilities](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Futilities%2Fpackage.json&label=%40shiftcode%2Futilities)](packages/utilities)\
18+
> various utility functions, constants and helper types - usable in Node and Browsers
2019
2120
## Usage
21+
2222
Add a `.npmrc` file to the root of your project:
23+
2324
```
2425
@shiftcode:registry=https://npm.pkg.github.com
2526
```
2627

2728
## Quick Start
28-
* `npm i`
29-
* `npm run build`
30-
* start developing
3129

30+
- `npm i`
31+
- `npm run build`
32+
- start developing
3233

3334
## Versioning
35+
3436
When opening a PR lerna publishes a new prerelease version with the preId `-prXX.{COUNT}`.
3537
By creating this version lerna creates a commit with the updated versions in the package.json. It does not update the `peerDependencies` versions.
3638

@@ -39,26 +41,31 @@ After merging the PR back to the master a new release is published with the grad
3941
> ensure your branch is named correctly by the convention `#XX-name` where `XX` is your github issue number.
4042
4143
### Hint
44+
4245
If it happens that you already have another commit locally, before updating the branch with this `build(release):..` commit:
43-
> use `rebase` instead of `merge`
4446

47+
> use `rebase` instead of `merge`
4548
4649
## Anatomy of the repo
4750

4851
We use lerna to manage the packages.
52+
4953
- For lerna to know the topological order of packages, we define the dependencies between the packages in each individual package as `devDependency`
5054
- For testing reasons we compile against the source code to run tests without prior compiling of the source, this requires `tsconfig.paths` definitions and also `moduleNameMapper` in `jest.config.js`
5155

5256
## ES Version
57+
5358
We support two runtimes: `node` and `latest browser versions`.
5459

5560
### Node 22
56-
Node 22 (which is also supported by AWS Lambda) supports [97%](https://node.green/#ES2022) of `es2022` features
61+
62+
Node 22 (which is also supported by AWS Lambda) supports [97%](https://node.green/#ES2022) of `es2022` features
5763
(no version supports 100%) and [100%](https://node.green/#ES2023) of `es2023` features.
5864
The only `es2022` feature that is currently not supported and needs a polyfill when using it is
59-
[RegExp Match Indices (shows up in flags)](https://node.green/#ES2022-features-RegExp-Match-Indices---hasIndices-----d--flag-) (see [2ality blog](https://2ality.com/2019/12/regexp-match-indices.html) for insights).
65+
[RegExp Match Indices (shows up in flags)](https://node.green/#ES2022-features-RegExp-Match-Indices---hasIndices-----d--flag-) (see [2ality blog](https://2ality.com/2019/12/regexp-match-indices.html) for insights).
6066
Polyfill can be found here: https://www.npmjs.com/package/regexp-match-indices.
6167

6268
### Browser
69+
6370
For modern browsers the latest fully supported version is `es2023` (see [can-i-use](https://caniuse.com/?search=es2023))
6471
which therefore is the target for `@shiftcode/utilities` package (see [package README](./packages/utilities/README.md)).

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
"scripts": {
1212
"build:ci": "lerna run build",
1313
"build:lint:ci": "lerna run build --scope @shiftcode/eslint-plugin-rules && lerna run build --scope @shiftcode/eslint-config-recommended",
14-
"format": "lerna run format",
15-
"format:ci": "lerna run format:ci",
14+
"format": "prettier --write .",
15+
"format:ci": "prettier --check .",
16+
"format:staged": "prettier --write --ignore-unknown",
1617
"lint:ci": "lerna run lint:ci",
1718
"prepare": "husky",
1819
"publish-libs": "node packages/publish-helper/dist/publish-lib",
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
# Reformat all .ts / .js
2-
"**/*.(t|j)s":
3-
- npm run format:staged
1+
'{src,test}/**/*.(t|j)s':
42
- npm run lint:staged
53

6-
# sort package.json keys
7-
./package.json:
8-
- sort-package-json
4+
'./package.json':
5+
- sort-package-json

0 commit comments

Comments
 (0)