@mui/internal-code-infra 0.1.1-canary.3 → 0.1.1-canary.31
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 +7 -4
- package/build/brokenLinksChecker/__fixtures__/no-signal-forwarding.d.mts +1 -0
- package/build/changelog/fetchChangelogs.d.mts +9 -10
- package/build/changelog/index.d.mts +1 -0
- package/build/cli/cmdBaseline.d.mts +18 -0
- package/build/cli/cmdBuild.d.mts +4 -0
- package/build/cli/cmdNetlifyIgnore.d.mts +1 -1
- package/build/eslint/index.d.mts +1 -0
- package/build/eslint/mui/rules/no-constructor-assigned-field.d.mts +50 -0
- package/build/eslint/nodeSupportConfig.d.mts +11 -0
- package/build/eslint/packageJsonConfig.d.mts +7 -0
- package/build/remark/config.d.mts +5 -14
- package/build/utils/build.d.mts +14 -0
- package/build/utils/credentials.d.mts +2 -2
- package/build/utils/git.d.mts +30 -9
- package/build/utils/github.d.mts +8 -0
- package/build/utils/pnpm.d.mts +67 -3
- package/package.json +54 -44
- package/src/brokenLinksChecker/index.mjs +8 -1
- package/src/changelog/fetchChangelogs.mjs +66 -26
- package/src/changelog/index.mjs +3 -0
- package/src/cli/cmdBaseline.mjs +31 -0
- package/src/cli/cmdBuild.mjs +47 -0
- package/src/cli/cmdNetlifyIgnore.mjs +14 -7
- package/src/cli/cmdPublish.mjs +17 -3
- package/src/cli/cmdPublishNewPackage.mjs +11 -4
- package/src/cli/index.mjs +2 -0
- package/src/eslint/baseConfig.mjs +8 -0
- package/src/eslint/docsConfig.mjs +28 -10
- package/src/eslint/index.mjs +1 -0
- package/src/eslint/jsonConfig.mjs +2 -1
- package/src/eslint/mui/config.mjs +16 -1
- package/src/eslint/mui/index.mjs +2 -0
- package/src/eslint/mui/rules/disallow-react-api-in-server-components.mjs +4 -1
- package/src/eslint/mui/rules/no-constructor-assigned-field.mjs +183 -0
- package/src/eslint/nodeSupportConfig.mjs +70 -0
- package/src/eslint/packageJsonConfig.mjs +50 -0
- package/src/eslint/testConfig.mjs +4 -2
- package/src/remark/config.mjs +60 -13
- package/src/utils/build.mjs +34 -0
- package/src/utils/credentials.mjs +4 -3
- package/src/utils/extractErrorCodes.mjs +1 -3
- package/src/utils/git.mjs +107 -46
- package/src/utils/github.mjs +27 -0
- package/src/utils/pnpm.mjs +126 -25
- package/vale/styles/MUI/GoogleLatin.yml +5 -2
- package/vale/styles/MUI/CorrectRererenceCased.yml +0 -14
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
|
|
|
@@ -24,12 +24,15 @@ This is stored in the `docs` top-level directory.
|
|
|
24
24
|
> - **Commit SHA to release from:** the commit that contains the merged release on master. This commit is linked to the GitHub release.
|
|
25
25
|
> - **Run in dry-run mode:** Used for debugging.
|
|
26
26
|
> - **Create GitHub release:** Keep selected if you want a GitHub release to be automatically created from the changelog.
|
|
27
|
-
> - **npm dist tag to publish to** Use to publish legacy or canary versions.
|
|
27
|
+
> - **npm dist tag to publish to** Use to publish legacy or canary versions. The publish fails before it publishes anything when a dist-tag would move to a lower version. `latest` and `latest-*` also cannot move to a prerelease unless they already point to one, and `latest-*` cannot change its major.
|
|
28
28
|
|
|
29
29
|
3. Click "Run workflow"
|
|
30
30
|
4. Refresh the page to see the newly created workflow, and click it.
|
|
31
31
|
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.**
|
|
32
32
|
|
|
33
|
+
> [!NOTE]
|
|
34
|
+
> A CI dry run (`code-infra publish --ci --dry-run`) runs the same dist-tag check. On a branch that does not publish to `latest`, pass the dist-tag of the release to it, for example `--tag next` for prereleases or `--tag latest-v8` for a previous major.
|
|
35
|
+
|
|
33
36
|
> [!IMPORTANT]
|
|
34
37
|
> 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.
|
|
35
38
|
|
|
@@ -59,7 +62,7 @@ If publishing fails with npm asking for `otp`, run the command again with 6 digi
|
|
|
59
62
|
pnpm code-infra publish-new-package --otp=123456
|
|
60
63
|
```
|
|
61
64
|
|
|
62
|
-
3. Go to the settings link for each package,
|
|
65
|
+
3. Go to the settings link for each package, for example, `https://www.npmjs.com/package/<pkg-name>/access`, and setup `Trusted Publisher`.
|
|
63
66
|
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
67
|
5. Fill in the details of the repo -
|
|
65
68
|
1. `Organization or user` as `mui`,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,6 +8,14 @@ export type FetchCommitsOptions = {
|
|
|
8
8
|
* - GitHub organization name, defaults to 'mui'
|
|
9
9
|
*/
|
|
10
10
|
org?: string;
|
|
11
|
+
/**
|
|
12
|
+
* - Called as commits are listed and their pull request details are fetched
|
|
13
|
+
*/
|
|
14
|
+
onProgress?: (progress: {
|
|
15
|
+
phase: string;
|
|
16
|
+
count: number;
|
|
17
|
+
total: number;
|
|
18
|
+
}) => void;
|
|
11
19
|
};
|
|
12
20
|
/**
|
|
13
21
|
* @typedef {import('@octokit/rest').Octokit} OctokitType
|
|
@@ -21,17 +29,8 @@ export type FetchCommitsOptions = {
|
|
|
21
29
|
* @property {string} lastRelease
|
|
22
30
|
* @property {string} release
|
|
23
31
|
* @property {string} [org='mui'] - GitHub organization name, defaults to 'mui'
|
|
32
|
+
* @property {(progress: { phase: string; count: number; total: number }) => void} [onProgress] - Called as commits are listed and their pull request details are fetched
|
|
24
33
|
*/
|
|
25
|
-
/**
|
|
26
|
-
* @param {Object} opts
|
|
27
|
-
* @param {string} opts.cwd
|
|
28
|
-
* @param {boolean} [opts.fetchAll=true] Whether to fetch all tags from all remotes before finding the latest tag.
|
|
29
|
-
* @returns {Promise<string>}
|
|
30
|
-
*/
|
|
31
|
-
export declare function findLatestTaggedVersion(opts: {
|
|
32
|
-
cwd: string;
|
|
33
|
-
fetchAll?: boolean;
|
|
34
|
-
}): Promise<string>;
|
|
35
34
|
/**
|
|
36
35
|
* Fetches commits between two refs (lastRelease..release) including PR details.
|
|
37
36
|
* Automatically handles GitHub OAuth authentication if none provided.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export type Args = {
|
|
3
|
+
/**
|
|
4
|
+
* - Branch pull requests fork from
|
|
5
|
+
*/
|
|
6
|
+
baseBranch?: string;
|
|
7
|
+
/**
|
|
8
|
+
* - Remote the base branch is fetched from
|
|
9
|
+
*/
|
|
10
|
+
remote?: string;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {Object} Args
|
|
14
|
+
* @property {string} [baseBranch] - Branch pull requests fork from
|
|
15
|
+
* @property {string} [remote] - Remote the base branch is fetched from
|
|
16
|
+
*/
|
|
17
|
+
declare const _default: import('yargs').CommandModule<{}, Args>;
|
|
18
|
+
export default _default;
|
package/build/cli/cmdBuild.d.mts
CHANGED
|
@@ -35,6 +35,10 @@ export type Args = {
|
|
|
35
35
|
* - Whether to skip checking for main field in package.json.
|
|
36
36
|
*/
|
|
37
37
|
skipMainCheck: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* - Whether to skip validating the output directory with publint.
|
|
40
|
+
*/
|
|
41
|
+
skipPublint: boolean;
|
|
38
42
|
/**
|
|
39
43
|
* - Globs to be ignored by Babel.
|
|
40
44
|
*/
|
package/build/eslint/index.d.mts
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
export type PropertyDefinition = import('@typescript-eslint/utils').TSESTree.PropertyDefinition;
|
|
3
|
+
export type Node = import('@typescript-eslint/utils').TSESTree.Node;
|
|
4
|
+
/**
|
|
5
|
+
* ESLint rule that disallows assigning a class field in the constructor when it is also
|
|
6
|
+
* declared as a (non-`declare`) class field.
|
|
7
|
+
*
|
|
8
|
+
* Babel 8 only strips TypeScript fields marked `declare` (see mui/material-ui#49241), so a
|
|
9
|
+
* field without an initializer is emitted as a property definition that sets it to
|
|
10
|
+
* `undefined` before the constructor assigns it again. Either initialize the field at its
|
|
11
|
+
* declaration, or mark it `declare` so it only serves as a type annotation.
|
|
12
|
+
*
|
|
13
|
+
* `declare` fields are exempt from TypeScript's strict property initialization check
|
|
14
|
+
* (TS2564), so prefer initializing at the declaration where the value doesn't depend on
|
|
15
|
+
* constructor arguments. The `declare` suggestion is only offered when every path through the
|
|
16
|
+
* constructor assigns the field, i.e. for an unconditional top-level assignment.
|
|
17
|
+
*
|
|
18
|
+
* Only plain `=` assignments count: compound assignments read the field rather than
|
|
19
|
+
* re-initialize it. A field with an initializer is only reported for an unconditional
|
|
20
|
+
* top-level assignment, as a conditional one overrides a default. Private (`#`) and decorated
|
|
21
|
+
* fields are ignored: they are runtime declarations that `declare` can't replace.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // Invalid
|
|
25
|
+
* class ModalManager {
|
|
26
|
+
* private modals: Modal[];
|
|
27
|
+
* constructor() {
|
|
28
|
+
* this.modals = [];
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // Valid - initialized at the declaration
|
|
34
|
+
* class ModalManager {
|
|
35
|
+
* private modals: Modal[] = [];
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // Valid - declared only, assigned in the constructor
|
|
40
|
+
* class ModalManager {
|
|
41
|
+
* declare private modals: Modal[];
|
|
42
|
+
* constructor(modals: Modal[]) {
|
|
43
|
+
* this.modals = modals;
|
|
44
|
+
* }
|
|
45
|
+
* }
|
|
46
|
+
*/
|
|
47
|
+
declare const _default: ESLintUtils.RuleModule<"addDeclare" | "assignedInConstructor", [], unknown, ESLintUtils.RuleListener> & {
|
|
48
|
+
name: string;
|
|
49
|
+
};
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reports syntax, ECMAScript built-ins and Node.js APIs in package sources that the Node.js
|
|
3
|
+
* versions allowed by the package's "engines.node" don't support. The ESM bundle is compiled for
|
|
4
|
+
* the "stable" browserslist environment rather than for "engines.node", and nothing polyfills
|
|
5
|
+
* built-ins, so all of them reach Node.js consumers as written.
|
|
6
|
+
* Only packages that declare "engines.node", meaning they're intended to run in Node.js, are
|
|
7
|
+
* checked.
|
|
8
|
+
* @param {string} baseDirectory - The repository root. File patterns are resolved against it.
|
|
9
|
+
* @returns {import('eslint').Linter.Config[]}
|
|
10
|
+
*/
|
|
11
|
+
export declare function createNodeSupportConfig(baseDirectory: string): import('eslint').Linter.Config[];
|
|
@@ -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[];
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import remarkGfm from 'remark-gfm';
|
|
2
|
-
import remarkLint from 'remark-lint';
|
|
3
1
|
/**
|
|
4
2
|
* Returns a remark preset wiring the MUI-authored remark-lint plugins together
|
|
5
3
|
* with a curated set of community plugins. Drop this into `.remarkrc.mjs`:
|
|
@@ -23,21 +21,14 @@ import remarkLint from 'remark-lint';
|
|
|
23
21
|
* ```
|
|
24
22
|
*
|
|
25
23
|
* @param {Object} [options]
|
|
24
|
+
* @param {boolean} [options.allowDefinitionComments=false] Allow titled `[//]` link-reference comments.
|
|
26
25
|
* @param {Array<{ files: string | string[], rules: Record<string, false | unknown[]> }>} [options.overrides]
|
|
26
|
+
* @returns {import('unified').Preset}
|
|
27
27
|
*/
|
|
28
|
-
export declare function createRemarkConfig({ overrides }?: {
|
|
28
|
+
export declare function createRemarkConfig({ overrides, allowDefinitionComments }?: {
|
|
29
|
+
allowDefinitionComments?: boolean;
|
|
29
30
|
overrides?: Array<{
|
|
30
31
|
files: string | string[];
|
|
31
32
|
rules: Record<string, false | unknown[]>;
|
|
32
33
|
}>;
|
|
33
|
-
}):
|
|
34
|
-
settings: {
|
|
35
|
-
bullet: string;
|
|
36
|
-
emphasis: string;
|
|
37
|
-
fence: string;
|
|
38
|
-
listItemIndent: string;
|
|
39
|
-
resourceLink: boolean;
|
|
40
|
-
rule: string;
|
|
41
|
-
};
|
|
42
|
-
plugins: (any[] | typeof remarkGfm | typeof remarkLint)[];
|
|
43
|
-
};
|
|
34
|
+
}): import('unified').Preset;
|
package/build/utils/build.d.mts
CHANGED
|
@@ -93,6 +93,20 @@ export declare function validatePkgJson(packageJson: Record<string, any>, option
|
|
|
93
93
|
skipMainCheck?: boolean;
|
|
94
94
|
enableReactCompiler?: boolean;
|
|
95
95
|
}): void;
|
|
96
|
+
/**
|
|
97
|
+
* Validates that "engines.node" in package.json doesn't allow Node.js versions older than the
|
|
98
|
+
* "node" browserslist environment, which the CommonJS bundle is compiled for. Otherwise the
|
|
99
|
+
* build can emit syntax that the oldest supported Node.js version can't run.
|
|
100
|
+
* Targets are resolved the same way `@babel/preset-env` resolves them during the build.
|
|
101
|
+
* @param {{ name?: string; engines?: { node?: string } }} packageJson
|
|
102
|
+
* @param {string} cwd - The package directory, used to find the browserslist config.
|
|
103
|
+
*/
|
|
104
|
+
export declare function validateEnginesNode(packageJson: {
|
|
105
|
+
name?: string;
|
|
106
|
+
engines?: {
|
|
107
|
+
node?: string;
|
|
108
|
+
};
|
|
109
|
+
}, cwd: string): void;
|
|
96
110
|
/**
|
|
97
111
|
* Marks the start and end of a function execution for performance measurement.
|
|
98
112
|
* Uses the Performance API to create marks and measure the duration.
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
export declare const KEYRING_SERVICE = "mui-code-infra";
|
|
9
9
|
/**
|
|
10
10
|
* @param {string} key
|
|
11
|
-
* @returns {Promise<string |
|
|
11
|
+
* @returns {Promise<string | null>}
|
|
12
12
|
*/
|
|
13
|
-
export declare function getPassword(key: string): Promise<string |
|
|
13
|
+
export declare function getPassword(key: string): Promise<string | null>;
|
|
14
14
|
/**
|
|
15
15
|
* @param {string} key
|
|
16
16
|
* @param {string} password
|
package/build/utils/git.d.mts
CHANGED
|
@@ -13,22 +13,18 @@ export type RepoInfo = {
|
|
|
13
13
|
remoteName: string;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* @property {string} repo - Repository name
|
|
19
|
-
* @property {string} remoteName - Remote name
|
|
20
|
-
*/
|
|
21
|
-
/**
|
|
22
|
-
* Get current repository info from git remote
|
|
16
|
+
* The canonical repository's remote, as opposed to a fork's: `upstream`, else `origin`, each only if
|
|
17
|
+
* it points at a mui repository. Reads the configured URLs, which `insteadOf` does not rewrite.
|
|
23
18
|
* @param {string} [cwd=process.cwd()]
|
|
24
|
-
* @returns {Promise<RepoInfo>}
|
|
19
|
+
* @returns {Promise<RepoInfo>}
|
|
25
20
|
*/
|
|
26
21
|
export declare function getRepositoryInfo(cwd?: string): Promise<RepoInfo>;
|
|
27
22
|
/**
|
|
28
23
|
* Get current git SHA
|
|
24
|
+
* @param {string} [cwd=process.cwd()]
|
|
29
25
|
* @returns {Promise<string>} Current git commit SHA
|
|
30
26
|
*/
|
|
31
|
-
export declare function getCurrentGitSha(): Promise<string>;
|
|
27
|
+
export declare function getCurrentGitSha(cwd?: string): Promise<string>;
|
|
32
28
|
/**
|
|
33
29
|
* Check whether a tag already exists on the origin remote
|
|
34
30
|
* @param {string} tagName - Tag name to check (e.g. `v1.2.3`)
|
|
@@ -36,3 +32,28 @@ export declare function getCurrentGitSha(): Promise<string>;
|
|
|
36
32
|
* @returns {Promise<boolean>} True if the tag exists on origin
|
|
37
33
|
*/
|
|
38
34
|
export declare function remoteGitTagExists(tagName: string, cwd?: string): Promise<boolean>;
|
|
35
|
+
/**
|
|
36
|
+
* The commit HEAD should be compared against: where it forked from the base branch, or its parent
|
|
37
|
+
* when HEAD is already on the base branch.
|
|
38
|
+
* @param {Object} [options]
|
|
39
|
+
* @param {string} [options.cwd]
|
|
40
|
+
* @param {string} [options.remote] - Defaults to the canonical remote.
|
|
41
|
+
* @param {string} [options.baseBranch] - Defaults to the remote's default branch.
|
|
42
|
+
* @returns {Promise<string>}
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveBaseline(options?: {
|
|
45
|
+
cwd?: string;
|
|
46
|
+
remote?: string;
|
|
47
|
+
baseBranch?: string;
|
|
48
|
+
}): Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* The most recent version tag reachable from HEAD — where a changelog's range starts.
|
|
51
|
+
* @param {Object} opts
|
|
52
|
+
* @param {string} opts.cwd
|
|
53
|
+
* @param {boolean} [opts.fetchAll=true] Whether to fetch all tags from all remotes before finding the latest tag.
|
|
54
|
+
* @returns {Promise<string>}
|
|
55
|
+
*/
|
|
56
|
+
export declare function findLatestTaggedVersion(opts: {
|
|
57
|
+
cwd: string;
|
|
58
|
+
fetchAll?: boolean;
|
|
59
|
+
}): Promise<string>;
|
package/build/utils/github.d.mts
CHANGED
|
@@ -47,3 +47,11 @@ export declare function endToEndGhAuthGetToken({ log }?: {
|
|
|
47
47
|
* @returns {Promise<void>}
|
|
48
48
|
*/
|
|
49
49
|
export declare function clearGitHubAuth(): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Returns when a rate-limited request may be retried, or `null` for other errors.
|
|
52
|
+
* https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api#exceeding-the-rate-limit
|
|
53
|
+
*
|
|
54
|
+
* @param {unknown} error
|
|
55
|
+
* @returns {Date | null}
|
|
56
|
+
*/
|
|
57
|
+
export declare function getRateLimitRetryTime(error: unknown): Date | null;
|
package/build/utils/pnpm.d.mts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/** Version that `publish-new-package` publishes to reserve the name of a new package. */
|
|
3
|
+
export declare const PLACEHOLDER_VERSION = "0.0.1";
|
|
2
4
|
export type PrivatePackage = {
|
|
3
5
|
/**
|
|
4
6
|
* - Package name
|
|
@@ -122,6 +124,43 @@ export declare function getPublishRegistry(packagePath: string): Promise<string>
|
|
|
122
124
|
* @returns {Promise<string | null>} Version string, or null when absent/invalid
|
|
123
125
|
*/
|
|
124
126
|
export declare function getReleaseVersion(cwd?: string): Promise<string | null>;
|
|
127
|
+
export type RegistryPackage = {
|
|
128
|
+
/**
|
|
129
|
+
* - Registry that the package publishes to
|
|
130
|
+
*/
|
|
131
|
+
registry: string;
|
|
132
|
+
/**
|
|
133
|
+
* - Whether the package is on the registry
|
|
134
|
+
*/
|
|
135
|
+
exists: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* - Dist-tags of the package
|
|
138
|
+
*/
|
|
139
|
+
distTags: Record<string, string>;
|
|
140
|
+
/**
|
|
141
|
+
* - Published versions of the package
|
|
142
|
+
*/
|
|
143
|
+
versions: string[];
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* @typedef {Object} RegistryPackage
|
|
147
|
+
* @property {string} registry - Registry that the package publishes to
|
|
148
|
+
* @property {boolean} exists - Whether the package is on the registry
|
|
149
|
+
* @property {Record<string, string>} distTags - Dist-tags of the package
|
|
150
|
+
* @property {string[]} versions - Published versions of the package
|
|
151
|
+
*/
|
|
152
|
+
/**
|
|
153
|
+
* Read each package from its publish registry with `pnpm view`, so the lookup uses the
|
|
154
|
+
* same registry configuration and credentials as `pnpm publish`.
|
|
155
|
+
*
|
|
156
|
+
* @param {PublicPackage[]} packages - Packages to read
|
|
157
|
+
* @param {{ npmOnly?: boolean }} [options] - `npmOnly` reads only the packages that publish to npm.
|
|
158
|
+
* Checks that only concern npm use it, so a missing credential for another registry does not block them.
|
|
159
|
+
* @returns {Promise<Map<string, RegistryPackage>>} By package name
|
|
160
|
+
*/
|
|
161
|
+
export declare function getRegistryPackages(packages: PublicPackage[], { npmOnly }?: {
|
|
162
|
+
npmOnly?: boolean;
|
|
163
|
+
}): Promise<Map<string, RegistryPackage>>;
|
|
125
164
|
/**
|
|
126
165
|
* Filter to the packages that must be published by hand before CI can take over.
|
|
127
166
|
*
|
|
@@ -131,14 +170,39 @@ export declare function getReleaseVersion(cwd?: string): Promise<string | null>;
|
|
|
131
170
|
* midway through. See {@link getPackageVersionInfo} for the version-level check.
|
|
132
171
|
*
|
|
133
172
|
* @param {PublicPackage[]} packages - Packages to check
|
|
134
|
-
* @
|
|
173
|
+
* @param {Map<string, RegistryPackage>} registryPackages - Registry data from {@link getRegistryPackages}
|
|
174
|
+
* @returns {PublicPackage[]} The subset needing a manual first publish
|
|
175
|
+
*/
|
|
176
|
+
export declare function getPackagesNeedingManualPublish(packages: PublicPackage[], registryPackages: Map<string, RegistryPackage>): PublicPackage[];
|
|
177
|
+
export type DistTagConflict = {
|
|
178
|
+
/**
|
|
179
|
+
* - Package to publish
|
|
180
|
+
*/
|
|
181
|
+
pkg: PublicPackage;
|
|
182
|
+
/**
|
|
183
|
+
* - Why the dist-tag would move to the wrong release line
|
|
184
|
+
*/
|
|
185
|
+
reason: string;
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* @typedef {Object} DistTagConflict
|
|
189
|
+
* @property {PublicPackage} pkg - Package to publish
|
|
190
|
+
* @property {string} reason - Why the dist-tag would move to the wrong release line
|
|
191
|
+
*/
|
|
192
|
+
/**
|
|
193
|
+
* Find the packages whose publish with `tag` would move the dist-tag to the wrong release line.
|
|
194
|
+
*
|
|
195
|
+
* @param {PublicPackage[]} packages - Packages to publish
|
|
196
|
+
* @param {string} tag - Dist-tag to publish with
|
|
197
|
+
* @param {Map<string, RegistryPackage>} registryPackages - Registry data from {@link getRegistryPackages}
|
|
198
|
+
* @returns {DistTagConflict[]}
|
|
135
199
|
*/
|
|
136
|
-
export declare function
|
|
200
|
+
export declare function getDistTagConflicts(packages: PublicPackage[], tag: string, registryPackages: Map<string, RegistryPackage>): DistTagConflict[];
|
|
137
201
|
/**
|
|
138
202
|
* Get package version info from registry.
|
|
139
203
|
*
|
|
140
204
|
* Resolves through `pnpm view`, which reports a lookup failure the same way it
|
|
141
|
-
* reports a missing version. Use {@link
|
|
205
|
+
* reports a missing version. Use {@link getRegistryPackages} where
|
|
142
206
|
* absence has to be told apart from an error.
|
|
143
207
|
*
|
|
144
208
|
* @param {string} packageName - Name of the package
|
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.31",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "Infra scripts and configs to be used across MUI repos.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,64 +53,70 @@
|
|
|
53
53
|
"code-infra": "./bin/code-infra.mjs"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@argos-ci/core": "6.8.
|
|
57
|
-
"@babel/cli": "^8.0
|
|
58
|
-
"@babel/core": "^8.0
|
|
56
|
+
"@argos-ci/core": "6.8.8",
|
|
57
|
+
"@babel/cli": "^8.1.0",
|
|
58
|
+
"@babel/core": "^8.1.0",
|
|
59
|
+
"@babel/helper-compilation-targets": "^8.0.7",
|
|
59
60
|
"@babel/plugin-syntax-jsx": "^8.0.1",
|
|
60
|
-
"@babel/plugin-syntax-typescript": "^8.0.
|
|
61
|
+
"@babel/plugin-syntax-typescript": "^8.0.3",
|
|
61
62
|
"@babel/plugin-transform-react-pure-annotations": "^8.0.1",
|
|
62
|
-
"@babel/plugin-transform-runtime": "^8.0.
|
|
63
|
-
"@babel/preset-env": "^8.0.
|
|
63
|
+
"@babel/plugin-transform-runtime": "^8.0.6",
|
|
64
|
+
"@babel/preset-env": "^8.0.7",
|
|
64
65
|
"@babel/preset-react": "^8.0.1",
|
|
65
|
-
"@babel/preset-typescript": "^8.0.
|
|
66
|
+
"@babel/preset-typescript": "^8.0.7",
|
|
66
67
|
"@eslint/compat": "^2.1.1",
|
|
67
68
|
"@eslint/js": "^10.0.1",
|
|
68
|
-
"@eslint/json": "^2.1.
|
|
69
|
-
"@inquirer/confirm": "^6.3.
|
|
70
|
-
"@inquirer/select": "^5.2.
|
|
71
|
-
"@mui/internal-babel-plugin-display-name": "2.0.1-canary.
|
|
72
|
-
"@mui/internal-babel-plugin-minify-errors": "3.0.1-canary.
|
|
73
|
-
"@mui/internal-babel-plugin-resolve-imports": "3.0.1-canary.
|
|
74
|
-
"@napi-rs/keyring": "^2.
|
|
69
|
+
"@eslint/json": "^2.1.1",
|
|
70
|
+
"@inquirer/confirm": "^6.3.5",
|
|
71
|
+
"@inquirer/select": "^5.2.8",
|
|
72
|
+
"@mui/internal-babel-plugin-display-name": "2.0.1-canary.3",
|
|
73
|
+
"@mui/internal-babel-plugin-minify-errors": "3.0.1-canary.3",
|
|
74
|
+
"@mui/internal-babel-plugin-resolve-imports": "3.0.1-canary.4",
|
|
75
|
+
"@napi-rs/keyring": "^2.1.2",
|
|
75
76
|
"@octokit/auth-action": "^6.0.3",
|
|
76
77
|
"@octokit/oauth-methods": "^6.0.5",
|
|
78
|
+
"@octokit/plugin-retry": "^8.1.1",
|
|
79
|
+
"@octokit/plugin-throttling": "^11.0.5",
|
|
77
80
|
"@octokit/rest": "^22.0.1",
|
|
78
|
-
"@pnpm/config.version-policy": "^1100.2.
|
|
81
|
+
"@pnpm/config.version-policy": "^1100.2.10",
|
|
79
82
|
"@pnpm/find-workspace-dir": "^1000.1.5",
|
|
80
83
|
"@pnpm/parse-wanted-dependency": "^1001.0.0",
|
|
81
|
-
"@typescript-eslint/types": "^8.
|
|
82
|
-
"@typescript-eslint/utils": "^8.
|
|
83
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
84
|
+
"@typescript-eslint/types": "^8.72.1",
|
|
85
|
+
"@typescript-eslint/utils": "^8.72.1",
|
|
86
|
+
"@vitest/eslint-plugin": "^1.6.28",
|
|
84
87
|
"babel-plugin-optimize-clsx": "^2.6.2",
|
|
85
88
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
86
|
-
"babel-plugin-transform-import-meta": "^3.
|
|
89
|
+
"babel-plugin-transform-import-meta": "^3.1.0",
|
|
87
90
|
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
|
88
91
|
"babel-plugin-transform-remove-imports": "^1.8.1",
|
|
89
|
-
"chalk": "^6.0.
|
|
92
|
+
"chalk": "^6.0.1",
|
|
90
93
|
"clipboardy": "^5.3.2",
|
|
91
|
-
"content-type": "^3.1.
|
|
94
|
+
"content-type": "^3.1.1",
|
|
92
95
|
"env-ci": "^11.2.0",
|
|
93
|
-
"es-toolkit": "^1.
|
|
96
|
+
"es-toolkit": "^1.53.2",
|
|
94
97
|
"eslint-config-prettier": "^10.1.8",
|
|
95
98
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
96
99
|
"eslint-module-utils": "^2.14.0",
|
|
97
100
|
"eslint-plugin-compat": "^7.0.2",
|
|
98
101
|
"eslint-plugin-import": "^2.32.0",
|
|
99
102
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
100
|
-
"eslint-plugin-mdx": "^3.
|
|
103
|
+
"eslint-plugin-mdx": "^3.9.1",
|
|
104
|
+
"eslint-plugin-n": "^18.5.0",
|
|
105
|
+
"eslint-plugin-package-json": "^1.14.0",
|
|
101
106
|
"eslint-plugin-react": "^7.37.5",
|
|
102
107
|
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
|
|
103
108
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
104
109
|
"eslint-plugin-testing-library": "^7.16.2",
|
|
105
|
-
"execa": "^10.
|
|
110
|
+
"execa": "^10.2.1",
|
|
106
111
|
"git-url-parse": "^16.1.0",
|
|
107
|
-
"globals": "^17.
|
|
112
|
+
"globals": "^17.14.0",
|
|
108
113
|
"globby": "^16.2.4",
|
|
109
|
-
"html-validate": "^11.
|
|
110
|
-
"minimatch": "^
|
|
111
|
-
"node-html-parser": "^9.0.
|
|
112
|
-
"open": "^11.0.
|
|
113
|
-
"postcss-styled-syntax": "^0.7.
|
|
114
|
+
"html-validate": "^11.18.0",
|
|
115
|
+
"minimatch": "^11.0.0",
|
|
116
|
+
"node-html-parser": "^9.0.7",
|
|
117
|
+
"open": "^11.0.4",
|
|
118
|
+
"postcss-styled-syntax": "^0.7.4",
|
|
119
|
+
"publint": "^0.3.25",
|
|
114
120
|
"regexp.escape": "^2.0.1",
|
|
115
121
|
"rehype-slug": "^6.0.0",
|
|
116
122
|
"rehype-stringify": "^10.0.1",
|
|
@@ -131,22 +137,26 @@
|
|
|
131
137
|
"remark-parse": "^11.0.0",
|
|
132
138
|
"remark-rehype": "^11.1.2",
|
|
133
139
|
"resolve-pkg-maps": "^1.0.0",
|
|
134
|
-
"semver": "^7.8.
|
|
135
|
-
"stylelint-config-standard": "^
|
|
136
|
-
"typescript-eslint": "^8.
|
|
140
|
+
"semver": "^7.8.6",
|
|
141
|
+
"stylelint-config-standard": "^41.0.0",
|
|
142
|
+
"typescript-eslint": "^8.72.1",
|
|
137
143
|
"unified": "^11.0.5",
|
|
138
144
|
"unified-lint-rule": "^3.0.1",
|
|
139
|
-
"unist-util-visit": "^5.
|
|
145
|
+
"unist-util-visit": "^5.2.0",
|
|
140
146
|
"yaml": "^2.9.1",
|
|
141
|
-
"yargs": "^18.
|
|
147
|
+
"yargs": "^18.2.0"
|
|
142
148
|
},
|
|
143
149
|
"peerDependencies": {
|
|
144
150
|
"@next/eslint-plugin-next": "*",
|
|
145
151
|
"eslint": "^9.0.0 || ^10.0.0",
|
|
146
152
|
"prettier": "^3.0.0",
|
|
153
|
+
"stylelint": "^18.0.0",
|
|
147
154
|
"typescript": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
148
155
|
},
|
|
149
156
|
"peerDependenciesMeta": {
|
|
157
|
+
"stylelint": {
|
|
158
|
+
"optional": true
|
|
159
|
+
},
|
|
150
160
|
"typescript": {
|
|
151
161
|
"optional": true
|
|
152
162
|
}
|
|
@@ -157,22 +167,22 @@
|
|
|
157
167
|
"@types/babel__preset-env": "7.10.0",
|
|
158
168
|
"@types/env-ci": "3.1.4",
|
|
159
169
|
"@types/eslint-plugin-jsx-a11y": "6.10.1",
|
|
160
|
-
"@types/estree": "1.0.
|
|
170
|
+
"@types/estree": "1.0.10",
|
|
161
171
|
"@types/estree-jsx": "1.0.5",
|
|
162
172
|
"@types/mdast": "4.0.4",
|
|
163
173
|
"@types/regexp.escape": "2.0.0",
|
|
164
174
|
"@types/yargs": "17.0.35",
|
|
165
|
-
"@typescript-eslint/parser": "8.
|
|
166
|
-
"@typescript-eslint/rule-tester": "8.
|
|
175
|
+
"@typescript-eslint/parser": "8.72.1",
|
|
176
|
+
"@typescript-eslint/rule-tester": "8.72.1",
|
|
167
177
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
168
|
-
"eslint": "10.
|
|
178
|
+
"eslint": "10.14.0",
|
|
169
179
|
"get-port": "7.2.0",
|
|
170
|
-
"prettier": "3.9.
|
|
180
|
+
"prettier": "3.9.10",
|
|
171
181
|
"remark": "15.0.1",
|
|
172
182
|
"remark-mdx": "3.1.1",
|
|
173
183
|
"serve": "14.2.6",
|
|
174
|
-
"
|
|
175
|
-
"typescript
|
|
184
|
+
"stylelint": "^18.0.0",
|
|
185
|
+
"typescript": "npm:@typescript/typescript6@6.0.2"
|
|
176
186
|
},
|
|
177
187
|
"files": [
|
|
178
188
|
"bin",
|
|
@@ -187,7 +197,7 @@
|
|
|
187
197
|
"publishConfig": {
|
|
188
198
|
"access": "public"
|
|
189
199
|
},
|
|
190
|
-
"gitSha": "
|
|
200
|
+
"gitSha": "fb999aabc9746b50f3cd915e236d646cf894eff4",
|
|
191
201
|
"scripts": {
|
|
192
202
|
"build": "tsc -p tsconfig.build.json",
|
|
193
203
|
"typescript": "tsc -noEmit",
|
|
@@ -621,6 +621,8 @@ export async function crawl(rawOptions) {
|
|
|
621
621
|
|
|
622
622
|
/** @type {AbortController | null} */
|
|
623
623
|
let controller = null;
|
|
624
|
+
/** @type {Promise<unknown> | null} */
|
|
625
|
+
let serverExited = null;
|
|
624
626
|
|
|
625
627
|
try {
|
|
626
628
|
if (options.startCommand) {
|
|
@@ -630,6 +632,7 @@ export async function crawl(rawOptions) {
|
|
|
630
632
|
stdout: 'pipe',
|
|
631
633
|
stderr: 'pipe',
|
|
632
634
|
cancelSignal: controller.signal,
|
|
635
|
+
killDescendants: true,
|
|
633
636
|
env: {
|
|
634
637
|
FORCE_COLOR: '1',
|
|
635
638
|
...process.env,
|
|
@@ -640,7 +643,10 @@ export async function crawl(rawOptions) {
|
|
|
640
643
|
const serverPrefix = chalk.gray('server: ');
|
|
641
644
|
appProcess.stdout.pipe(prefixLines(serverPrefix)).pipe(process.stdout);
|
|
642
645
|
appProcess.stderr.pipe(prefixLines(serverPrefix)).pipe(process.stderr);
|
|
643
|
-
|
|
646
|
+
// Settles once the whole process tree has exited: descendants inherit the
|
|
647
|
+
// stdout/stderr pipes, so execa waits for them too, and escalates to SIGKILL
|
|
648
|
+
// after `forceKillAfterDelay` when a server is slow to shut down.
|
|
649
|
+
serverExited = appProcess.catch(() => {});
|
|
644
650
|
|
|
645
651
|
// Poll the first page we are about to crawl (resolved against host) so we
|
|
646
652
|
// wait for the actual entry point to be serveable rather than the
|
|
@@ -660,6 +666,7 @@ export async function crawl(rawOptions) {
|
|
|
660
666
|
if (controller) {
|
|
661
667
|
console.log(chalk.blue('Stopping server...'));
|
|
662
668
|
controller.abort();
|
|
669
|
+
await serverExited;
|
|
663
670
|
}
|
|
664
671
|
}
|
|
665
672
|
}
|