File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,12 +112,14 @@ $templateShadComponents = (Get-ChildItem -Path app/components/ui).name
112112$diffComponents = $shadComponents | Where-Object {$templateShadComponents -NotContains $_ }
113113
114114invoke-npmCommand - command " exec --" - pnpmCommand " dlx" - argslist " nuxi prepare"
115-
116- invoke-npmCommand - command " exec --" - pnpmCommand " dlx" - argslist " shadcn-vue@latest add $diffComponents "
115+ if ($diffComponents.Length -gt 0 ) {
116+ write-output " Choose no (N) to overriding components if prompted below"
117+ invoke-npmCommand - command " exec --" - pnpmCommand " dlx" - argslist " shadcn-vue@latest add $diffComponents "
118+ }
117119
118120write-output " -----------------------------"
119121write-output " Upgrade complete!"
120122write-output " The next step is to convert your Tailwind CSS variables saved in 'tailwind.txt'"
121123write-output " Follow step 9 in the upgrade guide"
122124write-output " https://github.com/RDFLib/prez-ui/blob/feature/tailwind4/docs/upgrade.md#9-update-tailwindcss"
123- write-output " (Note: You may need to remove the prez-ui folder as it may not have been deleted properly)"
125+ write-output " (Note: You may need to remove the prez-ui folder as it may not have been deleted properly)"
Original file line number Diff line number Diff line change 77MAC_OS=$( [ $( uname -s) == Darwin ] && echo true || echo false)
88USE_PNPM=$( [ -f pnpm-lock.yaml ] && echo true || echo false)
99
10+ if $USE_PNPM ; then
11+ MANAGER=" pnpm"
12+ else
13+ MANAGER=" npm"
14+ fi
15+
1016if $MAC_OS ; then
1117 SED_FLAGS=( -i ' ' )
1218else
1521
1622# 1. Uninstall old packages
1723REMOVE_PACKAGES=(@nuxtjs/tailwindcss radix-vue tailwindcss-animate prez-ui)
18- if $USE_PNPM ; then
19- pnpm remove " ${REMOVE_PACKAGES[@]} "
20- else
21- npm uninstall " ${REMOVE_PACKAGES[@]} "
22- fi
24+
25+ for package in " ${REMOVE_PACKAGES[@]} " ; do
26+ if $MANAGER list --depth=0 | grep $package ; then
27+ if $USE_PNPM ; then
28+ pnpm remove $package
29+ else
30+ npm uninstall $package
31+ fi
32+ fi
33+ done
2334
2435# 2. Update packages
2536UPDATE_PACKAGES=(tailwind-merge nuxt shadcn-nuxt)
26-
2737PREZ_PACKAGES=(prez-lib prez-components)
28- if $USE_PNPM ; then
29- MANAGER=" pnpm"
30- else
31- MANAGER=" npm"
32- fi
38+
3339for package in " ${PREZ_PACKAGES[@]} " ; do
3440 if $MANAGER list --depth=0 | grep $package ; then
3541 UPDATE_PACKAGES+=($package )
117123fi
118124
119125if $USE_PNPM ; then
120- pnpm dlx shadcn-vue@latest add " ${DIFF_COMPONENTS[@]} "
126+ yes n | pnpm dlx shadcn-vue@latest add " ${DIFF_COMPONENTS[@]} "
121127else
122- npx shadcn-vue@latest add " ${DIFF_COMPONENTS[@]} "
128+ yes n | npx shadcn-vue@latest add " ${DIFF_COMPONENTS[@]} "
123129fi
124130
125131echo " -----------------------------"
You can’t perform that action at this time.
0 commit comments