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

refactor(v2): migrate core to Typescript ❄️🌀🐋 #1494

Merged
merged 11 commits into from
May 20, 2019

Conversation

endiliey
Copy link
Contributor

@endiliey endiliey commented May 20, 2019

Motivation

This is the first step of converting @docusaurus/core to TypeScript. The PR is getting big already so I sent out this PR first. There are some parts of @docusaurus/core still using JS (very minimal though).

There should be almost no logic change. Just adding typing and at mostly refactoring/ moving folders around. I also added tests if needed.

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

Development still working

dev working

Production still working

build working

Test passes locally
image

Netlify
https://deploy-preview-1494--docusaurus-2.netlify.com/

Test passes in CI

Related PRs

#1490

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 20, 2019
@endiliey
Copy link
Contributor Author

endiliey commented May 20, 2019

Deploy preview for docusaurus-2 ready!

Built with commit 26f0125

https://deploy-preview-1494--docusaurus-2.netlify.com

@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented May 20, 2019

Deploy preview for docusaurus-preview ready!

Built with commit 26f0125

https://deploy-preview-1494--docusaurus-preview.netlify.com

"lint": "eslint --cache \"**/*.js\"",
"lerna": "lerna",
"test": "jest",
"tsc": "lerna run --parallel tsc --no-private"
"tsc": "lerna run tsc --no-private"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cannot be run in parallel because there for example: docusaurus/core depends on docusaurus/utils.

import fs from 'fs-extra';
import importFresh from 'import-fresh';
import path from 'path';
import {generate} from '@docusaurus/utils';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't deep dive into typing this part because we're going to change the plugin to use plain object instead of class instance

@endiliey endiliey marked this pull request as ready for review May 20, 2019 15:39
@endiliey endiliey requested a review from yangshun as a code owner May 20, 2019 15:39
@endiliey endiliey changed the title refactor(v2): migrate @docusaurus/core to Typescript refactor(v2): migrate core to Typescript ❄️🌀🐋 May 20, 2019
@endiliey endiliey changed the title refactor(v2): migrate core to Typescript ❄️🌀🐋 refactor(v2): migrate @docusaurus/core to Typescript ❄️🌀🐋 May 20, 2019
@endiliey endiliey changed the title refactor(v2): migrate @docusaurus/core to Typescript ❄️🌀🐋 refactor(v2): migrate core to Typescript ❄️🌀🐋 May 20, 2019
@yangshun yangshun merged commit 305e698 into master May 20, 2019
@endiliey endiliey deleted the docusaurus/core branch May 25, 2019 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants