-
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependencies in issue templates & add playground + templates
- Loading branch information
Showing
28 changed files
with
338 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; | ||
--- | ||
|
||
<StarlightPage frontmatter={{ title: 'Playground', template: 'splash' }}> | ||
|
||
<p>The projects below contain a few issues on purpose to demonstrate how Knip works.</p> | ||
|
||
<p>Feel free to fork one of them and play around!</p> | ||
|
||
<ul> | ||
<li><a href="#basic">Basic</a></li> | ||
<li><a href="#monorepo">Monorepo</a></li> | ||
</ul> | ||
|
||
<h2 id="basic">Basic</h2> | ||
|
||
<p> | ||
Visit this <a href="https://stackblitz.com/github/webpro-nl/knip/tree/main/templates/playground/basic?file=package.json&view=editor">Knip playground onStackBlitz</a> | ||
to try out Knip in a regular setting.</p> | ||
|
||
<div class="playground"> | ||
<iframe src="https://stackblitz.com/github/webpro-nl/knip/tree/main/templates/playground/basic?file=package.json&view=editor" /> | ||
</div> | ||
|
||
<h2 id="monorepo">Monorepo</h2> | ||
|
||
<p> | ||
Visit this <a href="https://stackblitz.com/github/webpro-nl/knip/tree/main/templates/playground/monorepo?file=package.json&view=editor">Knip playground onStackBlitz</a> | ||
to try out Knip in a monorepo setting.</p> | ||
|
||
<div class="playground"> | ||
<iframe src="https://stackblitz.com/github/webpro-nl/knip/tree/main/templates/playground/monorepo?file=package.json&view=editor" /> | ||
</div> | ||
</StarlightPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Knip Playground (basic) | ||
|
||
Knip playground to show how Knip works. There are issues in this codebase on | ||
purpose. | ||
|
||
Feel free to fork this project and play around! | ||
|
||
## Usage | ||
|
||
``` | ||
npm run knip | ||
``` | ||
|
||
## Issues | ||
|
||
Running `knip` on this codebase will report the following issues: | ||
|
||
``` | ||
❯ knip | ||
Unlisted dependencies (1) | ||
unhead imported.ts | ||
Unused exports (1) | ||
unusedFunction unknown imported.ts:10:14 | ||
``` | ||
|
||
- `unhead` is an unlisted dependency, because it's used in `imported.ts`, but | ||
not listed in `package.json` | ||
- `unused` is exported from `imported.ts` but it's not imported anywhere, so | ||
it's reported as an unused export. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { x } from 'tinyexec'; | ||
import { createHead } from 'unhead'; | ||
|
||
x; | ||
|
||
createHead; | ||
|
||
export const used = () => 'used'; | ||
|
||
export const unusedFunction = () => 'unused'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { used } from './imported'; | ||
|
||
used; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "@knip/playground-basic", | ||
"version": "1.0.0", | ||
"private": true, | ||
"scripts": { | ||
"knip": "knip" | ||
}, | ||
"dependencies": { | ||
"tinyexec": "^0.3.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.14.8", | ||
"knip": "^5.30.1", | ||
"typescript": "^5.5.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist | ||
node_modules | ||
tsconfig.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Knip Playground (monorepo) | ||
|
||
Knip playground to show how Knip works. There are issues in this codebase on | ||
purpose. | ||
|
||
Feel free to fork this project and play around! | ||
|
||
## Usage | ||
|
||
``` | ||
npm run knip | ||
``` | ||
|
||
## Issues | ||
|
||
Running `knip` on this codebase will report the following issues: | ||
|
||
``` | ||
❯ knip | ||
Unused dependencies (1) | ||
tinyglobby package.json | ||
Unlisted dependencies (1) | ||
js-yaml packages/shared/src/used-fn.ts | ||
Unused exports (1) | ||
unusedFunction unknown packages/shared/src/exports.ts:7:14 | ||
``` | ||
|
||
- `tinyglobby` is unused in the root `package.json`. It's listed and used in the | ||
`packages/shared` workspace, but not referenced elsewhere in the root | ||
workspace. | ||
- `js-yaml` is used in `packages/shared/src/used-fn.ts`, but it's not listed as | ||
a dependency in `packages/shared/package.json`. | ||
- `unusedFunction` is exported from `packages/shared/src/exports.ts` but it's | ||
not imported anywhere. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** @type {import('knip').KnipConfig} */ | ||
const config = { | ||
workspaces: { | ||
'packages/shared': { | ||
includeEntryExports: true, | ||
}, | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "@knip/playground-monorepo", | ||
"version": "1.0.0", | ||
"private": true, | ||
"workspaces": ["packages/*"], | ||
"scripts": { | ||
"build": "tsc -b packages/shared packages/server packages/client", | ||
"knip": "knip" | ||
}, | ||
"dependencies": { | ||
"tinyglobby": "^0.2.6" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.14.8", | ||
"knip": "^5.30.1", | ||
"typescript": "^5.5.4" | ||
} | ||
} |
Oops, something went wrong.