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

Migrate remaining files to TypeScript #3631

Merged
merged 21 commits into from
Sep 7, 2022
Merged

Migrate remaining files to TypeScript #3631

merged 21 commits into from
Sep 7, 2022

Conversation

luin
Copy link
Member

@luin luin commented Aug 15, 2022

  • Migrated all remaining files to TS.
  • Upgraded eslint related packages.

To test:

Run npm pack, make sure the bundle only contains necessary files.

@luin luin force-pushed the zh-ts-3 branch 6 times, most recently from c10c292 to b6f3864 Compare August 16, 2022 10:05
@luin luin force-pushed the zh-ts-3 branch 6 times, most recently from 78f5e99 to 0fbc62a Compare August 17, 2022 03:42
@luin luin force-pushed the zh-ts-3 branch 2 times, most recently from af028d1 to cfc0ccb Compare August 18, 2022 01:18
@@ -13,6 +13,9 @@ import Clipboard from './modules/clipboard';
import History from './modules/history';
import Keyboard from './modules/keyboard';
import Uploader from './modules/uploader';
import Delta, { Op, OpIterator, AttributeMap } from 'quill-delta';

export { Delta, Op, OpIterator, AttributeMap };
Copy link
Member Author

Choose a reason for hiding this comment

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

Export quill-delta so users don't need to install quill-delta on their side. This is useful to prevent multiple versions of quill-delta coexist in a project and Delta.registerEmbed() being called on a wrong Delta instance.

An alternative is to get Delta from Quill.import('delta') but due to a TypeScript limit, users have to use typeof Delta instead of Delta when referring the type.

"lint": "npm run lint:eslint && npm run lint:tsc",
"lint:eslint": "eslint .",
"lint:tsc": "tsc --noEmit --skipLibCheck",
"prepare": "npm run build",
Copy link
Member Author

Choose a reason for hiding this comment

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

When Quill is installed as a git dependency, the prepare script will be called by npm to build js files. It won't be called when it's installed as a normal npm package where files have already been built before publishing.

tsconfig.json Show resolved Hide resolved
@luin luin marked this pull request as ready for review August 18, 2022 09:44
@luin luin requested a review from jhchen August 18, 2022 09:49
@luin luin force-pushed the zh-ts-3 branch 3 times, most recently from 689625f to 14d92da Compare September 2, 2022 15:08
@luin luin merged commit 6fb1532 into develop Sep 7, 2022
@luin luin deleted the zh-ts-3 branch September 7, 2022 04:55
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.

2 participants