@mui/internal-code-infra 0.1.1-canary.16 → 0.1.1-canary.17

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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  export type Args = {
3
3
  /**
4
- * - List of workspace names to process
4
+ * - Workspace names or root-relative paths to process
5
5
  */
6
6
  workspaces: string[];
7
7
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/internal-code-infra",
3
- "version": "0.1.1-canary.16",
3
+ "version": "0.1.1-canary.17",
4
4
  "author": "MUI Team",
5
5
  "description": "Infra scripts and configs to be used across MUI repos.",
6
6
  "license": "MIT",
@@ -190,7 +190,7 @@
190
190
  "publishConfig": {
191
191
  "access": "public"
192
192
  },
193
- "gitSha": "7909a2801b6402fec32dead2c01dad6d16dcf20d",
193
+ "gitSha": "afa705d3e675d687aaa77f6a3448cd87ea6f5711",
194
194
  "scripts": {
195
195
  "build": "tsc -p tsconfig.build.json",
196
196
  "typescript": "tsc -noEmit",
@@ -4,7 +4,7 @@
4
4
 
5
5
  /**
6
6
  * @typedef {Object} Args
7
- * @property {string[]} workspaces - List of workspace names to process
7
+ * @property {string[]} workspaces - Workspace names or root-relative paths to process
8
8
  * @property {boolean} [check] - Check mode - error if the generated content differs from current
9
9
  * @property {string} [baseBranch] - Branch to compare PRs against (default: master)
10
10
  */
@@ -100,7 +100,7 @@ export default /** @type {import('yargs').CommandModule<{}, Args>} */ ({
100
100
  .positional('workspaces', {
101
101
  type: 'string',
102
102
  array: true,
103
- describe: 'List of workspace names to process',
103
+ describe: 'Workspace names or root-relative paths to process',
104
104
  demandOption: true,
105
105
  })
106
106
  .option('check', {
@@ -115,6 +115,7 @@ export default /** @type {import('yargs').CommandModule<{}, Args>} */ ({
115
115
  "Branch to compare PRs against (the site's production branch on Netlify). Production and branch deploys always rebuild regardless of this value.",
116
116
  })
117
117
  .example('$0 netlify-ignore @mui/internal-docs-infra', 'Update netlify.toml for a workspace')
118
+ .example('$0 netlify-ignore ./apps/dashboard', 'Update an unnamed workspace by path')
118
119
  .example(
119
120
  '$0 netlify-ignore @mui/internal-docs-infra @mui/internal-code-infra',
120
121
  'Update netlify.toml for multiple workspaces',
@@ -135,11 +136,17 @@ export default /** @type {import('yargs').CommandModule<{}, Args>} */ ({
135
136
 
136
137
  // Get all workspace packages and create workspace map
137
138
  const allWorkspaces = await getWorkspacePackages({ cwd: workspaceRoot });
138
- const workspaceMap = new Map(
139
- allWorkspaces.flatMap((workspace) =>
140
- workspace.name ? [[workspace.name, workspace.path]] : [],
141
- ),
142
- );
139
+ /** @type {Map<string, string>} */
140
+ const workspaceMap = new Map();
141
+ for (const workspace of allWorkspaces) {
142
+ if (workspace.name) {
143
+ workspaceMap.set(workspace.name, workspace.path);
144
+ }
145
+
146
+ // Paths also identify private workspaces that have no package name.
147
+ const relativePath = toPosixPath(path.relative(workspaceRoot, workspace.path));
148
+ workspaceMap.set(`./${relativePath}`, workspace.path);
149
+ }
143
150
 
144
151
  // Process each workspace concurrently
145
152
  await Promise.all(
@@ -99,9 +99,7 @@ export default async function extractErrorCodes(args) {
99
99
  const packages = basePackages.filter(
100
100
  (pkg) =>
101
101
  // Ignore obvious packages that do not have user-facing errors
102
- !pkg.name.startsWith('@mui/internal-') &&
103
- !pkg.name.startsWith('@mui-internal/') &&
104
- !skipPackages.includes(pkg.name),
102
+ !pkg.name.startsWith('@mui/internal-') && !skipPackages.includes(pkg.name),
105
103
  );
106
104
  const files = await Promise.all(packages.map((pkg) => getFilesForPackage(pkg)));
107
105
  packages.forEach((pkg, index) => {