-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Edit Site: Add tsconfig.json validation for package #67406
base: trunk
Are you sure you want to change the base?
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +34 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
0f716eb
to
0fc5fec
Compare
Flaky tests detected in a8c931c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12510957091
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass. I'd love some expert help ❤️
@@ -84,8 +88,9 @@ export function getTopLevelStyleBookCategories(): StyleBookCategory[] { | |||
...STYLE_BOOK_THEME_SUBCATEGORIES, | |||
...STYLE_BOOK_CATEGORIES, | |||
].map( ( { slug } ) => slug ); | |||
const extraCategories = getCategories().filter( | |||
const extraCategories: StyleBookCategory[] = getCategories(); | |||
const extraCategoriesFiltered = extraCategories.filter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this is for the TS parser
If there are any major type tweaks required, I'd rather do them in a follow up.
This is just to get typing working for this package.
packages/edit-site/src/components/style-book/color-examples.tsx
Outdated
Show resolved
Hide resolved
// NOTE: This package is being progressively typed. You are encouraged to | ||
// expand this array with files which can be type-checked. At some point in | ||
// the future, this can be simplified to an `includes` of `src/**/*`. | ||
"files": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't use globs apparently, except in "include"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not so familiar with the details of the TS configs so I can't speak about that but this PR seems to be fixing the erros I previously got in VScode while editing the stylebook files.
90e7a49
to
954d58e
Compare
…ject and so tsc will try to build them.
…d fixing type assignment
9cbb560
to
1b8c418
Compare
@@ -27,6 +27,7 @@ | |||
"module": "build-module/index.js", | |||
"react-native": "src/index", | |||
"wpScript": true, | |||
"types": "build-types", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line would expose the types to the world (public consumers via npm). It doesn't seem like this package is ready to be typed, but this PR is trying to fix internal build issues for Gutenberg.
I'd remove this line:
"types": "build-types", |
packages/edit-site/src/components/style-book/color-examples.tsx
Outdated
Show resolved
Hide resolved
"compilerOptions": { | ||
"rootDir": "src", | ||
"declarationDir": "build-types" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This becomes redundant after ca61601 (rebase required):
"compilerOptions": { | |
"rootDir": "src", | |
"declarationDir": "build-types" | |
}, |
"src/components/style-book/color-examples.tsx", | ||
"src/components/style-book/duotone-examples.tsx", | ||
"src/components/style-book/examples.tsx" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After ca61601, it becomes necessary to override the default include
:
] | |
], | |
"include": [] |
What?
This PR:
TS9005 An explicit type annotation may unblock declaration emit
Why?
Style book added TS files, but no linting or config: #65430 (comment)
How?
Testing Instructions
Tests should pass and the CI should build.
Fire up the branch and smoke test the site editor, in particular the style book