Skip to content

Commit 4ced6ce

Browse files
committed
Fix package build
1 parent b949b25 commit 4ced6ce

10 files changed

+3387
-166
lines changed

package-lock.json

Lines changed: 3333 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"name": "react-fairdo-elastic-search",
33
"version": "0.0.1",
44
"private": true,
5+
"main": "dist/index.js",
6+
"type": "module",
57
"author": {
68
"name": "Christopher Raquet"
79
},
@@ -19,10 +21,8 @@
1921
"modern"
2022
],
2123
"scripts": {
22-
"dev": "next dev",
23-
"build": "next build",
24-
"start": "next start",
25-
"lint": "next lint"
24+
"dev": "storybook dev",
25+
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.app.json && tailwind build -i src/index.css -o dist/index.css && cp ./src/elastic-ui.css ./dist"
2626
},
2727
"dependencies": {
2828
"@elastic/react-search-ui": "^1.22.0",
@@ -57,6 +57,9 @@
5757
"zustand": "^5.0.2"
5858
},
5959
"devDependencies": {
60+
"@babel/core": "^7.26.0",
61+
"@babel/preset-env": "^7.26.0",
62+
"@babel/preset-react": "^7.26.3",
6063
"@chromatic-com/storybook": "^3.2.2",
6164
"@eslint-react/eslint-plugin": "^1.23.2",
6265
"@eslint/js": "^9.15.0",
@@ -73,16 +76,28 @@
7376
"@types/react-dom": "^18.3.1",
7477
"@vitejs/plugin-react": "^4.3.4",
7578
"autoprefixer": "^10.4.20",
79+
"babel-loader": "^9.2.1",
7680
"chromatic": "^11.20.2",
81+
"css-loader": "^7.1.2",
7782
"eslint": "^9.15.0",
7883
"eslint-plugin-react-hooks": "^5.0.0",
7984
"eslint-plugin-react-refresh": "^0.4.14",
8085
"eslint-plugin-storybook": "^0.11.1",
8186
"globals": "^15.12.0",
8287
"postcss": "^8.4.49",
88+
"postcss-loader": "^8.1.1",
8389
"storybook": "^8.4.7",
90+
"style-loader": "^4.0.0",
8491
"tailwindcss": "^3.4.16",
92+
"ts-loader": "^9.5.2",
93+
"tsc-alias": "^1.8.10",
8594
"typescript": "~5.6.2",
86-
"typescript-eslint": "^8.15.0"
87-
}
95+
"typescript-eslint": "^8.15.0",
96+
"webpack": "^5.97.1",
97+
"webpack-cli": "^6.0.1"
98+
},
99+
"files": [
100+
"dist"
101+
],
102+
"types": "dist/index.d.ts"
88103
}

src/components/FairDOElasticSearch.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { ErrorBoundary, Facet, Paging, PagingInfo, Results, ResultsPerPage, Sear
1515
import { Layout } from "@elastic/react-search-ui-views"
1616
import { LoaderCircle } from "lucide-react"
1717
import { useMemo } from "react"
18+
import "../index.css"
1819
import "../elastic-ui.css"
1920

2021
/**

src/components/result/ResultView.tsx

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/components/search/DefaultFacet.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function DefaultFacet(props: FacetViewProps & { config: FairDOConfigProvi
5151
<div key={value} className="flex max-w-full items-center gap-2 break-words p-1 pb-2">
5252
<Checkbox id={value} checked={option.selected} onCheckedChange={(v) => (v ? props.onSelect(option.value.toString()) : props.onRemove(option.value.toString()))} />
5353
<Label htmlFor={value} className="min-w-0 grow break-words">
54-
{value ? selfConfig.usePidResolver ? <PidDisplay pid={value} /> : tryURLPrettyPrint(value) : <span className="text-muted-foreground">None</span>}
54+
{value ? selfConfig?.usePidResolver ? <PidDisplay pid={value} /> : tryURLPrettyPrint(value) : <span className="text-muted-foreground">None</span>}
5555
</Label>
5656
<div className="text-xs text-muted-foreground">{option.count}</div>
5757
</div>

src/stories/FairDOElasticSearch.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { FairDOConfig } from "@/config/FairDOConfig.ts"
22

33
import type { Meta, StoryObj } from "@storybook/react"
4-
import { FairDOElasticSearch } from "../components/FairDOElasticSearch.tsx"
4+
import { FairDOElasticSearch } from "@/components/FairDOElasticSearch"
55

66
const meta = {
77
component: FairDOElasticSearch

src/stories/NMRResultView.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { Meta, StoryObj } from "@storybook/react"
22

3-
import { FairDOSearchContext } from "@/components/FairDOSearchContext.tsx"
4-
import { GlobalModalProvider } from "@/components/GlobalModalProvider.tsx"
3+
import { FairDOSearchContext } from "@/components/FairDOSearchContext"
4+
import { GlobalModalProvider } from "@/components/GlobalModalProvider"
55
import { DateTime } from "luxon"
6-
import { NMRResultView } from "../components/result/NMRResultView.tsx"
6+
import { NMRResultView } from "@/components/result/NMRResultView"
77

88
const meta = {
99
component: NMRResultView

src/stories/RelationsGraph.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { Meta, StoryObj } from "@storybook/react"
22

3-
import { BasicRelationNode } from "@/lib/RelationNode.ts"
3+
import { BasicRelationNode } from "@/lib/RelationNode"
44
import { ReactFlowProvider } from "@xyflow/react"
5-
import { RelationsGraph } from "../components/graph/RelationsGraph.tsx"
5+
import { RelationsGraph } from "@/components/graph/RelationsGraph"
66

77
const meta = {
88
component: RelationsGraph

tsconfig.app.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
/* Bundler mode */
1111
"moduleResolution": "bundler",
12-
"allowImportingTsExtensions": true,
1312
"isolatedModules": true,
1413
"moduleDetection": "force",
15-
"noEmit": true,
1614
"jsx": "react-jsx",
17-
15+
"declaration": true,
16+
"sourceMap": true,
17+
"outDir": "dist",
1818
/* Linting */
1919
"strict": true,
2020
"noUnusedLocals": true,
@@ -23,7 +23,8 @@
2323
"noUncheckedSideEffectImports": true,
2424
"paths": {
2525
"@/*": ["src/*"]
26-
}
26+
},
27+
"baseUrl": "./"
2728
},
2829
"include": ["src"]
2930
}

tsconfig.build.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4+
"target": "ES2020",
5+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
6+
"module": "Preserve",
7+
"skipLibCheck": true,
8+
"jsx": "react-jsx",
9+
"declaration": true,
10+
"sourceMap": true,
11+
12+
"outDir": "dist",
13+
"esModuleInterop": true,
14+
"paths": {
15+
"@/*": ["./*"]
16+
},
17+
"baseUrl": "./src"
18+
},
19+
"include": ["src"]
20+
}

0 commit comments

Comments
 (0)