mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
d19d871361
commit
4a58f06c13
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"ignorePatterns": ["dist/**"],
|
||||
"rules": {
|
||||
"sort-keys": 2
|
||||
}
|
||||
}
|
||||
@@ -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",
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -16,8 +16,8 @@ import os from 'os';
|
||||
|
||||
export function task(label: string, action: Task['action']): Task {
|
||||
return {
|
||||
label,
|
||||
action,
|
||||
label,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user