Skip to content

Commit f092790

Browse files
authored
ci: check knip as part of automated checks (#1521)
## Description Added a new Knip job to the CI workflow to detect unused files, exports, and dependencies. This job runs on Ubuntu with Node.js 20.x, installs dependencies with `npm ci`, and executes the `npm run knip` command. ## Type of Change - [x] Improvement - [x] Cleanup/Refactor ## Checklist - [x] I have tested this does not break current pipelines / runs functionality - [x] I have tested the changes on staging ## Test Instructions 1. Verify that the new Knip job runs successfully in the CI pipeline 2. Check that Knip correctly identifies unused code and dependencies
1 parent 71a783f commit f092790

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,21 @@ jobs:
6060

6161
- name: Run linting
6262
run: npm run lint
63+
64+
knip:
65+
name: Knip
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v4
69+
70+
- name: Setup Node.js
71+
uses: actions/setup-node@v4
72+
with:
73+
node-version: '20.x'
74+
cache: 'npm'
75+
76+
- name: Install dependencies
77+
run: npm ci
78+
79+
- name: Run knip
80+
run: npm run knip

tests/e2e/helpers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function locateFlowViewport(page: Page): Locator {
2626
/**
2727
* Locates the React Flow pane (for canvas interactions)
2828
*/
29-
export function locateFlowPane(page: Page): Locator {
29+
function locateFlowPane(page: Page): Locator {
3030
return page.locator(".react-flow__pane");
3131
}
3232

@@ -167,7 +167,7 @@ export async function dragComponentToCanvas(
167167
/**
168168
* Locates a task node by its name
169169
*/
170-
export function locateNodeByName(page: Page, nodeName: string): Locator {
170+
function locateNodeByName(page: Page, nodeName: string): Locator {
171171
return page.locator(`[data-testid="rf__node-task_${nodeName}"]`);
172172
}
173173

@@ -178,14 +178,14 @@ export function locateNodeByName(page: Page, nodeName: string): Locator {
178178
/**
179179
* Locates the context panel container
180180
*/
181-
export function locateContextPanelContainer(page: Page): Locator {
181+
function locateContextPanelContainer(page: Page): Locator {
182182
return page.locator('[data-testid="context-panel-container"]');
183183
}
184184

185185
/**
186186
* Locates a specific context panel by name
187187
*/
188-
export function locateContextPanel(page: Page, panelName: string): Locator {
188+
function locateContextPanel(page: Page, panelName: string): Locator {
189189
const container = locateContextPanelContainer(page);
190190
return container.locator(`[data-context-panel="${panelName}"]`);
191191
}

0 commit comments

Comments
 (0)