Skip to content

Instantly share code, notes, and snippets.

View iksena's full-sized avatar
🏠
Working from home

I Komang Sena Aji Buwana iksena

🏠
Working from home
View GitHub Profile
@iksena
iksena / app\index.js
Created January 16, 2021 17:15
yo microservice with compose route
const Generator = require('yeoman-generator');
class MicroserviceGenerator extends Generator {
// ...constructor
initializing() {
this.composeWith(require.resolve('../route'));
}
// ...other tasks
@iksena
iksena / route\index.js
Created January 16, 2021 16:22
yo microservice:route
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',
@iksena
iksena / app\index.js
Last active January 16, 2021 10:19
yo microservice install task
const Generator = require('yeoman-generator');
class MicroserviceGenerator extends Generator {
// ...other tasks
install() {
const devDependencies = [
'@types/cors',
'@types/express',
'@types/jest',
@iksena
iksena / app\index.js
Created January 15, 2021 20:08
yo microservice writing
const Generator = require('yeoman-generator');
class MicroserviceGenerator extends Generator {
// ...other tasks
writing() {
const templates = [
'.dockerignore',
'.env',
'.eslintrc.yml',
@iksena
iksena / .env
Created January 15, 2021 19:32
yo microservice env template
# ------------------------------------------------------------------
# General
# ------------------------------------------------------------------
SERVICE_NAME=<%= name %>
PORT=3000
LOG_LEVEL=debug
<%_ if (hasDb) { _%>
# ------------------------------------------------------------------
# Database
@iksena
iksena / app\index.js
Last active January 10, 2021 19:47
Configuring tasks for ms generator
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"
@iksena
iksena / app\index.js
Last active January 10, 2021 13:11
Microservice Main Generator for asking arguments
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',
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 {
import React from 'react';
import {
ScrollView,
View,
Text,
ViewStyle,
TextStyle,
StyleSheet
} from 'react-native';
import { Formik } from 'formik';
import React from 'react';
import {
FlatList,
StyleSheet,
Text,
TextStyle,
View,
ViewStyle
} from 'react-native';
import { Button, Icon } from 'react-native-elements';