Skip to content

Commit 4ef5063

Browse files
committed
merge upstream/master, resolve conflicts and sync lockfile for cssnano v7
2 parents 3a1a5f0 + 66db267 commit 4ef5063

37 files changed

+401
-18174
lines changed

.eslintrc.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"root": true,
23
"env": {
34
"es6": true,
45
"browser": true,
@@ -13,8 +14,12 @@
1314
"globalReturn": false
1415
}
1516
},
16-
"extends": ["eslint:recommended"],
17-
"ignorePatterns": ["lib/**"],
17+
"extends": [
18+
"eslint:recommended"
19+
],
20+
"ignorePatterns": [
21+
"lib/**"
22+
],
1823
"rules": {
1924
"no-console": "off",
2025
"no-unused-vars": "off",
@@ -25,12 +30,12 @@
2530
"semi": "error",
2631
"no-duplicate-case": "error",
2732
"no-irregular-whitespace": "warn",
28-
"no-prototype-builtins" : "off",
29-
"no-useless-escape" : "off",
30-
"no-inner-declarations" : "off",
31-
"no-constant-assign" : "off",
32-
"no-const-assign" : "off",
33-
"no-dupe-keys" : "off",
34-
"no-useless-catch" : "off"
33+
"no-prototype-builtins": "off",
34+
"no-useless-escape": "off",
35+
"no-inner-declarations": "off",
36+
"no-constant-assign": "off",
37+
"no-const-assign": "off",
38+
"no-dupe-keys": "off",
39+
"no-useless-catch": "off"
3540
}
3641
}

.github/workflows/node.js.yml

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,38 @@
44
name: Smoke Test
55

66
on:
7-
push:
8-
branches: [master]
9-
pull_request:
10-
branches: [master]
7+
push:
8+
branches: [master]
9+
pull_request:
10+
branches: [master]
1111

1212
jobs:
13-
build:
14-
runs-on: ubuntu-latest
15-
16-
strategy:
17-
matrix:
18-
node-version: [18.x, 20.x]
19-
20-
steps:
21-
- name: Checkout code
22-
uses: actions/checkout@v4
23-
with:
24-
fetch-depth: 0
25-
26-
- name: Use Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v4
28-
with:
29-
node-version: ${{ matrix.node-version }}
30-
31-
- run: npm ci
32-
- run: npm run build --if-present
33-
34-
# Post-run cleanup to remove the build directory after the job finishes
35-
- name: Post-run cleanup
36-
if: always()
37-
run: rm -rf ./build
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
node-version: [18.x, 20.x]
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Use Node.js ${{ matrix.node-version }}
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
cache: "npm"
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Build project
36+
run: npm run build --if-present
37+
38+
# Post-run cleanup to remove the build directory after the job finishes
39+
- name: Post-run cleanup
40+
if: always()
41+
run: rm -rf ./build

Docs/guide-es/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,8 @@ can be used inside the _Pitch-time Matrix_ block.
718718

719719
The _Set Drum_ block is used to map the enclosed pitches into drum
720720
sounds. Drum sounds are played in a monopitch using the specified drum
721-
sample. In the example above, a `kick drum` will be substitued for
722-
each occurance of a `Re` `4`.
721+
sample. In the example above, a `kick drum` will be substituted for
722+
each occurrence of a `Re` `4`.
723723

724724
![alt tag](./drum8.svg " ")
725725

Docs/guide-ja/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -818,8 +818,8 @@ can be used inside the *ピッチ・タイム行列* block.
818818

819819
The *Set ドラム* block is used to map the enclosed pitches into ドラム
820820
sounds. ドラム sounds are played in a monopitch using the specified ドラム
821-
sample. In the example above, a `kick ドラム` will be substitued for
822-
each occurance of a `` `4`.
821+
sample. In the example above, a `kick ドラム` will be substituted for
822+
each occurrence of a `` `4`.
823823

824824
![alt tag](./drum8.svg "ピッチ・ドラム・グラフ 1")
825825

Docs/guide-zhCN/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,8 +755,8 @@ notes.
755755

756756
The *Set Drum* block is used to map the enclosed pitches into drum
757757
sounds. Drum sounds are played in a monopitch using the specified drum
758-
sample. In the example above, a `kick drum` will be substitued for
759-
each occurance of a `Re` `4`.
758+
sample. In the example above, a `kick drum` will be substituted for
759+
each occurrence of a `Re` `4`.
760760

761761
*Set Drum* 块用于将封闭的音高映射到鼓中声音。
762762
鼓声使用指定的鼓在单声道中播放。

css/activities.css

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,12 +1051,12 @@ table {
10511051
}
10521052

10531053
#right-arrow {
1054-
left: 385px;
1054+
right: 25px;
10551055
background: url("../header-icons/right-arrow.png");
10561056
}
10571057

10581058
#left-arrow {
1059-
left: 5px;
1059+
left: 10px;
10601060
background: url("../header-icons/left-arrow.png");
10611061
}
10621062

@@ -1177,12 +1177,14 @@ table {
11771177

11781178
#helpBodyDiv {
11791179
position: relative;
1180-
left: 45px;
1180+
margin: 0 auto !important;
1181+
left: 0 !important;
11811182
border: 0 !important;
11821183
overflow-x: hidden;
11831184
overflow-y: auto;
1184-
width: 350px;
1185-
padding: 1rem 1rem 0 0;
1185+
width: calc(100% - 130px) !important;
1186+
max-width: 350px;
1187+
padding: 1rem 1rem 0 1rem;
11861188
display: flex;
11871189
flex-direction: column;
11881190
justify-content: center;
@@ -2107,7 +2109,7 @@ table {
21072109

21082110
#right-arrow {
21092111
left: auto !important; /* Unset the old fixed pixel value */
2110-
right: 10px !important; /* Stick to the right edge */
2112+
right: 25px !important; /* Stick to the right edge */
21112113
}
21122114

21132115
/* --- Desktop View (Screens wider than 900px) --- */
@@ -2138,7 +2140,8 @@ table {
21382140

21392141
/* Fix the inner text box width so it doesn't overflow */
21402142
#helpBodyDiv {
2141-
width: 100% !important;
2143+
width: calc(100% - 110px) !important;
2144+
margin: 0 auto !important;
21422145
left: 0 !important;
21432146
padding: 0 10px;
21442147
box-sizing: border-box;

gulpfile.mjs

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import gulp from "gulp";
2+
import babel from "gulp-babel";
3+
import uglify from "gulp-uglify";
4+
import rename from "gulp-rename";
5+
import concat from "gulp-concat";
6+
import cleanCSS from "gulp-clean-css";
7+
import * as sassCompiler from "sass";
8+
import gulpSass from "gulp-sass";
9+
import postcss from "gulp-postcss";
10+
import autoprefixer from "autoprefixer";
11+
import cssnano from "cssnano";
12+
import sourcemaps from "gulp-sourcemaps";
13+
import prettier from "gulp-prettier";
14+
15+
const sass = gulpSass(sassCompiler);
16+
17+
const paths = {
18+
scripts: {
19+
src: "js/**/*.js",
20+
dest: "dist/js"
21+
},
22+
styles: {
23+
src: "css/**/*.css",
24+
dest: "dist/css"
25+
},
26+
sass: {
27+
src: "scss/**/*.scss",
28+
dest: "dist/css"
29+
}
30+
};
31+
32+
export function jsTask() {
33+
return gulp
34+
.src(paths.scripts.src)
35+
.pipe(sourcemaps.init())
36+
.pipe(
37+
babel({
38+
presets: ["@babel/preset-env"]
39+
})
40+
)
41+
.pipe(uglify())
42+
.pipe(concat("main.min.js"))
43+
.pipe(sourcemaps.write("."))
44+
.pipe(gulp.dest(paths.scripts.dest));
45+
}
46+
47+
export function cssTask() {
48+
return gulp
49+
.src(paths.styles.src)
50+
.pipe(sourcemaps.init())
51+
.pipe(postcss([autoprefixer(), cssnano()]))
52+
.pipe(cleanCSS())
53+
.pipe(rename({ suffix: ".min" }))
54+
.pipe(sourcemaps.write("."))
55+
.pipe(gulp.dest(paths.styles.dest));
56+
}
57+
58+
export function sassTask() {
59+
return gulp
60+
.src(paths.sass.src)
61+
.pipe(sourcemaps.init())
62+
.pipe(sass().on("error", sass.logError))
63+
.pipe(postcss([autoprefixer(), cssnano()]))
64+
.pipe(cleanCSS())
65+
.pipe(rename({ suffix: ".min" }))
66+
.pipe(sourcemaps.write("."))
67+
.pipe(gulp.dest(paths.sass.dest));
68+
}
69+
70+
export function prettify() {
71+
return gulp.src(paths.scripts.src).pipe(prettier()).pipe(gulp.dest("js"));
72+
}
73+
74+
export const build = gulp.series(gulp.parallel(jsTask, sassTask));
75+
export default build;

js/__tests__/abc.test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ describe("processABCNotes - Basic Note Processing", () => {
5353

5454
beforeEach(() => {
5555
logo = {
56-
notationNotes: { "0": "" },
56+
notationNotes: { 0: "" },
5757
notation: {
5858
notationStaging: {
59-
"0": [
59+
0: [
6060
[["G♯4"], 4, 0, null, null, -1, false],
6161
[["F4"], 4, 0, null, null, -1, false],
6262
[["G♯4"], 2, 0, null, null, -1, false]
@@ -88,7 +88,7 @@ describe("processABCNotes - Advanced Note Handling", () => {
8888
let logo;
8989

9090
beforeEach(() => {
91-
logo = { notationNotes: { "0": "" }, notation: { notationStaging: { "0": [] } } };
91+
logo = { notationNotes: { 0: "" }, notation: { notationStaging: { 0: [] } } };
9292
});
9393

9494
it("should handle frequency (number) inputs", () => {
@@ -125,7 +125,7 @@ describe("processABCNotes - Advanced Note Handling", () => {
125125
describe("processABCNotes - Control Strings", () => {
126126
let logo;
127127
beforeEach(() => {
128-
logo = { notationNotes: { "0": "" }, notation: { notationStaging: { "0": [] } } };
128+
logo = { notationNotes: { 0: "" }, notation: { notationStaging: { 0: [] } } };
129129
});
130130

131131
it("should handle all string commands correctly", () => {
@@ -182,7 +182,7 @@ describe("processABCNotes - Control Strings", () => {
182182
describe("processABCNotes - Chords", () => {
183183
let logo;
184184
beforeEach(() => {
185-
logo = { notationNotes: { "0": "" }, notation: { notationStaging: { "0": [] } } };
185+
logo = { notationNotes: { 0: "" }, notation: { notationStaging: { 0: [] } } };
186186
});
187187

188188
it("should handle chords correctly (Start, Middle, End)", () => {
@@ -218,7 +218,7 @@ describe("processABCNotes - Chords", () => {
218218
describe("processABCNotes - Tuplet Handling", () => {
219219
let logo;
220220
beforeEach(() => {
221-
logo = { notationNotes: { "0": "" }, notation: { notationStaging: { "0": [] } } };
221+
logo = { notationNotes: { 0: "" }, notation: { notationStaging: { 0: [] } } };
222222
});
223223

224224
it("should process standard tuplets correctly", () => {
@@ -270,7 +270,7 @@ describe("processABCNotes - Edge Cases for 100% Coverage", () => {
270270
let logo;
271271

272272
beforeEach(() => {
273-
logo = { notationNotes: { "0": "" }, notation: { notationStaging: { "0": [] } } };
273+
logo = { notationNotes: { 0: "" }, notation: { notationStaging: { 0: [] } } };
274274
});
275275

276276
it("should handle array of notes in NOTATIONNOTE field", () => {
@@ -321,10 +321,10 @@ describe("saveAbcOutput", () => {
321321
activity = {
322322
logo: {
323323
notationOutput: "",
324-
notationNotes: { "0": "" },
324+
notationNotes: { 0: "" },
325325
notation: {
326326
notationStaging: {
327-
"0": [[["G♯4"], 4, 0, null, null, -1, false]]
327+
0: [[["G♯4"], 4, 0, null, null, -1, false]]
328328
}
329329
}
330330
},
@@ -353,10 +353,10 @@ describe("saveAbcOutput", () => {
353353
describe("processABCNotes - Tuplet Handling", () => {
354354
it("should process tuplets correctly", () => {
355355
const logo = {
356-
notationNotes: { "0": "" },
356+
notationNotes: { 0: "" },
357357
notation: {
358358
notationStaging: {
359-
"0": [
359+
0: [
360360
[["G♯4"], 4, 0, 3, 2, -1, false],
361361
[["F4"], 4, 0, 3, 2, -1, false],
362362
[["G♯4"], 4, 0, 3, 2, -1, false]

js/__tests__/artwork.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe("artwork.js Test Suite", () => {
6767
const circles = { highlight: {}, active: {} };
6868
hideButtonHighlight(circles, mockStage);
6969
jest.runAllTimers();
70-
expect(mockStage.removeChild).toBeCalledWith(circles.active, circles.highlight);
70+
expect(mockStage.removeChild).toHaveBeenCalledWith(circles.active, circles.highlight);
7171
jest.useRealTimers();
7272
});
7373

@@ -76,7 +76,7 @@ describe("artwork.js Test Suite", () => {
7676
const paletteText = {};
7777
hidePaletteNameDisplay(paletteText, mockStage);
7878
jest.runAllTimers();
79-
expect(mockStage.removeChild).toBeCalledWith(paletteText);
79+
expect(mockStage.removeChild).toHaveBeenCalledWith(paletteText);
8080
jest.useRealTimers();
8181
});
8282

js/__tests__/languagebox.test.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ Object.defineProperty(global, "localStorage", {
3535
writable: true
3636
});
3737

38-
delete global.window.location;
39-
global.window.location = {
40-
reload: jest.fn()
41-
};
42-
4338
document.querySelectorAll = jest.fn(() => []);
4439

4540
global._ = jest.fn(str => str);
@@ -53,8 +48,10 @@ describe("LanguageBox Class", () => {
5348
});
5449

5550
it("should reload the window when OnClick is called", () => {
51+
const reloadSpy = jest.spyOn(languageBox, "reload").mockImplementation(() => {});
5652
languageBox.OnClick();
57-
expect(global.window.location.reload).toHaveBeenCalled();
53+
expect(reloadSpy).toHaveBeenCalled();
54+
reloadSpy.mockRestore();
5855
});
5956

6057
it("should display 'already set' message when the selected language is the same", () => {

0 commit comments

Comments
 (0)