Skip to content

Commit

Permalink
chore: Upgrade to ocular v1 (visgl#6183)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibgreen authored Nov 12, 2021
1 parent 627957b commit 4a0bc67
Show file tree
Hide file tree
Showing 160 changed files with 2,557 additions and 1,176 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ module.exports = {
'react/forbid-prop-types': 0,
'react/no-deprecated': 0,
'import/no-unresolved': ['error', {ignore: ['test']}],
'import/no-extraneous-dependencies': ['error', {devDependencies: false, peerDependencies: true}]
'import/no-extraneous-dependencies': ['error', {devDependencies: false, peerDependencies: true}],
'accessor-pairs': 0
},
parserOptions: {
ecmaVersion: 2020
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ test/**/*-failed.png
.nyc_output/
.reify-cache/

tsconfig.tsbuildinfo

dist-demo/
dist-bundle.js

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ semi: true
singleQuote: true
trailingComma: none
bracketSpacing: false
arrowParens: avoid
22 changes: 14 additions & 8 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
/* eslint-disable import/no-extraneous-dependencies */
const getBabelConfig = require('ocular-dev-tools/config/babel.config');
const {getBabelConfig, deepMerge} = require('ocular-dev-tools');

module.exports = api => {
const config = getBabelConfig(api);
let config = getBabelConfig(api);

config.plugins.push('version-inline', 'inline-webgl-constants', [
'remove-glsl-comments',
{
patterns: ['**/*.glsl.js']
}
]);
config = deepMerge(config, {
plugins: [
'version-inline',
'inline-webgl-constants',
[
'remove-glsl-comments',
{
patterns: ['**/*.glsl.js']
}
]
]
});

return config;
};
2 changes: 1 addition & 1 deletion docs/api-reference/test-utils/generate-layer-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This utility generates a series of test cases to be used with [testLayer](/docs/
Example of layer unit tests using `tape`. The test utility itself is test framework agnostic.

```js
import test from 'tape-catch';
import test from 'tape-promise/tape';
import {testLayer, generateLayerTests} from '@deck.gl/test-utils';
import {GeoJsonLayer} from '@deck.gl/layers';

Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/test-utils/test-layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The `testLayerAsync` utility is like `testLayer`, but designed for layers that n
Example of layer unit tests using `tape`. The test utility itself is test framework agnostic.

```js
import test from 'tape-catch';
import test from 'tape-promise/tape';
import {testLayer, testLayerAsync} from '@deck.gl/test-utils';
import {GeoJsonLayer} from '@deck.gl/layers';

Expand Down
4 changes: 2 additions & 2 deletions docs/developer-guide/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Lifecycle test functions are designed to allow for integration with different un
Using [testLayer](/docs/api-reference/test-utils/test-layer.md) util to instantiate a layer and test a series of prop updates:

```js
import test from 'tape-catch';
import test from 'tape-promise/tape';
import {testLayer} from '@deck.gl/test-utils';
import {GeoJsonLayer} from '@deck.gl/layers';

Expand Down Expand Up @@ -54,7 +54,7 @@ test('GeoJsonLayer#tests', t => {
The [generateLayerTests](/docs/api-reference/test-utils/generate-layer-tests.md) utility automatically generates a series of test cases for `testLayers` based on the layer class' default props. It is useful for checking the conformance of a layer class:

```js
import test from 'tape-catch';
import test from 'tape-promise/tape';
import {testLayer, generateLayerTests} from '@deck.gl/test-utils';
import {GeoJsonLayer} from '@deck.gl/layers';

Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/utils/range.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* range (Array)
* + start (Number) - the start index (incl.)
* + end (Number) - the end index (excl.)
Expand Down
2 changes: 1 addition & 1 deletion modules/extensions/src/clip/clip.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ varying float clip_isVisible;

/*
* The fragment-shader version clips pixels at the bounds
* e.g. PolygonLayer - show the part of the polygon that intersect with the bounds
* e.g. PolygonLayer - show the part of the polygon that intersect with the bounds
*/
const shaderModuleFs = {
name: 'clip-fs',
Expand Down
3 changes: 2 additions & 1 deletion modules/jupyter-widget/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const {resolve} = require('path');
const webpack = require('webpack');
const {getOcularConfig} = require('ocular-dev-tools');

const ALIASES = require('ocular-dev-tools/config/ocular.config')({
const ALIASES = getOcularConfig({
aliasMode: 'src',
root: resolve(__dirname, '../..')
}).aliases;
Expand Down
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
"workspaces": [
"modules/*"
],
"resolutions_comments": [
"prettier: ocular bumps prettier to v2 which modifies a lot of source files"
],
"resolutions": {
"acorn": "7.4.1"
"acorn": "7.4.1",
"prettier": "1.14.3"
},
"scripts": {
"bootstrap": "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn && ocular-bootstrap",
Expand Down Expand Up @@ -65,14 +69,15 @@
"gl": "^4.9.0",
"glsl-transpiler": "^1.8.3",
"jsdom": "^15.0.0",
"ocular-dev-tools": "^0.3.1",
"ocular-dev-tools": "1.0.0-alpha.7",
"pre-commit": "^1.2.2",
"pre-push": "^0.1.1",
"raw-loader": "^0.5.1",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-map-gl": "^5.1.0",
"s2-geometry": "^1.2.10",
"tape-catch": "^1.0.6",
"typescript": "^4.2.3"
},
"pre-commit": [
Expand All @@ -81,5 +86,6 @@
],
"engines": {
"node": ">=14"
}
},
"dependencies": {}
}
4 changes: 2 additions & 2 deletions scripts/bundle.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const {resolve} = require('path');
const webpack = require('webpack');

const ALIASES = require('ocular-dev-tools/config/ocular.config')({
const {getOcularConfig} = require('ocular-dev-tools');
const ALIASES = getOcularConfig({
aliasMode: 'src',
root: resolve(__dirname, '..')
}).aliases;
Expand Down
4 changes: 2 additions & 2 deletions scripts/extract-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

// Enables ES2015 import/export in Node.js
require('reify');

const {getOcularConfig} = require('ocular-dev-tools');
const moduleAlias = require('module-alias');
const config = require('ocular-dev-tools/config/ocular.config')({
const config = getOcularConfig({
aliasMode: 'src',
root: resolve(__dirname, '..')
});
Expand Down
2 changes: 1 addition & 1 deletion test/apps/json-layer/json-layer/json-layer.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape-promise/tape';
import {testLayer, testInitializeLayer} from '@deck.gl/test-utils';
import {JSONLayer} from '@deck.gl/json';
import {configuration, JSON_DATA} from '../../../../test/modules/json/deck-json-converter.spec';
Expand Down
2 changes: 1 addition & 1 deletion test/modules/aggregation-layers/aggregation-layer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import test from 'tape-catch';
import test from 'tape-promise/tape';
import AggregationLayer from '@deck.gl/aggregation-layers/aggregation-layer';
import {Layer} from 'deck.gl';
import {DataFilterExtension} from '@deck.gl/extensions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import test from 'tape-catch';
import test from 'tape-promise/tape';

import * as FIXTURES from 'deck.gl-test/data';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape-promise/tape';
import {
getCode,
getVertices,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import test from 'tape-catch';
import test from 'tape-promise/tape';
import {makeSpy} from '@probe.gl/test-utils';

import * as FIXTURES from 'deck.gl-test/data';
Expand Down
2 changes: 1 addition & 1 deletion test/modules/aggregation-layers/gpu-cpu-aggregator.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape-promise/tape';
import {gl} from '@deck.gl/test-utils';
import GPUGridAggregator from '@deck.gl/aggregation-layers/utils/gpu-grid-aggregation/gpu-grid-aggregator';
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape-promise/tape';
// import VS from '@deck.gl/aggregation-layers/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl';
import {getQuantizeScale} from '@deck.gl/aggregation-layers/utils/scale-utils';
import {project32, gouraudLighting, picking} from '@deck.gl/core';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import test from 'tape-catch';
import test from 'tape-promise/tape';
import {Buffer} from '@luma.gl/core';
import {testLayer, testInitializeLayer} from '@deck.gl/test-utils';
import GPUGridCellLayer from '@deck.gl/aggregation-layers/gpu-grid-layer/gpu-grid-cell-layer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import test from 'tape-catch';
import test from 'tape-promise/tape';
import * as FIXTURES from 'deck.gl-test/data';
import {testLayer, generateLayerTests, testInitializeLayer} from '@deck.gl/test-utils';
import {makeSpy} from '@probe.gl/test-utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import test from 'tape-catch';
import test from 'tape-promise/tape';
import GridAggregationLayer from '@deck.gl/aggregation-layers/grid-aggregation-layer';
import GPUGridAggregator from '@deck.gl/aggregation-layers/utils/gpu-grid-aggregation/gpu-grid-aggregator';
import {
Expand Down
2 changes: 1 addition & 1 deletion test/modules/aggregation-layers/grid-aggregator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import test from 'tape-catch';
import test from 'tape-promise/tape';

import * as FIXTURES from 'deck.gl-test/data';

Expand Down
2 changes: 1 addition & 1 deletion test/modules/aggregation-layers/grid-layer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import test from 'tape-catch';
import test from 'tape-promise/tape';
import {testLayer, generateLayerTests} from '@deck.gl/test-utils';
import {GridLayer, _GPUGridAggregator as GPUGridAggregator} from '@deck.gl/aggregation-layers';
import * as FIXTURES from 'deck.gl-test/data';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import test from 'tape-catch';
import test from 'tape-promise/tape';
import {
getBounds,
boundsContain,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
import test from 'tape-catch';
import test from 'tape-promise/tape';
import * as FIXTURES from 'deck.gl-test/data';
import {testLayer, generateLayerTests} from '@deck.gl/test-utils';
import {MapView} from '@deck.gl/core';
Expand Down
2 changes: 1 addition & 1 deletion test/modules/aggregation-layers/hexagon-aggregator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import test from 'tape-catch';
import test from 'tape-promise/tape';
import {WebMercatorViewport} from 'deck.gl';

import * as FIXTURES from 'deck.gl-test/data';
Expand Down
2 changes: 1 addition & 1 deletion test/modules/aggregation-layers/hexagon-layer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import test from 'tape-catch';
import test from 'tape-promise/tape';
import {makeSpy} from '@probe.gl/test-utils';

import * as data from 'deck.gl-test/data';
Expand Down
2 changes: 1 addition & 1 deletion test/modules/aggregation-layers/screen-grid-layer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import test from 'tape-catch';
import test from 'tape-promise/tape';
import * as FIXTURES from 'deck.gl-test/data';
import {testLayer, generateLayerTests} from '@deck.gl/test-utils';
import {ScreenGridLayer} from '@deck.gl/aggregation-layers';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
/* eslint-disable func-style, no-console, max-len */
import test from 'tape-catch';
import test from 'tape-promise/tape';
import {Buffer, Texture2D} from '@luma.gl/core';
import {gl} from '@deck.gl/test-utils';
import ScreenGridCellLayer from '@deck.gl/aggregation-layers/screen-grid-layer/screen-grid-cell-layer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import test from 'tape-catch';
import test from 'tape-promise/tape';

import {
getValueFunc,
Expand Down
2 changes: 1 addition & 1 deletion test/modules/aggregation-layers/utils/bin-sorter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import test from 'tape-catch';
import test from 'tape-promise/tape';
import BinSorter from '@deck.gl/aggregation-layers/utils/bin-sorter';

const mockBins = [
Expand Down
2 changes: 1 addition & 1 deletion test/modules/aggregation-layers/utils/color-utils.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape-promise/tape';
import {colorRangeToFlatArray} from '@deck.gl/aggregation-layers/utils/color-utils';

test('color-utils#colorRangeToFlatArray', t => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape-promise/tape';
import GPUGridAggregator from '@deck.gl/aggregation-layers/utils/gpu-grid-aggregation/gpu-grid-aggregator';

import {gl} from '@deck.gl/test-utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

import test from 'tape-catch';
import test from 'tape-promise/tape';

import {alignToCell} from '@deck.gl/aggregation-layers/utils/grid-aggregation-utils';

Expand Down
2 changes: 1 addition & 1 deletion test/modules/aggregation-layers/utils/scale-utils.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape-promise/tape';
import {
quantizeScale,
getQuantileScale,
Expand Down
2 changes: 1 addition & 1 deletion test/modules/core/controllers/controllers.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape-promise/tape';
import {
MapView,
OrbitView,
Expand Down
2 changes: 1 addition & 1 deletion test/modules/core/controllers/custom-controller.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape-promise/tape';
import {Controller} from '@deck.gl/core';
import ViewState from '@deck.gl/core/controllers/view-state';

Expand Down
2 changes: 1 addition & 1 deletion test/modules/core/controllers/view-states.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape-promise/tape';
import {MapController, OrbitController, FirstPersonController} from '@deck.gl/core';

test('MapViewState', t => {
Expand Down
2 changes: 1 addition & 1 deletion test/modules/core/effects/lighting-effect.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import test from 'tape-catch';
import test from 'tape-promise/tape';
import LightingEffect from '@deck.gl/core/effects/lighting/lighting-effect';
import {_CameraLight as CameraLight, DirectionalLight, PointLight} from '@deck.gl/core';
import {ProgramManager} from '@luma.gl/core';
Expand Down
Loading

0 comments on commit 4a0bc67

Please sign in to comment.