Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rohit-gohri/redocusaurus
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.2.1
Choose a base ref
...
head repository: rohit-gohri/redocusaurus
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.2.2
Choose a head ref
  • 10 commits
  • 16 files changed
  • 4 contributors

Commits on Mar 20, 2025

  1. Bump prismjs from 1.29.0 to 1.30.0 (#401)

    Bumps [prismjs](https://github.com/PrismJS/prism) from 1.29.0 to 1.30.0.
    - [Release notes](https://github.com/PrismJS/prism/releases)
    - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
    - [Commits](PrismJS/prism@v1.29.0...v1.30.0)
    
    ---
    updated-dependencies:
    - dependency-name: prismjs
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 20, 2025
    Copy the full SHA
    c890d6c View commit details
  2. Bump serialize-javascript from 6.0.1 to 6.0.2 (#397)

    Bumps [serialize-javascript](https://github.com/yahoo/serialize-javascript) from 6.0.1 to 6.0.2.
    - [Release notes](https://github.com/yahoo/serialize-javascript/releases)
    - [Commits](yahoo/serialize-javascript@v6.0.1...v6.0.2)
    
    ---
    updated-dependencies:
    - dependency-name: serialize-javascript
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 20, 2025
    Copy the full SHA
    7666a03 View commit details
  3. Bump dompurify from 3.1.5 to 3.2.4 (#396)

    Bumps [dompurify](https://github.com/cure53/DOMPurify) from 3.1.5 to 3.2.4.
    - [Release notes](https://github.com/cure53/DOMPurify/releases)
    - [Commits](cure53/DOMPurify@3.1.5...3.2.4)
    
    ---
    updated-dependencies:
    - dependency-name: dompurify
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 20, 2025
    Copy the full SHA
    4b1791a View commit details
  4. Bump @babel/runtime from 7.26.0 to 7.26.10 (#406)

    Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.26.0 to 7.26.10.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-runtime)
    
    ---
    updated-dependencies:
    - dependency-name: "@babel/runtime"
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 20, 2025
    Copy the full SHA
    4deacca View commit details
  5. Bump @babel/runtime-corejs3 from 7.26.0 to 7.26.10 (#405)

    Bumps [@babel/runtime-corejs3](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime-corejs3) from 7.26.0 to 7.26.10.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-runtime-corejs3)
    
    ---
    updated-dependencies:
    - dependency-name: "@babel/runtime-corejs3"
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 20, 2025
    Copy the full SHA
    c09983c View commit details
  6. Bump @babel/helpers from 7.26.0 to 7.26.10 (#404)

    Bumps [@babel/helpers](https://github.com/babel/babel/tree/HEAD/packages/babel-helpers) from 7.26.0 to 7.26.10.
    - [Release notes](https://github.com/babel/babel/releases)
    - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
    - [Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-helpers)
    
    ---
    updated-dependencies:
    - dependency-name: "@babel/helpers"
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 20, 2025
    Copy the full SHA
    42fc3cb View commit details

Commits on Mar 21, 2025

  1. Add option to disable normalization of spec download URLs (#402)

    * first pass: hard-code false value for absolute
    
    * WIP add toggle for absolute
    
    * move URL normalization flag down to spec options
    
    * undo package.json change
    
    * docs(changeset): Add support for relative spec download URLs
    
    * Apply suggestions from code review
    
    * Update packages/docusaurus-theme-redoc/src/utils/useSpec.ts
    
    ---------
    
    Co-authored-by: Rohit Gohri <code@rohit.page>
    ctreatma and rohit-gohri authored Mar 21, 2025
    Copy the full SHA
    ba2bd9c View commit details
  2. RELEASING: Releasing 3 package(s)

    Releases:
      docusaurus-plugin-redoc@2.2.2
      docusaurus-theme-redoc@2.2.2
      redocusaurus@2.2.2
    
    [skip ci]
    github-actions[bot] committed Mar 21, 2025
    Copy the full SHA
    e5c3a24 View commit details
  3. Version Packages

    github-actions[bot] committed Mar 21, 2025
    Copy the full SHA
    31a61c8 View commit details

Commits on Mar 23, 2025

  1. Merge pull request #408 from rohit-gohri/changeset-release/main

    Version Packages
    rohit-gohri authored Mar 23, 2025
    Copy the full SHA
    62e5fb9 View commit details
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Redocusaurus

## redocusaurus@2.2.2


## docusaurus-plugin-redoc@2.2.2


## docusaurus-theme-redoc@2.2.2


## redocusaurus@2.2.1


6 changes: 6 additions & 0 deletions packages/docusaurus-plugin-redoc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# docusaurus-plugin-redoc

## 2.2.2

### Patch Changes

- [#402](https://github.com/rohit-gohri/redocusaurus/pull/402) [`ba2bd9c`](https://github.com/rohit-gohri/redocusaurus/commit/ba2bd9c5964df7f88ce1b5e7c08d2fcf5cd889f3) Thanks [@ctreatma](https://github.com/ctreatma)! - Add support for relative spec download URLs

## 2.2.1

### Patch Changes
2 changes: 1 addition & 1 deletion packages/docusaurus-plugin-redoc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusaurus-plugin-redoc",
"version": "2.2.1",
"version": "2.2.2",
"description": "Redoc Plugin for DocusaurusV2",
"main": "dist/index.js",
"types": "dist/index.d.ts",
3 changes: 2 additions & 1 deletion packages/docusaurus-plugin-redoc/src/index.ts
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ export default function redocPlugin(
}> {
const { baseUrl } = context.siteConfig;
const options: PluginOptionsWithDefault = { ...DEFAULT_OPTIONS, ...opts };
const { debug, spec, url: downloadUrl, config, themeId } = options;
const { debug, spec, url: downloadUrl, config, themeId, normalizeUrl: normalizeDownloadUrl } = options;

let url = downloadUrl;
const isSpecFile = fs.existsSync(spec);
@@ -127,6 +127,7 @@ export default function redocPlugin(
url,
themeId,
isSpecFile,
normalizeUrl: normalizeDownloadUrl,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
spec: content.converted as any,
};
3 changes: 3 additions & 0 deletions packages/docusaurus-plugin-redoc/src/options.ts
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@ export interface PluginOptions extends PluginDirectUsageOptions {
spec: string;
url?: string;
route?: string;
normalizeUrl?: boolean;
}

export interface PluginOptionsWithDefault extends PluginOptions {
@@ -44,6 +45,7 @@ export interface PluginOptionsWithDefault extends PluginOptions {
export const DEFAULT_OPTIONS = {
layout: {},
debug: false,
normalizeUrl: true,
} satisfies Omit<PluginOptions, 'spec'>;

export const PluginOptionSchema = Joi.object<PluginOptions>({
@@ -56,6 +58,7 @@ export const PluginOptionSchema = Joi.object<PluginOptions>({
// Basic
spec: Joi.string(),
url: Joi.string().uri({ allowRelative: true }).optional(),
normalizeUrl: Joi.boolean().default(DEFAULT_OPTIONS.normalizeUrl),
route: Joi.string().uri({ relativeOnly: true }).optional(),
layout: Joi.any().default(DEFAULT_OPTIONS.layout),
});
6 changes: 6 additions & 0 deletions packages/docusaurus-theme-redoc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# docusaurus-theme-redoc

## 2.2.2

### Patch Changes

- [#402](https://github.com/rohit-gohri/redocusaurus/pull/402) [`ba2bd9c`](https://github.com/rohit-gohri/redocusaurus/commit/ba2bd9c5964df7f88ce1b5e7c08d2fcf5cd889f3) Thanks [@ctreatma](https://github.com/ctreatma)! - Add support for relative spec download URLs

## 2.2.1

### Patch Changes
2 changes: 1 addition & 1 deletion packages/docusaurus-theme-redoc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docusaurus-theme-redoc",
"version": "2.2.1",
"version": "2.2.2",
"description": "Redoc Component for DocusaurusV2",
"main": "dist/index.js",
"types": "dist/index.d.ts",
3 changes: 2 additions & 1 deletion packages/docusaurus-theme-redoc/src/redocData.ts
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ const getDefaultTheme = (
prism: {
additionalLanguages: ['scala'],
},
},
}
},
customTheme,
);
@@ -148,6 +148,7 @@ export function getRedocThemes(
export async function getGlobalData({
primaryColor,
primaryColorDark = primaryColor,
//normalizeUrl = true,
theme: customThemeDeprecated,
options,
}: ThemeOptions): Promise<GlobalData> {
Original file line number Diff line number Diff line change
@@ -40,7 +40,8 @@ export function ServerStyles({
lightThemeOptions: RedocRawOptions;
darkThemeOptions: RedocRawOptions;
}) {
const fullUrl = useBaseUrl(specProps.url, { absolute: true });
const absoluteUrl = useBaseUrl(specProps.url, { absolute: true });
const fullUrl = specProps.normalizeUrl ? absoluteUrl : specProps.url;

const lightCss = prefixCssSelectors(
renderCss(new AppStore(specProps.spec, fullUrl, lightThemeOptions)),
1 change: 1 addition & 0 deletions packages/docusaurus-theme-redoc/src/types/common.ts
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ export interface SpecProps {
url?: string;
isSpecFile?: boolean;
themeId?: string;
normalizeUrl?: boolean;
}

export type RedocProps = SpecProps;
1 change: 1 addition & 0 deletions packages/docusaurus-theme-redoc/src/types/modules.ts
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@ interface SpecProps {
url?: string;
isSpecFile?: boolean;
themeId?: string;
normalizeUrl?: boolean;
}

declare module '@theme/Redoc' {
5 changes: 3 additions & 2 deletions packages/docusaurus-theme-redoc/src/utils/useSpec.ts
Original file line number Diff line number Diff line change
@@ -17,11 +17,12 @@ let currentStore: AppStore | null = null;
* Released under the MIT License
*/
export function useSpec(
{ spec, url, themeId }: SpecProps,
{ spec, url, themeId, normalizeUrl }: SpecProps,
optionsOverrides?: RedocRawOptions,
) {
const specOptions = useSpecOptions(themeId, optionsOverrides);
const fullUrl = useBaseUrl(url, { absolute: true });
const absoluteUrl = useBaseUrl(url, { absolute: true });
const fullUrl = normalizeUrl ? absoluteUrl : url;
const isBrowser = useIsBrowser();
const isDarkTheme = useColorMode().colorMode === 'dark';

8 changes: 8 additions & 0 deletions packages/redocusaurus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# redocusaurus

## 2.2.2

### Patch Changes

- Updated dependencies [[`ba2bd9c`](https://github.com/rohit-gohri/redocusaurus/commit/ba2bd9c5964df7f88ce1b5e7c08d2fcf5cd889f3)]:
- docusaurus-plugin-redoc@2.2.2
- docusaurus-theme-redoc@2.2.2

## 2.2.1

### Patch Changes
6 changes: 3 additions & 3 deletions packages/redocusaurus/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redocusaurus",
"version": "2.2.1",
"version": "2.2.2",
"description": "Redoc for DocusaurusV2",
"main": "dist/index.js",
"exports": {
@@ -41,8 +41,8 @@
},
"homepage": "https://redocusaurus.vercel.app/",
"dependencies": {
"docusaurus-plugin-redoc": "2.2.1",
"docusaurus-theme-redoc": "2.2.1"
"docusaurus-plugin-redoc": "2.2.2",
"docusaurus-theme-redoc": "2.2.2"
},
"peerDependencies": {
"@docusaurus/theme-common": "^3.6.0",
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
"clsx": "^1.2.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"redocusaurus": "^2.2.1"
"redocusaurus": "^2.2.2"
},
"devDependencies": {
"@percy/cli": "^1.28.8",
Loading