resend-cli 1.2.1 → 1.3.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/README.md +25 -10
- package/dist/cli.cjs +539 -0
- package/package.json +31 -13
- package/.claude/settings.local.json +0 -5
- package/.claude/worktrees/emails-list/.claude/settings.local.json +0 -5
- package/.claude/worktrees/emails-list/.github/scripts/pr-title-check.js +0 -34
- package/.claude/worktrees/emails-list/.github/workflows/ci.yml +0 -32
- package/.claude/worktrees/emails-list/.github/workflows/pr-title-check.yml +0 -13
- package/.claude/worktrees/emails-list/.github/workflows/release.yml +0 -93
- package/.claude/worktrees/emails-list/CHANGELOG.md +0 -31
- package/.claude/worktrees/emails-list/LICENSE +0 -21
- package/.claude/worktrees/emails-list/README.md +0 -424
- package/.claude/worktrees/emails-list/biome.json +0 -36
- package/.claude/worktrees/emails-list/bun.lock +0 -76
- package/.claude/worktrees/emails-list/bunfig.toml +0 -2
- package/.claude/worktrees/emails-list/install.ps1 +0 -140
- package/.claude/worktrees/emails-list/install.sh +0 -301
- package/.claude/worktrees/emails-list/package.json +0 -43
- package/.claude/worktrees/emails-list/renovate.json +0 -6
- package/.claude/worktrees/emails-list/src/cli.ts +0 -74
- package/.claude/worktrees/emails-list/src/commands/api-keys/create.ts +0 -114
- package/.claude/worktrees/emails-list/src/commands/api-keys/delete.ts +0 -47
- package/.claude/worktrees/emails-list/src/commands/api-keys/index.ts +0 -26
- package/.claude/worktrees/emails-list/src/commands/api-keys/list.ts +0 -35
- package/.claude/worktrees/emails-list/src/commands/api-keys/utils.ts +0 -8
- package/.claude/worktrees/emails-list/src/commands/auth/index.ts +0 -20
- package/.claude/worktrees/emails-list/src/commands/auth/login.ts +0 -207
- package/.claude/worktrees/emails-list/src/commands/auth/logout.ts +0 -105
- package/.claude/worktrees/emails-list/src/commands/broadcasts/create.ts +0 -196
- package/.claude/worktrees/emails-list/src/commands/broadcasts/delete.ts +0 -46
- package/.claude/worktrees/emails-list/src/commands/broadcasts/get.ts +0 -59
- package/.claude/worktrees/emails-list/src/commands/broadcasts/index.ts +0 -43
- package/.claude/worktrees/emails-list/src/commands/broadcasts/list.ts +0 -60
- package/.claude/worktrees/emails-list/src/commands/broadcasts/send.ts +0 -56
- package/.claude/worktrees/emails-list/src/commands/broadcasts/update.ts +0 -95
- package/.claude/worktrees/emails-list/src/commands/broadcasts/utils.ts +0 -35
- package/.claude/worktrees/emails-list/src/commands/contact-properties/create.ts +0 -118
- package/.claude/worktrees/emails-list/src/commands/contact-properties/delete.ts +0 -48
- package/.claude/worktrees/emails-list/src/commands/contact-properties/get.ts +0 -46
- package/.claude/worktrees/emails-list/src/commands/contact-properties/index.ts +0 -48
- package/.claude/worktrees/emails-list/src/commands/contact-properties/list.ts +0 -68
- package/.claude/worktrees/emails-list/src/commands/contact-properties/update.ts +0 -88
- package/.claude/worktrees/emails-list/src/commands/contact-properties/utils.ts +0 -17
- package/.claude/worktrees/emails-list/src/commands/contacts/add-segment.ts +0 -78
- package/.claude/worktrees/emails-list/src/commands/contacts/create.ts +0 -122
- package/.claude/worktrees/emails-list/src/commands/contacts/delete.ts +0 -49
- package/.claude/worktrees/emails-list/src/commands/contacts/get.ts +0 -53
- package/.claude/worktrees/emails-list/src/commands/contacts/index.ts +0 -58
- package/.claude/worktrees/emails-list/src/commands/contacts/list.ts +0 -57
- package/.claude/worktrees/emails-list/src/commands/contacts/remove-segment.ts +0 -48
- package/.claude/worktrees/emails-list/src/commands/contacts/segments.ts +0 -39
- package/.claude/worktrees/emails-list/src/commands/contacts/topics.ts +0 -45
- package/.claude/worktrees/emails-list/src/commands/contacts/update-topics.ts +0 -90
- package/.claude/worktrees/emails-list/src/commands/contacts/update.ts +0 -77
- package/.claude/worktrees/emails-list/src/commands/contacts/utils.ts +0 -119
- package/.claude/worktrees/emails-list/src/commands/doctor.ts +0 -298
- package/.claude/worktrees/emails-list/src/commands/domains/create.ts +0 -83
- package/.claude/worktrees/emails-list/src/commands/domains/delete.ts +0 -42
- package/.claude/worktrees/emails-list/src/commands/domains/get.ts +0 -47
- package/.claude/worktrees/emails-list/src/commands/domains/index.ts +0 -35
- package/.claude/worktrees/emails-list/src/commands/domains/list.ts +0 -53
- package/.claude/worktrees/emails-list/src/commands/domains/update.ts +0 -75
- package/.claude/worktrees/emails-list/src/commands/domains/utils.ts +0 -44
- package/.claude/worktrees/emails-list/src/commands/domains/verify.ts +0 -38
- package/.claude/worktrees/emails-list/src/commands/emails/batch.ts +0 -140
- package/.claude/worktrees/emails-list/src/commands/emails/index.ts +0 -28
- package/.claude/worktrees/emails-list/src/commands/emails/list.ts +0 -73
- package/.claude/worktrees/emails-list/src/commands/emails/receiving/attachment.ts +0 -55
- package/.claude/worktrees/emails-list/src/commands/emails/receiving/attachments.ts +0 -68
- package/.claude/worktrees/emails-list/src/commands/emails/receiving/get.ts +0 -58
- package/.claude/worktrees/emails-list/src/commands/emails/receiving/index.ts +0 -28
- package/.claude/worktrees/emails-list/src/commands/emails/receiving/list.ts +0 -59
- package/.claude/worktrees/emails-list/src/commands/emails/receiving/utils.ts +0 -38
- package/.claude/worktrees/emails-list/src/commands/emails/send.ts +0 -189
- package/.claude/worktrees/emails-list/src/commands/open.ts +0 -24
- package/.claude/worktrees/emails-list/src/commands/segments/create.ts +0 -50
- package/.claude/worktrees/emails-list/src/commands/segments/delete.ts +0 -47
- package/.claude/worktrees/emails-list/src/commands/segments/get.ts +0 -38
- package/.claude/worktrees/emails-list/src/commands/segments/index.ts +0 -36
- package/.claude/worktrees/emails-list/src/commands/segments/list.ts +0 -58
- package/.claude/worktrees/emails-list/src/commands/segments/utils.ts +0 -7
- package/.claude/worktrees/emails-list/src/commands/teams/index.ts +0 -10
- package/.claude/worktrees/emails-list/src/commands/teams/list.ts +0 -35
- package/.claude/worktrees/emails-list/src/commands/teams/remove.ts +0 -83
- package/.claude/worktrees/emails-list/src/commands/teams/switch.ts +0 -73
- package/.claude/worktrees/emails-list/src/commands/topics/create.ts +0 -73
- package/.claude/worktrees/emails-list/src/commands/topics/delete.ts +0 -47
- package/.claude/worktrees/emails-list/src/commands/topics/get.ts +0 -42
- package/.claude/worktrees/emails-list/src/commands/topics/index.ts +0 -42
- package/.claude/worktrees/emails-list/src/commands/topics/list.ts +0 -34
- package/.claude/worktrees/emails-list/src/commands/topics/update.ts +0 -59
- package/.claude/worktrees/emails-list/src/commands/topics/utils.ts +0 -16
- package/.claude/worktrees/emails-list/src/commands/webhooks/create.ts +0 -128
- package/.claude/worktrees/emails-list/src/commands/webhooks/delete.ts +0 -49
- package/.claude/worktrees/emails-list/src/commands/webhooks/get.ts +0 -42
- package/.claude/worktrees/emails-list/src/commands/webhooks/index.ts +0 -44
- package/.claude/worktrees/emails-list/src/commands/webhooks/list.ts +0 -55
- package/.claude/worktrees/emails-list/src/commands/webhooks/update.ts +0 -83
- package/.claude/worktrees/emails-list/src/commands/webhooks/utils.ts +0 -36
- package/.claude/worktrees/emails-list/src/commands/whoami.ts +0 -71
- package/.claude/worktrees/emails-list/src/lib/actions.ts +0 -157
- package/.claude/worktrees/emails-list/src/lib/client.ts +0 -34
- package/.claude/worktrees/emails-list/src/lib/config.ts +0 -211
- package/.claude/worktrees/emails-list/src/lib/files.ts +0 -15
- package/.claude/worktrees/emails-list/src/lib/help-text.ts +0 -38
- package/.claude/worktrees/emails-list/src/lib/output.ts +0 -54
- package/.claude/worktrees/emails-list/src/lib/pagination.ts +0 -36
- package/.claude/worktrees/emails-list/src/lib/prompts.ts +0 -149
- package/.claude/worktrees/emails-list/src/lib/spinner.ts +0 -93
- package/.claude/worktrees/emails-list/src/lib/table.ts +0 -57
- package/.claude/worktrees/emails-list/src/lib/tty.ts +0 -28
- package/.claude/worktrees/emails-list/src/lib/version.ts +0 -4
- package/.claude/worktrees/emails-list/tests/commands/api-keys/create.test.ts +0 -195
- package/.claude/worktrees/emails-list/tests/commands/api-keys/delete.test.ts +0 -156
- package/.claude/worktrees/emails-list/tests/commands/api-keys/list.test.ts +0 -133
- package/.claude/worktrees/emails-list/tests/commands/auth/login.test.ts +0 -119
- package/.claude/worktrees/emails-list/tests/commands/auth/logout.test.ts +0 -146
- package/.claude/worktrees/emails-list/tests/commands/broadcasts/create.test.ts +0 -447
- package/.claude/worktrees/emails-list/tests/commands/broadcasts/delete.test.ts +0 -182
- package/.claude/worktrees/emails-list/tests/commands/broadcasts/get.test.ts +0 -146
- package/.claude/worktrees/emails-list/tests/commands/broadcasts/list.test.ts +0 -196
- package/.claude/worktrees/emails-list/tests/commands/broadcasts/send.test.ts +0 -161
- package/.claude/worktrees/emails-list/tests/commands/broadcasts/update.test.ts +0 -283
- package/.claude/worktrees/emails-list/tests/commands/contact-properties/create.test.ts +0 -250
- package/.claude/worktrees/emails-list/tests/commands/contact-properties/delete.test.ts +0 -183
- package/.claude/worktrees/emails-list/tests/commands/contact-properties/get.test.ts +0 -144
- package/.claude/worktrees/emails-list/tests/commands/contact-properties/list.test.ts +0 -180
- package/.claude/worktrees/emails-list/tests/commands/contact-properties/update.test.ts +0 -216
- package/.claude/worktrees/emails-list/tests/commands/contacts/add-segment.test.ts +0 -188
- package/.claude/worktrees/emails-list/tests/commands/contacts/create.test.ts +0 -270
- package/.claude/worktrees/emails-list/tests/commands/contacts/delete.test.ts +0 -192
- package/.claude/worktrees/emails-list/tests/commands/contacts/get.test.ts +0 -148
- package/.claude/worktrees/emails-list/tests/commands/contacts/list.test.ts +0 -175
- package/.claude/worktrees/emails-list/tests/commands/contacts/remove-segment.test.ts +0 -166
- package/.claude/worktrees/emails-list/tests/commands/contacts/segments.test.ts +0 -167
- package/.claude/worktrees/emails-list/tests/commands/contacts/topics.test.ts +0 -163
- package/.claude/worktrees/emails-list/tests/commands/contacts/update-topics.test.ts +0 -247
- package/.claude/worktrees/emails-list/tests/commands/contacts/update.test.ts +0 -205
- package/.claude/worktrees/emails-list/tests/commands/doctor.test.ts +0 -165
- package/.claude/worktrees/emails-list/tests/commands/domains/create.test.ts +0 -192
- package/.claude/worktrees/emails-list/tests/commands/domains/delete.test.ts +0 -156
- package/.claude/worktrees/emails-list/tests/commands/domains/get.test.ts +0 -137
- package/.claude/worktrees/emails-list/tests/commands/domains/list.test.ts +0 -164
- package/.claude/worktrees/emails-list/tests/commands/domains/update.test.ts +0 -223
- package/.claude/worktrees/emails-list/tests/commands/domains/verify.test.ts +0 -117
- package/.claude/worktrees/emails-list/tests/commands/emails/batch.test.ts +0 -313
- package/.claude/worktrees/emails-list/tests/commands/emails/list.test.ts +0 -196
- package/.claude/worktrees/emails-list/tests/commands/emails/receiving/attachment.test.ts +0 -140
- package/.claude/worktrees/emails-list/tests/commands/emails/receiving/attachments.test.ts +0 -168
- package/.claude/worktrees/emails-list/tests/commands/emails/receiving/get.test.ts +0 -140
- package/.claude/worktrees/emails-list/tests/commands/emails/receiving/list.test.ts +0 -181
- package/.claude/worktrees/emails-list/tests/commands/emails/send.test.ts +0 -309
- package/.claude/worktrees/emails-list/tests/commands/segments/create.test.ts +0 -163
- package/.claude/worktrees/emails-list/tests/commands/segments/delete.test.ts +0 -182
- package/.claude/worktrees/emails-list/tests/commands/segments/get.test.ts +0 -137
- package/.claude/worktrees/emails-list/tests/commands/segments/list.test.ts +0 -173
- package/.claude/worktrees/emails-list/tests/commands/teams/list.test.ts +0 -63
- package/.claude/worktrees/emails-list/tests/commands/teams/remove.test.ts +0 -103
- package/.claude/worktrees/emails-list/tests/commands/teams/switch.test.ts +0 -96
- package/.claude/worktrees/emails-list/tests/commands/topics/create.test.ts +0 -191
- package/.claude/worktrees/emails-list/tests/commands/topics/delete.test.ts +0 -156
- package/.claude/worktrees/emails-list/tests/commands/topics/get.test.ts +0 -125
- package/.claude/worktrees/emails-list/tests/commands/topics/list.test.ts +0 -124
- package/.claude/worktrees/emails-list/tests/commands/topics/update.test.ts +0 -177
- package/.claude/worktrees/emails-list/tests/commands/webhooks/create.test.ts +0 -224
- package/.claude/worktrees/emails-list/tests/commands/webhooks/delete.test.ts +0 -156
- package/.claude/worktrees/emails-list/tests/commands/webhooks/get.test.ts +0 -125
- package/.claude/worktrees/emails-list/tests/commands/webhooks/list.test.ts +0 -177
- package/.claude/worktrees/emails-list/tests/commands/webhooks/update.test.ts +0 -206
- package/.claude/worktrees/emails-list/tests/commands/whoami.test.ts +0 -99
- package/.claude/worktrees/emails-list/tests/helpers.ts +0 -93
- package/.claude/worktrees/emails-list/tests/lib/client.test.ts +0 -71
- package/.claude/worktrees/emails-list/tests/lib/config.test.ts +0 -414
- package/.claude/worktrees/emails-list/tests/lib/files.test.ts +0 -65
- package/.claude/worktrees/emails-list/tests/lib/help-text.test.ts +0 -97
- package/.claude/worktrees/emails-list/tests/lib/output.test.ts +0 -127
- package/.claude/worktrees/emails-list/tests/lib/prompts.test.ts +0 -178
- package/.claude/worktrees/emails-list/tests/lib/spinner.test.ts +0 -146
- package/.claude/worktrees/emails-list/tests/lib/table.test.ts +0 -63
- package/.claude/worktrees/emails-list/tests/lib/tty.test.ts +0 -85
- package/.claude/worktrees/emails-list/tsconfig.json +0 -14
- package/.github/scripts/pr-title-check.js +0 -34
- package/.github/workflows/ci.yml +0 -32
- package/.github/workflows/pr-title-check.yml +0 -13
- package/.github/workflows/release.yml +0 -120
- package/.github/workflows/test-install-windows.yml +0 -48
- package/CHANGELOG.md +0 -31
- package/biome.json +0 -36
- package/bun.lock +0 -76
- package/bunfig.toml +0 -2
- package/docs/agent-dx-gaps.md +0 -167
- package/docs/missing-commands.md +0 -58
- package/docs/production-readiness.md +0 -99
- package/docs/secure-key-storage.md +0 -174
- package/install.ps1 +0 -141
- package/install.sh +0 -301
- package/renovate.json +0 -4
- package/src/cli.ts +0 -82
- package/src/commands/api-keys/create.ts +0 -114
- package/src/commands/api-keys/delete.ts +0 -47
- package/src/commands/api-keys/index.ts +0 -26
- package/src/commands/api-keys/list.ts +0 -35
- package/src/commands/api-keys/utils.ts +0 -8
- package/src/commands/auth/index.ts +0 -20
- package/src/commands/auth/login.ts +0 -207
- package/src/commands/auth/logout.ts +0 -105
- package/src/commands/broadcasts/create.ts +0 -196
- package/src/commands/broadcasts/delete.ts +0 -46
- package/src/commands/broadcasts/get.ts +0 -59
- package/src/commands/broadcasts/index.ts +0 -43
- package/src/commands/broadcasts/list.ts +0 -60
- package/src/commands/broadcasts/send.ts +0 -56
- package/src/commands/broadcasts/update.ts +0 -95
- package/src/commands/broadcasts/utils.ts +0 -35
- package/src/commands/contact-properties/create.ts +0 -118
- package/src/commands/contact-properties/delete.ts +0 -48
- package/src/commands/contact-properties/get.ts +0 -46
- package/src/commands/contact-properties/index.ts +0 -48
- package/src/commands/contact-properties/list.ts +0 -68
- package/src/commands/contact-properties/update.ts +0 -88
- package/src/commands/contact-properties/utils.ts +0 -17
- package/src/commands/contacts/add-segment.ts +0 -78
- package/src/commands/contacts/create.ts +0 -122
- package/src/commands/contacts/delete.ts +0 -49
- package/src/commands/contacts/get.ts +0 -53
- package/src/commands/contacts/index.ts +0 -58
- package/src/commands/contacts/list.ts +0 -57
- package/src/commands/contacts/remove-segment.ts +0 -48
- package/src/commands/contacts/segments.ts +0 -39
- package/src/commands/contacts/topics.ts +0 -45
- package/src/commands/contacts/update-topics.ts +0 -90
- package/src/commands/contacts/update.ts +0 -77
- package/src/commands/contacts/utils.ts +0 -119
- package/src/commands/doctor.ts +0 -298
- package/src/commands/domains/create.ts +0 -83
- package/src/commands/domains/delete.ts +0 -42
- package/src/commands/domains/get.ts +0 -47
- package/src/commands/domains/index.ts +0 -35
- package/src/commands/domains/list.ts +0 -53
- package/src/commands/domains/update.ts +0 -75
- package/src/commands/domains/utils.ts +0 -44
- package/src/commands/domains/verify.ts +0 -38
- package/src/commands/emails/batch.ts +0 -140
- package/src/commands/emails/index.ts +0 -24
- package/src/commands/emails/receiving/attachment.ts +0 -55
- package/src/commands/emails/receiving/attachments.ts +0 -68
- package/src/commands/emails/receiving/get.ts +0 -58
- package/src/commands/emails/receiving/index.ts +0 -28
- package/src/commands/emails/receiving/list.ts +0 -59
- package/src/commands/emails/receiving/utils.ts +0 -38
- package/src/commands/emails/send.ts +0 -189
- package/src/commands/open.ts +0 -24
- package/src/commands/segments/create.ts +0 -50
- package/src/commands/segments/delete.ts +0 -47
- package/src/commands/segments/get.ts +0 -38
- package/src/commands/segments/index.ts +0 -36
- package/src/commands/segments/list.ts +0 -58
- package/src/commands/segments/utils.ts +0 -7
- package/src/commands/teams/index.ts +0 -10
- package/src/commands/teams/list.ts +0 -35
- package/src/commands/teams/remove.ts +0 -83
- package/src/commands/teams/switch.ts +0 -73
- package/src/commands/topics/create.ts +0 -73
- package/src/commands/topics/delete.ts +0 -47
- package/src/commands/topics/get.ts +0 -42
- package/src/commands/topics/index.ts +0 -42
- package/src/commands/topics/list.ts +0 -34
- package/src/commands/topics/update.ts +0 -59
- package/src/commands/topics/utils.ts +0 -16
- package/src/commands/webhooks/create.ts +0 -128
- package/src/commands/webhooks/delete.ts +0 -49
- package/src/commands/webhooks/get.ts +0 -42
- package/src/commands/webhooks/index.ts +0 -44
- package/src/commands/webhooks/list.ts +0 -55
- package/src/commands/webhooks/update.ts +0 -83
- package/src/commands/webhooks/utils.ts +0 -36
- package/src/commands/whoami.ts +0 -71
- package/src/lib/actions.ts +0 -157
- package/src/lib/client.ts +0 -37
- package/src/lib/config.ts +0 -211
- package/src/lib/files.ts +0 -15
- package/src/lib/help-text.ts +0 -38
- package/src/lib/output.ts +0 -54
- package/src/lib/pagination.ts +0 -36
- package/src/lib/prompts.ts +0 -149
- package/src/lib/spinner.ts +0 -93
- package/src/lib/table.ts +0 -57
- package/src/lib/tty.ts +0 -28
- package/src/lib/version.ts +0 -4
- package/tests/commands/api-keys/create.test.ts +0 -195
- package/tests/commands/api-keys/delete.test.ts +0 -156
- package/tests/commands/api-keys/list.test.ts +0 -133
- package/tests/commands/auth/login.test.ts +0 -119
- package/tests/commands/auth/logout.test.ts +0 -146
- package/tests/commands/broadcasts/create.test.ts +0 -447
- package/tests/commands/broadcasts/delete.test.ts +0 -182
- package/tests/commands/broadcasts/get.test.ts +0 -146
- package/tests/commands/broadcasts/list.test.ts +0 -196
- package/tests/commands/broadcasts/send.test.ts +0 -161
- package/tests/commands/broadcasts/update.test.ts +0 -283
- package/tests/commands/contact-properties/create.test.ts +0 -250
- package/tests/commands/contact-properties/delete.test.ts +0 -183
- package/tests/commands/contact-properties/get.test.ts +0 -144
- package/tests/commands/contact-properties/list.test.ts +0 -180
- package/tests/commands/contact-properties/update.test.ts +0 -216
- package/tests/commands/contacts/add-segment.test.ts +0 -188
- package/tests/commands/contacts/create.test.ts +0 -270
- package/tests/commands/contacts/delete.test.ts +0 -192
- package/tests/commands/contacts/get.test.ts +0 -148
- package/tests/commands/contacts/list.test.ts +0 -175
- package/tests/commands/contacts/remove-segment.test.ts +0 -166
- package/tests/commands/contacts/segments.test.ts +0 -167
- package/tests/commands/contacts/topics.test.ts +0 -163
- package/tests/commands/contacts/update-topics.test.ts +0 -247
- package/tests/commands/contacts/update.test.ts +0 -205
- package/tests/commands/doctor.test.ts +0 -165
- package/tests/commands/domains/create.test.ts +0 -192
- package/tests/commands/domains/delete.test.ts +0 -156
- package/tests/commands/domains/get.test.ts +0 -137
- package/tests/commands/domains/list.test.ts +0 -164
- package/tests/commands/domains/update.test.ts +0 -223
- package/tests/commands/domains/verify.test.ts +0 -117
- package/tests/commands/emails/batch.test.ts +0 -313
- package/tests/commands/emails/receiving/attachment.test.ts +0 -140
- package/tests/commands/emails/receiving/attachments.test.ts +0 -168
- package/tests/commands/emails/receiving/get.test.ts +0 -140
- package/tests/commands/emails/receiving/list.test.ts +0 -181
- package/tests/commands/emails/send.test.ts +0 -309
- package/tests/commands/segments/create.test.ts +0 -163
- package/tests/commands/segments/delete.test.ts +0 -182
- package/tests/commands/segments/get.test.ts +0 -137
- package/tests/commands/segments/list.test.ts +0 -173
- package/tests/commands/teams/list.test.ts +0 -63
- package/tests/commands/teams/remove.test.ts +0 -103
- package/tests/commands/teams/switch.test.ts +0 -96
- package/tests/commands/topics/create.test.ts +0 -191
- package/tests/commands/topics/delete.test.ts +0 -156
- package/tests/commands/topics/get.test.ts +0 -125
- package/tests/commands/topics/list.test.ts +0 -124
- package/tests/commands/topics/update.test.ts +0 -177
- package/tests/commands/webhooks/create.test.ts +0 -224
- package/tests/commands/webhooks/delete.test.ts +0 -156
- package/tests/commands/webhooks/get.test.ts +0 -125
- package/tests/commands/webhooks/list.test.ts +0 -177
- package/tests/commands/webhooks/update.test.ts +0 -206
- package/tests/commands/whoami.test.ts +0 -99
- package/tests/helpers.ts +0 -93
- package/tests/lib/client.test.ts +0 -71
- package/tests/lib/config.test.ts +0 -414
- package/tests/lib/files.test.ts +0 -65
- package/tests/lib/help-text.test.ts +0 -97
- package/tests/lib/output.test.ts +0 -127
- package/tests/lib/prompts.test.ts +0 -178
- package/tests/lib/spinner.test.ts +0 -146
- package/tests/lib/table.test.ts +0 -63
- package/tests/lib/tty.test.ts +0 -85
- package/tsconfig.json +0 -14
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, spyOn, test } from 'bun:test';
|
|
2
|
-
import { expectExit1, mockExitThrow } from '../helpers';
|
|
3
|
-
|
|
4
|
-
describe('promptForMissing', () => {
|
|
5
|
-
const originalStdinIsTTY = process.stdin.isTTY;
|
|
6
|
-
const originalStdoutIsTTY = process.stdout.isTTY;
|
|
7
|
-
let errorSpy: ReturnType<typeof spyOn> | undefined;
|
|
8
|
-
let exitSpy: ReturnType<typeof spyOn> | undefined;
|
|
9
|
-
|
|
10
|
-
afterEach(() => {
|
|
11
|
-
errorSpy?.mockRestore();
|
|
12
|
-
exitSpy?.mockRestore();
|
|
13
|
-
errorSpy = undefined;
|
|
14
|
-
exitSpy = undefined;
|
|
15
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
16
|
-
value: originalStdinIsTTY,
|
|
17
|
-
writable: true,
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(process.stdout, 'isTTY', {
|
|
20
|
-
value: originalStdoutIsTTY,
|
|
21
|
-
writable: true,
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test('returns options unchanged when nothing is missing', async () => {
|
|
26
|
-
const { promptForMissing } = require('../../src/lib/prompts');
|
|
27
|
-
const opts = { from: 'a@b.com', to: 'c@d.com', subject: 'Hi' };
|
|
28
|
-
const result = await promptForMissing(
|
|
29
|
-
opts,
|
|
30
|
-
[
|
|
31
|
-
{ flag: 'from', message: 'From' },
|
|
32
|
-
{ flag: 'to', message: 'To' },
|
|
33
|
-
{ flag: 'subject', message: 'Subject' },
|
|
34
|
-
],
|
|
35
|
-
{},
|
|
36
|
-
);
|
|
37
|
-
expect(result).toEqual(opts);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
test('exits with missing_flags error in non-interactive mode', async () => {
|
|
41
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
42
|
-
value: undefined,
|
|
43
|
-
writable: true,
|
|
44
|
-
});
|
|
45
|
-
Object.defineProperty(process.stdout, 'isTTY', {
|
|
46
|
-
value: undefined,
|
|
47
|
-
writable: true,
|
|
48
|
-
});
|
|
49
|
-
errorSpy = spyOn(console, 'error').mockImplementation(() => {});
|
|
50
|
-
exitSpy = mockExitThrow();
|
|
51
|
-
|
|
52
|
-
const { promptForMissing } = require('../../src/lib/prompts');
|
|
53
|
-
|
|
54
|
-
await expectExit1(() =>
|
|
55
|
-
promptForMissing(
|
|
56
|
-
{ from: undefined, to: 'c@d.com', subject: undefined },
|
|
57
|
-
[
|
|
58
|
-
{ flag: 'from', message: 'From' },
|
|
59
|
-
{ flag: 'to', message: 'To' },
|
|
60
|
-
{ flag: 'subject', message: 'Subject' },
|
|
61
|
-
],
|
|
62
|
-
{},
|
|
63
|
-
),
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
const allErrors = errorSpy?.mock.calls.map((c) => c[0]).join(' ');
|
|
67
|
-
expect(allErrors).toContain('--from');
|
|
68
|
-
expect(allErrors).toContain('--subject');
|
|
69
|
-
// --to should NOT be listed since it has a value
|
|
70
|
-
expect(allErrors).not.toContain('--to,');
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
test('errors output includes missing_flags code', async () => {
|
|
74
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
75
|
-
value: undefined,
|
|
76
|
-
writable: true,
|
|
77
|
-
});
|
|
78
|
-
Object.defineProperty(process.stdout, 'isTTY', {
|
|
79
|
-
value: undefined,
|
|
80
|
-
writable: true,
|
|
81
|
-
});
|
|
82
|
-
errorSpy = spyOn(console, 'error').mockImplementation(() => {});
|
|
83
|
-
exitSpy = mockExitThrow();
|
|
84
|
-
|
|
85
|
-
const { promptForMissing } = require('../../src/lib/prompts');
|
|
86
|
-
|
|
87
|
-
await expectExit1(() =>
|
|
88
|
-
promptForMissing(
|
|
89
|
-
{ from: undefined },
|
|
90
|
-
[{ flag: 'from', message: 'From' }],
|
|
91
|
-
{},
|
|
92
|
-
),
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
const allErrors = errorSpy?.mock.calls.map((c) => c[0]).join(' ');
|
|
96
|
-
expect(allErrors).toContain('missing_flags');
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
test('skips fields marked as required=false', async () => {
|
|
100
|
-
const { promptForMissing } = require('../../src/lib/prompts');
|
|
101
|
-
const opts = { from: 'a@b.com', to: undefined };
|
|
102
|
-
const result = await promptForMissing(
|
|
103
|
-
opts,
|
|
104
|
-
[
|
|
105
|
-
{ flag: 'from', message: 'From' },
|
|
106
|
-
{ flag: 'to', message: 'To', required: false },
|
|
107
|
-
],
|
|
108
|
-
{},
|
|
109
|
-
);
|
|
110
|
-
expect(result).toEqual(opts);
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
describe('confirmDelete', () => {
|
|
115
|
-
const originalStdinIsTTY = process.stdin.isTTY;
|
|
116
|
-
const originalStdoutIsTTY = process.stdout.isTTY;
|
|
117
|
-
let errorSpy: ReturnType<typeof spyOn> | undefined;
|
|
118
|
-
let exitSpy: ReturnType<typeof spyOn> | undefined;
|
|
119
|
-
|
|
120
|
-
afterEach(() => {
|
|
121
|
-
errorSpy?.mockRestore();
|
|
122
|
-
exitSpy?.mockRestore();
|
|
123
|
-
errorSpy = undefined;
|
|
124
|
-
exitSpy = undefined;
|
|
125
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
126
|
-
value: originalStdinIsTTY,
|
|
127
|
-
writable: true,
|
|
128
|
-
});
|
|
129
|
-
Object.defineProperty(process.stdout, 'isTTY', {
|
|
130
|
-
value: originalStdoutIsTTY,
|
|
131
|
-
writable: true,
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
test('exits with confirmation_required when non-interactive', async () => {
|
|
136
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
137
|
-
value: undefined,
|
|
138
|
-
writable: true,
|
|
139
|
-
});
|
|
140
|
-
Object.defineProperty(process.stdout, 'isTTY', {
|
|
141
|
-
value: undefined,
|
|
142
|
-
writable: true,
|
|
143
|
-
});
|
|
144
|
-
errorSpy = spyOn(console, 'error').mockImplementation(() => {});
|
|
145
|
-
exitSpy = mockExitThrow();
|
|
146
|
-
|
|
147
|
-
const { confirmDelete } = require('../../src/lib/prompts');
|
|
148
|
-
|
|
149
|
-
await expectExit1(() =>
|
|
150
|
-
confirmDelete('res_123', 'Delete resource res_123?', { json: false }),
|
|
151
|
-
);
|
|
152
|
-
|
|
153
|
-
const output = errorSpy?.mock.calls.map((c) => c[0]).join(' ');
|
|
154
|
-
expect(output).toContain('confirmation_required');
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
test('outputs JSON confirmation_required error when json option is true', async () => {
|
|
158
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
159
|
-
value: undefined,
|
|
160
|
-
writable: true,
|
|
161
|
-
});
|
|
162
|
-
Object.defineProperty(process.stdout, 'isTTY', {
|
|
163
|
-
value: undefined,
|
|
164
|
-
writable: true,
|
|
165
|
-
});
|
|
166
|
-
errorSpy = spyOn(console, 'error').mockImplementation(() => {});
|
|
167
|
-
exitSpy = mockExitThrow();
|
|
168
|
-
|
|
169
|
-
const { confirmDelete } = require('../../src/lib/prompts');
|
|
170
|
-
await expectExit1(() =>
|
|
171
|
-
confirmDelete('res_123', 'Delete?', { json: true }),
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
const raw = errorSpy?.mock.calls.map((c) => c[0]).join(' ');
|
|
175
|
-
const parsed = JSON.parse(raw);
|
|
176
|
-
expect(parsed.error.code).toBe('confirmation_required');
|
|
177
|
-
});
|
|
178
|
-
});
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, spyOn, test } from 'bun:test';
|
|
2
|
-
|
|
3
|
-
describe('createSpinner', () => {
|
|
4
|
-
const originalStdinIsTTY = process.stdin.isTTY;
|
|
5
|
-
const originalStdoutIsTTY = process.stdout.isTTY;
|
|
6
|
-
let stderrSpy: ReturnType<typeof spyOn>;
|
|
7
|
-
|
|
8
|
-
afterEach(() => {
|
|
9
|
-
stderrSpy?.mockRestore();
|
|
10
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
11
|
-
value: originalStdinIsTTY,
|
|
12
|
-
writable: true,
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(process.stdout, 'isTTY', {
|
|
15
|
-
value: originalStdoutIsTTY,
|
|
16
|
-
writable: true,
|
|
17
|
-
});
|
|
18
|
-
delete process.env.CI;
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
test('returns no-op spinner in non-interactive mode', () => {
|
|
22
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
23
|
-
value: undefined,
|
|
24
|
-
writable: true,
|
|
25
|
-
});
|
|
26
|
-
Object.defineProperty(process.stdout, 'isTTY', {
|
|
27
|
-
value: undefined,
|
|
28
|
-
writable: true,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const { createSpinner } = require('../../src/lib/spinner');
|
|
32
|
-
const spinner = createSpinner('test message');
|
|
33
|
-
|
|
34
|
-
// Should not throw when calling any method
|
|
35
|
-
expect(() => spinner.stop('done')).not.toThrow();
|
|
36
|
-
expect(() => spinner.fail('error')).not.toThrow();
|
|
37
|
-
expect(() => spinner.warn('warning')).not.toThrow();
|
|
38
|
-
expect(() => spinner.update('updating')).not.toThrow();
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
test('returns functional spinner in interactive mode', () => {
|
|
42
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
43
|
-
value: true,
|
|
44
|
-
writable: true,
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(process.stdout, 'isTTY', {
|
|
47
|
-
value: true,
|
|
48
|
-
writable: true,
|
|
49
|
-
});
|
|
50
|
-
delete process.env.CI;
|
|
51
|
-
delete process.env.GITHUB_ACTIONS;
|
|
52
|
-
delete process.env.TERM;
|
|
53
|
-
|
|
54
|
-
stderrSpy = spyOn(process.stderr, 'write').mockImplementation(() => true);
|
|
55
|
-
|
|
56
|
-
const { createSpinner } = require('../../src/lib/spinner');
|
|
57
|
-
const spinner = createSpinner('loading...');
|
|
58
|
-
|
|
59
|
-
expect(spinner).toHaveProperty('stop');
|
|
60
|
-
expect(spinner).toHaveProperty('fail');
|
|
61
|
-
expect(spinner).toHaveProperty('warn');
|
|
62
|
-
expect(spinner).toHaveProperty('update');
|
|
63
|
-
|
|
64
|
-
// Stop to clean up the interval
|
|
65
|
-
spinner.stop('done');
|
|
66
|
-
expect(stderrSpy).toHaveBeenCalled();
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
test('stop writes checkmark to stderr', () => {
|
|
70
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
71
|
-
value: true,
|
|
72
|
-
writable: true,
|
|
73
|
-
});
|
|
74
|
-
Object.defineProperty(process.stdout, 'isTTY', {
|
|
75
|
-
value: true,
|
|
76
|
-
writable: true,
|
|
77
|
-
});
|
|
78
|
-
delete process.env.CI;
|
|
79
|
-
delete process.env.GITHUB_ACTIONS;
|
|
80
|
-
delete process.env.TERM;
|
|
81
|
-
|
|
82
|
-
stderrSpy = spyOn(process.stderr, 'write').mockImplementation(() => true);
|
|
83
|
-
|
|
84
|
-
const { createSpinner } = require('../../src/lib/spinner');
|
|
85
|
-
const spinner = createSpinner('loading...');
|
|
86
|
-
spinner.stop('completed');
|
|
87
|
-
|
|
88
|
-
const lastCall = stderrSpy.mock.calls[
|
|
89
|
-
stderrSpy.mock.calls.length - 1
|
|
90
|
-
][0] as string;
|
|
91
|
-
expect(lastCall).toContain('✔');
|
|
92
|
-
expect(lastCall).toContain('completed');
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
test('fail writes cross mark to stderr', () => {
|
|
96
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
97
|
-
value: true,
|
|
98
|
-
writable: true,
|
|
99
|
-
});
|
|
100
|
-
Object.defineProperty(process.stdout, 'isTTY', {
|
|
101
|
-
value: true,
|
|
102
|
-
writable: true,
|
|
103
|
-
});
|
|
104
|
-
delete process.env.CI;
|
|
105
|
-
delete process.env.GITHUB_ACTIONS;
|
|
106
|
-
delete process.env.TERM;
|
|
107
|
-
|
|
108
|
-
stderrSpy = spyOn(process.stderr, 'write').mockImplementation(() => true);
|
|
109
|
-
|
|
110
|
-
const { createSpinner } = require('../../src/lib/spinner');
|
|
111
|
-
const spinner = createSpinner('loading...');
|
|
112
|
-
spinner.fail('error occurred');
|
|
113
|
-
|
|
114
|
-
const lastCall = stderrSpy.mock.calls[
|
|
115
|
-
stderrSpy.mock.calls.length - 1
|
|
116
|
-
][0] as string;
|
|
117
|
-
expect(lastCall).toContain('✗');
|
|
118
|
-
expect(lastCall).toContain('error occurred');
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
test('warn writes warning icon to stderr', () => {
|
|
122
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
123
|
-
value: true,
|
|
124
|
-
writable: true,
|
|
125
|
-
});
|
|
126
|
-
Object.defineProperty(process.stdout, 'isTTY', {
|
|
127
|
-
value: true,
|
|
128
|
-
writable: true,
|
|
129
|
-
});
|
|
130
|
-
delete process.env.CI;
|
|
131
|
-
delete process.env.GITHUB_ACTIONS;
|
|
132
|
-
delete process.env.TERM;
|
|
133
|
-
|
|
134
|
-
stderrSpy = spyOn(process.stderr, 'write').mockImplementation(() => true);
|
|
135
|
-
|
|
136
|
-
const { createSpinner } = require('../../src/lib/spinner');
|
|
137
|
-
const spinner = createSpinner('loading...');
|
|
138
|
-
spinner.warn('watch out');
|
|
139
|
-
|
|
140
|
-
const lastCall = stderrSpy.mock.calls[
|
|
141
|
-
stderrSpy.mock.calls.length - 1
|
|
142
|
-
][0] as string;
|
|
143
|
-
expect(lastCall).toContain('⚠');
|
|
144
|
-
expect(lastCall).toContain('watch out');
|
|
145
|
-
});
|
|
146
|
-
});
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from 'bun:test';
|
|
2
|
-
import { renderTable } from '../../src/lib/table';
|
|
3
|
-
|
|
4
|
-
describe('renderTable', () => {
|
|
5
|
-
test('renders a table with correct border characters', () => {
|
|
6
|
-
const output = renderTable(['Name', 'ID'], [['Alice', 'abc-123']]);
|
|
7
|
-
expect(output).toContain('┌');
|
|
8
|
-
expect(output).toContain('┐');
|
|
9
|
-
expect(output).toContain('└');
|
|
10
|
-
expect(output).toContain('┘');
|
|
11
|
-
expect(output).toContain('│');
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
test('includes headers in output', () => {
|
|
15
|
-
const output = renderTable(
|
|
16
|
-
['Name', 'Status'],
|
|
17
|
-
[['my-domain.com', 'verified']],
|
|
18
|
-
);
|
|
19
|
-
expect(output).toContain('Name');
|
|
20
|
-
expect(output).toContain('Status');
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
test('includes row data in output', () => {
|
|
24
|
-
const output = renderTable(
|
|
25
|
-
['Name', 'Status'],
|
|
26
|
-
[['my-domain.com', 'verified']],
|
|
27
|
-
);
|
|
28
|
-
expect(output).toContain('my-domain.com');
|
|
29
|
-
expect(output).toContain('verified');
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
test('pads columns to the widest cell in each column', () => {
|
|
33
|
-
const output = renderTable(
|
|
34
|
-
['Key', 'Value'],
|
|
35
|
-
[
|
|
36
|
-
['short', 'a very long value here'],
|
|
37
|
-
['much longer key', 'v'],
|
|
38
|
-
],
|
|
39
|
-
);
|
|
40
|
-
// All rows should have the same line length
|
|
41
|
-
const lines = output.split('\n');
|
|
42
|
-
const lengths = lines.map((l) => l.length);
|
|
43
|
-
expect(new Set(lengths).size).toBe(1);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
test('renders multiple rows', () => {
|
|
47
|
-
const output = renderTable(
|
|
48
|
-
['A', 'B'],
|
|
49
|
-
[
|
|
50
|
-
['row1a', 'row1b'],
|
|
51
|
-
['row2a', 'row2b'],
|
|
52
|
-
],
|
|
53
|
-
);
|
|
54
|
-
expect(output).toContain('row1a');
|
|
55
|
-
expect(output).toContain('row2a');
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
test('contains a separator row between header and data', () => {
|
|
59
|
-
const output = renderTable(['Col'], [['val']]);
|
|
60
|
-
expect(output).toContain('├');
|
|
61
|
-
expect(output).toContain('┤');
|
|
62
|
-
});
|
|
63
|
-
});
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, test } from 'bun:test';
|
|
2
|
-
import { captureTestEnv } from '../helpers';
|
|
3
|
-
|
|
4
|
-
// We need to import the module fresh per test to pick up env changes,
|
|
5
|
-
// so we use dynamic imports.
|
|
6
|
-
|
|
7
|
-
describe('isInteractive', () => {
|
|
8
|
-
const restoreEnv = captureTestEnv();
|
|
9
|
-
|
|
10
|
-
afterEach(() => {
|
|
11
|
-
restoreEnv();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
function setTTY(stdin: boolean, stdout: boolean) {
|
|
15
|
-
Object.defineProperty(process.stdin, 'isTTY', {
|
|
16
|
-
value: stdin ? true : undefined,
|
|
17
|
-
writable: true,
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(process.stdout, 'isTTY', {
|
|
20
|
-
value: stdout ? true : undefined,
|
|
21
|
-
writable: true,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
test('returns true when stdin and stdout are TTY and no CI env', () => {
|
|
26
|
-
setTTY(true, true);
|
|
27
|
-
delete process.env.CI;
|
|
28
|
-
delete process.env.GITHUB_ACTIONS;
|
|
29
|
-
delete process.env.TERM;
|
|
30
|
-
|
|
31
|
-
const { isInteractive } = require('../../src/lib/tty');
|
|
32
|
-
expect(isInteractive()).toBe(true);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
test('returns false when stdin is not TTY', () => {
|
|
36
|
-
setTTY(false, true);
|
|
37
|
-
delete process.env.CI;
|
|
38
|
-
|
|
39
|
-
const { isInteractive } = require('../../src/lib/tty');
|
|
40
|
-
expect(isInteractive()).toBe(false);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
test('returns false when stdout is not TTY', () => {
|
|
44
|
-
setTTY(true, false);
|
|
45
|
-
delete process.env.CI;
|
|
46
|
-
|
|
47
|
-
const { isInteractive } = require('../../src/lib/tty');
|
|
48
|
-
expect(isInteractive()).toBe(false);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test('returns false when CI=true', () => {
|
|
52
|
-
setTTY(true, true);
|
|
53
|
-
process.env.CI = 'true';
|
|
54
|
-
|
|
55
|
-
const { isInteractive } = require('../../src/lib/tty');
|
|
56
|
-
expect(isInteractive()).toBe(false);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
test('returns false when CI=1', () => {
|
|
60
|
-
setTTY(true, true);
|
|
61
|
-
process.env.CI = '1';
|
|
62
|
-
|
|
63
|
-
const { isInteractive } = require('../../src/lib/tty');
|
|
64
|
-
expect(isInteractive()).toBe(false);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
test('returns false when GITHUB_ACTIONS is set', () => {
|
|
68
|
-
setTTY(true, true);
|
|
69
|
-
delete process.env.CI;
|
|
70
|
-
process.env.GITHUB_ACTIONS = 'true';
|
|
71
|
-
|
|
72
|
-
const { isInteractive } = require('../../src/lib/tty');
|
|
73
|
-
expect(isInteractive()).toBe(false);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
test('returns false when TERM=dumb', () => {
|
|
77
|
-
setTTY(true, true);
|
|
78
|
-
delete process.env.CI;
|
|
79
|
-
delete process.env.GITHUB_ACTIONS;
|
|
80
|
-
process.env.TERM = 'dumb';
|
|
81
|
-
|
|
82
|
-
const { isInteractive } = require('../../src/lib/tty');
|
|
83
|
-
expect(isInteractive()).toBe(false);
|
|
84
|
-
});
|
|
85
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
"outDir": "./dist",
|
|
10
|
-
"rootDir": "./src",
|
|
11
|
-
"types": ["bun"]
|
|
12
|
-
},
|
|
13
|
-
"include": ["src/**/*.ts"]
|
|
14
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
|
|
3
|
-
const eventPath = process.env.GITHUB_EVENT_PATH;
|
|
4
|
-
if (!eventPath) {
|
|
5
|
-
console.error(
|
|
6
|
-
'GITHUB_EVENT_PATH is not set. This script must run inside GitHub Actions.',
|
|
7
|
-
);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const eventJson = JSON.parse(fs.readFileSync(eventPath, 'utf8'));
|
|
12
|
-
const prTitle = eventJson.pull_request?.title;
|
|
13
|
-
if (!prTitle) {
|
|
14
|
-
console.error('Could not read pull_request.title from event payload.');
|
|
15
|
-
process.exit(1);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const isValidType = (title) =>
|
|
19
|
-
/^(feat|fix|chore|refactor)(\([a-zA-Z0-9-]+\))?:\s[a-z0-9].*$/.test(title);
|
|
20
|
-
|
|
21
|
-
const validateTitle = (title) => {
|
|
22
|
-
if (!isValidType(title)) {
|
|
23
|
-
console.error(
|
|
24
|
-
`PR title does not follow the required format "[type]: [description]"
|
|
25
|
-
Examples: "feat: add --cc flag" | "fix: domain fetch timeout"
|
|
26
|
-
Types: feat · fix · chore · refactor
|
|
27
|
-
Rules: lowercase after the colon`,
|
|
28
|
-
);
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
console.info(`PR title valid: "${title}"`);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
validateTitle(prTitle);
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches: [main]
|
|
5
|
-
pull_request:
|
|
6
|
-
concurrency:
|
|
7
|
-
group: ci-${{ github.ref }}
|
|
8
|
-
cancel-in-progress: true
|
|
9
|
-
jobs:
|
|
10
|
-
lint:
|
|
11
|
-
runs-on: blacksmith-2vcpu-ubuntu-2204
|
|
12
|
-
steps:
|
|
13
|
-
- uses: actions/checkout@v6
|
|
14
|
-
- uses: oven-sh/setup-bun@v2
|
|
15
|
-
- run: bun install --frozen-lockfile
|
|
16
|
-
- run: bun run lint
|
|
17
|
-
|
|
18
|
-
typecheck:
|
|
19
|
-
runs-on: blacksmith-2vcpu-ubuntu-2204
|
|
20
|
-
steps:
|
|
21
|
-
- uses: actions/checkout@v6
|
|
22
|
-
- uses: oven-sh/setup-bun@v2
|
|
23
|
-
- run: bun install --frozen-lockfile
|
|
24
|
-
- run: bun run typecheck
|
|
25
|
-
|
|
26
|
-
test:
|
|
27
|
-
runs-on: blacksmith-2vcpu-ubuntu-2204
|
|
28
|
-
steps:
|
|
29
|
-
- uses: actions/checkout@v6
|
|
30
|
-
- uses: oven-sh/setup-bun@v2
|
|
31
|
-
- run: bun install --frozen-lockfile
|
|
32
|
-
- run: bun run test
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
name: PR Title Check
|
|
2
|
-
on:
|
|
3
|
-
pull_request:
|
|
4
|
-
types: [opened, edited, synchronize, reopened]
|
|
5
|
-
permissions:
|
|
6
|
-
contents: read
|
|
7
|
-
pull-requests: read
|
|
8
|
-
jobs:
|
|
9
|
-
pr-title-check:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v6
|
|
13
|
-
- run: node .github/scripts/pr-title-check.js
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
name: Release
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
tags:
|
|
5
|
-
- 'v*'
|
|
6
|
-
concurrency:
|
|
7
|
-
group: release
|
|
8
|
-
cancel-in-progress: false
|
|
9
|
-
jobs:
|
|
10
|
-
test-binary:
|
|
11
|
-
strategy:
|
|
12
|
-
fail-fast: false
|
|
13
|
-
matrix:
|
|
14
|
-
include:
|
|
15
|
-
- os: macos-latest
|
|
16
|
-
target: bun-darwin-arm64
|
|
17
|
-
binary: dist/resend
|
|
18
|
-
flags: "--bytecode"
|
|
19
|
-
- os: ubuntu-latest
|
|
20
|
-
target: bun-linux-x64
|
|
21
|
-
binary: dist/resend
|
|
22
|
-
flags: "--bytecode"
|
|
23
|
-
- os: windows-latest
|
|
24
|
-
target: bun-windows-x64
|
|
25
|
-
binary: dist/resend.exe
|
|
26
|
-
flags: ""
|
|
27
|
-
runs-on: ${{ matrix.os }}
|
|
28
|
-
steps:
|
|
29
|
-
- uses: actions/checkout@v6
|
|
30
|
-
|
|
31
|
-
- uses: oven-sh/setup-bun@v2
|
|
32
|
-
|
|
33
|
-
- name: Install dependencies
|
|
34
|
-
run: bun install --frozen-lockfile
|
|
35
|
-
|
|
36
|
-
- name: Build binary
|
|
37
|
-
run: bun build --compile --minify --sourcemap ${{ matrix.flags }} src/cli.ts --target=${{ matrix.target }} --outfile ${{ matrix.binary }}
|
|
38
|
-
|
|
39
|
-
- name: Verify binary runs
|
|
40
|
-
run: ${{ matrix.binary }} --version
|
|
41
|
-
|
|
42
|
-
release:
|
|
43
|
-
needs: test-binary
|
|
44
|
-
permissions:
|
|
45
|
-
contents: write
|
|
46
|
-
runs-on: blacksmith-2vcpu-ubuntu-2204
|
|
47
|
-
steps:
|
|
48
|
-
- uses: actions/checkout@v6
|
|
49
|
-
|
|
50
|
-
- uses: oven-sh/setup-bun@v2
|
|
51
|
-
|
|
52
|
-
- name: Install dependencies
|
|
53
|
-
run: bun install --frozen-lockfile
|
|
54
|
-
|
|
55
|
-
- name: Build binaries
|
|
56
|
-
run: |
|
|
57
|
-
bun build --compile --minify --sourcemap --bytecode src/cli.ts --target=bun-darwin-arm64 --outfile dist/resend-darwin-arm64
|
|
58
|
-
bun build --compile --minify --sourcemap --bytecode src/cli.ts --target=bun-darwin-x64 --outfile dist/resend-darwin-x64
|
|
59
|
-
bun build --compile --minify --sourcemap --bytecode src/cli.ts --target=bun-linux-x64 --outfile dist/resend-linux-x64
|
|
60
|
-
bun build --compile --minify --sourcemap --bytecode src/cli.ts --target=bun-linux-arm64 --outfile dist/resend-linux-arm64
|
|
61
|
-
bun build --compile --minify --sourcemap src/cli.ts --target=bun-windows-x64 --outfile dist/resend-windows-x64.exe
|
|
62
|
-
|
|
63
|
-
- name: Verify binaries
|
|
64
|
-
run: |
|
|
65
|
-
for f in dist/resend-darwin-arm64 dist/resend-darwin-x64 \
|
|
66
|
-
dist/resend-linux-x64 dist/resend-linux-arm64 \
|
|
67
|
-
dist/resend-windows-x64.exe; do
|
|
68
|
-
[ -s "$f" ] || { echo "Missing or empty: $f"; exit 1; }
|
|
69
|
-
done
|
|
70
|
-
|
|
71
|
-
- name: Package archives
|
|
72
|
-
run: |
|
|
73
|
-
cd dist
|
|
74
|
-
for bin in resend-darwin-arm64 resend-darwin-x64 resend-linux-x64 resend-linux-arm64; do
|
|
75
|
-
cp "$bin" resend
|
|
76
|
-
chmod +x resend
|
|
77
|
-
tar -czf "${bin}.tar.gz" resend
|
|
78
|
-
rm resend
|
|
79
|
-
done
|
|
80
|
-
cp resend-windows-x64.exe resend.exe
|
|
81
|
-
zip resend-windows-x64.zip resend.exe
|
|
82
|
-
rm resend.exe
|
|
83
|
-
|
|
84
|
-
- name: Create GitHub Release
|
|
85
|
-
uses: softprops/action-gh-release@v2
|
|
86
|
-
with:
|
|
87
|
-
generate_release_notes: true
|
|
88
|
-
body: |
|
|
89
|
-
## Install
|
|
90
|
-
|
|
91
|
-
**macOS / Linux**
|
|
92
|
-
```sh
|
|
93
|
-
curl -fsSL https://resend.com/install.sh | bash
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
**Windows (PowerShell)**
|
|
97
|
-
```pwsh
|
|
98
|
-
irm https://resend.com/install.ps1 | iex
|
|
99
|
-
```
|
|
100
|
-
files: |
|
|
101
|
-
dist/resend-darwin-arm64.tar.gz
|
|
102
|
-
dist/resend-darwin-x64.tar.gz
|
|
103
|
-
dist/resend-linux-x64.tar.gz
|
|
104
|
-
dist/resend-linux-arm64.tar.gz
|
|
105
|
-
dist/resend-windows-x64.zip
|
|
106
|
-
|
|
107
|
-
notify-tap:
|
|
108
|
-
name: Trigger Homebrew Tap Update
|
|
109
|
-
needs: release
|
|
110
|
-
runs-on: ubuntu-latest
|
|
111
|
-
permissions:
|
|
112
|
-
contents: read
|
|
113
|
-
steps:
|
|
114
|
-
- name: Dispatch publish-release workflow on tap
|
|
115
|
-
env:
|
|
116
|
-
GH_TOKEN: ${{ secrets.RELEASE_CLI_ON_HOMEBREW }}
|
|
117
|
-
run: |
|
|
118
|
-
gh workflow run publish-release.yml \
|
|
119
|
-
--repo resend/homebrew-cli \
|
|
120
|
-
--field version="${GITHUB_REF_NAME}"
|