diff --git a/optuna_dashboard/package-lock.json b/optuna_dashboard/package-lock.json index d039bfe3..bd034baf 100644 --- a/optuna_dashboard/package-lock.json +++ b/optuna_dashboard/package-lock.json @@ -1,11 +1,11 @@ { - "name": "optuna-dashboard", + "name": "@optuna/optuna-dashboard", "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "optuna-dashboard", + "name": "@optuna/optuna-dashboard", "version": "0.0.1", "license": "MIT", "dependencies": { diff --git a/optuna_dashboard/package.json b/optuna_dashboard/package.json index 41cf693b..04d09bf8 100644 --- a/optuna_dashboard/package.json +++ b/optuna_dashboard/package.json @@ -3,8 +3,8 @@ "private": true, "version": "0.0.1", "description": "Dashboard for Optuna", - "main": "pkg/components/App.js", - "types": "types/components/App.d.ts", + "main": "pkg/pkg_index.js", + "types": "types/pkg_index.d.ts", "scripts": { "watch": "NODE_ENV=development TYPESCRIPT_LOADER=esbuild-loader webpack --watch", "build": "webpack", diff --git a/optuna_dashboard/ts/components/App.tsx b/optuna_dashboard/ts/components/App.tsx index 8267b5d9..c915f7c7 100644 --- a/optuna_dashboard/ts/components/App.tsx +++ b/optuna_dashboard/ts/components/App.tsx @@ -28,20 +28,6 @@ const queryClient = new QueryClient({ }, }) -const URL_PREFIX = "/dashboard" - -export const Ex: FC = () => { - const [ex, setEx] = useState("loading...") - - useEffect(() => { - setTimeout(() => { - setEx("Hello, World!") - }, 1000) - }, []) - - return
{ex}
-} - export const App: FC = () => { const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)") const [colorMode, setColorMode] = useState<"light" | "dark">("light") diff --git a/optuna_dashboard/ts/pkg_index.tsx b/optuna_dashboard/ts/pkg_index.tsx new file mode 100644 index 00000000..4c6ed85b --- /dev/null +++ b/optuna_dashboard/ts/pkg_index.tsx @@ -0,0 +1,5 @@ +import { APIClientProvider } from "./apiClientProvider" +import { AxiosClient } from "./axiosClient" +import { App } from "./components/App" + +export { AxiosClient, APIClientProvider, App} \ No newline at end of file diff --git a/optuna_dashboard/tsconfig.pkg.json b/optuna_dashboard/tsconfig.pkg.json index e984dc52..a683fe3e 100644 --- a/optuna_dashboard/tsconfig.pkg.json +++ b/optuna_dashboard/tsconfig.pkg.json @@ -1,24 +1,31 @@ -{ +{ "compilerOptions": { "isolatedModules": true, "skipLibCheck": true, - "strictNullChecks": true, - "moduleResolution": "Node", + "baseUrl": ".", + "moduleResolution": "node", "noImplicitThis": true, "alwaysStrict": true, - "noImplicitAny": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], - "module": "ESNext", - "esModuleInterop": true, "rootDir": "./ts", "outDir": "./pkg", + "paths": { + "plotly.js-dist-min": ["node_modules/@types/plotly.js"] + }, + "lib": ["dom", "esnext"], + "module": "esnext", + "esModuleInterop": true, "allowSyntheticDefaultImports": true, - "target": "ES2020", + "target": "es6", + "jsx": "react", "sourceMap": true, + "strict": true, "declaration": true, "declarationDir": "./types", - "strict": true, - "jsx": "react-jsx" }, - "include": ["ts/components/App.tsx"], + "files": [ + "./ts/pkg_index.tsx", + ], + "include": [ + "./ts/types/**/*", + ], } \ No newline at end of file