Skip to content
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}

- run: npx nx format:check
- run: npx nx affected -t lint unit-test integration-test build
- run: npx nx affected -t lint unit-test int-test e2e-test build
53 changes: 53 additions & 0 deletions .verdaccio/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# path to a directory with all packages
storage: ../tmp/local-registry/storage

# a list of other known repositories we can talk to
uplinks:
npmjs:
url: https://registry.npmjs.org/
maxage: 60m

packages:
# exceptions for external @code-pushup packages
'@code-pushup/models':
access: $all
proxy: npmjs
'@code-pushup/utils':
access: $all
proxy: npmjs
'@code-pushup/core':
access: $all
proxy: npmjs
'@code-pushup/cli':
access: $all
proxy: npmjs
'@code-pushup/portal-client':
access: $all
proxy: npmjs
'@code-pushup/eslint-config':
access: $all
proxy: npmjs

# allow publishing local packages
'@code-pushup/*':
access: $all
publish: $all
unpublish: $all

# proxy other packages to official NPM registry
'**':
access: $all
proxy: npmjs

# log settings
log:
type: stdout
format: pretty
level: warn

publish:
allow_offline: true # set offline to true to allow publish offline

middlewares:
audit:
enabled: true # needed to run npm audit in e2e test folder
10 changes: 10 additions & 0 deletions code-pushup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { CoreConfig } from '@code-pushup/models';
import { knipPlugin } from './packages/plugin-knip/src/lib';

export default {
plugins: [
knipPlugin({
outputFile: '.code-pushup/knip-report.json',
}),
],
} satisfies CoreConfig;
40 changes: 40 additions & 0 deletions e2e/plugin-knip-e2e/.eslint/eslint-report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[
{
"filePath": "/Users/michael_hladky/WebstormProjects/cli/e2e/plugin-knip-e2e/eslint.config.js",
"messages": [],
"suppressedMessages": [],
"errorCount": 0,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"usedDeprecatedRules": []
},
{
"filePath": "/Users/michael_hladky/WebstormProjects/cli/e2e/plugin-knip-e2e/tests/collect.e2e.test.ts",
"messages": [],
"suppressedMessages": [],
"errorCount": 0,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"usedDeprecatedRules": [
{
"ruleId": "vitest/no-done-callback",
"replacedBy": []
}
]
},
{
"filePath": "/Users/michael_hladky/WebstormProjects/cli/e2e/plugin-knip-e2e/vitest.e2e.config.ts",
"messages": [],
"suppressedMessages": [],
"errorCount": 0,
"fatalErrorCount": 0,
"warningCount": 0,
"fixableErrorCount": 0,
"fixableWarningCount": 0,
"usedDeprecatedRules": []
}
]
12 changes: 12 additions & 0 deletions e2e/plugin-knip-e2e/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import tseslint from 'typescript-eslint';
import baseConfig from '../../eslint.config.js';

export default tseslint.config(...baseConfig, {
files: ['**/*.ts'],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
});
12 changes: 12 additions & 0 deletions e2e/plugin-knip-e2e/mocks/fixtures/default-setup/_package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "knip-plugin-test-fixture-default-setup",
"version": "0.0.0",
"private": true,
"type": "module",
"dependencies": {
"lodash": "^4.17.21"
},
"devDependencies": {
"typescript": "^5.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import knipPlugin from '@code-pushup/knip-plugin';
import type { CoreConfig } from '@code-pushup/models';

export default {
plugins: [await knipPlugin()],
} satisfies CoreConfig;
7 changes: 7 additions & 0 deletions e2e/plugin-knip-e2e/mocks/fixtures/default-setup/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export function hello() {
return 'Hello, World!';
}

export function unused() {
return 'This function is not used';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "reporter-test-package",
"dependencies": {
"zod": "^3.23.6"
}
}
17 changes: 17 additions & 0 deletions e2e/plugin-knip-e2e/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "plugin-knip-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "e2e/plugin-knip-e2e/src",
"projectType": "application",
"targets": {
"lint": {},
"e2e": {
"executor": "@nx/vitest:test",
"options": {
"configFile": "{projectRoot}/vitest.e2e.config.ts"
}
}
},
"implicitDependencies": ["@code-pushup/plugin-knip"],
"tags": ["scope:plugin", "type:e2e"]
}
Loading
Loading