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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [20.x, 22.x, 24.x, 25.x]
node-version: [22.x, 24.x, 26.x]
os: [ubuntu-latest, windows-latest, macos-latest]
timeout-minutes: 5
steps:
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# 8.0.0 (Unpublished)

## ⚠️ Breaking changes

- Minimum Node.js version is now 22.13.0 (previously 20, which is now EOL).
- Removed commands that were deprecated in 7.0.0. There are alternatives for all removed commands. See the 7.0.0 release notes for details.
- Remove CommonJS exports. The package is now ESM-only. Use `import` instead of `require()`.

## 🚩 Enhancements

- Add support for project-level `calibre.json`, e.g.: `{ "site": "my-site-slug" }` to avoid having to pass `--site` for every command.
- Commands that have pagination now support an `--all` flag, which will automatically paginate through all results and return a complete list.
- Use consistent JSON error output.
- Use consistent table formatting.
- Use consistent date parsing.

## 🧹 Housekeeping

- Replaced `chalk` with Node.js built-in `node:util` `styleText` for terminal colouring.
- Replaced `ora` with `nanospinner` for terminal spinners.
- Removed `log-symbols` dependency in favour of Unicode characters.
- Updated CI matrix to test Node.js 22, 24, and 26.

# 7.0.0 (2026-05-07)

## ⚠️ Major release with breaking changes
Expand Down
4 changes: 2 additions & 2 deletions __tests__/cli/__snapshots__/metric-list.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
exports[`metric-list lists metrics 1`] = `
"2 metrics
IDENTIFIER | NAME | CATEGORY | GOOD | POOR | RECOMMENDED
first-contentful-paint | First Contentful Paint | Performance | > 1.80 sec | < 3.00 sec | ✔
largest-contentful-paint | Largest Contentful Paint | Performance | > 2.50 sec | < 4.00 sec | ✔ "
first-contentful-paint | First Contentful Paint | Performance | > 1.80 sec | < 3.00 sec |
largest-contentful-paint | Largest Contentful Paint | Performance | > 2.50 sec | < 4.00 sec | "
`;
38 changes: 10 additions & 28 deletions __tests__/cli/__snapshots__/site.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,41 +1,23 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`missing site argument 1`] = `
exports[`missing subcommand 1`] = `
"

Missing required argument: site
Not enough non-option arguments: got 0, need at least 1

calibre site pages [options]
calibre site <command>

Options:

--help Show help [boolean]
--version Show version number [boolean]
--site A unique slug identifying each Site. You can find it in Site
Settings → General or by using the calibre site list command.
[string] [required]
--count The number of items to return (default: 25, maximum: 500).
[default: 25]
--cursor The cursor to fetch records after
--json Outputs the results of the command in JSON format."
`;

exports[`missing site argument value 1`] = `
"
Manage your Sites.

Not enough arguments following: site
Commands:

calibre site pages [options]
calibre site create <name> [options] Add a Site for Calibre to monitor.
calibre site list List all Sites you are tracking in
Calibre.
calibre site delete <slug> [options] Delete a selected Site.

Options:

--help Show help [boolean]
--version Show version number [boolean]
--site A unique slug identifying each Site. You can find it in Site
Settings → General or by using the calibre site list command.
[string] [required]
--count The number of items to return (default: 25, maximum: 500).
[default: 25]
--cursor The cursor to fetch records after
--json Outputs the results of the command in JSON format."
--version Show version number [boolean]"
`;
9 changes: 9 additions & 0 deletions __tests__/cli/crux/__snapshots__/history.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`crux history displays crux history 1`] = `
"PERIOD | METRIC | P75
31-Jan-2024 | Largest Contentful Paint | 2.10 sec
31-Dec-2023 | Largest Contentful Paint | 2.30 sec
31-Jan-2024 | Cumulative Layout Shift | 0.05
31-Dec-2023 | Cumulative Layout Shift | 0.08 "
`;
2 changes: 1 addition & 1 deletion __tests__/cli/crux/__snapshots__/summary.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`crux summary displays crux summary 1`] = `
"Form factors: desktop 4500.0% | phone 5000.0% | tablet 500.0%
"Form factors: desktop 45.0% | phone 50.0% | tablet 5.0%

METRIC | P75
Largest Contentful Paint | 2.10 sec
Expand Down
12 changes: 12 additions & 0 deletions __tests__/cli/crux/__snapshots__/url.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`crux url displays crux url details 1`] = `
"
METRIC | P75
Largest Contentful Paint | 2.10 sec
Cumulative Layout Shift | 0.05

History:
PERIOD | METRIC | P75
31-Jan-2024 | Largest Contentful Paint | 2.10 sec"
`;
7 changes: 7 additions & 0 deletions __tests__/cli/crux/__snapshots__/urls.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`crux urls lists crux urls 1`] = `
"URL | ASSESSMENT | CRUXLARGESTCONTENTFULPAINT | CRUXCUMULATIVELAYOUTSHIFT
https://example.com/page1 | Good | 2.10 sec | 0.05
https://example.com/page2 | Needs Improvement | 3.50 sec | 0.15 "
`;
19 changes: 19 additions & 0 deletions __tests__/cli/crux/history.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {
runCLI,
setupIntegrationServer,
teardownIntegrationServer
} from '../../utils'

import cruxHistory from '../../fixtures/cruxHistory.json'

describe('crux history', () => {
beforeAll(async () => await setupIntegrationServer(cruxHistory))
afterAll(async () => await teardownIntegrationServer())

test('displays crux history', async () => {
const out = await runCLI({
args: 'crux history --site=test'
})
expect(out).toMatchSnapshot()
})
})
19 changes: 19 additions & 0 deletions __tests__/cli/crux/url.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {
runCLI,
setupIntegrationServer,
teardownIntegrationServer
} from '../../utils'

import cruxUrl from '../../fixtures/cruxUrl.json'

describe('crux url', () => {
beforeAll(async () => await setupIntegrationServer(cruxUrl))
afterAll(async () => await teardownIntegrationServer())

test('displays crux url details', async () => {
const out = await runCLI({
args: 'crux url 123e4567-e89b-12d3-a456-426614174000 --site=test'
})
expect(out).toMatchSnapshot()
})
})
19 changes: 19 additions & 0 deletions __tests__/cli/crux/urls.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {
runCLI,
setupIntegrationServer,
teardownIntegrationServer
} from '../../utils'

import cruxUrls from '../../fixtures/cruxUrls.json'

describe('crux urls', () => {
beforeAll(async () => await setupIntegrationServer(cruxUrls))
afterAll(async () => await teardownIntegrationServer())

test('lists crux urls', async () => {
const out = await runCLI({
args: 'crux urls --site=test'
})
expect(out).toMatchSnapshot()
})
})
3 changes: 3 additions & 0 deletions __tests__/cli/deploy/__snapshots__/create.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`deploy create creates deploy 1`] = `""`;
6 changes: 6 additions & 0 deletions __tests__/cli/deploy/__snapshots__/delete.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`deploy delete deletes deploy 1`] = `
"- Connecting to Calibre
✔ Deploy deleted: 8c68b9f6-b5bf-49bc-abd7-896db6338818"
`;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`site deploys lists all deploys 1`] = `
exports[`deploy list lists all deploys 1`] = `
"3 deploys
UUID | REVISION | REPOSITORY | USERNAME | CREATED
8c68b9f6-b5bf-49bc-abd7-896db6338818 | v1 | https://github.com/calibreapp/app | Deployer | 12:00AM 17-Jan-2019
Expand Down
19 changes: 19 additions & 0 deletions __tests__/cli/deploy/create.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {
runCLI,
setupIntegrationServer,
teardownIntegrationServer
} from '../../utils'

import createDeploy from '../../fixtures/createDeploy.json'

describe('deploy create', () => {
beforeAll(async () => await setupIntegrationServer(createDeploy))
afterAll(async () => await teardownIntegrationServer())

test('creates deploy', async () => {
const out = await runCLI({
args: 'deploy create --site=test --revision=abc123def456'
})
expect(out).toMatchSnapshot()
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,13 @@ import {

import deleteDeploy from '../../fixtures/deleteDeploy.json'

describe('site delete-deploy', () => {
describe('deploy delete', () => {
beforeAll(async () => await setupIntegrationServer(deleteDeploy))
afterAll(async () => await teardownIntegrationServer())

test('requires uuid', async () => {
const out = await runCLI({
args: 'site delete-deploy --site=test',
testForError: true
})
expect(out).toMatchSnapshot()
})

test('deletes deploy', async () => {
const out = await runCLI({
args: 'site delete-deploy --site=test --uuid=1',
args: 'deploy delete --site=test --uuid=1',
testForError: true
})
expect(out).toMatchSnapshot()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import {

import listDeploys from '../../fixtures/listDeploys.json'

describe('site deploys', () => {
describe('deploy list', () => {
beforeAll(async () => await setupIntegrationServer(listDeploys))
afterAll(async () => await teardownIntegrationServer())

test('lists all deploys', async () => {
const out = await runCLI({ args: 'site deploys --site=test' })
const out = await runCLI({
args: 'deploy list --site=test'
})
expect(out).toMatchSnapshot()
})
})
28 changes: 0 additions & 28 deletions __tests__/cli/deprecation.test.js

This file was deleted.

11 changes: 11 additions & 0 deletions __tests__/cli/rum/__snapshots__/config.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`rum config displays rum config 1`] = `
" Enabled: true
Sample Rate: 1
Allowed Origins: https://example.com, https://www.example.com
Endpoint: https://rum.calibreapp.com/collect
Identifier: rum_abc123
Data Retention: 12 months (max: 24)
Exclude EU: false"
`;
7 changes: 7 additions & 0 deletions __tests__/cli/rum/__snapshots__/history.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`rum history displays rum history 1`] = `
"DATE | LCP | CLS | INP | FCP | TTFB | SESSIONS
15-Jan-2024 | 2.10 sec | 0.05 | 180 ms | 1.80 sec | 800 ms | 1250
14-Jan-2024 | 2.30 sec | 0.08 | 200 ms | 1.90 sec | 850 ms | 1180 "
`;
8 changes: 8 additions & 0 deletions __tests__/cli/rum/__snapshots__/pages.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing

exports[`rum pages displays rum pages 1`] = `
"PATH | SESSIONS | LCP | CLS | INP
/ | 5000 | 2.10 sec | 0.05 | 180 ms
/about | 1200 | 2.50 sec | 0.1 | 220 ms
/contact | 800 | 1.90 sec | 0.03 | 150 ms"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import {
teardownIntegrationServer
} from '../../utils'

import listPages from '../../fixtures/listPages.json'
import rumConfig from '../../fixtures/rumConfig.json'

describe('site snapshots', () => {
beforeAll(async () => await setupIntegrationServer(listPages))
describe('rum config', () => {
beforeAll(async () => await setupIntegrationServer(rumConfig))
afterAll(async () => await teardownIntegrationServer())

test('lists all snapshots', async () => {
test('displays rum config', async () => {
const out = await runCLI({
args: 'site pages --site=test'
args: 'rum config --site=test'
})
expect(out).toMatchSnapshot()
})
Expand Down
19 changes: 19 additions & 0 deletions __tests__/cli/rum/history.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {
runCLI,
setupIntegrationServer,
teardownIntegrationServer
} from '../../utils'

import rumHistory from '../../fixtures/rumHistory.json'

describe('rum history', () => {
beforeAll(async () => await setupIntegrationServer(rumHistory))
afterAll(async () => await teardownIntegrationServer())

test('displays rum history', async () => {
const out = await runCLI({
args: 'rum history --site=test'
})
expect(out).toMatchSnapshot()
})
})
19 changes: 19 additions & 0 deletions __tests__/cli/rum/pages.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {
runCLI,
setupIntegrationServer,
teardownIntegrationServer
} from '../../utils'

import rumPages from '../../fixtures/rumPages.json'

describe('rum pages', () => {
beforeAll(async () => await setupIntegrationServer(rumPages))
afterAll(async () => await teardownIntegrationServer())

test('displays rum pages', async () => {
const out = await runCLI({
args: 'rum pages --site=test'
})
expect(out).toMatchSnapshot()
})
})
Loading
Loading