init project
Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled

This commit is contained in:
how2ice
2025-12-12 14:26:25 +09:00
commit 005cf56baf
43188 changed files with 1079531 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
# @mui/envinfo
Prints information about the current environment relevant to MUI packages to the console.
Please use this package if you report [issues to MUI](https://github.com/mui/material-ui/issues).
## Usage
```bash
$ npx @mui/envinfo
System:
OS: Linux 5.4 Ubuntu 20.04.1 LTS (Focal Fossa)
Binaries:
Node: 12.20.0 - ~/.nvm/versions/node/v12.20.0/bin/node
Yarn: 1.22.4 - /usr/bin/yarn
npm: 6.14.8 - ~/.nvm/versions/node/v12.20.0/bin/npm
Browsers:
Chrome: 87.0.4280.66
Firefox: 83.0
npmPackages:
@emotion/react: ^11.0.0 => 11.1.1
@emotion/styled: ^11.0.0 => 11.0.0
@mui/codemod: 5.0.0-alpha.17
@mui/material: 5.0.0-alpha.18
@mui/docs: 5.0.0-alpha.1
@mui/envinfo: 2.0.0
@mui/icons-material: 5.0.0-alpha.15
@mui/lab: 5.0.0-alpha.18
@mui/styled-engine: 5.0.0-alpha.18
@mui/styled-engine-sc: 5.0.0-alpha.18
@mui/styles: 5.0.0-alpha.18
@mui/system: 5.0.0-alpha.18
@mui/types: 5.1.0
@mui/base: 5.0.0-alpha.18
@mui/utils: 5.0.0-alpha.18
@types/react: ^17.0.0 => 17.0.0
react: ^16.14.0 => 16.14.0
react-dom: ^16.14.0 => 16.14.0
styled-components: 5.2.1
typescript: ^4.0.2 => 4.0.5
```

View File

@@ -0,0 +1,32 @@
{
"name": "@mui/envinfo",
"version": "2.0.44",
"author": "MUI Team",
"description": "Logs info about the environment relevant to @mui/*.",
"bin": "./envinfo.js",
"repository": {
"type": "git",
"url": "git+https://github.com/mui/material-ui.git",
"directory": "packages/mui-envinfo"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/mui/material-ui/issues"
},
"homepage": "https://github.com/mui/material-ui/tree/HEAD/packages/mui-envinfo",
"files": [],
"scripts": {
"build": "code-infra build --bundle cjs --buildTypes false --skipBabelRuntimeCheck"
},
"dependencies": {
"envinfo": "^7.21.0"
},
"devDependencies": {
"@types/chai": "^5.2.3",
"chai": "^6.0.1"
},
"publishConfig": {
"access": "public",
"directory": "build"
}
}

View File

@@ -0,0 +1,40 @@
#!/usr/bin/env node
const envinfo = require('envinfo');
const json = process.argv.includes('--json');
envinfo
.run(
{
npmPackages: `{${[
'@mui/*',
'@toolpad/*',
'@pigment-css/*',
'@base-ui-components/*',
// Peer dependencies
'react',
'react-dom',
// optional peer deps
'@emotion/react',
'@emotion/styled',
'styled-components',
'@types/react',
// auxiliary libraries
'typescript',
].join(',')}}`,
Binaries: ['Node', 'npm', 'pnpm'],
System: ['OS'],
Browsers: ['Chrome', 'Firefox', 'Safari', 'Edge'],
},
{
// `markdown: true` uses level 2 headings. It doesn't necessarily fit our issue template
json,
duplicates: true,
// include transitive dependencies and important packages that are transitive dependencies (for example `jsdom` is usually a transitive dependency inside jest)
fullTree: true,
showNotFound: true,
},
)
.then((output) => {
// eslint-disable-next-line no-console
console.log(output);
});

View File

@@ -0,0 +1,44 @@
import { isJsdom } from '@mui/internal-test-utils/env';
const { execFileSync } = require('child_process');
const path = require('path');
const { expect } = require('chai');
describe('@mui/envinfo', () => {
const packagePath = __dirname;
const testProjectPath = path.resolve(path.dirname(packagePath), 'test');
function execEnvinfo(args) {
const envinfoPath = path.resolve(packagePath, 'envinfo.js');
return execFileSync('node', [envinfoPath, ...args], {
encoding: 'utf8',
stdio: 'pipe',
cwd: testProjectPath,
});
}
it.skipIf(!isJsdom())('includes info about the environment relevant to MUI', function test() {
const envinfoJSON = execEnvinfo(['--json']);
const envinfo = JSON.parse(envinfoJSON);
// chai doesn't have expect.any(String) like jest so we have to use what's available
// We basically want to test like https://github.com/eps1lon/testing-library-envinfo/blob/2543092f4e4af02d79e306ec6546a9c12b258675/index.test.js#L20-L68
// The specific versions change over time so we can't use snapshots.
expect(envinfo).to.have.nested.property('Binaries.Node');
expect(envinfo).to.have.nested.property('Binaries.pnpm');
expect(envinfo).to.have.nested.property('Binaries.npm');
// CI doesn't install all the covered browsers. Simply asserting that it does print browsers.
expect(envinfo).to.have.nested.property('Browsers');
// Non-exhaustive list of `@mui/*` packages
expect(envinfo).to.have.nested.property('npmPackages.@mui/material');
expect(envinfo).to.have.nested.property('npmPackages.@mui/joy');
expect(envinfo).to.have.nested.property('npmPackages.@mui/base');
// Other libraries
expect(envinfo).to.have.nested.property('npmPackages.react');
expect(envinfo).to.have.nested.property('npmPackages.react-dom');
expect(envinfo).to.have.nested.property('npmPackages.@types/react');
expect(envinfo).to.have.nested.property('npmPackages.@emotion/react');
expect(envinfo).to.have.nested.property('npmPackages.@emotion/styled');
});
});

View File

@@ -0,0 +1,16 @@
{
"name": "envinfo-test-project",
"private": true,
"dependencies": {
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@mui/base": "5.0.0-beta.30",
"@mui/joy": "5.0.0-beta.22",
"@mui/material": "5.15.4",
"react": "^19.2.1",
"react-dom": "^19.2.1"
},
"devDependencies": {
"@types/react": "^19.2.7"
}
}

View File

@@ -0,0 +1,4 @@
// eslint-disable-next-line import/no-relative-packages
import sharedConfig from '../../vitest.shared.mts';
export default sharedConfig(import.meta.url, { jsdom: true });