diff --git a/apps/studio/.eslintignore b/apps/studio/.eslintignore deleted file mode 100644 index b97cc9245..000000000 --- a/apps/studio/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -build -.turbo diff --git a/apps/studio/.eslintrc b/apps/studio/.eslintrc deleted file mode 100644 index c1da477ee..000000000 --- a/apps/studio/.eslintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "env": { - "es6": true, - "browser": true, - "node": true - }, - "plugins": ["security"], - "extends":["eslint-config-custom", "eslint-config-custom/react"] -} diff --git a/apps/studio/.gitignore b/apps/studio/.gitignore deleted file mode 100644 index db15c18a7..000000000 --- a/apps/studio/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.DS_Store -/node_modules -.vscode/ -/lib -/build \ No newline at end of file diff --git a/apps/studio/CHANGELOG.md b/apps/studio/CHANGELOG.md deleted file mode 100644 index c285625db..000000000 --- a/apps/studio/CHANGELOG.md +++ /dev/null @@ -1,61 +0,0 @@ -# @asyncapi/studio - -## 0.21.4 - -### Patch Changes - -- 877810d: fix: temporarily hard-lock `@asyncapi/converter` on `v1.5.0` as a hotfix (#1138) - -## 0.21.3 - -### Patch Changes - -- 943fec1: fix: report correct `range` values in error diagnostics for YAML files - -## 0.21.2 - -### Patch Changes - -- c3248c8: fix: fix the validation error for payload of type `date` (https://github.com/asyncapi/parser-js/issues/980) - -## 0.21.1 - -### Patch Changes - -- 481b28c: fix: Incorrect rendering of security schemas: by reference and inline, #1066 - -## 0.21.0 - -### Minor Changes - -- 26dc05f: Fix side bar color and update @asyncapi/html-template. - -## 0.20.2 - -### Patch Changes - -- 5c7b4c1: scrollTo navigation to right code block in yaml. - -## 0.20.1 - -### Patch Changes - -- 6995cdf: bump dependencies - -## 0.20.0 - -### Minor Changes - -- 5129432: start publishing studio. - -## 0.19.1 - -### Patch Changes - -- 9187c17: fix studio breaking when trying to generate code/document - -## 0.19.0 - -### Minor Changes - -- 94215e6: Support spec V3.0.0 in studio diff --git a/apps/studio/Dockerfile b/apps/studio/Dockerfile deleted file mode 100644 index 23ba67e73..000000000 --- a/apps/studio/Dockerfile +++ /dev/null @@ -1,52 +0,0 @@ -# Use a UUID as placeholder value to have a unique string to replace. -ARG BASE_URL_PLACEHOLDER=189b303e-37a0-4f6f-8c0a-50333bc3c36e - - -FROM node:18-alpine AS base - -FROM base AS builder -RUN apk add --no-cache libc6-compat -RUN apk update -# Set working directory -WORKDIR /app -RUN npm install --global turbo -COPY . . -RUN turbo prune --scope=@asyncapi/studio --docker - -# Add lockfile and package.json's of isolated subworkspace -FROM base AS installer - -ARG BASE_URL_PLACEHOLDER - -RUN apk add --no-cache libc6-compat -RUN apk update -WORKDIR /app - -# First install the dependencies (as they change less often) - -COPY .gitignore .gitignore -COPY --from=builder /app/out/json/ . -COPY --from=builder /app/out/package-lock.json ./package-lock.json -RUN PUPPETEER_SKIP_DOWNLOAD=true npm ci - -# Build the project -COPY --from=builder /app/out/full/ . -RUN PUBLIC_URL=${BASE_URL_PLACEHOLDER} npm run build:studio - - -FROM docker.io/library/nginx:1.25.5-alpine as runtime - -ARG BASE_URL_PLACEHOLDER -# The base Nginx image automatically executes all shell scripts -# within the /docker-entrypoint.d/ directory ("entrypoint scripts") -# when the container is started. See the relevant logic at -# https://github.com/nginxinc/docker-nginx/blob/master/entrypoint/docker-entrypoint.sh#L16. -ARG ENTRYPOINT_SCRIPT=/docker-entrypoint.d/set-public-url.sh - -COPY --from=installer /app/apps/studio/build /usr/share/nginx/html/ -# Add an entrypoint script that replaces all occurrences of the -# placeholder value by the configured base URL. If no base URL -# is configured we assume the application is running at '/'. -RUN echo "find /usr/share/nginx/html/ -type f -print0 | xargs -0 sed -i \"s|${BASE_URL_PLACEHOLDER}|\${BASE_URL}|g\"" > $ENTRYPOINT_SCRIPT && chmod +x $ENTRYPOINT_SCRIPT - -FROM runtime diff --git a/apps/studio/README.md b/apps/studio/README.md deleted file mode 100644 index d11a7fbb5..000000000 --- a/apps/studio/README.md +++ /dev/null @@ -1,117 +0,0 @@ -[![AsyncAPI Studio](../../assets/logo.png)](https://studio.asyncapi.com) - -One place that allows you to develop an AsyncAPI document, validate it, convert it to the latest version, preview the documentation and visualize the events flow. - - -[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-) - - ---- - -## :loudspeaker: ATTENTION: - -This project is still under development and has not reached version 1.0.0 yet. This means that its API/styling/features may contain breaking changes until we're able to deploy the first stable version and begin semantic versioning. - ---- - - - - - -- [Requirements](#requirements) -- [Using it locally](#using-it-locally) -- [Using it via Docker](#using-it-via-docker) -- [Development](#development) - * [Spin up Gitpod](#spin-up-gitpod) -- [Contribution](#contribution) -- [Contributors ✨](#contributors-%E2%9C%A8) - - - -## Requirements - -- [NodeJS](https://nodejs.org/en/) >= 14 - -## Using it locally - -Run: - -```bash -npm install -npm start -``` - -and then go to [http://localhost:3000](http://localhost:3000). - -## Using it via Docker - -Run: - -```bash -docker run -it -p 8000:80 asyncapi/studio -``` - -and then go to [http://localhost:8000](http://localhost:8000). - -The `asyncapi/studio` image is based on the official `nginx` image. -Please refer to the [Nginx documentation](https://registry.hub.docker.com/_/nginx/) to learn how to e.g. pass a custom `nginx` configuration or plug in additional volumes. - -In some hosting scenarios (e.g. Docker Compose, Kubernetes) the container might not be exposed at the root path of the host. -Set the environment variable `BASE_URL` to let AsyncAPI Studio know from where to resolve static assets: - -```bash -docker run -it -p 8000:80 -e BASE_URL=/a/custom/path asyncapi/studio -``` - -Studio is also available as a Docker Desktop Extension. For more information, check [the related repository](https://github.com/thiyagu06/asyncapi-studio-docker-extension). - -## Development - -1. Setup project by installing dependencies `npm install` -2. Write code and tests. -3. Make sure all tests pass `npm test` - -### Spin up Gitpod -In order to prepare and spin up a Gitpod dev environment for our project, we configured our workspace through a [.gitpod.yml](/.gitpod.yml) file. - -To spin up a Gitpod, go to http://gitpod.io/#https://github.com/asyncapi/studio. - -## Contribution - -Read [CONTRIBUTING](https://github.com/asyncapi/.github/blob/master/CONTRIBUTING.md) guide. - -## Contributors ✨ - -Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): - - - - - - - - - - - - - - - - - - - - - - - - -
Maciej UrbaΕ„czyk
Maciej UrbaΕ„czyk

🚧 πŸ’» πŸ“– πŸ› πŸ€” πŸ‘€ 🎨 ⚠️ πŸš‡ πŸ§‘β€πŸ«
Fran MΓ©ndez
Fran MΓ©ndez

🚧 πŸ’» πŸ“– πŸ› πŸ€” πŸ‘€ 🎨 ⚠️ πŸš‡ πŸ§‘β€πŸ«
David Boyne
David Boyne

🚧 πŸ’» πŸ“– πŸ› πŸ€” πŸ‘€ 🎨 ⚠️ πŸ§‘β€πŸ«
Missy Turco
Missy Turco

🚧 πŸ’» πŸ€” πŸ‘€ 🎨 πŸ§‘β€πŸ«
Florian Greinacher
Florian Greinacher

πŸ’» πŸš‡ πŸ› πŸ“–
Ritik Rawal
Ritik Rawal

πŸ’»
Samriddhi
Samriddhi

πŸ’»
Pauline P. Narvas
Pauline P. Narvas

πŸ’» πŸš‡ πŸ“–
Jonas Lagoni
Jonas Lagoni

πŸ€” πŸ’¬ πŸ‘€
Sergio Moya
Sergio Moya

πŸ€” πŸ’¬
David Pereira
David Pereira

πŸ€” πŸ’¬
Nawed Ali
Nawed Ali

πŸ’» πŸ›
Viacheslav Turovskyi
Viacheslav Turovskyi

πŸ’»
- - - - - - -This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! diff --git a/apps/studio/craco.config.js b/apps/studio/craco.config.js deleted file mode 100644 index a2376cce8..000000000 --- a/apps/studio/craco.config.js +++ /dev/null @@ -1,85 +0,0 @@ -/* eslint-disable */ -const crypto = require('crypto'); -const webpack = require('webpack'); - -function getFileLoaderRule(rules) { - for (const rule of rules) { - if ("oneOf" in rule) { - const found = getFileLoaderRule(rule.oneOf); - if (found) { - return found; - } - } else if (rule.test === undefined && rule.type === 'asset/resource') { - return rule; - } - } - throw new Error("File loader not found"); -} - -function configureWebpack(webpackConfig) { - // fallbacks - const fallback = webpackConfig.resolve.fallback || {}; - Object.assign(fallback, { - assert: require.resolve('assert/'), - buffer: require.resolve('buffer'), - http: require.resolve('stream-http'), - https: require.resolve('https-browserify'), - path: require.resolve('path-browserify'), - stream: require.resolve('stream-browserify'), - zlib: require.resolve('browserify-zlib'), - url: require.resolve('url/'), - util: require.resolve('util/'), - fs: false, - }); - webpackConfig.resolve.fallback = fallback; - - // aliases - webpackConfig.resolve.alias = webpackConfig.resolve.alias || {}; - webpackConfig.resolve.alias['nimma/fallbacks'] = require.resolve('../../node_modules/nimma/dist/legacy/cjs/fallbacks/index.js'); - webpackConfig.resolve.alias['nimma/legacy'] = require.resolve('../../node_modules/nimma/dist/legacy/cjs/index.js'); - - // plugins - webpackConfig.plugins = (webpackConfig.plugins || []).concat([ - new webpack.ProvidePlugin({ - process: 'process/browser.js', - Buffer: ['buffer', 'Buffer'] - }) - ]); - - // rules/loaders - // workaround for https://github.com/facebook/create-react-app/issues/11889 issue - const fileLoaderRule = getFileLoaderRule(webpackConfig.module.rules); - fileLoaderRule.exclude.push(/\.cjs$/); - webpackConfig.module.rules.push({ - test: /\.yml$/i, - type: 'asset/source', - }); - - // ignore source-map warnings - webpackConfig.ignoreWarnings = [...(webpackConfig.ignoreWarnings || []), /Failed to parse source map/]; - - return webpackConfig; -} - -// Force method use SHA-256 to address OpenSSL 3.0 deprecation of MD4 algorithm -function configureCrypto() { - const cryptCreateHashOrig = crypto.createHash; - crypto.createHash = () => cryptCreateHashOrig('sha256'); -} - -function setEnvironments() { - process.env.DISABLE_ESLINT_PLUGIN = true; -} - -function configureCraco() { - setEnvironments(); - configureCrypto(); - - return { - webpack: { - configure: configureWebpack, - } - }; -} - -module.exports = configureCraco(); diff --git a/apps/studio/package.json b/apps/studio/package.json deleted file mode 100644 index c72576910..000000000 --- a/apps/studio/package.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "name": "@asyncapi/studio", - "version": "0.21.4", - "description": "One place that allows you to develop an AsyncAPI document, validate it, convert it to the latest version, preview the documentation and visualize the events flow.", - "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/asyncapi/studio/issues" - }, - "keywords": [ - "asyncapi", - "documentation", - "studio", - "playground" - ], - "author": { - "name": "The AsyncAPI maintainers" - }, - "files": [ - "/build", - "/assets/logo.png", - "./README.md", - "./LICENSE" - ], - "dependencies": { - "@asyncapi/avro-schema-parser": "^3.0.22", - "@asyncapi/converter": "1.5.0", - "@asyncapi/openapi-schema-parser": "^3.0.22", - "@asyncapi/parser": "^3.2.2", - "@asyncapi/protobuf-schema-parser": "^3.2.11", - "@asyncapi/react-component": "^1.4.10", - "@asyncapi/specs": "^6.7.0", - "@babel/preset-react": "^7.22.3", - "@ebay/nice-modal-react": "^1.2.10", - "@headlessui/react": "^1.7.4", - "@hookstate/core": "^4.0.0-rc21", - "@monaco-editor/react": "^4.4.6", - "@stoplight/yaml": "^4.3.0", - "@tippyjs/react": "^4.2.6", - "js-base64": "^3.7.3", - "js-file-download": "^0.4.12", - "js-yaml": "^4.1.0", - "monaco-editor": "0.34.1", - "monaco-yaml": "4.0.2", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-hot-toast": "2.4.0", - "react-icons": "^4.6.0", - "reactflow": "^11.2.0", - "tippy.js": "^6.3.7", - "zustand": "^4.1.4" - }, - "scripts": { - "lint": "eslint . --ext .js,.jsx,.ts,.tsx", - "dev": "npm run start", - "start": "craco start", - "build": "npm run generate:template-parameters && craco build", - "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf build", - "test": "npm run test:unit", - "test:unit": "craco test --watchAll=false --detectOpenHandles", - "eject": "react-scripts eject", - "generate:readme:toc": "markdown-toc -i README.md", - "generate:assets": "npm run build && npm run generate:readme:toc", - "generate:template-parameters": "ts-node ./scripts/template-parameters.ts", - "prepublishOnly": "npm run build && npm run generate:readme:toc" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "devDependencies": { - "@asyncapi/dotnet-nats-template": "^0.12.1", - "@asyncapi/go-watermill-template": "^0.2.75", - "@asyncapi/html-template": "^2.3.5", - "@asyncapi/java-spring-cloud-stream-template": "^0.13.4", - "@asyncapi/java-spring-template": "^1.5.1", - "@asyncapi/java-template": "^0.2.1", - "@asyncapi/markdown-template": "^1.6.1", - "@asyncapi/nodejs-template": "^3.0.0", - "@asyncapi/nodejs-ws-template": "^0.9.35", - "@asyncapi/python-paho-template": "^0.2.13", - "@asyncapi/ts-nats-template": "^0.10.3", - "@babel/preset-env": "^7.24.4", - "@babel/preset-typescript": "^7.24.1", - "@craco/craco": "^7.1.0", - "@craco/types": "^7.1.0", - "@tailwindcss/typography": "^0.5.8", - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/react": "^13.4.0", - "@testing-library/user-event": "^14.4.3", - "@types/jest": "^29.2.3", - "@types/js-yaml": "^4.0.5", - "@types/json-schema": "^7.0.11", - "@types/node": "^18.19.31", - "@types/react": "^18.0.25", - "@types/react-dom": "^18.0.9", - "assert": "^2.0.0", - "autoprefixer": "^10.4.13", - "browserify-zlib": "^0.2.0", - "buffer": "^6.0.3", - "conventional-changelog-conventionalcommits": "^5.0.0", - "cross-env": "^7.0.3", - "esbuild": "0.18.20", - "https-browserify": "^1.0.0", - "markdown-toc": "^1.2.0", - "path-browserify": "^1.0.1", - "postcss": "^8.4.31", - "process": "^0.11.10", - "raw-loader": "^4.0.2", - "react-scripts": "5.0.1", - "stream-browserify": "^3.0.0", - "stream-http": "^3.2.0", - "tailwindcss": "^3.2.4", - "ts-node": "^10.9.1", - "typescript": "^4.9.3", - "url": "^0.11.0", - "util": "^0.12.5", - "web-vitals": "^3.1.0", - "webpack": "^5.75.0", - "eslint-config-custom": "workspace:*" - }, - "jest": { - "transformIgnorePatterns": [ - "node_modules/.pnpm/(?!monaco-editor|monaco-yaml|monaco-marker-data-provider|monaco-worker-manager)" - ], - "moduleNameMapper": { - "^nimma/legacy$": "/../../node_modules/nimma/dist/legacy/cjs/index.js", - "^nimma/(.*)": "/../../node_modules/nimma/dist/cjs/$1" - } - }, - "publishConfig": { - "access": "public" - } -} diff --git a/apps/studio/public/_redirects b/apps/studio/public/_redirects deleted file mode 100644 index 9392728f9..000000000 --- a/apps/studio/public/_redirects +++ /dev/null @@ -1,19 +0,0 @@ -# Redirect editor.asyncapi.org to Studio - -http://editor.asyncapi.org/* https://studio.asyncapi.com 301! -https://editor.asyncapi.org/* https://studio.asyncapi.com 301! - -# Redirect playground.asyncapi.io to Studio - -http://playground.asyncapi.io/* https://studio.asyncapi.com/?redirectedFrom=playground 301! -https://playground.asyncapi.io/* https://studio.asyncapi.com/?redirectedFrom=playground 301! - -http://playground.asyncapi.io/* load=:load https://studio.asyncapi.com/?redirectedFrom=playground&load=:load 301! -https://playground.asyncapi.io/* load=:load https://studio.asyncapi.com/?redirectedFrom=playground&load=:load 301! -http://playground.asyncapi.io/* load=:load readOnly=:readOnly https://studio.asyncapi.com/?redirectedFrom=playground&load=:load&readOnly=true 301! -https://playground.asyncapi.io/* load=:load readOnly=:readOnly https://studio.asyncapi.com/?redirectedFrom=playground&load=:load&readOnly=true 301! - -http://playground.asyncapi.io/* url=:url https://studio.asyncapi.com/?redirectedFrom=playground&url=:url 301! -https://playground.asyncapi.io/* url=:url https://studio.asyncapi.com/?redirectedFrom=playground&url=:url 301! -http://playground.asyncapi.io/* url=:url readOnly=:readOnly https://studio.asyncapi.com/?redirectedFrom=playground&url=:url&readOnly=true 301! -https://playground.asyncapi.io/* url=:url readOnly=:readOnly https://studio.asyncapi.com/?redirectedFrom=playground&url=:url&readOnly=true 301! diff --git a/apps/studio/public/favicon-16x16.png b/apps/studio/public/favicon-16x16.png deleted file mode 100644 index f52b03ec9..000000000 Binary files a/apps/studio/public/favicon-16x16.png and /dev/null differ diff --git a/apps/studio/public/favicon-194x194.png b/apps/studio/public/favicon-194x194.png deleted file mode 100644 index 0d6bc7985..000000000 Binary files a/apps/studio/public/favicon-194x194.png and /dev/null differ diff --git a/apps/studio/public/favicon-32x32.png b/apps/studio/public/favicon-32x32.png deleted file mode 100644 index a65f8093c..000000000 Binary files a/apps/studio/public/favicon-32x32.png and /dev/null differ diff --git a/apps/studio/public/favicon.ico b/apps/studio/public/favicon.ico deleted file mode 100644 index 2597a4cf4..000000000 Binary files a/apps/studio/public/favicon.ico and /dev/null differ diff --git a/apps/studio/public/img/logo-studio.svg b/apps/studio/public/img/logo-studio.svg deleted file mode 100644 index e663e2b0e..000000000 --- a/apps/studio/public/img/logo-studio.svg +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/apps/studio/public/img/meta-studio-og-image.jpeg b/apps/studio/public/img/meta-studio-og-image.jpeg deleted file mode 100644 index 1a6b4b2de..000000000 Binary files a/apps/studio/public/img/meta-studio-og-image.jpeg and /dev/null differ diff --git a/apps/studio/public/img/survey-illustration.svg b/apps/studio/public/img/survey-illustration.svg deleted file mode 100644 index cd45a399d..000000000 --- a/apps/studio/public/img/survey-illustration.svg +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/apps/studio/public/index.html b/apps/studio/public/index.html deleted file mode 100644 index c0b25224b..000000000 --- a/apps/studio/public/index.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - AsyncAPI Studio - - - - -
-
-
- AsyncAPI Logo - - beta - -
-
-
-
-
-
- -
- - diff --git a/apps/studio/public/robots.txt b/apps/studio/public/robots.txt deleted file mode 100644 index e9e57dc4d..000000000 --- a/apps/studio/public/robots.txt +++ /dev/null @@ -1,3 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * -Disallow: diff --git a/apps/studio/scripts/template-parameters.ts b/apps/studio/scripts/template-parameters.ts deleted file mode 100644 index fbaf04a8f..000000000 --- a/apps/studio/scripts/template-parameters.ts +++ /dev/null @@ -1,115 +0,0 @@ -/* eslint-disable security/detect-non-literal-fs-filename */ -import fs from 'fs'; -import path from 'path'; -import { JSONSchema7 } from 'json-schema'; - -const DESTINATION_JSON = path.join(__dirname, '../src/components/Modals/Generator/template-parameters.json'); -const TEMPLATES: Record = { - '@asyncapi/dotnet-nats-template': '.NET Nats Project', - '@asyncapi/go-watermill-template': 'GO Lang Watermill Project', - '@asyncapi/html-template': 'HTML website', - '@asyncapi/java-spring-cloud-stream-template': 'Java Spring Cloud Stream Project', - '@asyncapi/java-spring-template': 'Java Spring Project', - '@asyncapi/java-template': 'Java Project', - '@asyncapi/markdown-template': 'Markdown Documentation', - '@asyncapi/nodejs-template': 'NodeJS Project', - '@asyncapi/nodejs-ws-template': 'NodeJS WebSocket Project', - '@asyncapi/python-paho-template': 'Python Paho Project', - '@asyncapi/ts-nats-template': 'Typescript Nats Project', -}; -const SUPPORTED_TEMPLATES = Object.keys(TEMPLATES); - -interface TemplateParameter { - description?: string; - default?: any; - required?: boolean; -} - -interface TemplateConfig { - parameters: Record; -} - -function serializeParam(configParam: TemplateParameter): JSONSchema7 { - const param: JSONSchema7 = { - description: configParam.description, - }; - - if (typeof configParam.default === 'boolean' || configParam.default === 'true' || configParam.default === 'false') { - param.type = 'boolean'; - if (typeof configParam.default === 'boolean') { - param.default = configParam.default; - } else if (configParam.default === 'true') { - param.default = true; - } else if (configParam.default === 'false') { - param.default = false; - } - } else if (typeof configParam.default === 'number') { - param.type = 'number'; - param.default = Number(configParam.default); - } else { - param.type = 'string'; - param.default = configParam.default; - } - - return param; -} - -function serializeTemplateParameters(config: TemplateConfig): JSONSchema7 | undefined { - if (!config || !config.parameters) { - return; - } - - const configParameters = config.parameters; - const parameters: Record = {}; - const required: string[] = []; - for (const parameter in configParameters) { - const configParam = configParameters[String(parameter)]; - - const param = serializeParam(configParam); - if (configParam.required) { - required.push(parameter); - } - - parameters[String(parameter)] = param; - } - - return { - $schema: 'http://json-schema.org/draft-07/schema#', - type: 'object', - properties: parameters, - required, - // don't allow non supported properties - additionalProperties: false, - } as JSONSchema7; -} - -async function main() { - const schemas: Record = {}; - for (let i = 0, l = SUPPORTED_TEMPLATES.length; i < l; i++) { - const templateName = SUPPORTED_TEMPLATES[Number(i)]; - - console.info(`[INFO]: Prepare parameters for ${templateName}.`); - - const pathToPackageJSON = path.join(__dirname, `../../../node_modules/${templateName}/package.json`); - const packageJSONContent = await fs.promises.readFile(pathToPackageJSON, 'utf-8'); - const packageJSON = JSON.parse(packageJSONContent); - const generatorConfig = packageJSON.generator; - - const schema = serializeTemplateParameters(generatorConfig); - if (schema) { - schemas[String(templateName)] = { - title: TEMPLATES[String(templateName)], - schema, - supportedProtocols: generatorConfig.supportedProtocols, - }; - } - } - - console.info(`[INFO]: Save template parameters schemas to ${DESTINATION_JSON}.`); - await fs.promises.writeFile(DESTINATION_JSON, JSON.stringify(schemas), 'utf-8'); -} -main(); diff --git a/apps/studio/src/App.tsx b/apps/studio/src/App.tsx deleted file mode 100644 index bfb54b021..000000000 --- a/apps/studio/src/App.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { AsyncAPIStudio } from './studio'; - -import type { FunctionComponent } from 'react'; - -export const App: FunctionComponent = () => { - return ( - - ); -}; diff --git a/apps/studio/src/components/Content.tsx b/apps/studio/src/components/Content.tsx deleted file mode 100644 index 1c147165f..000000000 --- a/apps/studio/src/components/Content.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import SplitPane from './SplitPane'; -import { Editor } from './Editor/Editor'; -import { Navigation } from './Navigation'; -import { Navigationv3 } from './Navigationv3'; -import { Template } from './Template'; -import { VisualiserTemplate } from './Visualiser'; - -import { debounce } from '../helpers'; -import { usePanelsState, useDocumentsState } from '../state'; - -import type { FunctionComponent } from 'react'; - -interface ContentProps {} - -export const Content: FunctionComponent = () => { // eslint-disable-line sonarjs/cognitive-complexity - const { show, secondaryPanelType } = usePanelsState(); - const document = useDocumentsState(state => state.documents['asyncapi']?.document) || null; - const isV3 = document?.version() === '3.0.0'; - const navigationEnabled = show.primarySidebar; - const editorEnabled = show.primaryPanel; - const viewEnabled = show.secondaryPanel; - const viewType = secondaryPanelType; - - const splitPosLeft = 'splitPos:left'; - const splitPosRight = 'splitPos:right'; - - const localStorageLeftPaneSize = parseInt(localStorage.getItem(splitPosLeft) || '0', 10) || 220; - const localStorageRightPaneSize = parseInt(localStorage.getItem(splitPosRight) || '0', 10) || '55%'; - - const secondPaneSize = navigationEnabled && !editorEnabled ? localStorageLeftPaneSize : localStorageRightPaneSize; - const secondPaneMaxSize = navigationEnabled && !editorEnabled ? 360 : '100%'; - - const navigationAndEditor = ( - { - localStorage.setItem(splitPosLeft, String(size)); - }, 100)} - > - { - isV3 ? : - } - - - ); - - return ( -
-
- { - localStorage.setItem(splitPosRight, String(size)); - }, 100)} - > - {navigationAndEditor} - {viewType === 'template' &&