Skip to content

Commit a4c0c24

Browse files
committed
chore: migrate to monorepo
1 parent 6950837 commit a4c0c24

File tree

249 files changed

+11781
-7911
lines changed

Some content is hidden

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

249 files changed

+11781
-7911
lines changed

.github/workflows/docs.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Documentation
22
on:
33
push:
44
branches: [master]
5+
pull_request:
6+
types: [opened, synchronize]
57
jobs:
68
build:
79
runs-on: ubuntu-latest
@@ -11,12 +13,13 @@ jobs:
1113
uses: actions/setup-node@v4
1214
with:
1315
node-version: 20
14-
- run: npm ci
15-
- run: npm run doc
16+
- uses: pnpm/action-setup@v4
17+
- run: pnpm i
18+
- run: pnpm doc
1619
- name: Upload GitHub Pages artifact
1720
uses: actions/upload-pages-artifact@v3
1821
with:
19-
path: docs/
22+
path: packages/melonjs/docs/
2023
deploy:
2124
runs-on: ubuntu-latest
2225
needs: build

.github/workflows/main.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Test
22
on:
33
push:
4+
branches: [master]
45
pull_request:
6+
types: [opened, synchronize]
57
jobs:
68
test:
79
strategy:
@@ -16,7 +18,8 @@ jobs:
1618
uses: actions/setup-node@v4
1719
with:
1820
node-version: ${{ matrix.node }}
19-
- run: npm ci
20-
- run: npm run lint
21-
- run: npx biome check
22-
- run: npm run build
21+
- uses: pnpm/action-setup@v4
22+
- run: pnpm i
23+
- run: pnpm lint
24+
- run: pnpm biome check
25+
- run: pnpm build

.github/workflows/test.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
name: Test
22
on:
33
push:
4+
branches: [master]
45
pull_request:
6+
types: [opened, synchronize]
57
jobs:
68
test:
79
runs-on: ubuntu-latest
810
container:
9-
image: mcr.microsoft.com/playwright:v1.44.1-jammy
11+
image: mcr.microsoft.com/playwright:v1.45.1-jammy
1012
steps:
1113
- uses: actions/checkout@v4
1214
- name: Setup node
1315
uses: actions/setup-node@v4
1416
with:
1517
node-version: 20
16-
- run: npm ci
17-
- run: npm test
18+
- uses: pnpm/action-setup@v4
19+
- run: pnpm i
20+
- run: pnpm test

.gitignore

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Custom
2-
/tests/browser/public/lib/
3-
41
# Eclipse files
52
.project
63
.settings
@@ -10,7 +7,6 @@
107
.DS_Store
118
Thumbs.db
129
Desktop.ini
13-
npm-debug.log
1410

1511
# Vim swap files
1612
*.sw*
@@ -22,9 +18,10 @@ npm-debug.log
2218
# Project specific ignore
2319
add-on/
2420
node_modules/
25-
build/*
21+
**/build/
2622
dist/*
2723
!.placeholder
2824
/_SpecRunner.html
2925
package-lock.json
3026
docs/
27+
.turbo

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"[typescript]": {
77
"editor.defaultFormatter": "biomejs.biome"
88
},
9+
"[typescriptreact]": {
10+
"editor.defaultFormatter": "biomejs.biome"
11+
},
912
"files.eol": "\n",
1013
"editor.codeActionsOnSave": {
1114
"source.fixAll": "explicit",

CONTRIBUTING.md

+14-17
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,25 @@ Please read our [Code of Conduct](./CODE_OF_CONDUCT.md) to keep our community ap
77

88
If this is your first time contributing to an open source project on GitHub, please have a look at [this free tutorial](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github).
99

10-
## Building melonJS
11-
12-
To build your own version of melonJS you will need to install :
13-
14-
- The [Node.js](http://nodejs.org/) JavaScript runtime and the [NPM](https://npmjs.org/) package manager
10+
## Developing melonJS
11+
The only things you need to start developing melonJS is [Node.js](http://nodejs.org/) and [pnpm](https://pnpm.io/installation). melonJS uses [Corepack](https://nodejs.org/api/corepack.html) to manage the package manager version. Follow the instructions to [install pnpm using Corepack](https://pnpm.io/installation#using-corepack). Run `pnpm install` to install third party dependencies.
1512

16-
Once Node.js and NPM have been installed, you need to install build dependencies,
17-
by executing the following in the folder where you cloned the repository :
13+
You can start development mode by running `pnpm dev` which will build melonJS and the docs on every file change and start a Vite dev server with the examples so you can test out your changes in real time.
1814

19-
$ [sudo] npm install
20-
21-
Then build the melonJS source by running:
15+
## Building melonJS
16+
Build the melonJS source by running:
2217

23-
$ npm run build
18+
pnpm build
2419

25-
The generated files will be available under the `build` directory :
26-
- `index.js` : a tree-shakeable ES6 Module Directory
27-
- `index.d.ts` : typescript declaration files
20+
The generated files will be available under the `build` directory:
21+
- `index.js`: melonJS ESM bundle
22+
- `index.js.map`: source map of the bundle
23+
- `*.d.ts`: TS declaration files
24+
- `*.d.ts.map`: TS declaration source maps
2825

29-
To run the melonJS test suite simply use the following:
26+
To run the melonJS test suite use the following:
3027

31-
$ npm run test
28+
pnpm test
3229

3330
Last but not least, if you really want to contribute, but not sure how, you can
3431
always check our [discussions](https://github.com/melonjs/melonJS/discussions/categories/ideas) list to get some idea on where to start.
@@ -37,7 +34,7 @@ always check our [discussions](https://github.com/melonjs/melonJS/discussions/ca
3734

3835
Similarly, you can build your own copy of the docs locally by running :
3936

40-
$ npm run doc
37+
$ pnpm doc
4138

4239
The documentation will be generated under the `docs` directory, and can be accessed by opening index.html in your web browser.
4340

biome.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@
44
"enabled": false
55
},
66
"files": {
7-
"ignore": ["docs/", "build/"]
7+
"ignore": ["docs/", "build/", ".turbo"]
88
},
99
"formatter": { "enabled": true },
10-
"linter": { "enabled": false }
10+
"linter": {
11+
"enabled": true,
12+
"rules": {
13+
"recommended": true,
14+
"nursery": { "recommended": true }
15+
},
16+
"include": ["packages/examples"]
17+
}
1118
}

eslint.config.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default tseslint.config(
1111
{
1212
name: "eslint/global-ignores",
1313
// globally ignore below directories and files
14-
ignores: ["build", "docs/**/*", "rollup.config.mjs", "scripts/build.js"],
14+
ignores: ["**/build", "**/docs/**/*", "**/node_modules", "**/examples"],
1515
},
1616
{
1717
name: "eslint/global-rules",
@@ -22,7 +22,7 @@ export default tseslint.config(
2222
...globals.browser,
2323
},
2424
},
25-
files: ["src/**/*.js", "src/**/*.ts", "tests/**/*.js"],
25+
files: ["**/src/**/*.js", "**/tests/**/*.js"],
2626
plugins: {
2727
jsdoc,
2828
},

0 commit comments

Comments
 (0)