Skip to content

Commit

Permalink
Merge branch 'master' into clone-deep
Browse files Browse the repository at this point in the history
  • Loading branch information
mscuthbert authored Aug 21, 2024
2 parents 29cff31 + 66adc89 commit 2da2985
Show file tree
Hide file tree
Showing 354 changed files with 64,780 additions and 47,655 deletions.
13 changes: 1 addition & 12 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
# For details see http://EditorConfig.org

# maybe top-most EditorConfig file, maybe not
root = false

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
[*.{js,py,ts}]
charset = utf-8

# 4 space indentation
[*.py]
indent_style = space
indent_size = 4

# 4 space indentation
[*.js]
indent_style = space
indent_size = 4
2 changes: 2 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@
"no-console": ["off"],
"no-continue": ["off"],
"no-confusing-arrow": ["off"],
"no-dupe-class-members": ["off"],
"no-else-return": ["off"],
"no-lonely-if": ["off"],
"no-mixed-operators": ["off"],
"no-multi-spaces": ["off"],
"no-multiple-empty-lines": ["error", { "max": 3 }],
"no-param-reassign": ["off"],
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
"no-promise-executor-return": ["off"],
"no-restricted-syntax": [
2,
"DebuggerStatement",
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ on:

jobs:
frontend_tests:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: '10.x'
node-version: 16

- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
submodules: True

Expand All @@ -28,13 +28,13 @@ jobs:
run: grunt test_no_watch

eslint:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: '10.x'
node-version: 16

- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
submodules: True

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ node_modules/grunt-contrib-uglify/package.json
.idea/music21j.iml
.idea/vcs.xml
.idea/workspace.xml
.idea/copilot

# VSCode
*.code-workspace
/tests/test_compile_out/
7 changes: 7 additions & 0 deletions .idea/dictionaries/cuthbert.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 45 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ const path = require('path');
const webpack = require('webpack');
const ESLintPlugin = require('eslint-webpack-plugin');
const package_json = require('./package.json');
const {spawn} = require('child_process');


// run qunit code while grunt watching.
class QUnitInWatch {
apply(compiler) {
compiler.hooks.done.tap('QUnitInWatch', stats => {
const child = spawn('grunt', ['qunit'], {cwd: __dirname});
child.stdout.on('data', function (data) {
process.stdout.write(data);
});
child.stderr.on('data', function (data) {
process.stderr.write(data);
});
});
}
}


module.exports = grunt => {

Expand All @@ -15,7 +33,7 @@ module.exports = grunt => {
+ 'Michael Scott Asato Cuthbert\n'
+ ' * BSD License, see LICENSE\n'
+ ' *\n'
+ ' * http://github.com/cuthbertLab/music21j\n'
+ ' * https://github.com/cuthbertLab/music21j\n'
+ ' */\n';
const BASE_DIR = __dirname;
const BUILD_DIR = path.join(BASE_DIR, 'build');
Expand Down Expand Up @@ -121,7 +139,7 @@ module.exports = grunt => {
modules: false, // do not transform modules; let webpack do it
targets: {
browsers: [
'last 4 years',
'last 2.5 years',
'not < 0.04% in US',
'not firefox < 39',
'not safari < 10',
Expand Down Expand Up @@ -149,7 +167,8 @@ module.exports = grunt => {
webpackTests.entry = TEST_ENTRY;
webpackTests.output.path = TEST_DIR;
webpackTests.output.library = 'm21Tests';
webpackTests.watch = false;
webpackTests.devtool = 'eval-source-map';
webpackTests.plugins.push(new QUnitInWatch());
// webpackTests.cache = true;

// Project configuration.
Expand All @@ -164,6 +183,7 @@ module.exports = grunt => {
mode: 'development',
}, webpackCommon),
test: webpackTests,
test_no_watch: {...webpackTests, watch: false},
},
jsdoc: {
dist: {
Expand All @@ -183,11 +203,23 @@ module.exports = grunt => {
eslint: {
target: SOURCES.concat(TEST_SOURCES),
options: {
configFile: '.eslintrc.json',
overrideConfigFile: '.eslintrc.json',
},
},
qunit: {
files: ['tests/gruntTest.html'],
options: {
puppeteer: {
ignoreDefaultArgs: true,
// these are to get around CORS not loading
// https://github.com/gruntjs/grunt-contrib-qunit/issues/158
args: [
'--headless',
'--disable-web-security',
'--allow-file-access-from-files',
]
}
}
},
watch: {
scripts: {
Expand Down Expand Up @@ -222,17 +254,20 @@ module.exports = grunt => {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-qunit');

// Plugin for the jsdoc task
grunt.loadNpmTasks('grunt-jsdoc');
// Plugin for the jsdoc task -- currently has vulnerabilities.
//grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-eslint');

// Default task(s).
grunt.registerTask('default', ['webpack:build']);
grunt.registerTask('test', 'Watch qunit tests', ['watch:test']);
grunt.registerTask('test_no_watch', 'Run qunit tests', ['webpack:test', 'qunit']);
grunt.registerTask('publish', 'Raise the version and publish', () => {
grunt.task.run('jsdoc');
// grunt.registerTask('test', 'Watch qunit tests', ['watch:test']);
// grunt.registerTask('test_no_watch', 'Run qunit tests', ['webpack:test', 'qunit']);
grunt.registerTask('test', 'Watch qunit tests', ['webpack:test']);
grunt.registerTask('test_no_watch', 'Run qunit tests', ['webpack:test_no_watch', 'qunit']);
grunt.registerTask('publish', 'Raise the version and be ready to publish', () => {
// vulnerable jsdoc versions only available.
// grunt.task.run('jsdoc');
grunt.task.run('bump');
});
};
Loading

0 comments on commit 2da2985

Please sign in to comment.