Skip to content

Commit fe67bff

Browse files
authored
build: speed up builds & prepare release (#48)
- bump dependencies - document contributing guidelines - speed up builds by triggering them only when necessary - bump release version
2 parents e447d00 + ce1131a commit fe67bff

File tree

9 files changed

+1261
-1151
lines changed

9 files changed

+1261
-1151
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ root = true
44
end_of_line = lf
55
insert_final_newline = true
66

7-
[*.{css,js,cjs,mjs,json,ts,cjs,mts,jsx,tsx,md}]
7+
[*.{css,js,cjs,mjs,json,ts,cjs,mts,jsx,tsx,md,sh}]
88
charset = utf-8
99
indent_style = tab
1010
indent_size = 2

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: (Types) Install dependencies
3939
run: pnpm --filter types install
4040
- name: (Types) Build Library
41-
run: pnpm --filter types run build
41+
run: pnpm --filter types run build:ci
4242
- name: (Types) Run Linters
4343
if: ${{ matrix.os == 'ubuntu-22.04' }}
4444
run: pnpm --filter types run lint
@@ -47,7 +47,7 @@ jobs:
4747
- name: (Algorithms) Install dependencies
4848
run: pnpm --filter algorithms install
4949
- name: (Algorithms) Build Library
50-
run: pnpm --filter algorithms run build
50+
run: pnpm --filter algorithms run build:ci
5151
- name: (Algorithms) Run Linters
5252
if: ${{ matrix.os == 'ubuntu-22.04' }}
5353
run: pnpm --filter algorithms run lint
@@ -58,7 +58,7 @@ jobs:
5858
- name: (React SVG) Install dependencies
5959
run: pnpm --filter react install
6060
- name: (React SVG) Build Library
61-
run: pnpm --filter react run build
61+
run: pnpm --filter react run build:ci
6262
- name: (React SVG) Run Linters
6363
if: ${{ matrix.os == 'ubuntu-22.04' }}
6464
run: pnpm --filter react run lint

@beautiful-tree/algorithms/package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"dist"
3838
],
3939
"scripts": {
40-
"build": "rm -rf dist && rollup --config rollup.config.prod.mjs",
40+
"build": "../../scripts/build.sh algorithms",
41+
"build:ci": "rollup --config rollup.config.prod.mjs",
4142
"build-storybook": "storybook build",
4243
"lint": "tsc && eslint . --ext ts,mts,tsx --report-unused-disable-directives --max-warnings 0 && publint",
4344
"lint:eslint": "eslint . --ext ts,mts,tsx --report-unused-disable-directives --max-warnings 0",
@@ -50,20 +51,20 @@
5051
},
5152
"devDependencies": {
5253
"@arethetypeswrong/cli": "^0.10.2",
53-
"@beautiful-tree/types": "workspace:0.2.0",
54+
"@beautiful-tree/types": "workspace:*",
5455
"@coderspirit/eslint-config": "^1.2.1",
5556
"@rollup/plugin-terser": "^0.4.3",
5657
"@rollup/plugin-typescript": "^11.1.3",
57-
"@types/node": "^20.6.1",
58-
"@typescript-eslint/parser": "^6.7.0",
59-
"@vitest/coverage-v8": "^0.34.4",
60-
"eslint": "^8.49.0",
58+
"@types/node": "^20.6.4",
59+
"@typescript-eslint/parser": "^6.7.2",
60+
"@vitest/coverage-v8": "^0.34.5",
61+
"eslint": "^8.50.0",
6162
"prettier": "^3.0.3",
6263
"publint": "^0.2.2",
63-
"rollup": "^3.29.1",
64+
"rollup": "^3.29.3",
6465
"rollup-plugin-dts": "^5.3.1",
6566
"tslib": "^2.6.2",
6667
"typescript": "^5.2.2",
67-
"vitest": "^0.34.4"
68+
"vitest": "^0.34.5"
6869
}
6970
}

@beautiful-tree/react/package.json

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@beautiful-tree/react",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"private": false,
55
"author": "Andres Correa Casablanca <castarco@coderspirit.xyz>",
66
"license": "MIT",
@@ -37,7 +37,8 @@
3737
"dist"
3838
],
3939
"scripts": {
40-
"build": "rm -rf dist && rollup --config rollup.config.prod.mjs",
40+
"build": "../../scripts/build.sh react",
41+
"build:ci": "rollup --config rollup.config.prod.mjs",
4142
"build-storybook": "storybook build",
4243
"lint": "tsc && eslint . --ext ts,mts,tsx --report-unused-disable-directives --max-warnings 0 && publint",
4344
"lint:eslint": "eslint . --ext ts,mts,tsx --report-unused-disable-directives --max-warnings 0",
@@ -51,41 +52,41 @@
5152
},
5253
"devDependencies": {
5354
"@arethetypeswrong/cli": "^0.10.2",
54-
"@beautiful-tree/algorithms": "workspace:0.2.0",
55-
"@beautiful-tree/types": "workspace:0.2.0",
55+
"@beautiful-tree/algorithms": "workspace:*",
56+
"@beautiful-tree/types": "workspace:*",
5657
"@coderspirit/eslint-config": "^1.2.1",
5758
"@rollup/plugin-node-resolve": "^15.2.1",
5859
"@rollup/plugin-terser": "^0.4.3",
5960
"@rollup/plugin-typescript": "^11.1.3",
60-
"@storybook/addon-essentials": "^7.4.2",
61-
"@storybook/addon-interactions": "^7.4.2",
62-
"@storybook/addon-links": "^7.4.2",
63-
"@storybook/blocks": "^7.4.2",
64-
"@storybook/react": "^7.4.2",
65-
"@storybook/react-vite": "^7.4.2",
61+
"@storybook/addon-essentials": "^7.4.4",
62+
"@storybook/addon-interactions": "^7.4.4",
63+
"@storybook/addon-links": "^7.4.4",
64+
"@storybook/blocks": "^7.4.4",
65+
"@storybook/react": "^7.4.4",
66+
"@storybook/react-vite": "^7.4.4",
6667
"@storybook/testing-library": "^0.2.1",
6768
"@testing-library/react": "^14.0.0",
68-
"@types/node": "^20.6.1",
69-
"@types/react": "^18.2.21",
69+
"@types/node": "^20.6.4",
70+
"@types/react": "^18.2.22",
7071
"@types/react-dom": "^18.2.7",
71-
"@typescript-eslint/parser": "^6.7.0",
72-
"@vitest/coverage-v8": "^0.34.4",
73-
"eslint": "^8.49.0",
72+
"@typescript-eslint/parser": "^6.7.2",
73+
"@vitest/coverage-v8": "^0.34.5",
74+
"eslint": "^8.50.0",
7475
"eslint-plugin-react": "^7.33.2",
7576
"eslint-plugin-react-hooks": "^4.6.0",
7677
"eslint-plugin-react-refresh": "^0.4.3",
77-
"eslint-plugin-storybook": "^0.6.13",
78+
"eslint-plugin-storybook": "^0.6.14",
7879
"jsdom": "^22.1.0",
7980
"prettier": "^3.0.3",
8081
"publint": "^0.2.2",
8182
"react": "^18.2.0",
8283
"react-dom": "^18.2.0",
83-
"rollup": "^3.29.1",
84+
"rollup": "^3.29.3",
8485
"rollup-plugin-dts": "^5.3.1",
85-
"storybook": "^7.4.2",
86+
"storybook": "^7.4.4",
8687
"tslib": "^2.6.2",
8788
"typescript": "^5.2.2",
88-
"vitest": "^0.34.4"
89+
"vitest": "^0.34.5"
8990
},
9091
"peerDependencies": {
9192
"react": "^18.2.0",

@beautiful-tree/types/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"dist"
1818
],
1919
"scripts": {
20-
"build": "rm -rf dist && rollup --config rollup.config.prod.mjs",
20+
"build": "../../scripts/build.sh types",
21+
"build:ci": "rollup --config rollup.config.prod.mjs",
2122
"lint": "tsc && eslint . --ext ts,mts,tsx --report-unused-disable-directives --max-warnings 0 && publint",
2223
"lint:eslint": "eslint . --ext ts,mts,tsx --report-unused-disable-directives --max-warnings 0",
2324
"lint:publint": "publint",
@@ -30,12 +31,12 @@
3031
"@arethetypeswrong/cli": "^0.10.2",
3132
"@coderspirit/eslint-config": "^1.2.1",
3233
"@rollup/plugin-typescript": "^11.1.3",
33-
"@types/node": "^20.6.1",
34-
"@typescript-eslint/parser": "^6.7.0",
35-
"eslint": "^8.49.0",
34+
"@types/node": "^20.6.4",
35+
"@typescript-eslint/parser": "^6.7.2",
36+
"eslint": "^8.50.0",
3637
"prettier": "^3.0.3",
3738
"publint": "^0.2.2",
38-
"rollup": "^3.29.1",
39+
"rollup": "^3.29.3",
3940
"rollup-plugin-dts": "^5.3.1",
4041
"tslib": "^2.6.2",
4142
"typescript": "^5.2.2"

CONTRIBUTING.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Contributing Guidelines
2+
3+
## Code of Conduct
4+
This project and everyone participating in it is governed by our
5+
[Code of Conduct](./CODE_OF_CONDUCT.md). By participating, you are expected to
6+
uphold this code. Please report unacceptable behavior to
7+
contact@coderspirit.xyz.
8+
9+
## How can I contribute?
10+
- Reporting bugs
11+
- Proposing new features or improvements
12+
- For bug reports & proposals, consider the following:
13+
- Always be respectful, and mind the [Code of Conduct](./CODE_OF_CONDUCT.md)
14+
- Check if someone else already reported that bug or proposed that idea.
15+
- Try to be thorough and detailed with your explanations, to help others to
16+
understand them and take proper action.
17+
- Improving the current documentation
18+
- Contributing code
19+
- Always be respectful, and mind the [Code of Conduct](./CODE_OF_CONDUCT.md)
20+
- Backwards compatibility is almost sacred, please try to preserve it.
21+
- Try to respect the current coding style, to avoid style inconsistencies.
22+
23+
## Tooling
24+
25+
1. If you are developing from a Macos system, it is advisable to install the
26+
`findutils` package via `brew` (or your package manager of choice).
27+
2. To save time in CI and have more immediate feedback, it is a good idea to
28+
enable the Git hooks with the command:
29+
```bash
30+
pnpm install-githooks
31+
```
32+
33+
## Code Contributions: Acceptance Criteria
34+
35+
In order for us to accept contributions, the merge request must fulfill certain
36+
requirements:
37+
38+
### Style Guide
39+
40+
There is no "official" style guide, although we enforce style through automated
41+
tools, such as [Prettier](https://prettier.io/) and
42+
[ESLint](https://eslint.org/).
43+
44+
### Commit signatures
45+
For security & regulations compliance, commits must be cryptographically signed
46+
by [PGP](https://www.openpgp.org/)/[GPG](https://gnupg.org/), or SSH
47+
([since git v2.34](https://github.blog/2021-11-15-highlights-from-git-2-34/)).
48+
You can read more about this topic here:
49+
- [Git's documentation](https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work)
50+
- [Github's documentation](https://help.github.com/en/github/authenticating-to-github/signing-commits)
51+
- [Gitlab's documentation](https://docs.gitlab.com/ee/user/project/repository/gpg_signed_commits/).
52+
- [Signing Git commits with your SSH key](https://calebhearth.com/sign-git-with-ssh)
53+
54+
### Commit messages
55+
56+
Commit messages must be properly formatted (following the
57+
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) rules).
58+
The reasons behind this decision are many:
59+
- The project's history has to be "easy" to read.
60+
- It's easier to extract statistics from the commit logs.
61+
- It's easier to generate useful changelogs.
62+
- This practice enforces that committers think twice about the nature of their
63+
contributions.
64+
- It allows us to automate version numbering (following
65+
[Semantic Versioning](https://semver.org/) rules)
66+
67+
### Branch history
68+
69+
The merge request's commits have to present a "clean" history, `git rebase` is
70+
your friend. This means:
71+
- linear history
72+
- commit messages matching what the commit does
73+
- no "experimental" commits + their revert commits

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"name": "beautiful-tree",
3-
"version": "0.1.3",
3+
"version": "0.2.0",
44
"private": true,
55
"author": "Andres Correa Casablanca <castarco@coderspirit.xyz>",
66
"license": "MIT",
77
"scripts": {
8-
"install-githooks": "if [ -d .git ]; then git config core.hooksPath .hooks; fi"
8+
"build": "pnpm -r run build",
9+
"install-githooks": "if [ -d .git ]; then git config core.hooksPath .hooks; fi",
10+
"test": "pnpm -r run test"
911
}
1012
}

0 commit comments

Comments
 (0)