@code-pushup/lighthouse-plugin 0.53.1 → 0.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // packages/plugin-lighthouse/package.json
2
2
  var name = "@code-pushup/lighthouse-plugin";
3
- var version = "0.53.1";
3
+ var version = "0.55.0";
4
4
 
5
5
  // packages/plugin-lighthouse/src/lib/constants.ts
6
6
  import { DEFAULT_FLAGS } from "chrome-launcher/dist/flags.js";
@@ -37,7 +37,7 @@ function exists(value) {
37
37
  return value != null;
38
38
  }
39
39
  function getMissingRefsForCategories(categories2, plugins) {
40
- if (categories2.length === 0) {
40
+ if (!categories2 || categories2.length === 0) {
41
41
  return false;
42
42
  }
43
43
  const auditRefsFromCategory = categories2.flatMap(
@@ -114,7 +114,6 @@ var fileNameSchema = z.string().trim().regex(filenameRegex, {
114
114
  message: `The filename has to be valid`
115
115
  }).min(1, { message: "file name is invalid" });
116
116
  var positiveIntSchema = z.number().int().positive();
117
- var nonnegativeIntSchema = z.number().int().nonnegative();
118
117
  var nonnegativeNumberSchema = z.number().nonnegative();
119
118
  function packageVersionSchema(options) {
120
119
  const { versionDescription = "NPM version of the package", required } = options ?? {};
@@ -537,12 +536,9 @@ var unrefinedCoreConfigSchema = z14.object({
537
536
  var coreConfigSchema = refineCoreConfig(unrefinedCoreConfigSchema);
538
537
  function refineCoreConfig(schema) {
539
538
  return schema.refine(
540
- (coreCfg) => !getMissingRefsForCategories(coreCfg.categories ?? [], coreCfg.plugins),
541
- (coreCfg) => ({
542
- message: missingRefsForCategoriesErrorMsg(
543
- coreCfg.categories ?? [],
544
- coreCfg.plugins
545
- )
539
+ ({ categories: categories2, plugins }) => !getMissingRefsForCategories(categories2, plugins),
540
+ ({ categories: categories2, plugins }) => ({
541
+ message: missingRefsForCategoriesErrorMsg(categories2, plugins)
546
542
  })
547
543
  );
548
544
  }
@@ -597,19 +593,16 @@ var reportSchema = packageVersionSchema({
597
593
  ).merge(
598
594
  z15.object(
599
595
  {
600
- categories: z15.array(categoryConfigSchema),
601
596
  plugins: z15.array(pluginReportSchema).min(1),
597
+ categories: z15.array(categoryConfigSchema).optional(),
602
598
  commit: commitSchema.describe("Git commit for which report was collected").nullable()
603
599
  },
604
600
  { description: "Collect output data" }
605
601
  )
606
602
  ).refine(
607
- (report) => !getMissingRefsForCategories(report.categories, report.plugins),
608
- (report) => ({
609
- message: missingRefsForCategoriesErrorMsg(
610
- report.categories,
611
- report.plugins
612
- )
603
+ ({ categories: categories2, plugins }) => !getMissingRefsForCategories(categories2, plugins),
604
+ ({ categories: categories2, plugins }) => ({
605
+ message: missingRefsForCategoriesErrorMsg(categories2, plugins)
613
606
  })
614
607
  );
615
608
 
@@ -661,7 +654,7 @@ var auditDiffSchema = scorableWithPluginDiffSchema.merge(
661
654
  z16.object({
662
655
  values: makeComparisonSchema(auditValueSchema).merge(
663
656
  z16.object({
664
- diff: z16.number().int().describe("Value change (`values.after - values.before`)")
657
+ diff: z16.number().describe("Value change (`values.after - values.before`)")
665
658
  })
666
659
  ).describe("Audit `value` comparison"),
667
660
  displayValues: makeComparisonSchema(auditDisplayValueSchema).describe(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-pushup/lighthouse-plugin",
3
- "version": "0.53.1",
3
+ "version": "0.55.0",
4
4
  "license": "MIT",
5
5
  "description": "Code PushUp plugin for measuring web performance and quality with Lighthouse 🔥",
6
6
  "homepage": "https://github.com/code-pushup/cli/tree/main/packages/plugin-lighthouse#readme",
@@ -38,8 +38,8 @@
38
38
  "main": "./index.js",
39
39
  "types": "./src/index.d.ts",
40
40
  "dependencies": {
41
- "@code-pushup/models": "0.53.1",
42
- "@code-pushup/utils": "0.53.1",
41
+ "@code-pushup/models": "0.55.0",
42
+ "@code-pushup/utils": "0.55.0",
43
43
  "ansis": "^3.3.0",
44
44
  "chrome-launcher": "^1.1.1",
45
45
  "lighthouse": "^12.0.0",
@@ -1,4 +0,0 @@
1
- export type DOM = {
2
- append: (v: string) => string;
3
- createComponent: (type: 'crcChain', opt: Record<string, unknown>) => string;
4
- };