Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a025a10
chore(monorepo): lerna init
mooooooi Aug 16, 2021
bfddf2f
chore(ci): update main.yml
mooooooi Aug 16, 2021
37f48ee
chore(ci): update main.yml
mooooooi Aug 16, 2021
126124c
chore(ci): update main.yml
mooooooi Aug 16, 2021
3c7cb18
chore(ci): update main.yml
mooooooi Aug 16, 2021
a657e60
chore(ci): update main.yml
mooooooi Aug 16, 2021
e52939a
chore(ci): update main.yml
mooooooi Aug 16, 2021
3e37103
chore(ci): update main.yml
mooooooi Aug 16, 2021
60cfc7c
chore(ci): update main.yml
mooooooi Aug 16, 2021
b55d500
chore(ci): update main.yml
mooooooi Aug 16, 2021
c65ce79
chore(ci): update main.yml
mooooooi Aug 16, 2021
0fcc6bd
chore(ci): update main.yml
mooooooi Aug 16, 2021
ad042c6
chore(ci): update main.yml
mooooooi Aug 16, 2021
b77cc4e
chore(ci): update main.yml
mooooooi Aug 16, 2021
fdd46fd
chore(ci): update main.yml
mooooooi Aug 16, 2021
99b9874
chore(ci): update main.yml
mooooooi Aug 16, 2021
adac343
chore(ci): update main.yml
mooooooi Aug 16, 2021
6137472
chore(ci): update main.yml
mooooooi Aug 16, 2021
f6cb278
chore(ci): update main.yml
mooooooi Aug 16, 2021
5c3c241
chore(ci): update main.yml
mooooooi Aug 16, 2021
533a997
chore(ci): update main.yml
mooooooi Aug 16, 2021
18265e8
chore(ci): update main.yml
mooooooi Aug 16, 2021
0d69671
chore(ci): update main.yml
mooooooi Aug 16, 2021
fe334a4
chore(netcode): change to tsdx dep
mooooooi Aug 16, 2021
f20b02e
chore(netcode): change to tsdx dep
mooooooi Aug 16, 2021
13cf4b3
chore(netcode/ci): coverage ignore
mooooooi Aug 16, 2021
f71d55c
chore(ci): update main.yml
mooooooi Aug 16, 2021
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
193 changes: 126 additions & 67 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,128 @@
name: CI
name: CI Any To Main
on:
push:
branches:
- main
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
pull_request:
branches:
- main
jobs:
build:
name: ${{ matrix.os }} - Node.js v${{ matrix.node }}

runs-on: ${{ matrix.os }}
strategy:
matrix:
# node: ["10.x", "12.x", "14.x"]
node: ["12.x"]
# os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org'

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

# - name: Lint
# run: yarn lint

- name: Test
run: yarn test:coverage --ci --maxWorkers=2

- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}


- name: Build
run: yarn build

- name: Build example
run: yarn example:build

- name: Check version and publish
id: publish
if: ${{ github.event_name == 'push' }}
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}

- if: steps.publish != NaN && steps.publish.outputs != NaN && steps.publish.outputs.type != 'none'
run: |
echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}"

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.4
if: ${{ github.event_name == 'push' }}
with:
branch: gh-pages # The branch the action should deploy to.
folder: example # The folder the action should deploy.
multi_build_and_test:
name: ${{ matrix.os }} - Node.js v${{ matrix.node }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ["12.x", "14.x"]
os: [ubuntu-latest]


steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
registry-url: "https://registry.npmjs.org"

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
with:
install-command: yarn --frozen-lockfile --silent

- name: Test
run: yarn test
# - name: Lint
# run: yarn lint
- name: Build
run: yarn build

testAndUploadCoverall:
needs: multi_build_and_test
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node 12.x
uses: actions/setup-node@v2
with:
node-version: 12.x
registry-url: "https://registry.npmjs.org"

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
with:
install-command: yarn --frozen-lockfile --silent

- name: Test
run: yarn test:ci

- name: Coveralls - ${{ env.package_array }}
uses: coverallsapp/github-action@master
env:
package_array: "netcode"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: packages/${{ env.package_array }}/coverage/lcov.info
base-path: packages/${{ env.package_array }}
parallel: true
flag-name: ${{ env.package_array }}

- name: Coveralls - ${{ env.package_array }}
uses: coverallsapp/github-action@master
env:
package_array: "template"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: packages/${{ env.package_array }}/coverage/lcov.info
base-path: packages/${{ env.package_array }}
parallel: true
flag-name: ${{ env.package_array }}


buildAndPublish:
needs: multi_build_and_test
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node 12.x
uses: actions/setup-node@v2
with:
node-version: 12.x
registry-url: "https://registry.npmjs.org"

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
with:
install-command: yarn --frozen-lockfile --silent

- name: Build
run: yarn build:ci

- name: Monorepo publish
id: publish
run: yarn lerna publish from-git --registry https://registry.npmjs.org/:_authToken=${NPM_TOKEN}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Deploy example 🚀
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages # The branch the action should deploy to.
folder: package/netcode/example # The folder the action should deploy.

finish:
needs: testAndUploadCoverall
runs-on: ubuntu-latest
steps:
- name: Coveralls - Finish
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ coverage
.vscode/
.vscode
example/bundle*
coverage
coverage
*.log
11 changes: 0 additions & 11 deletions babel.config.js

This file was deleted.

8 changes: 8 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"packages": [
"packages/*"
],
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true
}
68 changes: 24 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,37 @@
{
"name": "netcodejs",
"name": "@netcodejs/monorepo",
"private": true,
"version": "0.0.9",
"description": "A js game framework for state-synchronization.",
"module": "dist/netcode.esm.js",
"exports": "./dist/netcode.cjs.js",
"main": "dist/netcode.cjs.js",
"types": "dist/index.d.ts",
"repository": "https://github.com/netcodejs/netcode",
"author": "littlemoi",
"license": "GPL-3.0-or-later",
"workspaces": [
"packages/*"
],
"devDependencies": {
"@babel/core": "^7.12.17",
"@babel/plugin-proposal-class-properties": "^7.12.13",
"@babel/plugin-proposal-decorators": "^7.12.13",
"@babel/preset-env": "^7.12.17",
"@babel/preset-typescript": "^7.12.17",
"@commitlint/cli": "^12.0.1",
"@commitlint/config-conventional": "^12.0.1",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-replace": "^3.0.0",
"@types/jest": "^26.0.20",
"@types/rollup": "^0.54.0",
"babel-jest": "^26.6.3",
"babel-plugin-parameter-decorator": "^1.0.16",
"husky": "^7.0.0",
"jest": "^26.6.3",
"lint-staged": "^10.5.4",
"@commitlint/cli": "^13.1.0",
"@commitlint/config-conventional": "^13.1.0",
"@size-limit/preset-small-lib": "^5.0.3",
"husky": "^7.0.1",
"lint-staged": "^11.1.2",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"rollup": "^2.39.0",
"rollup-plugin-serve": "^1.1.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.30.0",
"ts-node": "^9.1.1",
"tslib": "^2.1.0",
"typescript": "^4.1.5"
"size-limit": "^5.0.3",
"tsdx": "^0.14.1",
"lerna": "^4.0.0",
"rollup-plugin-serve": "^1.1.0"
},
"scripts": {
"build": "rimraf dist/ & yarn run rollup -c",
"build:dev": "rimraf dist/ & yarn run rollup -c rollup.config.dev.js",
"build:nojit": "rimraf dist/ & yarn run rollup -c rollup.config.nojit.js",
"test": "jest",
"example:watch": "yarn run rollup -c rollup.config.example.js --watch",
"example:build": "yarn run rollup -c rollup.config.example.js",
"test:coverage": "jest --coverage",
"prepare": "husky install"
"build": "lerna run build",
"build:ci": "lerna run build:ci",
"test": "lerna run test",
"test:ci": "lerna run test:ci",
"prepare": "lerna bootstrap && husky install"
},
"lint-staged": {
"!(example/bundle).{ts,js,css,md}": "prettier --write"
"*.{ts,js,css,md}": "prettier --write"
},
"dependencies": {},
"files": [
"dist",
"README.md"
]
"dependencies": {
"netcodejs": "file:packages\\netcode",
"template": "file:packages\\template"
}
}
1 change: 1 addition & 0 deletions packages/netcode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
example/bundle*
Loading