[WEB-5048] chore: implements esm exports for all packages (#7816)

* fix: esm module imports for live and editor

* fix: convert all pacakges to export esm and cjs build

* fix: auto export

* fix: translation files formatting

* fix: convert eslint files to cjs files for supporting current config

* fix: code uuid package upgrade

---------

Co-authored-by: Aaron Reisman <aaron.reisman@plane.so>
This commit is contained in:
sriram veeraghanta 2025-10-06 21:01:32 +05:30 committed by GitHub
parent cbcb026e9a
commit 0589ac56d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
163 changed files with 52250 additions and 49718 deletions

View file

@ -4,22 +4,20 @@
"description": "Core Editor that powers Plane",
"license": "AGPL-3.0",
"private": true,
"files": [
"dist"
],
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.mts",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.cts",
"exports": {
".": {
"types": "./dist/index.d.mts",
"import": "./dist/index.mjs"
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"./lib": {
"require": "./dist/lib.js",
"types": "./dist/lib.d.mts",
"import": "./dist/lib.mjs"
"import": "./dist/lib.js",
"require": "./dist/lib.cjs"
},
"./package.json": "./package.json",
"./styles": "./dist/styles/index.css"
},
"scripts": {
@ -86,7 +84,6 @@
"@types/node": "18.15.3",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"@types/uuid": "^8.3.4",
"postcss": "^8.4.38",
"tsdown": "catalog:",
"typescript": "catalog:"

View file

@ -7,6 +7,8 @@ import {
autoUpdate,
useClick,
useRole,
type UseInteractionsReturn,
type UseFloatingReturn,
} from "@floating-ui/react";
import { useState } from "react";
@ -14,7 +16,13 @@ type TArgs = {
handleOpenChange?: (open: boolean) => void;
};
export const useFloatingMenu = (args: TArgs) => {
type TReturn = {
options: UseFloatingReturn;
getReferenceProps: UseInteractionsReturn["getReferenceProps"];
getFloatingProps: UseInteractionsReturn["getFloatingProps"];
};
export const useFloatingMenu = (args: TArgs): TReturn => {
const { handleOpenChange } = args;
// states
const [isDropdownOpen, setIsDropdownOpen] = useState(false);

View file

@ -1,14 +1,14 @@
{
"extends": "@plane/typescript-config/react-library.json",
"compilerOptions": {
"jsx": "react-jsx",
"lib": ["ES2022", "DOM"],
"module": "ESNext",
"moduleResolution": "bundler",
"module": "ES2022",
"moduleResolution": "Bundler",
"noEmit": true,
"strict": true,
"skipLibCheck": true,
"sourceMap": true,
"target": "ESNext",
"baseUrl": ".",
"paths": {
"@/*": ["./src/core/*"],

View file

@ -4,9 +4,13 @@ export default defineConfig({
entry: ["src/index.ts", "src/lib.ts"],
outDir: "dist",
format: ["esm", "cjs"],
dts: true,
clean: false,
sourcemap: true,
minify: true,
copy: ["src/styles"],
exports: {
customExports: (out) => ({
...out,
"./styles": "./dist/styles/index.css",
}),
},
dts: true,
clean: true,
});