@openrewrite/rewrite 8.91.4 → 8.91.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/javascript/index.d.ts +1 -1
- package/dist/javascript/index.d.ts.map +1 -1
- package/dist/javascript/index.js +2 -1
- package/dist/javascript/index.js.map +1 -1
- package/dist/javascript/remove-import.d.ts +0 -18
- package/dist/javascript/remove-import.d.ts.map +1 -1
- package/dist/javascript/remove-import.js +50 -438
- package/dist/javascript/remove-import.js.map +1 -1
- package/dist/javascript/scope.d.ts +6 -0
- package/dist/javascript/scope.d.ts.map +1 -1
- package/dist/javascript/scope.js +87 -7
- package/dist/javascript/scope.js.map +1 -1
- package/dist/rewrite-javascript-version.txt +1 -1
- package/dist/rpc/index.d.ts +1 -1
- package/dist/rpc/index.d.ts.map +1 -1
- package/dist/rpc/index.js +2 -1
- package/dist/rpc/index.js.map +1 -1
- package/dist/rpc/java-recipe.d.ts +32 -22
- package/dist/rpc/java-recipe.d.ts.map +1 -1
- package/dist/rpc/java-recipe.js +91 -30
- package/dist/rpc/java-recipe.js.map +1 -1
- package/dist/rpc/request/prepare-recipe.d.ts +10 -14
- package/dist/rpc/request/prepare-recipe.d.ts.map +1 -1
- package/dist/rpc/request/prepare-recipe.js +53 -88
- package/dist/rpc/request/prepare-recipe.js.map +1 -1
- package/dist/rpc/rewrite-rpc.d.ts +5 -12
- package/dist/rpc/rewrite-rpc.d.ts.map +1 -1
- package/dist/rpc/rewrite-rpc.js +5 -12
- package/dist/rpc/rewrite-rpc.js.map +1 -1
- package/package.json +1 -1
- package/src/javascript/index.ts +1 -1
- package/src/javascript/remove-import.ts +50 -424
- package/src/javascript/scope.ts +103 -7
- package/src/rpc/index.ts +1 -1
- package/src/rpc/java-recipe.ts +107 -33
- package/src/rpc/request/prepare-recipe.ts +55 -90
- package/src/rpc/rewrite-rpc.ts +5 -12
|
@@ -16,7 +16,7 @@ export * from "./autodetect";
|
|
|
16
16
|
export * from "./tree-debug";
|
|
17
17
|
export * from "./project-parser";
|
|
18
18
|
export type { Scope } from "./scope";
|
|
19
|
-
export { scopeOf, namesDeclaredIn, namesDeclaredWithin, namesUsedIn, bindingNames, deconflict, isValueReference, declarationsOf, compilationUnitOf, walk } from "./scope";
|
|
19
|
+
export { scopeOf, namesDeclaredIn, namesDeclaredWithin, namesUsedIn, namesReferencedWithin, bindingNames, deconflict, isValueReference, declarationsOf, compilationUnitOf, walk } from "./scope";
|
|
20
20
|
export type { QuoteChar, AddImportOptions } from "./add-import";
|
|
21
21
|
export { ImportStyle, moduleNameOf, AddImport } from "./add-import";
|
|
22
22
|
export type { AmdBlock, AmdCalleeOptions } from "./amd";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/javascript/index.ts"],"names":[],"mappings":"AAeA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AAEjC,YAAY,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAGnC,OAAO,EACH,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/javascript/index.ts"],"names":[],"mappings":"AAeA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC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WAAW,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,cAAc,EAAC,MAAM,WAAW,CAAC;AAC7H,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAE/B,OAAO,SAAS,CAAC;AACjB,OAAO,OAAO,CAAC"}
|
package/dist/javascript/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.maybeAddImport = exports.maybeRemoveImport = exports.isAmdBlock = exports.moduleBindings = exports.maybeRebind = exports.maybeUnbind = exports.maybeBind = exports.removeNewlyUnusedAmdBindings = exports.RemoveAmdDependency = exports.withoutDependencyAt = exports.withUnboundDependency = exports.withDependency = exports.derivedBindingName = exports.lastSegment = exports.namesUsed = exports.references = exports.bodyOf = exports.parameterNames = exports.dependencyNames = exports.identifierOf = exports.parametersOf = exports.elementsOf = exports.present = exports.enclosingAmdBlock = exports.amdBlockOf = exports.DEFAULT_AMD_CALLEES = exports.AddImport = exports.moduleNameOf = exports.ImportStyle = exports.walk = exports.compilationUnitOf = exports.declarationsOf = exports.isValueReference = exports.deconflict = exports.bindingNames = exports.namesUsedIn = exports.namesDeclaredWithin = exports.namesDeclaredIn = exports.scopeOf = void 0;
|
|
17
|
+
exports.maybeAddImport = exports.maybeRemoveImport = exports.isAmdBlock = exports.moduleBindings = exports.maybeRebind = exports.maybeUnbind = exports.maybeBind = exports.removeNewlyUnusedAmdBindings = exports.RemoveAmdDependency = exports.withoutDependencyAt = exports.withUnboundDependency = exports.withDependency = exports.derivedBindingName = exports.lastSegment = exports.namesUsed = exports.references = exports.bodyOf = exports.parameterNames = exports.dependencyNames = exports.identifierOf = exports.parametersOf = exports.elementsOf = exports.present = exports.enclosingAmdBlock = exports.amdBlockOf = exports.DEFAULT_AMD_CALLEES = exports.AddImport = exports.moduleNameOf = exports.ImportStyle = exports.walk = exports.compilationUnitOf = exports.declarationsOf = exports.isValueReference = exports.deconflict = exports.bindingNames = exports.namesReferencedWithin = exports.namesUsedIn = exports.namesDeclaredWithin = exports.namesDeclaredIn = exports.scopeOf = void 0;
|
|
18
18
|
/*
|
|
19
19
|
* Copyright 2025 the original author or authors.
|
|
20
20
|
* <p>
|
|
@@ -54,6 +54,7 @@ Object.defineProperty(exports, "scopeOf", { enumerable: true, get: function () {
|
|
|
54
54
|
Object.defineProperty(exports, "namesDeclaredIn", { enumerable: true, get: function () { return scope_1.namesDeclaredIn; } });
|
|
55
55
|
Object.defineProperty(exports, "namesDeclaredWithin", { enumerable: true, get: function () { return scope_1.namesDeclaredWithin; } });
|
|
56
56
|
Object.defineProperty(exports, "namesUsedIn", { enumerable: true, get: function () { return scope_1.namesUsedIn; } });
|
|
57
|
+
Object.defineProperty(exports, "namesReferencedWithin", { enumerable: true, get: function () { return scope_1.namesReferencedWithin; } });
|
|
57
58
|
Object.defineProperty(exports, "bindingNames", { enumerable: true, get: function () { return scope_1.bindingNames; } });
|
|
58
59
|
Object.defineProperty(exports, "deconflict", { enumerable: true, get: function () { return scope_1.deconflict; } });
|
|
59
60
|
Object.defineProperty(exports, "isValueReference", { enumerable: true, get: function () { return scope_1.isValueReference; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/javascript/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,yCAAuB;AACvB,4CAA0B;AAC1B,+CAA6B;AAC7B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,2DAAyC;AACzC,wDAAsC;AACtC,oDAAkC;AAClC,uDAAqC;AACrC,kDAAgC;AAChC,qDAAmC;AAC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Y,OAAA;AAAE,mGAAA,YAAY,OAAA;AACnG,sGAAA,eAAe,OAAA;AAAE,qGAAA,cAAc,OAAA;AAAE,6FAAA,MAAM,OAAA;AAAE,iGAAA,UAAU,OAAA;AAAE,gGAAA,SAAS,OAAA;AAAE,kGAAA,WAAW,OAAA;AAAE,yGAAA,kBAAkB,OAAA;AAC/F,qGAAA,cAAc,OAAA;AAAE,4GAAA,qBAAqB,OAAA;AAAE,0GAAA,mBAAmB,OAAA;AAC1D,0GAAA,mBAAmB,OAAA;AAAE,mHAAA,4BAA4B,OAAA;AAGrD,qCAA6H;AAArH,oGAAA,SAAS,OAAA;AAAE,sGAAA,WAAW,OAAA;AAAE,sGAAA,WAAW,OAAA;AAAE,yGAAA,cAAc,OAAA;AAAE,qGAAA,UAAU,OAAA;AAAE,4GAAA,iBAAiB,OAAA;AAAE,yGAAA,cAAc,OAAA;AAC1G,kDAAgC;AAChC,kDAAgC;AAChC,kDAAgC;AAChC,iDAA+B;AAE/B,mBAAiB;AACjB,iBAAe"}
|
|
@@ -32,10 +32,6 @@ export declare class RemoveImport<P> extends JavaScriptVisitor<P> {
|
|
|
32
32
|
* This is represented as a JS.Import with an initializer containing the require() call.
|
|
33
33
|
*/
|
|
34
34
|
private processImportEqualsRequire;
|
|
35
|
-
/**
|
|
36
|
-
* Check if a node is a require() method invocation
|
|
37
|
-
*/
|
|
38
|
-
private isRequireCall;
|
|
39
35
|
/**
|
|
40
36
|
* Check if the module name matches the target module
|
|
41
37
|
*/
|
|
@@ -57,19 +53,5 @@ export declare class RemoveImport<P> extends JavaScriptVisitor<P> {
|
|
|
57
53
|
private boundByPatternElement;
|
|
58
54
|
private shouldRemoveImport;
|
|
59
55
|
private isTargetModule;
|
|
60
|
-
/**
|
|
61
|
-
* Helper to traverse parameters from various node types
|
|
62
|
-
*/
|
|
63
|
-
private traverseParameters;
|
|
64
|
-
/**
|
|
65
|
-
* Helper to traverse statements from various node types
|
|
66
|
-
*/
|
|
67
|
-
private traverseStatements;
|
|
68
|
-
/**
|
|
69
|
-
* Helper to check for type expressions and collect type usage
|
|
70
|
-
*/
|
|
71
|
-
private checkTypeExpression;
|
|
72
|
-
private collectUsedIdentifiers;
|
|
73
|
-
private collectTypeUsage;
|
|
74
56
|
}
|
|
75
57
|
//# sourceMappingURL=remove-import.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-import.d.ts","sourceRoot":"","sources":["../../src/javascript/remove-import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAC,CAAC,EAAC,MAAM,SAAS,CAAC;AAE1B,OAAO,EAAC,EAAE,EAAM,MAAM,QAAQ,CAAC;AAY/B,qBAAa,YAAY,CAAC,CAAC,CAAE,SAAQ,iBAAiB,CAAC,CAAC,CAAC;IAUzC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM;IAVpC;;;;;;;;OAQG;gBACkB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,YAAA;IAIpC;;;;;OAKG;YACW,oCAAoC;IAgDlD;;OAEG;YACW,kBAAkB;IAejB,sBAAsB,CAAC,eAAe,EAAE,EAAE,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"remove-import.d.ts","sourceRoot":"","sources":["../../src/javascript/remove-import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAC,CAAC,EAAC,MAAM,SAAS,CAAC;AAE1B,OAAO,EAAC,EAAE,EAAM,MAAM,QAAQ,CAAC;AAY/B,qBAAa,YAAY,CAAC,CAAC,CAAE,SAAQ,iBAAiB,CAAC,CAAC,CAAC;IAUzC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,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