Skip to content

Commit

Permalink
chore: migrate to monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
hornta committed Jul 8, 2024
1 parent 6950837 commit c1836f3
Show file tree
Hide file tree
Showing 249 changed files with 11,161 additions and 7,904 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run doc
- uses: pnpm/action-setup@v4
- run: pnpm i
- run: pnpm doc
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm run lint
- run: npx biome check
- run: npm run build
- uses: pnpm/action-setup@v4
- run: pnpm i
- run: pnpm lint
- run: pnpm biome check
- run: pnpm build
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm test
- uses: pnpm/action-setup@v4
- run: pnpm i
- run: pnpm test
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Custom
/tests/browser/public/lib/

# Eclipse files
.project
.settings
Expand All @@ -10,7 +7,6 @@
.DS_Store
Thumbs.db
Desktop.ini
npm-debug.log

# Vim swap files
*.sw*
Expand All @@ -22,9 +18,10 @@ npm-debug.log
# Project specific ignore
add-on/
node_modules/
build/*
**/build/
dist/*
!.placeholder
/_SpecRunner.html
package-lock.json
docs/
.turbo
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"files.eol": "\n",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
Expand Down
31 changes: 14 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,25 @@ Please read our [Code of Conduct](./CODE_OF_CONDUCT.md) to keep our community ap

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

## Building melonJS

To build your own version of melonJS you will need to install :

- The [Node.js](http://nodejs.org/) JavaScript runtime and the [NPM](https://npmjs.org/) package manager
## Developing melonJS
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.

Once Node.js and NPM have been installed, you need to install build dependencies,
by executing the following in the folder where you cloned the repository :
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.

$ [sudo] npm install

Then build the melonJS source by running:
## Building melonJS
Build the melonJS source by running:

$ npm run build
pnpm build

The generated files will be available under the `build` directory :
- `index.js` : a tree-shakeable ES6 Module Directory
- `index.d.ts` : typescript declaration files
The generated files will be available under the `build` directory:
- `index.js`: melonJS ESM bundle
- `index.js.map`: source map of the bundle
- `*.d.ts`: TS declaration files
- `*.d.ts.map`: TS declaration source maps

To run the melonJS test suite simply use the following:
To run the melonJS test suite use the following:

$ npm run test
pnpm test

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

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

$ npm run doc
$ pnpm doc

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

Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"enabled": false
},
"files": {
"ignore": ["docs/", "build/"]
"ignore": ["docs/", "build/", ".turbo"]
},
"formatter": { "enabled": true },
"linter": { "enabled": false }
Expand Down
4 changes: 2 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default tseslint.config(
{
name: "eslint/global-ignores",
// globally ignore below directories and files
ignores: ["build", "docs/**/*", "rollup.config.mjs", "scripts/build.js"],
ignores: ["**/build", "**/docs/**/*"],
},
{
name: "eslint/global-rules",
Expand All @@ -22,7 +22,7 @@ export default tseslint.config(
...globals.browser,
},
},
files: ["src/**/*.js", "src/**/*.ts", "tests/**/*.js"],
files: ["**/src/**/*.js", "**/tests/**/*.js"],
plugins: {
jsdoc,
},
Expand Down
Loading

0 comments on commit c1836f3

Please sign in to comment.