Skip to content

Commit

Permalink
feat(typescript): Absolute to relative path transform
Browse files Browse the repository at this point in the history
Workaround microsoft/TypeScript#15479 to generate definitions with
relative imports. Use `ts-patch` to patch the `tsc` binary.
  • Loading branch information
Desplandis committed Feb 25, 2023
1 parent 7eb101b commit 9d17f14
Show file tree
Hide file tree
Showing 3 changed files with 277 additions and 12 deletions.
271 changes: 263 additions & 8 deletions package-lock.json

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

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"start-https": "cross-env NODE_ENV=development webpack serve --https",
"debug": "cross-env noInline=true npm start",
"prepublishOnly": "npm run build && npm run transpile",
"prepare": "cross-env NO_UPDATE_NOTIFIER=true node ./config/prepare.mjs && node ./config/replace.config.mjs",
"prepare": "cross-env NO_UPDATE_NOTIFIER=true node ./config/prepare.mjs && node ./config/replace.config.mjs && ts-patch install -s",
"watch": "cross-env BABEL_DISABLE_CACHE=1 babel --watch src --out-dir lib",
"changelog": "conventional-changelog -n ./config/conventionalChangelog/config.js -i changelog.md -s",
"bump": "if [ -z $npm_config_level ]; then grunt bump:minor; else grunt bump:$npm_config_level; fi && npm run changelog && git add -A && git commit --amend --no-edit",
Expand Down Expand Up @@ -59,8 +59,8 @@
"@mapbox/mapbox-gl-style-spec": "^13.24.0",
"@mapbox/vector-tile": "^1.3.1",
"@tmcw/togeojson": "^5.1.3",
"@types/three": "^0.146.0",
"@tweenjs/tween.js": "^18.6.4",
"@types/three": "^0.146.0",
"earcut": "^2.2.3",
"js-priority-queue": "^0.1.5",
"pbf": "^3.2.1",
Expand Down Expand Up @@ -110,7 +110,9 @@
"q": "^1.5.1",
"replace-in-file": "^6.3.2",
"three": "0.146.0",
"ts-patch": "^2.1.0",
"typescript": "^4.9.5",
"typescript-transform-paths": "^3.4.6",
"url-polyfill": "^1.1.12",
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2",
Expand Down
12 changes: 10 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/* Modules */
"baseUrl": ".",
"paths": {
"*": [ "node_modules/*", "src/*" ]
"*": [ "src/*" ]
},
/* Emit */
"declaration": true,
Expand All @@ -23,6 +23,14 @@
/* Language and Environment */
"target": "esnext",
/* Completeness */
"skipLibCheck": true
"skipLibCheck": true,
/* Plugins */
"plugins": [
{
"transform": "typescript-transform-paths",
"afterDeclarations": true,
"exclude": [ "**/node_modules/**" ]
}
]
}
}

0 comments on commit 9d17f14

Please sign in to comment.