Skip to content

Commit 8ef9888

Browse files
author
Weyoss
committed
chore: migrate to monorepo structure
- Reorganized project into a monorepo structure. - Updated build and dependency management scripts. - Adjusted CI/CD pipelines to support monorepo. - Ensured all packages are properly scoped and versioned.
1 parent ba343be commit 8ef9888

File tree

1,037 files changed

+36777
-9222
lines changed

Some content is hidden

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

1,037 files changed

+36777
-9222
lines changed

.eslintrc.cjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ module.exports = {
1818
ecmaVersion: 'latest',
1919
sourceType: 'module',
2020
},
21-
ignorePatterns: ['.eslintrc.cjs', 'node_modules/**', 'dist/**'],
22-
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
21+
ignorePatterns: ['**/.eslintrc.cjs', '**/dist', '**/node_modules', '**/data'],
22+
extends: [
23+
'eslint:recommended',
24+
'plugin:json/recommended-legacy',
25+
'plugin:prettier/recommended',
26+
],
2327
overrides: [
2428
{
2529
files: ['**/*.ts', '**/*.tsx'],
26-
env: {
27-
browser: true,
28-
es6: true,
29-
node: true,
30-
},
30+
env: { browser: true, es6: true, node: true },
3131
extends: [
3232
'eslint:recommended',
3333
'plugin:@typescript-eslint/eslint-recommended',

.github/workflows/codeql.yml

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "code quality"
12+
name: 'code quality'
1313

1414
on:
1515
push:
16-
branches: [ "master" ]
16+
branches: ['master']
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ "master" ]
19+
branches: ['master']
2020

2121
jobs:
2222
analyze:
@@ -30,41 +30,40 @@ jobs:
3030
strategy:
3131
fail-fast: false
3232
matrix:
33-
language: [ 'javascript' ]
33+
language: ['javascript']
3434
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3535
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
3636

3737
steps:
38-
- name: Checkout repository
39-
uses: actions/checkout@v3
38+
- name: Checkout repository
39+
uses: actions/checkout@v3
4040

41-
# Initializes the CodeQL tools for scanning.
42-
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@v2
44-
with:
45-
languages: ${{ matrix.language }}
46-
# If you wish to specify custom queries, you can do so here or in a config file.
47-
# By default, queries listed here will override any specified in a config file.
48-
# Prefix the list here with "+" to use these queries and those in the config file.
49-
50-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
51-
# queries: security-extended,security-and-quality
41+
# Initializes the CodeQL tools for scanning.
42+
- name: Initialize CodeQL
43+
uses: github/codeql-action/init@v2
44+
with:
45+
languages: ${{ matrix.language }}
46+
# If you wish to specify custom queries, you can do so here or in a config file.
47+
# By default, queries listed here will override any specified in a config file.
48+
# Prefix the list here with "+" to use these queries and those in the config file.
5249

53-
54-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55-
# If this step fails, then you should remove it and run the build manually (see below)
56-
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v2
50+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
51+
# queries: security-extended,security-and-quality
5852

59-
# ℹ️ Command-line programs to run using the OS shell.
60-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v2
6157

62-
# If the Autobuild fails above, remove it and uncomment the following three lines.
63-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6460

65-
# - run: |
66-
# echo "Run, Build Application using script"
67-
# ./location_of_script_within_repo/buildscript.sh
61+
# If the Autobuild fails above, remove it and uncomment the following three lines.
62+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
6863

69-
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v2
64+
# - run: |
65+
# echo "Run, Build Application using script"
66+
# ./location_of_script_within_repo/buildscript.sh
67+
68+
- name: Perform CodeQL Analysis
69+
uses: github/codeql-action/analyze@v2

.github/workflows/tests.yml

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ name: ci
44
on:
55
# Triggers the workflow on push or pull request events but only for the master branch
66
push:
7-
branches: [ master ]
7+
branches: [master]
88

99
pull_request:
10-
branches: [ master ]
10+
branches: [master]
1111

1212
# Allows you to run this workflow manually from the Actions tab
1313
workflow_dispatch:
@@ -20,43 +20,58 @@ jobs:
2020
- ubuntu-latest
2121

2222
node:
23-
- 18
2423
- 20
25-
- 22
2624

27-
redis:
28-
- 4
29-
- 5
30-
- 6
31-
- 7
25+
# Dynamically generate the package list by scanning the packages directory
26+
package: ${{ fromJSON(needs.list-packages.outputs.packages) }}
3227

3328
runs-on: ${{ matrix.os }}
3429

35-
steps:
30+
needs:
31+
list-packages
3632

33+
steps:
3734
- name: Use Node.js ${{ matrix.node }}
38-
uses: actions/setup-node@v1
35+
uses: actions/setup-node@v3
3936
with:
4037
node-version: ${{ matrix.node }}
4138

42-
- name: Start Redis ${{ matrix.redis }}
43-
uses: weyoss/redis-github-action@25915a901815971e3f91b3ae7010ab9fdca79392
44-
with:
45-
redis-version: ${{ matrix.redis }}
46-
4739
- name: Check out repository code
48-
uses: actions/checkout@v2
40+
uses: actions/checkout@v3
4941

5042
- name: Install dependencies
51-
run: npm ci
52-
53-
- name: Run type coverage
54-
run: npm run type-coverage
43+
run: pnpm build:ca
44+
continue-on-error: false
5545

5646
- name: Run tests and collect code coverage
57-
run: npm test
47+
run: pnpm -F ${{ matrix.package }} test
48+
if: success()
49+
50+
- name: Navigate to package directory
51+
run: cd packages/${{ matrix.package }}
5852
if: success()
5953

6054
- name: Upload code coverage
6155
uses: codecov/codecov-action@v2
62-
if: success()
56+
with:
57+
name: codecov-${{ matrix.package }}
58+
flags: ${{ matrix.package }}
59+
directory: packages/${{ matrix.package }}/coverage
60+
if: success()
61+
62+
# Job to list all packages in the packages directory
63+
list-packages:
64+
runs-on: ubuntu-latest
65+
66+
outputs:
67+
packages: ${{ steps.set-packages.outputs.packages }}
68+
69+
steps:
70+
- name: Check out repository code
71+
uses: actions/checkout@v3
72+
73+
- name: List packages
74+
id: set-packages
75+
run: |
76+
packages=$(ls -d packages/* | xargs -n 1 basename)
77+
echo "::set-output name=packages::[$packages]"

.gitignore

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,14 @@
1-
# compiled output
2-
/dist
3-
/node_modules
4-
5-
# Logs
6-
logs
7-
*.log
8-
npm-debug.log*
9-
yarn-debug.log*
10-
yarn-error.log*
11-
lerna-debug.log*
12-
13-
# OS
14-
.DS_Store
15-
16-
# Tests
17-
/coverage
18-
/.nyc_output
19-
20-
# IDEs and editors
21-
/.idea
22-
.project
23-
.classpath
24-
.c9/
25-
*.launch
26-
.settings/
27-
*.sublime-workspace
28-
29-
# IDE - VSCode
30-
.vscode/*
31-
!.vscode/settings.json
32-
!.vscode/tasks.json
33-
!.vscode/launch.json
34-
!.vscode/extensions.json
35-
36-
misc/benchmarks
37-
docker-compose.yml
38-
scripts/release*
1+
.idea
2+
.npmrc
3+
dist
4+
**/dist
5+
node_modules
6+
**/node_modules
7+
coverage
8+
**/coverage
9+
data
10+
**/scripts/document.sh
11+
**/scripts/release.sh
12+
**/scripts/benchmark.sh
13+
.husky/_
14+
lerna-debug.log

.husky/commit-msg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env sh
2+
commitlint --edit $1

.husky/pre-commit

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,2 @@
1-
#!/bin/sh
2-
#
3-
# Copyright (c)
4-
# Weyoss <weyoss@protonmail.com>
5-
# https://github.com/weyoss
6-
#
7-
# This source code is licensed under the MIT license found in the LICENSE file
8-
# in the root directory of this source tree.
9-
#
10-
11-
. "$(dirname "$0")/_/husky.sh"
12-
13-
export NVM_DIR="$HOME/.nvm"
14-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
15-
16-
npx lint-staged
1+
#!/usr/bin/env sh
2+
lint-staged

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/dist/*
2+
**/node_modules/*

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"singleQuote": true,
33
"trailingComma": "all"
4-
}
4+
}

0 commit comments

Comments
 (0)