Skip to content

Commit b7c7ef6

Browse files
[autofix.ci] apply automated fixes
1 parent 270fdca commit b7c7ef6

File tree

10 files changed

+38
-48
lines changed

10 files changed

+38
-48
lines changed

packages/mpack/src/metro/enhancedResolver.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ export function createResolver(rootPath: string, options?: CreateResolverOptions
4646
mainFields: context.mainFields,
4747
conditionNames: options?.conditionNames ?? [...RESOLVER_EXPORTS_MAP_CONDITIONS, 'require', 'node', 'default'],
4848
mainFiles: ['index'],
49-
modules: [
50-
'node_modules',
51-
path.join(rootPath, 'node_modules'),
52-
path.join(rootPath, 'src'),
53-
],
49+
modules: ['node_modules', path.join(rootPath, 'node_modules'), path.join(rootPath, 'src')],
5450
alias: options?.extraNodeModules ?? {},
5551
});
5652

packages/mpack/src/metro/getMetroConfig.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ export async function getMetroConfig({ rootPath }: GetMetroConfig, additionalCon
6060
},
6161
}),
6262
babelTransformerPath:
63-
additionalConfig?.transformer?.babelTransformerPath ||
64-
require.resolve('metro-react-native-babel-transformer'),
63+
additionalConfig?.transformer?.babelTransformerPath || require.resolve('metro-react-native-babel-transformer'),
6564
asyncRequireModulePath: require.resolve('metro-runtime/src/modules/asyncRequire'),
6665
unstable_collectDependenciesPath: resolveVendors('metro/src/ModuleGraph/worker/collectDependencies'),
6766
unstable_allowRequireContext: true,

packages/mpack/src/operations/serve.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export async function runServer({
7373
const { middlewares = [], inspectorProxy, ...additionalMetroConfig } = resolvedConfig?.metro ?? {};
7474
const baseConfig = await getMetroConfig({ rootPath: config.cwd }, additionalMetroConfig);
7575

76-
7776
const metroConfig = mergeConfig(baseConfig, {
7877
server: { port },
7978
reporter,

packages/plugin-radon/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ export { radon } from './radonPlugin';
22

33
export { radonCorePlugin } from './radonCorePlugin';
44

5-
export { radonGraniteRouter } from './radonGraniteRouterPlugin';
5+
export { radonGraniteRouter } from './radonGraniteRouterPlugin';

packages/plugin-radon/src/radonCorePlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { loadRadonMetroConfig } from './utils/loadRadonMetroConfig';
77
function ensureRadonIdeEnv() {
88
const appRoot = getPackageRoot();
99
const radonIdePath = detectRadonIdeExtensionPath();
10-
10+
1111
if (!radonIdePath) {
1212
console.warn('[Radon] Extension not found, Radon IDE features will not be available');
1313
return;

packages/plugin-radon/src/radonGraniteRouterPlugin.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const DEFAULT_OPTIONS: Required<RadonGraniteRouterPluginOptions> = {
1010
export const radonGraniteRouter = (options: RadonGraniteRouterPluginOptions = DEFAULT_OPTIONS): GranitePluginCore => {
1111
const mergedOptions = { ...DEFAULT_OPTIONS, ...options };
1212

13-
1413
return {
1514
name: 'radon-metro-reporter',
1615
config: {

packages/plugin-radon/src/radonPlugin.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { radonCorePlugin } from './radonCorePlugin.js';
33
import { radonGraniteRouter } from './radonGraniteRouterPlugin.js';
44

55
export const radon = (): GranitePlugin[] => {
6-
76
const plugins: GranitePlugin[] = [];
87

98
plugins.push(radonCorePlugin());
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
import fs from "node:fs";
2-
import path from "node:path";
1+
import fs from 'node:fs';
2+
import path from 'node:path';
33

44
export function detectRadonIdeExtensionPath(): string | undefined {
5-
const homeDir = process.env.HOME || process.env.USERPROFILE;
6-
if (!homeDir) {
7-
return undefined;
8-
}
9-
10-
// Check VSCode extensions
11-
const vscodeExtPath = path.join(homeDir, '.vscode', 'extensions');
12-
13-
// Check Cursor extensions
14-
const cursorExtPaths = path.join(homeDir, '.cursor', 'extensions')
15-
16-
const searchPaths = [vscodeExtPath, cursorExtPaths];
17-
18-
for (const searchPath of searchPaths) {
19-
if (fs.existsSync(searchPath)) {
20-
const entries = fs.readdirSync(searchPath);
21-
// Match exact version: swmansion.react-native-ide-1.14.2-{platform}
22-
const radonFolder = entries.find((entry) => /^swmansion\.react-native-ide-1\.14\.2-.+$/.test(entry));
23-
if (radonFolder) {
24-
const fullPath = path.join(searchPath, radonFolder);
25-
console.log(`[Radon] Found extension at: ${fullPath}`);
26-
return fullPath;
27-
}
5+
const homeDir = process.env.HOME || process.env.USERPROFILE;
6+
if (!homeDir) {
7+
return undefined;
8+
}
9+
10+
// Check VSCode extensions
11+
const vscodeExtPath = path.join(homeDir, '.vscode', 'extensions');
12+
13+
// Check Cursor extensions
14+
const cursorExtPaths = path.join(homeDir, '.cursor', 'extensions');
15+
16+
const searchPaths = [vscodeExtPath, cursorExtPaths];
17+
18+
for (const searchPath of searchPaths) {
19+
if (fs.existsSync(searchPath)) {
20+
const entries = fs.readdirSync(searchPath);
21+
// Match exact version: swmansion.react-native-ide-1.14.2-{platform}
22+
const radonFolder = entries.find((entry) => /^swmansion\.react-native-ide-1\.14\.2-.+$/.test(entry));
23+
if (radonFolder) {
24+
const fullPath = path.join(searchPath, radonFolder);
25+
console.log(`[Radon] Found extension at: ${fullPath}`);
26+
return fullPath;
2827
}
2928
}
30-
31-
console.warn('[Radon] Extension not found');
32-
return undefined;
33-
}
29+
}
30+
31+
console.warn('[Radon] Extension not found');
32+
return undefined;
33+
}

packages/plugin-radon/src/utils/loadRadonMetroConfig.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ export const loadRadonMetroConfig = (): AdditionalMetroConfig => {
3434
const localRequire = ((specifier: string) => {
3535
if (specifier.startsWith('.')) {
3636
const basePath = path.resolve(path.dirname(resolvedFilePath), specifier);
37-
const withExtension =
38-
fs.existsSync(basePath)
39-
? basePath
40-
: ['.js', '.cjs', '.json'].map((ext) => `${basePath}${ext}`).find((candidate) => fs.existsSync(candidate));
37+
const withExtension = fs.existsSync(basePath)
38+
? basePath
39+
: ['.js', '.cjs', '.json'].map((ext) => `${basePath}${ext}`).find((candidate) => fs.existsSync(candidate));
4140

4241
if (!withExtension) {
4342
return nodeRequire(specifier);
@@ -71,8 +70,7 @@ export const loadRadonMetroConfig = (): AdditionalMetroConfig => {
7170
// with its wrapper transformer.
7271
const appRoot = process.cwd();
7372
const originalBabelTransformerPath =
74-
process.env.RADON_IDE_ORIG_BABEL_TRANSFORMER_PATH ??
75-
requireResolve('metro-react-native-babel-transformer');
73+
process.env.RADON_IDE_ORIG_BABEL_TRANSFORMER_PATH ?? requireResolve('metro-react-native-babel-transformer');
7674

7775
const baseConfig: AdditionalMetroConfig = {
7876
projectRoot: appRoot,

packages/plugin-radon/tsdown.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default defineConfig([
1010
{
1111
entry: 'src/routerBabel.js',
1212
outDir: 'dist',
13-
format: ['esm','cjs'],
13+
format: ['esm', 'cjs'],
1414
dts: false,
1515
minify: true,
1616
},

0 commit comments

Comments
 (0)