Skip to content

Commit 5e7a89c

Browse files
committed
do not export plug function anymore but auto plug on import
1 parent b8f0a8e commit 5e7a89c

File tree

6 files changed

+27
-6
lines changed

6 files changed

+27
-6
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
Changelog
22
=========
33

4-
### 1.2.2 (next)
4+
### 1.3.0 (next)
5+
6+
#### public api
7+
8+
* Hide `use(plug)` concept from public api.
9+
The function for extending js-joda is not exported anymore (the default export of this module is removed).
10+
The code for extending js-joda `use(plug)` is not required anymore, because js-joda-timezone automaticaly extends
11+
js-joda when imported.
512

613
### 1.2.1
714

dist/js-joda-timezone-empty.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { };

dist/js-joda-timezone.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export default function plug(jsJoda: any):any;
1+
export { };

src/auto-plug.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* @copyright (c) 2016-present, Philipp Thürwächter, Pattrick Hüper
3+
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
4+
*/
5+
6+
import { use } from 'js-joda';
7+
8+
import plug from './plug';
9+
10+
export default function autoPlug() {
11+
use(plug);
12+
}
13+

src/js-joda-timezone-empty.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
44
*/
55

6-
import plug from './plug';
6+
import autoPlug from './auto-plug';
77

8-
export default plug;
8+
autoPlug();

src/js-joda-timezone.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
import latest from './tzdbData';
77

8-
import plug from './plug';
98
import { MomentZoneRulesProvider } from './MomentZoneRulesProvider';
9+
import autoPlug from './auto-plug';
1010

1111
MomentZoneRulesProvider.loadTzdbData(latest);
1212

13-
export default plug;
13+
autoPlug();

0 commit comments

Comments
 (0)