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

Add getting-started example for create-react-app (#920) #1003

Open
wants to merge 8 commits into
base: master
from

Conversation

@RobJacobson
Copy link

@RobJacobson RobJacobson commented Jan 20, 2020

Here's a first attempt at adding a minimal example using create-react-app. How does this look?

@RobJacobson
Copy link
Author

@RobJacobson RobJacobson commented Jan 20, 2020

Hmm... I'm confused about the Travis error. When I run the tests in my CLI, I get this error message (which isn't terribly helpful):

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-map-gl@5.2.0 test: flow check && ocular-test
npm ERR! Exit status 1

Have I made a mistake or omitted something necessary? (This is my first pull request here.) Thanks in advance.

"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"

This comment has been minimized.

@Pessimistress

Pessimistress Jan 24, 2020
Collaborator

This is breaking CI. You need to either remove this or add eslint-config-react-app to the root devDependencies.

This comment has been minimized.

@RobJacobson

RobJacobson Jan 28, 2020
Author

Thanks. I added the dev dependency.

This comment has been minimized.

@Pessimistress

Pessimistress Jan 29, 2020
Collaborator

You need to add it to the root package.json. CI does not install dependencies for each example.

@RobJacobson
Copy link
Author

@RobJacobson RobJacobson commented Jan 28, 2020

I've made the requested changes. However, I'm still failing the Travis CI check. Can you provide any guidance?

@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

This comment has been minimized.

@Pessimistress

Pessimistress Jan 29, 2020
Collaborator

Do you need this file specifically for this example? Can this be rolled into the root .gitignore?

@Pessimistress
Copy link
Collaborator

@Pessimistress Pessimistress commented Jan 29, 2020

I've made the requested changes. However, I'm still failing the Travis CI check.

You need to add it to the root package.json. CI does not install dependencies for each example.

@RobJacobson
Copy link
Author

@RobJacobson RobJacobson commented Jan 29, 2020

I'm terribly sorry, but the Travis build failed again. I removed "eslint-config-react-app" from the example's config.json file and moved it to config.json in the root project. Could you please provide a further hint? (The Travis CI check seems like a "black box" to me.)

@Pessimistress
Copy link
Collaborator

@Pessimistress Pessimistress commented Jan 29, 2020

I removed "eslint-config-react-app" from the example's config.json file and moved it to config.json in the root project.

CI runs yarn at root. If eslint-config-react-app is not a root dependency, then it won't be installed.

If you don't really need the eslint setup for your example, then just remove it period. The repo has its own eslint configuration.

@Pessimistress
Copy link
Collaborator

@Pessimistress Pessimistress commented Jan 29, 2020

Looks like you have committed some irrelevant files in examples/geojson-markers.

@RobJacobson
Copy link
Author

@RobJacobson RobJacobson commented Jan 29, 2020

Thank you. I've done the following:

  1. Deleted esLintConfig from package.json for the CRA example.
  2. Deleted eslint-config-react-app from root/package.json.
  3. Deleted the extraneous files. (Sorry about that.)

Unfortunately, the Travis check is still failing. I'm feeling like an idiot. Could you please elaborate again on the problem?

@Pessimistress
Copy link
Collaborator

@Pessimistress Pessimistress commented Jan 29, 2020

CI is failing for a different issue (lint error).

/home/travis/build/uber/react-map-gl/examples/get-started/create-react-app/src/index.js
  5:26  error  'document' is not defined  no-undef

Have you run yarn at root before you commit?

@RobJacobson
Copy link
Author

@RobJacobson RobJacobson commented Jan 30, 2020

Thanks for your tip. I'm using VS Code with the ESLint extension. I'm getting the following error message at the top level of the project:

ESLint: ESLint configuration in .eslintrc.js is invalid: - Property "overrides" is the wrong type (expected array but got `{"files":["*.spec.js","webpack.config.js","**/bundle/*.js"],"rules":{"import/no-extraneous-dependencies":0}}`). . Please see the 'ESLint' output channel for details.

What am I doing wrong? Thanks for your patience with this issue.

@Pessimistress
Copy link
Collaborator

@Pessimistress Pessimistress commented Jan 30, 2020

This issue was recently fixed, you may need to rebase master.

@CLAassistant
Copy link

@CLAassistant CLAassistant commented Mar 13, 2020

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.