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

fix: typescript export needs es6 #1268

Merged
merged 2 commits into from Mar 7, 2021
Merged

Conversation

simllll
Copy link
Contributor

@simllll simllll commented Mar 4, 2021

fixes #1267

There are two issues:
1.) there is only one default export, no named export. People are assuming a named export will work fine too. Which is not direclty a bug, but a nice to have ;)
2.) The export with es5 does not work correclty, as es5 is not aware of class exports.
Test:

import { Agenda } from 'agenda';
console.log('AGENDA', Agenda);
import Agenda from 'agenda';
console.log('AGENDA', Agenda);

all should output:
AGENDA [class Agenda extends EventEmitter]
But with es5 they output:
AGENDA [Function: Agenda]

RA80533
RA80533 previously approved these changes Mar 6, 2021
Copy link

@RA80533 RA80533 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The root index.js file can now be safely removed since it's no longer used as the entry point.

@simllll
Copy link
Contributor Author

simllll commented Mar 7, 2021

The root index.js file can now be safely removed since it's no longer used as the entry point.

Thanks @RA80533 ,pinging @koresar for final okay :)

@koresar koresar merged commit eabeea8 into agenda:master Mar 7, 2021
xenokratos pushed a commit to beedeez/agenda that referenced this pull request Mar 23, 2021
* fix: typescript export needs es6

* chore: drop obsolete index.js
@simllll simllll deleted the fix/ts-export branch March 18, 2022 22:29
github-actions bot pushed a commit to Sealos/agenda that referenced this pull request Feb 1, 2024
# 1.0.0 (2024-02-01)

### Bug Fixes

* 🐛 re-enable broken test ([abfd348](abfd348))
* Add try/catch block to agenda#now method ([agenda#876](https://github.com/Sealos/agenda/issues/876)) ([8e1fe23](8e1fe23))
* calculate nextRunAt when endDate is undefined ([agenda#1227](https://github.com/Sealos/agenda/issues/1227)) ([a7a2b83](a7a2b83))
* collection and options are optional now ([agenda#1275](https://github.com/Sealos/agenda/issues/1275)) ([143af6d](143af6d))
* **database:** use db() syntax rather than pulling dbName from client ([b811523](b811523))
* **deps:** update dependency cron-parser to v3 ([agenda#1188](https://github.com/Sealos/agenda/issues/1188)) ([f313f46](f313f46))
* **deps:** update dependency debug to ~4.2.0 ([agenda#1125](https://github.com/Sealos/agenda/issues/1125)) ([6d53a13](6d53a13))
* **deps:** update dependency debug to ~4.3.0 ([agenda#1148](https://github.com/Sealos/agenda/issues/1148)) ([7ed55ed](7ed55ed))
* **deps:** update dependency human-interval to v2 ([agenda#1134](https://github.com/Sealos/agenda/issues/1134)) ([d6bcf03](d6bcf03))
* export cjs and es ([agenda#1298](https://github.com/Sealos/agenda/issues/1298)) ([849b32f](849b32f))
* **history:** match cron-parser pattern ([agenda#1335](https://github.com/Sealos/agenda/issues/1335)) ([5a73b55](5a73b55))
* make agenda.cancel no longer require a callback ([5f895e3](5f895e3)), closes [agenda#249](https://github.com/Sealos/agenda/issues/249)
* make optional mongo-collection optional and allow dates for dates ([agenda#1258](https://github.com/Sealos/agenda/issues/1258)) ([29267cb](29267cb))
* simplified verbiage ([ee3ce39](ee3ce39))
* someone updated bee to bree (they are two separate packages) ([c98ba5c](c98ba5c))
* typescript export needs es6 ([agenda#1268](https://github.com/Sealos/agenda/issues/1268)) ([eabeea8](eabeea8))
* Typescript optional parameters ([agenda#1279](https://github.com/Sealos/agenda/issues/1279)) ([9f62482](9f62482))
* unlock job test needs cb ([agenda#1138](https://github.com/Sealos/agenda/issues/1138)) ([bfb5603](bfb5603))
* version bump of dependencies ([bf41588](bf41588))
* wrong initial value and lower processEvery for agenda-instance.js ([agenda#1131](https://github.com/Sealos/agenda/issues/1131)) ([ff9dd7a](ff9dd7a))

### Features

* added [@breejs](https://github.com/breejs) to README ([68ade1d](68ade1d))
* **database:** upgrade mongodb -> 3.1 ([fd077d1](fd077d1))
* rewrite to new standards ([f51ff62](f51ff62))

### Reverts

* Revert "Add job timeout (agenda#1420)" (agenda#1426) ([6ec531d](6ec531d)), closes [agenda#1420](https://github.com/Sealos/agenda/issues/1420) [agenda#1426](https://github.com/Sealos/agenda/issues/1426)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Types are incorrectly exported
3 participants