Skip to content

Commit ca0667b

Browse files
authored
feat!: upgrade to oclif/core v4 (#180)
* Replace anykey with inquirer * migrate to oclif/core v4 * Switch to npm from yarn * Update dependabot.yml * Add conventional changelog * Fix browser open to login, add script for running example, fill out README * Remove legacy client, update packages, switch to node uuid * Update sinon * Upgrade to eslint 8, apply rules fixes * Add a few more examples, adjust lint rules * Update yargs-parser * Add interactive option to example, fix output * lint cleanup
1 parent 369c860 commit ca0667b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+12587
-6050
lines changed

.circleci/config.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 24 deletions
This file was deleted.

.eslintrc.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
module.exports = {
2+
extends: [
3+
'oclif',
4+
'oclif-typescript',
5+
],
6+
overrides: [
7+
{
8+
files: ['test/**/*.ts', 'test/**/*.js'],
9+
rules: {
10+
'prefer-arrow-callback': 'off',
11+
'unicorn/consistent-destructuring': 'warn',
12+
},
13+
},
14+
{
15+
files: ['examples/**/*.ts', 'examples/**/*.js'],
16+
rules: {
17+
'unicorn/prefer-module': 'off',
18+
'unicorn/prefer-top-level-await': 'off',
19+
},
20+
},
21+
],
22+
plugins: ['import'],
23+
rules: {
24+
'@typescript-eslint/no-explicit-any': 'warn',
25+
camelcase: 'off',
26+
'import/namespace': 'warn',
27+
indent: ['error', 2, {MemberExpression: 1}],
28+
'no-useless-constructor': 'warn',
29+
'unicorn/consistent-function-scoping': 'off',
30+
'unicorn/import-style': 'warn',
31+
'unicorn/no-array-for-each': 'off',
32+
'unicorn/no-array-push-push': 'warn',
33+
'unicorn/no-static-only-class': 'off',
34+
'unicorn/numeric-separators-style': 'off',
35+
'unicorn/prefer-array-some': 'warn',
36+
'unicorn/prefer-node-protocol': 'warn',
37+
'unicorn/prefer-string-replace-all': 'off',
38+
},
39+
}

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../CODEOWNERS

.github/dependabot.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
1-
# To get started with Dependabot version updates, you'll need to specify which
2-
# package ecosystems to update and where the package manifests are located.
3-
# Please see the documentation for all configuration options:
4-
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5-
61
version: 2
72
updates:
8-
- package-ecosystem: "npm"
9-
directory: "/"
10-
open-pull-requests-limit: 5
11-
schedule:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
open-pull-requests-limit: 5
6+
schedule:
127
interval: "weekly"
8+
time: "12:00"
9+
day: "sunday"
10+
timezone: "America/Los_Angeles"
11+
- package-ecosystem: "npm"
12+
directory: "/"
13+
open-pull-requests-limit: 5
14+
schedule:
15+
interval: "weekly"
16+
time: "12:00"
17+
day: "sunday"
18+
timezone: "America/Los_Angeles"
19+
groups:
20+
dev-deps:
21+
dependency-type: "development"
22+
patch-dependencies:
23+
update-types:
24+
- "patch"
25+
ignore:
26+
- dependency-name: "@oclif/core"
27+
update-types: ["version-update:semver-major"]
28+
- dependency-name: "typescript"
29+
update-types: ["version-update:semver-major"]

.github/workflows/ci.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ jobs:
1616
uses: actions/setup-node@v4
1717
with:
1818
node-version: ${{ matrix.node-version }}
19-
cache: yarn
20-
- run: yarn --frozen-lockfile --network-timeout 1000000
21-
env:
22-
CI: true
23-
- run: yarn test
24-
env:
25-
CI: true
19+
- run: npm ci
20+
- name: unit tests
21+
run: npm test
22+
- name: linting
23+
run: npm run lint

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
/tmp
66
lib/
77
node_modules/
8-
package-lock.json
8+
yarn.lock
99
.idea/

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nodejs 20.18.3
1+
nodejs 22.15.0

CODEOWNERS

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# All files require review from the Heroku Front-End Dev Tools team.
2+
3+
# Comment line immediately above ownership line is reserved for related GUS information.
4+
# Please exercise caution while editing.
5+
6+
#GUSINFO: Heroku FE Dev Tools,Heroku CLI & Plugins
7+
* @heroku/frontend-dev-tooling
8+
19
#ECCN:Open Source
2-
#GUSINFO:Heroku FE Dev Tools,Heroku CLI & Plugins
3-
* @heroku/front-end

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,54 @@ Base class for Heroku CLI commands. Built off of [oclif](https://oclif.io).
88
[![Known Vulnerabilities](https://snyk.io/test/npm/@heroku-cli/command/badge.svg)](https://snyk.io/test/npm/@heroku-cli/command)
99
[![Downloads/week](https://img.shields.io/npm/dw/@heroku-cli/command.svg)](https://npmjs.org/package/@heroku-cli/command)
1010
[![License](https://img.shields.io/npm/l/@heroku-cli/command.svg)](https://github.com/heroku/heroku-cli-command/blob/master/package.json)
11+
12+
## Overview
13+
14+
This package provides the core functionality for Heroku CLI commands, including a comprehensive set of completion handlers for various Heroku resources. It serves as the foundation for building Heroku CLI commands with built-in support for command-line completion.
15+
16+
## Features
17+
18+
### Completion Handlers
19+
20+
The package includes completion handlers for various Heroku resources:
21+
22+
- **Apps**: Autocomplete for Heroku application names
23+
- **Addons**: Autocomplete for add-ons associated with specific apps
24+
- **Dynos**: Autocomplete for dyno names within apps
25+
- **Buildpacks**: Common Heroku buildpack options
26+
- **Dyno Sizes**: Available dyno size options
27+
- **Files**: Local file system completion
28+
- **Pipelines**: Heroku pipeline names
29+
- **Process Types**: Process types from Procfile
30+
- **Regions**: Available Heroku regions
31+
- **Git Remotes**: Git remote names
32+
- **Roles**: User role options (admin, collaborator, member, owner)
33+
- **Scopes**: Permission scope options
34+
- **Spaces**: Heroku Private Spaces
35+
- **Stacks**: Available Heroku stacks
36+
- **Stages**: Pipeline stage options
37+
- **Teams**: Heroku team names
38+
39+
### APIClient
40+
41+
The package includes a built-in `APIClient` for making authenticated requests to the Heroku Platform API:
42+
43+
- Handles authentication and request formatting
44+
- Provides a simple interface for making GET requests to Heroku resources
45+
- Automatically parses JSON responses
46+
- Used internally by completion handlers to fetch resource lists
47+
- Supports configurable request options through the CLI config
48+
49+
Example usage:
50+
```typescript
51+
const heroku = new APIClient(config)
52+
const {body: resources} = await heroku.get('/apps')
53+
```
54+
55+
## Usage
56+
57+
This package is primarily used as a dependency in other Heroku CLI plugins and commands. It provides the base functionality needed to implement Heroku CLI commands with proper completion support.
58+
59+
## Development
60+
61+
Built with TypeScript and uses the [oclif](https://oclif.io) framework for CLI command development.

0 commit comments

Comments
 (0)