From 56d970861424fddd403262bf85d7e1e3572b15e2 Mon Sep 17 00:00:00 2001 From: Phil Pluckthun Date: Mon, 20 Mar 2023 01:24:20 +0000 Subject: [PATCH] fix: Fix missing source contents in sourcemaps --- .changeset/cold-spoons-suffer.md | 5 ++ package.json | 2 +- pnpm-lock.yaml | 96 ++++++++++++++++++++++++++------ scripts/rollup.config.mjs | 15 ++--- 4 files changed, 90 insertions(+), 28 deletions(-) create mode 100644 .changeset/cold-spoons-suffer.md diff --git a/.changeset/cold-spoons-suffer.md b/.changeset/cold-spoons-suffer.md new file mode 100644 index 0000000..94e7d93 --- /dev/null +++ b/.changeset/cold-spoons-suffer.md @@ -0,0 +1,5 @@ +--- +'wonka': patch +--- + +Fix missing source contents in Wonka sourcemaps. diff --git a/package.json b/package.json index 90cd1c3..c6cdd3f 100644 --- a/package.json +++ b/package.json @@ -77,8 +77,8 @@ "@rollup/plugin-buble": "^1.0.1", "@rollup/plugin-commonjs": "^23.0.3", "@rollup/plugin-node-resolve": "^15.0.1", + "@rollup/plugin-sucrase": "^5.0.1", "@rollup/plugin-terser": "^0.1.0", - "@rollup/plugin-typescript": "^10.0.1", "@rollup/pluginutils": "^5.0.2", "@types/zen-observable": "^0.8.3", "@typescript-eslint/eslint-plugin": "^5.45.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fa78842..e1e9cf4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,8 +6,8 @@ specifiers: '@rollup/plugin-buble': ^1.0.1 '@rollup/plugin-commonjs': ^23.0.3 '@rollup/plugin-node-resolve': ^15.0.1 + '@rollup/plugin-sucrase': ^5.0.1 '@rollup/plugin-terser': ^0.1.0 - '@rollup/plugin-typescript': ^10.0.1 '@rollup/pluginutils': ^5.0.2 '@types/zen-observable': ^0.8.3 '@typescript-eslint/eslint-plugin': ^5.45.0 @@ -41,8 +41,8 @@ devDependencies: '@rollup/plugin-buble': 1.0.1_rollup@3.5.1 '@rollup/plugin-commonjs': 23.0.3_rollup@3.5.1 '@rollup/plugin-node-resolve': 15.0.1_rollup@3.5.1 + '@rollup/plugin-sucrase': 5.0.1_rollup@3.5.1 '@rollup/plugin-terser': 0.1.0_rollup@3.5.1 - '@rollup/plugin-typescript': 10.0.1_i353se4wjqegof6rzgogenttmu '@rollup/pluginutils': 5.0.2_rollup@3.5.1 '@types/zen-observable': 0.8.3 '@typescript-eslint/eslint-plugin': 5.45.0_kmw7swegqdzhqtxnpydwp4nxvm @@ -490,37 +490,31 @@ packages: rollup: 3.5.1 dev: true - /@rollup/plugin-terser/0.1.0_rollup@3.5.1: - resolution: {integrity: sha512-N2KK+qUfHX2hBzVzM41UWGLrEmcjVC37spC8R3c9mt3oEDFKh3N2e12/lLp9aVSt86veR0TQiCNQXrm8C6aiUQ==} + /@rollup/plugin-sucrase/5.0.1_rollup@3.5.1: + resolution: {integrity: sha512-3mYe28rR/sUTkV8v10yPCP55TQ/oJkvcxKZBj6NGx9ZfCn9BdBtBL1v1S0TQrcOV4WD3FTHJaI7TbbukALx9wA==} engines: {node: '>=14.0.0'} peerDependencies: - rollup: ^2.x || ^3.x + rollup: ^2.53.1||^3.0.0 peerDependenciesMeta: rollup: optional: true dependencies: + '@rollup/pluginutils': 5.0.2_rollup@3.5.1 rollup: 3.5.1 - terser: 5.16.1 + sucrase: 3.29.0 dev: true - /@rollup/plugin-typescript/10.0.1_i353se4wjqegof6rzgogenttmu: - resolution: {integrity: sha512-wBykxRLlX7EzL8BmUqMqk5zpx2onnmRMSw/l9M1sVfkJvdwfxogZQVNUM9gVMJbjRLDR5H6U0OMOrlDGmIV45A==} + /@rollup/plugin-terser/0.1.0_rollup@3.5.1: + resolution: {integrity: sha512-N2KK+qUfHX2hBzVzM41UWGLrEmcjVC37spC8R3c9mt3oEDFKh3N2e12/lLp9aVSt86veR0TQiCNQXrm8C6aiUQ==} engines: {node: '>=14.0.0'} peerDependencies: - rollup: ^2.14.0||^3.0.0 - tslib: '*' - typescript: '>=3.7.0' + rollup: ^2.x || ^3.x peerDependenciesMeta: rollup: optional: true - tslib: - optional: true dependencies: - '@rollup/pluginutils': 5.0.2_rollup@3.5.1 - resolve: 1.22.1 rollup: 3.5.1 - tslib: 2.4.1 - typescript: 4.9.5 + terser: 5.16.1 dev: true /@rollup/pluginutils/5.0.2_rollup@3.5.1: @@ -833,6 +827,10 @@ packages: engines: {node: '>=12'} dev: true + /any-promise/1.3.0: + resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} + dev: true + /argparse/1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: @@ -1107,6 +1105,11 @@ packages: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} dev: true + /commander/4.1.1: + resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} + engines: {node: '>= 6'} + dev: true + /commander/6.2.1: resolution: {integrity: sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==} engines: {node: '>= 6'} @@ -1956,6 +1959,17 @@ packages: is-glob: 4.0.3 dev: true + /glob/7.1.6: + resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + /glob/7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} dependencies: @@ -2622,6 +2636,14 @@ packages: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true + /mz/2.7.0: + resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + dependencies: + any-promise: 1.3.0 + object-assign: 4.1.1 + thenify-all: 1.6.0 + dev: true + /nanoid/3.3.4: resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -2689,6 +2711,11 @@ packages: path-key: 4.0.0 dev: true + /object-assign/4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + dev: true + /object-inspect/1.12.2: resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==} dev: true @@ -2907,6 +2934,11 @@ packages: engines: {node: '>=6'} dev: true + /pirates/4.0.5: + resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==} + engines: {node: '>= 6'} + dev: true + /pkg-dir/4.2.0: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} @@ -3482,6 +3514,19 @@ packages: acorn: 8.8.1 dev: true + /sucrase/3.29.0: + resolution: {integrity: sha512-bZPAuGA5SdFHuzqIhTAqt9fvNEo9rESqXIG3oiKdF8K4UmkQxC4KlNL3lVyAErXp+mPvUqZ5l13qx6TrDIGf3A==} + engines: {node: '>=8'} + hasBin: true + dependencies: + commander: 4.1.1 + glob: 7.1.6 + lines-and-columns: 1.2.4 + mz: 2.7.0 + pirates: 4.0.5 + ts-interface-checker: 0.1.13 + dev: true + /supports-color/5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -3521,6 +3566,19 @@ packages: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true + /thenify-all/1.6.0: + resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} + engines: {node: '>=0.8'} + dependencies: + thenify: 3.3.1 + dev: true + + /thenify/3.3.1: + resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + dependencies: + any-promise: 1.3.0 + dev: true + /through/2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} dev: true @@ -3562,6 +3620,10 @@ packages: engines: {node: '>=8'} dev: true + /ts-interface-checker/0.1.13: + resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + dev: true + /tslib/1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true diff --git a/scripts/rollup.config.mjs b/scripts/rollup.config.mjs index 644eaf7..4a6253f 100644 --- a/scripts/rollup.config.mjs +++ b/scripts/rollup.config.mjs @@ -1,6 +1,6 @@ import commonjs from '@rollup/plugin-commonjs'; import resolve from '@rollup/plugin-node-resolve'; -import typescript from '@rollup/plugin-typescript'; +import sucrase from '@rollup/plugin-sucrase'; import buble from '@rollup/plugin-buble'; import terser from '@rollup/plugin-terser'; import cjsCheck from 'rollup-plugin-cjs-check'; @@ -22,15 +22,9 @@ const commonPlugins = [ extensions: ['.mjs', '.js', '.ts'], }), - typescript({ - exclude: ['src/**/*.test.ts', '**/__tests__/*'], - compilerOptions: { - sourceMap: true, - sourceRoot: './', - noEmit: false, - declaration: false, - target: 'esnext', - }, + sucrase({ + exclude: ['node_modules/**'], + transforms: ['typescript'] }), ]; @@ -102,6 +96,7 @@ const output = format => { dir: './dist', exports: 'named', sourcemap: true, + sourcemapExcludeSources: false, indent: false, freeze: false, strict: false,