Skip to content

Commit b4e4f91

Browse files
committed
chore: migrate to Pages Router
1 parent e090310 commit b4e4f91

158 files changed

Lines changed: 3543 additions & 3625 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
name: CSK pages router
2+
3+
on:
4+
push:
5+
branches:
6+
- pages-router
7+
8+
jobs:
9+
validate-repo:
10+
name: 🔎 Validate Repository
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: 🛎 Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: 🧰 Setup Node.js environment
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: "20"
21+
22+
- name: 💾 Cache node_modules
23+
uses: actions/cache@v3
24+
with:
25+
path: |
26+
node_modules
27+
apps/*/node_modules
28+
packages/*/node_modules
29+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
30+
restore-keys: |
31+
${{ runner.os }}-node-
32+
33+
- name: 🌱 Export NPM_TOKEN
34+
run: echo "NPM_TOKEN=${{ secrets.NPM_TOKEN }}" >> $GITHUB_ENV
35+
36+
- name: 📦 Install dependencies
37+
run: npm install
38+
39+
build-and-lint:
40+
name: 🛠️ Build Packages & Lint All
41+
runs-on: ubuntu-latest
42+
needs: validate-repo
43+
44+
steps:
45+
- name: 🛎 Checkout repository
46+
uses: actions/checkout@v4
47+
48+
- name: 🧰 Setup Node.js environment
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: "20"
52+
53+
- name: 💾 Cache node_modules
54+
uses: actions/cache@v3
55+
with:
56+
path: |
57+
node_modules
58+
apps/*/node_modules
59+
packages/*/node_modules
60+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
61+
restore-keys: |
62+
${{ runner.os }}-node-
63+
64+
- name: 🌱 Export NPM_TOKEN
65+
run: echo "NPM_TOKEN=${{ secrets.NPM_TOKEN }}" >> $GITHUB_ENV
66+
67+
- name: 📦 Install dependencies
68+
run: npm install
69+
70+
- name: 🏗️ Build all packages
71+
run: |
72+
echo "Building all packages..."
73+
npm run build:packages
74+
75+
- name: 🧹 Lint all packages and apps
76+
run: |
77+
echo "Running full monorepo lint..."
78+
npm run lint
79+
80+
- name: 📤 Archive dist folders
81+
if: success()
82+
run: |
83+
echo "Archiving all dist folders from packages/*..."
84+
tar -czf build-packages.tar.gz packages/*/dist
85+
86+
- name: 🚚 Upload dist archive as artifact
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: build-packages
90+
path: build-packages.tar.gz
91+
92+
extract-and-lint:
93+
name: 🧪 Extract Components & Lint & Type Check
94+
runs-on: ubuntu-latest
95+
needs: build-and-lint
96+
97+
steps:
98+
- name: 🛎 Checkout repository
99+
uses: actions/checkout@v4
100+
101+
- name: 🧰 Setup Node.js environment
102+
uses: actions/setup-node@v4
103+
with:
104+
node-version: "20"
105+
106+
- name: 💾 Cache node_modules
107+
uses: actions/cache@v3
108+
with:
109+
path: |
110+
node_modules
111+
apps/*/node_modules
112+
packages/*/node_modules
113+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
114+
restore-keys: |
115+
${{ runner.os }}-node-
116+
117+
- name: 🌱 Export NPM_TOKEN
118+
run: echo "NPM_TOKEN=${{ secrets.NPM_TOKEN }}" >> $GITHUB_ENV
119+
120+
- name: 📦 Install dependencies
121+
run: npm install
122+
123+
- name: 📥 Download dist archive
124+
uses: actions/download-artifact@v4
125+
with:
126+
name: build-packages
127+
path: .
128+
129+
- name: ♻️ Extract dist folders into packages/*
130+
run: |
131+
echo "Extracting dist folders into packages..."
132+
tar -xzf build-packages.tar.gz
133+
134+
- name: 🧪 Run component:extract in apps/csk
135+
working-directory: apps/csk
136+
run: |
137+
echo "Running extract with simulated input..."
138+
echo "a" | npm run component:extract
139+
140+
- name: 🧹 Lint apps/csk after extract
141+
working-directory: apps/csk
142+
run: |
143+
echo "Linting apps/csk after component extraction..."
144+
npm run lint
145+
146+
- name: 🧹 Type check apps/csk after extract
147+
working-directory: apps/csk
148+
run: |
149+
echo "Type checking apps/csk after component extraction..."
150+
npm run typecheck

apps/csk/next.config.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import { NextConfig } from 'next';
2-
import { withUniformConfig } from '@uniformdev/canvas-next-rsc-v2/config';
2+
import withTM from 'next-transpile-modules';
3+
import localizationSettings from './src/i18n/locales.json';
34

45
/** @type {NextConfig} */
56
const nextConfig: NextConfig = {
67
images: {
78
remotePatterns: [{ protocol: 'https', hostname: '*' }],
89
deviceSizes: [320, 420, 640, 768, 1024, 1280, 1536],
910
},
11+
i18n: {
12+
locales: localizationSettings?.locales,
13+
defaultLocale: localizationSettings?.defaultLocale,
14+
localeDetection: false,
15+
},
1016
};
1117

12-
export default withUniformConfig(nextConfig);
18+
export default withTM(['@uniformdev/csk-components'])(nextConfig);

apps/csk/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"format": "prettier --write .",
2222
"init": "run-s uniform:push uniform:publish",
2323
"component:extract": "csk-components extract",
24-
"component:scaffold": "csk-cli scaffold",
2524
"pull:dex": "design-extensions-tools pull",
2625
"apply:dex": "design-extensions-tools apply",
2726
"push:dex": "design-extensions-tools push",
@@ -36,12 +35,13 @@
3635
"recipes": "csk-recipes init"
3736
},
3837
"dependencies": {
39-
"@uniformdev/canvas-next-rsc-client-v2": "20.7.1-alpha.73",
40-
"@uniformdev/canvas-next-rsc-shared-v2": "20.7.1-alpha.73",
41-
"@uniformdev/canvas-next-rsc-v2": "20.7.1-alpha.73",
38+
"@uniformdev/canvas-next": "20.30.1",
39+
"@uniformdev/canvas-react": "20.30.1",
40+
"@uniformdev/context-next": "20.30.1",
4241
"@uniformdev/csk-components": "*",
4342
"@uniformdev/design-extensions-tools": "*",
4443
"next": "^15.4.2",
44+
"next-transpile-modules": "^10.0.1",
4545
"react": "^19.1.0",
4646
"react-dom": "^19.1.0"
4747
},
@@ -52,7 +52,7 @@
5252
"@types/node": "^20.0.0",
5353
"@types/react": "^19.1.0",
5454
"@types/react-dom": "^19.1.0",
55-
"@uniformdev/cli": "20.7.1-alpha.73",
55+
"@uniformdev/cli": "20.30.1",
5656
"@uniformdev/csk-cli": "*",
5757
"@uniformdev/csk-recipes": "*",
5858
"cross-env": "^7.0.3",

apps/csk/src/app/api/preview/route.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

apps/csk/src/app/layout.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.

apps/csk/src/app/playground/[code]/page.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.

apps/csk/src/app/robots.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

apps/csk/src/app/sitemap.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

apps/csk/src/app/uniform/[code]/page.tsx

Lines changed: 0 additions & 41 deletions
This file was deleted.

apps/csk/src/components/custom-canvas/Container.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { FC } from 'react';
22
import {
33
Container as CSKContainer,
44
ContainerProps as CSKContainerProps,
5-
} from '@uniformdev/csk-components/components/canvas/serverClient';
5+
} from '@uniformdev/csk-components/components/canvas';
66

77
// This is an example of how you can override an existing CSK component based on the Container component.
88
const Container: FC<CSKContainerProps> = props => <CSKContainer {...props} />;

0 commit comments

Comments
 (0)