Skip to content

Commit 3762fd0

Browse files
chore(at-419): release 0.2.0 migration guide updates #698 (#7417)
* fix: redundant comma in package.json example * feat: add lint:fix command to nextjs turbo json snippet * feat: simplify yarn store add * feat: point to nuxtconfig instead of tsconfig when defining ts aliases * refactor: mention alokai config is in the root * chore: remove wrong storefront-unified-middleware dir from project tree * feat: mention creating tailwind-config src directory * chore: explicitly mention replacing content of config files * chore: mention server const to be updated more explicityl * chore: improve server const formatting
1 parent abf892b commit 3762fd0

File tree

1 file changed

+41
-26
lines changed

1 file changed

+41
-26
lines changed

docs/content/guides/7.multistore/3.migration-guide.md

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ Before we begin, here's what your project structure will look like after complet
1919
```ascii
2020
apps/
2121
├── playwright/
22+
├── storefront-middleware/
2223
├── storefront-unified-nextjs/
23-
├── storefront-unified-middleware/
2424
└── stores/
2525
├── default/
2626
│ └── playwright/
27-
│ └── storefront-unified-nextjs/
2827
│ └── storefront-middleware/
28+
│ └── storefront-unified-nextjs/
2929
packages/
3030
eslint-config/
3131
lint-staged-config/
@@ -37,13 +37,13 @@ packages/
3737
```ascii
3838
apps/
3939
├── playwright/
40+
├── storefront-middleware/
4041
├── storefront-unified-nuxt/
41-
├── storefront-unified-middleware/
4242
└── stores/
4343
├── default/
4444
│ └── playwright/
45-
│ └── storefront-unified-nuxt/
4645
│ └── storefront-middleware/
46+
│ └── storefront-unified-nuxt/
4747
packages/
4848
eslint-config/
4949
lint-staged-config/
@@ -531,6 +531,12 @@ Create `packages/tailwind-config/tsconfig.json`:
531531
}
532532
```
533533

534+
Create `packages/tailwind-config/src` directory:
535+
536+
```bash
537+
mkdir -p packages/tailwind-config/src
538+
```
539+
534540
::tabs{:titles='["Next.js", "Nuxt"]'}
535541

536542
#tab-1
@@ -701,7 +707,7 @@ Create `packages/tailwind-config/package.json`:
701707
"types": "./dist/nuxt.d.cts"
702708
},
703709
"types": "./dist/nuxt.d.ts"
704-
},
710+
}
705711
},
706712
"scripts": {
707713
"build": "unbuild",
@@ -738,22 +744,22 @@ mv apps/storefront-unified-nextjs/.prettierrc apps/storefront-unified-nextjs/.pr
738744

739745
Then update the configuration files:
740746

741-
Update `apps/storefront-unified-nextjs/eslint.config.mjs`:
747+
Replace the content of `apps/storefront-unified-nextjs/eslint.config.mjs` with:
742748
```js
743749
export { default } from 'eslint-config/nextjs';
744750
```
745751

746-
Update `apps/storefront-unified-nextjs/.prettierrc.mjs`:
752+
Replace the content of `apps/storefront-unified-nextjs/.prettierrc.mjs` with:
747753
```js
748754
export { default } from 'prettier-config/nextjs';
749755
```
750756

751-
Update `apps/storefront-unified-nextjs/lint-staged.config.mjs`:
757+
Replace the content of `apps/storefront-unified-nextjs/lint-staged.config.mjs` with:
752758
```js
753759
export { default } from 'lint-staged-config/nextjs';
754760
```
755761

756-
Update `apps/storefront-unified-nextjs/tailwind.config.ts`:
762+
Replace the content of `apps/storefront-unified-nextjs/tailwind.config.ts` with:
757763
```ts
758764
import tailwindConfig from 'tailwind-config/nextjs';
759765
import type { Config } from 'tailwindcss';
@@ -781,22 +787,22 @@ mv apps/storefront-unified-nuxt/.prettierrc apps/storefront-unified-nuxt/.pretti
781787

782788
Then update the configuration files:
783789

784-
Update `apps/storefront-unified-nuxt/eslint.config.mjs`:
790+
Replace the content of `apps/storefront-unified-nuxt/eslint.config.mjs` with:
785791
```js
786792
export { default } from 'eslint-config/nuxt';
787793
```
788794

789-
Update `apps/storefront-unified-nuxt/.prettierrc.mjs`:
795+
Replace the content of `apps/storefront-unified-nuxt/.prettierrc.mjs` with:
790796
```js
791797
export { default } from 'prettier-config/nuxt';
792798
```
793799

794-
Update `apps/storefront-unified-nuxt/lint-staged.config.mjs`:
800+
Replace the content of `apps/storefront-unified-nuxt/lint-staged.config.mjs` with:
795801
```js
796802
export { default } from 'lint-staged-config/nuxt';
797803
```
798804

799-
Update `apps/storefront-unified-nuxt/tailwind.config.ts`:
805+
Replace the content of `apps/storefront-unified-nuxt/tailwind.config.ts` with:
800806
```ts
801807
import tailwindConfig from 'tailwind-config/nuxt';
802808
import type { Config } from 'tailwindcss';
@@ -813,32 +819,32 @@ export default {
813819
```
814820
::
815821

816-
Update `apps/playwright/eslint.config.mjs`:
822+
Replace the content of `apps/playwright/eslint.config.mjs` with:
817823
```js
818824
export { default } from 'eslint-config/playwright';
819825
```
820826

821-
Update `apps/playwright/.prettierrc.mjs`:
827+
Replace the content of `apps/playwright/.prettierrc.mjs` with:
822828
```js
823829
export { default } from 'prettier-config/playwright';
824830
```
825831

826-
Update `apps/playwright/lint-staged.config.mjs`:
832+
Replace the content of `apps/playwright/lint-staged.config.mjs` with:
827833
```js
828834
export { default } from 'lint-staged-config/playwright';
829835
```
830836

831-
Update `apps/storefront-middleware/eslint.config.mjs`:
837+
Replace the content of `apps/storefront-middleware/eslint.config.mjs` with:
832838
```js
833839
export { default } from 'eslint-config/middleware';
834840
```
835841

836-
Update `apps/storefront-middleware/.prettierrc.mjs`:
842+
Replace the content of `apps/storefront-middleware/.prettierrc.mjs` with:
837843
```js
838844
export { default } from 'prettier-config/middleware';
839845
```
840846

841-
Update `apps/storefront-middleware/lint-staged.config.mjs`:
847+
Replace the content of `apps/storefront-middleware/lint-staged.config.mjs` with:
842848
```js
843849
export { default } from 'lint-staged-config/middleware';
844850
```
@@ -926,6 +932,9 @@ If `yarn lint:fix` finds any issues that it cannot automatically fix, we recomme
926932
"lint": {
927933
"dependsOn": []
928934
},
935+
"lint:fix": {
936+
"dependsOn": []
937+
},
929938
"format": {
930939
"outputs": []
931940
},
@@ -1096,13 +1105,16 @@ Update `apps/storefront-unified-nuxt/nuxt.config.ts`
10961105
}
10971106
```
10981107

1099-
Update `apps/storefront-unified-nuxt/tsconfig.json`
1108+
Update `apps/storefront-unified-nuxt/nuxt.config.ts`:
1109+
11001110
```diff
1111+
export default defineNuxtConfig({
11011112
alias: {
11021113
'@sf-modules': path.resolve(__dirname, '.', 'sf-modules'),
11031114
'@sf-modules-middleware': path.resolve(__dirname, '..', 'storefront-middleware', 'sf-modules'),
11041115
+ 'storefront-middleware': path.resolve(__dirname, '..', 'storefront-middleware'),
11051116
},
1117+
});
11061118
```
11071119
::
11081120

@@ -1159,7 +1171,7 @@ Update `apps/playwright/package.json`:
11591171
::tabs{:titles='["Next.js", "Nuxt"]'}
11601172

11611173
#tab-1
1162-
Update server configurations in `apps/playwright/setup/framework/nextjs/server-dev.ts` and `server.ts` to include envs and error handling:
1174+
Update `server` const in `apps/playwright/setup/framework/nextjs/server-dev.ts` and `apps/playwright/setup/framework/nextjs/server.ts` to include envs and error handling:
11631175
```ts
11641176
const server = exec(
11651177
'yarn dev',
@@ -1173,11 +1185,14 @@ const server = exec(
11731185
TEST_BUILD_DIR: join('.next', 'test', `${workerInfo.workerIndex}`),
11741186
},
11751187
},
1176-
(error) => {
1188+
(error: unknown) => {
11771189
if (error !== null) {
1178-
debug && console.log(`[WORKER ${workerInfo.workerIndex}] Next.js server encountered an error: ${error}`);
1190+
debug &&
1191+
console.log(
1192+
`[WORKER ${workerInfo.workerIndex}] Next.js server encountered an error: ${error}`,
1193+
);
11791194
}
1180-
}
1195+
},
11811196
);
11821197
```
11831198

@@ -1229,7 +1244,7 @@ yarn add @alokai/cli@0.2.0 cross-env -W
12291244
#step-5
12301245
### Set Up Alokai Configuration
12311246

1232-
1. Create `alokai.config.json`:
1247+
1. Create `alokai.config.json` in the root of the project:
12331248
```json
12341249
{
12351250
"$schema": "node_modules/@alokai/cli/dist/static/alokaiConfigSchema.json",
@@ -1245,7 +1260,7 @@ yarn add @alokai/cli@0.2.0 cross-env -W
12451260

12461261
After setting up the Alokai configuration, create your first store:
12471262
```bash
1248-
yarn exec alokai-cli store add
1263+
yarn store add
12491264
```
12501265

12511266
::tip Store Name

0 commit comments

Comments
 (0)