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
const Generator = require('yeoman-generator'); | |
class MicroserviceGenerator extends Generator { | |
// ...constructor | |
initializing() { | |
this.composeWith(require.resolve('../route')); | |
} | |
// ...other tasks |
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
const Generator = require('yeoman-generator'); | |
class RouteGenerator extends Generator { | |
async prompting() { | |
this.log('--- Generate a route ---'); | |
this.answers = await this.prompt([ | |
{ | |
name: 'routeName', | |
type: 'input', |
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
const Generator = require('yeoman-generator'); | |
class MicroserviceGenerator extends Generator { | |
// ...other tasks | |
install() { | |
const devDependencies = [ | |
'@types/cors', | |
'@types/express', | |
'@types/jest', |
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
const Generator = require('yeoman-generator'); | |
class MicroserviceGenerator extends Generator { | |
// ...other tasks | |
writing() { | |
const templates = [ | |
'.dockerignore', | |
'.env', | |
'.eslintrc.yml', |
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
# ------------------------------------------------------------------ | |
# General | |
# ------------------------------------------------------------------ | |
SERVICE_NAME=<%= name %> | |
PORT=3000 | |
LOG_LEVEL=debug | |
<%_ if (hasDb) { _%> | |
# ------------------------------------------------------------------ | |
# Database |
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
const Generator = require('yeoman-generator'); | |
class MicroserviceGenerator extends Generator { | |
// ... other methods | |
configuring() { | |
// creating new variables | |
const { name } = this.options; | |
const title = `ms-${name.toLowerCase()}`; // will output as "ms-example" |
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
const Generator = require('yeoman-generator'); | |
class MicroserviceGenerator extends Generator { | |
constructor(args, opts) { | |
super(args, opts); | |
// yo microservice Example | |
this.argument('name', { | |
type: String, | |
description: 'Microservice Name', |
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
import React from 'react'; | |
import { createStore } from 'redux'; | |
import { SafeAreaView } from 'react-native'; | |
import { Provider } from 'react-redux'; | |
import { NavigationContainer } from '@react-navigation/native'; | |
import NavigationStacks from './app/Navigations'; | |
import cartReducer from './app/Reducers/Cart.reducer'; | |
export default function App(): JSX.Element { |
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
import React from 'react'; | |
import { | |
ScrollView, | |
View, | |
Text, | |
ViewStyle, | |
TextStyle, | |
StyleSheet | |
} from 'react-native'; | |
import { Formik } from 'formik'; |
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
import React from 'react'; | |
import { | |
FlatList, | |
StyleSheet, | |
Text, | |
TextStyle, | |
View, | |
ViewStyle | |
} from 'react-native'; | |
import { Button, Icon } from 'react-native-elements'; |
NewerOlder