Skip to content

chore: move to paths relative to monorepo root for new monorepo support #2259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

nickytonline
Copy link

@nickytonline nickytonline commented Aug 11, 2023

Description

Brings the project in line with the improved monorepo support. I'm off next week and there are some incoming changes to the CLI for this. As well, we need to modify the Next.js runtime to take into account the new PACKAGE_PATH constant so that we can build the functions in the package folder and not the monorepo root, (see the work @eduardoboucas has done in #2260) e.g.

-  await writeFile(join(functionsPath, ODB_FUNCTION_NAME, 'pages.js'), jsSource)
-  await writeFile(join(functionsPath, HANDLER_FUNCTION_NAME, 'pages.js'), jsSource)
+  await writeFile(join(PACKAGE_PATH, functionsPath, ODB_FUNCTION_NAME, 'pages.js'), jsSource)
+  await writeFile(join(PACKAGE_PATH, functionsPath, HANDLER_FUNCTION_NAME, 'pages.js'), jsSource)

Aside from the configuration changes, the demo sites need to be reconfigured in the Netlify UI so that the base path is / instead of e.g. demos/default.

There are also E2E tests that run the Next.js E2E test suite that use the Netlify CLI, but the sites generated are not monorepo packages being created via the CLI, so those should not require and changes.

Note that all the demo sites in this PR will fail to build until the base paths are updated in the Netlify UI.

@pieh might take this over next week, but if not, I'll resume this work when I'm back.

Tests

All the demo sites should deploy as usual with the updated configurations and all checks are green.

Relevant links (GitHub issues, etc.) or a picture of cute animal

@nickytonline nickytonline self-assigned this Aug 11, 2023
@nickytonline nickytonline requested a review from a team as a code owner August 11, 2023 13:57
@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for next-plugin-edge-middleware failed.

Name Link
🔨 Latest commit 49c6108
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/64d64e1d8eae2c0008edceb5

@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for netlify-plugin-nextjs-export-demo failed.

Name Link
🔨 Latest commit 49c6108
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/64d64e1d9043ec00081bceeb

@github-actions github-actions bot added the type: chore work needed to keep the product and development running smoothly label Aug 11, 2023
@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for monumental-licorice-cb7c10 failed.

Name Link
🔨 Latest commit 49c6108
🔍 Latest deploy log https://app.netlify.com/sites/monumental-licorice-cb7c10/deploys/64d64e1d6eaf4a0008b17a3c

@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for netlify-plugin-nextjs-demo failed.

Name Link
🔨 Latest commit d5eae31
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/64d63e389bb2db000827d40a

@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for next-i18next-demo failed.

Name Link
🔨 Latest commit 49c6108
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/64d64e1d3e1739000895c7a5

@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for netlify-plugin-nextjs-static-root-demo failed.

Name Link
🔨 Latest commit 49c6108
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/64d64e1d97c6d600079144db

@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for nextjs-plugin-custom-routes-demo failed.

Name Link
🔨 Latest commit 49c6108
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/64d64e1dcdbcb00008b43d97

@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo failed.

Name Link
🔨 Latest commit 49c6108
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/64d64e1ded3abf00080f6b13

@nickytonline
Copy link
Author

I need to update the base paths in the Netlify UI. For the time being, everything should fail.

@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for netlify-plugin-nextjs-next-auth-demo failed.

Name Link
🔨 Latest commit 49c6108
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/64d64e1dbdd25d0008021103

@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for next-plugin-canary failed.

Name Link
🔨 Latest commit 49c6108
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/64d64e1d641d7100081aa7a7

@netlify
Copy link

netlify bot commented Aug 11, 2023

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit 49c6108
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/64d64e1d6b617a000876a239
😎 Deploy Preview https://deploy-preview-2259--netlify-plugin-nextjs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@nickytonline nickytonline marked this pull request as draft August 11, 2023 17:06
Copy link
Contributor

@lukasholzer lukasholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to adapt the ignore command as well:

- ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;"
+ ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF; fi;"

as it's run from the repo root there is no need to cd outside of the repo with ../..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modify demo site configurations to enable improved monorepo support on Netlify
3 participants