0.79.3 • Published 5 months ago

@react-native/core-cli-utils v0.79.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@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: ....

Contributing

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

0.78.0

9 months ago

0.78.2

7 months ago

0.78.1

8 months ago

0.77.0-rc.0

12 months ago

0.77.0-rc.1

11 months ago

0.77.0-rc.2

11 months ago

0.77.0-rc.3

11 months ago

0.77.0-rc.4

11 months ago

0.77.0-rc.5

10 months ago

0.77.0-rc.6

10 months ago

0.77.0-rc.7

10 months ago

0.79.3

5 months ago

0.79.2

6 months ago

0.79.1

7 months ago

0.79.0

7 months ago

0.76.6

10 months ago

0.76.5

11 months ago

0.76.8

8 months ago

0.76.7

9 months ago

0.76.2

12 months ago

0.76.4

11 months ago

0.76.3

12 months ago

0.76.9

7 months ago

0.77.1

9 months ago

0.77.0

10 months ago

0.77.2

8 months ago

0.79.0-rc.0

8 months ago

0.79.0-rc.1

8 months ago

0.79.0-rc.4

7 months ago

0.79.0-rc.2

8 months ago

0.79.0-rc.3

8 months ago

0.80.0-rc.4

5 months ago

0.80.0-rc.5

5 months ago

0.80.0-rc.0

6 months ago

0.80.0-rc.1

6 months ago

0.80.0-rc.2

6 months ago

0.80.0-rc.3

5 months ago

0.75.5

9 months ago

0.78.0-rc.5

9 months ago

0.78.0-rc.4

9 months ago

0.78.0-rc.3

9 months ago

0.78.0-rc.2

9 months ago

0.78.0-rc.1

10 months ago

0.78.0-rc.0

10 months ago

0.76.1

1 year ago

0.76.0

1 year ago

0.76.0-rc.6

1 year ago

0.76.0-rc.5

1 year ago

0.76.0-rc.3

1 year ago

0.76.0-rc.4

1 year ago

0.75.4

1 year ago

0.76.0-rc.2

1 year ago

0.76.0-rc.1

1 year ago

0.76.0-rc.0

1 year ago

0.75.3

1 year ago

0.75.2

1 year ago

0.75.1

1 year ago

0.75.0

1 year ago

0.75.0-rc.1

1 year ago

0.75.0-rc.0

1 year ago

0.75.0-rc.5

1 year ago

0.75.0-rc.4

1 year ago

0.75.0-rc.3

1 year ago

0.75.0-rc.2

1 year ago

0.75.0-rc.7

1 year ago

0.75.0-rc.6

1 year ago

0.75.0-main

2 years ago