Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove oas, swagger, docs:edit #902

Merged
merged 2 commits into from
Sep 14, 2023
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
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
1 change: 0 additions & 1 deletion knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { KnipConfig } from 'knip';
const config: KnipConfig = {
ignore: ['bin/*.js', 'vitest.single-threaded.config.ts'],
ignoreBinaries: ['semantic-release'],
ignoreDependencies: ['editor'],
};

export default config;
6 changes: 0 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"command-line-usage": "^7.0.1",
"configstore": "^6.0.0",
"debug": "^4.3.3",
"editor": "^1.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"formdata-node": "^5.0.1",
"gray-matter": "^4.0.1",
"ignore": "^5.2.0",
Expand Down
2 changes: 0 additions & 2 deletions src/.sink.d.ts

This file was deleted.

Loading