-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add an interactive playground to the documentation site #216
base: main
Are you sure you want to change the base?
Conversation
const fileRootPath = "file:///" | ||
monaco.languages.typescript.typescriptDefaults.setCompilerOptions({ | ||
...monaco.languages.typescript.typescriptDefaults.getCompilerOptions(), | ||
moduleResolution: 100 as any, //monaco.languages.typescript.ModuleResolutionKind.NodeJs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raised microsoft/monaco-editor#4545 to expose these properly, though unfortunately even with 3
(Node16) I still see squiggly red lines unless I do the hack above to reorganize the files to the root of the module.
import {useMemo} from "react"; | ||
|
||
export const getStaticProps = ({params}) => { | ||
const text = fs.readFileSync('/home/michael/projects/nahkies/npm-packages/openapi-code-generator/integration-tests-definitions/petstore-expanded.yaml', 'utf-8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: load all definitions, probably better to use a webpack loader
console.info("run generation") | ||
|
||
generate( | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: make all options configurable in UI
66b7c29
to
6d16802
Compare
6d16802
to
1133a1c
Compare
Oh boy was this more of a pain than I expected. Creates an interactive playground similar to the typespec or typescript ones, based on https://github.com/microsoft/monaco-editor
Still pretty WIP and buggy