Skip to content

Commit

Permalink
Fix type generation error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgallardo committed Sep 2, 2022
1 parent a2e97b8 commit 475c1b2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 26 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Type definition generation errors now stop the package compilation process.

## [0.0.2] - 2021-11-02

- Initial version
12 changes: 5 additions & 7 deletions getRollupConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ const { babel } = require('@rollup/plugin-babel');
const image = require('@rollup/plugin-image');
const ignoreImport = require('rollup-plugin-ignore-import');
const path = require('path');
const tsc = require('node-typescript-compiler');
const json = require('@rollup/plugin-json');

const compileTypings = (cwd) => () => {
return tsc.compile({
project: cwd,
emitDeclarationOnly: true,
const typeDefinitions = (dirname) =>
command(`tsc --project ${dirname}/tsconfig.json --emitDeclarationOnly`, {
exitOnFail: true,
wait: true,
});
};

module.exports = (dirname) => {
const pkgPath = path.join(dirname, 'package.json');
Expand All @@ -40,7 +38,7 @@ module.exports = (dirname) => {
return external.includes(namespace);
},
plugins: [
command(compileTypings(dirname), { exitOnFail: true, wait: true }),
typeDefinitions(dirname),
resolve({ extensions }),
commonjs(),
babel({
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"@rollup/plugin-node-resolve": "^13.0.0",
"cross-spawn": "^7.0.3",
"minimist": "^1.2.5",
"node-typescript-compiler": "^3.0.0",
"rollup": "^2.41.4",
"rollup-plugin-command": "^1.1.3",
"rollup-plugin-ignore-import": "^1.3.2",
Expand Down
21 changes: 3 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,7 @@ core-js-pure@^3.19.0:
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.19.3.tgz#c69b2b36b58927317824994b532ec3f0f7e49607"
integrity sha512-N3JruInmCyt7EJj5mAq3csCgGYgiSqu7p7TQp2KOztr180/OAIxyIvL1FCjzgmQk/t3Yniua50Fsak7FShI9lA==

cross-spawn@^7, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
cross-spawn@^7.0.2, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
Expand Down Expand Up @@ -2817,7 +2817,7 @@ lodash.merge@^4.6.2:
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==

lodash@^4, lodash@^4.11.2, lodash@^4.17.10, lodash@^4.17.19, lodash@^4.17.21:
lodash@^4.11.2, lodash@^4.17.10, lodash@^4.17.19, lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
Expand Down Expand Up @@ -2915,16 +2915,6 @@ node-releases@^2.0.1:
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5"
integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==

node-typescript-compiler@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/node-typescript-compiler/-/node-typescript-compiler-3.0.0.tgz#f6ed772eb3f1b890fb7896348d63ab5a2e8d6e7d"
integrity sha512-b3sE88wRNdVW2bNa51ASzh97sAf/P/p1ArTybW/rBWL7QBKv9y4amv5EodKXUe2sL9bDatNqZIkD66AlwksfjA==
dependencies:
cross-spawn "^7"
lodash "^4"
path-exists "^4"
tildify "^2"

object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
Expand Down Expand Up @@ -3089,7 +3079,7 @@ path-exists@^3.0.0:
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=

path-exists@^4, path-exists@^4.0.0:
path-exists@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
Expand Down Expand Up @@ -3531,11 +3521,6 @@ through@^2.3.6:
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=

tildify@^2:
version "2.0.0"
resolved "https://registry.yarnpkg.com/tildify/-/tildify-2.0.0.tgz#f205f3674d677ce698b7067a99e949ce03b4754a"
integrity sha512-Cc+OraorugtXNfs50hU9KS369rFXCfgGLpfCfvlc+Ud5u6VWmUQsOAa9HbTvheQdYnrdJqqv1e5oIqXppMYnSw==

tiny-glob@^0.2.9:
version "0.2.9"
resolved "https://registry.yarnpkg.com/tiny-glob/-/tiny-glob-0.2.9.tgz#2212d441ac17928033b110f8b3640683129d31e2"
Expand Down

0 comments on commit 475c1b2

Please sign in to comment.