Fast follows from RFC-0759 cli feedback

Summary:
Updated linters, include typings in `package.json` and removed bun from the clean commands.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D54493859

fbshipit-source-id: eb28d208de722c90916b14f56d5a8e847bb3d859
This commit is contained in:
Blake Friedman
2024-03-19 05:29:34 -07:00
committed by Facebook GitHub Bot
parent d19d871361
commit 4a58f06c13
5 changed files with 15 additions and 16 deletions
+6
View File
@@ -0,0 +1,6 @@
{
"ignorePatterns": ["dist/**"],
"rules": {
"sort-keys": 2
}
}
+1
View File
@@ -13,6 +13,7 @@
".": "./src/index.js",
"./package.json": "./package.json"
},
"types": "./dist/index.d.ts",
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/core-cli-utils#readme",
"keywords": [
"cli-utils",
+5 -3
View File
@@ -15,7 +15,9 @@ import {tasks as clean} from './private/clean.js';
/* eslint sort-keys : "error" */
export default {
android,
apple,
clean,
android: typeof android,
apple: typeof apple,
clean: typeof clean,
};
export type {Task} from './private/types';
+2 -12
View File
@@ -20,19 +20,18 @@ import path from 'path';
type CleanTasks = {
android: (androidSrcDir: ?string) => Task[],
cocoapods?: (projectRootDir: string) => Task[],
metro: () => Task[],
npm: (projectRootDir: string, verifyCache?: boolean) => Task[],
bun: (projectRootDir: string) => Task[],
watchman: (projectRootDir: string) => Task[],
yarn: (projectRootDir: string) => Task[],
cocoapods?: (projectRootDir: string) => Task[],
};
const rmrf = (pathname: string) => {
if (!existsSync(pathname)) {
return;
}
rm(pathname, {maxRetries: 3, recursive: true, force: true});
rm(pathname, {force: true, maxRetries: 3, recursive: true});
};
/**
@@ -130,15 +129,6 @@ export const tasks: CleanTasks = {
return _tasks;
},
/**
* Cleans up the Bun cache.
*/
bun: (projectRootDir: string) => [
task('🧹 Clean Bun cache', (opts?: ExecaOptions) =>
execa('bun', ['pm', 'cache', 'rm'], {cwd: projectRootDir, ...opts}),
),
],
/**
* Stops Watchman and clears its cache
*/
+1 -1
View File
@@ -16,8 +16,8 @@ import os from 'os';
export function task(label: string, action: Task['action']): Task {
return {
label,
action,
label,
};
}