Skip to content

Commit 95d8841

Browse files
committed
build(monorepo): implementation of a multi-package architecture
1 parent 08e364d commit 95d8841

Some content is hidden

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

70 files changed

+522
-497
lines changed

.commitlintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": ["@commitlint/config-conventional"],
33
"rules": {
4-
"scope-enum": [2, "always", ["core", "website", "tools", "github"]],
4+
"scope-enum": [2, "always", ["core", "github", "monorepo", "tools", "website"]],
55
"scope-empty": [0, "never"]
66
}
77
}

.editorconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,3 @@ trim_trailing_whitespace = false
4141
indent_style = space
4242
indent_size = 4
4343
trim_trailing_whitespace = false
44-
45-
[.gitmodules]
46-
indent_style = tab
47-
indent_size = 4

.github/CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,11 @@ The commit messages must follow the [Conventional Commits specification](https:/
142142

143143
The following `scope` are allowed:
144144

145-
- `core`: Dragula2 source code
146-
- `website`: presentation and demo website
147-
- `tools`: the external tools put in place to improve the development experience
145+
- `core`: Dragula2 source code (`@dragula2/core` package)
148146
- `github`: management of the github account and its tools
147+
- `monorepo`: monorepository management
148+
- `tools`: the external tools put in place to improve the development experience
149+
- `website`: presentation and demo website
149150

150151
The following `types` are allowed:
151152

.github/actions/install/action.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ inputs:
88
required: false
99
node_version:
1010
description: 'Version of node'
11-
default: 17
11+
default: 18
1212
required: false
1313
pnpm_version:
1414
description: 'Version of pnpm'
15-
default: 6.10.0
15+
default: 8.2.0
1616
required: false
1717

1818
# Add cache for pnpm / node / node_module?

.github/workflows/continuous-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
-
3535
name: 'Launch build'
3636
shell: sh
37-
run: pnpm run build
37+
run: pnpm run --filter="@dragula2/core" build
3838
-
3939
name: '[GITHUB / OFFICIAL] Setup Pages'
4040
uses: actions/configure-pages@c5a3e1159e0cbdf0845eb8811bd39e39fc3099c2 # v2.1.3

.github/workflows/continuous-integration.yaml

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -46,31 +46,32 @@ jobs:
4646
level: 'error'
4747
reporter: 'github-check'
4848

49-
javascript-quality:
50-
name: '[LINT] Javascript quality'
51-
runs-on: ubuntu-latest
52-
steps:
53-
-
54-
name: '[GITHUB / OFFICIAL] Checkout'
55-
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
56-
with:
57-
fetch-depth: 0
58-
-
59-
name: '[INTERNAL] Install project & environment'
60-
uses: ./.github/actions/install
61-
with:
62-
architecture: x64
63-
node_version: 18
64-
-
65-
name: '[OSS / REVIEW DOG] Launch eslint'
66-
uses: reviewdog/action-eslint@d3395027ea2cfc5cf8f460b1ea939b6c86fea656 # v1.17.0
67-
with:
68-
eslint_flags: '--color --no-inline-config .eslintrc.json ./{__tests__,src}/**/*.js'
69-
fail_on_error: true
70-
github_token: ${{ secrets.GITHUB_TOKEN }}
71-
level: 'error'
72-
reporter: 'github-check'
49+
# javascript-quality:
50+
# name: '[LINT] Javascript quality'
51+
# runs-on: ubuntu-latest
52+
# steps:
53+
# -
54+
# name: '[GITHUB / OFFICIAL] Checkout'
55+
# uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
56+
# with:
57+
# fetch-depth: 0
58+
# -
59+
# name: '[INTERNAL] Install project & environment'
60+
# uses: ./.github/actions/install
61+
# with:
62+
# architecture: x64
63+
# node_version: 18
64+
# -
65+
# name: '[OSS / REVIEW DOG] Launch eslint'
66+
# uses: reviewdog/action-eslint@d3395027ea2cfc5cf8f460b1ea939b6c86fea656 # v1.17.0
67+
# with:
68+
# eslint_flags: '--color --no-inline-config .eslintrc.json ./{__tests__,src}/**/*.js'
69+
# fail_on_error: true
70+
# github_token: ${{ secrets.GITHUB_TOKEN }}
71+
# level: 'error'
72+
# reporter: 'github-check'
7373

74+
# @todo: should be launched by package
7475
markdown-quality:
7576
name: '[LINT] Markdown quality'
7677
runs-on: ubuntu-latest
@@ -87,9 +88,10 @@ jobs:
8788
fail_on_error: true
8889
github_token: ${{ secrets.GITHUB_TOKEN }}
8990
level: 'error'
90-
markdownlint_flags: '. --config .markdownlint.json'
91+
markdownlint_flags: '. --config ./tools/lint/.markdownlint.json'
9192
reporter: 'github-check'
9293

94+
# @todo: should be launched by package
9395
code-quality:
9496
name: '[LINT] Code quality'
9597
runs-on: ubuntu-latest
@@ -106,12 +108,14 @@ jobs:
106108
DEFAULT_BRANCH: 'main'
107109
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108110
VALIDATE_ALL_CODEBASE: false
109-
VALIDATE_CSS: true
111+
# VALIDATE_CSS: true
110112
VALIDATE_ENV: true
111113
VALIDATE_GITLEAKS: true
112114

115+
# @todo: should be launched by package
113116
tests-with-jest:
114-
needs: [commit-quality, github-action-quality, javascript-quality, markdown-quality, code-quality]
117+
needs: [commit-quality, github-action-quality, markdown-quality, code-quality]
118+
# needs: [commit-quality, github-action-quality, javascript-quality, markdown-quality, code-quality]
115119
strategy:
116120
matrix:
117121
ARCHITECTURE: [x64]
@@ -132,14 +136,16 @@ jobs:
132136
-
133137
name: 'Launch build'
134138
shell: sh
135-
run: pnpm run build
139+
run: pnpm run --filter="@dragula2/core" build
136140
-
137141
name: 'Launch test'
138142
shell: sh
139-
run: pnpm run test:ci
143+
run: pnpm run --filter="@dragula2/core" test:ci
140144

145+
# @todo: should be launched by package
141146
tests-with-tape:
142-
needs: [commit-quality, github-action-quality, javascript-quality, markdown-quality, code-quality]
147+
needs: [commit-quality, github-action-quality, markdown-quality, code-quality]
148+
# needs: [commit-quality, github-action-quality, javascript-quality, markdown-quality, code-quality]
143149
strategy:
144150
matrix:
145151
ARCHITECTURE: [x64]
@@ -164,17 +170,17 @@ jobs:
164170
-
165171
name: 'Launch build'
166172
shell: sh
167-
run: pnpm run build
173+
run: pnpm run --filter="@dragula2/core" build
168174
-
169175
name: '[For UbuntuOS] Launch test'
170176
if: matrix.OS == 'ubuntu-latest'
171177
shell: sh
172-
run: xvfb-run --auto-servernum pnpm run test:old
178+
run: xvfb-run --auto-servernum pnpm run --filter="@dragula2/core" test:old
173179
-
174180
name: 'Launch test'
175181
if: matrix.OS != 'ubuntu-latest'
176182
shell: sh
177-
run: pnpm run test:old
183+
run: pnpm run --filter="@dragula2/core" test:old
178184

179185
tests-end:
180186
needs: [tests-with-jest, tests-with-tape]

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ lib-cov
2828
coverage
2929
*.lcov
3030

31+
# Turbo cache
32+
.turbo
33+
3134
# TypeScript cache
3235
*.tsbuildinfo
3336

@@ -36,6 +39,3 @@ coverage
3639

3740
# Optional eslint cache
3841
.eslintcache
39-
40-
# Tests
41-
test/test.html

.lintstagedrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"{__tests__,src}/**/*.js": ["pnpm run lint:tool:eslint --fix", "git add ."],
3-
"**/*.{css,html,json,md}": ["pnpm run lint:tool:prettier --write", "git add ."]
2+
"**/package.json": ["sort-package-json", "git add ."]
43
}

0 commit comments

Comments
 (0)