Skip to content

Commit

Permalink
feat: remove oas, swagger, docs:edit
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadgupta committed Sep 14, 2023
1 parent 92332d1 commit 73f791f
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 390 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ The following examples use JSON files, but `rdme` supports API Definitions that
`rdme openapi` locates your API definition (if [you don't supply one](#omitting-the-file-path)), validates it, and then syncs it to your API reference on ReadMe.

> [!NOTE]
> The `rdme openapi` command supports both OpenAPI and Swagger API definitions. The `rdme swagger` command is an alias for `rdme openapi` and is deprecated.
> The `rdme openapi` command supports both OpenAPI and Swagger API definitions.
If you wish to programmatically access any of this script's results (such as the API definition ID or the link to the corresponding docs in your dashboard), supply the `--raw` flag and the command will return a JSON output.

Expand Down
178 changes: 0 additions & 178 deletions __tests__/cmds/docs/edit.test.ts

This file was deleted.

18 changes: 0 additions & 18 deletions __tests__/cmds/openapi/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import prompts from 'prompts';
import { describe, beforeAll, beforeEach, afterEach, it, expect, vi } from 'vitest';

import OpenAPICommand from '../../../src/cmds/openapi/index.js';
import SwaggerCommand from '../../../src/cmds/swagger.js';
import APIError from '../../../src/lib/apiError.js';
import config from '../../../src/lib/config.js';
import petstoreWeird from '../../__fixtures__/petstore-simple-weird-version.json' assert { type: 'json' };
Expand All @@ -18,7 +17,6 @@ import { after, before } from '../../helpers/get-gha-setup.js';
import { after as afterGHAEnv, before as beforeGHAEnv } from '../../helpers/setup-gha-env.js';

const openapi = new OpenAPICommand();
const swagger = new SwaggerCommand();

let consoleInfoSpy;
let consoleWarnSpy;
Expand Down Expand Up @@ -1395,19 +1393,3 @@ describe('rdme openapi', () => {
});
});
});

describe('rdme swagger', () => {
beforeEach(() => {
consoleWarnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});
});

afterEach(() => {
consoleWarnSpy.mockRestore();
});

it('should run `rdme openapi`', () => {
return expect(swagger.run({ spec: 'some-non-existent-path', key, id, version })).rejects.toThrow(
"ENOENT: no such file or directory, open 'some-non-existent-path'",
);
});
});
8 changes: 0 additions & 8 deletions __tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,6 @@ describe('cli', () => {
});
});

it('should error with `rdme oas` arguments passed in', () => {
return expect(cli(['oas', 'endpoint'])).rejects.toStrictEqual(
new Error(
"This `oas` integration is now inactive.\n\nIf you're looking to create an OpenAPI definition, we recommend https://npm.im/swagger-inline",
),
);
});

describe('GHA onboarding via @supportsGHA decorator', () => {
let consoleInfoSpy;
const key = '123';
Expand Down
15 changes: 0 additions & 15 deletions __tests__/lib/__snapshots__/commands.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ exports[`utils > #listByCategory > should list commands by category 1`] = `
"hidden": false,
"name": "openapi:validate",
},
{
"description": "Alias for \`rdme openapi\`. [deprecated]",
"hidden": true,
"name": "swagger",
},
{
"description": "Alias for \`rdme openapi:validate\` [deprecated].",
"hidden": true,
Expand Down Expand Up @@ -109,11 +104,6 @@ exports[`utils > #listByCategory > should list commands by category 1`] = `
"hidden": false,
"name": "docs:prune",
},
{
"description": "Edit a single file from your ReadMe project without saving locally. [deprecated]",
"hidden": true,
"name": "docs:edit",
},
{
"description": "Alias for \`rdme docs\`.",
"hidden": false,
Expand All @@ -129,11 +119,6 @@ exports[`utils > #listByCategory > should list commands by category 1`] = `
},
"utilities": {
"commands": [
{
"description": "Helpful OpenAPI generation tooling. [inactive]",
"hidden": true,
"name": "oas",
},
{
"description": "Open your current ReadMe project in the browser.",
"hidden": false,
Expand Down
111 changes: 0 additions & 111 deletions src/cmds/docs/edit.ts

This file was deleted.

Loading

0 comments on commit 73f791f

Please sign in to comment.