Skip to content

Commit

Permalink
feat!: remove validate, deprecate/hide open (#1072)
Browse files Browse the repository at this point in the history
## 🧰 Changes

(writing these below as such so they get picked up by
`semantic-release`)

BREAKING CHANGE: `rdme validate` has been removed, use `rdme
openapi:validate` instead.

BREAKING CHANGE: `rdme open` is now deprecated

also updates our docs accordingly
  • Loading branch information
kanadgupta authored Nov 19, 2024
1 parent e85dcc6 commit f1b46f6
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 34 deletions.
8 changes: 0 additions & 8 deletions __tests__/commands/openapi/validate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,4 @@ describe('rdme openapi:validate', () => {
);
});
});

describe('rdme validate alias', () => {
it('should should `rdme openapi:validate`', async () => {
return expect(
(await oclifRunCommand(['validate', require.resolve('@readme/oas-examples/3.0/json/petstore.json')])).result,
).toContain(chalk.green('petstore.json is a valid OpenAPI API definition!'));
});
});
});
19 changes: 0 additions & 19 deletions documentation/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ USAGE
* [`rdme help [COMMAND]`](#rdme-help-command)
* [`rdme login`](#rdme-login)
* [`rdme logout`](#rdme-logout)
* [`rdme open`](#rdme-open)
* [`rdme openapi [SPEC]`](#rdme-openapi-spec)
* [`rdme openapi:convert [SPEC]`](#rdme-openapiconvert-spec)
* [`rdme openapi:inspect [SPEC]`](#rdme-openapiinspect-spec)
Expand Down Expand Up @@ -262,21 +261,6 @@ DESCRIPTION
Logs the currently authenticated user out of ReadMe.
```

## `rdme open`

Open your current ReadMe project in the browser.

```
USAGE
$ rdme open [--dash]
FLAGS
--dash Opens your current ReadMe project dashboard.
DESCRIPTION
Open your current ReadMe project in the browser.
```

## `rdme openapi [SPEC]`

Upload, or resync, your OpenAPI/Swagger definition to ReadMe.
Expand Down Expand Up @@ -403,9 +387,6 @@ FLAGS
DESCRIPTION
Validate your OpenAPI/Swagger definition.
ALIASES
$ rdme validate
```

## `rdme versions`
Expand Down
4 changes: 2 additions & 2 deletions documentation/rdme.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,15 @@ We recommend using the [quick start](#quick-start) to get started with GitHub Ac
The command syntax in GitHub Actions is functionally equivalent to the CLI. For example, take the following CLI command:
```sh
rdme validate [url-or-local-path-to-file]
rdme openapi:validate [url-or-local-path-to-file]
```

To execute this command via GitHub Actions, the step would look like this:

```yml
- uses: readmeio/rdme@RDME_VERSION
with:
rdme: validate [url-or-local-path-to-file]
rdme: openapi:validate [url-or-local-path-to-file]
```
The following section has links to full GitHub Actions workflow file examples.
Expand Down
8 changes: 8 additions & 0 deletions src/commands/open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ export default class OpenCommand extends BaseCommand<typeof OpenCommand> {
mock: Flags.boolean({ description: '[hidden] used for mocking.', hidden: true }),
};

static hidden = true;

static state = 'deprecated';

static deprecationOptions = {
message: '`rdme open` is deprecated and will be removed in a future release.',
};

async run() {
const { dash, mock } = this.flags;
const { apiKey, project } = getCurrentConfig();
Expand Down
4 changes: 0 additions & 4 deletions src/commands/openapi/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ export default class OpenAPIValidateCommand extends BaseCommand<typeof OpenAPIVa
// needed for unit tests, even though we also specify this in src/index.ts
static id = 'openapi:validate';

static aliases = ['validate'];

static deprecateAliases = true;

static args = {
spec: Args.string({ description: 'A file/URL to your API definition' }),
};
Expand Down
2 changes: 1 addition & 1 deletion src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const config = {
host: 'https://dash.readme.com',
hub: 'https://{project}.readme.io', // this is only used for the `open` command
hub: 'https://{project}.readme.io', // this is only used for the `rdme open` command
} as const;

export default config;

0 comments on commit f1b46f6

Please sign in to comment.