Skip to content

Commit 34bbabe

Browse files
authored
deprecate default exports (#441)
* chore: deprecated default exports * changeset * chore: version bump
1 parent 4e05792 commit 34bbabe

Some content is hidden

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

72 files changed

+855
-171
lines changed

.changeset/afraid-buttons-obey.md

-31
This file was deleted.

.changeset/curly-adults-move.md

-15
This file was deleted.

.changeset/lazy-deers-approve.md

-6
This file was deleted.

docs/CHANGELOG.md

+62
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,67 @@
11
# tonal
22

3+
## 6.2.0
4+
5+
### Minor Changes
6+
7+
#### `default` export is deprecated for @tonaljs modules
8+
9+
Using default exports for single packages are deprecated, so instead of:
10+
11+
```js
12+
import Note from "@tonaljs/note";
13+
```
14+
15+
You should do this:
16+
17+
```js
18+
import * as Note from "@tonaljs/note";
19+
```
20+
21+
The same for all modules.
22+
23+
### Patch Changes
24+
25+
#### Fix: add `Note.distance` back
26+
27+
The documentation said `Note.distance` was available, but was not.
28+
29+
Now you can do:
30+
31+
```js
32+
import { Note } from "tonal";
33+
Note.distance("c4", "e7"); // => "24M"
34+
```
35+
36+
#### Fix a bug finding distance between notes when they are in adjacent octaves (see #428)
37+
38+
## 6.1.0
39+
40+
New `rhythm-pattern` package:
41+
42+
```ts
43+
import { RhythmPattern } from "tonal";
44+
45+
RhythmPattern.euclid(8, 3); // => [1, 0, 0, 1, 0, 0, 1, 0]
46+
RhythmPattern.binary(12, 13); // => [1, 1, 0, 0, 1, 1, 0, 1]
47+
RhythmPattern.hex("8f"); // => [1, 0, 0, 0, 1, 1, 1, 1]
48+
RhythmPattern.onsets(1, 2, 2, 1); // => [1, 0, 1, 0, 0, 1, 0, 0, 1, 0]
49+
RhythmPattern.random(4); // => [1, 0, 0, 1]
50+
RhythmPattern.probability([0.6, 0, 0.2, 0.5]); // => [0, 0, 0, 1]
51+
RhythmPattern.rotate([1, 0, 0, 1], 2); // => [0, 1, 1, 0]
52+
```
53+
54+
## 6.0.1
55+
56+
Scale.get ignores case.
57+
58+
Now both calls returns the same scale:
59+
60+
```js
61+
Scale.get("C Major");
62+
Scale.get("c major");
63+
```
64+
365
## 6.0.0
466

567
### Major Changes

packages/abc-notation/CHANGELOG.md

+25
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# @tonaljs/abc-notation
22

3+
## 4.9.0
4+
5+
### Minor Changes
6+
7+
- 56d89f7: #### `default` export is deprecated for @tonaljs modules
8+
9+
Using default exports for single packages are deprecated, so instead of:
10+
11+
```js
12+
import Note from "@tonaljs/note";
13+
```
14+
15+
You should do this:
16+
17+
```js
18+
import * as Note from "@tonaljs/note";
19+
```
20+
21+
The same for all modules.
22+
23+
### Patch Changes
24+
25+
- Updated dependencies [4e05792]
26+
- @tonaljs/pitch-distance@5.0.4
27+
328
## 4.8.3
429

530
### Patch Changes

packages/abc-notation/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export function distance(from: string, to: string): string {
6969
return dist(abcToScientificNotation(from), abcToScientificNotation(to));
7070
}
7171

72+
/** @deprecated */
7273
export default {
7374
abcToScientificNotation,
7475
scientificToAbcNotation,

packages/abc-notation/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tonaljs/abc-notation",
3-
"version": "4.8.3",
3+
"version": "4.9.0",
44
"description": "Parse musical notes in abc notation",
55
"main": "dist/index.js",
66
"module": "dist/index.mjs",
@@ -9,7 +9,7 @@
99
],
1010
"types": "dist/index.d.ts",
1111
"dependencies": {
12-
"@tonaljs/pitch-distance": "5.0.3",
12+
"@tonaljs/pitch-distance": "5.0.4",
1313
"@tonaljs/pitch-note": "6.0.0"
1414
},
1515
"keywords": [

packages/chord-detect/CHANGELOG.md

+26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# @tonaljs/chord-detect
22

3+
## 4.9.0
4+
5+
### Minor Changes
6+
7+
- b113754: #### `default` export is deprecated for @tonaljs modules
8+
9+
Using default exports for single packages are deprecated, so instead of:
10+
11+
```js
12+
import Note from "@tonaljs/note";
13+
```
14+
15+
You should do this:
16+
17+
```js
18+
import * as Note from "@tonaljs/note";
19+
```
20+
21+
The same for all modules.
22+
23+
### Patch Changes
24+
25+
- Updated dependencies [b113754]
26+
- @tonaljs/chord-type@5.1.0
27+
- @tonaljs/pcset@4.10.0
28+
329
## 4.8.5
430

531
### Patch Changes

packages/chord-detect/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tonaljs/chord-detect",
3-
"version": "4.8.5",
3+
"version": "4.9.0",
44
"description": "Detect chord name based on note names",
55
"keywords": [
66
"chord-detect",
@@ -16,9 +16,9 @@
1616
],
1717
"types": "dist/index.d.ts",
1818
"dependencies": {
19-
"@tonaljs/chord-type": "5.0.5",
19+
"@tonaljs/chord-type": "5.1.0",
2020
"@tonaljs/pitch-note": "6.0.0",
21-
"@tonaljs/pcset": "4.9.2"
21+
"@tonaljs/pcset": "4.10.0"
2222
},
2323
"author": "[email protected]",
2424
"license": "MIT",

packages/chord-dictionary/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @tonaljs/chord-dictionary
22

3+
## 4.8.5
4+
5+
### Patch Changes
6+
7+
- Updated dependencies [b113754]
8+
- @tonaljs/chord-type@5.1.0
9+
310
## 4.8.4
411

512
### Patch Changes

packages/chord-dictionary/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tonaljs/chord-dictionary",
3-
"version": "4.8.4",
3+
"version": "4.8.5",
44
"description": "A dictionary of musical chords",
55
"keywords": [],
66
"main": "dist/index.js",
@@ -10,7 +10,7 @@
1010
],
1111
"types": "dist/index.d.ts",
1212
"dependencies": {
13-
"@tonaljs/chord-type": "5.0.5"
13+
"@tonaljs/chord-type": "5.1.0"
1414
},
1515
"author": "[email protected]",
1616
"license": "MIT",

packages/chord-type/CHANGELOG.md

+25
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# @tonaljs/chord-type
22

3+
## 5.1.0
4+
5+
### Minor Changes
6+
7+
- b113754: #### `default` export is deprecated for @tonaljs modules
8+
9+
Using default exports for single packages are deprecated, so instead of:
10+
11+
```js
12+
import Note from "@tonaljs/note";
13+
```
14+
15+
You should do this:
16+
17+
```js
18+
import * as Note from "@tonaljs/note";
19+
```
20+
21+
The same for all modules.
22+
23+
### Patch Changes
24+
25+
- Updated dependencies [b113754]
26+
- @tonaljs/pcset@4.10.0
27+
328
## 5.0.5
429

530
### Patch Changes

packages/chord-type/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tonaljs/chord-type",
3-
"version": "5.0.5",
3+
"version": "5.1.0",
44
"description": "A dictionary of musical chords",
55
"keywords": [
66
"chord",
@@ -17,7 +17,7 @@
1717
],
1818
"types": "dist/index.d.ts",
1919
"dependencies": {
20-
"@tonaljs/pcset": "4.9.2"
20+
"@tonaljs/pcset": "4.10.0"
2121
},
2222
"author": "[email protected]",
2323
"license": "MIT",

packages/chord/CHANGELOG.md

+33
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
# @tonaljs/chord
22

3+
## 6.1.0
4+
5+
### Minor Changes
6+
7+
- 56d89f7: #### `default` export is deprecated for @tonaljs modules
8+
9+
Using default exports for single packages are deprecated, so instead of:
10+
11+
```js
12+
import Note from "@tonaljs/note";
13+
```
14+
15+
You should do this:
16+
17+
```js
18+
import * as Note from "@tonaljs/note";
19+
```
20+
21+
The same for all modules.
22+
23+
### Patch Changes
24+
25+
- Updated dependencies [b113754]
26+
- Updated dependencies [4e05792]
27+
- Updated dependencies [56d89f7]
28+
- @tonaljs/chord-detect@4.9.0
29+
- @tonaljs/chord-type@5.1.0
30+
- @tonaljs/scale-type@4.9.0
31+
- @tonaljs/pcset@4.10.0
32+
- @tonaljs/pitch-distance@5.0.4
33+
- @tonaljs/collection@4.9.0
34+
- @tonaljs/interval@5.1.0
35+
336
## 6.0.0
437

538
### Major Changes

packages/chord/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ export function steps(chordName: ChordNameOrTokens, tonic?: string) {
288288
return tonicIntervalsTransposer(chord.intervals, note);
289289
}
290290

291+
/** @deprecated */
291292
export default {
292293
getChord,
293294
get,

packages/chord/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tonaljs/chord",
3-
"version": "6.0.0",
3+
"version": "6.1.0",
44
"description": "Musical chords and its relations",
55
"keywords": [
66
"chord",
@@ -16,14 +16,14 @@
1616
],
1717
"types": "dist/index.d.ts",
1818
"dependencies": {
19-
"@tonaljs/chord-detect": "4.8.5",
20-
"@tonaljs/chord-type": "5.0.5",
21-
"@tonaljs/collection": "4.8.1",
22-
"@tonaljs/interval": "^5.0.0",
23-
"@tonaljs/pcset": "4.9.2",
24-
"@tonaljs/pitch-distance": "5.0.3",
19+
"@tonaljs/chord-detect": "4.9.0",
20+
"@tonaljs/chord-type": "5.1.0",
21+
"@tonaljs/collection": "4.9.0",
22+
"@tonaljs/interval": "^5.1.0",
23+
"@tonaljs/pcset": "4.10.0",
24+
"@tonaljs/pitch-distance": "5.0.4",
2525
"@tonaljs/pitch-note": "6.0.0",
26-
"@tonaljs/scale-type": "4.8.5"
26+
"@tonaljs/scale-type": "4.9.0"
2727
},
2828
"author": "[email protected]",
2929
"license": "MIT",

0 commit comments

Comments
 (0)