Skip to content

Commit

Permalink
feat!: deprecation notices for non-readme-refactored commands (#1099)
Browse files Browse the repository at this point in the history
## 🧰 Changes

BREAKING CHANGE: deprecates commands that are not supported in ReadMe
Refactored. For more information, please visit our migration guide:
https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md

## 🧬 QA & Testing

Does the copy in these deprecation warnings make sense to you? Note that
the links will be broken for now since we haven't tagged a proper v9
release yet, but that will be fixed once this release is out!
  • Loading branch information
kanadgupta authored Dec 5, 2024
1 parent 6ecce00 commit 732e32b
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/commands/categories/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ interface Category {
}

export default class CategoriesCreateCommand extends BaseCommand<typeof CategoriesCreateCommand> {
// needed for deprecation message
static id = 'categories create' as const;

static state = 'deprecated';

static deprecationOptions = {
message: `\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`,
};

static description = 'Create a category with the specified title and guide in your ReadMe project.';

static args = {
Expand Down
9 changes: 9 additions & 0 deletions src/commands/categories/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ import getCategories from '../../lib/getCategories.js';
import { getProjectVersion } from '../../lib/versionSelect.js';

export default class CategoriesCommand extends BaseCommand<typeof CategoriesCommand> {
// needed for deprecation message
static id = 'categories' as const;

static state = 'deprecated';

static deprecationOptions = {
message: `\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`,
};

static description = 'Get all categories in your ReadMe project.';

static flags = {
Expand Down
6 changes: 6 additions & 0 deletions src/commands/custompages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export default class CustomPagesCommand extends BaseCommand<typeof CustomPagesCo
// needed for unit tests, even though we also specify this in src/index.ts
static id = 'custompages' as const;

static state = 'deprecated';

static deprecationOptions = {
message: `\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`,
};

static summary = 'Sync Markdown/HTML files to your ReadMe project as Custom Pages.';

static description =
Expand Down
6 changes: 6 additions & 0 deletions src/commands/docs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ export default class DocsCommand extends BaseCommand<typeof DocsCommand> {
// needed for unit tests, even though we also specify this in src/index.ts
static id = 'docs' as const;

static state = 'deprecated';

static deprecationOptions = {
message: `\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`,
};

static aliases = ['guides'];

static summary = 'Sync Markdown files to your ReadMe project as Guides.';
Expand Down
9 changes: 9 additions & 0 deletions src/commands/docs/prune.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ function getSlug(filename: string): string {
}

export default class DocsPruneCommand extends BaseCommand<typeof DocsPruneCommand> {
// needed for deprecation message
static id = 'docs prune' as const;

static state = 'deprecated';

static deprecationOptions = {
message: `\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`,
};

static aliases = ['guides prune'];

static description = 'Delete any docs from ReadMe if their slugs are not found in the target folder.';
Expand Down
5 changes: 4 additions & 1 deletion src/commands/open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ export default class OpenCommand extends BaseCommand<typeof OpenCommand> {

static hidden = true;

// needed for deprecation message
static id = 'open' as const;

static state = 'deprecated';

static deprecationOptions = {
message: '`rdme open` is deprecated and will be removed in a future release.',
message: `\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`,
};

async run() {
Expand Down
6 changes: 6 additions & 0 deletions src/commands/versions/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ export default class CreateVersionCommand extends BaseCommand<typeof CreateVersi
// needed for unit tests, even though we also specify this in src/index.ts
static id = 'versions create';

static state = 'deprecated';

static deprecationOptions = {
message: `\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`,
};

static args = {
version: Args.string({
description: "The version you'd like to create. Must be valid SemVer (https://semver.org/)",
Expand Down
9 changes: 9 additions & 0 deletions src/commands/versions/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ import { cleanAPIv1Headers, handleAPIv1Res, readmeAPIv1Fetch } from '../../lib/r
import { getProjectVersion } from '../../lib/versionSelect.js';

export default class DeleteVersionCommand extends BaseCommand<typeof DeleteVersionCommand> {
// needed for deprecation message
static id = 'versions delete' as const;

static state = 'deprecated';

static deprecationOptions = {
message: `\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`,
};

static description = 'Delete a version associated with your ReadMe project.';

static args = {
Expand Down
9 changes: 9 additions & 0 deletions src/commands/versions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ export interface Version {
}

export default class VersionsCommand extends BaseCommand<typeof VersionsCommand> {
// needed for deprecation message
static id = 'versions' as const;

static state = 'deprecated';

static deprecationOptions = {
message: `\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`,
};

static description = 'List versions available in your project or get a version by SemVer (https://semver.org/).';

static flags = {
Expand Down
9 changes: 9 additions & 0 deletions src/commands/versions/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ import { cleanAPIv1Headers, handleAPIv1Res, readmeAPIv1Fetch } from '../../lib/r
import { getProjectVersion } from '../../lib/versionSelect.js';

export default class UpdateVersionCommand extends BaseCommand<typeof UpdateVersionCommand> {
// needed for deprecation message
static id = 'versions update' as const;

static state = 'deprecated';

static deprecationOptions = {
message: `\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`,
};

static description = 'Update an existing version for your project.';

static args = {
Expand Down

0 comments on commit 732e32b

Please sign in to comment.