Skip to content

Commit

Permalink
remove @rollup/plugin-json
Browse files Browse the repository at this point in the history
This was conflicting with rollup-plugin-import-assert
Add missing json import assertions
  • Loading branch information
rotu committed Dec 11, 2022
1 parent b94bb2e commit 5462b8a
Show file tree
Hide file tree
Showing 22 changed files with 22 additions and 25 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

### 🐞 Bug fixes
- *...Add new stuff here...*
- Remove dependency on `@rollup/plugin-json`, which was in conflict with `rollup-plugin-import-assert`
- Fix `getElevation()` causing uncaught error ([#1650](https://github.com/maplibre/maplibre-gl-js/issues/1650)).
- Add dev version for csp build ([#1730](https://github.com/maplibre/maplibre-gl-js/pull/1730))
- Fix headless benchmark execution especially on VM ([#1732](https://github.com/maplibre/maplibre-gl-js/pull/1732))
Expand Down
2 changes: 0 additions & 2 deletions build/rollup_plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import typescript from '@rollup/plugin-typescript';
import resolve from '@rollup/plugin-node-resolve';
import replace from '@rollup/plugin-replace';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import {terser} from 'rollup-plugin-terser';
import minifyStyleSpec from './rollup_plugin_minify_style_spec';
import strip from '@rollup/plugin-strip';
Expand All @@ -21,7 +20,6 @@ export const nodeResolve = resolve({
export const plugins = (production: boolean): Plugin[] => [
minifyStyleSpec(),
importAssertionsPlugin(),
json(),
// https://github.com/zaach/jison/issues/351
replace({
preventAssignment: true,
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@
"src/",
"postinstall.js"
],
"engines": {
"npm": ">=8.1.0",
"node": ">=16.14.0"
"engines" : {
"npm" : ">=8.1.0",
"node" : ">=16.14.0"
}
}
2 changes: 0 additions & 2 deletions rollup.config.style-spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import path, {dirname} from 'path';
import replace from '@rollup/plugin-replace';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import {fileURLToPath, pathToFileURL} from 'url';
import {RollupOptions} from 'rollup';
import {nodeResolve} from './build/rollup_plugins';
Expand Down Expand Up @@ -49,7 +48,6 @@ const config: RollupOptions[] = [{
}
}),
importAssertionsPlugin(),
json(),
nodeResolve,
typescript(),
commonjs()
Expand Down
2 changes: 1 addition & 1 deletion src/data/bucket/symbol_bucket.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {RGBAImage} from '../../util/image';
import {ImagePosition} from '../../render/image_atlas';
import {IndexedFeature, PopulateParameters} from '../bucket';
import {StyleImage} from '../../style/style_image';
import glyphs from '../../../test/unit/assets/fontstack-glyphs.json';
import glyphs from '../../../test/unit/assets/fontstack-glyphs.json' assert {type: 'json'};
import {StyleGlyph} from '../../style/style_glyph';

// Load a point feature from fixture tile.
Expand Down
2 changes: 1 addition & 1 deletion src/source/vector_tile_source.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Tile from './tile';
import {OverscaledTileID} from './tile_id';
import {Evented} from '../util/evented';
import {RequestManager} from '../util/request_manager';
import fixturesSource from '../../test/unit/assets/source.json';
import fixturesSource from '../../test/unit/assets/source.json' assert {type: 'json'};
import {getMockDispatcher, getWrapDispatcher} from '../util/test/util';
import Map from '../ui/map';

Expand Down
2 changes: 1 addition & 1 deletion src/style-spec/expression/expression.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {createPropertyExpression, Feature, GlobalProperties, StylePropertyExpression} from '../expression';
import definitions from './definitions';
import v8 from '../reference/v8.json';
import v8 from '../reference/v8.json' assert {type: 'json'};
import {StylePropertySpecification} from '../style-spec';
import ParsingError from './parsing_error';

Expand Down
2 changes: 1 addition & 1 deletion src/style-spec/migrate.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import migrate from './migrate';
import * as spec from './style-spec';
import v8 from './reference/v8.json';
import v8 from './reference/v8.json' assert {type: 'json'};
import validate from './validate_style';

describe('migrate', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/style-spec/validate/validate_terrain.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import validateTerrain from './validate_terrain';
import v8 from '../reference/v8.json';
import v8 from '../reference/v8.json' assert {type: 'json'};

describe('Validate Terrain', () => {
test('Should return error in case terrain is not an object', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/style-spec/validate/validate_terrain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ValidationError from '../error/validation_error';
import getType from '../util/get_type';
import validate from './validate';
import type {StyleSpecification, TerrainSpecification} from '../types.g';
import type v8 from '../reference/v8.json';
import v8 from '../reference/v8.json' assert {type: 'json'};

export default function validateTerrain(
options: {value: TerrainSpecification; styleSpec: typeof v8; style: StyleSpecification}
Expand Down
2 changes: 1 addition & 1 deletion src/style-spec/visit.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Reference from './reference/v8.json';
import Reference from './reference/v8.json' assert {type: 'json'};
import type {StylePropertySpecification} from './style-spec';
import type {
StyleSpecification,
Expand Down
2 changes: 1 addition & 1 deletion test/bench/benchmarks/filter_create.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Benchmark from '../lib/benchmark';

import createFilter from '../../../src/style-spec/feature_filter';
import filters from '../data/filters.json';
import filters from '../data/filters.json' assert {type: 'json'};

export default class FilterCreate extends Benchmark {
bench() {
Expand Down
2 changes: 1 addition & 1 deletion test/bench/benchmarks/filter_evaluate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Benchmark from '../lib/benchmark';
import {VectorTile} from '@mapbox/vector-tile';
import Pbf from 'pbf';
import createFilter from '../../../src/style-spec/feature_filter';
import filters from '../data/filters.json';
import filters from '../data/filters.json' assert {type: 'json'};

export default class FilterEvaluate extends Benchmark {
layers: any[];
Expand Down
2 changes: 1 addition & 1 deletion test/bench/benchmarks/layers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import Benchmark from '../lib/benchmark';
import createMap from '../lib/create_map';
import style from '../data/empty.json';
import style from '../data/empty.json' assert {type: 'json'};

const width = 1024;
const height = 768;
Expand Down
2 changes: 1 addition & 1 deletion test/bench/benchmarks/paint_states.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import emptystyle from '../data/empty.json';
import emptystyle from '../data/empty.json' assert {type: 'json'};
import Benchmark from '../lib/benchmark';
import createMap from '../lib/create_map';

Expand Down
2 changes: 1 addition & 1 deletion test/bench/benchmarks/remove_paint_state.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import emptystyle from '../data/empty.json';
import emptystyle from '../data/empty.json' assert {type: 'json'};
import Benchmark from '../lib/benchmark';
import createMap from '../lib/create_map';

Expand Down
2 changes: 1 addition & 1 deletion test/bench/styles/benchmarks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import maplibregl from '../../../src';
import locationsWithTileID from '../lib/locations_with_tile_id';
import styleBenchmarkLocations from '@mapbox/gazetteer/benchmark/style-benchmark-locations.json';
import styleBenchmarkLocations from '@mapbox/gazetteer/benchmark/style-benchmark-locations.json' assert {type: 'json'};
import StyleLayerCreate from '../benchmarks/style_layer_create';
import Validate from '../benchmarks/style_validate';
import Layout from '../benchmarks/layout';
Expand Down
2 changes: 1 addition & 1 deletion test/bench/versions/benchmarks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import maplibregl from '../../../src';
import locationsWithTileID from '../lib/locations_with_tile_id';
import styleBenchmarkLocations from '@mapbox/gazetteer/benchmark/style-benchmark-locations.json';
import styleBenchmarkLocations from '@mapbox/gazetteer/benchmark/style-benchmark-locations.json' assert {type: 'json'};
import Layout from '../benchmarks/layout';
import Placement from '../benchmarks/placement';
import SymbolLayout from '../benchmarks/symbol_layout';
Expand Down
2 changes: 1 addition & 1 deletion test/build/min.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'fs';
import reference from '../../src/style-spec/reference/latest';
import packageJson from '../../package.json';
import packageJson from '../../package.json' assert {type: 'json'};

const minBundle = fs.readFileSync('dist/maplibre-gl.js', 'utf8');

Expand Down
2 changes: 1 addition & 1 deletion test/build/style-spec.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import isBuiltin from 'is-builtin-module';
import * as rollup from 'rollup';
import rollupConfig from '../../rollup.config.style-spec';
import styleSpecPackage from '../../src/style-spec/package.json';
import styleSpecPackage from '../../src/style-spec/package.json' assert {type: 'json'};
import * as spec from '../../dist/style-spec/index.cjs';
import {importAssertions} from 'acorn-import-assertions';
/* eslint-disable import/namespace */
Expand Down
2 changes: 1 addition & 1 deletion test/integration/query/query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// refer build/generate-query-test-fixtures.ts
import {Browser, chromium, Page} from 'playwright';

import fixtures from './dist/fixtures.json';
import fixtures from './dist/fixtures.json' assert {type: 'json'};
import {deepEqual} from '../lib/json-diff';
import st from 'st';
import http from 'http';
Expand Down
2 changes: 1 addition & 1 deletion test/integration/symbol-shaping/shaping.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'path';
import {WritingMode, shapeIcon, shapeText, fitIconToText, PositionedIcon, Shaping} from '../../../src/symbol/shaping';
import Formatted, {FormattedSection} from '../../../src/style-spec/expression/types/formatted';
import ResolvedImage from '../../../src/style-spec/expression/types/resolved_image';
import expectedJson from './tests/text-shaping-linebreak.json';
import expectedJson from './tests/text-shaping-linebreak.json' assert {type: 'json'};
import {ImagePosition} from '../../../src/render/image_atlas';
import {StyleImage} from '../../../src/style/style_image';

Expand Down

0 comments on commit 5462b8a

Please sign in to comment.