Skip to content
Merged
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
3,465 changes: 2,529 additions & 936 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions packages/cli/bin/run
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env node
/* eslint-disable @typescript-eslint/no-var-requires */

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

oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'))
run().catch(handle).finally(flush)
13 changes: 7 additions & 6 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,19 @@
"description": "Manage Checkly environment variables."
}
},
"helpClass": "./dist/help/help-extension"
"helpClass": "./dist/help/help-extension",
"topicSeparator": " "
},
"bin": {
"checkly": "./bin/run"
},
"homepage": "https://github.com/checkly/checkly-cli#readme",
"dependencies": {
"@oclif/core": "2.8.11",
"@oclif/plugin-help": "5.1.20",
"@oclif/plugin-not-found": "2.3.23",
"@oclif/plugin-plugins": "5.4.4",
"@oclif/plugin-warn-if-update-available": "2.0.24",
"@oclif/core": "4.2.8",
"@oclif/plugin-help": "6.2.26",
"@oclif/plugin-not-found": "3.2.44",
"@oclif/plugin-plugins": "5.4.34",
"@oclif/plugin-warn-if-update-available": "3.1.35",
"@typescript-eslint/typescript-estree": "8.24.1",
"acorn": "8.14.0",
"acorn-walk": "8.3.4",
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/src/commands/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { setTimeout } from 'node:timers/promises'
import * as fs from 'fs/promises'
import * as api from '../rest/api'
import config from '../services/config'
Expand Down Expand Up @@ -163,7 +164,7 @@ export default class Deploy extends AuthCommand {
this.log(this.formatPreview(data, project))
}
if (!preview) {
await ux.wait(500)
await setTimeout(500)
this.log(`Successfully deployed project "${project.name}" to account "${account.name}".`)

// Print the ping URL for heartbeat checks.
Expand Down
9 changes: 8 additions & 1 deletion packages/cli/src/commands/env/add.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import prompts from 'prompts'
import * as api from '../../rest/api'
import { Flags, Args, ux } from '@oclif/core'
import { AuthCommand } from '../authCommand'
Expand Down Expand Up @@ -43,7 +44,13 @@ export default class EnvAdd extends AuthCommand {
if (args.value) {
envValue = args.value
} else {
envValue = await ux.prompt(`What is the value of ${envVariableName}?`, { type: 'mask' })
const response = await prompts({
type: 'password',
name: 'value',
message: `What is the value of ${envVariableName}?`,
})

envValue = response.value
}
try {
await api.environmentVariables.add(envVariableName, envValue, locked, secret)
Expand Down
9 changes: 8 additions & 1 deletion packages/cli/src/commands/env/update.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import prompts from 'prompts'
import * as api from '../../rest/api'
import { Flags, Args, ux } from '@oclif/core'
import { AuthCommand } from '../authCommand'
Expand Down Expand Up @@ -43,7 +44,13 @@ export default class EnvUpdate extends AuthCommand {
if (args.value) {
envValue = args.value
} else {
envValue = await ux.prompt(`What is the value of ${envVariableName}?`, { type: 'mask' })
const response = await prompts({
type: 'password',
name: 'value',
message: `What is the value of ${envVariableName}?`,
})

envValue = response.value
}
try {
await api.environmentVariables.update(envVariableName, envValue, locked, secret)
Expand Down
7 changes: 3 additions & 4 deletions packages/cli/src/help/help-extension.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import { Command, Help } from '@oclif/core'
import examples from './examples'
import { BaseCommandClass } from '../commands/baseCommand'
import { Topic } from '@oclif/core/lib/interfaces'

export default class ChecklyHelpClass extends Help {
protected formatAllCommands (commands: Array<BaseCommandClass | Command.Loadable | Command.Cached>,
protected formatAllCommands (commands: Array<Command.Loadable>,
topics: Array<Topic>): string {
if (commands.length === 0) return ''

const coreCommands = commands.filter(c => c.coreCommand)
const additionalCommands = commands.filter(c => !c.coreCommand)

const formatCommandsWithoutTopics = (commands: Array<BaseCommandClass | Command.Loadable | Command.Cached>) =>
const formatCommandsWithoutTopics = (commands: Array<Command.Loadable>) =>
commands
// discard commands with ':' indicating they are under a topic
.filter(c => !c.id.includes(':') || c.coreCommand)
.map(c => [c.id.replace(/:/g, ' '), this.summary(c)])

const formatCommandsWithTopics = (commands: Array<BaseCommandClass | Command.Loadable | Command.Cached>) =>
const formatCommandsWithTopics = (commands: Array<Command.Loadable>) =>
commands
// discard commands with ':' indicating they are under a topic
.filter(c => !c.id.includes(':'))
Expand Down
7 changes: 4 additions & 3 deletions packages/create-cli/bin/run
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/usr/bin/env node
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable no-console */

const currentVersion = process.versions.node
const requiredVersion = parseInt(currentVersion.split('.')[0], 10)
const minimumVersion = 16
const minimumVersion = 18

if (requiredVersion < minimumVersion) {
console.error(`You are running Node.js v${currentVersion}. The Checkly CLI requires Node.js v${minimumVersion} or higher.`)
process.exit(1)
}

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

oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'))
run().catch(handle).finally(flush)
22 changes: 17 additions & 5 deletions packages/create-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,26 @@
],
"oclif": {
"bin": "create-cli",
"commands": "./dist/commands",
"default": "bootstrap"
"commands": {
"strategy": "single",
"target": "./dist/commands/bootstrap"
},
"plugins": [
"@oclif/plugin-help",
"@oclif/plugin-warn-if-update-available"
],
"warn-if-update-available": {
"timeoutInDays": 30,
"message": "<%= config.name %> update available from <%= chalk.greenBright(config.version) %> to <%= chalk.greenBright(latest) %>. To update, run `npm install -D checkly@latest`"
},
"topicSeparator": " "
},
"homepage": "https://github.com/checkly/checkly-cli#readme",
"dependencies": {
"@oclif/core": "2.8.11",
"@oclif/plugin-help": "5.1.20",
"@oclif/plugin-plugins": "5.4.4",
"@oclif/core": "4.2.8",
"@oclif/plugin-help": "6.2.26",
"@oclif/plugin-plugins": "5.4.34",
"@oclif/plugin-warn-if-update-available": "3.1.35",
"axios": "1.7.4",
"chalk": "4.1.2",
"debug": "4.3.4",
Expand Down
Loading