Skip to content

Commit

Permalink
Merge branch 'next' into oleh/openapi-adding-command-to-solve-circula…
Browse files Browse the repository at this point in the history
…rity-and-recursiveness
  • Loading branch information
olehshh authored Dec 11, 2024
2 parents 09b8039 + 301c36d commit 4011248
Show file tree
Hide file tree
Showing 29 changed files with 162 additions and 118 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,11 @@ jobs:
uses: ./rdme-repo/
with:
rdme: openapi "oas-examples-repo/3.1/json/petstore.json" --key "${{ secrets.RDME_TEST_PROJECT_API_KEY }}" --id=${{ secrets.RDME_TEST_PROJECT_API_SETTING }}

# this is a test to ensure that the rdme github action can run properly
# the way that our users invoke it
- name: E2E run of `openapi validate` on `next` branch
uses: readmeio/rdme@next
if: ${{ github.ref }} == 'refs/heads/next'
with:
rdme: openapi validate oas-examples-repo/3.1/json/petstore.json
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,20 @@ jobs:
with:
github_token: ${{ secrets.RELEASE_GH_TOKEN }}
branch: next

# quick assertion to validate that rdme CLI can be installed and run on ubuntu
postrelease:
name: Post-release checks
needs: release
runs-on: ubuntu-latest
if: ${{ github.ref }} == 'refs/heads/next'
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install `rdme` from npm
run: npm install -g rdme@next
- name: Print rdme CLI version
run: rdme --version
timeout-minutes: 1
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
## [9.0.4-next.2](https://github.com/readmeio/rdme/compare/v9.0.4-next.1...v9.0.4-next.2) (2024-12-11)


### Bug Fixes

* copy package.json file instead of symlinking ([1d56c21](https://github.com/readmeio/rdme/commit/1d56c21b0313fb0dcf0721294196b729eb2eaa49))

## [9.0.4-next.1](https://github.com/readmeio/rdme/compare/v9.0.3...v9.0.4-next.1) (2024-12-11)


### Bug Fixes

* bring back [#1117](https://github.com/readmeio/rdme/issues/1117) without breaking everything ([#1120](https://github.com/readmeio/rdme/issues/1120)) ([d5d74c5](https://github.com/readmeio/rdme/commit/d5d74c5ac4200c1e0ceaf994f2ff71086894b2c3))

## [9.0.3](https://github.com/readmeio/rdme/compare/v9.0.2...v9.0.3) (2024-12-11)


### Bug Fixes

* revert [#1117](https://github.com/readmeio/rdme/issues/1117) ([#1119](https://github.com/readmeio/rdme/issues/1119)) ([c20cc3c](https://github.com/readmeio/rdme/commit/c20cc3cf89a4e108efa485e46c26e8bfb7ba68d6))

## [9.0.3-next.1](https://github.com/readmeio/rdme/compare/v9.0.2...v9.0.3-next.1) (2024-12-11)


### Bug Fixes

* revert [#1117](https://github.com/readmeio/rdme/issues/1117) ([#1119](https://github.com/readmeio/rdme/issues/1119)) ([c20cc3c](https://github.com/readmeio/rdme/commit/c20cc3cf89a4e108efa485e46c26e8bfb7ba68d6))

## [9.0.2](https://github.com/readmeio/rdme/compare/v9.0.1...v9.0.2) (2024-12-11)


### Bug Fixes

* **autocomplete:** bad alias ([#1118](https://github.com/readmeio/rdme/issues/1118)) ([5b8d928](https://github.com/readmeio/rdme/commit/5b8d9286e891b1bc5cfbcfce1a1862cb8dbdf2b4))
* remove import attributes ([#1117](https://github.com/readmeio/rdme/issues/1117)) ([e662654](https://github.com/readmeio/rdme/commit/e66265486cac80f79c79f8594b7c60862fadbe12)), closes [#1115](https://github.com/readmeio/rdme/issues/1115) [/github.com/readmeio/rdme/pull/1115#issuecomment-2532123627](https://github.com//github.com/readmeio/rdme/pull/1115/issues/issuecomment-2532123627)

## [9.0.2-next.2](https://github.com/readmeio/rdme/compare/v9.0.2-next.1...v9.0.2-next.2) (2024-12-10)


### Bug Fixes

* **autocomplete:** bad alias ([#1118](https://github.com/readmeio/rdme/issues/1118)) ([5b8d928](https://github.com/readmeio/rdme/commit/5b8d9286e891b1bc5cfbcfce1a1862cb8dbdf2b4))

## [9.0.2-next.1](https://github.com/readmeio/rdme/compare/v9.0.1...v9.0.2-next.1) (2024-12-10)


### Bug Fixes

* remove import attributes ([#1117](https://github.com/readmeio/rdme/issues/1117)) ([e662654](https://github.com/readmeio/rdme/commit/e66265486cac80f79c79f8594b7c60862fadbe12)), closes [#1115](https://github.com/readmeio/rdme/issues/1115) [/github.com/readmeio/rdme/pull/1115#issuecomment-2532123627](https://github.com//github.com/readmeio/rdme/pull/1115/issues/issuecomment-2532123627)

## [9.0.1](https://github.com/readmeio/rdme/compare/v9.0.0...v9.0.1) (2024-12-09)


Expand Down
2 changes: 1 addition & 1 deletion __tests__/commands/logout.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, afterEach, beforeAll, it, expect } from 'vitest';

import pkg from '../../package.json';
import pkg from '../../package.json' with { type: 'json' };
import Command from '../../src/commands/logout.js';
import configStore from '../../src/lib/configstore.js';
import { runCommandAndReturnResult } from '../helpers/oclif.js';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/commands/open.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Version } from '../../src/commands/versions/index.js';
import chalk from 'chalk';
import { describe, afterEach, beforeAll, it, expect } from 'vitest';

import pkg from '../../package.json';
import pkg from '../../package.json' with { type: 'json' };
import Command from '../../src/commands/open.js';
import configStore from '../../src/lib/configstore.js';
import { getAPIv1Mock } from '../helpers/get-api-mock.js';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/commands/whoami.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, afterEach, it, expect, beforeAll } from 'vitest';

import pkg from '../../package.json';
import pkg from '../../package.json' with { type: 'json' };
import Command from '../../src/commands/whoami.js';
import configStore from '../../src/lib/configstore.js';
import { runCommandAndReturnResult } from '../helpers/oclif.js';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/helpers/get-gha-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { vi } from 'vitest';

import configstore from '../../src/lib/configstore.js';
import { git } from '../../src/lib/createGHA/index.js';
import * as getPkgVersion from '../../src/lib/getPkgVersion.js';
import * as getPkgVersion from '../../src/lib/getPkg.js';

import getGitRemoteMock from './get-git-mock.js';

Expand Down
2 changes: 1 addition & 1 deletion __tests__/lib/createGHA.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { describe, beforeEach, afterEach, it, expect, vi, type MockInstance, bef

import configstore from '../../src/lib/configstore.js';
import { getConfigStoreKey, getGHAFileName, git } from '../../src/lib/createGHA/index.js';
import { getMajorPkgVersion } from '../../src/lib/getPkgVersion.js';
import { getMajorPkgVersion } from '../../src/lib/getPkg.js';
import { after, before } from '../helpers/get-gha-setup.js';
import getGitRemoteMock from '../helpers/get-git-mock.js';
import ghaWorkflowSchema from '../helpers/github-workflow-schema.json' with { type: 'json' };
Expand Down
8 changes: 4 additions & 4 deletions __tests__/lib/getPkgVersion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import semver from 'semver';
import { describe, beforeEach, afterEach, it, expect, vi, type MockInstance } from 'vitest';

import pkg from '../../package.json' with { type: 'json' };
import { getNodeVersion, getPkgVersion } from '../../src/lib/getPkgVersion.js';
import { getNodeVersion, getPkgVersion, getPkgVersionFromNPM } from '../../src/lib/getPkg.js';

describe('#getNodeVersion()', () => {
it('should extract version that matches range in package.json', () => {
Expand All @@ -27,23 +27,23 @@ describe('#getPkgVersion()', () => {
});

it('should grab version from package.json by default', () => {
return expect(getPkgVersion()).resolves.toBe(pkg.version);
return expect(getPkgVersion()).toBe(pkg.version);
});

it('should fetch version from npm registry', async () => {
const mock = nock('https://registry.npmjs.com', { encodedQueryParams: true })
.get('/rdme')
.reply(200, { 'dist-tags': { latest: '1.0' } });

await expect(getPkgVersion('latest')).resolves.toBe('1.0');
await expect(getPkgVersionFromNPM('latest')).resolves.toBe('1.0');

mock.done();
});

it('should fallback if npm registry fails', async () => {
const mock = nock('https://registry.npmjs.com', { encodedQueryParams: true }).get('/rdme').reply(500);

await expect(getPkgVersion('latest')).resolves.toBe(pkg.version);
await expect(getPkgVersionFromNPM('latest')).resolves.toBe(pkg.version);

mock.done();
});
Expand Down
2 changes: 1 addition & 1 deletion bin/dev.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env -S npx tsx
#!/usr/bin/env npx tsx

async function main() {
const { execute } = await import('@oclif/core');
Expand Down
4 changes: 1 addition & 3 deletions bin/run.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env -S node --no-warnings=ExperimentalWarning
// ^ we need this env variable above to hide the ExperimentalWarnings
// source: https://github.com/nodejs/node/issues/10802#issuecomment-573376999
#!/usr/bin/env node

import stringArgv from 'string-argv';

Expand Down
18 changes: 6 additions & 12 deletions bin/set-major-version-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,12 @@ async function runGitCmd(args) {
*/
async function setMajorVersionTag() {
try {
console.log(
'kanad test',
JSON.stringify({
GITHUB_BASE_REF: process.env.GITHUB_BASE_REF,
GITHUB_HEAD_REF: process.env.GITHUB_HEAD_REF,
GITHUB_REF: process.env.GITHUB_REF,
GITHUB_REF_NAME: process.env.GITHUB_REF_NAME,
GITHUB_REF_PROTECTED: process.env.GITHUB_REF_PROTECTED,
GITHUB_REF_TYPE: process.env.GITHUB_REF_TYPE,
GITHUB_WORKFLOW_REF: process.env.GITHUB_WORKFLOW_REF,
}),
);
// The major version tag should only be set when releasing on the `main` branch
if (process.env.GITHUB_REF !== 'refs/heads/main') {
// eslint-disable-next-line no-console
console.warn(`Running with the following ref: ${process.env.GITHUB_REF || 'n/a'}, not setting major version tag`);
return;
}

const parsedVersion = parse(pkg.version);

Expand Down
2 changes: 1 addition & 1 deletion bin/set-version-output.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import * as core from '@actions/core';

// eslint-disable-next-line import/extensions
import { getNodeVersion, getMajorPkgVersion } from '../dist/lib/getPkgVersion.js';
import { getNodeVersion, getMajorPkgVersion } from '../dist/lib/getPkg.js';

/**
* Sets output parameters for GitHub Actions workflow so we can do
Expand Down
8 changes: 4 additions & 4 deletions dist-gha/commands.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist-gha/run.cjs

Large diffs are not rendered by default.

16 changes: 4 additions & 12 deletions documentation/commands/categories.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ USAGE
$ rdme categories --key <value> [--version <value>]
FLAGS
--key=<value> (required) An API key for your ReadMe project. Note that API authentication is required despite
being omitted from the example usage. See our docs for more information:
https://github.com/readmeio/rdme/tree/v9#authentication
--key=<value> (required) ReadMe project API key
--version=<value> ReadMe project version
DESCRIPTION
Expand All @@ -29,13 +27,11 @@ EXAMPLES
$ rdme categories --version={project-version}
FLAG DESCRIPTIONS
--key=<value>
--key=<value> ReadMe project API key
An API key for your ReadMe project. Note that API authentication is required despite being omitted from the example
usage. See our docs for more information: https://github.com/readmeio/rdme/tree/v9#authentication
ReadMe project API key
--version=<value> ReadMe project version
If running command in a CI environment and this option is not passed, the main project version will be used. See our
Expand All @@ -56,9 +52,7 @@ ARGUMENTS
FLAGS
--categoryType=<option> (required) Category type
<options: guide|reference>
--key=<value> (required) An API key for your ReadMe project. Note that API authentication is required
despite being omitted from the example usage. See our docs for more information:
https://github.com/readmeio/rdme/tree/v9#authentication
--key=<value> (required) ReadMe project API key
--preventDuplicates Prevents the creation of a new category if there is an existing category with a matching
`categoryType` and `title`
--version=<value> ReadMe project version
Expand All @@ -78,13 +72,11 @@ EXAMPLES
--preventDuplicates
FLAG DESCRIPTIONS
--key=<value>
--key=<value> ReadMe project API key
An API key for your ReadMe project. Note that API authentication is required despite being omitted from the example
usage. See our docs for more information: https://github.com/readmeio/rdme/tree/v9#authentication
ReadMe project API key
--version=<value> ReadMe project version
If running command in a CI environment and this option is not passed, the main project version will be used. See our
Expand Down
8 changes: 2 additions & 6 deletions documentation/commands/changelogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ ARGUMENTS
FLAGS
--dryRun Runs the command without creating/updating any changelogs in ReadMe. Useful for debugging.
--github Create a new GitHub Actions workflow for this command.
--key=<value> (required) An API key for your ReadMe project. Note that API authentication is required despite being
omitted from the example usage. See our docs for more information:
https://github.com/readmeio/rdme/tree/v9#authentication
--key=<value> (required) ReadMe project API key
DESCRIPTION
Sync Markdown files to your ReadMe project as Changelog posts.
Expand All @@ -42,10 +40,8 @@ EXAMPLES
$ rdme changelogs [path] --version={project-version} --dryRun
FLAG DESCRIPTIONS
--key=<value>
--key=<value> ReadMe project API key
An API key for your ReadMe project. Note that API authentication is required despite being omitted from the example
usage. See our docs for more information: https://github.com/readmeio/rdme/tree/v9#authentication
ReadMe project API key
```
8 changes: 2 additions & 6 deletions documentation/commands/custompages.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ ARGUMENTS
FLAGS
--dryRun Runs the command without creating/updating any custom pages in ReadMe. Useful for debugging.
--github Create a new GitHub Actions workflow for this command.
--key=<value> (required) An API key for your ReadMe project. Note that API authentication is required despite being
omitted from the example usage. See our docs for more information:
https://github.com/readmeio/rdme/tree/v9#authentication
--key=<value> (required) ReadMe project API key
DESCRIPTION
Sync Markdown/HTML files to your ReadMe project as Custom Pages.
Expand All @@ -42,10 +40,8 @@ EXAMPLES
$ rdme custompages [path] --version={project-version} --dryRun
FLAG DESCRIPTIONS
--key=<value>
--key=<value> ReadMe project API key
An API key for your ReadMe project. Note that API authentication is required despite being omitted from the example
usage. See our docs for more information: https://github.com/readmeio/rdme/tree/v9#authentication
ReadMe project API key
```
16 changes: 4 additions & 12 deletions documentation/commands/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ ARGUMENTS
FLAGS
--dryRun Runs the command without creating/updating any docs in ReadMe. Useful for debugging.
--github Create a new GitHub Actions workflow for this command.
--key=<value> (required) An API key for your ReadMe project. Note that API authentication is required despite
being omitted from the example usage. See our docs for more information:
https://github.com/readmeio/rdme/tree/v9#authentication
--key=<value> (required) ReadMe project API key
--version=<value> ReadMe project version
DESCRIPTION
Expand All @@ -47,13 +45,11 @@ EXAMPLES
$ rdme docs [path] --version={project-version} --dryRun
FLAG DESCRIPTIONS
--key=<value>
--key=<value> ReadMe project API key
An API key for your ReadMe project. Note that API authentication is required despite being omitted from the example
usage. See our docs for more information: https://github.com/readmeio/rdme/tree/v9#authentication
ReadMe project API key
--version=<value> ReadMe project version
If running command in a CI environment and this option is not passed, the main project version will be used. See our
Expand All @@ -75,9 +71,7 @@ FLAGS
--confirm Bypass the confirmation prompt. Useful for CI environments.
--dryRun Runs the command without deleting any docs in ReadMe. Useful for debugging.
--github Create a new GitHub Actions workflow for this command.
--key=<value> (required) An API key for your ReadMe project. Note that API authentication is required despite
being omitted from the example usage. See our docs for more information:
https://github.com/readmeio/rdme/tree/v9#authentication
--key=<value> (required) ReadMe project API key
--version=<value> ReadMe project version
DESCRIPTION
Expand All @@ -96,13 +90,11 @@ EXAMPLES
$ rdme docs prune [path-to-directory-of-markdown] --confirm
FLAG DESCRIPTIONS
--key=<value>
--key=<value> ReadMe project API key
An API key for your ReadMe project. Note that API authentication is required despite being omitted from the example
usage. See our docs for more information: https://github.com/readmeio/rdme/tree/v9#authentication
ReadMe project API key
--version=<value> ReadMe project version
If running command in a CI environment and this option is not passed, the main project version will be used. See our
Expand Down
8 changes: 2 additions & 6 deletions documentation/commands/openapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ FLAGS
--github Create a new GitHub Actions workflow for this command.
--id=<value> Unique identifier for your API definition. Use this if you're re-uploading an existing API
definition.
--key=<value> (required) An API key for your ReadMe project. Note that API authentication is required
despite being omitted from the example usage. See our docs for more information:
https://github.com/readmeio/rdme/tree/v9#authentication
--key=<value> (required) ReadMe project API key
--raw Return the command results as a JSON object instead of a pretty output.
--title=<value> An override value for the `info.title` field in the API definition
--update Bypasses the create/update prompt and automatically updates an existing API definition in
Expand Down Expand Up @@ -100,13 +98,11 @@ EXAMPLES
$ rdme openapi [url-or-local-path-to-file] --version={project-version} --update
FLAG DESCRIPTIONS
--key=<value>
--key=<value> ReadMe project API key
An API key for your ReadMe project. Note that API authentication is required despite being omitted from the example
usage. See our docs for more information: https://github.com/readmeio/rdme/tree/v9#authentication
ReadMe project API key
--update Bypasses the create/update prompt and automatically updates an existing API definition in ReadMe.
Note that this flag only works if there's only one API definition associated with the current version.
Expand Down
Loading

0 comments on commit 4011248

Please sign in to comment.