From 783f1b12517e0a38431fbb8dc9c9ad9149dce57b Mon Sep 17 00:00:00 2001 From: Vladimir Gorej Date: Wed, 22 Feb 2023 11:03:22 +0100 Subject: [PATCH] fix(build): remove @types/ramda from bundled dependencies --- package.json | 13 +++++++++++-- scripts/overrides.js | 20 ++++++++++++++++---- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 8f67cbf9e..bfc2c36fd 100644 --- a/package.json +++ b/package.json @@ -149,16 +149,25 @@ ".": "npm:-@0.0.1" } }, + "@swagger-api/apidom-json-pointer": { + "@types/ramda": { + ".": "npm:-@0.0.1" + } + }, "@swagger-api/apidom-ns-json-schema-draft-4": { "@types/ramda": { ".": "npm:-@0.0.1" } }, "@swagger-api/apidom-ns-openapi-3-0": { - "@types/ramda": "npm:-@0.0.1" + "@types/ramda": { + ".": "npm:-@0.0.1" + } }, "@swagger-api/apidom-ns-openapi-3-1": { - "@types/ramda": "npm:-@0.0.1" + "@types/ramda": { + ".": "npm:-@0.0.1" + } }, "@swagger-api/apidom-reference": { "@swagger-api/apidom-ns-asyncapi-2": { diff --git a/scripts/overrides.js b/scripts/overrides.js index 887779fcb..6f251d392 100644 --- a/scripts/overrides.js +++ b/scripts/overrides.js @@ -3,12 +3,22 @@ * unnecessary dependencies of ApiDOM from npm bundling. * The mechanism is fully idempotent. * - * Dependencies are only removed when using following override notation: + * Dependencies are removed when using following override notation: * * ``` - * "dep": { - * ".": "dep-override" - * } + * "overrides": { + * "dep": { + * ".": "dep-override" + * } + * } + * ``` + * + * Dependencies are overridden when using following override notation: + * + * ``` + * "overrides": { + * "dep": "dep-override" + * } * ``` */ const fs = require('node:fs'); @@ -38,6 +48,8 @@ const removeDeps = (pckgName, overrides) => { Object.entries(overrides).forEach(([dep, override]) => { if (typeof override === 'object') { delete pckgJSON?.dependencies[dep]; + } else { + pckgJSON.dependencies[dep] = override; } });