Commit 51ffd89
fix: improve global/env translation and cleaning up of overrides (#245)
* Add serviceworker and worker to the list of globalsm to allow flexibility on.
And also improve the tests a bit.
* Add more tests for serviceworker.
* Strip out supersets from environment values in the migrated configs.
This ensures that we aren't providing unnecessary extra values for the `env` key.
I wrote a script to confirm these values were the ones that are supersets, but theoretically we could also just update this to use the `globals` package directly and determine supersets at runtime?
* Add svelte, astro, and vue to match the rust crate.
* Fix the implementation of cleanUpSupersetEnvs.
* Skip envs not in the config.
* Upgrade tsgolint
* Add a many-extends config spec.
This is showing a current problem where multiple extends are not being merged properly, and so we end up with exact-duplicate overrides.
* Add fix for consecutive identical overrides.
Saw this from the mastodon config file after trying to migrate it, so now it's fixed :)
* Add basic cleanup tests.
* Add more complex env superset resolution.
This was heavily helped by AI, but looking through the tests and running it on the snapshots, it looks like it works correctly for all the cases I can come up with.
* Add an integration test that shows the duplicated `"no-console": "off",` overrides being emitted (albeit with differing sets of files).
Will fix this with the next commit.
* Simplify example config/snapshot a lot.
* Fix a comment that gets parsed as an ignore directive
* Add fix for duplicate overrides objects.
If the only difference is the set of files, merge the override objects and combine the file lists.
* Add more test cases.
* update
---------
Co-authored-by: Sysix <[email protected]>1 parent 5ab97bf commit 51ffd89
File tree
21 files changed
+2405
-148
lines changed- integration_test
- __snapshots__
- projects
- src
- walker/comments
21 files changed
+2405
-148
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| |||
299 | 297 | | |
300 | 298 | | |
301 | 299 | | |
302 | | - | |
303 | 300 | | |
304 | 301 | | |
305 | | - | |
306 | 302 | | |
307 | 303 | | |
308 | 304 | | |
| |||
733 | 729 | | |
734 | 730 | | |
735 | 731 | | |
736 | | - | |
737 | 732 | | |
738 | 733 | | |
739 | | - | |
740 | 734 | | |
741 | 735 | | |
742 | 736 | | |
| |||
1024 | 1018 | | |
1025 | 1019 | | |
1026 | 1020 | | |
1027 | | - | |
1028 | 1021 | | |
1029 | 1022 | | |
1030 | | - | |
1031 | 1023 | | |
1032 | 1024 | | |
1033 | 1025 | | |
| |||
Lines changed: 153 additions & 0 deletions
| 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 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
Lines changed: 52 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
31 | 42 | | |
32 | 43 | | |
33 | 44 | | |
| |||
49 | 60 | | |
50 | 61 | | |
51 | 62 | | |
52 | | - | |
53 | 63 | | |
54 | 64 | | |
55 | | - | |
56 | 65 | | |
57 | 66 | | |
58 | 67 | | |
| |||
63 | 72 | | |
64 | 73 | | |
65 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
66 | 88 | | |
67 | 89 | | |
68 | 90 | | |
| |||
84 | 106 | | |
85 | 107 | | |
86 | 108 | | |
87 | | - | |
88 | 109 | | |
89 | 110 | | |
90 | | - | |
91 | 111 | | |
92 | 112 | | |
93 | 113 | | |
| |||
98 | 118 | | |
99 | 119 | | |
100 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
101 | 134 | | |
102 | 135 | | |
103 | 136 | | |
| |||
120 | 153 | | |
121 | 154 | | |
122 | 155 | | |
123 | | - | |
124 | 156 | | |
125 | 157 | | |
126 | | - | |
127 | 158 | | |
128 | 159 | | |
129 | 160 | | |
| |||
134 | 165 | | |
135 | 166 | | |
136 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
137 | 181 | | |
138 | 182 | | |
139 | 183 | | |
| |||
0 commit comments