@mui/internal-code-infra 0.0.4-canary.60 → 0.0.4-canary.62

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/internal-code-infra",
3
- "version": "0.0.4-canary.60",
3
+ "version": "0.0.4-canary.62",
4
4
  "author": "MUI Team",
5
5
  "description": "Infra scripts and configs to be used across MUI repos.",
6
6
  "license": "MIT",
@@ -139,9 +139,9 @@
139
139
  "unified-lint-rule": "^3.0.1",
140
140
  "unist-util-visit": "^5.1.0",
141
141
  "yargs": "^18.0.0",
142
- "@mui/internal-babel-plugin-display-name": "1.0.4-canary.20",
143
142
  "@mui/internal-babel-plugin-resolve-imports": "2.0.7-canary.36",
144
- "@mui/internal-babel-plugin-minify-errors": "2.0.8-canary.27"
143
+ "@mui/internal-babel-plugin-minify-errors": "2.0.8-canary.27",
144
+ "@mui/internal-babel-plugin-display-name": "1.0.4-canary.20"
145
145
  },
146
146
  "peerDependencies": {
147
147
  "@next/eslint-plugin-next": "*",
@@ -191,7 +191,7 @@
191
191
  "publishConfig": {
192
192
  "access": "public"
193
193
  },
194
- "gitSha": "2cf5fd6323dcc09a25dd287dca00cb5edb5bdd14",
194
+ "gitSha": "ca1c0b42f26266f8a75b7075025a98a6ceb091c7",
195
195
  "scripts": {
196
196
  "build": "tsgo -p tsconfig.build.json",
197
197
  "typescript": "tsgo -noEmit",
@@ -141,6 +141,14 @@ export function createBaseConfig({
141
141
  'no-unassigned-vars': 'off',
142
142
  },
143
143
  },
144
+ // @TODO: Remove this once @typescript-eslint/no-shadow supports wrapped functions
145
+ // See https://github.com/eslint/eslint/pull/20982 (once merged also needs port to `typescript-eslint`)
146
+ {
147
+ name: 'Disabled tseslint-plugins',
148
+ rules: {
149
+ '@typescript-eslint/no-shadow': 'off',
150
+ },
151
+ },
144
152
  ]),
145
153
  },
146
154
  {
@@ -1281,4 +1281,77 @@ describe('createPackageImports', () => {
1281
1281
  },
1282
1282
  });
1283
1283
  });
1284
+
1285
+ it('passes a conditions object of bare specifiers through unchanged, preserving condition order', async () => {
1286
+ const cwd = await makeTempDir();
1287
+
1288
+ const imports = await createPackageImports(
1289
+ {
1290
+ '#mui/TransitionGroupContext': {
1291
+ node: 'react-transition-group/cjs/TransitionGroupContext.js',
1292
+ browser: 'react-transition-group/esm/TransitionGroupContext.js',
1293
+ default: 'react-transition-group/esm/TransitionGroupContext.js',
1294
+ },
1295
+ },
1296
+ {
1297
+ bundles: [
1298
+ { type: 'esm', dir: '.' },
1299
+ { type: 'cjs', dir: '.' },
1300
+ ],
1301
+ cwd,
1302
+ isFlat: true,
1303
+ packageType: 'module',
1304
+ },
1305
+ );
1306
+
1307
+ expect(imports).toEqual({
1308
+ '#mui/TransitionGroupContext': {
1309
+ node: 'react-transition-group/cjs/TransitionGroupContext.js',
1310
+ browser: 'react-transition-group/esm/TransitionGroupContext.js',
1311
+ default: 'react-transition-group/esm/TransitionGroupContext.js',
1312
+ },
1313
+ });
1314
+ expect(
1315
+ Object.keys(
1316
+ /** @type {Record<string, unknown>} */ (imports?.['#mui/TransitionGroupContext']),
1317
+ ),
1318
+ ).toEqual(['node', 'browser', 'default']);
1319
+ });
1320
+
1321
+ it('passes a nested import/require/default object of bare specifiers through unchanged', async () => {
1322
+ const cwd = await makeTempDir();
1323
+
1324
+ const imports = await createPackageImports(
1325
+ {
1326
+ '#mui/TransitionGroupContext': {
1327
+ node: 'react-transition-group/cjs/TransitionGroupContext.js',
1328
+ default: {
1329
+ import: 'react-transition-group/esm/TransitionGroupContext.js',
1330
+ require: 'react-transition-group/cjs/TransitionGroupContext.js',
1331
+ default: 'react-transition-group/esm/TransitionGroupContext.js',
1332
+ },
1333
+ },
1334
+ },
1335
+ {
1336
+ bundles: [
1337
+ { type: 'esm', dir: '.' },
1338
+ { type: 'cjs', dir: '.' },
1339
+ ],
1340
+ cwd,
1341
+ isFlat: true,
1342
+ packageType: 'module',
1343
+ },
1344
+ );
1345
+
1346
+ expect(imports).toEqual({
1347
+ '#mui/TransitionGroupContext': {
1348
+ node: 'react-transition-group/cjs/TransitionGroupContext.js',
1349
+ default: {
1350
+ import: 'react-transition-group/esm/TransitionGroupContext.js',
1351
+ require: 'react-transition-group/cjs/TransitionGroupContext.js',
1352
+ default: 'react-transition-group/esm/TransitionGroupContext.js',
1353
+ },
1354
+ },
1355
+ });
1356
+ });
1284
1357
  });