From 03ac19111daa36c2562b8a5de8824bb79d3b5d71 Mon Sep 17 00:00:00 2001 From: gchoqueux Date: Tue, 12 Nov 2024 18:40:49 +0100 Subject: [PATCH] fix(chore): remove package alias for babel. --- .eslintrc.cjs | 6 ++++-- package-lock.json | 6 +++++- packages/Debug/.babelrc | 6 +----- packages/Main/.babelrc.cjs | 7 ------- packages/Main/package.json | 2 +- packages/Widget/.babelrc | 6 +----- packages/Widget/package.json | 4 ++++ 7 files changed, 16 insertions(+), 21 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index fd51e69ebc..e1f28e971f 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,3 +1,5 @@ +const path = require('path'); + module.exports = { // Global ESLint settings @@ -17,8 +19,8 @@ module.exports = { 'import/resolver': { 'babel-module': { alias: { - '@itowns/geodesy': 'packages/Geodesy/src/Main.js', - itowns: 'packages/Main/src/Main.js', + '@itowns/geodesy': path.resolve(__dirname, 'packages/Geodesy/src/Main.js'), + itowns: path.resolve(__dirname, 'packages/Main/src/Main.js'), }, plugins: [ ['module-extension-resolver'], diff --git a/package-lock.json b/package-lock.json index 53818a10ce..fd8426751c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15844,7 +15844,11 @@ }, "packages/Widget": { "version": "2.44.2", - "license": "(CECILL-B OR MIT)" + "license": "(CECILL-B OR MIT)", + "dependencies": { + "@itowns/geodesy": "^2.44.2", + "itowns": "^2.44.2" + } } } } diff --git a/packages/Debug/.babelrc b/packages/Debug/.babelrc index a51025a040..90337692b3 100644 --- a/packages/Debug/.babelrc +++ b/packages/Debug/.babelrc @@ -12,11 +12,7 @@ ["module-resolver", { "cwd": "packagejson", "root": ["./src"], - "extensions": [".js", ".ts", ".tsx"], - "alias": { - "@itowns/geodesy": "../Geodesy/src/Main.js", - "itowns": "../Main/src/Main.js" - } + "extensions": [".js", ".ts", ".tsx"] }], ["babel-plugin-inline-import", { "extensions": [ diff --git a/packages/Main/.babelrc.cjs b/packages/Main/.babelrc.cjs index 31c7def008..06c05b30cb 100644 --- a/packages/Main/.babelrc.cjs +++ b/packages/Main/.babelrc.cjs @@ -1,7 +1,3 @@ -const BABEL_ENV = process.env.BABEL_ENV; - -const alias_itowns_geodesy = `../Geodesy/${BABEL_ENV == 'test' ? 'lib' : 'src'}/Main.js`; - module.exports = (api) => { api.cache(true); return { @@ -19,9 +15,6 @@ module.exports = (api) => { cwd: 'packagejson', root: ['./src'], extensions: [".js", ".ts", ".tsx"], - alias: { - '@itowns/geodesy': alias_itowns_geodesy - } }], ['babel-plugin-inline-import', { extensions: [ diff --git a/packages/Main/package.json b/packages/Main/package.json index d6ed55f133..f928bd1d0d 100644 --- a/packages/Main/package.json +++ b/packages/Main/package.json @@ -10,7 +10,7 @@ "scripts": { "lint": "eslint \"src/**/*.{js,ts,tsx}\" \"test/**/*.js\"", "transpile": "cross-env BABEL_DISABLE_CACHE=1 babel src --out-dir lib", - "test-unit": "cross-env BABEL_ENV=test npm run base-test-unit test/unit", + "test-unit": "npm run base-test-unit test/unit", "base-test-unit": "cross-env BABEL_DISABLE_CACHE=1 mocha --timeout 5000 --file test/unit/bootstrap.js --import=../../config/babel-register/register.mjs", "test-with-coverage": "c8 -n src -r html cross-env npm run test-unit", "test-with-coverage_lcov": "c8 -n src --reporter=lcov cross-env npm run test-unit", diff --git a/packages/Widget/.babelrc b/packages/Widget/.babelrc index a51025a040..90337692b3 100644 --- a/packages/Widget/.babelrc +++ b/packages/Widget/.babelrc @@ -12,11 +12,7 @@ ["module-resolver", { "cwd": "packagejson", "root": ["./src"], - "extensions": [".js", ".ts", ".tsx"], - "alias": { - "@itowns/geodesy": "../Geodesy/src/Main.js", - "itowns": "../Main/src/Main.js" - } + "extensions": [".js", ".ts", ".tsx"] }], ["babel-plugin-inline-import", { "extensions": [ diff --git a/packages/Widget/package.json b/packages/Widget/package.json index a0166fa4b8..f94292d6ca 100644 --- a/packages/Widget/package.json +++ b/packages/Widget/package.json @@ -26,5 +26,9 @@ "bugs": { "url": "https://github.com/itowns/itowns/issues" }, + "dependencies": { + "@itowns/geodesy": "^2.44.2", + "itowns": "^2.44.2" + }, "homepage": "https://itowns.github.io/" }