Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Chord Mark to v0.13.0 #610

Merged
merged 22 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion jest.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ module.exports = {
'\\.svg': 'jest-text-transformer',
},
// whitelisting local modules in the node_modules folder
transformIgnorePatterns: ['<rootDir>.*(node_modules)(?!.*chord-mark.*).*$'],
transformIgnorePatterns: [
'<rootDir>.*(node_modules)(?!.*chord-(symbol|mark).*).*$',
],

moduleNameMapper: {
'\\.(css|scss)$': '<rootDir>/tests/styleMock.js',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@size-limit/preset-app": "^8.1.0",
"@size-limit/webpack": "^8.1.0",
"babel-jest": "^29.2.1",
"babel-loader": "^8.2.2",
"babel-loader": "^9.1.2",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.5.1",
Expand Down Expand Up @@ -41,7 +41,7 @@
"terser-webpack-plugin": "^5.1.4",
"webpack": "^5.36.2",
"webpack-bundle-analyzer": "^4.4.2",
"webpack-cli": "^4.7.2",
"webpack-cli": "^5.0.1",
"webpack-dev-server": "^4.7.2",
"webpack-merge": "^5.8.0"
},
Expand Down
18 changes: 9 additions & 9 deletions packages/chord-chart-studio/SLOC
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Source code:

---------- Result ------------

Physical : 6254
Source : 5180
Physical : 6245
Source : 5174
Comment : 132
Single-line comment : 63
Block comment : 69
Mixed : 9
Empty block comment : 0
Empty : 951
Empty : 948
To Do : 0

Number of files read : 142
Expand All @@ -20,14 +20,14 @@ Tests:

---------- Result ------------

Physical : 7209
Source : 5926
Physical : 7156
Source : 5880
Comment : 67
Single-line comment : 60
Block comment : 7
Mixed : 10
Empty block comment : 0
Empty : 1226
Empty : 1219
To Do : 0

Number of files read : 65
Expand All @@ -38,14 +38,14 @@ Total:

---------- Result ------------

Physical : 13463
Source : 11106
Physical : 13401
Source : 11054
Comment : 199
Single-line comment : 123
Block comment : 76
Mixed : 19
Empty block comment : 0
Empty : 2177
Empty : 2167
To Do : 0

Number of files read : 207
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion packages/chord-chart-studio/build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-EGKBT2J600');</script><link rel="icon" href="app/favicon.png"><script defer="defer" src="app/vendors.6c2b09763d09b4b4339a.js"></script><script defer="defer" src="app/main.6c2b09763d09b4b4339a.js"></script><link href="app/css/main.6c2b09763d09b4b4339a.css" rel="stylesheet"></head><body><div id="app" class="theme-dark"></div></body></html>
gtag('config', 'G-EGKBT2J600');</script><link rel="icon" href="app/favicon.png"><script defer="defer" src="app/vendors.3a60932e92db6c837452.js"></script><script defer="defer" src="app/main.3a60932e92db6c837452.js"></script><link href="app/css/main.3a60932e92db6c837452.css" rel="stylesheet"></head><body><div id="app" class="theme-dark"></div></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */

/*! @license DOMPurify 2.3.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.4/LICENSE */
/*! @license DOMPurify 2.4.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.4/LICENSE */

/*! @license DOMPurify 2.4.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.0/LICENSE */
/*! @license DOMPurify 3.0.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.0/LICENSE */

/*! Universal Router | MIT License | https://www.kriasoft.com/universal-router/ */

Expand Down Expand Up @@ -84,7 +84,7 @@ and limitations under the License.
*
* @copyright 2022 Jason Mulligan <jason.mulligan@avoidwork.com>
* @license BSD-3-Clause
* @version 10.0.5
* @version 10.0.6
*/

/** @license React v16.13.1
Expand Down

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

12 changes: 6 additions & 6 deletions packages/chord-chart-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
"react-test-renderer": "^18.2.0"
},
"dependencies": {
"chord-mark": "^0.12.0",
"chord-mark-converters": "^0.12.0",
"chord-mark-themes": "^0.12.0",
"chord-symbol": "^3.0.0",
"chord-symbol-ultimateguitar": "3.0.0",
"chord-mark": "^0.13.0",
"chord-mark-converters": "^0.13.0",
"chord-mark-themes": "^0.13.0",
"chord-symbol": "^4.0.0",
"chord-symbol-ultimateguitar": "^4.0.0",
"combine-section-reducers": "^1.0.6",
"core-js": "^3.20.2",
"dompurify": "^2.2.9",
"dompurify": "^3.0.0",
"file-saver": "^2.0.5",
"filesize": "^10.0.5",
"lodash": "^4.17.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/chord-chart-studio/scss/abstract/_colors.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Dark theme
// Source: https://coolors.co/f4f4f4-2e4052-303846-293132-fabf2b
// Source: https://coolors.co/f4f4f4-2e4052-303846-293132-fabf2b-74f14e
$whiteSmoke: rgba(244, 244, 244, 1);
$onyx: rgba(48, 56, 70, 1);
$charcoal: rgba(46, 64, 82, 1);
Expand Down
12 changes: 6 additions & 6 deletions packages/chord-chart-studio/src/core/createGetVersions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ const packageJson = require('../../package.json');
const cmPackageJson = require('../../node_modules/chord-mark/package.json');
const fs = require('fs');

const chordChartStudioVersion = 'v' + packageJson.version;
const chordChartStudioVersion = packageJson.version;
const chordMarkVersion = packageJson.dependencies['chord-mark'].replace(
'^',
'v'
''
);
const chordSymbolVersion = cmPackageJson.dependencies['chord-symbol'].replace(
'^',
'v'
''
);

const version = {
'chord-chart-studio': chordChartStudioVersion,
'chord-symbol': chordSymbolVersion,
'chord-mark': chordMarkVersion,
'chord-chart-studio': 'v' + chordChartStudioVersion,
'chord-symbol': 'v' + chordSymbolVersion,
'chord-mark': 'v' + chordMarkVersion,
};

const serialized = JSON.stringify(version).replace(/"/g, "'");
Expand Down
2 changes: 1 addition & 1 deletion packages/chord-chart-studio/src/core/getVersions.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default () => ({'chord-chart-studio':'v0.13.0','chord-symbol':'3.0.0','chord-mark':'v0.12.0'});
export default () => ({'chord-chart-studio':'v0.13.0','chord-symbol':'v4.0.0','chord-mark':'v0.13.0'});
7 changes: 6 additions & 1 deletion packages/chord-chart-studio/src/core/renderSong.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ function render(songTxt, renderOptions, useChartFormat, outputFormat) {
customRenderer: chordMark2UltimateGuitar(),
printBarSeparators: 'grids',
printChordsDuration: 'never',
printSubBeatDelimiters: false,
printInlineTimeSignatures: false,
chordSymbolRenderer: chordRendererFactory({
customFilters: [chordSymbolUltimateGuitar()],
useShortNamings: true,
useFlats: renderOptions.accidentalsType === 'flat',
accidentalsType:
renderOptions.accidentalsType === 'auto'
? 'original'
: renderOptions.accidentalsType,
...renderOptions, // duh!
}),
}) +
Expand Down
14 changes: 4 additions & 10 deletions packages/chord-chart-studio/src/db/options/editorModeOptions.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
const editorModeOptions = {
edit: [
'theme',

'transposeValue',
'harmonizeAccidentals',
'preferredAccidentals',
],
edit: ['theme', 'transposeValue', 'preferredAccidentals', 'symbolType'],
play: [
'theme',

'transposeValue',
'harmonizeAccidentals',
'preferredAccidentals',
'symbolType',

'chartType',
'alignChordsWithLyrics',
Expand All @@ -25,8 +19,8 @@ const editorModeOptions = {
],
print: [
'transposeValue',
'harmonizeAccidentals',
'preferredAccidentals',
'symbolType',

'chartType',
'alignChordsWithLyrics',
Expand All @@ -44,8 +38,8 @@ const editorModeOptions = {
'chartFormat',

'transposeValue',
'harmonizeAccidentals',
'preferredAccidentals',
'symbolType',

'chartType',
'alignChordsWithLyrics',
Expand Down
4 changes: 2 additions & 2 deletions packages/chord-chart-studio/src/db/options/seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export default {
songPreferences: {
values: {
transposeValue: 0,
harmonizeAccidentals: true,
preferredAccidentals: 'auto',
symbolType: 'chord',
},
defaults: {
transposeValue: 0,
harmonizeAccidentals: true,
preferredAccidentals: 'auto',
symbolType: 'chord',
},
//userDefaults: {},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ export default function exportSelectedFileAsText() {
'songPreferences',
'transposeValue'
),
harmonizeAccidentals: getOptionValue(
state,
'songPreferences',
'harmonizeAccidentals'
),
accidentalsType: getOptionValue(
state,
'songPreferences',
'accidentalsType'
),
symbolType: getOptionValue(state, 'songPreferences', 'symbolType'),

chartType: getOptionValue(state, 'songFormatting', 'chartType'),
alignChordsWithLyrics: getOptionValue(
Expand Down
2 changes: 1 addition & 1 deletion packages/chord-chart-studio/src/gettingStarted.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ Where to start? You can either:
- check the sample song on the left
- read the user guide, by clicking the big yellow button in the top right corner

Have fun!
Have fun!
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ export const getNonInteractableWidgets = (state) => {
}
}

const harmonizeAccidentals = getOptionValue(
state,
'songPreferences',
'harmonizeAccidentals'
);

if (!harmonizeAccidentals) {
nonInteractableWidgets.push('preferredAccidentals');
}

return nonInteractableWidgets;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export default {

groupWidgetsOrder: [
'transposeValue',
'harmonizeAccidentals',
'preferredAccidentals',
'symbolType',
],
allGroupWidgets: {
transposeValue: {
Expand All @@ -97,15 +97,6 @@ export default {
},
},

harmonizeAccidentals: {
label: 'Harmonize accidentals',
type: 'toggle',
option: {
context: 'songPreferences',
key: 'harmonizeAccidentals',
},
},

preferredAccidentals: {
label: 'Preferred accidentals',
type: 'select',
Expand Down Expand Up @@ -133,6 +124,29 @@ export default {
key: 'preferredAccidentals',
},
},

symbolType: {
label: 'Symbols type',
type: 'select',
typeOptions: {
allChoices: [
{
id: 'symbolTypeChord',
label: 'Chord symbols',
value: 'chord',
},
{
id: 'symbolTypeRoman',
label: 'Roman numerals',
value: 'roman',
},
],
},
option: {
context: 'songPreferences',
key: 'symbolType',
},
},
},
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ function SongRenderer(props) {
'chartFormat',

'transposeValue',
'harmonizeAccidentals',
'accidentalsType',
'symbolType',

'chartType',
'alignChordsWithLyrics',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@ import SongRenderer from '../_components/SongRenderer';
export default connect((state) => ({
// songPreferences
transposeValue: getOptionValue(state, 'songPreferences', 'transposeValue'),
harmonizeAccidentals: getOptionValue(
state,
'songPreferences',
'harmonizeAccidentals'
),
accidentalsType: getOptionValue(
state,
'songPreferences',
'preferredAccidentals'
),
symbolType: getOptionValue(state, 'songPreferences', 'symbolType'),

// songFormatting
chartFormat: getOptionValue(state, 'editorPreferences', 'chartFormat'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ function PrintPreview(props) {

const renderOptions = _pick(props, [
'transposeValue',
'harmonizeAccidentals',
'accidentalsType',
'symbolType',

'chartType',
'alignChordsWithLyrics',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ import PrintPreview from '../_components/PrintPreview';

export default connect((state) => ({
// songPreferences
harmonizeAccidentals: getOptionValue(
state,
'songPreferences',
'harmonizeAccidentals'
),
accidentalsType: getOptionValue(
state,
'songPreferences',
'preferredAccidentals'
),
transposeValue: getOptionValue(state, 'songPreferences', 'transposeValue'),
symbolType: getOptionValue(state, 'songPreferences', 'symbolType'),

// songFormatting
chartType: getOptionValue(state, 'songFormatting', 'chartType'),
Expand Down
Loading