diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..4a26bcd5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM registry.access.redhat.com/ubi9/nodejs-20 AS builder + +USER root + +WORKDIR /usr/share/builder + +COPY package.json package-lock.json tsconfig.json config-overrides.js ./ +COPY src ./src +COPY public ./public +COPY packages/common ./packages/common + +RUN npm i + +FROM registry.access.redhat.com/ubi9/nginx-124 + +WORKDIR /usr/share/nginx + +COPY --from=builder /usr/share/builder/ /usr/share/nginx/html +COPY nginx.conf /etc/nginx/nginx.conf + +EXPOSE 8080 + +CMD ["nginx", "-g", "daemon off;", "-c", "/etc/nginx/nginx.conf"] diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 00000000..8687cdf3 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,21 @@ +events {} +http { + include mime.types; + error_log /dev/stdout info; + include /etc/nginx/sites-enabled/*; + server { + access_log /dev/stdout; + listen 8080; + + location ~ \.css { + # add_header Content-Type text/css; + } + + # nested routes + rewrite ^/api-catalog/api/(.*)$ /api/$1.html last; + # other assets like JS and CSS + rewrite ^/api-catalog(.+)$ $1 last; + # index route + rewrite ^/api-catalog$ / last; + } +} diff --git a/package-lock.json b/package-lock.json index 5872f295..86976510 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,6 +57,7 @@ "assert-never": "^1.2.1", "better-ajv-errors": "^1.2.0", "customize-cra": "^1.0.0", + "eslint-plugin-prettier": "^5.2.1", "gh-pages": "^5.0.0", "glob": "^9.2.1", "monaco-editor-webpack-plugin": "^7.0.1", @@ -4178,6 +4179,18 @@ "version": "4.94.6", "license": "MIT" }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/@pmmmwh/react-refresh-webpack-plugin": { "version": "0.5.10", "license": "MIT", @@ -9153,6 +9166,36 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-prettier": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", + "integrity": "sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==", + "dev": true, + "dependencies": { + "prettier-linter-helpers": "^1.0.0", + "synckit": "^0.9.1" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint-plugin-prettier" + }, + "peerDependencies": { + "@types/eslint": ">=8.0.0", + "eslint": ">=8.0.0", + "eslint-config-prettier": "*", + "prettier": ">=3.0.0" + }, + "peerDependenciesMeta": { + "@types/eslint": { + "optional": true + }, + "eslint-config-prettier": { + "optional": true + } + } + }, "node_modules/eslint-plugin-react": { "version": "7.32.1", "license": "MIT", @@ -9904,6 +9947,12 @@ "version": "3.1.3", "license": "MIT" }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "dev": true + }, "node_modules/fast-glob": { "version": "3.2.12", "license": "MIT", @@ -19480,18 +19529,33 @@ } }, "node_modules/prettier": { - "version": "2.8.4", - "license": "MIT", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "dev": true, + "peer": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "dependencies": { + "fast-diff": "^1.1.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/pretty-bytes": { "version": "5.6.0", "license": "MIT", @@ -23030,6 +23094,22 @@ "version": "3.2.4", "license": "MIT" }, + "node_modules/synckit": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", + "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", + "dev": true, + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/tabbable": { "version": "5.3.3", "license": "MIT" @@ -23536,8 +23616,9 @@ } }, "node_modules/tslib": { - "version": "2.5.0", - "license": "0BSD" + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -25042,6 +25123,20 @@ "node": ">= 10" } }, + "packages/sitemap/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "packages/transform": { "name": "@apidocs/transform", "license": "Apache-2.0", @@ -25068,6 +25163,20 @@ "engines": { "node": ">= 10" } + }, + "packages/transform/node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } } } } diff --git a/package.json b/package.json index 73cec2bd..63664eaa 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,7 @@ "assert-never": "^1.2.1", "better-ajv-errors": "^1.2.0", "customize-cra": "^1.0.0", + "eslint-plugin-prettier": "^5.2.1", "gh-pages": "^5.0.0", "glob": "^9.2.1", "monaco-editor-webpack-plugin": "^7.0.1", diff --git a/packages/common/package-lock.json b/packages/common/package-lock.json new file mode 100644 index 00000000..7827c4e8 --- /dev/null +++ b/packages/common/package-lock.json @@ -0,0 +1,11 @@ +{ + "name": "@apidocs/common", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@apidocs/common", + "license": "Apache-2.0" + } + } +} diff --git a/packages/discovery/package-lock.json b/packages/discovery/package-lock.json new file mode 100644 index 00000000..eb7ab384 --- /dev/null +++ b/packages/discovery/package-lock.json @@ -0,0 +1,10 @@ +{ + "name": "@apidocs/discovery", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@apidocs/discovery" + } + } +}