UNPKG

3.53 kBMarkdownView Raw
1# gooddata-create-gooddata-react-app
2
3© 2019-2020 GoodData Corporation
4
5# GoodData Create React App
6
7This is a CLI tool that creates a new React project with a proxy set up to connect to your projects on the GoodData platform.
8The new app features some widgets and helpers that could come in handy.
9The app is built on top of Create React App. For more info see [Create React App documentation](https://facebook.github.io/create-react-app/).
10
11## How to use
12
13To create a project called `my-app`, run this in your terminal:
14
15```bash
16npx @gooddata/create-gooddata-react-app my-app
17```
18
19Then follow the instructions provided by the CLI.
20
21When navigating to your application using an IP address instead of localhost, you may run into `401` errors while trying to log in. This is due to proxying and cookie rewriting rules that the generated application uses to get around CORS. Use localhost instead of IP addresses to access the application because the development server rewrites GDC cookies to be for localhost.
22
23_NOTE:_ We use `yarn` dependency manager. To install it, follow its [documentation](https://yarnpkg.com/lang/en/docs/install). If you don't want to use `yarn`, provide the `--no-install` flag like `npx @gooddata/create-gooddata-react-app my-app --no-install` . This will skip calling `yarn install` and you will have to manually install the dependencies of the created app. Please note that we do not provide `package-lock.json` so the application may not work properly when dependencies are installed using `npm`.
24
25## CLI usage
26
27`@gooddata/create-gooddata-react-app` supports several optional flags:
28
29- `--hostname <hostname>` URL of your GoodData host
30- `-c, --config <config>` path to configuration file (see below)
31- `--no-install` skip yarn installing the app dependencies
32- `--verbose` output additional logs, useful mainly for debugging and bug reports
33- `-h, --help` output usage information
34- `--backend <backend>` switch backend to a desired one (default: `bear`)
35- `--flavor <flavor>` desired flavor of the application: `js` for JavaScript, `ts` for TypeScript
36
37### Configuration file
38
39The configuration file has the following structure:
40
41```json
42{
43 "hostname": "(Required) URL of the project hosted, e.g., https://developer.na.gooddata.com",
44 "appName": "(Optional) name of the app to use",
45 "flavor": "(Optional) flavor of the app, e.g., js for JavaScript, ts for TypeScript (default: js)"
46}
47```
48
49## Prerequisites
50
51Before running `@gooddata/create-gooddata-react-app`, please make sure that you have all compatible [technologies](https://sdk.gooddata.com/gooddata-ui/docs/about_gooddataui.html#supported-technologies) installed on your device.
52
53## Troubleshooting
54
55In case there are errors while running `@gooddata/create-gooddata-react-app`, please try these steps.
56
57### Remove older versions
58
59Sometimes having older versions of `@gooddata/create-gooddata-react-app` can cause errors. In that case please remove any previously installed versions by running
60
61```bash
62npm uninstall -g @gooddata/create-gooddata-react-app
63yarn global remove @gooddata/create-gooddata-react-app
64```
65
66### Force npx to use the latest version
67
68You can force `npx` to use latest version of the tool by running
69
70```bash
71npx --ignore-existing @gooddata/create-gooddata-react-app my-app
72```
73
74### Enable verbose output
75
76You can increase the logging level of `@gooddata/create-gooddata-react-app my-app` by providing the `--verbose` flag like
77
78```bash
79npx @gooddata/create-gooddata-react-app my-app --verbose
80```