Commit 8f8b0bc
authored
feat!: libraries only export (valid) ES modules (#405)
The ES module exports are now actually valid (they lacked the `.js`
extension required to point to real paths in some of the packages).
To avoid having to change all import paths in the TypeScript code
itself, we use `esnext/bundler` instead of `nodenext/nodenext`
module resolution. While the latter was slightly simpler as it
did not need e.g. esbuild, the `topbar` code was already quite
large, so it was easier to switch to bundler (and then do that
for all packages so they are aligned).
BREAKING:
- libraries are now only exported as (native) ES modules
NOTE: Fluent UI packages are still missing extensions for most ES
module imports, which is upsetting Node.js, cfr [this issue](microsoft/fluentui#30634)
This means that for testing, you will need to (partially) bundle these.
With vitest, you can do this by providing packages to be optimized:
```
test: {
deps: { optimizer: { web: {
enabled: true,
include: [<package-name>, ...],
}}},
},
```
- generated tokens are not included in the repo, you need to run
the `fluent-theme-tokens` command which comes with the
`@axiscommunications/fluent-theme` package to generate them
TLDR:
- all packages are of type "module" and use the "export" field
- TypeScript is updated to v5 which supports "bundler" resolution
and that is used throughout
- type declarations are built with tsc using tsconfig.build.json
which excludes any test sources (if present)
- bundles are produced using esbuild CLI (no config file), which fixes
some packages that did not have proper extensions as ES modules.
NOTE: these are not minifed bundles as in `.min.js` as we don't directly use
modules in production yet)
- ts-node is removed as it's no longer up-to-date and cannot handle ES
modules properly connected to unresolved issues. Scripts use JS for
now (until e.g. Node.js allows running TS directly).
- lodash was removed (instead of replacing with lodash-es)
- vitest + coverage was updated to v3, vite to v61 parent b6456a8 commit 8f8b0bc
File tree
104 files changed
+1323
-8001
lines changed- .github
- workflows
- components
- empty-view
- password-input
- src
- slider
- stepper
- topbar
- examples
- hooks
- icons
- illustrations
- scripts
- src
- illustrations
- scripts
- tests
- utils
- styles
- theme
- src
- hooks
- tests
- themes
- tokens
- types
- tokens
- generated
- css
- json
- tokens
- ts
- xaml
- tools
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
104 files changed
+1323
-8001
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | | - | |
| 35 | + | |
33 | 36 | | |
34 | | - | |
35 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
| 36 | + | |
30 | 37 | | |
31 | 38 | | |
32 | | - | |
| 39 | + | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
37 | 44 | | |
38 | 45 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments