feat: add build step to allow for nullish coalescing and optional chaining

This commit is contained in:
Andrew Bastin
2021-12-29 11:15:49 +05:30
parent 07171396ad
commit f8bbf6613f
4 changed files with 68 additions and 84 deletions

View File

@@ -11,6 +11,13 @@ module.exports = {
"^.+\\.js$": "babel-jest",
".*\\.(vue)$": "vue-jest",
},
globals: {
"vue-jest": {
templateCompiler: {
compiler: require("vue-template-babel-compiler"),
},
},
},
setupFilesAfterEnv: ["<rootDir>/jest.setup.js"],
snapshotSerializers: ["jest-serializer-vue"],
collectCoverage: true,

View File

@@ -251,6 +251,11 @@ export default {
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
loaders: {
vue: {
compiler: require("vue-template-babel-compiler"),
},
},
// You can extend webpack config here
extend(config, { isDev, isClient }) {
// Sets webpack's mode to development if `isDev` is true.

View File

@@ -167,6 +167,7 @@
"ts-jest": "^27.1.2",
"typescript": "^4.5.4",
"vue-jest": "^3.0.7",
"vue-template-babel-compiler": "^1.0.8",
"worker-loader": "^3.0.8"
}
}

139
pnpm-lock.yaml generated
View File

@@ -167,6 +167,7 @@ importers:
vue-functional-data-merge: ^3.1.0
vue-github-button: ^1.3.0
vue-jest: ^3.0.7
vue-template-babel-compiler: ^1.0.8
vue-textarea-autosize: ^1.1.1
vue-tippy: ^4.13.0
vuejs-auto-complete: ^0.9.0
@@ -307,6 +308,7 @@ importers:
ts-jest: 27.1.2_ec062b4b172ee90337481ff2b9700ebc
typescript: 4.5.4
vue-jest: 3.0.7_babel-core@7.0.0-bridge.0
vue-template-babel-compiler: 1.0.8
worker-loader: 3.0.8
packages/hoppscotch-data:
@@ -452,7 +454,7 @@ packages:
resolution: {integrity: sha512-kIvCdjZqcdKqoDbVVdt5R99icaRtrtYhYK/xux5qiWCBmfdvEYMFZ68QCrpE5cbFM1JsuArUNs1ZkuKtTtUcZA==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.16.0
'@babel/types': 7.16.7
jsesc: 2.5.2
source-map: 0.5.7
@@ -483,7 +485,7 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0
dependencies:
'@babel/compat-data': 7.16.0
'@babel/compat-data': 7.16.4
'@babel/core': 7.16.7
'@babel/helper-validator-option': 7.16.7
browserslist: 4.17.5
@@ -502,23 +504,6 @@ packages:
browserslist: 4.19.1
semver: 6.3.0
/@babel/helper-create-class-features-plugin/7.16.0_@babel+core@7.16.7:
resolution: {integrity: sha512-XLwWvqEaq19zFlF5PTgOod4bUA+XbkR4WLQBct1bkzmxJGB0ZEJaoKF4c8cgH9oBtCDuYJ8BP5NB9uFiEgO5QA==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0
dependencies:
'@babel/core': 7.16.7
'@babel/helper-annotate-as-pure': 7.16.7
'@babel/helper-function-name': 7.16.7
'@babel/helper-member-expression-to-functions': 7.16.0
'@babel/helper-optimise-call-expression': 7.16.7
'@babel/helper-replace-supers': 7.16.7
'@babel/helper-split-export-declaration': 7.16.7
transitivePeerDependencies:
- supports-color
dev: false
/@babel/helper-create-class-features-plugin/7.16.7_@babel+core@7.16.7:
resolution: {integrity: sha512-kIFozAvVfK05DM4EVQYKK+zteWvY85BFdGBRQBytRyY3y+6PX0DkDOn/CZ3lEuczCfrCxEzwt0YtP/87YPTWSw==}
engines: {node: '>=6.9.0'}
@@ -552,8 +537,8 @@ packages:
'@babel/core': ^7.4.0-0
dependencies:
'@babel/core': 7.16.7
'@babel/helper-compilation-targets': 7.16.0_@babel+core@7.16.7
'@babel/helper-module-imports': 7.16.0
'@babel/helper-compilation-targets': 7.16.7_@babel+core@7.16.7
'@babel/helper-module-imports': 7.16.7
'@babel/helper-plugin-utils': 7.16.7
'@babel/traverse': 7.16.7
debug: 4.3.3
@@ -599,8 +584,7 @@ packages:
dependencies:
'@babel/helper-get-function-arity': 7.16.0
'@babel/template': 7.16.0
'@babel/types': 7.16.0
dev: false
'@babel/types': 7.16.7
/@babel/helper-function-name/7.16.7:
resolution: {integrity: sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==}
@@ -614,8 +598,7 @@ packages:
resolution: {integrity: sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.16.0
dev: false
'@babel/types': 7.16.7
/@babel/helper-get-function-arity/7.16.7:
resolution: {integrity: sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==}
@@ -627,8 +610,7 @@ packages:
resolution: {integrity: sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.16.0
dev: false
'@babel/types': 7.16.7
/@babel/helper-hoist-variables/7.16.7:
resolution: {integrity: sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==}
@@ -636,13 +618,6 @@ packages:
dependencies:
'@babel/types': 7.16.7
/@babel/helper-member-expression-to-functions/7.16.0:
resolution: {integrity: sha512-bsjlBFPuWT6IWhl28EdrQ+gTvSvj5tqVP5Xeftp07SEuz5pLnsXZuDkDD3Rfcxy0IsHmbZ+7B2/9SHzxO0T+sQ==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.16.7
dev: false
/@babel/helper-member-expression-to-functions/7.16.7:
resolution: {integrity: sha512-VtJ/65tYiU/6AbMTDwyoXGPKHgTsfRarivm+YbB5uAzKUyuPjgZSgAFeG87FCigc7KNHu2Pegh1XIT3lXjvz3Q==}
engines: {node: '>=6.9.0'}
@@ -729,8 +704,7 @@ packages:
resolution: {integrity: sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/types': 7.16.0
dev: false
'@babel/types': 7.16.7
/@babel/helper-split-export-declaration/7.16.7:
resolution: {integrity: sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==}
@@ -841,19 +815,6 @@ packages:
transitivePeerDependencies:
- supports-color
/@babel/plugin-proposal-class-properties/7.16.0_@babel+core@7.16.7:
resolution: {integrity: sha512-mCF3HcuZSY9Fcx56Lbn+CGdT44ioBMMvjNVldpKtj8tpniETdLjnxdHI1+sDWXIM1nNt+EanJOZ3IG9lzVjs7A==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.16.7
'@babel/helper-create-class-features-plugin': 7.16.0_@babel+core@7.16.7
'@babel/helper-plugin-utils': 7.16.7
transitivePeerDependencies:
- supports-color
dev: false
/@babel/plugin-proposal-class-properties/7.16.7_@babel+core@7.16.7:
resolution: {integrity: sha512-IobU0Xme31ewjYOShSIqd/ZGM/r/cuOz2z0MDbNrhF5FW+ZVgi0f2lyeoj9KFPDOAqsYxmLWZte1WOwlvY9aww==}
engines: {node: '>=6.9.0'}
@@ -886,7 +847,7 @@ packages:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.16.7
'@babel/helper-create-class-features-plugin': 7.16.0_@babel+core@7.16.7
'@babel/helper-create-class-features-plugin': 7.16.7_@babel+core@7.16.7
'@babel/helper-plugin-utils': 7.16.7
'@babel/plugin-syntax-decorators': 7.16.0_@babel+core@7.16.7
transitivePeerDependencies:
@@ -933,8 +894,8 @@ packages:
'@babel/helper-plugin-utils': 7.16.7
'@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.16.7
/@babel/plugin-proposal-nullish-coalescing-operator/7.16.0_@babel+core@7.16.7:
resolution: {integrity: sha512-3bnHA8CAFm7cG93v8loghDYyQ8r97Qydf63BeYiGgYbjKKB/XP53W15wfRC7dvKfoiJ34f6Rbyyx2btExc8XsQ==}
/@babel/plugin-proposal-nullish-coalescing-operator/7.16.5_@babel+core@7.16.7:
resolution: {integrity: sha512-YwMsTp/oOviSBhrjwi0vzCUycseCYwoXnLiXIL3YNjHSMBHicGTz7GjVU/IGgz4DtOEXBdCNG72pvCX22ehfqg==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
@@ -942,7 +903,6 @@ packages:
'@babel/core': 7.16.7
'@babel/helper-plugin-utils': 7.16.7
'@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.16.7
dev: false
/@babel/plugin-proposal-nullish-coalescing-operator/7.16.7_@babel+core@7.16.7:
resolution: {integrity: sha512-aUOrYU3EVtjf62jQrCj63pYZ7k6vns2h/DQvHPWGmsJRYzWXZ6/AsfgpiRy6XiuIDADhJzP2Q9MwSMKauBQ+UQ==}
@@ -987,8 +947,8 @@ packages:
'@babel/helper-plugin-utils': 7.16.7
'@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.16.7
/@babel/plugin-proposal-optional-chaining/7.16.0_@babel+core@7.16.7:
resolution: {integrity: sha512-Y4rFpkZODfHrVo70Uaj6cC1JJOt3Pp0MdWSwIKtb8z1/lsjl9AmnB7ErRFV+QNGIfcY1Eruc2UMx5KaRnXjMyg==}
/@babel/plugin-proposal-optional-chaining/7.16.5_@babel+core@7.16.7:
resolution: {integrity: sha512-kzdHgnaXRonttiTfKYnSVafbWngPPr2qKw9BWYBESl91W54e+9R5pP70LtWxV56g0f05f/SQrwHYkfvbwcdQ/A==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
@@ -997,7 +957,6 @@ packages:
'@babel/helper-plugin-utils': 7.16.7
'@babel/helper-skip-transparent-expression-wrappers': 7.16.0
'@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.16.7
dev: false
/@babel/plugin-proposal-optional-chaining/7.16.7_@babel+core@7.16.7:
resolution: {integrity: sha512-eC3xy+ZrUcBtP7x+sq62Q/HYd674pPTb/77XZMb5wbDPGWIdUbSr4Agr052+zaUPSb+gGRnjxXfKFvx5iMJ+DA==}
@@ -1010,19 +969,6 @@ packages:
'@babel/helper-skip-transparent-expression-wrappers': 7.16.0
'@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.16.7
/@babel/plugin-proposal-private-methods/7.16.0_@babel+core@7.16.7:
resolution: {integrity: sha512-IvHmcTHDFztQGnn6aWq4t12QaBXTKr1whF/dgp9kz84X6GUcwq9utj7z2wFCUfeOup/QKnOlt2k0zxkGFx9ubg==}
engines: {node: '>=6.9.0'}
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.16.7
'@babel/helper-create-class-features-plugin': 7.16.0_@babel+core@7.16.7
'@babel/helper-plugin-utils': 7.16.7
transitivePeerDependencies:
- supports-color
dev: false
/@babel/plugin-proposal-private-methods/7.16.7_@babel+core@7.16.7:
resolution: {integrity: sha512-7twV3pzhrRxSwHeIvFE6coPgvo+exNDOiGUMg39o2LiLo1Y+4aKpfkcLGcg1UHonzorCt7SNXnoMyCnnIOA8Sw==}
engines: {node: '>=6.9.0'}
@@ -1073,7 +1019,7 @@ packages:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.16.7
'@babel/helper-plugin-utils': 7.16.5
'@babel/helper-plugin-utils': 7.16.7
dev: true
/@babel/plugin-syntax-class-properties/7.12.13_@babel+core@7.16.7:
@@ -1135,7 +1081,7 @@ packages:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.16.7
'@babel/helper-plugin-utils': 7.16.5
'@babel/helper-plugin-utils': 7.16.7
dev: true
/@babel/plugin-syntax-json-strings/7.8.3_@babel+core@7.16.7:
@@ -1547,7 +1493,7 @@ packages:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/core': 7.16.7
'@babel/helper-module-imports': 7.16.0
'@babel/helper-module-imports': 7.16.7
'@babel/helper-plugin-utils': 7.16.7
babel-plugin-polyfill-corejs2: 0.2.3_@babel+core@7.16.7
babel-plugin-polyfill-corejs3: 0.3.0_@babel+core@7.16.7
@@ -1736,15 +1682,21 @@ packages:
dependencies:
'@babel/code-frame': 7.16.0
'@babel/parser': 7.16.6
'@babel/types': 7.16.0
'@babel/types': 7.16.7
/@babel/template/7.16.7:
resolution: {integrity: sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==}
engines: {node: '>=6.9.0'}
dependencies:
'@babel/code-frame': 7.16.7
'@babel/generator': 7.16.5
'@babel/helper-function-name': 7.16.0
'@babel/helper-hoist-variables': 7.16.0
'@babel/helper-split-export-declaration': 7.16.0
'@babel/parser': 7.16.7
'@babel/types': 7.16.7
debug: 4.3.3
globals: 11.12.0
/@babel/traverse/7.16.0:
resolution: {integrity: sha512-qQ84jIs1aRQxaGaxSysII9TuDaguZ5yVrEuC0BN2vcPlalwfLovVmCjbFDPECPXcYM/wLvNFfp8uDOliLxIoUQ==}
@@ -1773,7 +1725,7 @@ packages:
'@babel/helper-hoist-variables': 7.16.7
'@babel/helper-split-export-declaration': 7.16.7
'@babel/parser': 7.16.4
'@babel/types': 7.16.0
'@babel/types': 7.16.7
debug: 4.3.3
globals: 11.12.0
transitivePeerDependencies:
@@ -3571,11 +3523,11 @@ packages:
'@babel/core': 7.16.7
'@babel/helper-compilation-targets': 7.16.0_@babel+core@7.16.7
'@babel/helper-module-imports': 7.16.0
'@babel/plugin-proposal-class-properties': 7.16.0_@babel+core@7.16.7
'@babel/plugin-proposal-class-properties': 7.16.7_@babel+core@7.16.7
'@babel/plugin-proposal-decorators': 7.16.0_@babel+core@7.16.7
'@babel/plugin-proposal-nullish-coalescing-operator': 7.16.0_@babel+core@7.16.7
'@babel/plugin-proposal-optional-chaining': 7.16.0_@babel+core@7.16.7
'@babel/plugin-proposal-private-methods': 7.16.0_@babel+core@7.16.7
'@babel/plugin-proposal-nullish-coalescing-operator': 7.16.5_@babel+core@7.16.7
'@babel/plugin-proposal-optional-chaining': 7.16.5_@babel+core@7.16.7
'@babel/plugin-proposal-private-methods': 7.16.7_@babel+core@7.16.7
'@babel/plugin-transform-runtime': 7.16.0_@babel+core@7.16.7
'@babel/preset-env': 7.16.7_@babel+core@7.16.7
'@babel/runtime': 7.16.3
@@ -4510,20 +4462,20 @@ packages:
/@types/babel__generator/7.6.3:
resolution: {integrity: sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA==}
dependencies:
'@babel/types': 7.16.0
'@babel/types': 7.16.7
dev: true
/@types/babel__template/7.4.1:
resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==}
dependencies:
'@babel/parser': 7.16.6
'@babel/types': 7.16.0
'@babel/types': 7.16.7
dev: true
/@types/babel__traverse/7.14.2:
resolution: {integrity: sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA==}
dependencies:
'@babel/types': 7.16.0
'@babel/types': 7.16.7
dev: true
/@types/body-parser/1.19.1:
@@ -6124,7 +6076,7 @@ packages:
engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
dependencies:
'@babel/template': 7.16.0
'@babel/types': 7.16.0
'@babel/types': 7.16.7
'@types/babel__core': 7.1.17
'@types/babel__traverse': 7.14.2
dev: true
@@ -6134,7 +6086,7 @@ packages:
peerDependencies:
'@babel/core': ^7.0.0-0
dependencies:
'@babel/compat-data': 7.16.0
'@babel/compat-data': 7.16.4
'@babel/core': 7.16.7
'@babel/helper-define-polyfill-provider': 0.2.4_@babel+core@7.16.7
semver: 6.3.0
@@ -6161,7 +6113,7 @@ packages:
dependencies:
'@babel/core': 7.16.7
'@babel/helper-define-polyfill-provider': 0.2.4_@babel+core@7.16.7
core-js-compat: 3.19.0
core-js-compat: 3.20.1
transitivePeerDependencies:
- supports-color
dev: false
@@ -17897,6 +17849,25 @@ packages:
svg-to-vue: 0.7.0
dev: true
/vue-template-babel-compiler/1.0.8:
resolution: {integrity: sha512-V4mgSIep9wJRFKP1t1V+C+wUh1pgcmjxayRldd/KeuU5Sa4oZNEH1MOo+zcB8uugV7G9vIJSeGELBFQmLRgixA==}
engines: {node: '>=12.0.0'}
dependencies:
'@babel/core': 7.16.7
'@babel/plugin-proposal-nullish-coalescing-operator': 7.16.5_@babel+core@7.16.7
'@babel/plugin-proposal-object-rest-spread': 7.16.7_@babel+core@7.16.7
'@babel/plugin-proposal-optional-chaining': 7.16.5_@babel+core@7.16.7
'@babel/plugin-transform-arrow-functions': 7.16.7_@babel+core@7.16.7
'@babel/plugin-transform-block-scoping': 7.16.7_@babel+core@7.16.7
'@babel/plugin-transform-computed-properties': 7.16.7_@babel+core@7.16.7
'@babel/plugin-transform-destructuring': 7.16.7_@babel+core@7.16.7
'@babel/plugin-transform-parameters': 7.16.7_@babel+core@7.16.7
'@babel/plugin-transform-spread': 7.16.7_@babel+core@7.16.7
'@babel/types': 7.16.0
transitivePeerDependencies:
- supports-color
dev: true
/vue-template-compiler/2.6.14:
resolution: {integrity: sha512-ODQS1SyMbjKoO1JBJZojSw6FE4qnh9rIpUZn2EUT86FKizx9uH5z6uXiIrm4/Nb/gwxTi/o17ZDEGWAXHvtC7g==}
dependencies: