From 9ae11aaf5724b56a09206309de68a0e0ea097ee7 Mon Sep 17 00:00:00 2001 From: Kevin Fabre Date: Wed, 3 Jul 2024 14:05:27 +0200 Subject: [PATCH] Revert "chore: add path aliases" This reverts commit f24f939ad6a953924473c5e72d9182cde9428593. --- package-lock.json | 70 ------------------- packages/visualizations/.eslintrc.js | 5 -- packages/visualizations/package.json | 2 - packages/visualizations/rollup.config.js | 10 --- .../src/components/Chart/Chart.svelte | 15 ++-- .../src/components/Chart/datasets.ts | 4 +- .../src/components/Chart/legend.ts | 4 +- .../src/components/Chart/scales.ts | 2 +- .../src/components/Chart/types.ts | 6 +- .../src/components/Chart/utils.ts | 2 +- .../WebGl/ChoroplethGeoJson.svelte | 2 +- .../WebGl/ChoroplethVectorTiles.svelte | 2 +- .../ChoroplethMap/WebGl/MapRender.svelte | 12 ++-- .../src/components/ChoroplethMap/types.ts | 4 +- .../src/components/ChoroplethMap/utils.ts | 2 +- .../src/components/KpiCard/KpiCard.svelte | 6 +- .../src/components/KpiCard/types.ts | 4 +- .../src/components/Legend/ColorsLegend.svelte | 4 +- .../src/components/Legend/types.ts | 2 +- .../src/components/Map/Poi/Poi.svelte | 4 +- .../src/components/Map/Poi/types.ts | 6 +- .../src/components/Map/WebGl/WebGl.svelte | 2 +- .../src/components/Map/WebGl/constants.ts | 2 +- .../src/components/Map/WebGl/types.ts | 2 +- .../src/components/Map/WebGl/utils.ts | 2 +- .../src/components/MarkdownText/types.ts | 2 +- .../Table/Cell/Format/GeoFormat.svelte | 6 +- .../src/components/Table/Table.svelte | 4 +- .../src/components/Table/TableCard.svelte | 4 +- .../src/components/Table/types.ts | 6 +- .../src/components/utils/Card.svelte | 2 +- .../src/components/utils/MiniMap.svelte | 6 +- .../src/components/utils/SourceLink.svelte | 2 +- packages/visualizations/src/index.ts | 34 ++++----- packages/visualizations/tsconfig.json | 8 +-- 35 files changed, 77 insertions(+), 173 deletions(-) diff --git a/package-lock.json b/package-lock.json index 000b6c390..f7fc68ab5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12823,53 +12823,6 @@ "ms": "^2.1.1" } }, - "node_modules/eslint-import-resolver-typescript": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz", - "integrity": "sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==", - "dev": true, - "dependencies": { - "debug": "^4.3.4", - "enhanced-resolve": "^5.12.0", - "eslint-module-utils": "^2.7.4", - "fast-glob": "^3.3.1", - "get-tsconfig": "^4.5.0", - "is-core-module": "^2.11.0", - "is-glob": "^4.0.3" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" - }, - "peerDependencies": { - "eslint": "*", - "eslint-plugin-import": "*" - } - }, - "node_modules/eslint-import-resolver-typescript/node_modules/enhanced-resolve": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz", - "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/eslint-import-resolver-typescript/node_modules/tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/eslint-module-utils": { "version": "2.8.1", "dev": true, @@ -14748,18 +14701,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/get-tsconfig": { - "version": "4.7.5", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.5.tgz", - "integrity": "sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw==", - "dev": true, - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, "node_modules/get-value": { "version": "2.0.6", "license": "MIT", @@ -24353,15 +24294,6 @@ "node": ">=8" } }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, "node_modules/resolve-protobuf-schema": { "version": "2.1.0", "license": "MIT", @@ -29235,7 +29167,6 @@ "devDependencies": { "@babel/core": "^7.13.10", "@babel/preset-env": "^7.13.10", - "@rollup/plugin-alias": "^5.1.0", "@rollup/plugin-babel": "^5.3.0", "@rollup/plugin-commonjs": "^19.0.0", "@rollup/plugin-json": "^4.1.0", @@ -29259,7 +29190,6 @@ "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.0.0", "eslint-config-prettier": "^8.3.0", - "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.26.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-svelte": "^2.35.1", diff --git a/packages/visualizations/.eslintrc.js b/packages/visualizations/.eslintrc.js index 32f9d38d0..cf6a20650 100644 --- a/packages/visualizations/.eslintrc.js +++ b/packages/visualizations/.eslintrc.js @@ -3,11 +3,6 @@ module.exports = { browser: true, es2021: true, }, - settings: { - "import/resolver": { - typescript: {} - }, - }, extends: [ 'eslint:recommended', 'plugin:@typescript-eslint/recommended', diff --git a/packages/visualizations/package.json b/packages/visualizations/package.json index b5c2cac4f..7d26041df 100644 --- a/packages/visualizations/package.json +++ b/packages/visualizations/package.json @@ -45,7 +45,6 @@ "devDependencies": { "@babel/core": "^7.13.10", "@babel/preset-env": "^7.13.10", - "@rollup/plugin-alias": "^5.1.0", "@rollup/plugin-babel": "^5.3.0", "@rollup/plugin-commonjs": "^19.0.0", "@rollup/plugin-json": "^4.1.0", @@ -69,7 +68,6 @@ "eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-typescript": "^17.0.0", "eslint-config-prettier": "^8.3.0", - "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.26.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-svelte": "^2.35.1", diff --git a/packages/visualizations/rollup.config.js b/packages/visualizations/rollup.config.js index 50cb1a822..4b97dde0f 100644 --- a/packages/visualizations/rollup.config.js +++ b/packages/visualizations/rollup.config.js @@ -2,7 +2,6 @@ import svelte from 'rollup-plugin-svelte'; import autoPreprocess from 'svelte-preprocess'; import postcss from 'rollup-plugin-postcss'; import autoprefixer from 'autoprefixer'; -import path from 'path'; // import visualizer from 'rollup-plugin-visualizer'; import { terser } from 'rollup-plugin-terser'; import typescript from '@rollup/plugin-typescript'; @@ -11,22 +10,13 @@ import commonjs from '@rollup/plugin-commonjs'; import json from '@rollup/plugin-json'; import { babel } from '@rollup/plugin-babel'; import replace from '@rollup/plugin-replace'; -import alias from '@rollup/plugin-alias'; import { defineConfig } from 'rollup'; import pkg from './package.json'; const production = !process.env.ROLLUP_WATCH; -const projectRootDir = path.resolve(__dirname); function basePlugins() { return [ - alias({ - entries: { - "components": path.resolve(projectRootDir, 'src/components'), - "stores": path.resolve(projectRootDir, 'src/stores'), - "types": path.resolve(projectRootDir, 'src/types'), - }, - }), svelte({ // enable run-time checks when not in production dev: !production, diff --git a/packages/visualizations/src/components/Chart/Chart.svelte b/packages/visualizations/src/components/Chart/Chart.svelte index 2ec1eba10..4747fc88a 100644 --- a/packages/visualizations/src/components/Chart/Chart.svelte +++ b/packages/visualizations/src/components/Chart/Chart.svelte @@ -3,15 +3,12 @@ import type { ChartConfiguration } from 'chart.js'; import { Chart } from 'chart.js'; import 'chartjs-adapter-luxon'; - import type { DataFrame } from 'components/types'; - import { generateId } from 'components/utils'; - import SourceLink from 'components/utils/SourceLink.svelte'; - import { defaultNumberFormat } from 'components/utils/formatter'; - import CategoryLegend from 'components/Legend/CategoryLegend.svelte'; - import type { - LegendPositions, - CategoryLegend as CategoryLegendType, - } from 'components/Legend/types'; + import type { DataFrame } from '../types'; + import { generateId } from '../utils'; + import SourceLink from '../utils/SourceLink.svelte'; + import { defaultNumberFormat } from '../utils/formatter'; + import CategoryLegend from '../Legend/CategoryLegend.svelte'; + import type { LegendPositions, CategoryLegend as CategoryLegendType } from '../Legend/types'; import { ChartSeriesType } from './types'; import type { ChartProps, diff --git a/packages/visualizations/src/components/Chart/datasets.ts b/packages/visualizations/src/components/Chart/datasets.ts index 0dc1c45a5..e1c5a99af 100644 --- a/packages/visualizations/src/components/Chart/datasets.ts +++ b/packages/visualizations/src/components/Chart/datasets.ts @@ -1,13 +1,13 @@ import type { ChartDataset } from 'chart.js'; import type { Options as DataLabelsOptions } from 'chartjs-plugin-datalabels/types/options'; -import { defaultCompactNumberFormat, assureMaxLength } from 'components/utils/formatter'; -import type { DataFrame } from 'components/types'; import type { ChartSeries, DataLabelsConfiguration, FillConfiguration, ScriptableTreemapContext, } from './types'; +import type { DataFrame } from '../types'; +import { defaultCompactNumberFormat, assureMaxLength } from '../utils/formatter'; import { defaultValue, singleChartJsColor, diff --git a/packages/visualizations/src/components/Chart/legend.ts b/packages/visualizations/src/components/Chart/legend.ts index 1b900eb69..a364162c8 100644 --- a/packages/visualizations/src/components/Chart/legend.ts +++ b/packages/visualizations/src/components/Chart/legend.ts @@ -1,9 +1,9 @@ import type { LegendOptions, ChartConfiguration, Chart } from 'chart.js'; import type { _DeepPartialObject } from 'chart.js/dist/types/utils'; -import { assureMaxLength } from 'components/utils/formatter'; -import { CATEGORY_ITEM_VARIANT } from 'components/Legend/types'; import type { ChartOptions } from './types'; +import { assureMaxLength } from '../utils/formatter'; import { defaultValue, DEFAULT_GREY_COLOR } from './utils'; +import { CATEGORY_ITEM_VARIANT } from '../Legend/types'; const LEGEND_MAX_LENGTH = 50; diff --git a/packages/visualizations/src/components/Chart/scales.ts b/packages/visualizations/src/components/Chart/scales.ts index 064ff4800..18905a20a 100644 --- a/packages/visualizations/src/components/Chart/scales.ts +++ b/packages/visualizations/src/components/Chart/scales.ts @@ -8,7 +8,6 @@ import type { } from 'chart.js'; import { DateTime } from 'luxon'; import type { DeepPartial } from 'chart.js/dist/types/utils'; -import { assureMaxLength, defaultCompactNumberFormat } from 'components/utils/formatter'; import type { CartesianAxisConfiguration, ChartOptions, @@ -17,6 +16,7 @@ import type { TimeCartesianAxisConfiguration, } from './types'; import { defaultValue, singleChartJsColor } from './utils'; +import { assureMaxLength, defaultCompactNumberFormat } from '../utils/formatter'; const TICK_MAX_LENGTH = 40; diff --git a/packages/visualizations/src/components/Chart/types.ts b/packages/visualizations/src/components/Chart/types.ts index 790914671..9c69ce8e0 100644 --- a/packages/visualizations/src/components/Chart/types.ts +++ b/packages/visualizations/src/components/Chart/types.ts @@ -1,6 +1,6 @@ -import type { Async } from 'types'; -import type { Color, DataFrame, Source } from 'components/types'; -import type { LegendConfiguration } from 'components/Legend/types'; +import type { Color, DataFrame, Source } from '../types'; +import type { LegendConfiguration } from '../Legend/types'; +import type { Async } from '../../types'; export interface ChartOptions { /** Specify label column in DataFrame (mandatory for all charts except Treemap) */ diff --git a/packages/visualizations/src/components/Chart/utils.ts b/packages/visualizations/src/components/Chart/utils.ts index fa9259596..cb93ea0e8 100644 --- a/packages/visualizations/src/components/Chart/utils.ts +++ b/packages/visualizations/src/components/Chart/utils.ts @@ -1,4 +1,4 @@ -import type { Color } from 'components/types'; +import type { Color } from '../types'; export const DEFAULT_GREY_COLOR = '#F0F0F0'; diff --git a/packages/visualizations/src/components/ChoroplethMap/WebGl/ChoroplethGeoJson.svelte b/packages/visualizations/src/components/ChoroplethMap/WebGl/ChoroplethGeoJson.svelte index 4d6c99846..ce049f724 100644 --- a/packages/visualizations/src/components/ChoroplethMap/WebGl/ChoroplethGeoJson.svelte +++ b/packages/visualizations/src/components/ChoroplethMap/WebGl/ChoroplethGeoJson.svelte @@ -3,7 +3,7 @@ import type { ExpressionSpecification, SourceSpecification, GestureOptions } from 'maplibre-gl'; import type { BBox, FeatureCollection } from 'geojson'; import { debounce } from 'lodash'; - import type { ColorScale, DataBounds, Color, Source } from 'components/types'; + import type { ColorScale, DataBounds, Color, Source } from '../../types'; import MapRender from './MapRender.svelte'; import { BLANK } from '../mapStyles'; import { diff --git a/packages/visualizations/src/components/ChoroplethMap/WebGl/ChoroplethVectorTiles.svelte b/packages/visualizations/src/components/ChoroplethMap/WebGl/ChoroplethVectorTiles.svelte index dedb6c0a0..5dbbccf77 100644 --- a/packages/visualizations/src/components/ChoroplethMap/WebGl/ChoroplethVectorTiles.svelte +++ b/packages/visualizations/src/components/ChoroplethMap/WebGl/ChoroplethVectorTiles.svelte @@ -7,7 +7,7 @@ } from 'maplibre-gl'; import type { BBox } from 'geojson'; import { debounce } from 'lodash'; - import type { ColorScale, DataBounds, Color, Source } from 'components/types'; + import type { ColorScale, DataBounds, Color, Source } from '../../types'; import MapRender from './MapRender.svelte'; import { BLANK } from '../mapStyles'; import { diff --git a/packages/visualizations/src/components/ChoroplethMap/WebGl/MapRender.svelte b/packages/visualizations/src/components/ChoroplethMap/WebGl/MapRender.svelte index 14c62ea6e..637c1e7ae 100644 --- a/packages/visualizations/src/components/ChoroplethMap/WebGl/MapRender.svelte +++ b/packages/visualizations/src/components/ChoroplethMap/WebGl/MapRender.svelte @@ -14,13 +14,13 @@ import { onMount } from 'svelte'; import { debounce } from 'lodash'; import type { BBox } from 'geojson'; - import SourceLink from 'components/utils/SourceLink.svelte'; - import ColorsLegend from 'components/Legend/ColorsLegend.svelte'; - import BackButton from 'components/utils/BackButton.svelte'; - import MiniMap from 'components/utils/MiniMap.svelte'; - import type { ColorScale, DataBounds, Source } from 'components/types'; - import type { LegendVariant } from 'components/Legend/types'; + import SourceLink from '../../utils/SourceLink.svelte'; import { computeMaxZoomFromGeoJsonFeatures, getFixedTooltips } from '../utils'; + import ColorsLegend from '../../Legend/ColorsLegend.svelte'; + import BackButton from '../../utils/BackButton.svelte'; + import MiniMap from '../../utils/MiniMap.svelte'; + import type { ColorScale, DataBounds, Source } from '../../types'; + import type { LegendVariant } from '../../Legend/types'; import type { ChoroplethFixedTooltipDescription, MapLayer, diff --git a/packages/visualizations/src/components/ChoroplethMap/types.ts b/packages/visualizations/src/components/ChoroplethMap/types.ts index 42da60259..152c2d05f 100644 --- a/packages/visualizations/src/components/ChoroplethMap/types.ts +++ b/packages/visualizations/src/components/ChoroplethMap/types.ts @@ -1,8 +1,8 @@ import type { Feature, FeatureCollection, Position, BBox } from 'geojson'; import type { FillLayerSpecification, Popup, GestureOptions, LngLatBoundsLike } from 'maplibre-gl'; import type { DebouncedFunc } from 'lodash'; -import type { LegendPositions } from 'components/Legend/types'; -import type { ColorScale, Color, Source } from 'components/types'; +import type { LegendPositions } from '../Legend/types'; +import type { ColorScale, Color, Source } from '../types'; export interface ChoroplethOptions { /** Configuration for the color scale used to color the choropleth shapes. */ diff --git a/packages/visualizations/src/components/ChoroplethMap/utils.ts b/packages/visualizations/src/components/ChoroplethMap/utils.ts index 3ae61f24a..9af44367c 100644 --- a/packages/visualizations/src/components/ChoroplethMap/utils.ts +++ b/packages/visualizations/src/components/ChoroplethMap/utils.ts @@ -4,8 +4,8 @@ import maplibregl, { ExpressionInputType, ExpressionSpecification } from 'maplib import { viewport } from '@placemarkio/geo-viewport'; import type { Feature, FeatureCollection, Position, BBox } from 'geojson'; import type { Scale } from 'chroma-js'; -import { assertUnreachable } from 'components/utils'; import { DEFAULT_COLORS } from './constants'; +import { assertUnreachable } from '../utils'; import { Color, ColorScale, diff --git a/packages/visualizations/src/components/KpiCard/KpiCard.svelte b/packages/visualizations/src/components/KpiCard/KpiCard.svelte index 38b811e31..11b468f73 100644 --- a/packages/visualizations/src/components/KpiCard/KpiCard.svelte +++ b/packages/visualizations/src/components/KpiCard/KpiCard.svelte @@ -1,8 +1,8 @@