diff --git a/.bumpversion.cfg b/.bumpversion.cfg index b907e33..6c660d1 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 5.0.2 +current_version = 5.0.3 commit = False tag = False serialize = diff --git a/.version b/.version index a1ef0ca..2661148 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -5.0.2 +5.0.3 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9e065f6..9d5fa8e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@linkurious/ogma-react", - "version": "5.0.2", + "version": "5.0.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@linkurious/ogma-react", - "version": "5.0.2", + "version": "5.0.3", "license": "Apache-2.0", "dependencies": { "lodash.throttle": "^4.1.1" @@ -14507,4 +14507,4 @@ "dev": true } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 5bb2a43..7fb33ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@linkurious/ogma-react", - "version": "5.0.2", + "version": "5.0.3", "description": "A light adaptation of Ogma for React application", "keywords": [ "ogma", @@ -9,15 +9,15 @@ "webgl", "graph" ], - "jsdelivr": "dist/ogma-react.mjs", - "browser": "dist/ogma-react.umd.js", - "main": "dist/ogma-react.mjs", - "module": "dist/ogma-react.mjs", + "jsdelivr": "dist/index.mjs", + "browser": "dist/index.umd.js", + "main": "dist/index.mjs", + "module": "dist/index.mjs", "typings": "dist/index.d.ts", "exports": { - "import": "./dist/ogma-react.mjs", - "require": "./dist/ogma-react.js", - "default": "./dist/ogma-react.mjs", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs", + "default": "./dist/index.mjs", "types": "./dist/index.d.ts" }, "files": [ diff --git a/src/overlay/overlay.tsx b/src/overlay/overlay.tsx index c3be4c6..9d7bf30 100644 --- a/src/overlay/overlay.tsx +++ b/src/overlay/overlay.tsx @@ -16,7 +16,7 @@ import { useOgma } from "../context"; import { getPosition } from "./utils"; import { createPortal } from "react-dom"; -interface PopupProps { +interface OverlayProps { /** Overlay position */ position: Point | ((ogma: OgmaLib) => Point | null); /** Overlay size */ @@ -33,7 +33,7 @@ const offScreenPos: Point = { x: -9999, y: -9999 }; // TODO: use props for these classes export const Overlay = forwardRef( ( - { position, children, className = "", size, scaled }: PopupProps, + { position, children, className = "", size, scaled }: OverlayProps, ref?: Ref ) => { const ogma = useOgma(); diff --git a/tsconfig.json b/tsconfig.json index 697a60a..582c5a1 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,14 +21,8 @@ "skipLibCheck": true, "jsx": "react-jsx", "outDir": "./dist/", - "types": [ - "node", - "jest" - ], - "lib": [ - "ES6", - "DOM" - ] + "types": ["node", "jest"], + "lib": ["ES6", "DOM"] }, "include": [ "src/**/*.ts", @@ -37,7 +31,5 @@ "**/*.ts", "**/*.tsx" ], - "exclude": [ - "node_modules" - ] -} \ No newline at end of file + "exclude": ["node_modules"] +} diff --git a/vite.config.ts b/vite.config.ts index 7bc30ca..2a5cf93 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,12 +7,19 @@ import react from "@vitejs/plugin-react"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], + define: { "process.env": { NODE_ENV: "production" } }, build: { minify: true, + sourcemap: true, lib: { name: "OgmaReact", entry: "./src/index.ts", formats: ["es", "cjs", "umd"], + fileName: (format) => { + if (format === "umd") return `index.umd.js`; + if (format === "cjs") return `index.cjs`; + return `index.mjs`; + }, }, rollupOptions: { external: ["@linkurious/ogma", "react", "react-dom", "react-dom/server"],