Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modulo Core agora precisa ser transpilado antes de usar #17

Merged
merged 1 commit into from
Dec 9, 2018

Conversation

eduardomoroni
Copy link
Contributor

@eduardomoroni eduardomoroni commented Dec 8, 2018

De acordo com a discussão em facebook/create-react-app#4517, não é possivel que o CRA transpile modulos que estejam dentro da pasta node_modules.
Por enquanto vamos manter esta etapa manual.
Voce precisa ir dentro do modulo core e rodar o comando: npm run build, este comando vai transformar o código dentro de src para dist. O modulo web e mobile irão consumir os arquivos de dentro da pasta dist e não da pasta src.

Em breve configurarei o nosso próprio CRA https://github.com/mtg-community/create-react-app, de acordo com https://medium.com/@denis.zhbankov/maintaining-a-fork-of-create-react-app-as-an-alternative-to-ejecting-c555e8eb2b63

NOTA: este PR deleta a pasta web/src/core

@@ -4,6 +4,7 @@
"private": false,
"main": "dist/index.js",
"scripts": {
"postinstall": "npm run build",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Após npm install o npm automaticamente rodará a build

export * from './useCases';
export * from './frameworks';
export * from './entities';
import {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esta verboso, mas esta é a melhor maneira de conseguir ter auxilio da IDE e conseguir importar as coisas direto de 'core'

ReduxAdapter,
AuthenticationInteractor,
CounterInteractor,
} from 'core';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perceba que o from 'core' pode ser usado agora. Graçcas aquele core/src/index.js verbosao

@LeoMosiah LeoMosiah merged commit c7b2fdc into master Dec 9, 2018
@eduardomoroni eduardomoroni deleted the core-transpile branch December 10, 2018 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants