Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
d3cfcc7
wip
BioPhoton Mar 6, 2024
07499de
Merge branch 'main' into add-lighthouse-runner
BioPhoton Mar 6, 2024
98783a2
wip
BioPhoton Mar 7, 2024
911e486
refactor(plugin-lighthouse): fix lighthouse config for runner
BioPhoton Mar 8, 2024
4b3ec98
test(plugin-lighthouse): add runner tests
BioPhoton Mar 8, 2024
d5a357d
Merge branch 'main' into add-lighthouse-runner
BioPhoton Mar 8, 2024
6e47a7e
refactor: fix lint
BioPhoton Mar 8, 2024
7f74d92
refactor: fix lint
BioPhoton Mar 8, 2024
647a814
refactor: fix import
BioPhoton Mar 8, 2024
eb05096
test(plugin-lighthouse): adjust timeout
BioPhoton Mar 8, 2024
2bafe47
test(plugin-lighthouse): use headless new by default
BioPhoton Mar 8, 2024
d96ae78
docs(plugin-lighthouse): add docs
BioPhoton Mar 8, 2024
632e268
test(plugin-lighthouse): remove e2e setup
BioPhoton Mar 8, 2024
a6afbcd
refactor(plugin-lighthouse): remove from main config
BioPhoton Mar 8, 2024
2f6f0f5
refactor: cleanup
BioPhoton Mar 8, 2024
79021af
wip
BioPhoton Mar 9, 2024
8b6b62c
wip
BioPhoton Mar 9, 2024
87abca9
wip
BioPhoton Mar 9, 2024
3c30b55
wip
BioPhoton Mar 9, 2024
7a57bca
wip
BioPhoton Mar 9, 2024
214c761
wip
BioPhoton Mar 9, 2024
57ef882
refactor(plugin-lighthouse): fix lint
BioPhoton Mar 9, 2024
1c472fc
docs(plugin-lighthouse): add flags docs
BioPhoton Mar 9, 2024
8998fbd
wip
BioPhoton Mar 9, 2024
f19f2f4
wip
BioPhoton Mar 10, 2024
45d7a4d
wip
BioPhoton Mar 10, 2024
0a8f582
wip
BioPhoton Mar 10, 2024
849bf63
wip
BioPhoton Mar 10, 2024
03b5a8e
wip
BioPhoton Mar 10, 2024
60782c6
test(plugin-lighthouse): mock stubEnv CHROME_PATH
ChristopherPHolder Mar 11, 2024
0a9601d
test(plugin-lighthouse): run lh with chrome as shell
ChristopherPHolder Mar 11, 2024
6ccf336
test(plugin-lighthouse): increase test getRunner set timeout
ChristopherPHolder Mar 11, 2024
0466946
Merge remote-tracking branch 'origin/main' into add-lighthouse-runner
BioPhoton Mar 12, 2024
8ac52e0
fix
BioPhoton Mar 12, 2024
0b0b367
fix
BioPhoton Mar 12, 2024
8fdfeef
Merge branch 'main' into add-lighthouse-runner
BioPhoton Mar 13, 2024
fb1710c
increase test timeout
BioPhoton Mar 13, 2024
9fc9eb5
Update packages/plugin-lighthouse/src/lib/lighthouse-plugin.integrati…
BioPhoton Mar 15, 2024
ea35341
Update packages/plugin-lighthouse/src/lib/lighthouse-plugin.unit.test.ts
BioPhoton Mar 15, 2024
e147d0e
Update packages/plugin-lighthouse/README.md
BioPhoton Mar 15, 2024
f48a0a0
Update packages/plugin-lighthouse/README.md
BioPhoton Mar 15, 2024
5bb1e31
Merge branch 'main' into add-lighthouse-runner
BioPhoton Mar 15, 2024
8025292
refactor(plugin-lighthouse): implement PR feedback
BioPhoton Mar 15, 2024
6bfd979
refactor(plugin-lighthouse): adopt docs
BioPhoton Mar 15, 2024
6e5b3cf
feat(example-plugins): add knip to example plugins
BioPhoton Mar 15, 2024
8626b77
refactor(example-plugins): add knip config to monorepo
BioPhoton Mar 15, 2024
6097319
add knip package
BioPhoton Mar 15, 2024
4560d3c
test(example-plugins): add mock data
BioPhoton Mar 15, 2024
a1ff74c
refactor(example-plugins): format
BioPhoton Mar 15, 2024
98e277d
refactor(example-plugins): add targets
BioPhoton Mar 15, 2024
bf82447
refactor(example-plugins): format
BioPhoton Mar 15, 2024
72685b1
refactor(example-plugins): add groups
BioPhoton Mar 15, 2024
d6cf325
refactor(plugin-lighthouse): fix lint
BioPhoton Mar 15, 2024
7a8d790
refactor(plugin-lighthouse): format
BioPhoton Mar 15, 2024
efe17eb
fix flaky test
BioPhoton Mar 15, 2024
f15c9cf
fix lint
BioPhoton Mar 16, 2024
ee90665
test(plugin-lighthouse): adjust test data
BioPhoton Mar 17, 2024
db2b4c9
test(plugin-lighthouse): adjust test data 2
BioPhoton Mar 17, 2024
3d1b0ba
test(plugin-lighthouse): adjust test data 3
BioPhoton Mar 17, 2024
5da5bee
test(plugin-lighthouse): adjust test data 4
BioPhoton Mar 17, 2024
697f151
test(plugin-lighthouse): adjust test data 5
BioPhoton Mar 17, 2024
782b1e6
test(plugin-lighthouse): adjust test data 6
BioPhoton Mar 17, 2024
17fffbe
test(plugin-lighthouse): adjust test data 7
BioPhoton Mar 17, 2024
b72f2a9
test(plugin-lighthouse): adjust test data 8
BioPhoton Mar 17, 2024
5419cd7
Update lighthouse-plugin.ts
BioPhoton Mar 18, 2024
9eded4b
Update README.md
BioPhoton Mar 18, 2024
afd6073
Update utils.ts
BioPhoton Mar 18, 2024
b9ede4d
Update utils.unit.test.ts
BioPhoton Mar 18, 2024
6d37a6c
test(plugin-lighthouse): implement feedback
BioPhoton Mar 19, 2024
644740f
merge main
BioPhoton Mar 19, 2024
987c4b0
fix tests
BioPhoton Mar 19, 2024
400d6f8
fix tests
BioPhoton Mar 20, 2024
7bda9b5
fix tests
BioPhoton Mar 20, 2024
0d2ea93
merge main
BioPhoton Mar 25, 2024
f741e24
adopt docs
BioPhoton Mar 25, 2024
9d132cb
format
BioPhoton Mar 25, 2024
ebfd205
format
BioPhoton Mar 25, 2024
d62721a
adjust tests
BioPhoton Mar 25, 2024
d393f96
fix runner typing
BioPhoton Mar 25, 2024
aaa57a1
fix test
BioPhoton Mar 25, 2024
c3749b1
fix test
BioPhoton Mar 25, 2024
6087510
fix test 2
BioPhoton Mar 25, 2024
6dc4146
fix test 3
BioPhoton Mar 25, 2024
3295802
docs(plugin-lighthouse): add CONTRIBUTING.md and images
BioPhoton Mar 26, 2024
1672db2
test(plugin-lighthouse): add auto-detection of chrome path
BioPhoton Mar 26, 2024
d82f1ab
refactor(plugin-lighthouse): adopt path
BioPhoton Mar 26, 2024
932b876
ci(plugin-lighthouse): add custom chrome path to CI
BioPhoton Mar 26, 2024
dde09c5
refactor(plugin-lighthouse): format
BioPhoton Mar 26, 2024
a68c6c3
ci(plugin-lighthouse): add chrome path
BioPhoton Mar 26, 2024
dbfa1c2
refactor: debug chrome path 1
BioPhoton Mar 26, 2024
63727e4
refactor: debug chrome path 2
BioPhoton Mar 26, 2024
59b93f2
refactor: debug chrome path 3
BioPhoton Mar 26, 2024
9e35e31
Merge branch 'main' into example-plugin-knip
BioPhoton Mar 26, 2024
cd4059a
wip
BioPhoton Mar 26, 2024
bacca71
wip
BioPhoton Mar 26, 2024
c000966
wip
BioPhoton Mar 26, 2024
807180d
wip
BioPhoton Mar 26, 2024
727d9b5
wip
BioPhoton Mar 26, 2024
ca6e88f
Merge branch 'main' into add-lighthouse-runner
BioPhoton Mar 27, 2024
26cccf0
Update testing/test-setup/src/lib/chrome-path.setup.ts
BioPhoton Mar 27, 2024
f5215fc
Update packages/plugin-lighthouse/CONTRIBUTING.md
BioPhoton Mar 27, 2024
3f8b7e2
refactor: fix evn vars for windows
BioPhoton Mar 27, 2024
ff5ab96
Update packages/plugin-lighthouse/CONTRIBUTING.md
BioPhoton Mar 27, 2024
46c5c31
test(plugin-lighthouse): add afterAll hook
BioPhoton Mar 27, 2024
37be116
ci: adjust env ver config
BioPhoton Mar 27, 2024
ac29985
ci: adjust env ver config 2
BioPhoton Mar 27, 2024
1ca82fa
ci: adjust env ver config 3
BioPhoton Mar 27, 2024
db23811
ci: adjust env ver config 4
BioPhoton Mar 27, 2024
4ce7a36
ci: adjust env ver config 5
BioPhoton Mar 27, 2024
8832d67
ci: adjust env ver config 6
BioPhoton Mar 27, 2024
b8f68cf
ci: adjust env ver config 7
BioPhoton Mar 27, 2024
cc75d36
ci: adjust env ver config 8
BioPhoton Mar 27, 2024
6aa451c
ci: adjust env ver config 9
BioPhoton Mar 27, 2024
99da9ef
ci: adjust env ver config 10
BioPhoton Mar 27, 2024
5244e0d
ci: adjust env ver config 11
BioPhoton Mar 27, 2024
9c18a2f
ci: adjust env ver config 12
BioPhoton Mar 27, 2024
e776962
ci: adjust env ver config 13
BioPhoton Mar 27, 2024
d3d9660
ci: adjust env ver config 14
BioPhoton Mar 27, 2024
d3b7887
ci: adjust env ver config 15
BioPhoton Mar 27, 2024
96bb8ba
ci: log env 1
BioPhoton Mar 27, 2024
b2b4be4
ci: log env 2
BioPhoton Mar 27, 2024
0501002
ci: log env 3
BioPhoton Mar 27, 2024
a010d54
ci: log env 4
BioPhoton Mar 27, 2024
1162bad
ci: log env 5
BioPhoton Mar 27, 2024
6f0cc32
ci: log env 6
BioPhoton Mar 27, 2024
b7ffc1a
ci: log env 7
BioPhoton Mar 27, 2024
1032261
ci: add comments to chrome path logic
BioPhoton Mar 27, 2024
a9e98b3
ci: add debug info
BioPhoton Mar 27, 2024
0cbd040
format
BioPhoton Mar 27, 2024
213bf3b
test timing
BioPhoton Mar 28, 2024
e05bb04
test debug
BioPhoton Mar 28, 2024
f5f1647
test debug 2
BioPhoton Mar 28, 2024
1921827
test debug logs
BioPhoton Mar 28, 2024
2a2c79b
test debug logs 2
BioPhoton Mar 28, 2024
6dec2cd
test debug logs 3
BioPhoton Mar 28, 2024
61600d3
test debug logs 4
BioPhoton Mar 28, 2024
9237d67
test debug logs 5
BioPhoton Mar 28, 2024
1c0c151
docs(plugin-lighthouse): add troubleshooting section to CONTRIBUTING.md
BioPhoton Mar 28, 2024
a4d84fa
timeout 1
BioPhoton Mar 28, 2024
8480c28
timeout 35_000
BioPhoton Mar 28, 2024
396ff9c
timeout 30_000
BioPhoton Mar 28, 2024
2bfec94
timeout 35_000
BioPhoton Mar 28, 2024
037c9a2
docs(plugin-lighthouse): extend troubleshooting section
BioPhoton Mar 28, 2024
46faf2d
docs(plugin-lighthouse): extend troubleshooting section
BioPhoton Mar 28, 2024
5773b1a
cleanup
BioPhoton Mar 28, 2024
af6ed72
test: implement flag to skip long running tasks
BioPhoton Mar 28, 2024
e0ed526
test: adjust flag to skip long running tasks
BioPhoton Mar 28, 2024
327e574
adjust test time
BioPhoton Mar 28, 2024
1489736
fix typo
BioPhoton Mar 28, 2024
b528e2e
adjust test logic
BioPhoton Mar 28, 2024
93df764
add docs
BioPhoton Mar 28, 2024
13cba55
add better docs
BioPhoton Mar 28, 2024
d2620a4
Merge branch 'main' into example-plugin-knip
BioPhoton Mar 30, 2024
45a1225
merge main
BioPhoton Mar 30, 2024
a479c8d
adopt knip
BioPhoton Mar 30, 2024
3f17e19
merge lh runner
BioPhoton Mar 30, 2024
985ac71
edit config & docs
BioPhoton Mar 31, 2024
eff3128
adopt groups and logic
BioPhoton Mar 31, 2024
6f2d45a
update package json
BioPhoton Mar 31, 2024
82cdea8
feat(examples-plugins): add knip plugin
BioPhoton Mar 31, 2024
9c43249
refactor(examples-plugins): cleanup file configs
BioPhoton Mar 31, 2024
bb7e696
fix package-lock.json
BioPhoton Mar 31, 2024
1deac75
refactor(examples-react-todos-app): add knip setup
BioPhoton Mar 31, 2024
035be7d
remove changes
BioPhoton Mar 31, 2024
907cc6a
remove changes
BioPhoton Mar 31, 2024
1408acf
remove changes
BioPhoton Mar 31, 2024
ccaf94a
remove changes
BioPhoton Mar 31, 2024
baa8b12
Update .github/workflows/ci.yml
BioPhoton Mar 31, 2024
a8e1fad
Update CONTRIBUTING.md
BioPhoton Mar 31, 2024
a11e120
remove changes
BioPhoton Mar 31, 2024
5efc552
adjust index.ts
BioPhoton Mar 31, 2024
097f915
fix packages 1
BioPhoton Apr 1, 2024
9db74d7
fix packages 2
BioPhoton Apr 1, 2024
8025743
adjust tests
BioPhoton Apr 1, 2024
439a298
show last symbol as source reference
BioPhoton Apr 1, 2024
1f92a1f
adopt tests
BioPhoton Apr 1, 2024
016de2c
fix tests
BioPhoton Apr 1, 2024
1df5309
knip config update
BioPhoton Apr 7, 2024
b47d571
knip config update 2
BioPhoton Apr 7, 2024
acb6cbb
Merge branch 'main' into example-plugin-knip
BioPhoton Apr 10, 2024
29e2c12
merge main
BioPhoton Apr 10, 2024
6fc824c
wip
BioPhoton Apr 10, 2024
f7b9d3b
Merge branch 'main' into example-plugin-knip
BioPhoton Apr 11, 2024
bf5ef2a
merge main
BioPhoton Apr 11, 2024
8179611
wip
BioPhoton Apr 11, 2024
c11ffa3
wip
BioPhoton Apr 11, 2024
fbada2a
fix(example-plugins): adjust imports
BioPhoton Apr 14, 2024
7c8b52e
Merge branch 'main' into example-plugin-knip
BioPhoton Apr 14, 2024
01b930d
add link to readme
BioPhoton Apr 14, 2024
65fa9c4
Merge branch 'main' into example-plugin-knip
BioPhoton Apr 14, 2024
a4cfdf0
Merge branch 'main' into example-plugin-knip
BioPhoton Apr 27, 2024
5b58b9b
Merge branch 'main' into example-plugin-knip
BioPhoton May 2, 2024
8c8da11
refactor(examples-plugins): refactor knip reporter
BioPhoton May 4, 2024
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
22 changes: 22 additions & 0 deletions code-pushup.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import 'dotenv/config';
import { join } from 'node:path';
import { z } from 'zod';
import {
KNIP_PLUGIN_SLUG,
KNIP_RAW_REPORT_NAME,
KNIP_REPORT_NAME,
fileSizePlugin,
fileSizeRecommendedRefs,
knipCategoryGroupRef,
knipPlugin,
packageJsonDocumentationGroupRef,
packageJsonPerformanceGroupRef,
packageJsonPlugin,
Expand Down Expand Up @@ -78,6 +84,19 @@ const config: CoreConfig = {
}),

await lighthousePlugin('https://codepushup.dev/'),

await knipPlugin({
rawOutputFile: join(
'.code-pushup',
KNIP_PLUGIN_SLUG,
`${KNIP_RAW_REPORT_NAME.split('.').shift()}-${Date.now()}.json`,
),
outputFile: join(
'.code-pushup',
KNIP_PLUGIN_SLUG,
`${KNIP_REPORT_NAME.split('.').shift()}-${Date.now()}.json`,
),
}),
],

categories: [
Expand Down Expand Up @@ -168,6 +187,9 @@ const config: CoreConfig = {
...fileSizeRecommendedRefs,
packageJsonPerformanceGroupRef,
packageJsonDocumentationGroupRef,
knipCategoryGroupRef('files'),
knipCategoryGroupRef('dependencies'),
knipCategoryGroupRef('exports'),
],
},
],
Expand Down
138 changes: 138 additions & 0 deletions examples/plugins/mocks/knip-raw.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import {ReporterOptions} from "knip";

export const rawReport: Pick<ReporterOptions, 'report' | 'issues' | 'options'> = {
report: {
files: true,
dependencies: true,
devDependencies: true,
optionalPeerDependencies: true,
unlisted: true,
binaries: true,
unresolved: true,
exports: true,
nsExports: false,
types: true,
nsTypes: false,
enumMembers: true,
classMembers: false,
duplicates: true,
},
issues: {
files: new Set(['code-pushup.json']),
dependencies: {
'package.json': {
'cli-table3': {
type: 'dependencies',
filePath:
'/Users/username/Projects/code-pushup/package.json',
symbol: 'cli-table3',
severity: 'error',
},
}
},
devDependencies: {
'package.json': {
'@trivago/prettier-plugin-sort-imports': {
type: 'devDependencies',
filePath:
'/Users/username/Projects/code-pushup/package.json',
symbol: '@trivago/prettier-plugin-sort-imports',
severity: 'error',
},
},
},
optionalPeerDependencies: {
'package.json': {
'ts-node': {
type: 'devDependencies',
filePath:
'/Users/username/Projects/code-pushup/package.json',
symbol: 'ts-node',
severity: 'error',
},
},
},
unlisted: {
'packages/plugin-lighthouse/.eslintrc.json': {
'jsonc-eslint-parser': {
type: 'unlisted',
filePath:
'/Users/username/Projects/code-pushup/packages/plugin-lighthouse/.eslintrc.json',
symbol: 'jsonc-eslint-parser',
severity: 'error',
},
},
'.eslintrc.json': {
'jsonc-eslint-parser': {
type: 'unlisted',
filePath:
'/Users/username/Projects/code-pushup/.eslintrc.json',
symbol: 'jsonc-eslint-parser',
severity: 'error',
},
}
},
binaries: {},
unresolved: {},
exports: {
'packages/models/src/lib/category-config.ts': {
duplicateErrorMsg: {
type: 'exports',
filePath:
'/Users/username/Projects/code-pushup/packages/models/src/lib/category-config.ts',
symbol: 'duplicateErrorMsg',
symbolType: 'function',
pos: 1571,
line: 54,
col: 17,
severity: 'error',
},
},
},
nsExports: {},
types: {
'packages/models/src/lib/group.ts': {
GroupMeta: {
type: 'types',
filePath:
'/Users/username/Projects/code-pushup/packages/models/src/lib/group.ts',
symbol: 'GroupMeta',
symbolType: 'type',
pos: 701,
line: 26,
col: 13,
severity: 'error',
},
},
},
nsTypes: {},
enumMembers: {},
classMembers: {},
duplicates: {
'packages/nx-plugin/src/generators/init/generator.ts': {
'initGenerator|default': {
type: 'duplicates',
filePath:
'/Users/username/Projects/code-pushup/packages/nx-plugin/src/generators/init/generator.ts',
symbol: 'initGenerator|default',
symbols: [
{
symbol: 'initGenerator',
line: 76,
col: 2,
pos: 2144,
},
{
symbol: 'default',
line: 91,
col: 15,
pos: 2479,
},
],
severity: 'error',
},
},
},
},
options: '',
};
130 changes: 130 additions & 0 deletions examples/plugins/mocks/knip-report.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
export const input = {
files: ['src/unused.ts'],
issues: [
{
file: 'package.json',
owners: ['@org/admin'],
dependencies: ['jquery', 'moment'],
devDependencies: [],
unlisted: [{ name: 'react' }, { name: '@org/unresolved' }],
exports: [],
types: [],
duplicates: [],
},
{
file: 'src/Registration.tsx',
owners: ['@org/owner'],
dependencies: [],
devDependencies: [],
binaries: [],
unresolved: [{ name: './unresolved', line: 8, col: 23, pos: 403 }],
exports: [{ name: 'unusedExport', line: 1, col: 14, pos: 13 }],
types: [
{ name: 'unusedEnum', line: 3, col: 13, pos: 71 },
{ name: 'unusedType', line: 8, col: 14, pos: 145 },
],
enumMembers: {
MyEnum: [
{ name: 'unusedMember', line: 13, col: 3, pos: 167 },
{ name: 'unusedKey', line: 15, col: 3, pos: 205 },
],
},
classMembers: {
MyClass: [
{ name: 'unusedMember', line: 40, col: 3, pos: 687 },
{ name: 'unusedSetter', line: 61, col: 14, pos: 1071 },
],
},
duplicates: ['Registration', 'default'],
},
],
};

export const output = [
{
slug: 'unused-files',
value: 1,
displayValue: '1 unused files',
score: 0,
details: {
issues: [
{
message: 'File "src/unused.ts" unused',
severity: 'warning',
source: {
file: 'src/unused.ts',
},
},
],
},
},
{
slug: 'unlisted',
value: 2,
displayValue: '2 unlisted',
score: 0,
details: {
issues: [
{
message: 'react',
severity: 'warning',
source: {
file: '???',
},
},
{
message: '@org/unresolved',
severity: 'warning',
source: {
file: '???',
},
},
],
},
},
{
slug: 'dependencies',
value: 2,
displayValue: '2 dependencies',
score: 0,
details: {
issues: [
{
message: 'jquery',
severity: 'warning',
source: {
file: 'package.json',
},
},
{
message: 'moment',
severity: 'warning',
source: {
file: 'package.json',
},
},
],
},
},
{
slug: 'unresolved',
value: 2,
displayValue: '2 unresolved',
score: 0,
details: {
issues: [
{
message: 'jquery',
severity: 'warning',
source: {
file: 'src/Registration.tsx',
position: {
startLine: 8,
startColumn: 23,
},
},
},
],
},
},
];
3 changes: 3 additions & 0 deletions examples/plugins/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"main": "examples/plugins/src/index.ts",
"tsConfig": "examples/plugins/tsconfig.lib.json",
"assets": ["examples/plugins/*.md"],
"additionalEntryPoints": [
"examples/plugins/src/knip/src/reporter/index.ts"
],
"esbuildConfig": "esbuild.config.js"
}
},
Expand Down
8 changes: 8 additions & 0 deletions examples/plugins/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ export {
LIGHTHOUSE_OUTPUT_FILE_DEFAULT,
recommendedRefs as lighthouseCorePerfGroupRefs,
} from './lighthouse/src/index';
export {
knipPlugin,
knipCategoryAuditRef,
knipCategoryGroupRef,
KNIP_PLUGIN_SLUG,
KNIP_RAW_REPORT_NAME,
KNIP_REPORT_NAME,
} from './knip/src/index';
Loading