@mui/internal-code-infra 0.1.1-canary.14 → 0.1.1-canary.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -14,9 +14,9 @@ This is stored in the `docs` top-level directory.
|
|
|
14
14
|
|
|
15
15
|
1. Go to the publish action -
|
|
16
16
|
|
|
17
|
-
- [Base
|
|
17
|
+
- [Base UI](https://github.com/mui/base-ui/actions/workflows/publish.yml)
|
|
18
18
|
- [Core](https://github.com/mui/material-ui/actions/workflows/publish.yml)
|
|
19
|
-
- [MUI
|
|
19
|
+
- [MUI X](https://github.com/mui/mui-x/actions/workflows/publish.yml)
|
|
20
20
|
|
|
21
21
|
2. Choose "Run workflow" dropdown
|
|
22
22
|
|
|
@@ -59,7 +59,7 @@ If publishing fails with npm asking for `otp`, run the command again with 6 digi
|
|
|
59
59
|
pnpm code-infra publish-new-package --otp=123456
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
3. Go to the settings link for each package,
|
|
62
|
+
3. Go to the settings link for each package, for example, `https://www.npmjs.com/package/<pkg-name>/access`, and setup `Trusted Publisher`.
|
|
63
63
|
4. In the `Select your publisher` step in the above link, click on the `GitHub Actions` button to configure GitHub Actions-based trusted publishing.
|
|
64
64
|
5. Fill in the details of the repo -
|
|
65
65
|
1. `Organization or user` as `mui`,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lints package.json files for publishing metadata. Published packages must
|
|
3
|
+
* declare an SPDX license, `"author": "MUI Team"` and a repository pointing at
|
|
4
|
+
* their own directory. Private packages must not carry publishing metadata.
|
|
5
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
6
|
+
*/
|
|
7
|
+
export declare function createPackageJsonConfig(): import('eslint').Linter.Config[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-code-infra",
|
|
3
|
-
"version": "0.1.1-canary.
|
|
3
|
+
"version": "0.1.1-canary.16",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "Infra scripts and configs to be used across MUI repos.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
"eslint-plugin-import": "^2.32.0",
|
|
102
102
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
103
103
|
"eslint-plugin-mdx": "^3.8.1",
|
|
104
|
+
"eslint-plugin-package-json": "^1.10.1",
|
|
104
105
|
"eslint-plugin-react": "^7.37.5",
|
|
105
106
|
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
|
|
106
107
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
@@ -174,8 +175,7 @@
|
|
|
174
175
|
"remark": "15.0.1",
|
|
175
176
|
"remark-mdx": "3.1.1",
|
|
176
177
|
"serve": "14.2.6",
|
|
177
|
-
"typescript": "npm:@typescript/typescript6@6.0.2"
|
|
178
|
-
"typescript-eslint": "8.71.1"
|
|
178
|
+
"typescript": "npm:@typescript/typescript6@6.0.2"
|
|
179
179
|
},
|
|
180
180
|
"files": [
|
|
181
181
|
"bin",
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
"publishConfig": {
|
|
191
191
|
"access": "public"
|
|
192
192
|
},
|
|
193
|
-
"gitSha": "
|
|
193
|
+
"gitSha": "7909a2801b6402fec32dead2c01dad6d16dcf20d",
|
|
194
194
|
"scripts": {
|
|
195
195
|
"build": "tsc -p tsconfig.build.json",
|
|
196
196
|
"typescript": "tsc -noEmit",
|
|
@@ -17,6 +17,7 @@ import { createCoreConfig } from './mui/config.mjs';
|
|
|
17
17
|
import muiPlugin from './mui/index.mjs';
|
|
18
18
|
import { EXTENSION_TS } from './extensions.mjs';
|
|
19
19
|
import { createJsonConfig } from './jsonConfig.mjs';
|
|
20
|
+
import { createPackageJsonConfig } from './packageJsonConfig.mjs';
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* @param {string} filePath
|
|
@@ -73,6 +74,7 @@ export function createBaseConfig({
|
|
|
73
74
|
includeIgnoreIfExists(path.join(baseDirectory, '.gitignore'), `Ignore rules from .gitignore`),
|
|
74
75
|
includeIgnoreIfExists(path.join(baseDirectory, '.lintignore'), `Ignore rules from .lintignore`),
|
|
75
76
|
createJsonConfig(),
|
|
77
|
+
createPackageJsonConfig(),
|
|
76
78
|
prettier,
|
|
77
79
|
// Markdown + MDX linting via eslint-plugin-mdx. Severities for markdown
|
|
78
80
|
// quality checks live in the project's `.remarkrc` (see
|
|
@@ -9,7 +9,8 @@ export function createJsonConfig() {
|
|
|
9
9
|
{
|
|
10
10
|
name: 'JSON files',
|
|
11
11
|
files: ['**/*.json'],
|
|
12
|
-
|
|
12
|
+
// package.json is linted by eslint-plugin-package-json, whose rules need the jsonc-eslint-parser AST.
|
|
13
|
+
ignores: ['package-lock.json', '**/package.json'],
|
|
13
14
|
plugins: { json },
|
|
14
15
|
language: 'json/json',
|
|
15
16
|
extends: [json.configs.recommended],
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineConfig } from 'eslint/config';
|
|
2
|
+
import packageJson from 'eslint-plugin-package-json';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Lints package.json files for publishing metadata. Published packages must
|
|
6
|
+
* declare an SPDX license, `"author": "MUI Team"` and a repository pointing at
|
|
7
|
+
* their own directory. Private packages must not carry publishing metadata.
|
|
8
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
9
|
+
*/
|
|
10
|
+
export function createPackageJsonConfig() {
|
|
11
|
+
return defineConfig([
|
|
12
|
+
{
|
|
13
|
+
name: 'package.json files',
|
|
14
|
+
files: ['**/package.json'],
|
|
15
|
+
ignores: ['**/__fixtures__/**'],
|
|
16
|
+
extends: [packageJson.configs.recommended],
|
|
17
|
+
rules: {
|
|
18
|
+
'package-json/require-author': ['error', { ignorePrivate: true }],
|
|
19
|
+
'package-json/require-description': ['error', { ignorePrivate: true }],
|
|
20
|
+
'package-json/restrict-private-properties': [
|
|
21
|
+
'error',
|
|
22
|
+
// `publishConfig.directory` is allowed: `code-infra build` reads it, also for private packages.
|
|
23
|
+
{ blockedProperties: ['files', 'license'] },
|
|
24
|
+
],
|
|
25
|
+
'no-restricted-syntax': [
|
|
26
|
+
'error',
|
|
27
|
+
{
|
|
28
|
+
selector:
|
|
29
|
+
'Program > JSONExpressionStatement > JSONObjectExpression > JSONProperty[key.value="author"][value.value!="MUI Team"]',
|
|
30
|
+
message: 'The "author" field must be "MUI Team".',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
// Condition order in "exports" is significant, and scripts are grouped by purpose.
|
|
34
|
+
'package-json/sort-collections': 'off',
|
|
35
|
+
// Packages built with `code-infra build` get these fields in the generated package.json.
|
|
36
|
+
'package-json/require-files': 'off',
|
|
37
|
+
'package-json/require-sideEffects': 'off',
|
|
38
|
+
'package-json/require-type': 'off',
|
|
39
|
+
// Peer dependencies are installed once at the workspace root.
|
|
40
|
+
'package-json/specify-peers-locally': 'off',
|
|
41
|
+
// CLI-only packages have no "exports".
|
|
42
|
+
'package-json/require-exports': 'off',
|
|
43
|
+
// Rejects the object form of "browser", which the browser field spec allows.
|
|
44
|
+
'package-json/valid-browser': 'off',
|
|
45
|
+
// npm only auto-includes "main" when it has no "./" prefix; removing it from "files" can drop the entry point.
|
|
46
|
+
'package-json/no-redundant-files': 'off',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
]);
|
|
50
|
+
}
|