Commit 1c96426
authored
switch to NodeNext module resolution (#12179)
refs: #9005
## Description
This changes all tsconfig projects to use `moduleResolution: 'NodeNext'`, freeing us of ambients! There are still some globals via `exported.js` that we can burn down later but at least those are explicit.
(The previous moduleResolution, 'bundler', was necessary because of our dependence on ambients. It's the mode that assumes everything will be turned into one giant bundle, so whatever hacks and heuristics the local TSC has to do to get the types to resolve is okay. But we actually do publish separate packages so need more strict type resolution behavior.)
I used the hacky script in #12225 but am not proposing to merge that. We might need to run it again when getting off `exported.js` but we can either run it from the branch or do some more (separate) work to make it trunk-worthy. That script uses the TS language server to iterate over files and do the "auto-import" that VS Code does. By changing the moduleResolution from 'bundler' and running that, necessary types are auto-imported. When there's a duplicate name it doesn't always get the right one so some manual fixups were necessary. After doing this for every module in the repo, I was able to change the default so they all are 'NodeNext' now.
### Security Considerations
none
### Scaling Considerations
none
### Documentation Considerations
Any downstream relying on the `types-ambient.js` exports will fail. The solution is just to import explicitly. I think that's a fine change to impose.
### Testing Considerations
CI
Nothing downstream will fail until it updates to a newer release and the fix for any ambients will be trivial.
### Upgrade Considerations
does not affect chainFile tree
211 files changed
+1010
-369
lines changed- multichain-testing
- scripts
- tools
- packages
- ERTP
- test/swingsetTests/ertpService
- SwingSet
- src
- controller
- supervisors/subprocess-node
- test
- agoric-cli
- src
- tools/resm-plugin
- src
- async-flow
- base-zone
- benchmark/src
- boot
- test/upgrading
- tools
- client-utils
- src
- cosmic-swingset
- test
- deploy-script-support/test/unitTests
- governance/src
- contractGovernance
- inter-protocol
- src
- auction
- proposals
- psm
- vaultFactory
- test
- auction
- psm
- reserve
- swingsetTests
- fluxAggregator
- psmUpgrade
- reserve
- vaultFactory
- internal
- src/node
- kmarshal
- notifier
- test
- orchestration
- src
- pegasus/src
- portfolio-api
- portfolio-contract
- smart-wallet
- test
- swingsetTests/upgradeWalletFactory
- store
- swing-store
- swingset-liveslots
- telemetry
- src
- time
- vats
- src
- core
- proposals
- tools
- xsnap/src
- zoe
- src
- contractFacet
- contractSupport
- contracts
- auction
- callSpread
- loan
- zoeService
- offer
- test
- swingsetTests
- runMint
- upgradeCoveredCall
- zoe
- unitTests
- contracts
- zcf
- zoe
- tools
- zone
- types/anylogger
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
211 files changed
+1010
-369
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
| |||
96 | 94 | | |
97 | 95 | | |
98 | 96 | | |
99 | | - | |
100 | | - | |
101 | 97 | | |
102 | 98 | | |
103 | 99 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
135 | 133 | | |
136 | 134 | | |
137 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
145 | 143 | | |
146 | 144 | | |
147 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 4 | | |
11 | 5 | | |
12 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
0 commit comments