@mui/internal-code-infra 0.1.1-canary.0 → 0.1.1-canary.2

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.1.1-canary.0",
3
+ "version": "0.1.1-canary.2",
4
4
  "author": "MUI Team",
5
5
  "description": "Infra scripts and configs to be used across MUI repos.",
6
6
  "license": "MIT",
@@ -58,6 +58,7 @@
58
58
  "@babel/core": "^8.0.5",
59
59
  "@babel/plugin-syntax-jsx": "^8.0.1",
60
60
  "@babel/plugin-syntax-typescript": "^8.0.1",
61
+ "@babel/plugin-transform-react-pure-annotations": "^8.0.1",
61
62
  "@babel/plugin-transform-runtime": "^8.0.1",
62
63
  "@babel/preset-env": "^8.0.5",
63
64
  "@babel/preset-react": "^8.0.1",
@@ -186,7 +187,7 @@
186
187
  "publishConfig": {
187
188
  "access": "public"
188
189
  },
189
- "gitSha": "764e3b3cfc14293e74e93f3413609025f502bab9",
190
+ "gitSha": "342a1159c5c25a48c8ed853893146aa8701574a6",
190
191
  "scripts": {
191
192
  "build": "tsc -p tsconfig.build.json",
192
193
  "typescript": "tsc -noEmit",
@@ -1,3 +1,4 @@
1
+ import pluginReactPureAnnotations from '@babel/plugin-transform-react-pure-annotations';
1
2
  import pluginTransformRuntime from '@babel/plugin-transform-runtime';
2
3
  import presetEnv from '@babel/preset-env';
3
4
  import presetReact from '@babel/preset-react';
@@ -10,6 +11,9 @@ import pluginTransformImportMeta from 'babel-plugin-transform-import-meta';
10
11
  import pluginRemovePropTypes from 'babel-plugin-transform-react-remove-prop-types';
11
12
  import pluginTransformInlineEnvVars from './babelPluginInlineEnvironmentVariables.mjs';
12
13
 
14
+ // Plain TypeScript, ie. files that can't contain JSX.
15
+ const TS_WITHOUT_JSX = /\.[cm]?ts$/;
16
+
13
17
  /**
14
18
  * @typedef {'annotation' | 'syntax' | 'infer' | 'all'} ReactCompilationMode
15
19
  */
@@ -154,9 +158,16 @@ export function getBaseConfig({
154
158
  {
155
159
  // Babel 8 keeps the JSX parser on for every file the React preset touches, which
156
160
  // misparses generic arrows like `<T = unknown>(x) => x` in plain `.ts` files.
157
- exclude: /\.[cm]?ts$/,
161
+ exclude: TS_WITHOUT_JSX,
158
162
  presets: [[presetReact, { runtime: 'automatic' }]],
159
163
  },
164
+ {
165
+ // The React preset is off for those files, so re-add the one part of it they still
166
+ // need: `/*#__PURE__*/` on `React.createContext()` and friends, without which
167
+ // bundlers keep every unused context.
168
+ include: TS_WITHOUT_JSX,
169
+ plugins: [pluginReactPureAnnotations],
170
+ },
160
171
  ],
161
172
  };
162
173
  }
@@ -30,7 +30,13 @@ import { getCurrentGitSha, getRepositoryInfo, remoteGitTagExists } from '../util
30
30
  const isCI = envCI().isCi;
31
31
 
32
32
  function getOctokit() {
33
- return new Octokit({ authStrategy: isCI ? createActionAuth : persistentAuthStrategy });
33
+ const octokit = new Octokit({
34
+ authStrategy: isCI ? createActionAuth : persistentAuthStrategy,
35
+ });
36
+ octokit.hook.before('request', (requestOptions) => {
37
+ requestOptions.headers['x-github-api-version'] = '2026-03-10';
38
+ });
39
+ return octokit;
34
40
  }
35
41
 
36
42
  /**