From 5f5df6043c604aa8899db6d769aa939a2cd0c304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Burzy=C5=84ski?= Date: Mon, 15 May 2023 17:46:00 +0200 Subject: [PATCH] chore: put types condition first in the syncing script (#26743) Co-authored-by: Chris Breiding --- cli/package.json | 2 +- scripts/sync-exported-npm-with-cli.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/package.json b/cli/package.json index e0d0a3303f..f9c2d09f14 100644 --- a/cli/package.json +++ b/cli/package.json @@ -160,7 +160,7 @@ "./svelte": { "types": "./svelte/dist/index.d.ts", "import": "./svelte/dist/cypress-svelte.esm-bundler.js", - "require": "./svelte/dist/cypress-selte.cjs.js" + "require": "./svelte/dist/cypress-svelte.cjs.js" } }, "workspaces": { diff --git a/scripts/sync-exported-npm-with-cli.js b/scripts/sync-exported-npm-with-cli.js index 42518dafab..8682c29812 100644 --- a/scripts/sync-exported-npm-with-cli.js +++ b/scripts/sync-exported-npm-with-cli.js @@ -54,6 +54,11 @@ packlist({ path: currentPackageDir }) const subPackageExports = cliPackageConfig.exports[`./${exportName}`] = {} const esmEntry = isModule ? currentPackageConfig.main : currentPackageConfig.module + if (types) { + // ./react/dist/cypress-react-cjs.js, etc + subPackageExports.types = `./${exportName}/${types}` + } + if (esmEntry) { // ./react/dist/cypress-react-esm.js, etc subPackageExports.import = `./${exportName}/${esmEntry}` @@ -64,11 +69,6 @@ packlist({ path: currentPackageDir }) subPackageExports.require = `./${exportName}/${currentPackageConfig.main}` } - if (types) { - // ./react/dist/cypress-react-cjs.js, etc - subPackageExports.types = `./${exportName}/${types}` - } - if (!cliPackageConfig.files.includes(exportName)) { cliPackageConfig.files.push(exportName) }