Skip to content

Commit

Permalink
fix(build): remove @types/ramda from bundled dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
char0n committed Feb 22, 2023
1 parent fdfbbf4 commit 783f1b1
Showing 2 changed files with 27 additions and 6 deletions.
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
20 changes: 16 additions & 4 deletions scripts/overrides.js
Original file line number Diff line number Diff line change
@@ -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;
}
});

0 comments on commit 783f1b1

Please sign in to comment.