1/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @format
8 */
9
10'use strict';
11
12const yargs = require('yargs');
13const executor = require('./codegen/generate-specs-cli-executor');
14
15const argv = yargs
16  .option('p', {
17    alias: 'platform',
18    describe: 'Platform to generate native code artifacts for.',
19  })
20  .option('s', {
21    alias: 'schemaPath',
22    describe: 'The path to the schema file.',
23  })
24  .option('o', {
25    alias: 'outputDir',
26    describe:
27      'Path to the root directory where native code source files should be saved.',
28  })
29  .option('n', {
30    alias: 'libraryName',
31    describe: 'Name of specs library.',
32    default: 'FBReactNativeSpec',
33  })
34  .option('j', {
35    alias: 'javaPackageName',
36    describe: 'Name of Java package.',
37    default: 'com.facebook.fbreact.specs',
38  })
39  .option('t', {
40    alias: 'libraryType',
41    describe: 'all, components, or modules.',
42    default: 'all',
43  })
44  .usage('Usage: $0 <args>')
45  .demandOption(
46    ['platform', 'schemaPath', 'outputDir'],
47    'Please provide platform, schema path, and output directory.',
48  ).argv;
49
50function main() {
51  executor.execute(
52    argv.platform,
53    argv.schemaPath,
54    argv.outputDir,
55    argv.libraryName,
56    argv.javaPackageName,
57    argv.libraryType,
58  );
59}
60
61main();
62