Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/dependency-cycle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Checking package dependencies with knip and lerna

on:
# Runs for every pull-requests created
pull_request:
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
knip:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'npm'

- name: Build TKO
run: make

- name: Check for dependency cycles and faulty imports/exports with knip
run: make knip

- name: Check lerna packages
run: make lerna-check
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ format-fix:
tsc:
$(NPX) tsc

knip:
$(NPX) knip --no-config-hints

eslint:
$(NPX) eslint .

Expand All @@ -63,6 +66,9 @@ dts:
docker-build:
$(DOCKER) build . --tag tko

lerna-check:
$(LERNA) exec --stream -- true

# Run the `repackage` target in every directory. Essentially
# homogenizes the `package.json`.
repackage: tools/repackage.mjs
Expand Down
3 changes: 1 addition & 2 deletions builds/knockout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@
"@tko/provider.multi": "^4.0.0-beta1.3",
"@tko/provider.virtual": "^4.0.0-beta1.6",
"@tko/utils.component": "^4.0.0-beta1.3",
"@tko/utils.functionrewrite": "^4.0.0-beta1.3",
"tslib": "^2.2.0"
"@tko/utils.functionrewrite": "^4.0.0-beta1.3"
},
"exports": {
".": {
Expand Down
3 changes: 1 addition & 2 deletions builds/reference/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
"@tko/provider.native": "^4.0.0-beta1.3",
"@tko/provider.virtual": "^4.0.0-beta1.6",
"@tko/utils.component": "^4.0.0-beta1.3",
"@tko/utils.jsx": "^4.0.0-beta1.3",
"tslib": "^2.2.0"
"@tko/utils.jsx": "^4.0.0-beta1.3"
},
"files": [
"dist/",
Expand Down
20 changes: 20 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"ignoreExportsUsedInFile": {
"interface": true,
"type": true
},
"tags": [
"-lintignore",
"-internal"
],
"ignoreDependencies": ["@types/mocha", "chai", "electron", "esbuild", "fs-extra", "karma[.]*", "mocha", "nyc", "prettier", "sinon", "lerna"],
"workspaces": {
"packages/*": {
"entry": "src/index.ts",
"project": "src/*.ts",
"ignore": ["/helpers/**"]
}
},
"ignoreWorkspaces": ["builds/**", "docs/**", "tko.io/**", "tools/**"]
}
Loading