Created
March 7, 2019 18:38
-
-
Save ericlewis/17c2dbe013e6863efdcaee91966a2e9c to your computer and use it in GitHub Desktop.
Generates the files needed for React Native Fabric components.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright (c) Facebook, Inc. and its affiliates. | |
* | |
* This source code is licensed under the MIT license found in the | |
* LICENSE file in the root directory of this source tree. | |
* | |
* @flow | |
* @format | |
*/ | |
'use strict'; | |
require('flow-remove-types/register'); | |
const RNCodegen = require('./generators/RNCodegen.js'); | |
const mkdirp = require('mkdirp'); | |
function _generate(schema, outputDirectory) { | |
mkdirp.sync(outputDirectory); | |
RNCodegen.generate({ | |
libraryName: 'rncore', | |
schema, | |
outputDirectory, | |
}); | |
} | |
function generateCombined() { | |
const activityIndicatorSchema = require('../../../Libraries/Components/ActivityIndicator/ActivityIndicatorSchema.js'); | |
const switchSchema = require('../../../Libraries/Components/Switch/SwitchSchema.js'); | |
const sliderSchema = require('../../../Libraries/Components/Slider/SliderSchema.js'); | |
const schema = { | |
modules: { | |
...activityIndicatorSchema.modules, | |
...switchSchema.modules, | |
...sliderSchema.modules, | |
}, | |
}; | |
const outputDirectory = '../../ReactCommon/fabric/components/rncore'; | |
_generate(schema, outputDirectory); | |
} | |
generateCombined(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment