Skip to content

Commit

Permalink
feat!: deprecation notices for non-readme-refactored commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadgupta committed Dec 4, 2024
1 parent 64a8c2f commit c25aebd
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 0 deletions.
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';

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';

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';

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
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';

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';

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';

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 c25aebd

Please sign in to comment.