@mui/internal-code-infra 0.0.3-canary.6 → 0.0.3-canary.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/build/babel-config.d.mts +40 -0
- package/build/brokenLinksChecker/index.d.mts +138 -0
- package/build/cli/cmdArgosPush.d.mts +13 -0
- package/build/cli/cmdBuild.d.mts +56 -0
- package/build/cli/cmdCopyFiles.d.mts +20 -0
- package/build/cli/cmdExtractErrorCodes.d.mts +3 -0
- package/build/cli/cmdGithubAuth.d.mts +6 -0
- package/build/cli/cmdListWorkspaces.d.mts +18 -0
- package/build/cli/cmdPublish.d.mts +27 -0
- package/build/cli/cmdPublishCanary.d.mts +30 -0
- package/build/cli/cmdPublishNewPackage.d.mts +8 -0
- package/build/cli/cmdSetVersionOverrides.d.mts +9 -0
- package/build/cli/cmdValidateBuiltTypes.d.mts +2 -0
- package/build/cli/index.d.mts +1 -0
- package/build/eslint/baseConfig.d.mts +10 -0
- package/build/eslint/docsConfig.d.mts +4 -0
- package/build/eslint/extensions.d.mts +8 -0
- package/build/eslint/index.d.mts +4 -0
- package/build/eslint/jsonConfig.d.mts +4 -0
- package/build/eslint/material-ui/config.d.mts +8 -0
- package/build/eslint/material-ui/index.d.mts +2 -0
- package/build/eslint/material-ui/rules/disallow-active-element-as-key-event-target.d.mts +5 -0
- package/build/eslint/material-ui/rules/disallow-react-api-in-server-components.d.mts +2 -0
- package/build/eslint/material-ui/rules/docgen-ignore-before-comment.d.mts +2 -0
- package/build/eslint/material-ui/rules/mui-name-matches-component-name.d.mts +5 -0
- package/build/eslint/material-ui/rules/no-empty-box.d.mts +5 -0
- package/build/eslint/material-ui/rules/no-restricted-resolved-imports.d.mts +12 -0
- package/build/eslint/material-ui/rules/no-styled-box.d.mts +5 -0
- package/build/eslint/material-ui/rules/rules-of-use-theme-variants.d.mts +9 -0
- package/build/eslint/material-ui/rules/straight-quotes.d.mts +5 -0
- package/build/eslint/testConfig.d.mts +14 -0
- package/build/markdownlint/duplicate-h1.d.mts +27 -0
- package/build/markdownlint/git-diff.d.mts +8 -0
- package/build/markdownlint/index.d.mts +56 -0
- package/build/markdownlint/straight-quotes.d.mts +8 -0
- package/build/markdownlint/table-alignment.d.mts +8 -0
- package/build/markdownlint/terminal-language.d.mts +8 -0
- package/build/prettier.d.mts +20 -0
- package/build/stylelint/index.d.mts +32 -0
- package/build/utils/babel.d.mts +71 -0
- package/build/utils/build.d.mts +50 -0
- package/build/utils/changelog.d.mts +64 -0
- package/build/utils/credentials.d.mts +17 -0
- package/build/utils/extractErrorCodes.d.mts +19 -0
- package/build/utils/git.d.mts +26 -0
- package/build/utils/github.d.mts +41 -0
- package/build/utils/pnpm.d.mts +238 -0
- package/build/utils/typescript.d.mts +35 -0
- package/package.json +92 -42
- package/src/babel-config.mjs +52 -8
- package/src/brokenLinksChecker/__fixtures__/static-site/broken-links.html +20 -0
- package/src/brokenLinksChecker/__fixtures__/static-site/broken-targets.html +22 -0
- package/src/brokenLinksChecker/__fixtures__/static-site/example.md +9 -0
- package/src/brokenLinksChecker/__fixtures__/static-site/external-links.html +21 -0
- package/src/brokenLinksChecker/__fixtures__/static-site/ignored-page.html +17 -0
- package/src/brokenLinksChecker/__fixtures__/static-site/index.html +26 -0
- package/src/brokenLinksChecker/__fixtures__/static-site/known-targets.json +5 -0
- package/src/brokenLinksChecker/__fixtures__/static-site/nested/page.html +19 -0
- package/src/brokenLinksChecker/__fixtures__/static-site/orphaned-page.html +20 -0
- package/src/brokenLinksChecker/__fixtures__/static-site/page-with-api-links.html +20 -0
- package/src/brokenLinksChecker/__fixtures__/static-site/page-with-custom-targets.html +24 -0
- package/src/brokenLinksChecker/__fixtures__/static-site/page-with-ignored-content.html +28 -0
- package/src/brokenLinksChecker/__fixtures__/static-site/page-with-known-target-links.html +19 -0
- package/src/brokenLinksChecker/__fixtures__/static-site/valid.html +20 -0
- package/src/brokenLinksChecker/__fixtures__/static-site/with-anchors.html +31 -0
- package/src/brokenLinksChecker/index.mjs +641 -0
- package/src/brokenLinksChecker/index.test.ts +178 -0
- package/src/cli/cmdArgosPush.mjs +13 -2
- package/src/cli/cmdBuild.mjs +228 -31
- package/src/cli/cmdGithubAuth.mjs +36 -0
- package/src/cli/cmdListWorkspaces.mjs +2 -2
- package/src/cli/cmdPublish.mjs +203 -49
- package/src/cli/cmdPublishCanary.mjs +404 -46
- package/src/cli/cmdPublishNewPackage.mjs +86 -0
- package/src/cli/cmdSetVersionOverrides.mjs +17 -1
- package/src/cli/cmdValidateBuiltTypes.mjs +49 -0
- package/src/cli/index.mjs +6 -2
- package/src/cli/packageJson.d.ts +729 -0
- package/src/eslint/baseConfig.mjs +96 -78
- package/src/eslint/docsConfig.mjs +26 -13
- package/src/eslint/extensions.mjs +8 -8
- package/src/eslint/jsonConfig.mjs +40 -0
- package/src/eslint/material-ui/config.mjs +8 -9
- package/src/eslint/material-ui/rules/mui-name-matches-component-name.mjs +4 -2
- package/src/eslint/material-ui/rules/rules-of-use-theme-variants.mjs +2 -1
- package/src/eslint/testConfig.mjs +72 -66
- package/src/stylelint/index.mjs +46 -0
- package/src/untyped-plugins.d.ts +13 -0
- package/src/{cli → utils}/babel.mjs +10 -3
- package/src/utils/build.mjs +27 -1
- package/src/utils/changelog.mjs +157 -0
- package/src/utils/credentials.mjs +71 -0
- package/src/utils/extractErrorCodes.mjs +2 -2
- package/src/utils/git.mjs +67 -0
- package/src/utils/github.mjs +263 -0
- package/src/{cli → utils}/pnpm.mjs +23 -13
- package/src/{cli → utils}/typescript.mjs +13 -7
- package/src/cli/cmdJsonLint.mjs +0 -69
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { globby } from 'globby';
|
|
3
|
+
import * as fs from 'node:fs/promises';
|
|
4
|
+
import { findWorkspaceDir } from '@pnpm/find-workspace-dir';
|
|
5
|
+
|
|
6
|
+
import { mapConcurrently } from '../utils/build.mjs';
|
|
7
|
+
|
|
8
|
+
const DYNAMIC_PACKAGES_IMPORT_REGEX = /import\((['"])packages\//gm;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Validates if there are no missing exports from TS files that would
|
|
12
|
+
* result in an import from a local file.
|
|
13
|
+
*/
|
|
14
|
+
async function validateFiles() {
|
|
15
|
+
const cwd = process.cwd();
|
|
16
|
+
const workspaceRoot = await findWorkspaceDir(cwd);
|
|
17
|
+
const declarationFiles = await globby(['**/build/**/*.d.{ts,cts,mts}'], {
|
|
18
|
+
absolute: true,
|
|
19
|
+
ignore: ['node_modules'],
|
|
20
|
+
followSymbolicLinks: false,
|
|
21
|
+
cwd: workspaceRoot,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const invalidFiles = (
|
|
25
|
+
await mapConcurrently(
|
|
26
|
+
declarationFiles,
|
|
27
|
+
async (declarationFile) => {
|
|
28
|
+
const content = await fs.readFile(declarationFile, 'utf-8');
|
|
29
|
+
const matches = Array.from(content.matchAll(DYNAMIC_PACKAGES_IMPORT_REGEX));
|
|
30
|
+
return matches.length > 0 ? declarationFile : undefined;
|
|
31
|
+
},
|
|
32
|
+
20,
|
|
33
|
+
)
|
|
34
|
+
).filter((file) => typeof file === 'string');
|
|
35
|
+
|
|
36
|
+
if (invalidFiles.length > 0) {
|
|
37
|
+
console.error('❌ Found invalid imports in the following files:');
|
|
38
|
+
console.log(invalidFiles.join('\n'));
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
console.log('✅ Found no invalid import statements in built declaration files.');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default /** @type {import('yargs').CommandModule<{}, {}>} */ ({
|
|
46
|
+
command: 'validate-built-types',
|
|
47
|
+
describe: 'Validate built TypeScript declaration files for invalid imports from local files.',
|
|
48
|
+
handler: validateFiles,
|
|
49
|
+
});
|
package/src/cli/index.mjs
CHANGED
|
@@ -6,11 +6,13 @@ import cmdArgosPush from './cmdArgosPush.mjs';
|
|
|
6
6
|
import cmdBuild from './cmdBuild.mjs';
|
|
7
7
|
import cmdCopyFiles from './cmdCopyFiles.mjs';
|
|
8
8
|
import cmdExtractErrorCodes from './cmdExtractErrorCodes.mjs';
|
|
9
|
-
import
|
|
9
|
+
import cmdGithubAuth from './cmdGithubAuth.mjs';
|
|
10
10
|
import cmdListWorkspaces from './cmdListWorkspaces.mjs';
|
|
11
11
|
import cmdPublish from './cmdPublish.mjs';
|
|
12
12
|
import cmdPublishCanary from './cmdPublishCanary.mjs';
|
|
13
|
+
import cmdPublishNewPackage from './cmdPublishNewPackage.mjs';
|
|
13
14
|
import cmdSetVersionOverrides from './cmdSetVersionOverrides.mjs';
|
|
15
|
+
import cmdValidateBuiltTypes from './cmdValidateBuiltTypes.mjs';
|
|
14
16
|
|
|
15
17
|
const pkgJson = createRequire(import.meta.url)('../../package.json');
|
|
16
18
|
|
|
@@ -21,11 +23,13 @@ yargs()
|
|
|
21
23
|
.command(cmdBuild)
|
|
22
24
|
.command(cmdCopyFiles)
|
|
23
25
|
.command(cmdExtractErrorCodes)
|
|
24
|
-
.command(
|
|
26
|
+
.command(cmdGithubAuth)
|
|
25
27
|
.command(cmdListWorkspaces)
|
|
26
28
|
.command(cmdPublish)
|
|
27
29
|
.command(cmdPublishCanary)
|
|
30
|
+
.command(cmdPublishNewPackage)
|
|
28
31
|
.command(cmdSetVersionOverrides)
|
|
32
|
+
.command(cmdValidateBuiltTypes)
|
|
29
33
|
.demandCommand(1, 'You need at least one command before moving on')
|
|
30
34
|
.strict()
|
|
31
35
|
.help()
|