nxtensions / nxtensions

Extensions and plugins for Nx
MIT License
60 stars 20 forks source link

✨ [Feature Request]: Astro 3.0 support #488

Closed andersonba closed 8 months ago

andersonba commented 1 year ago

For which package(s) is the feature request for?

Background & Motivation

With the release of Astro 3.0, there have been significant improvements in performance and new features added to the framework.

However, the current version is not fully compatible. When attempting to run an app that leverages the new version, specifically, one of the most critical issues is that running the application with nx serve fails to start the development server as expected.


I'm not sure if the type of issue I created is the correct one. I was unsure whether this was a bug or a feature, so please forgive me for that.

Proposed Solution

Upgrade guide:

https://docs.astro.build/en/guides/upgrade-to/v3/

Detailed Design

No response

Help make it happen!

louiss0 commented 1 year ago

I need this too the server is not working and so is tailwind. Both broke here is the repo http://www.github.com/louiss0/dummy-with-astro3.

When working with tailwind I get this error.

warn - The `content` option in your Tailwind CSS configuration is missing or empty.
warn - Configure your content sources or your generated CSS will be missing styles.
warn - https://tailwindcss.com/docs/content-configuration
  1. Download the repo
  2. Install the dependencies with pnpm i
  3. Then run pnpm nx run test:dev

You will see that the server does not start at all.

If you want to fix the tailwind error first I suggest installing astro@2.10.0

M0nica commented 1 year ago

The default Astro port in V3 has been updated to use 4321 instead of 3000. This extension assumes the default port should be 3000 which I believe is breaking the https://github.com/netlify/cli 's ability to detect that a V3 Astro app is running as it is always defaulting to waiting for port 3000. Please let me know if this should be opened as a separate issue or should be included in the scope of this https://github.com/nxtensions/nxtensions/issues/488

Here is where the extension defaults to port 3000 regardless of Astro version https://github.com/nxtensions/nxtensions/blob/861694f9f3f557256e89c1dbedc9477d31493a74/packages/astro/src/executors/preview/executor.ts#L19

Documentation about the default Astro port being port 4321 in Astro V3

Until this is addressed a workaround appears to be running Astro V3 on port 3000 by passing the --port flag like astro dev --port 3000

firxworx commented 10 months ago

Noting here that #491 was closed in favour of #512 by its OP.

https://github.com/nxtensions/nxtensions/pull/491#issuecomment-1748846619

Refer to #512 for PR