Fix esm plugin typings and add test.
Generated esm plugins are generated like plugin/duration/index.js, but import still points to import dayjs from '../index', but it should be import dayjs from '../../index'.
- Fix imports.
- Add tests.
- Update babel to release.
Codecov Report
Merging #1544 (05e1da4) into dev (c5688f3) will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## dev #1544 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 176 177 +1
Lines 1980 1986 +6
Branches 502 503 +1
=========================================
+ Hits 1980 1986 +6
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/locale/sv-fi.js | 100.00% <0.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update c5688f3...05e1da4. Read the comment docs.
e.g. in file esm/locale/af.js,import dayjs from '../index' means to import root/esm/index.js, should correct don't we?
e.g. in file
esm/locale/af.js,import dayjs from '../index'means to importroot/esm/index.js, should correct don't we?
Yes, it’s just changing plugin directories. I think locales folder should be ok.
e.g. in file
esm/locale/af.js,import dayjs from '../index'means to importroot/esm/index.js, should correct don't we?Yes, it’s just changing plugin directories. I think locales folder should be ok.
seems we don't have to change the path here?
seems we don't have to change the path here?
Locale is ok, plug-ins generates a folder due to typings.
seems we don't have to change the path here?
Locale is ok, plug-ins generates a folder due to typings.
Can you please detail it? Seems there's no plugin has the import statement import ../index.js
Honestly I don’t know why Babel adds it.
Look at esm/plugins/*/index.js.
Probably due to typings.
https://github.com/iamkun/dayjs/blob/8e32164855cff724642e24c37a631eb4c4d760c8/types/plugin/duration.d.ts#L2
Changing that to dayjs may fix the problem too I will test.
The error is just with duration plugin. Do you want me to drop the tests?