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

WIP: refactor(gatsby-plugin-theme-ui): add typescript #705

Closed
wants to merge 8 commits into from

Conversation

hasparus
Copy link
Member

@hasparus hasparus commented Feb 23, 2020

Part of #668.

Needs types for theme-ui.


Results of npm pack:
gatsby-plugin-theme-ui-v0.3.0.zip

"files": [
"src/**/*.js",
"/*.js"
],
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a pretty unconventional way to use TS, but I'm not sure if it's worse than copying package.json and README to dist and modifying lerna.json.

lerna/lerna#1282

"scripts": {
"build": "tsc",
"prepare": "yarn build || true",
"test": "tsc --noEmit"
Copy link
Member Author

Choose a reason for hiding this comment

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

This could get executed in root package.json (jest && lerna run test)

@@ -0,0 +1,365 @@
import * as React from 'react'
Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -41,7 +41,9 @@
"ts-jest": "^25.2.0",
"typescript": "^3.8.2"
},
"resolutions": {},
"resolutions": {
Copy link
Member Author

Choose a reason for hiding this comment

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

described in #757 (comment)

@@ -42,7 +42,8 @@
"typescript": "^3.8.2"
},
"resolutions": {
"@types/vfile-message": "1.0.1"
"@types/vfile-message": "1.0.1",
"@types/react": "16.9.23"
Copy link
Member Author

Choose a reason for hiding this comment

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

Multiple versions of @types/react in node_modules lead to a lot of suffering (global namespace conflicts).

@hasparus hasparus marked this pull request as ready for review March 16, 2020 11:05
@hasparus hasparus changed the title refactor(gatsby-plugin-theme-ui): add typescript WIP: refactor(gatsby-plugin-theme-ui): add typescript May 7, 2020
@hasparus hasparus marked this pull request as draft May 7, 2020 21:15
@hasparus
Copy link
Member Author

hasparus commented May 7, 2020

Marked this as draft now. It needs to be updated.

@jxnblk
Copy link
Member

jxnblk commented May 8, 2020

Ah! Sorry we're doing some updates to the Gatsby plugin -- since this relies on the shadowing API in Gatsby, I'd say let's hold off on converting this plugin and other Gatsby themes in the repo until later, since there are other things to consider. Currently these packages aren't compiled at all and Gatsby consumes them directly...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants