Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Generates the files needed for React Native Fabric components.
/**
* 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
You can’t perform that action at this time.