Unverified Commit 06ad6824 authored by Scott Ames's avatar Scott Ames Committed by GitHub
Browse files

Merge pull request #10 from scottaames/master

Base config complete
parents bb2b57c9 02c98988
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
{
  "presets": ["airbnb"]
  "presets": ["airbnb"],
  "env": {
    "production": {
      "presets": ["minify"]
    }
  }
}
+12 −1
Original line number Diff line number Diff line
{
  "env": {
    "es6": true,
    "browser": true
  },
  "extends": ["airbnb-base", "prettier"],
  "plugins": ["prettier"],
  "rules": {
    "prettier/prettier": "error"
  }
  },
  "ignorePatterns": [
    ".prettierrc",
    "postcss.config.js",
    ".eslintrc",
    ".babelrc",
    "webpack.*"
  ]
}
+15 −3
Original line number Diff line number Diff line
.DS_Store
node_modules
.dist
.cache/
coverage/
dist/*
node_modules/
*.log
package-lock.json
.dist/

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
+75 −0
Original line number Diff line number Diff line
# CartoCosmos - Leaflet Plugin for Planetary Mapping

Repository for the CartoCosmos Capstone Team.

### Building and running on localhost

##### First install dependencies:

```sh
npm install
```

##### To create a production build:

```sh
npm run build
```

This will create a folder "dist" with all of the production files needed.

##### To run the development server:

```sh
npm start
```

This will open a development server on port 8000 which will automatically compile and update in the browser window on save.

#### Linting and Formatting

##### Run ESLint:

```
npm run lint
```

This will display linting errors in the terminal window.

##### Fix ESLint errors:

```
npm run fix
```

This will fix the errors that ESLint knows how to.

##### Tell Prettier to format file on change:

```
npm run prettier-watch
```

This will tell Prettier to watch all javascript files and automatically format them on save.

###### Note: I recommend doing the following instead

_Works best in VSCode_

- Install the following extensions in VSCode:
  - Babel Javascript
  - Prettier - Code formatter
  - ESlint
- Go to your Settings and look for "Auto format on Save' and enable it.
- Set Prettier as your default formatter for javascript files.

This will automatically do all the linting and formatting for you.

#### Adding local assets for use

Add any files to

```
src/assets/
```

then simply import them in the file you need to use them inside. If you have any problems with this contact me.
+16 −4
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@
  "name": "cartocosmos",
  "version": "1.0.0",
  "license": "UNLICENSED",
  "main": "index.js",
  "description": "Leaflet extension for planetary mapping of non-Earth bodies with varying radii.",
  "author": "CartoCosmos",
  "contributors": [
@@ -15,7 +16,7 @@
    },
    {
      "name": "Jacob Kaufman",
      "url": "https://github.com/"
      "url": "https://github.com/jkaufy"
    },
    {
      "name": "Christopher Moore",
@@ -28,7 +29,8 @@
    "url": "https://github.com/CartoCosmos/CartoCosmos.git"
  },
  "scripts": {
    "build": "webpack",
    "start": "webpack-dev-server --open --config webpack.dev.js",
    "build": "webpack --config webpack.prod.js",
    "lint": "eslint --ext .js src",
    "fix": "npm run lint -- --fix",
    "prettier-watch": "onchange '**/*.js' -- prettier --write {{changed}}"
@@ -36,21 +38,31 @@
  "devDependencies": {
    "@babel/core": "^7.8.3",
    "@babel/runtime": "^7.8.3",
    "babel-loader": "^8.0.6",
    "babel-preset-airbnb": "^4.4.0",
    "clean-webpack-plugin": "^3.0.0",
    "css-loader": "^3.4.2",
    "eslint": "^6.1.0",
    "eslint-config-airbnb-base": "^14.0.0",
    "eslint-config-prettier": "^6.9.0",
    "eslint-plugin-import": "^2.20.0",
    "eslint-plugin-prettier": "^3.1.2",
    "html-webpack-plugin": "^3.2.0",
    "onchange": "^6.1.0",
    "postcss-loader": "^3.0.0",
    "prettier": "^1.19.1",
    "style-loader": "^1.1.3",
    "url-loader": "^3.0.0",
    "webpack": "^4.41.5",
    "webpack-cli": "^3.3.10",
    "webpack-dev-server": "^3.10.1"
    "webpack-dev-server": "^3.10.1",
    "autoprefixer": "^9.7.4",
    "precss": "^4.0.0",
    "webpack-merge": "^4.2.2"
  },
  "dependencies": {
    "leaflet": "^1.6.0",
    "lodash": "^4.17.15",
    "proj4": "^2.6.0",
    "proj4leaflet": "^1.0.2"
  }
}
Loading