@teleporthq/teleport-component-generator-reactnative
Advanced tools
Comparing version 0.15.0 to 0.16.0
import ReactNativeMapping from './react-native-mapping.json'; | ||
import { ComponentGenerator, Mapping, ReactNativeStyleVariation } from '@teleporthq/teleport-types'; | ||
declare const createReactNativeComponentGenerator: (variation?: ReactNativeStyleVariation, mapping?: Mapping) => ComponentGenerator; | ||
import { ReactNativeStyleVariation, ComponentGeneratorInstance } from '@teleporthq/teleport-types'; | ||
declare const createReactNativeComponentGenerator: ComponentGeneratorInstance; | ||
export { createReactNativeComponentGenerator, ReactNativeMapping, ReactNativeStyleVariation }; | ||
declare const _default: ComponentGenerator; | ||
export default _default; |
@@ -49,9 +49,8 @@ "use strict"; | ||
_a); | ||
var createReactNativeComponentGenerator = function (variation, mapping) { | ||
if (variation === void 0) { variation = teleport_types_1.ReactNativeStyleVariation.StyledComponents; } | ||
if (mapping === void 0) { mapping = {}; } | ||
var createReactNativeComponentGenerator = function (_a) { | ||
var _b = _a === void 0 ? {} : _a, _c = _b.variation, variation = _c === void 0 ? teleport_types_1.ReactNativeStyleVariation.StyledComponents : _c, _d = _b.mappings, mappings = _d === void 0 ? [] : _d, _e = _b.postprocessors, postprocessors = _e === void 0 ? [] : _e, _f = _b.plugins, plugins = _f === void 0 ? [] : _f; | ||
var generator = teleport_component_generator_1.createComponentGenerator(); | ||
var stylePlugin = stylePlugins[variation] || teleport_plugin_jsx_inline_styles_1.default; | ||
generator.addMapping(react_native_mapping_json_1.default); | ||
generator.addMapping(mapping); | ||
mappings.forEach(function (mapping) { return generator.addMapping(mapping); }); | ||
generator.addPlugin(teleport_plugin_react_base_component_1.default); | ||
@@ -62,4 +61,6 @@ generator.addPlugin(stylePlugin); | ||
generator.addPlugin(teleport_plugin_reactnative_component_navigation_1.default); | ||
plugins.forEach(function (plugin) { return generator.addPlugin(plugin); }); | ||
generator.addPlugin(teleport_plugin_import_statements_1.default); | ||
generator.addPostProcessor(teleport_postprocessor_prettier_jsx_1.default); | ||
postprocessors.forEach(function (postprocessor) { return generator.addPostProcessor(postprocessor); }); | ||
var originalGeneratorFn = generator.generateComponent; | ||
@@ -73,3 +74,2 @@ // Until we figure out a better way to skip the resolve navlink functionality | ||
exports.createReactNativeComponentGenerator = createReactNativeComponentGenerator; | ||
exports.default = createReactNativeComponentGenerator(); | ||
//# sourceMappingURL=index.js.map |
import ReactNativeMapping from './react-native-mapping.json'; | ||
import { ComponentGenerator, Mapping, ReactNativeStyleVariation } from '@teleporthq/teleport-types'; | ||
declare const createReactNativeComponentGenerator: (variation?: ReactNativeStyleVariation, mapping?: Mapping) => ComponentGenerator; | ||
import { ReactNativeStyleVariation, ComponentGeneratorInstance } from '@teleporthq/teleport-types'; | ||
declare const createReactNativeComponentGenerator: ComponentGeneratorInstance; | ||
export { createReactNativeComponentGenerator, ReactNativeMapping, ReactNativeStyleVariation }; | ||
declare const _default: ComponentGenerator; | ||
export default _default; |
@@ -11,3 +11,3 @@ import reactComponentPlugin from '@teleporthq/teleport-plugin-react-base-component'; | ||
import ReactNativeMapping from './react-native-mapping.json'; | ||
import { ReactNativeStyleVariation } from '@teleporthq/teleport-types'; | ||
import { ReactNativeStyleVariation, } from '@teleporthq/teleport-types'; | ||
// This extracts Text, View, Image as illegal element names | ||
@@ -24,7 +24,7 @@ const rnMapping = ReactNativeMapping; | ||
}; | ||
const createReactNativeComponentGenerator = (variation = ReactNativeStyleVariation.StyledComponents, mapping = {}) => { | ||
const createReactNativeComponentGenerator = ({ variation = ReactNativeStyleVariation.StyledComponents, mappings = [], postprocessors = [], plugins = [], } = {}) => { | ||
const generator = createComponentGenerator(); | ||
const stylePlugin = stylePlugins[variation] || inlineStylesPlugin; | ||
generator.addMapping(ReactNativeMapping); | ||
generator.addMapping(mapping); | ||
mappings.forEach((mapping) => generator.addMapping(mapping)); | ||
generator.addPlugin(reactComponentPlugin); | ||
@@ -35,4 +35,6 @@ generator.addPlugin(stylePlugin); | ||
generator.addPlugin(navigationPlugin); | ||
plugins.forEach((plugin) => generator.addPlugin(plugin)); | ||
generator.addPlugin(importStatementsPlugin); | ||
generator.addPostProcessor(prettierJSX); | ||
postprocessors.forEach((postprocessor) => generator.addPostProcessor(postprocessor)); | ||
const originalGeneratorFn = generator.generateComponent; | ||
@@ -47,3 +49,2 @@ // Until we figure out a better way to skip the resolve navlink functionality | ||
export { createReactNativeComponentGenerator, ReactNativeMapping, ReactNativeStyleVariation }; | ||
export default createReactNativeComponentGenerator(); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@teleporthq/teleport-component-generator-reactnative", | ||
"version": "0.15.0", | ||
"version": "0.16.0", | ||
"description": "Component generator customization, capable of creating React Native components", | ||
@@ -29,15 +29,15 @@ "author": "teleportHQ", | ||
"dependencies": { | ||
"@teleporthq/teleport-component-generator": "^0.15.0", | ||
"@teleporthq/teleport-plugin-import-statements": "^0.15.0", | ||
"@teleporthq/teleport-plugin-jsx-inline-styles": "^0.15.0", | ||
"@teleporthq/teleport-plugin-jsx-proptypes": "^0.15.0", | ||
"@teleporthq/teleport-plugin-react-base-component": "^0.15.0", | ||
"@teleporthq/teleport-plugin-react-styled-components": "^0.15.0", | ||
"@teleporthq/teleport-plugin-reactnative-component-navigation": "^0.15.0", | ||
"@teleporthq/teleport-plugin-reactnative-resource-loader": "^0.15.0", | ||
"@teleporthq/teleport-postprocessor-prettier-jsx": "^0.15.0", | ||
"@teleporthq/teleport-shared": "^0.15.0", | ||
"@teleporthq/teleport-types": "^0.15.0" | ||
"@teleporthq/teleport-component-generator": "^0.16.0", | ||
"@teleporthq/teleport-plugin-import-statements": "^0.16.0", | ||
"@teleporthq/teleport-plugin-jsx-inline-styles": "^0.16.0", | ||
"@teleporthq/teleport-plugin-jsx-proptypes": "^0.16.0", | ||
"@teleporthq/teleport-plugin-react-base-component": "^0.16.0", | ||
"@teleporthq/teleport-plugin-react-styled-components": "^0.16.0", | ||
"@teleporthq/teleport-plugin-reactnative-component-navigation": "^0.16.0", | ||
"@teleporthq/teleport-plugin-reactnative-resource-loader": "^0.16.0", | ||
"@teleporthq/teleport-postprocessor-prettier-jsx": "^0.16.0", | ||
"@teleporthq/teleport-shared": "^0.16.0", | ||
"@teleporthq/teleport-types": "^0.16.0" | ||
}, | ||
"gitHead": "397f2e55be8419d8b060dfd96485297fc1169535" | ||
"gitHead": "87531fab68231f166de64fdd5a2a212fdab8f0c9" | ||
} |
@@ -8,11 +8,13 @@ import reactComponentPlugin from '@teleporthq/teleport-plugin-react-base-component' | ||
import navigationPlugin from '@teleporthq/teleport-plugin-reactnative-component-navigation' | ||
import prettierJSX from '@teleporthq/teleport-postprocessor-prettier-jsx' | ||
import { createComponentGenerator } from '@teleporthq/teleport-component-generator' | ||
import ReactNativeMapping from './react-native-mapping.json' | ||
import { | ||
ComponentGenerator, | ||
Mapping, | ||
ReactNativeStyleVariation, | ||
GeneratorFactoryParams, | ||
ComponentGeneratorInstance, | ||
} from '@teleporthq/teleport-types' | ||
import { ComponentGenerator, Mapping, ReactNativeStyleVariation } from '@teleporthq/teleport-types' | ||
// This extracts Text, View, Image as illegal element names | ||
@@ -34,11 +36,13 @@ const rnMapping = ReactNativeMapping as Mapping | ||
const createReactNativeComponentGenerator = ( | ||
const createReactNativeComponentGenerator: ComponentGeneratorInstance = ({ | ||
variation = ReactNativeStyleVariation.StyledComponents, | ||
mapping: Mapping = {} | ||
): ComponentGenerator => { | ||
mappings = [], | ||
postprocessors = [], | ||
plugins = [], | ||
}: GeneratorFactoryParams = {}): ComponentGenerator => { | ||
const generator = createComponentGenerator() | ||
const stylePlugin = stylePlugins[variation] || inlineStylesPlugin | ||
const stylePlugin = stylePlugins[variation as ReactNativeStyleVariation] || inlineStylesPlugin | ||
generator.addMapping(ReactNativeMapping as Mapping) | ||
generator.addMapping(mapping) | ||
mappings.forEach((mapping) => generator.addMapping(mapping)) | ||
@@ -50,5 +54,7 @@ generator.addPlugin(reactComponentPlugin) | ||
generator.addPlugin(navigationPlugin) | ||
plugins.forEach((plugin) => generator.addPlugin(plugin)) | ||
generator.addPlugin(importStatementsPlugin) | ||
generator.addPostProcessor(prettierJSX) | ||
postprocessors.forEach((postprocessor) => generator.addPostProcessor(postprocessor)) | ||
@@ -68,3 +74,1 @@ const originalGeneratorFn = generator.generateComponent | ||
export { createReactNativeComponentGenerator, ReactNativeMapping, ReactNativeStyleVariation } | ||
export default createReactNativeComponentGenerator() |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
262486
998
+ Added@teleporthq/teleport-component-generator@0.16.3(transitive)
+ Added@teleporthq/teleport-plugin-common@0.16.3(transitive)
+ Added@teleporthq/teleport-plugin-import-statements@0.16.3(transitive)
+ Added@teleporthq/teleport-plugin-jsx-inline-styles@0.16.3(transitive)
+ Added@teleporthq/teleport-plugin-jsx-proptypes@0.16.3(transitive)
+ Added@teleporthq/teleport-plugin-react-base-component@0.16.3(transitive)
+ Added@teleporthq/teleport-plugin-react-styled-components@0.16.3(transitive)
+ Added@teleporthq/teleport-plugin-reactnative-component-navigation@0.16.3(transitive)
+ Added@teleporthq/teleport-plugin-reactnative-resource-loader@0.16.3(transitive)
+ Added@teleporthq/teleport-postprocessor-prettier-jsx@0.16.3(transitive)
+ Added@teleporthq/teleport-shared@0.16.3(transitive)
+ Added@teleporthq/teleport-types@0.16.3(transitive)
+ Added@teleporthq/teleport-uidl-builders@0.16.3(transitive)
+ Added@teleporthq/teleport-uidl-resolver@0.16.3(transitive)
+ Added@teleporthq/teleport-uidl-validator@0.16.3(transitive)
- Removed@teleporthq/teleport-component-generator@0.15.0(transitive)
- Removed@teleporthq/teleport-plugin-common@0.15.0(transitive)
- Removed@teleporthq/teleport-plugin-import-statements@0.15.0(transitive)
- Removed@teleporthq/teleport-plugin-jsx-inline-styles@0.15.0(transitive)
- Removed@teleporthq/teleport-plugin-jsx-proptypes@0.15.0(transitive)
- Removed@teleporthq/teleport-plugin-react-base-component@0.15.0(transitive)
- Removed@teleporthq/teleport-plugin-react-styled-components@0.15.0(transitive)
- Removed@teleporthq/teleport-plugin-reactnative-component-navigation@0.15.0(transitive)
- Removed@teleporthq/teleport-plugin-reactnative-resource-loader@0.15.0(transitive)
- Removed@teleporthq/teleport-postprocessor-prettier-jsx@0.15.0(transitive)
- Removed@teleporthq/teleport-shared@0.15.0(transitive)
- Removed@teleporthq/teleport-types@0.15.0(transitive)
- Removed@teleporthq/teleport-uidl-builders@0.15.0(transitive)
- Removed@teleporthq/teleport-uidl-resolver@0.15.0(transitive)
- Removed@teleporthq/teleport-uidl-validator@0.15.0(transitive)
Updated@teleporthq/teleport-plugin-import-statements@^0.16.0
Updated@teleporthq/teleport-plugin-jsx-inline-styles@^0.16.0
Updated@teleporthq/teleport-plugin-react-base-component@^0.16.0
Updated@teleporthq/teleport-plugin-react-styled-components@^0.16.0
Updated@teleporthq/teleport-plugin-reactnative-component-navigation@^0.16.0
Updated@teleporthq/teleport-plugin-reactnative-resource-loader@^0.16.0
Updated@teleporthq/teleport-postprocessor-prettier-jsx@^0.16.0