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

Chore/deprecate default exports #441

Merged
merged 3 commits into from
Jul 23, 2024
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
31 changes: 0 additions & 31 deletions .changeset/afraid-buttons-obey.md

This file was deleted.

15 changes: 0 additions & 15 deletions .changeset/curly-adults-move.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/lazy-deers-approve.md

This file was deleted.

62 changes: 62 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,67 @@
# tonal

## 6.2.0

### Minor Changes

#### `default` export is deprecated for @tonaljs modules

Using default exports for single packages are deprecated, so instead of:

```js
import Note from "@tonaljs/note";
```

You should do this:

```js
import * as Note from "@tonaljs/note";
```

The same for all modules.

### Patch Changes

#### Fix: add `Note.distance` back

The documentation said `Note.distance` was available, but was not.

Now you can do:

```js
import { Note } from "tonal";
Note.distance("c4", "e7"); // => "24M"
```

#### Fix a bug finding distance between notes when they are in adjacent octaves (see #428)

## 6.1.0

New `rhythm-pattern` package:

```ts
import { RhythmPattern } from "tonal";

RhythmPattern.euclid(8, 3); // => [1, 0, 0, 1, 0, 0, 1, 0]
RhythmPattern.binary(12, 13); // => [1, 1, 0, 0, 1, 1, 0, 1]
RhythmPattern.hex("8f"); // => [1, 0, 0, 0, 1, 1, 1, 1]
RhythmPattern.onsets(1, 2, 2, 1); // => [1, 0, 1, 0, 0, 1, 0, 0, 1, 0]
RhythmPattern.random(4); // => [1, 0, 0, 1]
RhythmPattern.probability([0.6, 0, 0.2, 0.5]); // => [0, 0, 0, 1]
RhythmPattern.rotate([1, 0, 0, 1], 2); // => [0, 1, 1, 0]
```

## 6.0.1

Scale.get ignores case.

Now both calls returns the same scale:

```js
Scale.get("C Major");
Scale.get("c major");
```

## 6.0.0

### Major Changes
Expand Down
25 changes: 25 additions & 0 deletions packages/abc-notation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# @tonaljs/abc-notation

## 4.9.0

### Minor Changes

- 56d89f7: #### `default` export is deprecated for @tonaljs modules

Using default exports for single packages are deprecated, so instead of:

```js
import Note from "@tonaljs/note";
```

You should do this:

```js
import * as Note from "@tonaljs/note";
```

The same for all modules.

### Patch Changes

- Updated dependencies [4e05792]
- @tonaljs/[email protected]

## 4.8.3

### Patch Changes
Expand Down
1 change: 1 addition & 0 deletions packages/abc-notation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export function distance(from: string, to: string): string {
return dist(abcToScientificNotation(from), abcToScientificNotation(to));
}

/** @deprecated */
export default {
abcToScientificNotation,
scientificToAbcNotation,
Expand Down
4 changes: 2 additions & 2 deletions packages/abc-notation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tonaljs/abc-notation",
"version": "4.8.3",
"version": "4.9.0",
"description": "Parse musical notes in abc notation",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand All @@ -9,7 +9,7 @@
],
"types": "dist/index.d.ts",
"dependencies": {
"@tonaljs/pitch-distance": "5.0.3",
"@tonaljs/pitch-distance": "5.0.4",
"@tonaljs/pitch-note": "6.0.0"
},
"keywords": [
Expand Down
26 changes: 26 additions & 0 deletions packages/chord-detect/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# @tonaljs/chord-detect

## 4.9.0

### Minor Changes

- b113754: #### `default` export is deprecated for @tonaljs modules

Using default exports for single packages are deprecated, so instead of:

```js
import Note from "@tonaljs/note";
```

You should do this:

```js
import * as Note from "@tonaljs/note";
```

The same for all modules.

### Patch Changes

- Updated dependencies [b113754]
- @tonaljs/[email protected]
- @tonaljs/[email protected]

## 4.8.5

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/chord-detect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tonaljs/chord-detect",
"version": "4.8.5",
"version": "4.9.0",
"description": "Detect chord name based on note names",
"keywords": [
"chord-detect",
Expand All @@ -16,9 +16,9 @@
],
"types": "dist/index.d.ts",
"dependencies": {
"@tonaljs/chord-type": "5.0.5",
"@tonaljs/chord-type": "5.1.0",
"@tonaljs/pitch-note": "6.0.0",
"@tonaljs/pcset": "4.9.2"
"@tonaljs/pcset": "4.10.0"
},
"author": "[email protected]",
"license": "MIT",
Expand Down
7 changes: 7 additions & 0 deletions packages/chord-dictionary/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @tonaljs/chord-dictionary

## 4.8.5

### Patch Changes

- Updated dependencies [b113754]
- @tonaljs/[email protected]

## 4.8.4

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/chord-dictionary/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tonaljs/chord-dictionary",
"version": "4.8.4",
"version": "4.8.5",
"description": "A dictionary of musical chords",
"keywords": [],
"main": "dist/index.js",
Expand All @@ -10,7 +10,7 @@
],
"types": "dist/index.d.ts",
"dependencies": {
"@tonaljs/chord-type": "5.0.5"
"@tonaljs/chord-type": "5.1.0"
},
"author": "[email protected]",
"license": "MIT",
Expand Down
25 changes: 25 additions & 0 deletions packages/chord-type/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# @tonaljs/chord-type

## 5.1.0

### Minor Changes

- b113754: #### `default` export is deprecated for @tonaljs modules

Using default exports for single packages are deprecated, so instead of:

```js
import Note from "@tonaljs/note";
```

You should do this:

```js
import * as Note from "@tonaljs/note";
```

The same for all modules.

### Patch Changes

- Updated dependencies [b113754]
- @tonaljs/[email protected]

## 5.0.5

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/chord-type/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tonaljs/chord-type",
"version": "5.0.5",
"version": "5.1.0",
"description": "A dictionary of musical chords",
"keywords": [
"chord",
Expand All @@ -17,7 +17,7 @@
],
"types": "dist/index.d.ts",
"dependencies": {
"@tonaljs/pcset": "4.9.2"
"@tonaljs/pcset": "4.10.0"
},
"author": "[email protected]",
"license": "MIT",
Expand Down
33 changes: 33 additions & 0 deletions packages/chord/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# @tonaljs/chord

## 6.1.0

### Minor Changes

- 56d89f7: #### `default` export is deprecated for @tonaljs modules

Using default exports for single packages are deprecated, so instead of:

```js
import Note from "@tonaljs/note";
```

You should do this:

```js
import * as Note from "@tonaljs/note";
```

The same for all modules.

### Patch Changes

- Updated dependencies [b113754]
- Updated dependencies [4e05792]
- Updated dependencies [56d89f7]
- @tonaljs/[email protected]
- @tonaljs/[email protected]
- @tonaljs/[email protected]
- @tonaljs/[email protected]
- @tonaljs/[email protected]
- @tonaljs/[email protected]
- @tonaljs/[email protected]

## 6.0.0

### Major Changes
Expand Down
1 change: 1 addition & 0 deletions packages/chord/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ export function steps(chordName: ChordNameOrTokens, tonic?: string) {
return tonicIntervalsTransposer(chord.intervals, note);
}

/** @deprecated */
export default {
getChord,
get,
Expand Down
16 changes: 8 additions & 8 deletions packages/chord/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tonaljs/chord",
"version": "6.0.0",
"version": "6.1.0",
"description": "Musical chords and its relations",
"keywords": [
"chord",
Expand All @@ -16,14 +16,14 @@
],
"types": "dist/index.d.ts",
"dependencies": {
"@tonaljs/chord-detect": "4.8.5",
"@tonaljs/chord-type": "5.0.5",
"@tonaljs/collection": "4.8.1",
"@tonaljs/interval": "^5.0.0",
"@tonaljs/pcset": "4.9.2",
"@tonaljs/pitch-distance": "5.0.3",
"@tonaljs/chord-detect": "4.9.0",
"@tonaljs/chord-type": "5.1.0",
"@tonaljs/collection": "4.9.0",
"@tonaljs/interval": "^5.1.0",
"@tonaljs/pcset": "4.10.0",
"@tonaljs/pitch-distance": "5.0.4",
"@tonaljs/pitch-note": "6.0.0",
"@tonaljs/scale-type": "4.8.5"
"@tonaljs/scale-type": "4.9.0"
},
"author": "[email protected]",
"license": "MIT",
Expand Down
Loading
Loading