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

Remove @rollup/plugin-json #1894

Merged
merged 1 commit into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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`
- Remove dependency on `@mapbox/gazetteer` which caused some build warnings ([#1898](https://github.com/maplibre/maplibre-gl-js/pull/1757)[#1898](https://github.com/maplibre/maplibre-gl-js/pull/1898))
- 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))
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
117 changes: 0 additions & 117 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"@mapbox/mapbox-gl-rtl-text": "^0.2.3",
"@mapbox/mvt-fixtures": "^3.10.0",
"@rollup/plugin-commonjs": "^23.0.3",
"@rollup/plugin-json": "^5.0.2",
"@rollup/plugin-node-resolve": "^15.0.1",
"@rollup/plugin-replace": "^5.0.1",
"@rollup/plugin-strip": "^3.0.1",
Expand All @@ -68,7 +67,6 @@
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@types/request": "^2.48.8",
"@types/rollup-plugin-json": "^3.0.3",
"@types/shuffle-seed": "^1.1.0",
"@types/supercluster": "^7.1.0",
"@types/window-or-global": "^1.0.4",
Expand Down
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 '../data/style-benchmark-locations.json';
import styleBenchmarkLocations from '../data/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 '../data/style-benchmark-locations.json';
import styleBenchmarkLocations from '../data/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