@mui/internal-code-infra 0.0.4-canary.9 → 0.0.4-canary.90
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/LICENSE +1 -1
- package/README.md +19 -8
- package/build/babel-config.d.mts +5 -1
- package/build/brokenLinksChecker/crawlWorker.d.mts +1 -0
- package/build/brokenLinksChecker/index.d.mts +45 -2
- package/build/changelog/types.d.ts +3 -1
- package/build/cli/cmdArgosPush.d.mts +2 -2
- package/build/cli/cmdBuild.d.mts +3 -2
- package/build/cli/cmdCopyFiles.d.mts +2 -2
- package/build/cli/cmdExtractErrorCodes.d.mts +2 -2
- package/build/cli/cmdGenerateChangelog.d.mts +2 -2
- package/build/cli/cmdGithubAuth.d.mts +2 -2
- package/build/cli/cmdListWorkspaces.d.mts +6 -4
- package/build/cli/cmdNetlifyIgnore.d.mts +3 -2
- package/build/cli/cmdPublish.d.mts +4 -2
- package/build/cli/cmdPublishCanary.d.mts +3 -3
- package/build/cli/cmdPublishNewPackage.d.mts +4 -2
- package/build/cli/cmdSetVersionOverrides.d.mts +2 -2
- package/build/cli/cmdVale.d.mts +46 -0
- package/build/cli/cmdValidateBuiltTypes.d.mts +2 -2
- package/build/eslint/baseConfig.d.mts +3 -1
- package/build/eslint/mui/rules/disallow-react-api-in-server-components.d.mts +2 -2
- package/build/eslint/mui/rules/docgen-ignore-before-comment.d.mts +2 -2
- package/build/eslint/mui/rules/no-floating-cleanup.d.mts +5 -0
- package/build/eslint/mui/rules/no-guarded-throw.d.mts +31 -0
- package/build/eslint/mui/rules/no-presentation-role.d.mts +5 -0
- package/build/eslint/mui/rules/no-restricted-resolved-imports.d.mts +2 -2
- package/build/eslint/mui/rules/nodeEnvUtils.d.mts +18 -0
- package/build/remark/config.d.mts +43 -0
- package/build/remark/createLintTester.d.mts +10 -0
- package/build/remark/firstBlockHeading.d.mts +4 -0
- package/build/remark/gitDiff.d.mts +2 -0
- package/build/remark/noSpaceInLinks.d.mts +2 -0
- package/build/remark/straightQuotes.d.mts +2 -0
- package/build/remark/tableAlignment.d.mts +2 -0
- package/build/remark/terminalLanguage.d.mts +2 -0
- package/build/utils/babel.d.mts +1 -1
- package/build/utils/build.d.mts +56 -37
- package/build/utils/git.d.mts +7 -0
- package/build/utils/github.d.mts +1 -1
- package/build/utils/pnpm.d.mts +81 -2
- package/build/utils/testUtils.d.mts +7 -0
- package/build/utils/typescript.d.mts +6 -16
- package/package.json +74 -50
- package/src/babel-config.mjs +3 -1
- package/src/brokenLinksChecker/crawlWorker.mjs +240 -0
- package/src/brokenLinksChecker/index.mjs +263 -188
- package/src/changelog/fetchChangelogs.mjs +8 -2
- package/src/changelog/renderChangelog.mjs +1 -1
- package/src/changelog/types.ts +3 -1
- package/src/cli/cmdBuild.mjs +51 -85
- package/src/cli/cmdListWorkspaces.mjs +12 -27
- package/src/cli/cmdNetlifyIgnore.mjs +34 -93
- package/src/cli/cmdPublish.mjs +95 -20
- package/src/cli/cmdPublishCanary.mjs +128 -132
- package/src/cli/cmdPublishNewPackage.mjs +27 -6
- package/src/cli/cmdSetVersionOverrides.mjs +8 -9
- package/src/cli/cmdVale.mjs +513 -0
- package/src/cli/index.mjs +2 -0
- package/src/cli/packageJson.d.ts +1 -1
- package/src/eslint/baseConfig.mjs +51 -19
- package/src/eslint/docsConfig.mjs +2 -1
- package/src/eslint/mui/config.mjs +24 -4
- package/src/eslint/mui/index.mjs +6 -0
- package/src/eslint/mui/rules/no-floating-cleanup.mjs +187 -0
- package/src/eslint/mui/rules/no-guarded-throw.mjs +115 -0
- package/src/eslint/mui/rules/no-presentation-role.mjs +60 -0
- package/src/eslint/mui/rules/nodeEnvUtils.mjs +52 -0
- package/src/eslint/mui/rules/require-dev-wrapper.mjs +25 -40
- package/src/estree-typescript.d.ts +1 -1
- package/src/remark/config.mjs +157 -0
- package/src/remark/createLintTester.mjs +19 -0
- package/src/remark/firstBlockHeading.mjs +87 -0
- package/src/remark/gitDiff.mjs +43 -0
- package/src/remark/noSpaceInLinks.mjs +42 -0
- package/src/remark/straightQuotes.mjs +31 -0
- package/src/remark/tableAlignment.mjs +23 -0
- package/src/remark/terminalLanguage.mjs +19 -0
- package/src/untyped-plugins.d.ts +11 -11
- package/src/utils/build.mjs +604 -270
- package/src/utils/git.mjs +27 -7
- package/src/utils/pnpm.mjs +277 -10
- package/src/utils/testUtils.mjs +18 -0
- package/src/utils/typescript.mjs +23 -42
- package/vale/.vale.ini +1 -0
- package/vale/styles/MUI/CorrectReferenceAllCases.yml +42 -0
- package/vale/styles/MUI/CorrectRererenceCased.yml +14 -0
- package/vale/styles/MUI/GoogleLatin.yml +11 -0
- package/vale/styles/MUI/MuiBrandName.yml +22 -0
- package/vale/styles/MUI/NoBritish.yml +112 -0
- package/vale/styles/MUI/NoCompanyName.yml +17 -0
- package/build/markdownlint/duplicate-h1.d.mts +0 -56
- package/build/markdownlint/git-diff.d.mts +0 -11
- package/build/markdownlint/index.d.mts +0 -52
- package/build/markdownlint/straight-quotes.d.mts +0 -11
- package/build/markdownlint/table-alignment.d.mts +0 -11
- package/build/markdownlint/terminal-language.d.mts +0 -11
- package/src/brokenLinksChecker/__fixtures__/static-site/broken-links.html +0 -20
- package/src/brokenLinksChecker/__fixtures__/static-site/broken-targets.html +0 -22
- package/src/brokenLinksChecker/__fixtures__/static-site/example.md +0 -20
- package/src/brokenLinksChecker/__fixtures__/static-site/external-links.html +0 -21
- package/src/brokenLinksChecker/__fixtures__/static-site/ignored-page.html +0 -17
- package/src/brokenLinksChecker/__fixtures__/static-site/index.html +0 -28
- package/src/brokenLinksChecker/__fixtures__/static-site/known-targets.json +0 -5
- package/src/brokenLinksChecker/__fixtures__/static-site/nested/page.html +0 -21
- package/src/brokenLinksChecker/__fixtures__/static-site/orphaned-page.html +0 -20
- package/src/brokenLinksChecker/__fixtures__/static-site/page-with-api-links.html +0 -20
- package/src/brokenLinksChecker/__fixtures__/static-site/page-with-custom-targets.html +0 -24
- package/src/brokenLinksChecker/__fixtures__/static-site/page-with-ignored-content.html +0 -28
- package/src/brokenLinksChecker/__fixtures__/static-site/page-with-known-target-links.html +0 -19
- package/src/brokenLinksChecker/__fixtures__/static-site/unclosed-tags.html +0 -1
- package/src/brokenLinksChecker/__fixtures__/static-site/valid.html +0 -20
- package/src/brokenLinksChecker/__fixtures__/static-site/with-anchors.html +0 -31
- package/src/brokenLinksChecker/index.test.ts +0 -261
- package/src/changelog/categorizeCommits.test.ts +0 -319
- package/src/changelog/filterCommits.test.ts +0 -363
- package/src/changelog/parseCommitLabels.test.ts +0 -509
- package/src/changelog/renderChangelog.test.ts +0 -378
- package/src/changelog/sortSections.test.ts +0 -199
- package/src/eslint/mui/rules/add-undef-to-optional.test.mjs +0 -361
- package/src/eslint/mui/rules/consistent-production-guard.test.mjs +0 -162
- package/src/eslint/mui/rules/disallow-active-elements-as-key-event-target.test.mjs +0 -66
- package/src/eslint/mui/rules/disallow-react-api-in-server-components.test.mjs +0 -305
- package/src/eslint/mui/rules/docgen-ignore-before-comment.test.mjs +0 -52
- package/src/eslint/mui/rules/flatten-parentheses.test.mjs +0 -245
- package/src/eslint/mui/rules/mui-name-matches-component-name.test.mjs +0 -247
- package/src/eslint/mui/rules/no-empty-box.test.mjs +0 -40
- package/src/eslint/mui/rules/no-styled-box.test.mjs +0 -73
- package/src/eslint/mui/rules/require-dev-wrapper.test.mjs +0 -265
- package/src/eslint/mui/rules/rules-of-use-theme-variants.test.mjs +0 -149
- package/src/eslint/mui/rules/straight-quotes.test.mjs +0 -67
- package/src/markdownlint/duplicate-h1.mjs +0 -69
- package/src/markdownlint/git-diff.mjs +0 -31
- package/src/markdownlint/index.mjs +0 -62
- package/src/markdownlint/straight-quotes.mjs +0 -26
- package/src/markdownlint/table-alignment.mjs +0 -42
- package/src/markdownlint/terminal-language.mjs +0 -19
- package/src/utils/build.test.mjs +0 -705
- package/src/utils/template.test.mjs +0 -133
- package/src/utils/typescript.test.mjs +0 -380
package/build/utils/build.d.mts
CHANGED
|
@@ -1,62 +1,82 @@
|
|
|
1
1
|
export type BundleType = 'esm' | 'cjs';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export type BundleMeta = {
|
|
3
|
+
type: BundleType;
|
|
4
|
+
dir: string;
|
|
5
|
+
condition: 'import' | 'require';
|
|
6
|
+
outExtension: string;
|
|
7
|
+
typeOutExtension: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const BASE_IGNORES: string[];
|
|
5
10
|
/**
|
|
6
11
|
* @param {BundleType} bundle
|
|
7
12
|
* @param {Object} [options]
|
|
8
13
|
* @param {boolean} [options.isType=false] - Whether to get the extension for type declaration files.
|
|
9
|
-
* @param {boolean} [options.isFlat=false] - Whether to get the extension for a flat build structure.
|
|
10
14
|
* @param {'module' | 'commonjs'} [options.packageType='commonjs'] - The package.json type field.
|
|
11
15
|
* @returns {string}
|
|
12
16
|
*/
|
|
13
17
|
export declare function getOutExtension(bundle: BundleType, options?: {
|
|
14
18
|
isType?: boolean;
|
|
15
|
-
isFlat?: boolean;
|
|
16
19
|
packageType?: 'module' | 'commonjs';
|
|
17
20
|
}): string;
|
|
18
21
|
/**
|
|
19
|
-
* @param {
|
|
20
|
-
* @param {
|
|
21
|
-
* @param {
|
|
22
|
-
* @param {string}
|
|
23
|
-
* @param {string}
|
|
24
|
-
* @param {boolean} [
|
|
25
|
-
* @param {boolean} [
|
|
26
|
-
* @param {'module' | 'commonjs'} [
|
|
22
|
+
* @param {import('../cli/packageJson').PackageJson['exports']} packageExports
|
|
23
|
+
* @param {Object} options
|
|
24
|
+
* @param {BundleType[]} options.bundles
|
|
25
|
+
* @param {string} options.outputDir
|
|
26
|
+
* @param {string} options.cwd
|
|
27
|
+
* @param {boolean} [options.addTypes]
|
|
28
|
+
* @param {boolean} [options.expand] - Whether to enumerate glob patterns into concrete entries.
|
|
29
|
+
* @param {'module' | 'commonjs'} [options.packageType]
|
|
27
30
|
*/
|
|
28
|
-
export declare function createPackageExports(
|
|
29
|
-
|
|
30
|
-
bundles: {
|
|
31
|
-
type: BundleType;
|
|
32
|
-
dir: string;
|
|
33
|
-
}[];
|
|
31
|
+
export declare function createPackageExports(packageExports: import('../cli/packageJson').PackageJson['exports'], { bundles, outputDir, cwd, addTypes, expand, packageType }: {
|
|
32
|
+
bundles: BundleType[];
|
|
34
33
|
outputDir: string;
|
|
35
34
|
cwd: string;
|
|
36
35
|
addTypes?: boolean;
|
|
37
|
-
|
|
36
|
+
expand?: boolean;
|
|
38
37
|
packageType?: 'module' | 'commonjs';
|
|
39
38
|
}): Promise<{
|
|
40
|
-
main?: string
|
|
41
|
-
types?: string
|
|
42
|
-
exports: import(
|
|
39
|
+
main?: string;
|
|
40
|
+
types?: string;
|
|
41
|
+
exports: import('../cli/packageJson').PackageJson.ExportConditions;
|
|
43
42
|
}>;
|
|
44
43
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* @
|
|
50
|
-
*
|
|
44
|
+
* Generates the package.json `imports` field for the built package, rewriting
|
|
45
|
+
* internal subpath imports (keys starting with `#`) that point at source files
|
|
46
|
+
* into their built equivalents with `import`/`require`/`types` conditions.
|
|
47
|
+
*
|
|
48
|
+
* Mirrors {@link createPackageExports} but without the `.` / `package.json` /
|
|
49
|
+
* `main` / `types` index handling that only applies to public exports. Entries
|
|
50
|
+
* that resolve to bare specifiers (e.g. an external package) are passed through
|
|
51
|
+
* unchanged, since the `imports` field commonly aliases dependencies.
|
|
52
|
+
* @param {import('../cli/packageJson').PackageJson['imports']} packageImports
|
|
53
|
+
* @param {Object} options
|
|
54
|
+
* @param {BundleType[]} options.bundles
|
|
55
|
+
* @param {string} options.cwd
|
|
56
|
+
* @param {string} [options.outputDir] - Used to verify non-source passthrough paths exist in the build output.
|
|
57
|
+
* @param {boolean} [options.addTypes]
|
|
58
|
+
* @param {boolean} [options.expand] - Whether to enumerate glob patterns into concrete entries.
|
|
59
|
+
* @param {'module' | 'commonjs'} [options.packageType]
|
|
60
|
+
* @returns {Promise<import('../cli/packageJson').PackageJson.Imports | undefined>}
|
|
61
|
+
*/
|
|
62
|
+
export declare function createPackageImports(packageImports: import('../cli/packageJson').PackageJson['imports'], { bundles, cwd, outputDir, addTypes, expand, packageType }: {
|
|
63
|
+
bundles: BundleType[];
|
|
64
|
+
cwd: string;
|
|
65
|
+
outputDir?: string;
|
|
66
|
+
addTypes?: boolean;
|
|
67
|
+
expand?: boolean;
|
|
68
|
+
packageType?: 'module' | 'commonjs';
|
|
69
|
+
}): Promise<import('../cli/packageJson').PackageJson.Imports | undefined>;
|
|
70
|
+
/**
|
|
71
|
+
* @param {import('../cli/packageJson').PackageJson['bin']} bin
|
|
72
|
+
* @param {Object} options
|
|
73
|
+
* @param {BundleType[]} options.bundles
|
|
74
|
+
* @param {string} options.cwd
|
|
75
|
+
* @param {'module' | 'commonjs'} [options.packageType]
|
|
51
76
|
*/
|
|
52
|
-
export declare function createPackageBin(
|
|
53
|
-
|
|
54
|
-
bundles: {
|
|
55
|
-
type: BundleType;
|
|
56
|
-
dir: string;
|
|
57
|
-
}[];
|
|
77
|
+
export declare function createPackageBin(bin: import('../cli/packageJson').PackageJson['bin'], { bundles, cwd, packageType }: {
|
|
78
|
+
bundles: BundleType[];
|
|
58
79
|
cwd: string;
|
|
59
|
-
isFlat?: boolean;
|
|
60
80
|
packageType?: 'module' | 'commonjs';
|
|
61
81
|
}): Promise<string | Record<string, string> | undefined>;
|
|
62
82
|
/**
|
|
@@ -84,7 +104,6 @@ export declare function markFn<F extends () => Promise<any>>(label: string, fn:
|
|
|
84
104
|
* @param {string} label
|
|
85
105
|
*/
|
|
86
106
|
export declare function measureFn(label: string): PerformanceMeasure;
|
|
87
|
-
export declare const BASE_IGNORES: string[];
|
|
88
107
|
/**
|
|
89
108
|
* A utility to map a function over an array of items in a worker pool.
|
|
90
109
|
*
|
package/build/utils/git.d.mts
CHANGED
|
@@ -20,3 +20,10 @@ export declare function getRepositoryInfo(cwd?: string): Promise<RepoInfo>;
|
|
|
20
20
|
* @returns {Promise<string>} Current git commit SHA
|
|
21
21
|
*/
|
|
22
22
|
export declare function getCurrentGitSha(): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Check whether a tag already exists on the origin remote
|
|
25
|
+
* @param {string} tagName - Tag name to check (e.g. `v1.2.3`)
|
|
26
|
+
* @param {string} [cwd=process.cwd()]
|
|
27
|
+
* @returns {Promise<boolean>} True if the tag exists on origin
|
|
28
|
+
*/
|
|
29
|
+
export declare function remoteGitTagExists(tagName: string, cwd?: string): Promise<boolean>;
|
package/build/utils/github.d.mts
CHANGED
|
@@ -20,7 +20,7 @@ export type GitHubAppAuthenticationWithRefreshToken = {
|
|
|
20
20
|
* @property {string} [refreshTokenExpiresAt] - ISO string when the refresh token expires
|
|
21
21
|
*/
|
|
22
22
|
export declare function persistentAuthStrategy(): {
|
|
23
|
-
hook: (request: import(
|
|
23
|
+
hook: (request: import('@octokit/types').RequestInterface, route: import('@octokit/types').Route, parameters: import('@octokit/types').RequestParameters) => Promise<import("@octokit/types").OctokitResponse<any, number>>;
|
|
24
24
|
};
|
|
25
25
|
/**
|
|
26
26
|
* @param {Object} [options]
|
package/build/utils/pnpm.d.mts
CHANGED
|
@@ -31,6 +31,7 @@ export type GetWorkspacePackagesOptions = {
|
|
|
31
31
|
publicOnly?: boolean;
|
|
32
32
|
nonPublishedOnly?: boolean;
|
|
33
33
|
cwd?: string;
|
|
34
|
+
filter?: string[];
|
|
34
35
|
};
|
|
35
36
|
export declare function getWorkspacePackages(options?: {
|
|
36
37
|
publicOnly: true;
|
|
@@ -49,13 +50,78 @@ export declare function getWorkspacePackages(options?: GetWorkspacePackagesOptio
|
|
|
49
50
|
* @returns {Promise<VersionInfo>} Version information
|
|
50
51
|
*/
|
|
51
52
|
export declare function getPackageVersionInfo(packageName: string, baseVersion: string): Promise<VersionInfo>;
|
|
53
|
+
export type PublishSummaryEntry = {
|
|
54
|
+
name: string;
|
|
55
|
+
version: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* @typedef {Object} PublishSummaryEntry
|
|
59
|
+
* @property {string} name
|
|
60
|
+
* @property {string} version
|
|
61
|
+
*/
|
|
52
62
|
/**
|
|
53
63
|
* Publish packages with the given options
|
|
54
64
|
* @param {PublicPackage[]} packages - Packages to publish
|
|
55
65
|
* @param {PublishOptions} [options={}] - Publishing options
|
|
56
|
-
* @returns {Promise<
|
|
66
|
+
* @returns {Promise<PublishSummaryEntry[]>}
|
|
67
|
+
*/
|
|
68
|
+
export declare function publishPackages(packages: PublicPackage[], options?: PublishOptions): Promise<PublishSummaryEntry[]>;
|
|
69
|
+
export type GetTransitiveDependenciesOptions = {
|
|
70
|
+
workspacePathByName?: Map<string, string>;
|
|
71
|
+
includeDev?: boolean;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* @typedef {Object} GetTransitiveDependenciesOptions
|
|
75
|
+
* @property {Map<string, string>} [workspacePathByName] - Map of workspace package name to directory path
|
|
76
|
+
* @property {boolean} [includeDev=true] - Whether to include devDependencies in the traversal
|
|
57
77
|
*/
|
|
58
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Get all transitive workspace dependencies for a set of packages.
|
|
80
|
+
*
|
|
81
|
+
* Only follows deps whose version spec starts with `workspace:` (e.g. `workspace:*`
|
|
82
|
+
* or `workspace:^`), meaning they are sourced directly from the monorepo. Pinned
|
|
83
|
+
* external versions (e.g. `^1.0.0`) are ignored even when the package name exists
|
|
84
|
+
* in the workspace. Traverses `dependencies` and optionally `devDependencies`.
|
|
85
|
+
* Results are cached per package so each package is read from disk at most once
|
|
86
|
+
* regardless of how many roots depend on it.
|
|
87
|
+
*
|
|
88
|
+
* @param {string[]} packageNames - Package names to start the traversal from
|
|
89
|
+
* @param {GetTransitiveDependenciesOptions} [options]
|
|
90
|
+
* @returns {Promise<Set<string>>} All reachable workspace package names, including the input packages themselves
|
|
91
|
+
*/
|
|
92
|
+
export declare function getTransitiveDependencies(packageNames: string[], options?: GetTransitiveDependenciesOptions): Promise<Set<string>>;
|
|
93
|
+
/**
|
|
94
|
+
* Pure validation logic: given a publish set and workspace maps, checks that all
|
|
95
|
+
* transitive hard workspace dependencies are covered and none are private.
|
|
96
|
+
*
|
|
97
|
+
* A hard dependency is one listed in `dependencies` (not `peerDependencies` or
|
|
98
|
+
* `devDependencies`) using a `workspace:` version specifier (e.g. `workspace:*` or
|
|
99
|
+
* `workspace:^`). Peer dependencies are never bundled and dev dependencies are not installed
|
|
100
|
+
* on consumer devices - both are excluded regardless of version specifier. Pinned-version
|
|
101
|
+
* references in `dependencies` are also excluded - they resolve from the registry and do
|
|
102
|
+
* not need to be co-published.
|
|
103
|
+
*
|
|
104
|
+
* @param {PublicPackage[]} packages - The packages intended for publishing
|
|
105
|
+
* @param {Map<string, PublicPackage | PrivatePackage>} workspacePackageByName - All workspace packages by name
|
|
106
|
+
* @param {Map<string, string>} workspacePathByName - Map of workspace package name to directory path
|
|
107
|
+
* @returns {Promise<{issues: string[]}>}
|
|
108
|
+
* List of human-readable issue strings. Empty when the dependency set is valid.
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
111
|
+
export declare function checkPublishDependencies(packages: PublicPackage[], workspacePackageByName: Map<string, PublicPackage | PrivatePackage>, workspacePathByName: Map<string, string>): Promise<{
|
|
112
|
+
issues: string[];
|
|
113
|
+
}>;
|
|
114
|
+
/**
|
|
115
|
+
* Validate that a set of packages covers all of their transitive hard workspace dependencies,
|
|
116
|
+
* and that none of those dependencies are private (which would make them unpublishable).
|
|
117
|
+
*
|
|
118
|
+
* @param {PublicPackage[]} packages - The packages intended for publishing
|
|
119
|
+
* @returns {Promise<{issues: string[]}>}
|
|
120
|
+
* List of human-readable issue strings. Empty when the dependency set is valid.
|
|
121
|
+
*/
|
|
122
|
+
export declare function validatePublishDependencies(packages: PublicPackage[]): Promise<{
|
|
123
|
+
issues: string[];
|
|
124
|
+
}>;
|
|
59
125
|
/**
|
|
60
126
|
* Read package.json from a directory
|
|
61
127
|
* @param {string} packagePath - Path to package directory
|
|
@@ -69,6 +135,19 @@ export declare function readPackageJson(packagePath: string): Promise<import('..
|
|
|
69
135
|
* @returns {Promise<void>}
|
|
70
136
|
*/
|
|
71
137
|
export declare function writePackageJson(packagePath: string, packageJson: Object): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Write the computed overrides into whichever manifest already defines
|
|
140
|
+
* overrides — preferring pnpm-workspace.yaml, falling back to package.json
|
|
141
|
+
* `pnpm.overrides`, defaulting to pnpm-workspace.yaml — and persist the result.
|
|
142
|
+
* A missing pnpm-workspace.yaml is treated as empty, so a fresh file is created
|
|
143
|
+
* with just the `overrides:` block. Rejects a `resolutions` field in
|
|
144
|
+
* package.json because pnpm 11 silently ignores it.
|
|
145
|
+
*
|
|
146
|
+
* @param {string} workspaceDir - Workspace root directory
|
|
147
|
+
* @param {Record<string, string>} overrides - Overrides to apply
|
|
148
|
+
* @returns {Promise<void>}
|
|
149
|
+
*/
|
|
150
|
+
export declare function writeOverridesToWorkspace(workspaceDir: string, overrides: Record<string, string>): Promise<void>;
|
|
72
151
|
/**
|
|
73
152
|
* Resolve a package@version specifier to an exact version
|
|
74
153
|
* @param {string} packageSpec - Package specifier in format "package@version"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a temporary directory and registers an `onTestFinished` hook to
|
|
3
|
+
* remove it automatically when the current test ends — even if the test throws.
|
|
4
|
+
*
|
|
5
|
+
* @returns {Promise<string>} The path of the created temporary directory.
|
|
6
|
+
*/
|
|
7
|
+
export declare function makeTempDir(): Promise<string>;
|
|
@@ -22,19 +22,14 @@ export declare function copyDeclarations(sourceDirectory: string, destinationDir
|
|
|
22
22
|
* @param {Object} param0
|
|
23
23
|
* @param {string} param0.inputDir
|
|
24
24
|
* @param {string} param0.buildDir
|
|
25
|
-
* @param {
|
|
26
|
-
* @param {boolean} [param0.isFlat]
|
|
25
|
+
* @param {import('../utils/build.mjs').BundleType[]} param0.bundles
|
|
27
26
|
* @param {'module' | 'commonjs'} [param0.packageType]
|
|
28
27
|
* @returns
|
|
29
28
|
*/
|
|
30
|
-
export declare function moveAndTransformDeclarations({ inputDir, buildDir, bundles,
|
|
29
|
+
export declare function moveAndTransformDeclarations({ inputDir, buildDir, bundles, packageType }: {
|
|
31
30
|
inputDir: string;
|
|
32
31
|
buildDir: string;
|
|
33
|
-
bundles:
|
|
34
|
-
type: import('../utils/build.mjs').BundleType;
|
|
35
|
-
dir: string;
|
|
36
|
-
}[];
|
|
37
|
-
isFlat?: boolean;
|
|
32
|
+
bundles: import('../utils/build.mjs').BundleType[];
|
|
38
33
|
packageType?: 'module' | 'commonjs';
|
|
39
34
|
}): Promise<void>;
|
|
40
35
|
/**
|
|
@@ -43,9 +38,8 @@ export declare function moveAndTransformDeclarations({ inputDir, buildDir, bundl
|
|
|
43
38
|
* After copying, babel transformations are applied to the copied files because they need to be alongside the actual js files for proper resolution.
|
|
44
39
|
*
|
|
45
40
|
* @param {Object} param0
|
|
46
|
-
* @param {boolean} [param0.isFlat = false] - Whether to place generated declaration files in a flattened directory.
|
|
47
41
|
* @param {boolean} [param0.verbose = false] - Whether to log additional information while generating and moving declaration files.
|
|
48
|
-
* @param {
|
|
42
|
+
* @param {import('../utils/build.mjs').BundleType[]} param0.bundles - The bundles to create declarations for.
|
|
49
43
|
* @param {string} param0.srcDir - The source directory.
|
|
50
44
|
* @param {string} param0.buildDir - The build directory.
|
|
51
45
|
* @param {string} param0.cwd - The current working directory.
|
|
@@ -53,13 +47,9 @@ export declare function moveAndTransformDeclarations({ inputDir, buildDir, bundl
|
|
|
53
47
|
* @param {boolean} [param0.useTsgo=false] - Whether to build types using typescript native (tsgo).
|
|
54
48
|
* @param {'module' | 'commonjs'} [param0.packageType] - The package.json type field.
|
|
55
49
|
*/
|
|
56
|
-
export declare function createTypes({ bundles, srcDir, buildDir, cwd, skipTsc, useTsgo,
|
|
57
|
-
isFlat?: boolean;
|
|
50
|
+
export declare function createTypes({ bundles, srcDir, buildDir, cwd, skipTsc, useTsgo, packageType, verbose, }: {
|
|
58
51
|
verbose?: boolean;
|
|
59
|
-
bundles:
|
|
60
|
-
type: import('../utils/build.mjs').BundleType;
|
|
61
|
-
dir: string;
|
|
62
|
-
}[];
|
|
52
|
+
bundles: import('../utils/build.mjs').BundleType[];
|
|
63
53
|
srcDir: string;
|
|
64
54
|
buildDir: string;
|
|
65
55
|
cwd: string;
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/internal-code-infra",
|
|
3
|
-
"version": "0.0.4-canary.
|
|
3
|
+
"version": "0.0.4-canary.90",
|
|
4
|
+
"author": "MUI Team",
|
|
4
5
|
"description": "Infra scripts and configs to be used across MUI repos.",
|
|
5
|
-
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
10
|
"url": "git+https://github.com/mui/mui-public.git",
|
|
@@ -28,9 +29,9 @@
|
|
|
28
29
|
"types": "./build/utils/github.d.mts",
|
|
29
30
|
"default": "./src/utils/github.mjs"
|
|
30
31
|
},
|
|
31
|
-
"./
|
|
32
|
-
"types": "./build/
|
|
33
|
-
"default": "./src/
|
|
32
|
+
"./remark": {
|
|
33
|
+
"types": "./build/remark/config.d.mts",
|
|
34
|
+
"default": "./src/remark/config.mjs"
|
|
34
35
|
},
|
|
35
36
|
"./prettier": {
|
|
36
37
|
"types": "./build/prettier.d.mts",
|
|
@@ -52,28 +53,28 @@
|
|
|
52
53
|
"code-infra": "./bin/code-infra.mjs"
|
|
53
54
|
},
|
|
54
55
|
"dependencies": {
|
|
55
|
-
"@argos-ci/core": "
|
|
56
|
-
"@babel/cli": "^7.
|
|
57
|
-
"@babel/core": "^7.29.
|
|
58
|
-
"@babel/plugin-syntax-jsx": "^7.
|
|
59
|
-
"@babel/plugin-syntax-typescript": "^7.
|
|
60
|
-
"@babel/plugin-transform-runtime": "^7.29.
|
|
61
|
-
"@babel/preset-env": "^7.29.
|
|
62
|
-
"@babel/preset-react": "^7.
|
|
63
|
-
"@babel/preset-typescript": "^7.
|
|
64
|
-
"@eslint/compat": "^2.0
|
|
56
|
+
"@argos-ci/core": "6.5.0",
|
|
57
|
+
"@babel/cli": "^7.29.7",
|
|
58
|
+
"@babel/core": "^7.29.7",
|
|
59
|
+
"@babel/plugin-syntax-jsx": "^7.29.7",
|
|
60
|
+
"@babel/plugin-syntax-typescript": "^7.29.7",
|
|
61
|
+
"@babel/plugin-transform-runtime": "^7.29.7",
|
|
62
|
+
"@babel/preset-env": "^7.29.7",
|
|
63
|
+
"@babel/preset-react": "^7.29.7",
|
|
64
|
+
"@babel/preset-typescript": "^7.29.7",
|
|
65
|
+
"@eslint/compat": "^2.1.0",
|
|
65
66
|
"@eslint/js": "^10.0.1",
|
|
66
|
-
"@eslint/json": "^
|
|
67
|
-
"@inquirer/confirm": "^6.
|
|
68
|
-
"@inquirer/select": "^5.1
|
|
69
|
-
"@napi-rs/keyring": "^1.
|
|
67
|
+
"@eslint/json": "^2.0.1",
|
|
68
|
+
"@inquirer/confirm": "^6.1.1",
|
|
69
|
+
"@inquirer/select": "^5.2.1",
|
|
70
|
+
"@napi-rs/keyring": "^1.3.0",
|
|
70
71
|
"@octokit/auth-action": "^6.0.2",
|
|
71
72
|
"@octokit/oauth-methods": "^6.0.2",
|
|
72
73
|
"@octokit/rest": "^22.0.1",
|
|
73
|
-
"@pnpm/find-workspace-dir": "^1000.1.
|
|
74
|
-
"@typescript-eslint/types": "^8.
|
|
75
|
-
"@typescript-eslint/utils": "^8.
|
|
76
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
74
|
+
"@pnpm/find-workspace-dir": "^1000.1.5",
|
|
75
|
+
"@typescript-eslint/types": "^8.63.0",
|
|
76
|
+
"@typescript-eslint/utils": "^8.63.0",
|
|
77
|
+
"@vitest/eslint-plugin": "^1.6.22",
|
|
77
78
|
"babel-plugin-optimize-clsx": "^2.6.2",
|
|
78
79
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
79
80
|
"babel-plugin-transform-import-meta": "^2.3.3",
|
|
@@ -82,50 +83,68 @@
|
|
|
82
83
|
"babel-plugin-transform-remove-imports": "^1.8.1",
|
|
83
84
|
"chalk": "^5.6.2",
|
|
84
85
|
"clipboardy": "^5.3.1",
|
|
85
|
-
"content-type": "^
|
|
86
|
+
"content-type": "^2.0.0",
|
|
86
87
|
"env-ci": "^11.2.0",
|
|
88
|
+
"es-toolkit": "^1.49.0",
|
|
87
89
|
"eslint-config-prettier": "^10.1.8",
|
|
88
90
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
89
|
-
"eslint-module-utils": "^2.
|
|
90
|
-
"eslint-plugin-compat": "^7.0.
|
|
91
|
+
"eslint-module-utils": "^2.13.0",
|
|
92
|
+
"eslint-plugin-compat": "^7.0.2",
|
|
91
93
|
"eslint-plugin-import": "^2.32.0",
|
|
92
94
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
93
|
-
"eslint-plugin-
|
|
95
|
+
"eslint-plugin-mdx": "^3.8.1",
|
|
96
|
+
"eslint-plugin-mocha": "^11.3.0",
|
|
94
97
|
"eslint-plugin-react": "^7.37.5",
|
|
95
98
|
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
|
|
96
|
-
"eslint-plugin-react-hooks": "^7.
|
|
97
|
-
"eslint-plugin-testing-library": "^7.16.
|
|
98
|
-
"es-toolkit": "^1.45.1",
|
|
99
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
100
|
+
"eslint-plugin-testing-library": "^7.16.2",
|
|
99
101
|
"execa": "^9.6.1",
|
|
100
102
|
"git-url-parse": "^16.1.0",
|
|
101
|
-
"globals": "^17.
|
|
102
|
-
"globby": "^16.
|
|
103
|
-
"
|
|
104
|
-
"
|
|
103
|
+
"globals": "^17.7.0",
|
|
104
|
+
"globby": "^16.2.0",
|
|
105
|
+
"html-validate": "^11.5.5",
|
|
106
|
+
"minimatch": "^10.2.5",
|
|
107
|
+
"node-html-parser": "^9.0.0",
|
|
105
108
|
"open": "^11.0.0",
|
|
106
109
|
"postcss-styled-syntax": "^0.7.1",
|
|
107
110
|
"regexp.escape": "^2.0.1",
|
|
108
111
|
"rehype-slug": "^6.0.0",
|
|
109
112
|
"rehype-stringify": "^10.0.1",
|
|
113
|
+
"remark-frontmatter": "^5.0.0",
|
|
110
114
|
"remark-gfm": "^4.0.1",
|
|
115
|
+
"remark-lint": "^10.0.1",
|
|
116
|
+
"remark-lint-code-block-style": "^4.0.1",
|
|
117
|
+
"remark-lint-fenced-code-flag": "^4.2.0",
|
|
118
|
+
"remark-lint-heading-increment": "^4.0.1",
|
|
119
|
+
"remark-lint-heading-style": "^4.0.1",
|
|
120
|
+
"remark-lint-no-duplicate-headings": "^4.0.1",
|
|
121
|
+
"remark-lint-no-empty-url": "^4.0.1",
|
|
122
|
+
"remark-lint-no-heading-punctuation": "^4.0.1",
|
|
123
|
+
"remark-lint-no-multiple-toplevel-headings": "^4.0.1",
|
|
124
|
+
"remark-lint-no-undefined-references": "^5.0.2",
|
|
125
|
+
"remark-lint-no-unused-definitions": "^4.0.2",
|
|
126
|
+
"remark-lint-table-pipes": "^5.0.1",
|
|
111
127
|
"remark-parse": "^11.0.0",
|
|
112
128
|
"remark-rehype": "^11.1.2",
|
|
113
129
|
"resolve-pkg-maps": "^1.0.0",
|
|
114
|
-
"semver": "^7.
|
|
130
|
+
"semver": "^7.8.0",
|
|
115
131
|
"stylelint-config-standard": "^40.0.0",
|
|
116
|
-
"typescript-eslint": "^8.
|
|
132
|
+
"typescript-eslint": "^8.63.0",
|
|
117
133
|
"unified": "^11.0.5",
|
|
134
|
+
"unified-lint-rule": "^3.0.1",
|
|
135
|
+
"unist-util-visit": "^5.1.0",
|
|
136
|
+
"yaml": "^2.9.0",
|
|
118
137
|
"yargs": "^18.0.0",
|
|
119
|
-
"@mui/internal-babel-plugin-display-name": "1.0.4-canary.
|
|
120
|
-
"@mui/internal-babel-plugin-
|
|
121
|
-
"@mui/internal-babel-plugin-
|
|
138
|
+
"@mui/internal-babel-plugin-display-name": "1.0.4-canary.22",
|
|
139
|
+
"@mui/internal-babel-plugin-minify-errors": "2.0.8-canary.29",
|
|
140
|
+
"@mui/internal-babel-plugin-resolve-imports": "2.0.7-canary.39"
|
|
122
141
|
},
|
|
123
142
|
"peerDependencies": {
|
|
124
143
|
"@next/eslint-plugin-next": "*",
|
|
125
144
|
"@typescript/native-preview": ">=7.0.0-dev.0",
|
|
126
145
|
"eslint": "^9.0.0 || ^10.0.0",
|
|
127
146
|
"prettier": "^3.0.0",
|
|
128
|
-
"typescript": "^5.0.0"
|
|
147
|
+
"typescript": "^5.0.0 || ^6.0.0"
|
|
129
148
|
},
|
|
130
149
|
"peerDependenciesMeta": {
|
|
131
150
|
"@typescript/native-preview": {
|
|
@@ -139,32 +158,37 @@
|
|
|
139
158
|
"@octokit/types": "16.0.0",
|
|
140
159
|
"@types/babel__core": "7.20.5",
|
|
141
160
|
"@types/babel__preset-env": "7.10.0",
|
|
142
|
-
"@types/content-type": "1.1.9",
|
|
143
161
|
"@types/env-ci": "3.1.4",
|
|
144
162
|
"@types/eslint-plugin-jsx-a11y": "6.10.1",
|
|
145
|
-
"@types/estree": "1.0.
|
|
163
|
+
"@types/estree": "1.0.9",
|
|
146
164
|
"@types/estree-jsx": "1.0.5",
|
|
165
|
+
"@types/mdast": "4.0.4",
|
|
147
166
|
"@types/regexp.escape": "2.0.0",
|
|
148
167
|
"@types/yargs": "17.0.35",
|
|
149
|
-
"@typescript-eslint/parser": "8.
|
|
150
|
-
"@typescript-eslint/rule-tester": "8.
|
|
151
|
-
"eslint": "10.0
|
|
152
|
-
"get-port": "7.
|
|
153
|
-
"prettier": "3.8.
|
|
168
|
+
"@typescript-eslint/parser": "8.63.0",
|
|
169
|
+
"@typescript-eslint/rule-tester": "8.63.0",
|
|
170
|
+
"eslint": "10.6.0",
|
|
171
|
+
"get-port": "7.2.0",
|
|
172
|
+
"prettier": "3.8.3",
|
|
173
|
+
"remark": "15.0.1",
|
|
174
|
+
"remark-mdx": "3.1.1",
|
|
154
175
|
"serve": "14.2.6",
|
|
155
|
-
"typescript-eslint": "8.
|
|
176
|
+
"typescript-eslint": "8.63.0"
|
|
156
177
|
},
|
|
157
178
|
"files": [
|
|
158
179
|
"bin",
|
|
159
180
|
"build",
|
|
160
181
|
"src",
|
|
182
|
+
"vale",
|
|
161
183
|
"README.md",
|
|
162
|
-
"LICENSE"
|
|
184
|
+
"LICENSE",
|
|
185
|
+
"!src/**/__fixtures__/**",
|
|
186
|
+
"!src/**/*.test.*"
|
|
163
187
|
],
|
|
164
188
|
"publishConfig": {
|
|
165
189
|
"access": "public"
|
|
166
190
|
},
|
|
167
|
-
"gitSha": "
|
|
191
|
+
"gitSha": "d0c4e65df099189157250fa353917bcb28ff4110",
|
|
168
192
|
"scripts": {
|
|
169
193
|
"build": "tsgo -p tsconfig.build.json",
|
|
170
194
|
"typescript": "tsgo -noEmit",
|
package/src/babel-config.mjs
CHANGED
|
@@ -25,6 +25,7 @@ import pluginRemovePropTypes from 'babel-plugin-transform-react-remove-prop-type
|
|
|
25
25
|
* @param {string} param0.runtimeVersion
|
|
26
26
|
* @param {string} [param0.reactCompilerReactVersion]
|
|
27
27
|
* @param {ReactCompilationMode} [param0.reactCompilerMode]
|
|
28
|
+
* @param {{ allowedCallees?: Record<string, string[]> }} [param0.displayName] - Options for the display name plugin.
|
|
28
29
|
* @returns {import('@babel/core').TransformOptions} The base Babel configuration.
|
|
29
30
|
*/
|
|
30
31
|
export function getBaseConfig({
|
|
@@ -37,6 +38,7 @@ export function getBaseConfig({
|
|
|
37
38
|
outExtension,
|
|
38
39
|
reactCompilerReactVersion,
|
|
39
40
|
reactCompilerMode,
|
|
41
|
+
displayName,
|
|
40
42
|
}) {
|
|
41
43
|
/**
|
|
42
44
|
* @type {import('@babel/preset-env').Options}
|
|
@@ -61,7 +63,7 @@ export function getBaseConfig({
|
|
|
61
63
|
},
|
|
62
64
|
'@babel/plugin-transform-runtime',
|
|
63
65
|
],
|
|
64
|
-
[pluginDisplayName, {}, '@mui/internal-babel-plugin-display-name'],
|
|
66
|
+
[pluginDisplayName, { ...displayName }, '@mui/internal-babel-plugin-display-name'],
|
|
65
67
|
[
|
|
66
68
|
pluginTransformInlineEnvVars,
|
|
67
69
|
{
|