Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f72e3f4
feat!: bump minimum Node.js version to 20.19.0
sorccu May 8, 2026
bd8520d
refactor(cli): add .js extensions to all relative imports
sorccu May 8, 2026
3926f21
feat!: switch CLI and create-CLI to ESM
sorccu May 8, 2026
db7913c
refactor(cli): replace __dirname/__filename with ESM equivalents
sorccu May 8, 2026
88d45ab
refactor(cli): replace require() calls with createRequire for ESM compat
sorccu May 8, 2026
cc46a64
chore(cli): update previously ESM-blocked dependencies
sorccu May 8, 2026
911947c
fix(cli): fix import style for log-symbols, execa, passwd-user
sorccu May 8, 2026
5c8c2d0
chore(cli): update previously Node 20+ blocked dependencies
sorccu May 8, 2026
b1f5307
chore(cli): update tar 7.5.14 → 7.5.15
sorccu May 8, 2026
90cfdcb
refactor(cli): convert dynamic execa imports to static imports
sorccu May 8, 2026
f6343a9
fix(create-cli): fix execa v9 compat in e2e tests
sorccu May 13, 2026
3fb782e
fix(cli): use default import for json5 (ESM compat)
sorccu May 13, 2026
0e0e4db
fix(create-cli): fix ora namespace import for ESM compat
sorccu May 13, 2026
29d99bc
fix(cli): convert e2e config file to ESM
sorccu May 13, 2026
ff1e17a
fix(cli): convert remaining CJS config/fixture files to ESM
sorccu May 13, 2026
8042168
fix(cli): add package.json to check-parse-error e2e fixture
sorccu May 13, 2026
2c46f53
test: log stderr when bootstrap e2e stdout is empty
sorccu May 13, 2026
3b7b17b
fix(cli): disable oclif auto-transpile in ESM bin scripts
sorccu May 13, 2026
344266d
fix(cli): make formatCheckTitle tests platform-agnostic
sorccu May 13, 2026
c309779
refactor(cli): add .js extensions to account members imports
sorccu May 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3,221 changes: 1,483 additions & 1,738 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"@stylistic/eslint-plugin": "^5.10.0",
"eslint": "^10.0.1",
"globals": "^17.6.0",
"lint-staged": "^15.5.2",
"rimraf": "5.0.10",
"lint-staged": "^16.4.0",
"rimraf": "^6.1.3",
"simple-git-hooks": "^2.13.1",
"typescript-eslint": "^8.59.2"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/bin/run
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
/* eslint-disable @typescript-eslint/no-var-requires */

const { run, handle, flush } = require('@oclif/core')
import { execute, settings } from '@oclif/core'

run().catch(handle).finally(flush)
settings.enableAutoTranspile = false
await execute({ dir: import.meta.url })
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "check-parse-error-fixture",
"private": true
}
5 changes: 1 addition & 4 deletions packages/cli/e2e/config/default.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
// 'config' also supports TypeScript, but there are bugs. Hence, we just use JS.
// https://github.com/node-config/node-config/issues/530
const config = {}

config.accountName = process.env.CHECKLY_ACCOUNT_NAME || 'Checkly CLI E2E'
config.apiKey = process.env.CHECKLY_API_KEY
config.accountId = process.env.CHECKLY_ACCOUNT_ID
config.baseURL = process.env.CHECKLY_BASE_URL || 'https://api.checklyhq.com'

// Optional: empty account for edge-case testing (no checks, no groups, etc.)
config.emptyApiKey = process.env.CHECKLY_EMPTY_API_KEY
config.emptyAccountId = process.env.CHECKLY_EMPTY_ACCOUNT_ID

module.exports = config
export default config
2 changes: 1 addition & 1 deletion packages/cli/e2e/config/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is a placeholder to satisfy config's "Strict Mode"
// https://github.com/node-config/node-config/wiki/Strict-Mode# ->
// <- node_env-value-of-node_env-did-not-match-any-deployment-config-file-names
module.exports = {}
export default {}
31 changes: 16 additions & 15 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "checkly",
"version": "0.0.1-dev",
"type": "module",
"description": "Checkly CLI",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -11,7 +12,7 @@
"./util": "./dist/util/index.js"
},
"engines": {
"node": "^18.19.0 || >=20.5.0"
"node": "^20.19.0 || >=22.12.0"
},
"scripts": {
"clean:dist": "rimraf ./dist ./tsconfig.tsbuildinfo",
Expand Down Expand Up @@ -102,30 +103,30 @@
"acorn-walk": "^8.3.5",
"archiver": "7.0.1",
"axios": "^1.16.0",
"chalk": "^4.1.2",
"chalk": "^5.6.2",
"ci-info": "^4.4.0",
"conf": "^10.2.0",
"conf": "^15.1.0",
"debug": "^4.4.3",
"dotenv": "^16.6.1",
"dotenv": "^17.4.2",
"execa": "^9.6.1",
"git-repo-info": "^2.1.1",
"glob": "^10.5.0",
"indent-string": "^4.0.0",
"glob": "^13.0.6",
"indent-string": "^5.0.0",
"json-stream-stringify": "^3.1.6",
"json5": "^2.2.3",
"jwt-decode": "^4.0.0",
"log-symbols": "^4.1.0",
"log-symbols": "^7.0.1",
"luxon": "^3.7.2",
"minimatch": "^9.0.9",
"minimatch": "^10.2.5",
"mqtt": "^5.15.1",
"open": "^8.4.2",
"p-queue": "^6.6.2",
"open": "^11.0.0",
"p-queue": "^9.2.0",
"prompts": "^2.4.2",
"proxy-from-env": "^2.1.0",
"recast": "^0.23.11",
"semver": "^7.7.3",
"tunnel": "^0.0.6",
"uuid": "^11.1.1"
"uuid": "^14.0.0"
},
"devDependencies": {
"@playwright/test": "^1.59.1",
Expand All @@ -139,13 +140,13 @@
"@types/tunnel": "^0.0.7",
"@types/uuid": "^10.0.0",
"@types/ws": "^8.5.5",
"config": "^3.3.12",
"config": "^4.4.1",
"cross-env": "^10.1.0",
"jiti": "^2.7.0",
"nanoid": "^3.3.12",
"nanoid": "^5.1.11",
"oclif": "^4.23.0",
"rimraf": "^5.0.10",
"tar": "^7.5.14",
"rimraf": "^6.1.3",
"tar": "^7.5.15",
"ts-node": "^10.9.2",
"typescript": "^6.0.3",
"vitest": "^3.2.4"
Expand Down
7 changes: 5 additions & 2 deletions packages/cli/src/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import * as os from 'os'
import * as http from 'http'
import * as crypto from 'crypto'
import { jwtDecode } from 'jwt-decode'
import { getDefaults as getApiDefaults } from '../rest/api'
import { assignProxy } from '../services/proxy'
import { getDefaults as getApiDefaults } from '../rest/api.js'
import { assignProxy } from '../services/proxy.js'
import * as fs from 'fs'
import * as path from 'path'
import { fileURLToPath } from 'node:url'

const __dirname = path.dirname(fileURLToPath(import.meta.url))

export type AuthMode = 'signup' | 'login'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
normalizeAccountMemberRole,
normalizeAccountMemberStatus,
normalizeAccountMemberType,
} from '../account/members'
} from '../account/members.js'

describe('account members flag normalization', () => {
it('normalizes type values case-insensitively', () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commands/__tests__/auth-command-init.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ vi.mock('../../rest/api', () => ({
validateAuthentication: vi.fn().mockResolvedValue({ name: 'Test Account' }),
}))

import * as api from '../../rest/api'
import { BaseCommand } from '../baseCommand'
import { AuthCommand } from '../authCommand'
import * as api from '../../rest/api.js'
import { BaseCommand } from '../baseCommand.js'
import { AuthCommand } from '../authCommand.js'

describe('AuthCommand.init', () => {
it('awaits BaseCommand.init before validating authentication', async () => {
Expand Down
70 changes: 35 additions & 35 deletions packages/cli/src/commands/__tests__/command-metadata.spec.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import { describe, expect, it } from 'vitest'
import { BaseCommand } from '../baseCommand'
import { BaseCommand } from '../baseCommand.js'

// Import all non-hidden command classes
import ChecksList from '../checks/list'
import ChecksGet from '../checks/get'
import ChecksStats from '../checks/stats'
import StatusPagesList from '../status-pages/list'
import StatusPagesGet from '../status-pages/get'
import IncidentsList from '../incidents/list'
import IncidentsCreate from '../incidents/create'
import IncidentsUpdate from '../incidents/update'
import IncidentsResolve from '../incidents/resolve'
import EnvLs from '../env/ls'
import EnvAdd from '../env/add'
import EnvRm from '../env/rm'
import EnvUpdate from '../env/update'
import EnvPull from '../env/pull'
import Deploy from '../deploy'
import Destroy from '../destroy'
import Test from '../test'
import Trigger from '../trigger'
import Validate from '../validate'
import Login from '../login'
import Logout from '../logout'
import Whoami from '../whoami'
import Switch from '../switch'
import Runtimes from '../runtimes'
import Rules from '../rules'
import ImportPlan from '../import/plan'
import ImportApply from '../import/apply'
import ImportCommit from '../import/commit'
import ImportCancel from '../import/cancel'
import PwTest from '../pw-test'
import SyncPlaywright from '../sync-playwright'
import SkillsInstall from '../skills/install'
import AccountPlan from '../account/plan'
import AccountMembers from '../account/members'
import ChecksList from '../checks/list.js'
import ChecksGet from '../checks/get.js'
import ChecksStats from '../checks/stats.js'
import StatusPagesList from '../status-pages/list.js'
import StatusPagesGet from '../status-pages/get.js'
import IncidentsList from '../incidents/list.js'
import IncidentsCreate from '../incidents/create.js'
import IncidentsUpdate from '../incidents/update.js'
import IncidentsResolve from '../incidents/resolve.js'
import EnvLs from '../env/ls.js'
import EnvAdd from '../env/add.js'
import EnvRm from '../env/rm.js'
import EnvUpdate from '../env/update.js'
import EnvPull from '../env/pull.js'
import Deploy from '../deploy.js'
import Destroy from '../destroy.js'
import Test from '../test.js'
import Trigger from '../trigger.js'
import Validate from '../validate.js'
import Login from '../login.js'
import Logout from '../logout.js'
import Whoami from '../whoami.js'
import Switch from '../switch.js'
import Runtimes from '../runtimes.js'
import Rules from '../rules.js'
import ImportPlan from '../import/plan.js'
import ImportApply from '../import/apply.js'
import ImportCommit from '../import/commit.js'
import ImportCancel from '../import/cancel.js'
import PwTest from '../pw-test.js'
import SyncPlaywright from '../sync-playwright.js'
import SkillsInstall from '../skills/install.js'
import AccountPlan from '../account/plan.js'
import AccountMembers from '../account/members.js'

const commands: Array<[string, typeof BaseCommand]> = [
['account members', AccountMembers],
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/src/commands/__tests__/confirm-flow-deploy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ vi.mock('prompts', () => ({
default: vi.fn(() => Promise.resolve({ confirm: true })),
}))

import { detectCliMode } from '../../helpers/cli-mode'
import * as api from '../../rest/api'
import { parseProject } from '../../services/project-parser'
import { AuthCommand } from '../authCommand'
import Deploy from '../deploy'
import { detectCliMode } from '../../helpers/cli-mode.js'
import * as api from '../../rest/api.js'
import { parseProject } from '../../services/project-parser.js'
import { AuthCommand } from '../authCommand.js'
import Deploy from '../deploy.js'

function createConfirmContext () {
const logged: string[] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ vi.mock('prompts', () => ({
default: vi.fn(() => Promise.resolve({ confirm: true })),
}))

import { detectCliMode } from '../../helpers/cli-mode'
import { detectCliMode } from '../../helpers/cli-mode.js'
import prompts from 'prompts'
import * as api from '../../rest/api'
import { AuthCommand } from '../authCommand'
import Destroy from '../destroy'
import * as api from '../../rest/api.js'
import { AuthCommand } from '../authCommand.js'
import Destroy from '../destroy.js'

function createCommandContext (parsed: unknown) {
const logged: string[] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ vi.mock('prompts', () => ({
default: vi.fn(() => Promise.resolve({ confirm: true })),
}))

import { detectCliMode } from '../../helpers/cli-mode'
import * as api from '../../rest/api'
import { AuthCommand } from '../authCommand'
import EnvRm from '../env/rm'
import { detectCliMode } from '../../helpers/cli-mode.js'
import * as api from '../../rest/api.js'
import { AuthCommand } from '../authCommand.js'
import EnvRm from '../env/rm.js'

function createCommandContext (parsed: unknown) {
const logged: string[] = []
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commands/__tests__/confirm-or-abort.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ vi.mock('prompts', () => ({
default: vi.fn(() => Promise.resolve({ confirm: true })),
}))

import { detectCliMode } from '../../helpers/cli-mode'
import { detectCliMode } from '../../helpers/cli-mode.js'
import prompts from 'prompts'
import type { CommandPreview } from '../../helpers/command-preview'
import type { CommandPreview } from '../../helpers/command-preview.js'

// Minimal AuthCommand-like context for testing confirmOrAbort
// We import the actual method after mocks are set up
import { AuthCommand } from '../authCommand'
import { AuthCommand } from '../authCommand.js'

const basePreview: CommandPreview = {
command: 'incidents create',
Expand Down
18 changes: 9 additions & 9 deletions packages/cli/src/commands/__tests__/init.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { join } from 'path'
import { describe, it, expect, vi, beforeEach } from 'vitest'
import Init from '../init'
import Init from '../init.js'

vi.mock('../skills/install', () => ({
PLATFORM_TARGETS: {
Expand Down Expand Up @@ -50,24 +50,24 @@ import { writeFileSync } from 'fs'
import {
readSkillFile,
writeSkillToTarget,
} from '../skills/install'
import { detectProjectContext } from '../../helpers/onboarding/detect-project'
} from '../skills/install.js'
import { detectProjectContext } from '../../helpers/onboarding/detect-project.js'
import {
runSkillInstallStep,
refreshSkill,
} from '../../helpers/onboarding/skill-install'
} from '../../helpers/onboarding/skill-install.js'
import {
runDepsInstall,
createConfig,
copyChecks,
} from '../../helpers/onboarding/boilerplate'
import { loadPromptTemplate } from '../../helpers/onboarding/template-prompt'
import { displayStarterPrompt } from '../../helpers/onboarding/prompt-display'
} from '../../helpers/onboarding/boilerplate.js'
import { loadPromptTemplate } from '../../helpers/onboarding/template-prompt.js'
import { displayStarterPrompt } from '../../helpers/onboarding/prompt-display.js'
import {
greeting,
existingProjectFooter,
} from '../../helpers/onboarding/messages'
import { detectCliMode } from '../../helpers/cli-mode'
} from '../../helpers/onboarding/messages.js'
import { detectCliMode } from '../../helpers/cli-mode.js'
import prompts from 'prompts'

const mockConfig = {
Expand Down
12 changes: 6 additions & 6 deletions packages/cli/src/commands/account/members.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Flags } from '@oclif/core'
import { AuthCommand } from '../authCommand'
import { outputFlag } from '../../helpers/flags'
import * as api from '../../rest/api'
import type { OutputFormat } from '../../formatters/render'
import { AuthCommand } from '../authCommand.js'
import { outputFlag } from '../../helpers/flags.js'
import * as api from '../../rest/api.js'
import type { OutputFormat } from '../../formatters/render.js'
import type {
AccountMemberRole,
AccountMemberStatus,
AccountMemberType,
AccountMembersListParams,
} from '../../rest/account-members'
} from '../../rest/account-members.js'
import {
formatAccountMembers,
formatCursorNavigationHints,
formatCursorPaginationInfo,
} from '../../formatters/account-members'
} from '../../formatters/account-members.js'

const accountMemberTypes = ['member', 'invite'] as const
const accountMemberRoles = ['OWNER', 'ADMIN', 'READ_WRITE', 'READ_RUN', 'READ_ONLY'] as const
Expand Down
12 changes: 6 additions & 6 deletions packages/cli/src/commands/account/plan.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Args, Flags } from '@oclif/core'
import { AuthCommand } from '../authCommand'
import { outputFlag } from '../../helpers/flags'
import * as api from '../../rest/api'
import type { OutputFormat } from '../../formatters/render'
import { AuthCommand } from '../authCommand.js'
import { outputFlag } from '../../helpers/flags.js'
import * as api from '../../rest/api.js'
import type { OutputFormat } from '../../formatters/render.js'
import {
formatPlanSummary,
formatEntitlementDetail,
formatFilteredEntitlements,
getEntitlementUpgradeUrl,
CONTACT_SALES_URL,
} from '../../formatters/account-plan'
import type { Entitlement } from '../../rest/entitlements'
} from '../../formatters/account-plan.js'
import type { Entitlement } from '../../rest/entitlements.js'

function withUpgradeUrl (e: Entitlement, checkoutUrl: string) {
if (e.enabled) return e
Expand Down
Loading
Loading