Commit d3222a7
committed
fix(packaging)!: make the component library consumable outside the monorepo
Restructure @dirac-grid/diracx-web-components packaging so the library
works when installed from npm outside this monorepo:
- move host-provided packages (react, react-dom, MUI core, emotion,
@axa-fr/react-oidc, swr) from dependencies to peerDependencies and
mirror them in devDependencies for local dev/test
- add a proper exports map with a root "." entry (types-first) plus a
new ./services entry; add sideEffects: false and engines.node >= 22
- drop the legacy src/{components,contexts,hooks,types}/package.json
stub files (superseded by the exports map)
- add scripts/verify-dist.mjs to the build to fail fast when tsup
output stops matching package.json#exports
- add a framework-agnostic services/fetcher HTTP client module
(exported via ./services; root re-export lands with the consumer
migration) and guard process.env access in useDiracxUrl so non-Next
bundlers don't throw
- remove next/image usage from LoginForm and DashboardDrawer (plain
<img>) so the library no longer requires Next.js; LoginForm gains a
skeleton loading state and an error Alert
- pin Node >= 22 at the root (engines + .nvmrc); react-virtuoso stays
a direct dependency until the DataTable rewrite lands
BREAKING CHANGE: react, react-dom, @mui/material, @mui/icons-material,
@emotion/react, @emotion/styled, @axa-fr/react-oidc and swr are now
peerDependencies and must be installed by the consuming application.
Deep imports that relied on the removed per-directory package.json
stubs must use the documented subpath exports instead.1 parent 6d89033 commit d3222a7
17 files changed
Lines changed: 335 additions & 72 deletions
File tree
- packages/diracx-web-components
- scripts
- src
- components
- DashboardLayout
- Login
- contexts
- hooks
- services
- types
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
39 | 47 | | |
40 | 48 | | |
41 | | - | |
42 | 49 | | |
43 | 50 | | |
44 | 51 | | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
49 | 57 | | |
| 58 | + | |
| 59 | + | |
50 | 60 | | |
51 | 61 | | |
52 | 62 | | |
53 | 63 | | |
| 64 | + | |
| 65 | + | |
54 | 66 | | |
55 | 67 | | |
56 | 68 | | |
| |||
59 | 71 | | |
60 | 72 | | |
61 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
62 | 78 | | |
63 | 79 | | |
| 80 | + | |
64 | 81 | | |
65 | 82 | | |
66 | 83 | | |
67 | 84 | | |
68 | 85 | | |
| 86 | + | |
69 | 87 | | |
70 | 88 | | |
71 | 89 | | |
| |||
74 | 92 | | |
75 | 93 | | |
76 | 94 | | |
| 95 | + | |
| 96 | + | |
77 | 97 | | |
| 98 | + | |
78 | 99 | | |
79 | 100 | | |
80 | 101 | | |
81 | 102 | | |
82 | | - | |
83 | | - | |
84 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
85 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
86 | 111 | | |
87 | 112 | | |
88 | | - | |
89 | | - | |
| 113 | + | |
| 114 | + | |
90 | 115 | | |
91 | 116 | | |
92 | | - | |
93 | | - | |
| 117 | + | |
| 118 | + | |
94 | 119 | | |
95 | 120 | | |
96 | | - | |
97 | | - | |
| 121 | + | |
| 122 | + | |
98 | 123 | | |
99 | 124 | | |
100 | | - | |
101 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
102 | 131 | | |
103 | 132 | | |
104 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
413 | 412 | | |
414 | 413 | | |
415 | 414 | | |
416 | | - | |
| 415 | + | |
417 | 416 | | |
418 | 417 | | |
419 | | - | |
420 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
421 | 426 | | |
422 | 427 | | |
423 | 428 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
153 | 151 | | |
154 | 152 | | |
155 | 153 | | |
156 | | - | |
| 154 | + | |
157 | 155 | | |
158 | 156 | | |
159 | 157 | | |
| |||
Lines changed: 0 additions & 6 deletions
This file was deleted.
0 commit comments