diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 9135cbc0f814..844ac1633815 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -84,9 +84,5 @@ jobs: path: /tmp - name: Unpack published packages run: tar -C /tmp -xf /tmp/verdaccio-workspace.tar - - name: Setup upterm session - uses: lhotari/action-upterm@v1 - with: - limit-access-to-users: nicolo-ribaudo - name: Test run: ./scripts/integration-tests/e2e-${{ matrix.project }}.sh diff --git a/packages/babel-helpers/scripts/build-helper-metadata.js b/packages/babel-helpers/scripts/build-helper-metadata.js index f308c7da1875..0745349809a0 100644 --- a/packages/babel-helpers/scripts/build-helper-metadata.js +++ b/packages/babel-helpers/scripts/build-helper-metadata.js @@ -88,6 +88,12 @@ export function getHelperMetadata(babel, code, helperName) { exportName = name; spansToRemove.push([child.node.start, child.node.end]); child.remove(); + } else if ( + child.isExportNamedDeclaration() && + child.node.specifiers.length === 0 + ) { + spansToRemove.push([child.node.start, child.node.end]); + child.remove(); } else if ( child.isExportAllDeclaration() || child.isExportNamedDeclaration() diff --git a/packages/babel-helpers/scripts/generate-helpers.js b/packages/babel-helpers/scripts/generate-helpers.js index b4f4f585f3ba..5764b3cf4419 100644 --- a/packages/babel-helpers/scripts/generate-helpers.js +++ b/packages/babel-helpers/scripts/generate-helpers.js @@ -97,7 +97,39 @@ const helpers: Record = { /** * @type {import("@babel/core").PluginObj} */ - { + ({ types: t }) => ({ + // These pre/post hooks are needed because the TS transform is, + // when building in the old Babel e2e test, removing the + // `export { OverloadYield as default }` in the OverloadYield helper. + // TODO: Remove in Babel 8. + pre(file) { + file.metadata.exportName = null; + file.path.traverse({ + ExportSpecifier(path) { + if (path.node.exported.name === "default") { + file.metadata.exportName = path.node.local.name; + } + }, + }); + }, + post(file) { + if (!file.metadata.exportName) return; + file.path.traverse({ + ExportNamedDeclaration(path) { + if ( + !path.node.declaration && + path.node.specifiers.length === 0 + ) { + path.node.specifiers.push( + t.exportSpecifier( + t.identifier(file.metadata.exportName), + t.identifier("default") + ) + ); + } + }, + }); + }, visitor: { ImportDeclaration(path) { const source = path.node.source; @@ -117,7 +149,7 @@ const helpers: Record = { } }, }, - }, + }), ], }).code; code = (