Skip to content

Commit

Permalink
add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
afrokick committed Feb 19, 2022
1 parent 9d6fd16 commit 6bfb586
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .github/prettifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Template for commit messages from Prettifier.
# Placeholders are:
# - {{commitSha}}: the SHA of your commit that Prettifier formats
commitMessage: 'AutoFormat {{commitSha}}'

fixByCommit: true

fixByPullRequest: false

prettified-message: >
I have adjusted the formatting of this pull request for you.
To stop seeing this message, please install Prettier on your machine and run
`meteor npm run format` to format your changes before submitting them.
# Whether to only check branches that have an active pull request.
pulls-only: true
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Unit tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'npm'
- run: npm i
- name: Run tsc-check
run: npm run tsc-check
- name: Run tests
run: npm test
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ All notable changes will be documented in this file.

The main goals of the second version:

- modernize the code base: use `es6` and latest tools
- target to the latest browsers API(you can use webrtc adapter to shim old browsers)
- modernize the code base: use `es6` and latest tools;
- target to the latest browsers API(you can use webrtc adapter to shim old browsers);
- shrink the package size.

### Breaking changes

Expand Down Expand Up @@ -59,6 +60,16 @@ import Peer from 'peerjs/dist/peerjs.min.js';
...
```

#### Remove `dist` folder from git

Please, try to host the package by yourself. It is more securely and you don't depend on third party.

In any case, you can use a CDN like `unpkg.com`:

```html
<script src="https://unpkg.com/[email protected]/dist/peerjs.min.js"></script>
```

#### Use `ESBuild` as bundler.

Parcel 1 was a good choice years ago, but now esbuild seems like simple and good solution!
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
"dev": "",
"esbuild": "esbuild lib/index.ts --bundle --sourcemap --target=es6",
"build": "npm run esbuild -- --outfile=dist/peerjs.js && npm run esbuild -- --minify --outfile=dist/peerjs.min.js",
"prepublishOnly": "npm run test && npm run build",
"test": "mocha -r ts-node/register -r jsdom-global/register test/**/*.ts"
"prepublishOnly": "npm run tsc-check && npm run test && npm run build",
"test": "mocha -r ts-node/register -r jsdom-global/register test/**/*.ts",
"tsc-check": "tsc --noEmit"
},
"release": {
"branch": "master"
Expand Down

0 comments on commit 6bfb586

Please sign in to comment.