punter.js 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - uses: actions/setup-node@v4
17
+ with:
18
+ node-version: '18'
19
+ cache: npm
20
+
21
+ - name: Install dependencies
22
+ run: npm install
23
+
24
+ - name: Run tests
25
+ run: npm test
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- 22
1
+ 18
package/README.MD CHANGED
@@ -1,5 +1,9 @@
1
1
  # punter.js
2
2
 
3
+ [![Tests](https://github.com/orca-scan/punter.js/actions/workflows/ci.yml/badge.svg)](https://github.com/orca-scan/punter.js/actions/workflows/ci.yml)
4
+ [![npm](https://img.shields.io/npm/v/punter.js)](https://www.npmjs.com/package/punter.js)
5
+ [![license](https://img.shields.io/github/license/orca-scan/punter.js)](https://github.com/orca-scan/punter.js/blob/master/LICENSE)
6
+
3
7
  <p align="center"><img src="images/punterjs.png" width="290" height="174" /></p>
4
8
 
5
9
  A simple, dependency-free 2D game engine for the browser. No build step, no frameworks - just one script tag.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "punter.js",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "A simple, dependency-free 2D game engine for the browser. No build step, no frameworks - just one script tag.",
5
5
  "main": "punter.js",
6
6
  "directories": {
@@ -9,7 +9,7 @@
9
9
  "scripts": {
10
10
  "start": "npx serve .",
11
11
  "start:pong": "npx serve . -l 4000 & npx open-cli http://localhost:4000/games/pong.html",
12
- "test": ". \"$NVM_DIR/nvm.sh\" && nvm use && NODE_ENV=test TZ=UTC node_modules/.bin/jasmine --config=tests/jasmine/config.json"
12
+ "test": "NODE_ENV=test TZ=UTC jasmine --config=tests/jasmine/config.json"
13
13
  },
14
14
  "repository": {
15
15
  "type": "git",
package/tests/setup.js CHANGED
@@ -3,8 +3,6 @@
3
3
  var http = require('http');
4
4
  var fs = require('fs');
5
5
  var path = require('path');
6
- var puppeteer = require('puppeteer');
7
-
8
6
  var ROOT = path.resolve(__dirname, '..');
9
7
  var MIME = { '.html': 'text/html', '.js': 'application/javascript', '.wav': 'audio/wav', '.png': 'image/png' };
10
8
 
@@ -28,6 +26,7 @@ function ensureStarted() {
28
26
  _server.listen(0, '127.0.0.1', resolve);
29
27
  });
30
28
  _baseUrl = 'http://127.0.0.1:' + _server.address().port;
29
+ var puppeteer = (await import('puppeteer')).default;
31
30
  _browser = await puppeteer.launch({ headless: true, args: ['--no-sandbox', '--autoplay-policy=no-user-gesture-required'] });
32
31
  })();
33
32
  return _started;