@mui/internal-code-infra 0.0.4-canary.1 → 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.
- package/LICENSE +1 -1
- package/README.md +22 -8
- package/build/babel-config.d.mts +11 -3
- package/build/brokenLinksChecker/crawlWorker.d.mts +1 -0
- package/build/brokenLinksChecker/index.d.mts +192 -2
- package/build/changelog/fetchChangelogs.d.mts +3 -0
- package/build/changelog/types.d.ts +3 -1
- package/build/cli/cmdArgosPush.d.mts +8 -2
- package/build/cli/cmdBuild.d.mts +48 -2
- package/build/cli/cmdCopyFiles.d.mts +14 -2
- package/build/cli/cmdExtractErrorCodes.d.mts +2 -2
- package/build/cli/cmdGenerateChangelog.d.mts +17 -2
- package/build/cli/cmdGithubAuth.d.mts +2 -2
- package/build/cli/cmdListWorkspaces.d.mts +16 -2
- package/build/cli/cmdNetlifyIgnore.d.mts +12 -2
- package/build/cli/cmdPublish.d.mts +24 -4
- package/build/cli/cmdPublishCanary.d.mts +21 -2
- package/build/cli/cmdPublishNewPackage.d.mts +10 -2
- package/build/cli/cmdRenameScope.d.mts +18 -0
- package/build/cli/cmdSetVersionOverrides.d.mts +5 -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 +8 -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 +7 -1
- package/build/utils/build.d.mts +59 -37
- package/build/utils/extractErrorCodes.d.mts +9 -0
- package/build/utils/git.d.mts +16 -0
- package/build/utils/github.d.mts +13 -1
- package/build/utils/pnpm.d.mts +200 -7
- package/build/utils/testUtils.d.mts +28 -0
- package/build/utils/typescript.d.mts +6 -16
- package/package.json +83 -56
- package/src/babel-config.mjs +9 -3
- package/src/brokenLinksChecker/crawlWorker.mjs +240 -0
- package/src/brokenLinksChecker/index.mjs +263 -188
- package/src/build-env.d.ts +13 -0
- 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 +16 -3
- package/src/cli/cmdNetlifyIgnore.mjs +34 -93
- package/src/cli/cmdPublish.mjs +105 -36
- package/src/cli/cmdPublishCanary.mjs +145 -109
- package/src/cli/cmdPublishNewPackage.mjs +31 -8
- package/src/cli/cmdRenameScope.mjs +76 -0
- package/src/cli/cmdSetVersionOverrides.mjs +8 -9
- package/src/cli/cmdVale.mjs +513 -0
- package/src/cli/index.mjs +4 -0
- package/src/cli/packageJson.d.ts +2 -3
- 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/stylelint/index.mjs +2 -2
- package/src/untyped-plugins.d.ts +14 -14
- package/src/utils/build.mjs +604 -270
- package/src/utils/git.mjs +27 -7
- package/src/utils/pnpm.mjs +549 -26
- package/src/utils/testUtils.mjs +53 -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
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export type Args = {
|
|
3
|
+
/**
|
|
4
|
+
* Source and target scope
|
|
5
|
+
*/
|
|
6
|
+
alias: [string, string];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {Object} Args
|
|
10
|
+
* @property {[string, string]} alias Source and target scope
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @param {string} alias
|
|
14
|
+
* @returns {[string, string]}
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseAlias(alias: string): [string, string];
|
|
17
|
+
declare const _default: import('yargs').CommandModule<{}, Args>;
|
|
18
|
+
export default _default;
|
|
@@ -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(
|
|
6
|
-
export 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(
|
|
2
|
-
export 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(
|
|
2
|
-
export default
|
|
1
|
+
declare const _default: import('eslint').Rule.RuleModule;
|
|
2
|
+
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import(
|
|
2
|
-
export default
|
|
1
|
+
declare const _default: import('eslint').Rule.RuleModule;
|
|
2
|
+
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;
|
|
@@ -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(
|
|
15
|
-
export 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
|
+
}>;
|
package/build/utils/babel.d.mts
CHANGED
|
@@ -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;
|
package/build/utils/build.d.mts
CHANGED
|
@@ -1,62 +1,85 @@
|
|
|
1
1
|
export type BundleType = 'esm' | 'cjs';
|
|
2
|
-
|
|
3
|
-
|
|
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 {
|
|
20
|
-
* @param {
|
|
21
|
-
* @param {
|
|
22
|
-
* @param {string}
|
|
23
|
-
* @param {string}
|
|
24
|
-
* @param {boolean} [
|
|
25
|
-
* @param {boolean} [
|
|
26
|
-
* @param {'module' | 'commonjs'} [
|
|
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(
|
|
29
|
-
|
|
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
|
-
|
|
39
|
+
expand?: boolean;
|
|
38
40
|
packageType?: 'module' | 'commonjs';
|
|
39
41
|
}): Promise<{
|
|
40
|
-
main?: string
|
|
41
|
-
types?: string
|
|
42
|
-
exports: import(
|
|
42
|
+
main?: string;
|
|
43
|
+
types?: string;
|
|
44
|
+
exports: import('../cli/packageJson').PackageJson.ExportConditions;
|
|
43
45
|
}>;
|
|
44
46
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* @
|
|
50
|
-
*
|
|
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(
|
|
53
|
-
|
|
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
|
/**
|
package/build/utils/git.d.mts
CHANGED
|
@@ -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>;
|
package/build/utils/github.d.mts
CHANGED
|
@@ -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(
|
|
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]
|