From 9e64ea543947de712a2b59c4ac080d1f2cba2a8c Mon Sep 17 00:00:00 2001 From: Anoop M D Date: Fri, 4 Nov 2022 23:42:34 +0530 Subject: [PATCH] feat: package init for graphql-docs --- package.json | 3 +- packages/bruno-graphql-docs/.gitignore | 22 ++++++++++++ packages/bruno-graphql-docs/package.json | 21 ++++++++++++ packages/bruno-graphql-docs/rollup.config.js | 34 +++++++++++++++++++ packages/bruno-graphql-docs/src/GraphDocs.tsx | 9 +++++ packages/bruno-graphql-docs/src/index.ts | 5 +++ packages/bruno-graphql-docs/tsconfig.json | 22 ++++++++++++ 7 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 packages/bruno-graphql-docs/.gitignore create mode 100644 packages/bruno-graphql-docs/package.json create mode 100644 packages/bruno-graphql-docs/rollup.config.js create mode 100644 packages/bruno-graphql-docs/src/GraphDocs.tsx create mode 100644 packages/bruno-graphql-docs/src/index.ts create mode 100644 packages/bruno-graphql-docs/tsconfig.json diff --git a/package.json b/package.json index f5bb4ccf..97c56977 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "packages/bruno-electron", "packages/bruno-tauri", "packages/bruno-schema", - "packages/bruno-testbench" + "packages/bruno-testbench", + "packages/bruno-graphql-docs" ], "devDependencies": { "@faker-js/faker": "^7.6.0", diff --git a/packages/bruno-graphql-docs/.gitignore b/packages/bruno-graphql-docs/.gitignore new file mode 100644 index 00000000..f6eabff3 --- /dev/null +++ b/packages/bruno-graphql-docs/.gitignore @@ -0,0 +1,22 @@ +# dependencies +node_modules +yarn.lock +pnpm-lock.yaml +package-lock.json +.pnp +.pnp.js + +# testing +coverage + +# production +dist + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/packages/bruno-graphql-docs/package.json b/packages/bruno-graphql-docs/package.json new file mode 100644 index 00000000..482d0ca5 --- /dev/null +++ b/packages/bruno-graphql-docs/package.json @@ -0,0 +1,21 @@ +{ + "name": "@usebruno/graphql-docs", + "version": "0.1.0", + "main": "dist/cjs/index.js", + "module": "dist/esm/index.js", + "scripts": { + "build": "rollup -c" + }, + "devDependencies": { + "@rollup/plugin-commonjs": "^23.0.2", + "@rollup/plugin-node-resolve": "^15.0.1", + "@rollup/plugin-typescript": "^9.0.2", + "@types/react": "^18.0.25", + "react": "^17.0.2", + "rollup": "^2.79.1", + "rollup-plugin-dts": "^5.0.0", + "rollup-plugin-peer-deps-external": "^2.2.4", + "rollup-plugin-terser": "^7.0.2", + "typescript": "^4.8.4" + } +} diff --git a/packages/bruno-graphql-docs/rollup.config.js b/packages/bruno-graphql-docs/rollup.config.js new file mode 100644 index 00000000..e0281891 --- /dev/null +++ b/packages/bruno-graphql-docs/rollup.config.js @@ -0,0 +1,34 @@ +import resolve from "@rollup/plugin-node-resolve"; +import commonjs from "@rollup/plugin-commonjs"; +import typescript from "@rollup/plugin-typescript"; +import dts from "rollup-plugin-dts"; +import { terser } from "rollup-plugin-terser"; +import peerDepsExternal from 'rollup-plugin-peer-deps-external'; + +const packageJson = require("./package.json"); + +export default [ + { + input: "src/index.ts", + output: [ + { + file: packageJson.main, + format: "cjs", + sourcemap: true, + }, + { + file: packageJson.module, + format: "esm", + sourcemap: true, + }, + ], + plugins: [ + peerDepsExternal(), + resolve(), + commonjs(), + typescript({ tsconfig: "./tsconfig.json" }), + terser(), + ], + external: ["react", "react-dom", "styled-components"] + } +]; \ No newline at end of file diff --git a/packages/bruno-graphql-docs/src/GraphDocs.tsx b/packages/bruno-graphql-docs/src/GraphDocs.tsx new file mode 100644 index 00000000..d398691a --- /dev/null +++ b/packages/bruno-graphql-docs/src/GraphDocs.tsx @@ -0,0 +1,9 @@ +import React from 'react'; + +class GraphDocs extends React.Component { + render() { + return "Graphql Docs Explorer" + } +} + +export default GraphDocs; diff --git a/packages/bruno-graphql-docs/src/index.ts b/packages/bruno-graphql-docs/src/index.ts new file mode 100644 index 00000000..54d83c49 --- /dev/null +++ b/packages/bruno-graphql-docs/src/index.ts @@ -0,0 +1,5 @@ +import GraphDocs from "./GraphDocs"; + +export { + GraphDocs +} \ No newline at end of file diff --git a/packages/bruno-graphql-docs/tsconfig.json b/packages/bruno-graphql-docs/tsconfig.json new file mode 100644 index 00000000..51e350d2 --- /dev/null +++ b/packages/bruno-graphql-docs/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "esModuleInterop": true, + "strict": true, + "skipLibCheck": true, + "jsx": "react", + "module": "ESNext", + "declaration": true, + "declarationDir": "types", + "sourceMap": true, + "outDir": "dist", + "moduleResolution": "node", + "emitDeclarationOnly": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true + }, + "exclude": [ + "dist", + "node_modules", + "src/**/*.test.tsx" + ], +} \ No newline at end of file