⚠️ Deprecated : The contents of this project have been moved to Terralego/visu-front
$ npm ci
For development purpose, you should create the following file:
$ touch .env
and edit it to set the REACT_APP_MAPBOX_TOKEN
variable.
$ npm start
You can see many logs in your console by activating debug. Just type in your browser console :
localStorage.debug = 'terralego:*';
and reload your app. You can focus on any TerraFront module by replacing *
by any module name like terralego:Visualizer
.
npm run storybook
npm test
npm run build
Requirements: git-extras needed by npm version to run the command git changelog
The package publication is automatic for all tagged version. To proceed, execute the following commands on master:
npm version [patch|minor|major] # Select the type according to the evolution criticity
# ... the previous command proposes you to edit the CHANGELOG
git push && git push --tags
# Then the gitlab pipeline starts and should publish the package.
To publish manually (not recomanded) the package to npmjs.com (current commit should be tagged)
npm run publish:manual
An API service to fetch data from backend
A user provider with a login form. Wrap your app with AuthProvider to get access to all auth data and actions. Then, you will be able to get connected user and call login and signout action.
A fully configurable visualizer displaying a layers tree, a map and able to make user interactions on it.
Every component should be configurable by passing replacement props from TerraFrontProvider.
<terrafront/dir> $ npm ci
<terrafront/dir> $ npm run build-local
<terrafront/dir> $ npm link # To link globally
# Switch to other project dir
<otherproject/dir> $ npm link <terrafront/dir>/dist
# Come back to terrafront/dir inside dist
<terrafront/dir> $ npm link <otherproject/dir>/node_modules/react
<terrafront/dir> $ npm link <otherproject/dir>/node_modules/react-router
<terrafront/dir> $ npm run build-local
<terrafront/dir> $ npm run watch:babel # To start autobuilding
# THEN you can start the other package dev server
<otherproject/dir> $ npm run start
When developing in another environement with TF linked you can see this error.
Invalid hook call. Hooks can only be called inside of the body of a function component.
In this case stop all running server or watcher and execute :
<terrafront/dir> $ cd dist
<terrafront/dir> $ npm link ../../<otherproject/dir>/node_modules/react/