react-native/packages/core-cli-utils
Riccardo Cipolleschi 120558c0cd Bump main to 0.77
Summary:
This change bumps the React Native version in main to 0.77

bypass-github-export-checks

## Changelog:
[General][Changed] - Bump main to 0.77-main

## Facebook:
generated by running `js1 publish react-native 0.77.0-main`

Reviewed By: cortinico

Differential Revision: D62575939

fbshipit-source-id: 6d239fca2eed6cfe51f8c37f78d8dc8730c18b8c
2024-09-12 09:23:23 -07:00
..
src Fix cli assemble, build & install (#44902) 2024-06-13 04:51:20 -07:00
.eslintrc.json Fast follows from RFC-0759 cli feedback 2024-03-19 05:29:34 -07:00
.gitignore Port: @react-native-community/cli#ios → @react-native/core-cli-utils#ios (#43288) 2024-03-13 10:34:06 -07:00
package.json Bump main to 0.77 2024-09-12 09:23:23 -07:00
README.md core-cli-utils - Added version information 2024-04-11 07:59:01 -07:00

@react-native/core-cli-utils

npm package

A collection of utilites to help Frameworks build their React Native CLI tooling. This is not intended to be used directly use users of React Native.

Usage

import { Command } from 'commander';
import cli from '@react-native/core-cli-utils';
import debug from 'debug';

const android = new Command('android');

const frameworkFindsAndroidSrcDir = "...";
const tasks = cli.clean.android(frameworkFindsAndroidSrcDir);
const log = debug('fancy-framework:android');

android
    .command('clean')
    .description(cli.clean.android)
    .action(async () => {
        const log = debug('fancy-framework:android:clean');
        log(`🧹 let me clean your Android caches`);
        // Add other caches your framework needs besides the normal React Native caches
        // here.
        for (const task of tasks) {
            try {
                log(`\t ${task.label}`);
                // See: https://github.com/sindresorhus/execa#lines
                const {stdout} = await task.action({ lines: true })
                log(stdout.join('\n\tGradle: '));
            } catch (e) {
                log(`\t ⚠️ whoops: ${e.message}`);
            }
        }
    });

And you'd be using it like this:

$ ./fancy-framework android clean
🧹 let me clean your Android caches
    Gradle: // a bunch of gradle output
    Gradle: ....

Features

  • "@react-native/core-cli-utils/version.js" contains the platform and tooling version requirements for react-native.

Contributing

Changes to this package can be made locally and linked against your app. Please see the Contributing guide.