|
1 | 1 | ## Post-Update Checklist for shadcn Components |
2 | 2 |
|
3 | | -After updating your `shadcn` components with the CLI, complete the following steps to ensure everything integrates correctly: |
| 3 | +After running the shadcn CLI to update your components, follow these steps to ensure everything integrates correctly. |
| 4 | +This process helps you isolate and address any changes the CLI made, then reapply your custom modifications. |
4 | 5 |
|
5 | | -### Modifications |
| 6 | +### Steps to Follow |
6 | 7 |
|
7 | | -##### `sidebar.svelte` |
8 | | -Change `ease-linear` for the sidebar to `ease-in-out` and increase the duration from 200ms to 300ms (`duration-300`) |
| 8 | +To start off, we want to eliminate the bulk of the changes that the CLI made, this will make it easier to see what actual changes were made by inspecting the git diff. |
9 | 9 |
|
10 | | -1. **Update `sonner` component if modified** |
| 10 | +To do this we will first migrate all the tailwindcss classes to tailwindcss v4, then format all the code to our code style. |
11 | 11 |
|
12 | | - If the `sonner` component was modified by the CLI, it most likely went back to using the `svelte-sonner` package. |
13 | | - * Update it to use our own `ColorSchemeStore` implementation instead of the one from the `svelte-sonner` package. |
14 | | - * Remove `svelte-sonner` from `package.json` |
15 | | - |
16 | | -2. **Redirect utility imports** |
17 | | - |
18 | | - * Replace every instance of |
19 | | - |
20 | | - ```js |
21 | | - import ... from '$lib/utils.js' |
22 | | - ``` |
23 | | - |
24 | | - with: |
25 | | - |
26 | | - ```js |
27 | | - import ... from '$lib/utils/shadcn' |
28 | | - ``` |
29 | | - |
30 | | - This can be done easily with a search and replace tool in your code editor. |
| 12 | +```bash |
| 13 | +pnpx @tailwindcss/upgrade --force |
| 14 | +pnpm run format |
| 15 | +``` |
31 | 16 |
|
32 | | -3. **Replace `shadcn` utils file if CLI generated one** |
| 17 | +Now it should be easier to see what the CLI actually changed, and we can now proceed with the following steps: |
33 | 18 |
|
34 | | - * If the CLI created `src/lib/utils.ts`, overwrite your existing `src/lib/utils/shadcn.ts` with it. |
| 19 | +1. **Update `sidebar` component if modified** |
35 | 20 |
|
36 | | -4. **Run tailwindcss migration utility** |
| 21 | + If the `sidebar` component was modified by the CLI, it most likely went back to using `ease-linear` and `duration-200`. |
| 22 | + * Change `ease-linear` for the sidebar to `ease-in-out`. |
| 23 | + * Increase the duration from `duration-200` to `duration-300`. |
37 | 24 |
|
38 | | - * Shadcn-svelte still hasnt migrated to tailwindcss v4, so we need to run the migration utility to ensure everything is up to date. |
| 25 | +2. **Update `sonner` component if modified** |
39 | 26 |
|
40 | | - ```bash |
41 | | - pnpx @tailwindcss/upgrade --force |
42 | | - ``` |
| 27 | + If the `sonner` component was modified by the CLI, it most likely went back to using the `svelte-sonner` package. |
| 28 | + * Update it to use our own `ColorSchemeStore` implementation instead of the one from the `svelte-sonner` package. |
| 29 | + * Remove `svelte-sonner` from `package.json` |
43 | 30 |
|
44 | | -5. **Apply consistent styling** |
| 31 | +3. **Run code formatting again** |
45 | 32 |
|
46 | | - * Run the following command to apply consistent styling: |
| 33 | + Now we need to run the code formatting again to ensure everything is consistent after the changes made in steps 1 and 2. |
47 | 34 |
|
48 | | - ```bash |
49 | | - pnpm run format |
50 | | - ``` |
| 35 | + ```bash |
| 36 | + pnpm run format |
| 37 | + ``` |
51 | 38 |
|
52 | | -6. **Check code for any issues** |
| 39 | +4. **Check code for any issues** |
53 | 40 |
|
54 | 41 | * Run the following commands to check for any issues: |
55 | 42 |
|
56 | 43 | ```bash |
57 | | - pnpm run lint |
58 | 44 | pnpm run check |
59 | 45 | ``` |
0 commit comments