Skip to content

Commit 557cd41

Browse files
Bump to Node 18 and yarn 3
* build: drop support for Node.js 14 * build: use yarn 3.4.1 * build: make scripts use yarn * docs: add CONTRIBUTING.md * build: enable corepack in ci * build: bump to Node.js 18 and Yarn 4
1 parent b8f121a commit 557cd41

7 files changed

Lines changed: 7814 additions & 5366 deletions

File tree

.github/CONTRIBUTING.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
This page contains several pointers for people that want to contribute to this project.
2+
3+
## Setup development environment
4+
5+
Start by cloning this repository.
6+
7+
```bash
8+
$ git clone git@github.com:LinkedSoftwareDependencies/Components-Generator.js.git
9+
```
10+
11+
This project requires [Node.js](https://nodejs.org/en/) `>=18.12` and [Yarn](https://yarnpkg.com/) `>=4` to be installed. Preferable, use the Yarn version provided and managed by Node.js' integrated [CorePack](https://yarnpkg.com/corepack) by running `corepack enable`.
12+
13+
After that, you can install the project by running `yarn install`. This will automatically also run `yarn build`, which you can run again at any time to compile any changed code.
14+
15+
## Continuous integration
16+
17+
Given the critical nature of this project, we require a full (100%) test coverage.
18+
Additionally, we have configured strict linting rules.
19+
20+
These checks are run automatically upon each commit, and via continuous integration.
21+
22+
You can run them manually as follows:
23+
```bash
24+
$ yarn test
25+
$ yarn lint
26+
```
27+
28+
## Code architecture
29+
30+
The architecture is decomposed into 5 main packages:
31+
32+
1. [`config`](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/tree/master/lib/config): Loading a generator from configuration files.
33+
2. [`generate`](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/tree/master/lib/generate): Generating component files by parsing type information from TypeScript and serializing it into JSON-LD.
34+
3. [`parse`](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/tree/master/lib/parse): Parsing components from TypeScript.
35+
4. [`resolution`](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/tree/master/lib/resolution): Resolution of dependencies.
36+
5. [`serialize`](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/tree/master/lib/serialize): Serializing components to JSON-LD.
37+
6. [`util`](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/tree/master/lib/util): Various utilities.

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
- uses: actions/setup-node@v2
1414
with:
1515
node-version: 20.x
16+
- run: corepack enable
1617
- run: yarn install
1718
- run: yarn run lint
1819

@@ -22,8 +23,6 @@ jobs:
2223
matrix:
2324
os: [ubuntu-latest, windows-latest, macos-latest]
2425
node-version:
25-
- 14.x
26-
- 16.x
2726
- 18.x
2827
- 20.x
2928
- 21.x
@@ -32,6 +31,8 @@ jobs:
3231
uses: actions/setup-node@v2
3332
with:
3433
node-version: ${{ matrix.node-version }}
34+
- name: Enable CorePack
35+
run: corepack enable
3536
- name: Ensure line endings are consistent
3637
run: git config --global core.autocrlf input
3738
- name: Check out repository

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
test_files/
77
output/
88
.eslintcache
9+
.yarn/
910

1011
**/lib/**/*.js
1112
**/lib/**/*.js.map

.nvmrc

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

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
"version": "3.1.2",
44
"description": "Automatically generate component files from TypeScript classes for the Components.js dependency injection framework",
55
"main": "index.js",
6+
"packageManager": "yarn@4.0.1",
67
"engines": {
7-
"node": ">=14"
8+
"node": ">=18.12"
89
},
910
"scripts": {
1011
"build": "tsc",
11-
"test": "jest ${1}",
12+
"test": "jest",
1213
"lint": "eslint . --ext .ts --cache",
13-
"prepare": "husky install && npm run build",
14+
"postinstall": "husky install && yarn build",
1415
"version": "manual-git-changelog onversion"
1516
},
1617
"jest": {
@@ -54,9 +55,7 @@
5455
},
5556
"homepage": "https://github.com/LinkedSoftwareDependencies/Components-Generator.js#readme",
5657
"license": "MIT",
57-
"bin": {
58-
"componentsjs-generator": "bin/componentsjs-generator.js"
59-
},
58+
"bin": "bin/componentsjs-generator.js",
6059
"files": [
6160
"bin/**/*.d.ts",
6261
"bin/**/*.js",

0 commit comments

Comments
 (0)