@openrewrite/rewrite 8.110.0 → 8.110.1
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/recipes/dependencies.d.ts +7 -0
- package/dist/javascript/recipes/dependencies.d.ts.map +1 -1
- package/dist/javascript/recipes/dependencies.js.map +1 -1
- package/dist/rewrite-javascript-version.txt +1 -1
- package/package.json +1 -1
- package/src/javascript/recipes/dependencies.ts +7 -0
|
@@ -27,6 +27,13 @@ export declare function addDependency(options: AddDependencyOptions): Promise<Re
|
|
|
27
27
|
export interface RemoveDependencyOptions {
|
|
28
28
|
packageName: string;
|
|
29
29
|
scope?: NpmDependencyScope;
|
|
30
|
+
/**
|
|
31
|
+
* Keep the dependency in a `package.json` while a source still imports a package matching one of these globs, by
|
|
32
|
+
* `import`, `export ... from`, `require()` or `import()`: the nearest `package.json` above that source declaring
|
|
33
|
+
* the dependency. Imports are read before the cycle's edits, so the recipe runs another cycle, in which it removes
|
|
34
|
+
* the dependency where an earlier recipe removed the last import.
|
|
35
|
+
*/
|
|
36
|
+
unlessImporting?: string[];
|
|
30
37
|
}
|
|
31
38
|
/**
|
|
32
39
|
* Remove an npm dependency from `package.json`, regenerate the lock file, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../../src/javascript/recipes/dependencies.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAGpC;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GACxB,cAAc,GACd,iBAAiB,GACjB,kBAAkB,GAClB,sBAAsB,CAAC;AAE7B,MAAM,WAAW,oBAAoB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,iHAAiH;IACjH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;O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;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAC9C,OAAO,EAAE,yCAAyC,GACnD,OAAO,CAAC,MAAM,CAAC,CAKjB"}
|
|
1
|
+
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../../src/javascript/recipes/dependencies.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,MAAM,EAAC,MAAM,cAAc,CAAC;AAGpC;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GACxB,cAAc,GACd,iBAAiB,GACjB,kBAAkB,GAClB,sBAAsB,CAAC;AAE7B,MAAM,WAAW,oBAAoB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,iHAAiH;IACjH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAE5E;AAED,MAAM,WAAW,uBAAuB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAElF;AAED,MAAM,WAAW,+BAA+B;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,+BAA+B,GAAG,OAAO,CAAC,MAAM,CAAC,CAElG;AAED,MAAM,WAAW,gCAAgC;IAC7C,oGAAoG;IACpG,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,4GAA4G;IAC5G,4BAA4B,CAAC,EAAE,OAAO,CAAC;CAC1C;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,gCAAgC,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpG;AAED,MAAM,WAAW,uBAAuB;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAElF;AAED,MAAM,WAAW,yCAAyC;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAC9C,OAAO,EAAE,yCAAyC,GACnD,OAAO,CAAC,MAAM,CAAC,CAKjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../src/javascript/recipes/dependencies.ts"],"names":[],"mappings":";;AAgDA,sCAEC;
|
|
1
|
+
{"version":3,"file":"dependencies.js","sourceRoot":"","sources":["../../../src/javascript/recipes/dependencies.ts"],"names":[],"mappings":";;AAgDA,sCAEC;AAmBD,4CAEC;AAaD,4DAEC;AAaD,8DAEC;AAcD,4CAEC;AAaD,gFAOC;AAzHD,uDAAwD;AA2BxD;;;;GAIG;AACH,SAAgB,aAAa,CAAC,OAA6B;IACvD,OAAO,IAAA,+BAAiB,EAAC,0CAA0C,EAAE,OAAO,CAAC,CAAC;AAClF,CAAC;AAcD;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,OAAgC;IAC7D,OAAO,IAAA,+BAAiB,EAAC,6CAA6C,EAAE,OAAO,CAAC,CAAC;AACrF,CAAC;AAQD;;;;GAIG;AACH,SAAgB,wBAAwB,CAAC,OAAwC;IAC7E,OAAO,IAAA,+BAAiB,EAAC,qDAAqD,EAAE,OAAO,CAAC,CAAC;AAC7F,CAAC;AASD;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,OAAyC;IAC/E,OAAO,IAAA,+BAAiB,EAAC,sDAAsD,EAAE,OAAO,CAAC,CAAC;AAC9F,CAAC;AASD;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,OAAgC;IAC7D,OAAO,IAAA,+BAAiB,EAAC,6CAA6C,EAAE,OAAO,CAAC,CAAC;AACrF,CAAC;AAQD;;;;GAIG;AACH,SAAgB,kCAAkC,CAC9C,OAAkD;IAElD,OAAO,IAAA,+BAAiB,EACpB,+DAA+D,EAC/D,OAAO,CACV,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
8.110.
|
|
1
|
+
8.110.1
|
package/package.json
CHANGED
|
@@ -53,6 +53,13 @@ export function addDependency(options: AddDependencyOptions): Promise<Recipe> {
|
|
|
53
53
|
export interface RemoveDependencyOptions {
|
|
54
54
|
packageName: string;
|
|
55
55
|
scope?: NpmDependencyScope;
|
|
56
|
+
/**
|
|
57
|
+
* Keep the dependency in a `package.json` while a source still imports a package matching one of these globs, by
|
|
58
|
+
* `import`, `export ... from`, `require()` or `import()`: the nearest `package.json` above that source declaring
|
|
59
|
+
* the dependency. Imports are read before the cycle's edits, so the recipe runs another cycle, in which it removes
|
|
60
|
+
* the dependency where an earlier recipe removed the last import.
|
|
61
|
+
*/
|
|
62
|
+
unlessImporting?: string[];
|
|
56
63
|
}
|
|
57
64
|
|
|
58
65
|
/**
|