Skip to content

Automatic stub generation#17

Open
emilianobovetti wants to merge 1 commit into
masterfrom
stubs
Open

Automatic stub generation#17
emilianobovetti wants to merge 1 commit into
masterfrom
stubs

Conversation

@emilianobovetti

@emilianobovetti emilianobovetti commented Oct 21, 2019

Copy link
Copy Markdown
Member

Generare componenti in automatico da uno stub è 😎, ma trovo scomodo configurare gli strumenti per aderire a tutte le convenzioni che abbiamo deciso di adottare. Visto che creare uno script era molto semplice ho pensato di fare questa proposta:

yarn gen component Test produce questo

app
└── components
    └── Test
        ├── index.js
        └── Test.js

index.js

export { Test } from './Test';

Test.js

import React from 'react';
import { View, Text } from 'react-native';

export function Test(props) {
  return (
    <View>
      <Text>hello, world</Text>
    </View>
  );
}

yarn gen screen Test fa la stessa cosa in screens

app
└── screens
    └── Test
        ├── index.js
        └── Test.js

As a bonus: ho creato l'org hitbit su npm (che fa super fico) 🎉

Fatemi sapere che ne pensate 👋

@matteocarpi

Copy link
Copy Markdown
Contributor

Miiiitico.

Bello mi piace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants