From 242e6dbea1b9b4ece265db1edb393e76f2fef62d Mon Sep 17 00:00:00 2001 From: astone123 Date: Mon, 7 Aug 2023 10:28:57 -0600 Subject: [PATCH] fix output configurations for npm packages, add gitignores --- npm/mount-utils/package.json | 3 ++- npm/react/package.json | 3 ++- npm/react18/package.json | 3 ++- npm/svelte/package.json | 3 ++- npm/vite-dev-server/package.json | 9 +++++++++ npm/vite-plugin-cypress-esm/package.json | 9 +++++++++ npm/vue/package.json | 3 ++- npm/vue2/package.json | 3 ++- npm/webpack-dev-server/package.json | 9 +++++++++ npm/webpack-preprocessor/package.json | 11 ++++++++++- nx.json | 4 +++- packages/config/.gitignore | 1 + packages/data-context/package.json | 2 +- packages/resolve-dist/.gitignore | 1 + packages/rewriter/.gitignore | 1 + packages/scaffold-config/.gitignore | 1 + packages/server/.gitignore | 1 + scripts/binary/build.ts | 4 ++-- 18 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 packages/config/.gitignore create mode 100644 packages/resolve-dist/.gitignore create mode 100644 packages/rewriter/.gitignore create mode 100644 packages/scaffold-config/.gitignore create mode 100644 packages/server/.gitignore diff --git a/npm/mount-utils/package.json b/npm/mount-utils/package.json index 3e867164b942..6d48c967e639 100644 --- a/npm/mount-utils/package.json +++ b/npm/mount-utils/package.json @@ -40,7 +40,8 @@ "{workspaceRoot}/scripts" ], "outputs": [ - "{workspaceRoot}/cli/mount-utils" + "{workspaceRoot}/cli/mount-utils", + "{projectRoot}/dist" ] } } diff --git a/npm/react/package.json b/npm/react/package.json index 939e40f76706..4a2c0e65b812 100644 --- a/npm/react/package.json +++ b/npm/react/package.json @@ -94,7 +94,8 @@ "{workspaceRoot}/scripts" ], "outputs": [ - "{workspaceRoot}/cli/react" + "{workspaceRoot}/cli/react", + "{projectRoot}/dist" ] } } diff --git a/npm/react18/package.json b/npm/react18/package.json index 5f80b536d9a5..75233e9a4387 100644 --- a/npm/react18/package.json +++ b/npm/react18/package.json @@ -64,7 +64,8 @@ "{workspaceRoot}/scripts" ], "outputs": [ - "{workspaceRoot}/cli/react18" + "{workspaceRoot}/cli/react18", + "{projectRoot}/dist" ] } } diff --git a/npm/svelte/package.json b/npm/svelte/package.json index 27e12bb49845..e053f921c202 100644 --- a/npm/svelte/package.json +++ b/npm/svelte/package.json @@ -47,7 +47,8 @@ "{workspaceRoot}/scripts" ], "outputs": [ - "{workspaceRoot}/cli/svelte" + "{workspaceRoot}/cli/svelte", + "{projectRoot}/dist" ] } } diff --git a/npm/vite-dev-server/package.json b/npm/vite-dev-server/package.json index 741f718f4807..2988ca3fb0ce 100644 --- a/npm/vite-dev-server/package.json +++ b/npm/vite-dev-server/package.json @@ -45,5 +45,14 @@ "module": "dist/index.js", "publishConfig": { "access": "public" + }, + "nx": { + "targets": { + "build": { + "outputs": [ + "{projectRoot}/dist" + ] + } + } } } diff --git a/npm/vite-plugin-cypress-esm/package.json b/npm/vite-plugin-cypress-esm/package.json index 394f0de6baa9..ea69ce3e0ac3 100644 --- a/npm/vite-plugin-cypress-esm/package.json +++ b/npm/vite-plugin-cypress-esm/package.json @@ -41,5 +41,14 @@ "module": "dist/index.js", "publishConfig": { "access": "public" + }, + "nx": { + "targets": { + "build": { + "outputs": [ + "{projectRoot}/dist" + ] + } + } } } diff --git a/npm/vue/package.json b/npm/vue/package.json index ef097cef9c66..22726960f7aa 100644 --- a/npm/vue/package.json +++ b/npm/vue/package.json @@ -88,7 +88,8 @@ "{workspaceRoot}/scripts" ], "outputs": [ - "{workspaceRoot}/cli/vue" + "{workspaceRoot}/cli/vue", + "{projectRoot}/dist" ] } } diff --git a/npm/vue2/package.json b/npm/vue2/package.json index c77c0214d995..7357c5ea8917 100644 --- a/npm/vue2/package.json +++ b/npm/vue2/package.json @@ -56,7 +56,8 @@ "{workspaceRoot}/scripts" ], "outputs": [ - "{workspaceRoot}/cli/vue2" + "{workspaceRoot}/cli/vue2", + "{projectRoot}/dist" ] } } diff --git a/npm/webpack-dev-server/package.json b/npm/webpack-dev-server/package.json index e67eb4019edf..98d4f5a74aef 100644 --- a/npm/webpack-dev-server/package.json +++ b/npm/webpack-dev-server/package.json @@ -56,5 +56,14 @@ "bugs": "https://github.com/cypress-io/cypress/issues/new?template=1-bug-report.md", "publishConfig": { "access": "public" + }, + "nx": { + "targets": { + "build": { + "outputs": [ + "{projectRoot}/dist" + ] + } + } } } diff --git a/npm/webpack-preprocessor/package.json b/npm/webpack-preprocessor/package.json index 4cb0857e50b2..c71f614441b2 100644 --- a/npm/webpack-preprocessor/package.json +++ b/npm/webpack-preprocessor/package.json @@ -71,5 +71,14 @@ "cypress-plugin", "cypress-preprocessor", "webpack" - ] + ], + "nx": { + "targets": { + "build": { + "outputs": [ + "{projectRoot}/dist" + ] + } + } + } } diff --git a/nx.json b/nx.json index 9ddde92d1fff..74cac97de491 100644 --- a/nx.json +++ b/nx.json @@ -30,7 +30,9 @@ } }, "namedInputs": { - "sharedGlobals": [], + "sharedGlobals": [ + "{workspaceRoot}/scripts" + ], "default": [ "{projectRoot}/**/*", "sharedGlobals" diff --git a/packages/config/.gitignore b/packages/config/.gitignore new file mode 100644 index 000000000000..6724ce3596d6 --- /dev/null +++ b/packages/config/.gitignore @@ -0,0 +1 @@ +src/**/*.js \ No newline at end of file diff --git a/packages/data-context/package.json b/packages/data-context/package.json index a31069db67b4..edf5b5e6ad9d 100644 --- a/packages/data-context/package.json +++ b/packages/data-context/package.json @@ -92,7 +92,7 @@ "targets": { "build": { "outputs": [ - "{workspaceRoot}/src/**/*.js" + "{projectRoot}/src/**/*.js" ] } } diff --git a/packages/resolve-dist/.gitignore b/packages/resolve-dist/.gitignore new file mode 100644 index 000000000000..40dc45d0feb2 --- /dev/null +++ b/packages/resolve-dist/.gitignore @@ -0,0 +1 @@ +lib/**/*.js \ No newline at end of file diff --git a/packages/rewriter/.gitignore b/packages/rewriter/.gitignore new file mode 100644 index 000000000000..40dc45d0feb2 --- /dev/null +++ b/packages/rewriter/.gitignore @@ -0,0 +1 @@ +lib/**/*.js \ No newline at end of file diff --git a/packages/scaffold-config/.gitignore b/packages/scaffold-config/.gitignore new file mode 100644 index 000000000000..6724ce3596d6 --- /dev/null +++ b/packages/scaffold-config/.gitignore @@ -0,0 +1 @@ +src/**/*.js \ No newline at end of file diff --git a/packages/server/.gitignore b/packages/server/.gitignore new file mode 100644 index 000000000000..40dc45d0feb2 --- /dev/null +++ b/packages/server/.gitignore @@ -0,0 +1 @@ +lib/**/*.js \ No newline at end of file diff --git a/scripts/binary/build.ts b/scripts/binary/build.ts index 8c1d94e85d2b..f07baffae094 100644 --- a/scripts/binary/build.ts +++ b/scripts/binary/build.ts @@ -102,12 +102,12 @@ export async function buildCypressApp (options: BuildCypressAppOpts) { if (!keepBuild) { log('#buildPackages') - await execa('yarn', ['lerna', 'run', 'build-prod', '--ignore', 'cli', '--concurrency', '4'], { + await execa('yarn', ['lerna', 'run', 'build', '--ignore', 'cli', '--concurrency', '4'], { stdio: 'inherit', cwd: CY_ROOT_DIR, }) - await execa('yarn', ['lerna', 'run', 'build', '--ignore', 'cli', '--concurrency', '4'], { + await execa('yarn', ['lerna', 'run', 'build-prod', '--ignore', 'cli', '--concurrency', '4'], { stdio: 'inherit', cwd: CY_ROOT_DIR, })