Commit 7e9133e
JavaScript: More key APIs are now non-async (#6504)
* UUID generation fallback for Node version pre-14.17.0 (#6495)
* UUID generation fallback for Node version pre-14.17.0
* Apply suggestions from code review
* Use module-load-time selection for performance
* Polish
---------
Co-authored-by: Tim te Beek <tim@moderne.io>
Co-authored-by: Knut Wannheden <knut@moderne.io>
* Changing `AddDependencyVisitor` so it is able to broaden the scope of a direct dependency if needed (#6434)
* Allowing `AddDependency` to broaden the scope of existing dependency, provided you're requesting an equal or higher version number. If requesting same scope but higher version number, the version number will be upgraded.
* Dropping `import` scope validity in favour of `compile`, given `import` is only applicable for dependencies in `dependencyManagement`
Co-authored-by: Tim te Beek <tim@moderne.io>
---------
Co-authored-by: Tim te Beek <tim@moderne.io>
* Add style parameter to OrderImports. (#6496)
* Drop Lombok hint from RemoveUnusedImports class (#6500)
* Drop Lombok hint from RemoveUnusedImports class
Since we've supported Lombok for quite some time now.
* Also update recipes.csv
* In yaml `CopyValue`, invoke `UnfoldProperties` after `MergeYaml` (#6499)
* unit test with poc for UnfoldProperties
* use imperative CopyValue in unit test
* Invoke UnfoldProperties after MergeYaml
* Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Slight polish
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tim te Beek <tim@moderne.io>
* Allow adding comments to Maven plugins too
Fixes #6502
* JavaScript: Make visitor base clases sync and add async alternative
* Polish parser APIs
* More async cleanups
* JavaScript: Notify about parsed source files from `parseProject()`
* Polish object property shorthand
* Fix Prettier integration when calling it using sync API
* Altering check for `AddDependency` to compare versions differently when direct vs indirect dependency. (#6505)
* If transitive, actually just allow regardless of version, as per old behaviour.
* Changing the parsing of the `relativePath` for `parent` in the `MavenPomDownloader` to prevent the situation where `/` was producing `/\pom.xml` on Windows rather than `\pom.xml` (#6506)
* Claude/catalogue async apis u67 hy (#6507)
* Convert package-manager and related APIs from async to sync
- Convert runInstallInTempDir and runWorkspaceInstallInTempDir to use sync
fs APIs (fs.mkdtempSync, fs.writeFileSync, fs.readFileSync, fs.rmSync)
- Convert runInstallIfNeeded callback from async to sync
- Convert updateNodeResolutionMarker to sync (was marked async with no awaits)
- Convert createLockFileEditor to use sync JsonVisitor and TreeVisitor
- Update add-dependency, upgrade-dependency-version, and
upgrade-transitive-dependency-version recipes to use sync visitors
- Convert Result.diff() to sync (createTwoFilesPatch is already sync)
The package manager operations were unnecessarily async since the underlying
process spawning (spawnSync) was already synchronous. Only the file I/O was
async, which is negligible compared to the npm/yarn/pnpm install time.
* Remove unnecessary async from IsSourceFile.preVisit()
* Add async property to TreeVisitor and AsyncTreeVisitor
Add a readonly `async` property to both visitor base classes:
- TreeVisitor: async = false
- AsyncTreeVisitor: async = true
This allows runtime discrimination of sync vs async visitors via the
RecipeVisitor union type. Useful for sync-to-sync recipe composition
where a sync visitor wants to call another sync visitor without async
overhead.
* Lift async I/O out of visitors into editorWithData()
Refactor package-manager recipes to do async I/O (npm install) in
editorWithData() before returning the visitor, keeping visitors pure.
Changes:
- Add async runInstallInTempDirAsync() using spawn() and fs.promises
- Add async runWorkspaceInstallInTempDirAsync() for workspace support
- Refactor AddDependency, UpgradeDependencyVersion, and
UpgradeTransitiveDependencyVersion to run package manager installs
in editorWithData() before returning visitors
- Remove unused runInstallIfNeeded() helper function
- Visitors are now pure tree transformations with no I/O
This provides a cleaner separation of concerns:
- Async I/O happens in the recipe's async editor() method
- Visitors are pure, synchronous tree transformations using pre-computed data
* More sync visitors
* Simplify receivers by extending visitors
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Bugfix
* Add back runInstallIfNeeded()
* Also parse `jrxml` as XML
Fixes #6512
* Update description for onlyIfUsing option
Clarified description for 'onlyIfUsing' option to specify its importance in multi-module projects.
Fixes #5795
* Retain nested class imports in `ChangePackage` (#6515)
Fixes #6513
* Add Python language support (#6508)
* Compact array RpcObjectData only for JS
* Less async test code
---------
Co-authored-by: Benjamin Muschko <benjamin.muschko@gmail.com>
Co-authored-by: Tim te Beek <tim@moderne.io>
Co-authored-by: Steve Elliott <steve@moderne.io>
Co-authored-by: Sam Snyder <sam@moderne.io>
Co-authored-by: David Grieve <david@moderne.io>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Jonathan Schnéider <jkschneider@gmail.com>1 parent 4b01270 commit 7e9133e
361 files changed
Lines changed: 50481 additions & 5048 deletions
File tree
- .context
- .github/workflows
- .idea/modules/rewrite-python-src
- rewrite-benchmarks/src/jmh/java/org/openrewrite/benchmarks/java
- rewrite-core/src
- main/java/org/openrewrite/rpc
- request
- test/java/org/openrewrite/rpc
- rewrite-java-test/src/test/java/org/openrewrite/java
- rewrite-javascript
- rewrite
- fixtures
- src
- javascript
- cleanup
- format
- migrate
- es6
- typescript
- recipes
- search
- templating
- java
- json
- rpc
- request
- search
- test
- text
- yaml
- test
- javascript
- cleanup
- format
- parser
- templating
- java
- json
- rpc
- yaml
- src/main/java/org/openrewrite/javascript
- rpc
- rewrite-java/src
- main
- java/org/openrewrite/java
- format
- resources/META-INF/rewrite
- test/java/org/openrewrite/java
- internal/rpc
- rpc
- rewrite-json/src/test/java/org/openrewrite/json/internal/rpc
- rewrite-maven/src
- main
- java/org/openrewrite/maven
- internal
- resources/META-INF/rewrite
- test/java/org/openrewrite/maven
- marketplace
- search
- rewrite-python
- rewrite
- scripts
- src/rewrite
- java
- remote
- python
- recipes
- remote
- rpc
- test
- tests
- recipes
- src
- main
- java/org/openrewrite/python
- format
- internal
- rpc
- marker
- rpc
- style
- tree
- resources/META-INF/services
- test
- java/org/openrewrite/python
- format
- style
- tree
- resources
- META-INF/services
- rewrite-xml/src/main/java/org/openrewrite/xml
- rewrite-yaml/src
- main/java/org/openrewrite/yaml
- test/java/org/openrewrite/yaml
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| 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 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
Whitespace-only changes.
0 commit comments