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

build: modern stack #122

Merged
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
37 changes: 37 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
This page contains several pointers for people that want to contribute to this project.

## Setup development environment

Start by cloning this repository.

```bash
$ git clone [email protected]:LinkedSoftwareDependencies/Components-Generator.js.git
```

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`.

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.

## Continuous integration

Given the critical nature of this project, we require a full (100%) test coverage.
Additionally, we have configured strict linting rules.

These checks are run automatically upon each commit, and via continuous integration.

You can run them manually as follows:
```bash
$ yarn test
$ yarn lint
```

## Code architecture

The architecture is decomposed into 5 main packages:

1. [`config`](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/tree/master/lib/config): Loading a generator from configuration files.
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.
3. [`parse`](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/tree/master/lib/parse): Parsing components from TypeScript.
4. [`resolution`](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/tree/master/lib/resolution): Resolution of dependencies.
5. [`serialize`](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/tree/master/lib/serialize): Serializing components to JSON-LD.
6. [`util`](https://github.com/LinkedSoftwareDependencies/Components-Generator.js/tree/master/lib/util): Various utilities.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 20.x
- run: corepack enable
- run: yarn install
- run: yarn run lint

Expand All @@ -22,8 +23,6 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version:
- 14.x
- 16.x
- 18.x
- 20.x
- 21.x
Expand All @@ -32,6 +31,8 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Enable CorePack
run: corepack enable
- name: Ensure line endings are consistent
run: git config --global core.autocrlf input
- name: Check out repository
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
test_files/
output/
.eslintcache
.yarn/

**/lib/**/*.js
**/lib/**/*.js.map
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
"version": "3.1.2",
"description": "Automatically generate component files from TypeScript classes for the Components.js dependency injection framework",
"main": "index.js",
"packageManager": "[email protected]",
"engines": {
"node": ">=14"
"node": ">=18.12"
},
"scripts": {
"build": "tsc",
"test": "jest ${1}",
"test": "jest",
"lint": "eslint . --ext .ts --cache",
"prepare": "husky install && npm run build",
"postinstall": "husky install && yarn build",
"version": "manual-git-changelog onversion"
},
"jest": {
Expand Down Expand Up @@ -54,9 +55,7 @@
},
"homepage": "https://github.com/LinkedSoftwareDependencies/Components-Generator.js#readme",
"license": "MIT",
"bin": {
"componentsjs-generator": "bin/componentsjs-generator.js"
},
"bin": "bin/componentsjs-generator.js",
"files": [
"bin/**/*.d.ts",
"bin/**/*.js",
Expand Down
Loading
Loading