Skip to content

Commit ab538b2

Browse files
chore: clean up stale rebase artifacts, update lockfile
1 parent c36c289 commit ab538b2

4 files changed

Lines changed: 43 additions & 51 deletions

File tree

.github/workflows/check-nextjs.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,48 +29,48 @@ jobs:
2929
uses: actions/setup-node@v4
3030
with:
3131
node-version: ${{ matrix.NODE }}
32+
cache: 'npm'
33+
cache-dependency-path: |
34+
package-lock.json
35+
apps/nextjs-testing/**/package-lock.json
3236
33-
- name: Extract create-next-app version
37+
- name: Determine test app directory
3438
run: |
35-
NEXT_APP_VERSION=$(node -e "const versions = require('./packages/devextreme-cli/src/utility/latest-versions.js'); console.log(versions['create-next-app'])")
36-
echo "Using create-next-app version: $NEXT_APP_VERSION"
37-
echo "NEXT_APP_VERSION=$NEXT_APP_VERSION" >> $GITHUB_ENV
39+
TS_PART=${{ matrix.TYPESCRIPT == true && 'ts' || 'js' }}
40+
SRC_PART=${{ matrix.SRC_DIR == true && 'src' || 'nosrc' }}
41+
ROUTER_PART=${{ matrix.APP_ROUTER == true && 'app' || 'pages' }}
42+
echo "TEST_APP_DIR=apps/nextjs-testing/${TS_PART}-${SRC_PART}-${ROUTER_PART}" >> $GITHUB_ENV
3843
shell: bash
3944

40-
- name: Create Next.js application
45+
- name: Verify committed apps are up-to-date
4146
run: |
42-
npx create-next-app@${{ env.NEXT_APP_VERSION }} test-nextjs-app \
43-
--typescript=${{ matrix.TYPESCRIPT }} \
44-
--src-dir=${{ matrix.SRC_DIR }} \
45-
--app=${{ matrix.APP_ROUTER }} \
46-
--eslint \
47-
--no-tailwind \
48-
--import-alias="@/*" \
49-
--no-git \
50-
--use-npm
47+
EXPECTED_VERSION=$(node -e "const v = require('./packages/devextreme-cli/src/utility/latest-versions.js'); console.log(v['create-next-app'])")
48+
COMMITTED_VERSION=$(node -e "const m = require('./apps/nextjs-testing/.generator-meta.json'); console.log(m['create-next-app'])")
49+
if [ "$EXPECTED_VERSION" != "$COMMITTED_VERSION" ]; then
50+
echo "ERROR: Committed test apps use create-next-app@$COMMITTED_VERSION but latest-versions.js specifies $EXPECTED_VERSION"
51+
echo "Run 'npm run regenerate-nextjs-apps' and commit the results"
52+
exit 1
53+
fi
5154
shell: bash
5255

53-
- name: Add actual devExtreme-cli
54-
run: |
55-
cd test-nextjs-app
56-
npm add devextreme-cli
57-
rm -r ./node_modules/devextreme-cli/src/
58-
cp -r ../packages/devextreme-cli/src/ ./node_modules/devextreme-cli/
59-
ls ./node_modules/devextreme-cli
60-
ls ./node_modules/devextreme-cli/src
61-
shell: bash
62-
timeout-minutes: 15
56+
- name: Install devextreme-cli dependencies
57+
run: npm ci --prefix packages/devextreme-cli
58+
timeout-minutes: 5
59+
60+
- name: Install test app dependencies
61+
run: cd ${{ env.TEST_APP_DIR }} && npm ci
62+
timeout-minutes: 5
6363

6464
- name: Add DevExtreme to Next.js application
6565
run: |
66-
cd test-nextjs-app
67-
npx devextreme-cli add devextreme-react
66+
cd ${{ env.TEST_APP_DIR }}
67+
node ../../../packages/devextreme-cli/index.js add devextreme-react
6868
shell: bash
6969
timeout-minutes: 15
7070

7171
- name: Verify DevExtreme dependencies in package.json
7272
run: |
73-
cd test-nextjs-app
73+
cd ${{ env.TEST_APP_DIR }}
7474
7575
if ! grep -q '"devextreme":' package.json; then
7676
echo "Error: devextreme dependency not found in package.json"
@@ -87,7 +87,7 @@ jobs:
8787

8888
- name: Build Next.js application
8989
run: |
90-
cd test-nextjs-app
90+
cd ${{ env.TEST_APP_DIR }}
9191
npm run build
9292
shell: bash
9393
timeout-minutes: 15

packages/devextreme-cli/src/templates/nextjs/application/src/components/side-navigation-menu/SideNavigationMenu.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ export default function SideNavigationMenu(props<%=#isTypeScript%>: React.PropsW
2020

2121
const theme = useContext(ThemeContext);
2222
const { isLarge } = useScreenSize();
23-
function normalizePath () {
24-
return navigation.map((item) => (
25-
{ ...item, expanded: isLarge, path: item.path && !(/^\//.test(item.path)) ? `/${item.path}` : item.path }
26-
))
27-
}
28-
2923
const items = useMemo(
30-
() => normalizePath(),
24+
() => navigation.map((item) => (
25+
{ ...item, expanded: isLarge, path: item.path && !(/^\//.test(item.path)) ? `/${item.path}` : item.path }
26+
)),
3127
// eslint-disable-next-line react-hooks/exhaustive-deps
3228
[]
3329
);

packages/devextreme-cli/src/templates/react/application/src/components/side-navigation-menu/SideNavigationMenu.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,10 @@ export default function SideNavigationMenu(props<%=#isTypeScript%>: React.PropsW
2020

2121
const theme = useContext(ThemeContext);
2222
const { isLarge } = useScreenSize();
23-
function normalizePath () {
24-
return navigation.map((item) => (
25-
{ ...item, expanded: isLarge, path: item.path && !(/^\//.test(item.path)) ? `/${item.path}` : item.path }
26-
))
27-
}
28-
2923
const items = useMemo(
30-
() => normalizePath(),
24+
() => navigation.map((item) => (
25+
{ ...item, expanded: isLarge, path: item.path && !(/^\//.test(item.path)) ? `/${item.path}` : item.path }
26+
)),
3127
// eslint-disable-next-line react-hooks/exhaustive-deps
3228
[]
3329
);

pnpm-lock.yaml

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)