CartoDB / carto-react-template

CARTO for React. The best way to develop Location Intelligence (LI) Apps usign CARTO platform and React
https://sample-app-react.carto.com
MIT License
39 stars 26 forks source link

First integration carto-cloud-native #231

Closed alasarr closed 3 years ago

alasarr commented 3 years ago
vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/carto-frontend/cra-template-carto/EqdXjDySToKiaeVXwtiKKECo8kWC
✅ Preview: https://cra-template-carto-git-carto-cloud-native-carto-frontend.vercel.app

alasarr commented 3 years ago

@borja-munoz hygen is available.

To make this compatible with cloud native I've create an environment variable that you can pass to hygen generator.

Example for carto cloud native:

CARTO_REACT_MODE='carto-cloud-native' npx hygen source new

Example for carto:

CARTO_REACT_MODE='carto' npx hygen source new
// or just skip the environment var since carto is the default
npx hygen source new

The same applies to other commands like view or layer

borja-munoz commented 3 years ago

Is there any way to avoid the need to specify the environment variable? I mean something we can inspect (like the use of Auth0 in the App.js file). I don't like too much having to use an env var.

alasarr commented 3 years ago

Is there any way to avoid the need to specify the environment variable? I mean something we can inspect (like the use of Auth0 in the App.js file). I don't like too much having to use an env var.

Open to a better ideas. but don't like the hack/magic of inspecting other files.

alasarr commented 3 years ago

Fixed, now code generator read the environment variable from .env. As we ready have a .env for each template, the user doesn't need to add it.