Skip to content

Commit 22765d7

Browse files
committed
fix(npm-scripts): bundle TypeScript dependencies
As reported here: #91 (comment) Our use of the `@typescript-eslint/parser` (since 50a4d99) means that we have a runtime dependency on `typescript` package. This worked fine in liferay-portal, where `typescript` is already present, but not in liferay-learn, where it is not. And I didn't know that `@typescript-eslint/parser` doesn't actually declare all of its transitive dependencies; as noted in: #113 `@typescript-eslint/typescript-estree` does an unguarded `import` of `typescript` even though it is not declared in its dependencies (they declare it as an optional peer dependency). So, let's not only fix this, by explicitly declaring our dependency on TypeScript, but also declare all of our TS-related dependencies. This will allow us to delete the devDependencies currently declared here: https://github.com/liferay/liferay-portal/blob/f1a2b2ce06fa050d5e1ab193728ab9ec06df4315/modules/apps/remote-app/remote-app-client-js/package.json#L3-L6
1 parent 6f94843 commit 22765d7

File tree

3 files changed

+56
-9
lines changed

3 files changed

+56
-9
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"eslint": "7.10.0",
1111
"jest": "26.4.2",
1212
"prettier": "2.1.2",
13-
"typescript": "4.0.3"
13+
"typescript": "^4.0.3"
1414
},
1515
"license": "See LICENSE.md",
1616
"main": "index.js",

projects/npm-tools/packages/npm-scripts/package.json

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
1414
"@babel/preset-env": "^7.4.2",
1515
"@babel/preset-react": "^7.8.3",
16+
"@babel/preset-typescript": "^7.10.4",
1617
"@liferay/eslint-config": "21.2.0",
1718
"@liferay/jest-junit-reporter": "1.2.0",
1819
"@liferay/npm-bundler-preset-liferay-dev": "4.6.3",
@@ -27,6 +28,7 @@
2728
"@testing-library/react": "^8.0.9",
2829
"@testing-library/react-hooks": "^3.4.2",
2930
"@testing-library/user-event": "^4.2.4",
31+
"@types/jest": "^26.0.14",
3032
"babel-eslint": "^10.0.3",
3133
"babel-jest": "^25.1.0",
3234
"babel-loader": "^8.1.0",
@@ -64,6 +66,8 @@
6466
"style-ext-html-webpack-plugin": "4.1.2",
6567
"style-loader": "^1.1.3",
6668
"stylelint": "^13.2.0",
69+
"ts-loader": "^8.0.4",
70+
"typescript": "^4.0.3",
6771
"webpack": "^4.39.1",
6872
"webpack-cli": "^3.3.6",
6973
"webpack-dev-server": "^3.7.2"

yarn.lock

+51-8
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
levenary "^1.1.1"
116116
semver "^5.5.0"
117117

118-
"@babel/helper-create-class-features-plugin@^7.10.4":
118+
"@babel/helper-create-class-features-plugin@^7.10.4", "@babel/helper-create-class-features-plugin@^7.10.5":
119119
version "7.10.5"
120120
resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.5.tgz#9f61446ba80e8240b0a5c85c6fdac8459d6f259d"
121121
integrity sha512-0nkdeijB7VlZoLT3r/mY3bUkw3T8WG/hNw+FATs/6+pG2039IJWjTYL0VTISqsNHMUTEnwbVnc89WIJX9Qed0A==
@@ -520,6 +520,13 @@
520520
dependencies:
521521
"@babel/helper-plugin-utils" "^7.10.4"
522522

523+
"@babel/plugin-syntax-typescript@^7.10.4":
524+
version "7.10.4"
525+
resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.10.4.tgz#2f55e770d3501e83af217d782cb7517d7bb34d25"
526+
integrity sha512-oSAEz1YkBCAKr5Yiq8/BNtvSAPwkp/IyUnwZogd8p+F0RuYQQrLeRUzIQhueQTTBy/F+a40uS7OFKxnkRvmvFQ==
527+
dependencies:
528+
"@babel/helper-plugin-utils" "^7.10.4"
529+
523530
"@babel/plugin-transform-arrow-functions@^7.10.4":
524531
version "7.10.4"
525532
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.10.4.tgz#e22960d77e697c74f41c501d44d73dbf8a6a64cd"
@@ -821,6 +828,15 @@
821828
dependencies:
822829
"@babel/helper-plugin-utils" "^7.10.4"
823830

831+
"@babel/plugin-transform-typescript@^7.10.4":
832+
version "7.11.0"
833+
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.11.0.tgz#2b4879676af37342ebb278216dd090ac67f13abb"
834+
integrity sha512-edJsNzTtvb3MaXQwj8403B7mZoGu9ElDJQZOKjGUnvilquxBA3IQoEIOvkX/1O8xfAsnHS/oQhe2w/IXrr+w0w==
835+
dependencies:
836+
"@babel/helper-create-class-features-plugin" "^7.10.5"
837+
"@babel/helper-plugin-utils" "^7.10.4"
838+
"@babel/plugin-syntax-typescript" "^7.10.4"
839+
824840
"@babel/plugin-transform-unicode-escapes@^7.10.4":
825841
version "7.10.4"
826842
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.10.4.tgz#feae523391c7651ddac115dae0a9d06857892007"
@@ -942,6 +958,14 @@
942958
"@babel/plugin-transform-react-jsx-source" "^7.10.4"
943959
"@babel/plugin-transform-react-pure-annotations" "^7.10.4"
944960

961+
"@babel/preset-typescript@^7.10.4":
962+
version "7.10.4"
963+
resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.10.4.tgz#7d5d052e52a682480d6e2cc5aa31be61c8c25e36"
964+
integrity sha512-SdYnvGPv+bLlwkF2VkJnaX/ni1sMNetcGI1+nThF1gyv6Ph8Qucc4ZZAjM5yZcE/AKRXIOTZz7eSRDWOEjPyRQ==
965+
dependencies:
966+
"@babel/helper-plugin-utils" "^7.10.4"
967+
"@babel/plugin-transform-typescript" "^7.10.4"
968+
945969
"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.3.1", "@babel/runtime@^7.4.4", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.1", "@babel/runtime@^7.5.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.7.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
946970
version "7.11.2"
947971
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.11.2.tgz#f549c13c754cc40b87644b9fa9f09a6a95fe0736"
@@ -2543,6 +2567,14 @@
25432567
dependencies:
25442568
"@types/istanbul-lib-report" "*"
25452569

2570+
"@types/jest@^26.0.14":
2571+
version "26.0.14"
2572+
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-26.0.14.tgz#078695f8f65cb55c5a98450d65083b2b73e5a3f3"
2573+
integrity sha512-Hz5q8Vu0D288x3iWXePSn53W7hAjP0H7EQ6QvDO9c7t46mR0lNOLlfuwQ+JkVxuhygHzlzPX+0jKdA3ZgSh+Vg==
2574+
dependencies:
2575+
jest-diff "^25.2.1"
2576+
pretty-format "^25.2.1"
2577+
25462578
"@types/json-schema@^7.0.3", "@types/json-schema@^7.0.5":
25472579
version "7.0.6"
25482580
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.6.tgz#f4c7ec43e81b319a9815115031709f26987891f0"
@@ -4774,7 +4806,7 @@ ccount@^1.0.0:
47744806
resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.5.tgz#ac82a944905a65ce204eb03023157edf29425c17"
47754807
integrity sha512-MOli1W+nfbPLlKEhInaxhRdp7KVLFxLN5ykwzHgLsLI3H3gs5jjFAK4Eoj3OzzcxCtumDaI8onoVDeQyWaNTkw==
47764808

4777-
[email protected], chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.1, chalk@^2.4.2:
4809+
[email protected], chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2:
47784810
version "2.4.2"
47794811
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
47804812
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
@@ -6295,7 +6327,7 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0:
62956327
dependencies:
62966328
once "^1.4.0"
62976329

6298-
enhanced-resolve@^4.1.1, enhanced-resolve@^4.3.0:
6330+
enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.1, enhanced-resolve@^4.3.0:
62996331
version "4.3.0"
63006332
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.3.0.tgz#3b806f3bfafc1ec7de69551ef93cca46c1704126"
63016333
integrity sha512-3e87LvavsdxyoCfGusJnrZ5G8SLPOFeHSNpZI/ATL9a5leXo2k0w6MKnbqhdBad9qTobSfB20Ld7UmgoNbAZkQ==
@@ -9541,7 +9573,7 @@ jest-diff@^24.0.0, jest-diff@^24.9.0:
95419573
jest-get-type "^24.9.0"
95429574
pretty-format "^24.9.0"
95439575

9544-
jest-diff@^25.5.0:
9576+
jest-diff@^25.2.1, jest-diff@^25.5.0:
95459577
version "25.5.0"
95469578
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-25.5.0.tgz#1dd26ed64f96667c068cef026b677dfa01afcfa9"
95479579
integrity sha512-z1kygetuPiREYdNIumRpAHY6RXiGmp70YHptjdaxTWGmA085W3iCnXNx0DhflK3vwrKmrRWyY1wUpkPMVxMK7A==
@@ -10869,7 +10901,7 @@ [email protected]:
1086910901
emojis-list "^2.0.0"
1087010902
json5 "^1.0.1"
1087110903

10872-
loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4.0:
10904+
loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.3, loader-utils@^1.4.0:
1087310905
version "1.4.0"
1087410906
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613"
1087510907
integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==
@@ -11465,7 +11497,7 @@ micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4:
1146511497
snapdragon "^0.8.1"
1146611498
to-regex "^3.0.2"
1146711499

11468-
micromatch@^4.0.2:
11500+
micromatch@^4.0.0, micromatch@^4.0.2:
1146911501
version "4.0.2"
1147011502
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259"
1147111503
integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==
@@ -13042,7 +13074,7 @@ pretty-format@^24.0.0, pretty-format@^24.8.0, pretty-format@^24.9.0:
1304213074
ansi-styles "^3.2.0"
1304313075
react-is "^16.8.4"
1304413076

13045-
pretty-format@^25.5.0:
13077+
pretty-format@^25.2.1, pretty-format@^25.5.0:
1304613078
version "25.5.0"
1304713079
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-25.5.0.tgz#7873c1d774f682c34b8d48b6743a2bf2ac55791a"
1304813080
integrity sha512-kbo/kq2LQ/A/is0PQwsEHM7Ca6//bGPPvU6UnsdDRSKTWxT/ru/xb88v4BJf6a69H+uTytOEsTusT9ksd/1iWQ==
@@ -15926,6 +15958,17 @@ ts-dedent@^1.1.0:
1592615958
resolved "https://registry.yarnpkg.com/ts-dedent/-/ts-dedent-1.1.1.tgz#68fad040d7dbd53a90f545b450702340e17d18f3"
1592715959
integrity sha512-UGTRZu1evMw4uTPyYF66/KFd22XiU+jMaIuHrkIHQ2GivAXVlLV0v/vHrpOuTRf9BmpNHi/SO7Vd0rLu0y57jg==
1592815960

15961+
ts-loader@^8.0.4:
15962+
version "8.0.4"
15963+
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-8.0.4.tgz#02b9c91fbcfdb3114d8b1e98a3829265270eee7a"
15964+
integrity sha512-5u8KF1SW8eCUb/Ff7At81e3wznPmT/27fvaGRO9CziVy+6NlPVRvrzSox4OwU0/e6OflOUB32Err4VquysCSAQ==
15965+
dependencies:
15966+
chalk "^2.3.0"
15967+
enhanced-resolve "^4.0.0"
15968+
loader-utils "^1.0.2"
15969+
micromatch "^4.0.0"
15970+
semver "^6.0.0"
15971+
1592915972
ts-pnp@^1.1.2:
1593015973
version "1.2.0"
1593115974
resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92"
@@ -16039,7 +16082,7 @@ typedarray@^0.0.6:
1603916082
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
1604016083
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
1604116084

16042-
typescript@*, typescript@4.0.3:
16085+
typescript@^4.0.3:
1604316086
version "4.0.3"
1604416087
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.3.tgz#153bbd468ef07725c1df9c77e8b453f8d36abba5"
1604516088
integrity sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg==

0 commit comments

Comments
 (0)