@mui/internal-code-infra 0.0.4-canary.70 → 0.0.4-canary.72

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.70",
3
+ "version": "0.0.4-canary.72",
4
4
  "author": "MUI Team",
5
5
  "description": "Infra scripts and configs to be used across MUI repos.",
6
6
  "license": "MIT",
@@ -135,9 +135,9 @@
135
135
  "unist-util-visit": "^5.1.0",
136
136
  "yaml": "^2.9.0",
137
137
  "yargs": "^18.0.0",
138
- "@mui/internal-babel-plugin-resolve-imports": "2.0.7-canary.37",
139
- "@mui/internal-babel-plugin-minify-errors": "2.0.8-canary.28",
140
- "@mui/internal-babel-plugin-display-name": "1.0.4-canary.21"
138
+ "@mui/internal-babel-plugin-display-name": "1.0.4-canary.21",
139
+ "@mui/internal-babel-plugin-resolve-imports": "2.0.7-canary.38",
140
+ "@mui/internal-babel-plugin-minify-errors": "2.0.8-canary.28"
141
141
  },
142
142
  "peerDependencies": {
143
143
  "@next/eslint-plugin-next": "*",
@@ -186,7 +186,7 @@
186
186
  "publishConfig": {
187
187
  "access": "public"
188
188
  },
189
- "gitSha": "92bf20d1aa981a2b1b44d8a9773613d5a76f170c",
189
+ "gitSha": "d5f96b89b5b960ad6272652eb2734ddb305a85ae",
190
190
  "scripts": {
191
191
  "build": "tsgo -p tsconfig.build.json",
192
192
  "typescript": "tsgo -noEmit",
@@ -4,10 +4,13 @@ import { describe, expect, it } from 'vitest';
4
4
 
5
5
  import {
6
6
  crawl,
7
- type BrokenLinkIssue,
8
- type HtmlValidateIssue,
9
- type Issue,
10
- type Link,
7
+ // eslint-disable-next-line import/extensions
8
+ } from './index.mjs';
9
+ import type {
10
+ BrokenLinkIssue,
11
+ HtmlValidateIssue,
12
+ Issue,
13
+ Link,
11
14
  // eslint-disable-next-line import/extensions
12
15
  } from './index.mjs';
13
16
 
@@ -527,9 +527,10 @@ export function createCoreConfig(options = {}) {
527
527
  '@typescript-eslint/consistent-type-imports': [
528
528
  'error',
529
529
  {
530
- fixStyle: 'inline-type-imports',
530
+ fixStyle: 'separate-type-imports',
531
531
  },
532
532
  ],
533
+ 'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
533
534
  }
534
535
  : {}),
535
536
  // Prevent the use of `e` as a shorthand for `event`, `error`, etc.
@@ -1,4 +1,4 @@
1
- import { type BaseExpression, type Expression } from 'estree';
1
+ import type { BaseExpression, Expression } from 'estree';
2
2
 
3
3
  export * from 'estree';
4
4
 
@@ -13,77 +13,77 @@ declare module 'eslint-config-airbnb' {
13
13
  }
14
14
 
15
15
  declare module 'eslint-config-airbnb-base/rules/best-practices' {
16
- import { type Linter } from 'eslint';
16
+ import type { Linter } from 'eslint';
17
17
 
18
18
  declare const config: Omit<Linter.LegacyConfig, 'extends' | 'plugins'>;
19
19
  export default config;
20
20
  }
21
21
 
22
22
  declare module 'eslint-config-airbnb-base/rules/errors' {
23
- import { type Linter } from 'eslint';
23
+ import type { Linter } from 'eslint';
24
24
 
25
25
  declare const config: Omit<Linter.LegacyConfig, 'extends' | 'plugins'>;
26
26
  export default config;
27
27
  }
28
28
 
29
29
  declare module 'eslint-config-airbnb-base/rules/es6' {
30
- import { type Linter } from 'eslint';
30
+ import type { Linter } from 'eslint';
31
31
 
32
32
  declare const config: Omit<Linter.LegacyConfig, 'extends' | 'plugins'>;
33
33
  export default config;
34
34
  }
35
35
 
36
36
  declare module 'eslint-config-airbnb-base/rules/imports' {
37
- import { type Linter } from 'eslint';
37
+ import type { Linter } from 'eslint';
38
38
 
39
39
  declare const config: Omit<Linter.LegacyConfig, 'extends' | 'plugins'>;
40
40
  export default config;
41
41
  }
42
42
 
43
43
  declare module 'eslint-config-airbnb-base/rules/node' {
44
- import { type Linter } from 'eslint';
44
+ import type { Linter } from 'eslint';
45
45
 
46
46
  declare const config: Omit<Linter.LegacyConfig, 'extends' | 'plugins'>;
47
47
  export default config;
48
48
  }
49
49
 
50
50
  declare module 'eslint-config-airbnb-base/rules/strict' {
51
- import { type Linter } from 'eslint';
51
+ import type { Linter } from 'eslint';
52
52
 
53
53
  declare const config: Omit<Linter.LegacyConfig, 'extends' | 'plugins'>;
54
54
  export default config;
55
55
  }
56
56
 
57
57
  declare module 'eslint-config-airbnb-base/rules/style' {
58
- import { type Linter } from 'eslint';
58
+ import type { Linter } from 'eslint';
59
59
 
60
60
  declare const config: Omit<Linter.LegacyConfig, 'extends' | 'plugins'>;
61
61
  export default config;
62
62
  }
63
63
 
64
64
  declare module 'eslint-config-airbnb-base/rules/variables' {
65
- import { type Linter } from 'eslint';
65
+ import type { Linter } from 'eslint';
66
66
 
67
67
  declare const config: Omit<Linter.LegacyConfig, 'extends' | 'plugins'>;
68
68
  export default config;
69
69
  }
70
70
 
71
71
  declare module 'eslint-config-airbnb/rules/react' {
72
- import { type Linter } from 'eslint';
72
+ import type { Linter } from 'eslint';
73
73
 
74
74
  declare const config: Omit<Linter.LegacyConfig, 'extends' | 'plugins'>;
75
75
  export default config;
76
76
  }
77
77
 
78
78
  declare module 'eslint-config-airbnb/rules/react-a11y' {
79
- import { type Linter } from 'eslint';
79
+ import type { Linter } from 'eslint';
80
80
 
81
81
  declare const config: Omit<Linter.LegacyConfig, 'extends' | 'plugins'>;
82
82
  export default config;
83
83
  }
84
84
 
85
85
  declare module '@next/eslint-plugin-next' {
86
- import { type Linter } from 'eslint';
86
+ import type { Linter } from 'eslint';
87
87
 
88
88
  interface NextEslintPluginConfig extends Linter.LegacyConfig {
89
89
  flatConfig: {
@@ -78,18 +78,33 @@ import { parseDocument, isMap } from 'yaml';
78
78
  export async function getWorkspacePackages(options = {}) {
79
79
  const { sinceRef = null, publicOnly = false, nonPublishedOnly = false, filter = [] } = options;
80
80
 
81
- // Build command with conditional filter
82
- const filterArg = sinceRef ? ['--filter', `...[${sinceRef}]`] : [];
83
- if (filter.length > 0) {
84
- filter.forEach((f) => {
85
- filterArg.push('--filter', f);
86
- });
81
+ /**
82
+ * Run `pnpm ls` with the given --filter args and return the parsed list.
83
+ * @param {string[]} filterArg
84
+ * @returns {Promise<PnpmListResultItem[]>}
85
+ */
86
+ const listPackages = async (filterArg) => {
87
+ const result = await $({ cwd: options.cwd })`pnpm ls -r --json --depth -1 ${filterArg}`;
88
+ return JSON.parse(result.stdout);
89
+ };
90
+
91
+ // pnpm ORs --filter args, so intersect "matches filter" with "changed since ref"
92
+ // in JS. The `[ref]` selector (no `...`) excludes dependents of changed packages.
93
+ const patternFilterArg = filter.flatMap((f) => ['--filter', f]);
94
+ const [candidatePackages, changedPackages] = await Promise.all([
95
+ listPackages(patternFilterArg),
96
+ // null when no sinceRef (skip the constraint); [] when nothing changed.
97
+ sinceRef ? listPackages(['--filter', `[${sinceRef}]`]) : Promise.resolve(null),
98
+ ]);
99
+ let packageData = candidatePackages;
100
+ if (changedPackages) {
101
+ // sinceRef given but nothing changed → no packages, regardless of filter.
102
+ if (changedPackages.length === 0) {
103
+ return [];
104
+ }
105
+ const changedPaths = new Set(changedPackages.map((pkg) => pkg.path));
106
+ packageData = packageData.filter((pkg) => changedPaths.has(pkg.path));
87
107
  }
88
- const result = options.cwd
89
- ? await $({ cwd: options.cwd })`pnpm ls -r --json --depth -1 ${filterArg}`
90
- : await $`pnpm ls -r --json --depth -1 ${filterArg}`;
91
- /** @type {PnpmListResultItem[]} */
92
- const packageData = JSON.parse(result.stdout);
93
108
 
94
109
  // Filter packages based on options
95
110
  const filteredPackages = packageData.flatMap((pkg) => {