diff --git a/packages/diracx-web/Dockerfile b/Dockerfile similarity index 93% rename from packages/diracx-web/Dockerfile rename to Dockerfile index e23b6e17..5bc8ea53 100644 --- a/packages/diracx-web/Dockerfile +++ b/Dockerfile @@ -5,7 +5,8 @@ FROM node:alpine AS build WORKDIR /app # Install the project dependencies -COPY package*.json ./ +COPY package.json ./ +COPY package-lock.json ./ RUN npm ci # Copy the rest of the application to the working directory COPY . . diff --git a/packages/diracx-web/config/nginx/default.conf b/config/nginx/default.conf similarity index 100% rename from packages/diracx-web/config/nginx/default.conf rename to config/nginx/default.conf diff --git a/package.json b/package.json index 7376e940..e6dd5971 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "build": "lerna run build", "build-lib": "lerna run build --scope diracx-web-components", "lint": "lerna run lint", - "ts-lint": "lerna run ts-lint" + "ts-lint": "lerna run ts-lint", + "pack": "npm pack -w diracx-web-components" } } diff --git a/packages/diracx-web-components/components/package.json b/packages/diracx-web-components/components/package.json index 07774385..2fcdf607 100644 --- a/packages/diracx-web-components/components/package.json +++ b/packages/diracx-web-components/components/package.json @@ -1,6 +1,6 @@ { "private": true, - "main": "../dist/components/index.js", - "module": "../dist/components/index.mjs", + "main": "../dist/components/index.cjs", + "module": "../dist/components/index.js", "types": "../dist/components/index.d.ts" } diff --git a/packages/diracx-web-components/contexts/package.json b/packages/diracx-web-components/contexts/package.json index f8d2c3e7..b8c795b2 100644 --- a/packages/diracx-web-components/contexts/package.json +++ b/packages/diracx-web-components/contexts/package.json @@ -1,6 +1,6 @@ { "private": true, - "main": "../dist/contexts/index.js", - "module": "../dist/contexts/index.mjs", + "main": "../dist/contexts/index.cjs", + "module": "../dist/contexts/index.js", "types": "../dist/contexts/index.d.ts" } diff --git a/packages/diracx-web-components/hooks/package.json b/packages/diracx-web-components/hooks/package.json index 1b8a3018..2064eb5b 100644 --- a/packages/diracx-web-components/hooks/package.json +++ b/packages/diracx-web-components/hooks/package.json @@ -1,6 +1,6 @@ { "private": true, - "main": "../dist/hooks/index.js", - "module": "../dist/hooks/index.mjs", + "main": "../dist/hooks/index.cjs", + "module": "../dist/hooks/index.js", "types": "../dist/hooks/index.d.ts" } diff --git a/packages/diracx-web-components/package.json b/packages/diracx-web-components/package.json index 7cd026e7..f9571037 100644 --- a/packages/diracx-web-components/package.json +++ b/packages/diracx-web-components/package.json @@ -4,11 +4,11 @@ "description": "Useful components for diracx-web", "scripts": { "build": "tsup --minify", - "dev": "tsup --watch --sourcemap", + "dev": "tsup --watch", "test": "jest --ci", "lint": "eslint src", "ts-lint": "tsc -noEmit -incremental", - "prepack": "npm run build" + "prepack": "rm -rf dist && npm run build" }, "author": "", "license": "GPL-3.0", @@ -55,25 +55,25 @@ "./package.json": "./package.json", "./components": { "module": "./dist/components/index.js", - "require": "./dist/components/index.js", + "require": "./dist/components/index.cjs", "types": "./dist/components/index.d.ts", "default": "./dist/components/index.js" }, "./contexts": { "module": "./dist/contexts/index.js", - "require": "./dist/contexts/index.js", + "require": "./dist/contexts/index.cjs", "types": "./dist/contexts/index.d.ts", "default": "./dist/contexts/index.js" }, "./hooks": { "module": "./dist/hooks/index.js", - "require": "./dist/hooks/index.js", + "require": "./dist/hooks/index.cjs", "types": "./dist/hooks/index.d.ts", "default": "./dist/hooks/index.js" }, "./types": { "module": "./dist/types/index.js", - "require": "./dist/types/index.js", + "require": "./dist/types/index.cjs", "types": "./dist/types/index.d.ts", "default": "./dist/types/index.js" } diff --git a/packages/diracx-web-components/src/components/applications/JobMonitor.tsx b/packages/diracx-web-components/src/components/applications/JobMonitor.tsx index 3518d5da..55a3f2f3 100644 --- a/packages/diracx-web-components/src/components/applications/JobMonitor.tsx +++ b/packages/diracx-web-components/src/components/applications/JobMonitor.tsx @@ -1,5 +1,5 @@ "use client"; -import * as React from "react"; +import React from "react"; import { JobDataTable } from "../ui/JobDataTable"; import ApplicationHeader from "@/components/ui/ApplicationHeader"; diff --git a/packages/diracx-web-components/src/components/applications/LoginForm.tsx b/packages/diracx-web-components/src/components/applications/LoginForm.tsx index 53883f8c..bc911b42 100644 --- a/packages/diracx-web-components/src/components/applications/LoginForm.tsx +++ b/packages/diracx-web-components/src/components/applications/LoginForm.tsx @@ -12,7 +12,7 @@ import Autocomplete from "@mui/material/Autocomplete"; import TextField from "@mui/material/TextField"; import { CssBaseline, Stack } from "@mui/material"; import { ThemeProvider as MUIThemeProvider } from "@mui/material/styles"; -import * as React from "react"; +import React from "react"; import { useOidc } from "@axa-fr/react-oidc"; import { useOIDCContext } from "@/hooks/oidcConfiguration"; import { useMUITheme } from "@/hooks/theme"; diff --git a/packages/diracx-web-components/src/components/applications/UserDashboard.tsx b/packages/diracx-web-components/src/components/applications/UserDashboard.tsx index a9951d36..ec9796fa 100644 --- a/packages/diracx-web-components/src/components/applications/UserDashboard.tsx +++ b/packages/diracx-web-components/src/components/applications/UserDashboard.tsx @@ -1,5 +1,5 @@ "use client"; -import * as React from "react"; +import React from "react"; import { useOidcAccessToken } from "@axa-fr/react-oidc"; import { useOIDCContext } from "@/hooks/oidcConfiguration"; import ApplicationHeader from "@/components/ui/ApplicationHeader"; diff --git a/packages/diracx-web-components/src/components/layout/Dashboard.tsx b/packages/diracx-web-components/src/components/layout/Dashboard.tsx index 49fd138f..b7174788 100644 --- a/packages/diracx-web-components/src/components/layout/Dashboard.tsx +++ b/packages/diracx-web-components/src/components/layout/Dashboard.tsx @@ -1,5 +1,5 @@ "use client"; -import * as React from "react"; +import React from "react"; import AppBar from "@mui/material/AppBar"; import Box from "@mui/material/Box"; import CssBaseline from "@mui/material/CssBaseline"; diff --git a/packages/diracx-web-components/src/components/ui/DataTable.tsx b/packages/diracx-web-components/src/components/ui/DataTable.tsx index 0549c615..7044738a 100644 --- a/packages/diracx-web-components/src/components/ui/DataTable.tsx +++ b/packages/diracx-web-components/src/components/ui/DataTable.tsx @@ -1,5 +1,5 @@ "use client"; -import * as React from "react"; +import React from "react"; import { alpha } from "@mui/material/styles"; import Box from "@mui/material/Box"; import Table from "@mui/material/Table"; diff --git a/packages/diracx-web-components/src/components/ui/JobDataTable.tsx b/packages/diracx-web-components/src/components/ui/JobDataTable.tsx index fd95bde2..518dcdff 100644 --- a/packages/diracx-web-components/src/components/ui/JobDataTable.tsx +++ b/packages/diracx-web-components/src/components/ui/JobDataTable.tsx @@ -1,4 +1,4 @@ -import * as React from "react"; +import React from "react"; import Box from "@mui/material/Box"; import { blue, diff --git a/packages/diracx-web-components/tsup.config.ts b/packages/diracx-web-components/tsup.config.ts index d77d43ba..d3856a37 100644 --- a/packages/diracx-web-components/tsup.config.ts +++ b/packages/diracx-web-components/tsup.config.ts @@ -14,6 +14,7 @@ export default defineConfig([ experimentalDts: true, // Seems to work fine, lower memory usage and faster than dts target: "es5", bundle: true, + sourcemap: true, async onSuccess() { // recursively go through each js file in dist and add "use client" to the top const distDir = path.join(__dirname, "dist"); @@ -52,8 +53,8 @@ export default defineConfig([ ], format: ["esm", "cjs"], experimentalDts: true, // Seems to work fine, lower memory usage and faster than dts - clean: true, target: "es5", bundle: false, + sourcemap: true }, ]); diff --git a/packages/diracx-web-components/types/package.json b/packages/diracx-web-components/types/package.json index f91a56fb..0af6e8d6 100644 --- a/packages/diracx-web-components/types/package.json +++ b/packages/diracx-web-components/types/package.json @@ -1,6 +1,6 @@ { "private": true, - "main": "../dist/types/index.js", - "module": "../dist/types/index.mjs", + "main": "../dist/types/index.cjs", + "module": "../dist/types/index.js", "types": "../dist/types/index.d.ts" } diff --git a/packages/diracx-web/src/app/(dashboard)/layout.tsx b/packages/diracx-web/src/app/(dashboard)/layout.tsx index 4f7ef5bc..84202a1c 100644 --- a/packages/diracx-web/src/app/(dashboard)/layout.tsx +++ b/packages/diracx-web/src/app/(dashboard)/layout.tsx @@ -1,5 +1,5 @@ "use client"; -import * as React from "react"; +import React from "react"; import CssBaseline from "@mui/material/CssBaseline"; import { Box } from "@mui/material"; import { ThemeProvider as MUIThemeProvider } from "@mui/material/styles";