Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Always reference these instructions first and fallback to search or bash command

### Repository Structure

```
```text
packages/
├── babel-plugin-display-name/ # Babel plugin for component display names
├── babel-plugin-minify-errors/ # Babel plugin for error minification
Expand Down
20 changes: 10 additions & 10 deletions packages/code-infra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ Scripts and configs to be used across MUI repos.
## Publishing packages

1. Go to the publish action -

- [Base UI](https://github.com/mui/base-ui/actions/workflows/publish.yml)
- [Core](https://github.com/mui/material-ui/actions/workflows/publish.yml)
- [MUI X](https://github.com/mui/mui-x/actions/workflows/publish.yml)
- [Base UI](https://github.com/mui/base-ui/actions/workflows/publish.yml)
- [Core](https://github.com/mui/material-ui/actions/workflows/publish.yml)
- [MUI X](https://github.com/mui/mui-x/actions/workflows/publish.yml)

2. Choose "Run workflow" dropdown

Expand All @@ -22,7 +21,8 @@ Scripts and configs to be used across MUI repos.
4. Refresh the page to see the newly created workflow, and click it.
5. The next screen shows "@username requested your review to deploy to npm-publish", click "Review deployments" and authorize your workflow run. **Never approve workflow runs you didn't initiaite.**

> [!IMPORTANT]
> [!IMPORTANT] <!-- eslint-disable-line markdown/no-missing-label-refs --><!-- See https://github.com/eslint/markdown/issues/294 -->
>
> Go through the below steps if there is an error that says `The following packages are new and need to be published manually first` in the publish flow.

### Adding and publishing new packages
Expand All @@ -31,13 +31,13 @@ Whenever news packages are added to the repo (that will get published to npm) or

1. Goto your repo's code base on your system, open terminal and run:

```bash
pnpm code-infra publish-new-package
```
```bash
pnpm code-infra publish-new-package
```

This command detects the new public packages in the repo and asks for your confirmation before publishing them to the npm registry. Add the `--dryRun` flag to skip the actual publishing.
This command detects the new public packages in the repo and asks for your confirmation before publishing them to the npm registry. Add the `--dryRun` flag to skip the actual publishing.

2. Goto the settings link for each packages, ie, https://www.npmjs.com/package/<pkg-name>/access , and setup `Trusted Publisher`.
2. Goto the settings link for each packages, ie, `https://www.npmjs.com/package/<pkg-name>/access` , and setup `Trusted Publisher`.
3. In `Select your publisher` step in the above link, click on the `Github Actions` button to configure Github actions based trusted publishing.
4. Fill in the details of the repo -
1. `Organization or user` as `mui`,
Expand Down
3 changes: 2 additions & 1 deletion packages/code-infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"@eslint/compat": "^1.4.0",
"@eslint/js": "^9.36.0",
"@eslint/json": "^0.13.2",
"@eslint/markdown": "^7.4.0",
"@inquirer/confirm": "^5.1.19",
"@mui/internal-babel-plugin-display-name": "workspace:*",
"@mui/internal-babel-plugin-minify-errors": "workspace:*",
Expand Down Expand Up @@ -109,6 +110,7 @@
"typescript": "^5.0.0"
},
"devDependencies": {
"@octokit/types": "^15.0.0",
"@types/babel__core": "^7.20.5",
"@types/babel__preset-env": "^7.10.0",
"@types/eslint-plugin-jsx-a11y": "^6.10.0",
Expand All @@ -119,7 +121,6 @@
"@typescript-eslint/parser": "^8.45.0",
"@typescript-eslint/rule-tester": "^8.45.0",
"eslint": "^9.36.0",
"@octokit/types": "^15.0.0",
"prettier": "^3.6.2",
"typescript-eslint": "^8.45.0"
},
Expand Down
9 changes: 9 additions & 0 deletions packages/code-infra/src/eslint/baseConfig.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import prettier from 'eslint-config-prettier/flat';
import importPlugin from 'eslint-plugin-import';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import reactPlugin from 'eslint-plugin-react';
import markdown from '@eslint/markdown';
import { configs as reactCompilerPluginConfigs } from 'eslint-plugin-react-compiler';
import reactHooks from 'eslint-plugin-react-hooks';
import globals from 'globals';
Expand Down Expand Up @@ -42,6 +43,14 @@ export function createBaseConfig({
includeIgnoreIfExists(path.join(baseDirectory, '.lintignore'), `Ignore rules from .lintignore`),
createJsonConfig(),
prettier,
// Track https://github.com/eslint/markdown/issues/316 for MDX support
markdown.configs.recommended,
{
files: ['**/*.md'],
rules: {
'markdown/no-duplicate-headings': 'error',
},
},
{
name: 'Base config',
files: [`**/*${EXTENSION_TS}`],
Expand Down
Loading
Loading