@mui/internal-code-infra 0.1.1-canary.4 → 0.1.1-canary.41

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.
Files changed (102) hide show
  1. package/README.md +36 -4
  2. package/build/babel-config.d.mts +7 -1
  3. package/build/changelog/changelogChanges.d.mts +42 -0
  4. package/build/changelog/changelogGrouping.d.mts +52 -0
  5. package/build/changelog/changelogMarkdown.d.mts +69 -0
  6. package/build/changelog/changelogTags.d.mts +15 -0
  7. package/build/changelog/changelogTitle.d.mts +28 -0
  8. package/build/changelog/fetchChangelogData.d.mts +16 -0
  9. package/build/changelog/fetchChangelogs.d.mts +11 -12
  10. package/build/changelog/index.d.mts +25 -0
  11. package/build/changelog/octokit.d.mts +7 -0
  12. package/build/changelog/types.d.ts +174 -0
  13. package/build/eslint/baseConfig.d.mts +1 -1
  14. package/build/eslint/index.d.mts +1 -0
  15. package/build/eslint/mui/rules/no-constructor-assigned-field.d.mts +50 -0
  16. package/build/eslint/nodeSupportConfig.d.mts +11 -0
  17. package/build/eslint/packageJsonConfig.d.mts +7 -0
  18. package/build/remark/config.d.mts +5 -14
  19. package/build/utils/babelPlugin.d.mts +8 -0
  20. package/build/utils/build.d.mts +22 -0
  21. package/build/utils/cjsSourcesPlugin.d.mts +11 -0
  22. package/build/utils/credentials.d.mts +2 -2
  23. package/build/utils/dtsExportsPlugin.d.mts +8 -0
  24. package/build/utils/dtsNamespacesPlugin.d.mts +19 -0
  25. package/build/utils/fileUrlEntriesPlugin.d.mts +9 -0
  26. package/build/utils/getPublishedPkgJson.d.mts +20 -0
  27. package/build/utils/git.d.mts +30 -9
  28. package/build/utils/github.d.mts +8 -0
  29. package/build/utils/jsNamespacesPlugin.d.mts +13 -0
  30. package/build/utils/pnpm.d.mts +67 -3
  31. package/build/utils/publint.d.mts +6 -0
  32. package/build/utils/rolldownOutput.d.mts +38 -0
  33. package/build/utils/testUtils.d.mts +8 -0
  34. package/build/utils/typescript.d.mts +17 -0
  35. package/package.json +61 -49
  36. package/src/babel-config.mjs +35 -1
  37. package/src/brokenLinksChecker/index.mjs +8 -1
  38. package/src/changelog/changelogChanges.mjs +479 -0
  39. package/src/changelog/changelogGrouping.mjs +148 -0
  40. package/src/changelog/changelogMarkdown.mjs +110 -0
  41. package/src/changelog/changelogTags.mjs +34 -0
  42. package/src/changelog/changelogTitle.mjs +56 -0
  43. package/src/changelog/fetchChangelogData.mjs +172 -0
  44. package/src/changelog/fetchChangelogs.mjs +47 -34
  45. package/src/changelog/index.mjs +34 -0
  46. package/src/changelog/octokit.mjs +35 -0
  47. package/src/changelog/types.ts +187 -0
  48. package/src/cli/cmdBaseline.mjs +31 -0
  49. package/src/cli/cmdBuild.mjs +20 -89
  50. package/src/cli/cmdBuildNew.mjs +474 -0
  51. package/src/cli/cmdNetlifyIgnore.mjs +14 -7
  52. package/src/cli/cmdPublish.mjs +17 -3
  53. package/src/cli/cmdPublishNewPackage.mjs +11 -4
  54. package/src/cli/cmdValidateBuiltTypes.mjs +447 -32
  55. package/src/cli/index.mjs +4 -0
  56. package/src/eslint/baseConfig.mjs +10 -2
  57. package/src/eslint/docsConfig.mjs +28 -10
  58. package/src/eslint/index.mjs +1 -0
  59. package/src/eslint/jsonConfig.mjs +2 -1
  60. package/src/eslint/mui/config.mjs +16 -1
  61. package/src/eslint/mui/index.mjs +2 -0
  62. package/src/eslint/mui/rules/disallow-react-api-in-server-components.mjs +4 -1
  63. package/src/eslint/mui/rules/no-constructor-assigned-field.mjs +183 -0
  64. package/src/eslint/nodeSupportConfig.mjs +70 -0
  65. package/src/eslint/packageJsonConfig.mjs +50 -0
  66. package/src/eslint/testConfig.mjs +4 -2
  67. package/src/remark/config.mjs +60 -13
  68. package/src/utils/babelPlugin.mjs +52 -0
  69. package/src/utils/build.mjs +81 -0
  70. package/src/utils/cjsSourcesPlugin.mjs +92 -0
  71. package/src/utils/credentials.mjs +4 -3
  72. package/src/utils/dtsExportsPlugin.mjs +103 -0
  73. package/src/utils/dtsNamespacesPlugin.mjs +226 -0
  74. package/src/utils/extractErrorCodes.mjs +1 -3
  75. package/src/utils/fileUrlEntriesPlugin.mjs +84 -0
  76. package/src/utils/getPublishedPkgJson.mjs +86 -0
  77. package/src/utils/git.mjs +107 -46
  78. package/src/utils/github.mjs +27 -0
  79. package/src/utils/jsNamespacesPlugin.mjs +505 -0
  80. package/src/utils/pnpm.mjs +126 -25
  81. package/src/utils/publint.mjs +34 -0
  82. package/src/utils/rolldownOutput.mjs +70 -0
  83. package/src/utils/testUtils.mjs +26 -0
  84. package/src/utils/typescript.mjs +23 -13
  85. package/vale/styles/MUI/GoogleLatin.yml +5 -2
  86. package/build/cli/cmdArgosPush.d.mts +0 -18
  87. package/build/cli/cmdBuild.d.mts +0 -64
  88. package/build/cli/cmdCopyFiles.d.mts +0 -20
  89. package/build/cli/cmdExtractErrorCodes.d.mts +0 -6
  90. package/build/cli/cmdGenerateChangelog.d.mts +0 -32
  91. package/build/cli/cmdGithubAuth.d.mts +0 -11
  92. package/build/cli/cmdListWorkspaces.d.mts +0 -29
  93. package/build/cli/cmdNetlifyIgnore.d.mts +0 -17
  94. package/build/cli/cmdPublish.d.mts +0 -32
  95. package/build/cli/cmdPublishCanary.d.mts +0 -34
  96. package/build/cli/cmdPublishNewPackage.d.mts +0 -17
  97. package/build/cli/cmdRenameScope.d.mts +0 -18
  98. package/build/cli/cmdSetVersionOverrides.d.mts +0 -9
  99. package/build/cli/cmdVale.d.mts +0 -46
  100. package/build/cli/cmdValidateBuiltTypes.d.mts +0 -2
  101. package/build/cli/index.d.mts +0 -1
  102. package/vale/styles/MUI/CorrectRererenceCased.yml +0 -14
@@ -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;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Runs a Babel config in `oxc` mode: `getBaseConfig` keeps only the plugins Oxc has no
3
+ * equivalent for, and the config file adds its own. Oxc then strips types, compiles JSX and
4
+ * lowers syntax.
5
+ * @param {string} configFile
6
+ * @returns {import('tsdown').Rolldown.Plugin}
7
+ */
8
+ export declare function babelPlugin(configFile: string): import('tsdown').Rolldown.Plugin;
@@ -82,6 +82,14 @@ export declare function createPackageBin(bin: import('../cli/packageJson').Packa
82
82
  cwd: string;
83
83
  packageType?: 'module' | 'commonjs';
84
84
  }): Promise<string | Record<string, string> | undefined>;
85
+ /**
86
+ * The JS/TS sources the package's `exports`, `imports` and `bin` point at, relative to `cwd`.
87
+ * Glob patterns are expanded against the files on disk, as in the published `package.json`.
88
+ * @param {import('../cli/packageJson').PackageJson} packageJson
89
+ * @param {string} cwd
90
+ * @returns {Promise<string[]>}
91
+ */
92
+ export declare function getPackageSources({ exports, imports, bin }: import('../cli/packageJson').PackageJson, cwd: string): Promise<string[]>;
85
93
  /**
86
94
  * Validates the package.json before building.
87
95
  * @param {Record<string, any>} packageJson
@@ -93,6 +101,20 @@ export declare function validatePkgJson(packageJson: Record<string, any>, option
93
101
  skipMainCheck?: boolean;
94
102
  enableReactCompiler?: boolean;
95
103
  }): void;
104
+ /**
105
+ * Validates that "engines.node" in package.json doesn't allow Node.js versions older than the
106
+ * "node" browserslist environment, which the CommonJS bundle is compiled for. Otherwise the
107
+ * build can emit syntax that the oldest supported Node.js version can't run.
108
+ * Targets are resolved the same way `@babel/preset-env` resolves them during the build.
109
+ * @param {{ name?: string; engines?: { node?: string } }} packageJson
110
+ * @param {string} cwd - The package directory, used to find the browserslist config.
111
+ */
112
+ export declare function validateEnginesNode(packageJson: {
113
+ name?: string;
114
+ engines?: {
115
+ node?: string;
116
+ };
117
+ }, cwd: string): void;
96
118
  /**
97
119
  * Marks the start and end of a function execution for performance measurement.
98
120
  * Uses the Performance API to create marks and measure the duration.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Ships `.cjs` sources unchanged. Rolldown would turn them into ESM whose `require` calls go
3
+ * through a runtime helper bundlers can't resolve, so imports of them stay as written and each is
4
+ * emitted as is. The local modules one requires are built at the path the `require` names. Only
5
+ * `@mui/material-nextjs` needs it: its `.cjs` shims exist because `next` has no `exports` map
6
+ * (https://github.com/vercel/next.js/issues/77200). Remove this plugin once that is fixed.
7
+ * @param {string} sourceDir
8
+ * @param {string | undefined} cjsExtension The CommonJS bundle's output extension, if it is built.
9
+ * @returns {import('tsdown').Rolldown.Plugin}
10
+ */
11
+ export declare function cjsSourcesPlugin(sourceDir: string, cjsExtension: string | undefined): import('tsdown').Rolldown.Plugin;
@@ -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 | undefined>}
11
+ * @returns {Promise<string | null>}
12
12
  */
13
- export declare function getPassword(key: string): Promise<string | undefined>;
13
+ export declare function getPassword(key: string): Promise<string | null>;
14
14
  /**
15
15
  * @param {string} key
16
16
  * @param {string} password
@@ -0,0 +1,8 @@
1
+ export type Body = import('rolldown/utils').ParseResult['program']['body'];
2
+ /**
3
+ * rolldown-plugin-dts prints re-exports as `import { X } from …; export { X }`. Module
4
+ * augmentation of the exported alias then doesn't reach the interface other declarations
5
+ * reference, so these become `export { X } from …`.
6
+ * @returns {import('tsdown').Rolldown.Plugin}
7
+ */
8
+ export declare function dtsExportsPlugin(): import('tsdown').Rolldown.Plugin;
@@ -0,0 +1,19 @@
1
+ export type Node = import('./rolldownOutput.mjs').Node;
2
+ export type Namespace = {
3
+ /**
4
+ * The binding the module exports the namespace by.
5
+ */
6
+ local: string;
7
+ /**
8
+ * The declaration or import that creates it.
9
+ */
10
+ node: Node;
11
+ };
12
+ /**
13
+ * For a namespace import, rolldown-plugin-dts declares a `<name>_exports` namespace that leaves out
14
+ * names re-exported from packages. Importers get `import * as` instead, as tsc emits, and the
15
+ * namespace is dropped. Remove this plugin once rolldown-plugin-dts keeps those names:
16
+ * https://github.com/sxzz/rolldown-plugin-dts/issues/300
17
+ * @returns {import('tsdown').Rolldown.Plugin}
18
+ */
19
+ export declare function dtsNamespacesPlugin(): import('tsdown').Rolldown.Plugin;
@@ -0,0 +1,9 @@
1
+ export type NewExpression = import('rolldown/utils').ESTree.NewExpression;
2
+ /**
3
+ * Builds the modules sources load with `new URL('./file', import.meta.url)`, such as workers. No
4
+ * import or `exports` entry reaches them, so they would be missing from the output. Each becomes
5
+ * an entry, compiled like any other source, and the URL is rewritten to its output path and
6
+ * extension (`new URL('./worker.ts', …)` → `new URL('./worker.mjs', …)`).
7
+ * @returns {import('tsdown').Rolldown.Plugin}
8
+ */
9
+ export declare function fileUrlEntriesPlugin(): import('tsdown').Rolldown.Plugin;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @param {Object} options
3
+ * @param {import('../cli/packageJson').PackageJson} options.packageJson - The source package.json content.
4
+ * @param {import('./build.mjs').BundleType[]} options.bundles
5
+ * @param {string} options.outputDir
6
+ * @param {string} options.cwd
7
+ * @param {boolean} options.addTypes - Whether to add type declarations for the package.
8
+ * @param {boolean} [options.expand] - Whether to enumerate glob patterns into concrete entries.
9
+ * @param {'module' | 'commonjs'} options.packageType - The package.json type field.
10
+ * @returns {Promise<import('../cli/packageJson').PackageJson>} The package.json to publish from `outputDir`.
11
+ */
12
+ export declare function getPublishedPkgJson({ packageJson: source, bundles, outputDir, cwd, addTypes, expand, packageType, }: {
13
+ packageJson: import('../cli/packageJson').PackageJson;
14
+ bundles: import('./build.mjs').BundleType[];
15
+ outputDir: string;
16
+ cwd: string;
17
+ addTypes: boolean;
18
+ expand?: boolean;
19
+ packageType: 'module' | 'commonjs';
20
+ }): Promise<import('../cli/packageJson').PackageJson>;
@@ -13,22 +13,18 @@ export type RepoInfo = {
13
13
  remoteName: string;
14
14
  };
15
15
  /**
16
- * @typedef {Object} RepoInfo
17
- * @property {string} owner - Repository owner
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>} Repository owner and name
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>;
@@ -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;
@@ -0,0 +1,13 @@
1
+ export type Edit = import('./rolldownOutput.mjs').Edit;
2
+ export type Node = import('./rolldownOutput.mjs').Node;
3
+ /**
4
+ * Rolldown turns `export * as X from './parts'` into an `__exportAll()` object holding every
5
+ * export, which bundlers can't tree-shake. Rolldown also reads names an external `export *` provides
6
+ * through that object. ESM chunks import such namespaces with `import * as` instead, and CommonJS
7
+ * chunks read the module's `exports`. Objects nothing references any more are removed with their
8
+ * `<name>_exports` export.
9
+ * Remove this plugin once Rolldown keeps namespace re-exports in unbundled builds:
10
+ * https://github.com/rolldown/rolldown/issues/6669
11
+ * @returns {import('tsdown').Rolldown.Plugin}
12
+ */
13
+ export declare function jsNamespacesPlugin(): import('tsdown').Rolldown.Plugin;
@@ -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
- * @returns {Promise<PublicPackage[]>} The subset needing a manual first publish
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 getPackagesNeedingManualPublish(packages: PublicPackage[]): Promise<PublicPackage[]>;
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 getPackagesNeedingManualPublish} where
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
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Lints the output directory with publint. Errors fail the build, warnings are only reported.
3
+ * @param {string} buildDir - The build directory to validate.
4
+ * @returns {Promise<void>}
5
+ */
6
+ export declare function validateWithPublint(buildDir: string): Promise<void>;
@@ -0,0 +1,38 @@
1
+ export declare const DTS_FILES: RegExp;
2
+ export declare const GENERATED_NAMESPACE: RegExp;
3
+ export type Edit = {
4
+ start: number;
5
+ end: number;
6
+ text: string;
7
+ };
8
+ export type Node = import('rolldown/utils').ESTree.Node;
9
+ export type Name = import('rolldown/utils').ESTree.ModuleExportName | import('rolldown/utils').ESTree.BindingIdentifier;
10
+ /**
11
+ * @typedef {{ start: number; end: number; text: string }} Edit
12
+ * @typedef {import('rolldown/utils').ESTree.Node} Node
13
+ * @typedef {import('rolldown/utils').ESTree.ModuleExportName | import('rolldown/utils').ESTree.BindingIdentifier} Name
14
+ */
15
+ /**
16
+ * @param {string} code
17
+ * @param {Edit[]} edits
18
+ */
19
+ export declare function applyEdits(code: string, edits: Edit[]): string;
20
+ /**
21
+ * @param {string} code
22
+ * @param {string} name
23
+ */
24
+ export declare function countReferences(code: string, name: string): number;
25
+ /** @param {Name} node */
26
+ export declare function getName(node: Name): string;
27
+ /**
28
+ * The imported and local names of an import specifier, or the local and exported names of an
29
+ * export specifier.
30
+ * @param {Node} specifier
31
+ * @returns {[Name, Name] | []}
32
+ */
33
+ export declare function getBinding(specifier: Node): [Name, Name] | [];
34
+ /**
35
+ * @param {string} code
36
+ * @param {Node} node
37
+ */
38
+ export declare function slice(code: string, node: Node): string;
@@ -5,6 +5,13 @@
5
5
  * @returns {Promise<string>} The path of the created temporary directory.
6
6
  */
7
7
  export declare function makeTempDir(): Promise<string>;
8
+ /**
9
+ * Creates a temporary directory (see {@link makeTempDir}) containing `files`.
10
+ *
11
+ * @param {Record<string, string>} files - File contents keyed by path relative to the directory.
12
+ * @returns {Promise<string>} The path of the created temporary directory.
13
+ */
14
+ export declare function makeTempFiles(files: Record<string, string>): Promise<string>;
8
15
  /**
9
16
  * Write a package.json into a subdirectory of a temp workspace.
10
17
  *
@@ -26,3 +33,4 @@ export declare function publicPkg(name: string, pkgPath: string): import('./pnpm
26
33
  * @returns {import('./pnpm.mjs').PrivatePackage}
27
34
  */
28
35
  export declare function privatePkg(name: string, pkgPath: string): import('./pnpm.mjs').PrivatePackage;
36
+ export declare function getTsgo(): Promise<any>;
@@ -1,3 +1,20 @@
1
+ /**
2
+ * Resolves the native/JS TypeScript CLI pair from the workspace root's
3
+ * `node_modules/.bin`: tsgo/tsc when the legacy `tsgo` shim exists, tsc/tsc6
4
+ * otherwise, with bare `tsc` from PATH as the JS fallback.
5
+ *
6
+ * @param {string} cwd
7
+ * @returns {Promise<{ native: string | null, js: string }>}
8
+ */
9
+ export declare function findTscPair(cwd: string): Promise<{
10
+ native: string | null;
11
+ js: string;
12
+ }>;
13
+ /**
14
+ * @param {string} cwd
15
+ * @returns {Promise<string>} The `tsconfig.build.json` to emit declarations with.
16
+ */
17
+ export declare function getTsconfig(cwd: string): Promise<string>;
1
18
  /**
2
19
  * Emits TypeScript declaration files.
3
20
  * @param {string} tsconfig - The path to the tsconfig.json file.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/internal-code-infra",
3
- "version": "0.1.1-canary.4",
3
+ "version": "0.1.1-canary.41",
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,74 @@
53
53
  "code-infra": "./bin/code-infra.mjs"
54
54
  },
55
55
  "dependencies": {
56
- "@argos-ci/core": "6.8.4",
57
- "@babel/cli": "^8.0.5",
58
- "@babel/core": "^8.0.5",
56
+ "@argos-ci/core": "6.9.2",
57
+ "@babel/cli": "^8.1.0",
58
+ "@babel/core": "^8.1.3",
59
+ "@babel/helper-compilation-targets": "^8.0.7",
59
60
  "@babel/plugin-syntax-jsx": "^8.0.1",
60
- "@babel/plugin-syntax-typescript": "^8.0.1",
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.1",
63
- "@babel/preset-env": "^8.0.5",
63
+ "@babel/plugin-transform-runtime": "^8.1.2",
64
+ "@babel/preset-env": "^8.0.7",
64
65
  "@babel/preset-react": "^8.0.1",
65
- "@babel/preset-typescript": "^8.0.1",
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.0",
69
- "@inquirer/confirm": "^6.3.2",
70
- "@inquirer/select": "^5.2.5",
71
- "@mui/internal-babel-plugin-display-name": "2.0.1-canary.0",
72
- "@mui/internal-babel-plugin-minify-errors": "3.0.1-canary.0",
73
- "@mui/internal-babel-plugin-resolve-imports": "3.0.1-canary.1",
74
- "@napi-rs/keyring": "^2.0.0",
69
+ "@eslint/json": "^2.1.1",
70
+ "@inquirer/confirm": "^6.4.1",
71
+ "@inquirer/select": "^5.3.1",
72
+ "@mui/internal-babel-plugin-display-name": "2.0.1-canary.5",
73
+ "@mui/internal-babel-plugin-minify-errors": "3.0.1-canary.5",
74
+ "@mui/internal-babel-plugin-resolve-imports": "3.0.1-canary.6",
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.3",
81
+ "@octokit/types": "^18.0.0",
82
+ "@pnpm/config.version-policy": "^1100.2.11",
79
83
  "@pnpm/find-workspace-dir": "^1000.1.5",
80
84
  "@pnpm/parse-wanted-dependency": "^1001.0.0",
81
- "@typescript-eslint/types": "^8.70.1",
82
- "@typescript-eslint/utils": "^8.70.1",
83
- "@vitest/eslint-plugin": "^1.6.27",
85
+ "@types/babel__core": "^7.20.5",
86
+ "@types/estree": "^1.0.10",
87
+ "@types/mdast": "^4.0.4",
88
+ "@typescript-eslint/types": "^8.73.0",
89
+ "@typescript-eslint/utils": "^8.73.0",
90
+ "@vitest/eslint-plugin": "^1.6.28",
84
91
  "babel-plugin-optimize-clsx": "^2.6.2",
85
92
  "babel-plugin-react-compiler": "^1.0.0",
86
- "babel-plugin-transform-import-meta": "^3.0.0",
93
+ "babel-plugin-transform-import-meta": "^3.1.0",
87
94
  "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
88
- "babel-plugin-transform-remove-imports": "^1.8.1",
89
- "chalk": "^6.0.0",
95
+ "babel-plugin-transform-remove-imports": "^1.8.3",
96
+ "chalk": "^6.0.1",
90
97
  "clipboardy": "^5.3.2",
91
- "content-type": "^3.1.0",
98
+ "content-type": "^3.1.1",
92
99
  "env-ci": "^11.2.0",
93
- "es-toolkit": "^1.52.0",
100
+ "es-toolkit": "^1.53.2",
94
101
  "eslint-config-prettier": "^10.1.8",
95
102
  "eslint-import-resolver-typescript": "^4.4.5",
96
103
  "eslint-module-utils": "^2.14.0",
97
104
  "eslint-plugin-compat": "^7.0.2",
98
105
  "eslint-plugin-import": "^2.32.0",
99
106
  "eslint-plugin-jsx-a11y": "^6.10.2",
100
- "eslint-plugin-mdx": "^3.8.1",
107
+ "eslint-plugin-mdx": "^3.10.1",
108
+ "eslint-plugin-n": "^18.5.0",
109
+ "eslint-plugin-package-json": "^1.14.0",
101
110
  "eslint-plugin-react": "^7.37.5",
102
111
  "eslint-plugin-react-compiler": "^19.1.0-rc.2",
103
112
  "eslint-plugin-react-hooks": "^7.1.1",
104
113
  "eslint-plugin-testing-library": "^7.16.2",
105
- "execa": "^10.0.1",
114
+ "execa": "^10.2.1",
106
115
  "git-url-parse": "^16.1.0",
107
- "globals": "^17.12.0",
116
+ "globals": "^17.14.0",
108
117
  "globby": "^16.2.4",
109
- "html-validate": "^11.15.0",
110
- "minimatch": "^10.2.6",
111
- "node-html-parser": "^9.0.4",
112
- "open": "^11.0.3",
113
- "postcss-styled-syntax": "^0.7.2",
118
+ "html-validate": "^11.21.1",
119
+ "minimatch": "^11.0.9",
120
+ "node-html-parser": "^9.0.7",
121
+ "open": "^11.0.4",
122
+ "postcss-styled-syntax": "^0.7.4",
123
+ "publint": "^0.3.25",
114
124
  "regexp.escape": "^2.0.1",
115
125
  "rehype-slug": "^6.0.0",
116
126
  "rehype-stringify": "^10.0.1",
@@ -131,48 +141,50 @@
131
141
  "remark-parse": "^11.0.0",
132
142
  "remark-rehype": "^11.1.2",
133
143
  "resolve-pkg-maps": "^1.0.0",
134
- "semver": "^7.8.5",
135
- "stylelint-config-standard": "^40.0.0",
136
- "typescript-eslint": "^8.70.1",
144
+ "rolldown": "1.2.16",
145
+ "semver": "^7.8.6",
146
+ "stylelint-config-standard": "^41.1.0",
147
+ "tsdown": "0.23.4",
148
+ "typescript-eslint": "^8.73.0",
137
149
  "unified": "^11.0.5",
138
150
  "unified-lint-rule": "^3.0.1",
139
- "unist-util-visit": "^5.1.0",
151
+ "unist-util-visit": "^5.2.0",
140
152
  "yaml": "^2.9.1",
141
- "yargs": "^18.1.0"
153
+ "yargs": "^18.2.0"
142
154
  },
143
155
  "peerDependencies": {
144
156
  "@next/eslint-plugin-next": "*",
145
157
  "eslint": "^9.0.0 || ^10.0.0",
146
158
  "prettier": "^3.0.0",
159
+ "stylelint": "^18.0.0",
147
160
  "typescript": "^5.0.0 || ^6.0.0 || ^7.0.0"
148
161
  },
149
162
  "peerDependenciesMeta": {
163
+ "stylelint": {
164
+ "optional": true
165
+ },
150
166
  "typescript": {
151
167
  "optional": true
152
168
  }
153
169
  },
154
170
  "devDependencies": {
155
- "@octokit/types": "18.0.0",
156
- "@types/babel__core": "7.20.5",
157
171
  "@types/babel__preset-env": "7.10.0",
158
172
  "@types/env-ci": "3.1.4",
159
173
  "@types/eslint-plugin-jsx-a11y": "6.10.1",
160
- "@types/estree": "1.0.9",
161
174
  "@types/estree-jsx": "1.0.5",
162
- "@types/mdast": "4.0.4",
163
175
  "@types/regexp.escape": "2.0.0",
164
176
  "@types/yargs": "17.0.35",
165
- "@typescript-eslint/parser": "8.70.1",
166
- "@typescript-eslint/rule-tester": "8.70.1",
177
+ "@typescript-eslint/parser": "8.73.0",
178
+ "@typescript-eslint/rule-tester": "8.73.0",
167
179
  "@typescript/native": "npm:typescript@7.0.2",
168
- "eslint": "10.11.0",
180
+ "eslint": "10.15.0",
169
181
  "get-port": "7.2.0",
170
- "prettier": "3.9.9",
182
+ "prettier": "3.10.1",
171
183
  "remark": "15.0.1",
172
184
  "remark-mdx": "3.1.1",
173
- "serve": "14.2.6",
174
- "typescript": "npm:@typescript/typescript6@6.0.2",
175
- "typescript-eslint": "8.70.1"
185
+ "serve": "14.2.8",
186
+ "stylelint": "18.1.0",
187
+ "typescript": "npm:@typescript/typescript6@6.0.2"
176
188
  },
177
189
  "files": [
178
190
  "bin",
@@ -187,7 +199,7 @@
187
199
  "publishConfig": {
188
200
  "access": "public"
189
201
  },
190
- "gitSha": "6b201e6626d428b0f335c8eb7103c8c9b9cf8f5b",
202
+ "gitSha": "47d6cbbcf6881aaf04c4c086b8598cd72a259985",
191
203
  "scripts": {
192
204
  "build": "tsc -p tsconfig.build.json",
193
205
  "typescript": "tsc -noEmit",