Skip to content

Commit

Permalink
Upgrade to docusaurus 3 (#149)
Browse files Browse the repository at this point in the history
* docusaurus 2.4.3

* Escape `{}` characters in preparation for MDX3

* Node 20.17

* Upgrade to typescript 5

* [WIP] Fix syntax highlighting

* revert src

* fix highlight

* update webpack

---------

Co-authored-by: Gimmy <[email protected]>
  • Loading branch information
ronenh and gimmyxd authored Nov 6, 2024
1 parent 2f5a5b2 commit 5884aa1
Show file tree
Hide file tree
Showing 7 changed files with 5,235 additions and 3,918 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.17.0
4 changes: 2 additions & 2 deletions docs/software-development-kits/java/middleware.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ E.g.

## Resource
A resource can be any structured data that the authorization policy uses to evaluate decisions.
By default, the middleware extracts resources from the path parameters. For example if we have a mapping of /user/{id}
By default, the middleware extracts resources from the path parameters. For example if we have a mapping of /user/\{id\}
and we get a request to /user/123, the middleware will extract the resource from the path parameter `id` and use it.

This behavior can be changed by implementing the `ResourceMapper` interface and creating a bean that returns it.
Expand Down Expand Up @@ -138,4 +138,4 @@ aserto.authorizer.grpc.caCertPath=${user.home}/.local/share/topaz/certs/grpc-ca.
#aserto.authorizer.apiKey=<api_key>
```

For a minimal example please see the [Spring example](https://github.com/aserto-dev/aserto-spring/tree/main/examples/java-application).
For a minimal example please see the [Spring example](https://github.com/aserto-dev/aserto-spring/tree/main/examples/java-application).
2 changes: 1 addition & 1 deletion docs/software-development-kits/ruby/rails.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ end

The current user's permissions can then be checked using the `allowed?`, `visible?` and `enabled?` methods in views and controllers.

```erb
```ruby
<% if allowed? :get, "/posts/:id", @post %>
<%= link_to "View", @post %>
<% end %>
Expand Down
7 changes: 4 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
import {themes as prismThemes} from 'prism-react-renderer';
const lightCodeTheme = prismThemes.github;
const darkCodeTheme = prismThemes.dracula;

/** @type {import('@docusaurus/types').Config} */
const config = {
Expand Down Expand Up @@ -159,7 +160,7 @@ const config = {
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ['powershell', 'csharp', 'rego', 'ruby', 'erb', 'java', 'properties'],
additionalLanguages: ['powershell', 'csharp', 'rego', 'ruby', 'java', 'properties'],
},
/*
hubspot: {
Expand Down
38 changes: 23 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,36 @@
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "^2.4.1",
"@docusaurus/plugin-google-tag-manager": "^2.4.1",
"@docusaurus/preset-classic": "^2.4.1",
"@docusaurus/theme-search-algolia": "^2.4.1",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"@algolia/client-search": "<6",
"@docusaurus/core": "^3.6.0",
"@docusaurus/plugin-google-tag-manager": "^3.6.0",
"@docusaurus/preset-classic": "^3.6.0",
"@docusaurus/theme-search-algolia": "^3.6.0",
"@mdx-js/react": "^3.1.0",
"@types/react": "^18.3.12",
"acorn": "^8.14.0",
"clsx": "^2.0.0",
"docusaurus-plugin-hubspot": "^1.0.0",
"docusaurus2-dotenv": "^1.4.0",
"flex-banner": "^2.2.2",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-syntax-highlighter": "^15.5.0",
"styled-components": "^5.3.6"
"prism-react-renderer": "^2.3.0",
"prop-types": "^15.5.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-is": ">= 16.8.0",
"react-loadable": "^5.5.0",
"react-syntax-highlighter": "^15.6.1",
"search-insights": "<3",
"styled-components": "^5.3.6",
"webpack": "^5"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^2.4.1",
"@tsconfig/docusaurus": "^1.0.5",
"@docusaurus/module-type-aliases": "^3.6.0",
"@docusaurus/tsconfig": "^3.6.0",
"postcss": "^8.4.17",
"postcss-reporter": "^7.0.5",
"prettier": "^2.7.1",
"typescript": "^4.7.4"
"typescript": "^5.6.3"
},
"browserslist": {
"production": [
Expand All @@ -52,7 +60,7 @@
]
},
"engines": {
"node": ">=16.14"
"node": ">=20.17.0"
},
"packageManager": "[email protected]"
}
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
// This file is not used in compilation. It is here just for a nice editor experience.
"extends": "@tsconfig/docusaurus/tsconfig.json",
"extends": "@docusaurus/tsconfig",
"compilerOptions": {
"baseUrl": "."
}
Expand Down
Loading

0 comments on commit 5884aa1

Please sign in to comment.