Skip to content

Commit d72d035

Browse files
Merge branch 'main' into worklets-instance-mode
2 parents 3de34ec + c7073ec commit d72d035

File tree

232 files changed

+24161
-139580
lines changed

Some content is hidden

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

232 files changed

+24161
-139580
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
Gruntfile.js
2-
test/test.js
32
webpack.config.js
43
lib/

.eslintrc

Lines changed: 19 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -13,67 +13,29 @@
1313
"Float32Array": true,
1414
"Uint8Array": true
1515
},
16+
"extends": ["eslint:recommended", "prettier"],
17+
"plugins": ["prettier"],
1618
"rules": {
17-
"block-scoped-var": 0,
18-
"camelcase": 0,
19-
"comma-style": [
20-
2,
21-
"last"
22-
],
23-
"dot-notation": [
19+
"prettier/prettier": ["error"],
20+
"no-cond-assign": [2, "except-parens"],
21+
"eqeqeq": ["error", "smart"],
22+
"no-use-before-define": [
2423
2,
2524
{
26-
"allowKeywords": true
25+
"functions": false
2726
}
2827
],
29-
"eqeqeq": [
30-
2,
31-
"allow-null"
32-
],
33-
"eol-last": ["error", "always"],
34-
"guard-for-in": 2,
35-
"indent": ["error", 2, { "SwitchCase": 1 }],
36-
"max-len": [1, 120, 2, { "ignoreComments": true }],
37-
"new-cap": 2,
28+
"new-cap": 0,
3829
"no-caller": 2,
39-
"no-cond-assign": [
40-
2,
41-
"except-parens"
42-
],
43-
"no-debugger": 2,
44-
"no-empty": 2,
45-
"no-eval": 2,
46-
"no-extend-native": 2,
47-
"no-extra-parens": 2,
48-
"no-extra-semi": 2,
49-
"no-irregular-whitespace": 2,
50-
"no-trailing-spaces": 2,
51-
"no-iterator": 2,
52-
"no-loop-func": 0,
53-
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1 }],
54-
"no-multi-str": 2,
55-
"no-new": 2,
56-
"no-plusplus": 0,
57-
"no-proto": 2,
58-
"no-script-url": 2,
59-
"no-sequences": 2,
60-
"no-shadow": 2,
61-
"no-undef": 2,
62-
"no-unused-vars": 2,
63-
"no-with": 2,
64-
"quotes": [
65-
2,
66-
"single"
67-
],
68-
"semi": [
69-
2
70-
],
71-
"space-before-blocks": "error",
72-
"strict": 2,
73-
"valid-typeof": 2,
74-
"wrap-iife": [
75-
2,
76-
"inside"
77-
]
78-
}
30+
"no-undef": 0,
31+
"no-unused-vars": ["error", { "args": "none" }],
32+
"no-empty": ["error", { "allowEmptyCatch": true }],
33+
"no-console": "off"
34+
35+
},
36+
"parserOptions": {
37+
"ecmaVersion": 8,
38+
"sourceType": "module",
39+
"allowImportExportEverywhere": true
40+
}
7941
}

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: processing
2+
custom: https://processingfoundation.org/

.github/workflows/ci-lint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Linting
5+
6+
on:
7+
push:
8+
branches: [ main ]
9+
pull_request:
10+
branches: [ main ]
11+
12+
jobs:
13+
lint:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [10.x, 12.x]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
- run: npm ci
28+
- run: npm run lint

.github/workflows/ci-test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [10.x, 12.x]
15+
16+
17+
steps:
18+
- uses: actions/checkout@v1
19+
- name: Use Node.js ${{ matrix.node-version }}
20+
uses: actions/setup-node@v1
21+
with:
22+
node-version: ${{ matrix.node-version }}
23+
- name: Get node modules
24+
run: npm ci
25+
env:
26+
CI: true
27+
- name: Build
28+
run: npm run build
29+
env:
30+
CI: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ examples/__test
44
p5soundnotes
55
*.DS_Store
66
.vscode
7+
lib/p5.*

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Gruntfile.js
2+
webpack.config.js
3+
lib/

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

Gruntfile.js

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,36 @@ module.exports = function(grunt) {
44

55
grunt.initConfig({
66
pkg: grunt.file.readJSON('package.json'),
7-
7+
decomment: {
8+
any: {
9+
// remove comments added by webpack from the build
10+
files: {
11+
"./lib/p5.sound.js": "./lib/p5.sound.js",
12+
},
13+
options: {
14+
ignore: [
15+
// keep JSDoc comments (p5.js repo's YUIDoc task parses those for documentation)
16+
/\/\*\*\s*\n([^\*]|(\*(?!\/)))*\*\//g,
17+
// keep the version number
18+
/.*Version.*/
19+
]
20+
}
21+
}
22+
},
823
// Configure style consistency
924
eslint: {
1025
source: {
11-
options: {configFile: './.eslintrc'},
26+
options: {
27+
configFile: './.eslintrc',
28+
fix: true
29+
},
30+
src: ['src/**/*.js', 'test/tests/**/*.js']
31+
},
32+
sourceNofix: {
33+
options: {
34+
configFile: './.eslintrc',
35+
fix: false
36+
},
1237
src: ['src/**/*.js', 'test/tests/**/*.js']
1338
}
1439
},
@@ -38,18 +63,29 @@ module.exports = function(grunt) {
3863
hostname: '*'
3964
}
4065
}
41-
}
66+
},
67+
githooks: {
68+
all: {
69+
options:{
70+
template:"templates/pre-commit-hook.js"
71+
},
72+
'pre-commit':'lint-nofix' //runs elint in -nofix mode before every git commit
73+
}
74+
}
4275
});
4376

44-
77+
4578
grunt.loadNpmTasks('grunt-webpack');
4679
grunt.loadNpmTasks('grunt-eslint');
4780
grunt.loadNpmTasks('grunt-contrib-connect');
4881
grunt.loadNpmTasks('grunt-open');
82+
grunt.loadNpmTasks('grunt-decomment');
83+
grunt.loadNpmTasks('grunt-githooks');
4984

5085
grunt.registerTask('lint', ['eslint:source']);
51-
grunt.registerTask('default', ['webpack:prod']);
52-
grunt.registerTask('dev', ['connect','webpack:dev']);
86+
grunt.registerTask('lint-nofix', ['eslint:sourceNofix']);
87+
grunt.registerTask('default', ['webpack:prod', 'decomment']);
88+
grunt.registerTask('dev', ['eslint','connect','webpack:dev', 'decomment']);
5389
grunt.registerTask('serve', 'connect:server:keepalive');
5490
grunt.registerTask('run-tests', ['serve', 'open']);
5591
};

0 commit comments

Comments
 (0)