Skip to content
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

fix: nuxt module [SFUI2-1327] #3155

Merged
merged 15 commits into from
May 20, 2024
Merged

Conversation

Szymon-dziewonski
Copy link
Contributor

Related issue

https://alokai.atlassian.net/browse/SFUI2-1327

Closes #

Scope of work

Fix nuxt package
Add README.md file
Update installation documentation
Add linting to nuxt package

Screenshots of visual changes

Checklist

  • Self code-reviewed
  • Changes documented
  • Semantic HTML
  • SSR-friendly
  • Caching friendly
  • a11y for WCAG 2.0 AA
  • examples created
  • blocks created
  • cypress tests created

Copy link

changeset-bot bot commented May 14, 2024

🦋 Changeset detected

Latest commit: 95f5f84

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

import * as storefrontUi from '@storefront-ui/vue';
import { tailwindConfig } from '@storefront-ui/vue/tailwind-config';
import { type RawFile } from 'tailwindcss/types/config';
import '@nuxtjs/tailwindcss';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

without this import NuxtOptions['tailwindcss'] does not work and throw error that tailwindcss does not exists on NuxtOptions, because there is typing file generated on tailwindcss side that NuxtOptions contain this property.

@Szymon-dziewonski Szymon-dziewonski changed the base branch from v2-develop to v2-release/nuxt-2.5.0 May 14, 2024 11:20
@Szymon-dziewonski
Copy link
Contributor Author

cannot continue working with PR because of error occurs nuxt/module-builder#267


```bash
# npm
npm i -D @nuxtjs/tailwindcss @storefront-ui/vue
npm i -D @storefront-ui/nuxt @storefront-ui/vue @nuxtjs/tailwindcss
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: shouldn't @nuxtjs/tailwindcss be installed by our nuxt module?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its installed only in nuxt itself modules property in config, however we still need dependency

Copy link
Contributor

Choose a reason for hiding this comment

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

dependency in our package.json, right? Not in the user codebase.
Like: @nuxtjs/tailwindcss does not require you to install tailwindcss itself

Copy link
Contributor Author

Choose a reason for hiding this comment

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

dependency in client package.json. If user will install our @storefront-ui/nuxt module, which uses @nuxtjs/tailwindcss wont have it wont work. In other words await installModule('@nuxtjs/tailwindcss'); in out module just adding @nuxtjs/tailwindcss string to nuxt.config.js modules property. It does not installing dependency into package.json. I just double checked it.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's why it would be good to have @nuxtjs/tailwindcss as a subdependency of our module, right? IMO it would be a nice thing for the end users - they do not have to install/update @nuxtjs/tailwindcss unless they use it directly by themselves.

Now I'm wondering if we shouldn't do the same for @storefront-ui/vue. Do we need it to be explicitly installed by the user and not as a subdependency of @storefront-ui/nuxt?

@Szymon-dziewonski Szymon-dziewonski force-pushed the fix--nuxt-module branch 2 times, most recently from 264716c to de417f0 Compare May 17, 2024 13:52
@Szymon-dziewonski Szymon-dziewonski force-pushed the fix--nuxt-module branch 15 times, most recently from 57d7878 to c30a56b Compare May 17, 2024 16:48
@Szymon-dziewonski Szymon-dziewonski merged commit a754c14 into v2-release/nuxt-2.5.0 May 20, 2024
15 checks passed
@Szymon-dziewonski Szymon-dziewonski deleted the fix--nuxt-module branch May 20, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants