Skip to content

Commit

Permalink
Fix src, test and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus89 committed Feb 7, 2018
1 parent ae71596 commit 02a61e6
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 50 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/config
/dist
/doc
/docs
/examples
9 changes: 6 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"env": {
"es6": true,
"node": true,
"browser": true,
"es6": true
"mocha": true
},
"extends": "eslint:recommended",
"parserOptions": {
Expand All @@ -24,6 +26,7 @@
"semi": [
"error",
"always"
]
],
"no-console": "off"
}
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.log
*.log

.vscode/
docs/
Expand Down
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
## CARTO GL

![](./doc/carto-gl-capture.png)

## Development

### Run the tests

```
npm test
```

### Build the library

```
npm run build
```

To watch the files

```
npm run build:watch
```

### Generate the docs

```
npm run docs
```
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions examples/complete/mapbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script src='../dist/mapbox-gl-dev.js'></script>
<script src='../../dist/mapbox-gl-dev.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.42.2/mapbox-gl.css' rel='stylesheet' />
<link href='css/normalize.css' rel='stylesheet' />
<link href='css/skeleton.css' rel='stylesheet' />
Expand Down Expand Up @@ -109,6 +109,6 @@ <h5 id='tutorial'></h5>
<textarea class="three columns" id="dataset">tx_0125_copy_copy</textarea>
<textarea class="three columns" id="cartoURL">carto-staging.com</textarea>
</div>
<script src="../dist/mapbox.js"></script>
<script src="../../dist/mapbox.js"></script>

</html>
</html>
6 changes: 3 additions & 3 deletions examples/complete/mapbox.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*eslint-env jquery*/
/*eslint no-console: ["off"] */

import * as MGL from '../lib/api/mapboxgl';
import WindshaftSQL from '../lib/api/windshaft-sql';
import * as R from '../src/index';
import * as MGL from '../../src/api/mapboxgl';
import WindshaftSQL from '../../src/api/windshaft-sql';
import * as R from '../../src/core/index';

const styles = [
`width: 3
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@
"main": "src/index.js",
"scripts": {
"sst": "mocha test/sstest/index.test.js --timeout 15000",
"test": "./node_modules/.bin/eslint example/ contrib/ src/",
"loc": "node_modules/sloc/bin/sloc src/ contrib/ example/",
"loc": "node_modules/sloc/bin/sloc src/ examples/",
"test": "npm run lint",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"build": "webpack",
"build:watch": "webpack -w",
"build-doc": "rm -rf docs/; node_modules/.bin/jsdoc --configure config/jsdoc/internal.json; node_modules/.bin/jsdoc --configure config/jsdoc/public.json",
"docs": "rm -rf docs/public; jsdoc --configure config/jsdoc/public-conf.json",
"docs:internal": "rm -rf docs/internal; jsdoc --configure config/jsdoc/internal-conf.json",
"publish": "git checkout gh-pages && git merge master && npm run build && npm run build-doc && git commit -a -m \"Auto generated gh-pages\" && git push && git checkout master"
}
}
2 changes: 1 addition & 1 deletion src/api/mapboxgl.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import * as R from '../src/index';
import * as R from '../core/index';

const DEG2RAD = Math.PI / 180;
const EARTH_RADIUS = 6378137;
Expand Down
2 changes: 1 addition & 1 deletion src/api/windshaft-sql.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as rsys from './rsys';
import * as R from '../src/index';
import * as R from '../core/index';

import { VectorTile } from '@mapbox/vector-tile';
import * as Protobuf from 'pbf';
Expand Down
1 change: 1 addition & 0 deletions src/core/style/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export const mode = (...args) => new Mode(...args);
export const top = (...args) => new Top(...args);
export const linear = (...args) => new Linear(...args);
export const cubic = (...args) => new Cubic(...args);
export const ilinear = (...args) => new ILinear(...args);
export const now = (...args) => new Now(...args);
export const zoom = (...args) => new Zoom(...args);
export const cielab = (...args) => new CIELab(...args);
Expand Down
30 changes: 0 additions & 30 deletions test/.eslintrc.json

This file was deleted.

10 changes: 5 additions & 5 deletions test/sstest/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const serve = require('serve');
const path = require('path');
const server = serve(path.join(__dirname, '../../'), {
port: 5555,
});
// const serve = require('serve');
// const path = require('path');
// const server = serve(path.join(__dirname, '../../'), {
// port: 5555,
// });

0 comments on commit 02a61e6

Please sign in to comment.