1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/website/package.json
Thomas Heartman 7cff6336c1
docs: Use Go readme (#2816)
# PR 1: add remote content plugin and rust readme

## What

This PR does a few connected things:

1. It adds the ["docusaurus-plugin-remote-content" package](https://github.com/rdilweb/docusaurus-plugin-remote-content).

2. It adds configuration to make it work with Readmes found on GitHub.

3. It adds the Rust SDK's readme (replacing the link we used to have) as a proof of concept on how to do it.

## Why

With documentation split between GitHub readmes and the official docs, it's hard to keep everything up to date and in sync. It's also quite confusing that some information is only available in some places, but not in others. 

We've talked about auto-including readmes from GitHub for a while, so here's a proof of concept (finally) 🥳 

The intention is to get this merged and then to migrate the other SDK docs one by one, ensuring that everything in the documentation is also in the readme (so that no info is lost). 

## Discussion points

### Generation directory

The current generation method generates the files into `/reference/sdks/<sdk name>`. I think this works for now, but it means it adds auto-generated files into a directory that you can't ignore (at least not yet). 

We could instead generate them into `/generated/sdks` and update the slugs so that they still match the expected pattern. 

However, this would make the sidebar a little harder to work with (for now). That said, there may be ways around it. It's worth exploring.

### Generation method

By default, this plugin will generate files whenever you build. That (probably) means that you need an internet connection _and_ that you'll end up with a bunch of untracked files.

An option is to only generate the files "manually" and commit them to the repo. That would allow you to build the project without an internet connection and would also remove the need for ignoring the files. We could automate the generation if we wanted to. 

## Preview / Screenies

Visit [/reference/sdks/rust](https://unleash-docs-git-docs-include-sdk-readmes-unleash-team.vercel.app/reference/sdks/rust) in the preview to see what it looks like live. 

![image](https://user-images.githubusercontent.com/17786332/210373446-784b7e69-0f36-4e9e-874a-2b06b863b603.png)

# PR 2: add go readme

This PR changes the docs generation to use the Go SDK's GitHub readme
for the SDK docs instead of a separate document.

## What

The changes in this PR are:

- Delete the existing Go SDK documentation. All the content in this
guide already exists in the Go readme.
-   Add the Go SDK to the list of auto-generated readme docs
- Move the readme-related code into a separate module, `readme-fns.js`
(I'm not bullish about the file name: we can change it if you have
suggestions)
- Add a note to the top of all generated readmes saying you'll need an
API url and an API token. The note also links you to the relevant
reference and how-to docs.

## Why

Having two different bits of documentation for the same SDK is
troublesome. By only having the data in one place, we can avoid it going
out of sync and getting stale.
2023-01-05 09:47:49 +00:00

88 lines
2.5 KiB
JSON

{
"name": "websitev-2",
"version": "0.0.0",
"private": true,
"engines": {
"node": ">=16.14"
},
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "yarn generate && docusaurus build",
"swizzle": "docusaurus swizzle",
"generate": "docusaurus gen-api-docs all && node clean-generated-docs.js",
"deploy": "yarn generate && docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
},
"dependencies": {
"@docusaurus/core": "2.2.0",
"@docusaurus/plugin-client-redirects": "2.2.0",
"@docusaurus/plugin-google-analytics": "2.2.0",
"@docusaurus/preset-classic": "2.2.0",
"@docusaurus/remark-plugin-npm2yarn": "2.2.0",
"@mdx-js/react": "1.6.22",
"@svgr/webpack": "6.5.1",
"browserslist": "^4.16.5",
"clsx": "1.2.1",
"docusaurus-plugin-openapi-docs": "1.5.0",
"docusaurus-plugin-remote-content": "^3.1.0",
"docusaurus-theme-openapi-docs": "1.5.0",
"file-loader": "6.2.0",
"immer": "^9.0.6",
"react": "18.2.0",
"react-dom": "18.2.0",
"unleash-proxy-client": "2.4.0",
"url-loader": "4.1.1"
},
"resolutions": {
"async": "^3.2.4",
"trim": "^1.0.0",
"got": "^11.8.5",
"glob-parent": "^6.0.0",
"browserslist": "^4.16.5",
"set-value": "^4.0.1",
"immer": "^9.0.6",
"ansi-regex": "^5.0.1",
"nth-check": "^2.0.1",
"shelljs": "^0.8.5",
"trim-newlines": "^4.0.0",
"minimatch": "^5.0.0",
"decode-uri-component": "^0.4.0",
"qs": "^6.9.7"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/core": "7.20.12",
"@docusaurus/module-type-aliases": "2.2.0",
"@storybook/addon-actions": "6.5.15",
"@storybook/addon-essentials": "6.5.15",
"@storybook/addon-interactions": "6.5.15",
"@storybook/addon-links": "6.5.15",
"@storybook/react": "6.5.15",
"@storybook/testing-library": "0.0.13",
"@tsconfig/docusaurus": "1.0.6",
"babel-loader": "9.1.2",
"enhanced-resolve": "5.12.0",
"react-router": "6.6.1",
"replace-in-file": "6.3.5",
"storybook-addon-root-attribute": "1.0.2",
"typescript": "4.8.4"
}
}