@mui/internal-code-infra 0.0.4-canary.10 → 0.0.4-canary.100

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 (145) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +21 -7
  3. package/build/babel-config.d.mts +5 -1
  4. package/build/brokenLinksChecker/crawlWorker.d.mts +1 -0
  5. package/build/brokenLinksChecker/index.d.mts +192 -2
  6. package/build/changelog/fetchChangelogs.d.mts +3 -0
  7. package/build/changelog/types.d.ts +3 -1
  8. package/build/cli/cmdArgosPush.d.mts +8 -2
  9. package/build/cli/cmdBuild.d.mts +48 -2
  10. package/build/cli/cmdCopyFiles.d.mts +14 -2
  11. package/build/cli/cmdExtractErrorCodes.d.mts +2 -2
  12. package/build/cli/cmdGenerateChangelog.d.mts +17 -2
  13. package/build/cli/cmdGithubAuth.d.mts +2 -2
  14. package/build/cli/cmdListWorkspaces.d.mts +14 -2
  15. package/build/cli/cmdNetlifyIgnore.d.mts +12 -2
  16. package/build/cli/cmdPublish.d.mts +23 -4
  17. package/build/cli/cmdPublishCanary.d.mts +20 -2
  18. package/build/cli/cmdPublishNewPackage.d.mts +10 -2
  19. package/build/cli/cmdRenameScope.d.mts +18 -0
  20. package/build/cli/cmdSetVersionOverrides.d.mts +5 -2
  21. package/build/cli/cmdVale.d.mts +46 -0
  22. package/build/cli/cmdValidateBuiltTypes.d.mts +2 -2
  23. package/build/eslint/baseConfig.d.mts +3 -1
  24. package/build/eslint/mui/rules/disallow-react-api-in-server-components.d.mts +2 -2
  25. package/build/eslint/mui/rules/docgen-ignore-before-comment.d.mts +2 -2
  26. package/build/eslint/mui/rules/no-floating-cleanup.d.mts +5 -0
  27. package/build/eslint/mui/rules/no-guarded-throw.d.mts +31 -0
  28. package/build/eslint/mui/rules/no-presentation-role.d.mts +5 -0
  29. package/build/eslint/mui/rules/no-restricted-resolved-imports.d.mts +8 -2
  30. package/build/eslint/mui/rules/nodeEnvUtils.d.mts +18 -0
  31. package/build/remark/config.d.mts +43 -0
  32. package/build/remark/createLintTester.d.mts +10 -0
  33. package/build/remark/firstBlockHeading.d.mts +4 -0
  34. package/build/remark/gitDiff.d.mts +2 -0
  35. package/build/remark/noSpaceInLinks.d.mts +2 -0
  36. package/build/remark/straightQuotes.d.mts +2 -0
  37. package/build/remark/tableAlignment.d.mts +2 -0
  38. package/build/remark/terminalLanguage.d.mts +2 -0
  39. package/build/utils/babel.d.mts +7 -1
  40. package/build/utils/build.d.mts +59 -37
  41. package/build/utils/extractErrorCodes.d.mts +9 -0
  42. package/build/utils/git.d.mts +16 -0
  43. package/build/utils/github.d.mts +13 -1
  44. package/build/utils/pnpm.d.mts +176 -17
  45. package/build/utils/testUtils.d.mts +28 -0
  46. package/build/utils/typescript.d.mts +6 -16
  47. package/package.json +77 -53
  48. package/src/babel-config.mjs +3 -1
  49. package/src/brokenLinksChecker/crawlWorker.mjs +240 -0
  50. package/src/brokenLinksChecker/index.mjs +263 -188
  51. package/src/changelog/fetchChangelogs.mjs +8 -2
  52. package/src/changelog/renderChangelog.mjs +1 -1
  53. package/src/changelog/types.ts +3 -1
  54. package/src/cli/cmdBuild.mjs +51 -85
  55. package/src/cli/cmdListWorkspaces.mjs +7 -1
  56. package/src/cli/cmdNetlifyIgnore.mjs +30 -5
  57. package/src/cli/cmdPublish.mjs +79 -37
  58. package/src/cli/cmdPublishCanary.mjs +96 -24
  59. package/src/cli/cmdPublishNewPackage.mjs +31 -8
  60. package/src/cli/cmdRenameScope.mjs +76 -0
  61. package/src/cli/cmdSetVersionOverrides.mjs +8 -9
  62. package/src/cli/cmdVale.mjs +513 -0
  63. package/src/cli/index.mjs +4 -0
  64. package/src/cli/packageJson.d.ts +2 -3
  65. package/src/eslint/baseConfig.mjs +51 -19
  66. package/src/eslint/docsConfig.mjs +2 -1
  67. package/src/eslint/mui/config.mjs +24 -4
  68. package/src/eslint/mui/index.mjs +6 -0
  69. package/src/eslint/mui/rules/no-floating-cleanup.mjs +187 -0
  70. package/src/eslint/mui/rules/no-guarded-throw.mjs +115 -0
  71. package/src/eslint/mui/rules/no-presentation-role.mjs +60 -0
  72. package/src/eslint/mui/rules/nodeEnvUtils.mjs +52 -0
  73. package/src/eslint/mui/rules/require-dev-wrapper.mjs +25 -40
  74. package/src/estree-typescript.d.ts +1 -1
  75. package/src/remark/config.mjs +157 -0
  76. package/src/remark/createLintTester.mjs +19 -0
  77. package/src/remark/firstBlockHeading.mjs +87 -0
  78. package/src/remark/gitDiff.mjs +43 -0
  79. package/src/remark/noSpaceInLinks.mjs +42 -0
  80. package/src/remark/straightQuotes.mjs +31 -0
  81. package/src/remark/tableAlignment.mjs +23 -0
  82. package/src/remark/terminalLanguage.mjs +19 -0
  83. package/src/stylelint/index.mjs +2 -2
  84. package/src/untyped-plugins.d.ts +14 -14
  85. package/src/utils/build.mjs +604 -270
  86. package/src/utils/git.mjs +27 -7
  87. package/src/utils/pnpm.mjs +444 -53
  88. package/src/utils/testUtils.mjs +53 -0
  89. package/src/utils/typescript.mjs +23 -42
  90. package/vale/.vale.ini +1 -0
  91. package/vale/styles/MUI/CorrectReferenceAllCases.yml +42 -0
  92. package/vale/styles/MUI/CorrectRererenceCased.yml +14 -0
  93. package/vale/styles/MUI/GoogleLatin.yml +11 -0
  94. package/vale/styles/MUI/MuiBrandName.yml +22 -0
  95. package/vale/styles/MUI/NoBritish.yml +112 -0
  96. package/vale/styles/MUI/NoCompanyName.yml +17 -0
  97. package/build/markdownlint/duplicate-h1.d.mts +0 -56
  98. package/build/markdownlint/git-diff.d.mts +0 -11
  99. package/build/markdownlint/index.d.mts +0 -52
  100. package/build/markdownlint/straight-quotes.d.mts +0 -11
  101. package/build/markdownlint/table-alignment.d.mts +0 -11
  102. package/build/markdownlint/terminal-language.d.mts +0 -11
  103. package/src/brokenLinksChecker/__fixtures__/static-site/broken-links.html +0 -20
  104. package/src/brokenLinksChecker/__fixtures__/static-site/broken-targets.html +0 -22
  105. package/src/brokenLinksChecker/__fixtures__/static-site/example.md +0 -20
  106. package/src/brokenLinksChecker/__fixtures__/static-site/external-links.html +0 -21
  107. package/src/brokenLinksChecker/__fixtures__/static-site/ignored-page.html +0 -17
  108. package/src/brokenLinksChecker/__fixtures__/static-site/index.html +0 -28
  109. package/src/brokenLinksChecker/__fixtures__/static-site/known-targets.json +0 -5
  110. package/src/brokenLinksChecker/__fixtures__/static-site/nested/page.html +0 -21
  111. package/src/brokenLinksChecker/__fixtures__/static-site/orphaned-page.html +0 -20
  112. package/src/brokenLinksChecker/__fixtures__/static-site/page-with-api-links.html +0 -20
  113. package/src/brokenLinksChecker/__fixtures__/static-site/page-with-custom-targets.html +0 -24
  114. package/src/brokenLinksChecker/__fixtures__/static-site/page-with-ignored-content.html +0 -28
  115. package/src/brokenLinksChecker/__fixtures__/static-site/page-with-known-target-links.html +0 -19
  116. package/src/brokenLinksChecker/__fixtures__/static-site/unclosed-tags.html +0 -1
  117. package/src/brokenLinksChecker/__fixtures__/static-site/valid.html +0 -20
  118. package/src/brokenLinksChecker/__fixtures__/static-site/with-anchors.html +0 -31
  119. package/src/brokenLinksChecker/index.test.ts +0 -261
  120. package/src/changelog/categorizeCommits.test.ts +0 -319
  121. package/src/changelog/filterCommits.test.ts +0 -363
  122. package/src/changelog/parseCommitLabels.test.ts +0 -509
  123. package/src/changelog/renderChangelog.test.ts +0 -378
  124. package/src/changelog/sortSections.test.ts +0 -199
  125. package/src/eslint/mui/rules/add-undef-to-optional.test.mjs +0 -361
  126. package/src/eslint/mui/rules/consistent-production-guard.test.mjs +0 -162
  127. package/src/eslint/mui/rules/disallow-active-elements-as-key-event-target.test.mjs +0 -66
  128. package/src/eslint/mui/rules/disallow-react-api-in-server-components.test.mjs +0 -305
  129. package/src/eslint/mui/rules/docgen-ignore-before-comment.test.mjs +0 -52
  130. package/src/eslint/mui/rules/flatten-parentheses.test.mjs +0 -245
  131. package/src/eslint/mui/rules/mui-name-matches-component-name.test.mjs +0 -247
  132. package/src/eslint/mui/rules/no-empty-box.test.mjs +0 -40
  133. package/src/eslint/mui/rules/no-styled-box.test.mjs +0 -73
  134. package/src/eslint/mui/rules/require-dev-wrapper.test.mjs +0 -265
  135. package/src/eslint/mui/rules/rules-of-use-theme-variants.test.mjs +0 -149
  136. package/src/eslint/mui/rules/straight-quotes.test.mjs +0 -67
  137. package/src/markdownlint/duplicate-h1.mjs +0 -69
  138. package/src/markdownlint/git-diff.mjs +0 -31
  139. package/src/markdownlint/index.mjs +0 -62
  140. package/src/markdownlint/straight-quotes.mjs +0 -26
  141. package/src/markdownlint/table-alignment.mjs +0 -42
  142. package/src/markdownlint/terminal-language.mjs +0 -19
  143. package/src/utils/build.test.mjs +0 -705
  144. package/src/utils/template.test.mjs +0 -133
  145. package/src/utils/typescript.test.mjs +0 -380
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  export type Args = {
3
+ /**
4
+ * - Package version specifiers in format 'package@version'
5
+ */
3
6
  pkg?: string[];
4
7
  };
5
- declare const _default: import("yargs").CommandModule<{}, Args>;
6
- export default /** @type {import('yargs').CommandModule<{}, Args>} */ _default;
8
+ declare const _default: import('yargs').CommandModule<{}, Args>;
9
+ export default _default;
@@ -0,0 +1,46 @@
1
+ export type ValeOS = 'Linux' | 'macOS' | 'Windows';
2
+ export type ValeArch = '64-bit' | 'arm64';
3
+ /**
4
+ * Extracts the replacement text from a vale alert.
5
+ * Returns null if no replacement can be determined.
6
+ * @param {{ Action: { Name: string; Params: string[] | null }; Message: string }} alert
7
+ * @returns {string | null}
8
+ */
9
+ export declare function getReplacementText(alert: {
10
+ Action: {
11
+ Name: string;
12
+ Params: string[] | null;
13
+ };
14
+ Message: string;
15
+ }): string | null;
16
+ /**
17
+ * Applies auto-fixes from vale alerts to the source files.
18
+ * Processes alerts in reverse order within each line to preserve column positions.
19
+ * @param {Record<string, Array<{ Action: { Name: string; Params: string[] | null }; Span: [number, number]; Check: string; Message: string; Severity: string; Match: string; Line: number }>>} results
20
+ * @param {'all' | 'error'} fixLevel
21
+ * @returns {Promise<{ fixed: number; skipped: number }>}
22
+ */
23
+ export declare function applyFixes(results: Record<string, Array<{
24
+ Action: {
25
+ Name: string;
26
+ Params: string[] | null;
27
+ };
28
+ Span: [number, number];
29
+ Check: string;
30
+ Message: string;
31
+ Severity: string;
32
+ Match: string;
33
+ Line: number;
34
+ }>>, fixLevel: 'all' | 'error'): Promise<{
35
+ fixed: number;
36
+ skipped: number;
37
+ }>;
38
+ export type Args = {
39
+ 'vale-version': string;
40
+ 'auto-fix': 'all' | 'error' | undefined;
41
+ };
42
+ /**
43
+ * @typedef {{ 'vale-version': string; 'auto-fix': 'all' | 'error' | undefined; }} Args
44
+ */
45
+ declare const _default: import('yargs').CommandModule<{}, Args>;
46
+ export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("yargs").CommandModule<{}, {}>;
2
- export default /** @type {import('yargs').CommandModule<{}, {}>} */ _default;
1
+ declare const _default: import('yargs').CommandModule<{}, {}>;
2
+ export default _default;
@@ -4,11 +4,13 @@
4
4
  * @param {boolean} [params.consistentTypeImports] - Whether to enforce consistent type imports.
5
5
  * @param {boolean} [params.materialUi] - Whether to enable Material UI specific rules (mui/material-ui-*).
6
6
  * @param {string} [params.baseDirectory] - The base directory for the configuration.
7
+ * @param {boolean} [params.markdown] - @deprecated Markdown/MDX linting is enabled by default; this option no longer needs to be passed. To skip markdown linting, use eslint ignore patterns for the relevant files.
7
8
  * @returns {import('eslint').Linter.Config[]}
8
9
  */
9
- export declare function createBaseConfig({ enableReactCompiler, consistentTypeImports, materialUi, baseDirectory }?: {
10
+ export declare function createBaseConfig({ enableReactCompiler, consistentTypeImports, materialUi, markdown, baseDirectory, }?: {
10
11
  enableReactCompiler?: boolean;
11
12
  consistentTypeImports?: boolean;
12
13
  materialUi?: boolean;
13
14
  baseDirectory?: string;
15
+ markdown?: boolean;
14
16
  }): import('eslint').Linter.Config[];
@@ -1,2 +1,2 @@
1
- declare const _default: import("eslint").Rule.RuleModule;
2
- export default /** @type {import('eslint').Rule.RuleModule} */ _default;
1
+ declare const _default: import('eslint').Rule.RuleModule;
2
+ export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("eslint").Rule.RuleModule;
2
- export default /** @type {import('eslint').Rule.RuleModule} */ _default;
1
+ declare const _default: import('eslint').Rule.RuleModule;
2
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { ESLintUtils } from '@typescript-eslint/utils';
2
+ declare const _default: ESLintUtils.RuleModule<"floatingCleanup", [], unknown, ESLintUtils.RuleListener> & {
3
+ name: string;
4
+ };
5
+ export default _default;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * ESLint rule that disallows throw statements guarded by process.env.NODE_ENV checks.
3
+ *
4
+ * NODE_ENV guards cause throw statements to only execute in certain environments,
5
+ * leading to inconsistent control flow between development and production. Whether
6
+ * the guard excludes production (tree-shaking the throw away) or targets production
7
+ * specifically, the result is environment-dependent behavior that should be avoided.
8
+ *
9
+ * The rule stops at function boundaries, so throws inside functions defined within
10
+ * a NODE_ENV guard are not flagged, as the function may be called from other contexts.
11
+ *
12
+ * @example
13
+ * // Invalid - throw only in development, removed in production
14
+ * if (process.env.NODE_ENV !== 'production') {
15
+ * throw new Error('Missing required prop');
16
+ * }
17
+ *
18
+ * @example
19
+ * // Invalid - throw only in production
20
+ * if (process.env.NODE_ENV === 'production') {
21
+ * throw new Error('Production-only error');
22
+ * }
23
+ *
24
+ * @example
25
+ * // Valid - unconditional throw
26
+ * throw new Error('Something went wrong');
27
+ *
28
+ * @type {import('eslint').Rule.RuleModule}
29
+ */
30
+ declare const rule: import('eslint').Rule.RuleModule;
31
+ export default rule;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @type {import('eslint').Rule.RuleModule}
3
+ */
4
+ declare const rule: import('eslint').Rule.RuleModule;
5
+ export default rule;
@@ -1,5 +1,11 @@
1
1
  export type PatternConfig = {
2
+ /**
3
+ * - The pattern to match against resolved imports
4
+ */
2
5
  pattern: string;
6
+ /**
7
+ * - Custom message to show when the pattern matches
8
+ */
3
9
  message?: string;
4
10
  };
5
11
  /**
@@ -11,5 +17,5 @@ export type PatternConfig = {
11
17
  * Creates an ESLint rule that restricts imports based on their resolved paths.
12
18
  * Works with both ESM (import) and CommonJS (require) imports.
13
19
  */
14
- declare const _default: import("eslint").Rule.RuleModule;
15
- export default /** @type {import('eslint').Rule.RuleModule} */ _default;
20
+ declare const _default: import('eslint').Rule.RuleModule;
21
+ export default _default;
@@ -21,3 +21,21 @@ export declare function isLiteralEq(node: import('estree').Node, value: string):
21
21
  * @returns {boolean}
22
22
  */
23
23
  export declare function isLiteralNeq(node: import('estree').Node, value: string): boolean;
24
+ /**
25
+ * Checks if a BinaryExpression compares process.env.NODE_ENV with === or !==
26
+ * @param {import('estree').Node} node
27
+ * @returns {boolean}
28
+ */
29
+ export declare function isNodeEnvBinaryComparison(node: import('estree').Node): boolean;
30
+ /**
31
+ * Walks up the parent chain and checks if the node is inside an IfStatement
32
+ * whose test is a NODE_ENV binary comparison.
33
+ * If a callback is provided, it is called with the IfStatement and the direct
34
+ * child that leads to the node. The function returns true only when the callback
35
+ * returns true. Without a callback the function returns true when the node is
36
+ * inside any branch (consequent or alternate) of such an IfStatement.
37
+ * @param {import('eslint').Rule.Node} node
38
+ * @param {(ifStatement: import('estree').IfStatement & import('eslint').Rule.NodeParentExtension, child: import('eslint').Rule.Node) => boolean} [callback]
39
+ * @returns {boolean}
40
+ */
41
+ export declare function isInsideNodeEnvCheck(node: import('eslint').Rule.Node, callback?: (ifStatement: import('estree').IfStatement & import('eslint').Rule.NodeParentExtension, child: import('eslint').Rule.Node) => boolean): boolean;
@@ -0,0 +1,43 @@
1
+ import remarkGfm from 'remark-gfm';
2
+ import remarkLint from 'remark-lint';
3
+ /**
4
+ * Returns a remark preset wiring the MUI-authored remark-lint plugins together
5
+ * with a curated set of community plugins. Drop this into `.remarkrc.mjs`:
6
+ *
7
+ * ```js
8
+ * import { createRemarkConfig } from '@mui/internal-code-infra/remark';
9
+ * export default createRemarkConfig();
10
+ * ```
11
+ *
12
+ * Pass `overrides` to scope rule changes to a glob. Each entry's `rules` map
13
+ * is keyed by the rule name (the key used in `RULES`); `false` disables the
14
+ * rule for matching files, a settings tuple replaces its severity/options:
15
+ *
16
+ * ```js
17
+ * createRemarkConfig({
18
+ * overrides: [
19
+ * { files: 'docs/special/**', rules: { 'mui-no-space-in-links': false } },
20
+ * { files: '**\/CHANGELOG.md', rules: { 'heading-style': ['warn', 'atx'] } },
21
+ * ],
22
+ * });
23
+ * ```
24
+ *
25
+ * @param {Object} [options]
26
+ * @param {Array<{ files: string | string[], rules: Record<string, false | unknown[]> }>} [options.overrides]
27
+ */
28
+ export declare function createRemarkConfig({ overrides }?: {
29
+ overrides?: Array<{
30
+ files: string | string[];
31
+ rules: Record<string, false | unknown[]>;
32
+ }>;
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
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @param {unknown} plugin
3
+ * @param {unknown} [options]
4
+ * @returns {(input: string) => Array<{ reason: string, line: number, column: number }>}
5
+ */
6
+ export declare function createLintTester(plugin: unknown, options?: unknown): (input: string) => Array<{
7
+ reason: string;
8
+ line: number;
9
+ column: number;
10
+ }>;
@@ -0,0 +1,4 @@
1
+ declare const remarkLintMuiFirstBlockHeading: import("unified-lint-rule").Plugin<import("mdast").Root, {
2
+ frontMatterTitle?: RegExp | false;
3
+ } | undefined>;
4
+ export default remarkLintMuiFirstBlockHeading;
@@ -0,0 +1,2 @@
1
+ declare const remarkLintMuiGitDiff: import("unified-lint-rule").Plugin<import("mdast").Root, unknown>;
2
+ export default remarkLintMuiGitDiff;
@@ -0,0 +1,2 @@
1
+ declare const remarkLintMuiNoSpaceInLinks: import("unified-lint-rule").Plugin<import("mdast").Root, unknown>;
2
+ export default remarkLintMuiNoSpaceInLinks;
@@ -0,0 +1,2 @@
1
+ declare const remarkLintMuiStraightQuotes: import("unified-lint-rule").Plugin<import("mdast").Root, unknown>;
2
+ export default remarkLintMuiStraightQuotes;
@@ -0,0 +1,2 @@
1
+ declare const remarkLintMuiTableAlignment: import("unified-lint-rule").Plugin<import("mdast").Root, unknown>;
2
+ export default remarkLintMuiTableAlignment;
@@ -0,0 +1,2 @@
1
+ declare const remarkLintMuiTerminalLanguage: import("unified-lint-rule").Plugin<import("mdast").Root, unknown>;
2
+ export default remarkLintMuiTerminalLanguage;
@@ -15,7 +15,13 @@ export declare function cjsCopy({ from, to }: {
15
15
  to: string;
16
16
  }): Promise<void>;
17
17
  export type ErrorCodeMetadata = {
18
+ /**
19
+ * - The path where the error code file should be written.
20
+ */
18
21
  outputPath: string;
22
+ /**
23
+ * - The runtime module to replace the errors with.
24
+ */
19
25
  runtimeModule?: string;
20
26
  };
21
27
  /**
@@ -41,7 +47,7 @@ export type ErrorCodeMetadata = {
41
47
  * @param {string} options.babelRuntimeVersion - The version of @babel/runtime to use.
42
48
  * @returns {Promise<void>}
43
49
  */
44
- export declare function build({ cwd, sourceDir, outDir, babelRuntimeVersion, hasLargeFiles, bundle, pkgVersion, outExtension, optimizeClsx, removePropTypes, verbose, ignores, reactCompiler }: {
50
+ export declare function build({ cwd, sourceDir, outDir, babelRuntimeVersion, hasLargeFiles, bundle, pkgVersion, outExtension, optimizeClsx, removePropTypes, verbose, ignores, reactCompiler, }: {
45
51
  verbose?: boolean;
46
52
  optimizeClsx?: boolean;
47
53
  removePropTypes?: boolean;
@@ -1,62 +1,85 @@
1
1
  export type BundleType = 'esm' | 'cjs';
2
- /**
3
- * @typedef {'esm' | 'cjs'} BundleType
4
- */
2
+ export type BundleMeta = {
3
+ type: BundleType;
4
+ dir: string;
5
+ /**
6
+ * - The package.json condition this bundle maps to.
7
+ */
8
+ condition: 'import' | 'require';
9
+ outExtension: string;
10
+ typeOutExtension: string;
11
+ };
12
+ export declare const BASE_IGNORES: string[];
5
13
  /**
6
14
  * @param {BundleType} bundle
7
15
  * @param {Object} [options]
8
16
  * @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
17
  * @param {'module' | 'commonjs'} [options.packageType='commonjs'] - The package.json type field.
11
18
  * @returns {string}
12
19
  */
13
20
  export declare function getOutExtension(bundle: BundleType, options?: {
14
21
  isType?: boolean;
15
- isFlat?: boolean;
16
22
  packageType?: 'module' | 'commonjs';
17
23
  }): string;
18
24
  /**
19
- * @param {Object} param0
20
- * @param {import('../cli/packageJson').PackageJson['exports']} param0.exports
21
- * @param {{type: BundleType; dir: string}[]} param0.bundles
22
- * @param {string} param0.outputDir
23
- * @param {string} param0.cwd
24
- * @param {boolean} [param0.addTypes]
25
- * @param {boolean} [param0.isFlat]
26
- * @param {'module' | 'commonjs'} [param0.packageType]
25
+ * @param {import('../cli/packageJson').PackageJson['exports']} packageExports
26
+ * @param {Object} options
27
+ * @param {BundleType[]} options.bundles
28
+ * @param {string} options.outputDir
29
+ * @param {string} options.cwd
30
+ * @param {boolean} [options.addTypes]
31
+ * @param {boolean} [options.expand] - Whether to enumerate glob patterns into concrete entries.
32
+ * @param {'module' | 'commonjs'} [options.packageType]
27
33
  */
28
- export declare function createPackageExports({ exports: packageExports, bundles, outputDir, cwd, addTypes, isFlat, packageType }: {
29
- exports: import('../cli/packageJson').PackageJson['exports'];
30
- bundles: {
31
- type: BundleType;
32
- dir: string;
33
- }[];
34
+ export declare function createPackageExports(packageExports: import('../cli/packageJson').PackageJson['exports'], { bundles, outputDir, cwd, addTypes, expand, packageType }: {
35
+ bundles: BundleType[];
34
36
  outputDir: string;
35
37
  cwd: string;
36
38
  addTypes?: boolean;
37
- isFlat?: boolean;
39
+ expand?: boolean;
38
40
  packageType?: 'module' | 'commonjs';
39
41
  }): Promise<{
40
- main?: string | undefined;
41
- types?: string | undefined;
42
- exports: import("../cli/packageJson").PackageJson.ExportConditions;
42
+ main?: string;
43
+ types?: string;
44
+ exports: import('../cli/packageJson').PackageJson.ExportConditions;
43
45
  }>;
44
46
  /**
45
- * @param {Object} param0
46
- * @param {import('../cli/packageJson').PackageJson['bin']} param0.bin
47
- * @param {{type: BundleType; dir: string}[]} param0.bundles
48
- * @param {string} param0.cwd
49
- * @param {boolean} [param0.isFlat]
50
- * @param {'module' | 'commonjs'} [param0.packageType]
47
+ * Generates the package.json `imports` field for the built package, rewriting
48
+ * internal subpath imports (keys starting with `#`) that point at source files
49
+ * into their built equivalents with `import`/`require`/`types` conditions.
50
+ *
51
+ * Mirrors {@link createPackageExports} but without the `.` / `package.json` /
52
+ * `main` / `types` index handling that only applies to public exports. Entries
53
+ * that resolve to bare specifiers (e.g. an external package) are passed through
54
+ * unchanged, since the `imports` field commonly aliases dependencies.
55
+ * @param {import('../cli/packageJson').PackageJson['imports']} packageImports
56
+ * @param {Object} options
57
+ * @param {BundleType[]} options.bundles
58
+ * @param {string} options.cwd
59
+ * @param {string} [options.outputDir] - Used to verify non-source passthrough paths exist in the build output.
60
+ * @param {boolean} [options.addTypes]
61
+ * @param {boolean} [options.expand] - Whether to enumerate glob patterns into concrete entries.
62
+ * @param {'module' | 'commonjs'} [options.packageType]
63
+ * @returns {Promise<import('../cli/packageJson').PackageJson.Imports | undefined>}
64
+ */
65
+ export declare function createPackageImports(packageImports: import('../cli/packageJson').PackageJson['imports'], { bundles, cwd, outputDir, addTypes, expand, packageType }: {
66
+ bundles: BundleType[];
67
+ cwd: string;
68
+ outputDir?: string;
69
+ addTypes?: boolean;
70
+ expand?: boolean;
71
+ packageType?: 'module' | 'commonjs';
72
+ }): Promise<import('../cli/packageJson').PackageJson.Imports | undefined>;
73
+ /**
74
+ * @param {import('../cli/packageJson').PackageJson['bin']} bin
75
+ * @param {Object} options
76
+ * @param {BundleType[]} options.bundles
77
+ * @param {string} options.cwd
78
+ * @param {'module' | 'commonjs'} [options.packageType]
51
79
  */
52
- export declare function createPackageBin({ bin, bundles, cwd, isFlat, packageType }: {
53
- bin: import('../cli/packageJson').PackageJson['bin'];
54
- bundles: {
55
- type: BundleType;
56
- dir: string;
57
- }[];
80
+ export declare function createPackageBin(bin: import('../cli/packageJson').PackageJson['bin'], { bundles, cwd, packageType }: {
81
+ bundles: BundleType[];
58
82
  cwd: string;
59
- isFlat?: boolean;
60
83
  packageType?: 'module' | 'commonjs';
61
84
  }): Promise<string | Record<string, string> | undefined>;
62
85
  /**
@@ -84,7 +107,6 @@ export declare function markFn<F extends () => Promise<any>>(label: string, fn:
84
107
  * @param {string} label
85
108
  */
86
109
  export declare function measureFn(label: string): PerformanceMeasure;
87
- export declare const BASE_IGNORES: string[];
88
110
  /**
89
111
  * A utility to map a function over an array of items in a worker pool.
90
112
  *
@@ -1,6 +1,15 @@
1
1
  export type Args = {
2
+ /**
3
+ * - The output path to write the extracted error codes.
4
+ */
2
5
  errorCodesPath: string;
6
+ /**
7
+ * - List of package names to skip. By default, all workspace packages are considered.
8
+ */
3
9
  skip?: string[];
10
+ /**
11
+ * - The detection strategy to use when extracting error codes.
12
+ */
4
13
  detection?: import('@mui/internal-babel-plugin-minify-errors').Options['detection'];
5
14
  };
6
15
  /**
@@ -1,6 +1,15 @@
1
1
  export type RepoInfo = {
2
+ /**
3
+ * - Repository owner
4
+ */
2
5
  owner: string;
6
+ /**
7
+ * - Repository name
8
+ */
3
9
  repo: string;
10
+ /**
11
+ * - Remote name
12
+ */
4
13
  remoteName: string;
5
14
  };
6
15
  /**
@@ -20,3 +29,10 @@ export declare function getRepositoryInfo(cwd?: string): Promise<RepoInfo>;
20
29
  * @returns {Promise<string>} Current git commit SHA
21
30
  */
22
31
  export declare function getCurrentGitSha(): Promise<string>;
32
+ /**
33
+ * Check whether a tag already exists on the origin remote
34
+ * @param {string} tagName - Tag name to check (e.g. `v1.2.3`)
35
+ * @param {string} [cwd=process.cwd()]
36
+ * @returns {Promise<boolean>} True if the tag exists on origin
37
+ */
38
+ export declare function remoteGitTagExists(tagName: string, cwd?: string): Promise<boolean>;
@@ -7,9 +7,21 @@
7
7
  *
8
8
  */
9
9
  export type GitHubAppAuthenticationWithRefreshToken = {
10
+ /**
11
+ * - The access token
12
+ */
10
13
  token: string;
14
+ /**
15
+ * - ISO string when the access token expires
16
+ */
11
17
  expiresAt?: string;
18
+ /**
19
+ * - The refresh token
20
+ */
12
21
  refreshToken?: string;
22
+ /**
23
+ * - ISO string when the refresh token expires
24
+ */
13
25
  refreshTokenExpiresAt?: string;
14
26
  };
15
27
  /**
@@ -20,7 +32,7 @@ export type GitHubAppAuthenticationWithRefreshToken = {
20
32
  * @property {string} [refreshTokenExpiresAt] - ISO string when the refresh token expires
21
33
  */
22
34
  export declare function persistentAuthStrategy(): {
23
- hook: (request: import("@octokit/types").RequestInterface<object>, route: string, parameters: import("@octokit/types").RequestParameters) => Promise<import("@octokit/types").OctokitResponse<any, number>>;
35
+ hook: (request: import('@octokit/types').RequestInterface, route: import('@octokit/types').Route, parameters: import('@octokit/types').RequestParameters) => Promise<import("@octokit/types").OctokitResponse<any, number>>;
24
36
  };
25
37
  /**
26
38
  * @param {Object} [options]