@openrewrite/recipes-angular 1.25.0 → 1.27.0
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/libraries/primeng/18/migrate-primeng-config.d.ts.map +1 -1
- package/dist/libraries/primeng/18/migrate-primeng-config.js +0 -59
- package/dist/libraries/primeng/18/migrate-primeng-config.js.map +1 -1
- package/dist/libraries/primeng/18/rename-calendar-to-datepicker.d.ts.map +1 -1
- package/dist/libraries/primeng/18/rename-calendar-to-datepicker.js +0 -65
- package/dist/libraries/primeng/18/rename-calendar-to-datepicker.js.map +1 -1
- package/dist/libraries/primeng/18/rename-dropdown-to-select.d.ts.map +1 -1
- package/dist/libraries/primeng/18/rename-dropdown-to-select.js +0 -65
- package/dist/libraries/primeng/18/rename-dropdown-to-select.js.map +1 -1
- package/dist/libraries/primeng/18/rename-inputswitch-to-toggleswitch.d.ts.map +1 -1
- package/dist/libraries/primeng/18/rename-inputswitch-to-toggleswitch.js +0 -65
- package/dist/libraries/primeng/18/rename-inputswitch-to-toggleswitch.js.map +1 -1
- package/dist/libraries/primeng/18/rename-overlaypanel-to-popover.d.ts.map +1 -1
- package/dist/libraries/primeng/18/rename-overlaypanel-to-popover.js +0 -65
- package/dist/libraries/primeng/18/rename-overlaypanel-to-popover.js.map +1 -1
- package/dist/libraries/primeng/18/rename-sidebar-to-drawer.d.ts.map +1 -1
- package/dist/libraries/primeng/18/rename-sidebar-to-drawer.js +0 -65
- package/dist/libraries/primeng/18/rename-sidebar-to-drawer.js.map +1 -1
- package/dist/migration/rename-after-render.d.ts +2 -2
- package/dist/migration/rename-after-render.d.ts.map +1 -1
- package/dist/migration/rename-after-render.js +9 -25
- package/dist/migration/rename-after-render.js.map +1 -1
- package/dist/migration/rename-check-no-changes.d.ts +2 -2
- package/dist/migration/rename-check-no-changes.d.ts.map +1 -1
- package/dist/migration/rename-check-no-changes.js +23 -19
- package/dist/migration/rename-check-no-changes.js.map +1 -1
- package/dist/migration/rename-pending-tasks.d.ts +2 -2
- package/dist/migration/rename-pending-tasks.d.ts.map +1 -1
- package/dist/migration/rename-pending-tasks.js +9 -22
- package/dist/migration/rename-pending-tasks.js.map +1 -1
- package/dist/migration/rename-zoneless-provider.d.ts +2 -2
- package/dist/migration/rename-zoneless-provider.d.ts.map +1 -1
- package/dist/migration/rename-zoneless-provider.js +9 -21
- package/dist/migration/rename-zoneless-provider.js.map +1 -1
- package/package.json +1 -1
- package/src/libraries/primeng/18/migrate-primeng-config.ts +2 -43
- package/src/libraries/primeng/18/rename-calendar-to-datepicker.ts +2 -50
- package/src/libraries/primeng/18/rename-dropdown-to-select.ts +2 -50
- package/src/libraries/primeng/18/rename-inputswitch-to-toggleswitch.ts +2 -50
- package/src/libraries/primeng/18/rename-overlaypanel-to-popover.ts +2 -50
- package/src/libraries/primeng/18/rename-sidebar-to-drawer.ts +2 -50
- package/src/migration/rename-after-render.ts +11 -24
- package/src/migration/rename-check-no-changes.ts +21 -18
- package/src/migration/rename-pending-tasks.ts +11 -22
- package/src/migration/rename-zoneless-provider.ts +11 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-primeng-config.d.ts","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/migrate-primeng-config.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"migrate-primeng-config.d.ts","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/migrate-primeng-config.ts"],"names":[],"mappings":"AAMA,OAAO,EAAsC,MAAM,EAAc,MAAM,sBAAsB,CAAC;AA+C9F,qBAAa,6BAA8B,SAAQ,MAAM;IACrD,QAAQ,CAAC,IAAI,2DAA2D;IACxE,QAAQ,CAAC,WAAW,0CAA0C;IAC9D,QAAQ,CAAC,WAAW,SACmH;IAEjI,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAWxC"}
|
|
@@ -19,64 +19,6 @@ const rewrite_1 = require("@openrewrite/rewrite");
|
|
|
19
19
|
const javascript_1 = require("@openrewrite/rewrite/javascript");
|
|
20
20
|
const java_1 = require("@openrewrite/rewrite/java");
|
|
21
21
|
const CONFIG_NAMES = new Set(['PrimeNGConfig', 'PrimeNG']);
|
|
22
|
-
class RenamePrimeNGConfigIdentifiers extends rewrite_1.Recipe {
|
|
23
|
-
constructor() {
|
|
24
|
-
super(...arguments);
|
|
25
|
-
this.name = "org.openrewrite.primeng.MigratePrimeNgConfigToPrimeNG.identifiers";
|
|
26
|
-
this.displayName = "Rename `PrimeNGConfig` identifiers to `PrimeNG`";
|
|
27
|
-
this.description = "Renames `PrimeNGConfig` identifier usages in files importing it from `primeng/api`.";
|
|
28
|
-
}
|
|
29
|
-
editor() {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
return new class extends javascript_1.JavaScriptVisitor {
|
|
32
|
-
constructor() {
|
|
33
|
-
super(...arguments);
|
|
34
|
-
this.hasImport = false;
|
|
35
|
-
}
|
|
36
|
-
visitImportDeclaration(jsImport, p) {
|
|
37
|
-
const _super = Object.create(null, {
|
|
38
|
-
visitImportDeclaration: { get: () => super.visitImportDeclaration }
|
|
39
|
-
});
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
var _a;
|
|
42
|
-
const imp = yield _super.visitImportDeclaration.call(this, jsImport, p);
|
|
43
|
-
if (!(imp === null || imp === void 0 ? void 0 : imp.moduleSpecifier))
|
|
44
|
-
return imp;
|
|
45
|
-
const moduleSpec = imp.moduleSpecifier.element;
|
|
46
|
-
if (moduleSpec.kind !== java_1.J.Kind.Literal)
|
|
47
|
-
return imp;
|
|
48
|
-
if (moduleSpec.value !== "primeng/api")
|
|
49
|
-
return imp;
|
|
50
|
-
const namedBindings = (_a = imp.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings;
|
|
51
|
-
if ((namedBindings === null || namedBindings === void 0 ? void 0 : namedBindings.kind) === javascript_1.JS.Kind.NamedImports) {
|
|
52
|
-
for (const specifier of namedBindings.elements.elements) {
|
|
53
|
-
const spec = specifier.element;
|
|
54
|
-
if ((0, java_1.isIdentifier)(spec.specifier) && spec.specifier.simpleName === 'PrimeNGConfig') {
|
|
55
|
-
this.hasImport = true;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return imp;
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
visitIdentifier(identifier, p) {
|
|
63
|
-
const _super = Object.create(null, {
|
|
64
|
-
visitIdentifier: { get: () => super.visitIdentifier }
|
|
65
|
-
});
|
|
66
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
const id = yield _super.visitIdentifier.call(this, identifier, p);
|
|
68
|
-
if (!id)
|
|
69
|
-
return id;
|
|
70
|
-
if (this.hasImport && id.simpleName === 'PrimeNGConfig') {
|
|
71
|
-
return (0, rewrite_1.produceAsync)(id, (draft) => __awaiter(this, void 0, void 0, function* () { draft.simpleName = 'PrimeNG'; }));
|
|
72
|
-
}
|
|
73
|
-
return id;
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
22
|
class FindPrimeNGConfigInjection extends rewrite_1.Recipe {
|
|
81
23
|
constructor() {
|
|
82
24
|
super(...arguments);
|
|
@@ -138,7 +80,6 @@ class MigratePrimeNgConfigToPrimeNG extends rewrite_1.Recipe {
|
|
|
138
80
|
recipeList() {
|
|
139
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
140
82
|
return [
|
|
141
|
-
new RenamePrimeNGConfigIdentifiers(),
|
|
142
83
|
new javascript_1.ChangeImport({
|
|
143
84
|
oldModule: "primeng/api",
|
|
144
85
|
oldMember: "PrimeNGConfig",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-primeng-config.js","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/migrate-primeng-config.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"migrate-primeng-config.js","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/migrate-primeng-config.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,kDAA8F;AAC9F,gEAAgF;AAChF,oDAA0D;AAE1D,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC;AAE3D,MAAM,0BAA2B,SAAQ,gBAAM;IAA/C;;QACa,SAAI,GAAG,sEAAsE,CAAC;QAC9E,gBAAW,GAAG,oDAAoD,CAAC;QACnE,gBAAW,GAAG,4FAA4F;YAC/G,sEAAsE,CAAC;IAmC/E,CAAC;IAjCS,MAAM;;YACR,OAAO,IAAI,KAAM,SAAQ,8BAAmC;gBACxC,qBAAqB,CAAC,MAA0B,EAAE,CAAmB;;;;;;wBACjF,MAAM,CAAC,GAAG,MAAM,OAAM,qBAAqB,YAAC,MAAM,EAAE,CAAC,CAAuB,CAAC;wBAC7E,IAAI,CAAC,CAAC;4BAAE,OAAO,CAAC,CAAC;wBAEjB,IAAI,IAAA,mBAAY,EAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;4BACzD,KAAK,MAAM,GAAG,IAAI,MAAA,MAAA,CAAC,CAAC,SAAS,0CAAE,QAAQ,mCAAI,EAAE,EAAE,CAAC;gCAC5C,IAAI,IAAA,mBAAY,EAAC,GAAG,CAAC,OAAO,CAAC,IAAI,YAAY,CAAC,GAAG,CAAE,GAAG,CAAC,OAAwB,CAAC,UAAU,CAAC,EAAE,CAAC;oCAC1F,OAAO,IAAA,2BAAiB,EAAC,CAAC,EACtB,KAAM,GAAG,CAAC,OAAwB,CAAC,UAAU,yBAAyB;wCACtE,sIAAsI,CAAC,CAAC;gCAChJ,CAAC;4BACL,CAAC;wBACL,CAAC;wBAED,OAAO,CAAC,CAAC;oBACb,CAAC;iBAAA;gBAEe,yBAAyB,CAAC,QAAgC,EAAE,CAAmB;;;;;wBAC3F,MAAM,CAAC,GAAG,MAAM,OAAM,yBAAyB,YAAC,QAAQ,EAAE,CAAC,CAA2B,CAAC;wBACvF,IAAI,CAAC,CAAC;4BAAE,OAAO,CAAC,CAAC;wBAEjB,IAAI,CAAC,CAAC,cAAc,IAAI,IAAA,mBAAY,EAAC,CAAC,CAAC,cAAc,CAAC,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,CAAC;4BACtG,OAAO,IAAA,2BAAiB,EAAC,CAAC,EACtB,KAAK,CAAC,CAAC,cAAc,CAAC,UAAU,+BAA+B;gCAC/D,sIAAsI,CAAC,CAAC;wBAChJ,CAAC;wBAED,OAAO,CAAC,CAAC;oBACb,CAAC;iBAAA;aACJ,CAAC;QACN,CAAC;KAAA;CACJ;AAED,MAAa,6BAA8B,SAAQ,gBAAM;IAAzD;;QACa,SAAI,GAAG,uDAAuD,CAAC;QAC/D,gBAAW,GAAG,sCAAsC,CAAC;QACrD,gBAAW,GAAG,4FAA4F;YAC/G,kIAAkI,CAAC;IAa3I,CAAC;IAXS,UAAU;;YACZ,OAAO;gBACH,IAAI,yBAAY,CAAC;oBACb,SAAS,EAAE,aAAa;oBACxB,SAAS,EAAE,eAAe;oBAC1B,SAAS,EAAE,gBAAgB;oBAC3B,SAAS,EAAE,SAAS;iBACvB,CAAC;gBACF,IAAI,0BAA0B,EAAE;aACnC,CAAC;QACN,CAAC;KAAA;CACJ;AAjBD,sEAiBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rename-calendar-to-datepicker.d.ts","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-calendar-to-datepicker.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"rename-calendar-to-datepicker.d.ts","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-calendar-to-datepicker.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAG5C,qBAAa,0BAA2B,SAAQ,MAAM;IAClD,QAAQ,CAAC,IAAI,wDAAwD;IACrE,QAAQ,CAAC,WAAW,uCAAuC;IAC3D,QAAQ,CAAC,WAAW,SAE8B;IAE5C,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAgBxC"}
|
|
@@ -17,70 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.RenameCalendarToDatePicker = void 0;
|
|
18
18
|
const rewrite_1 = require("@openrewrite/rewrite");
|
|
19
19
|
const javascript_1 = require("@openrewrite/rewrite/javascript");
|
|
20
|
-
const java_1 = require("@openrewrite/rewrite/java");
|
|
21
|
-
const RENAMES = {
|
|
22
|
-
Calendar: "DatePicker",
|
|
23
|
-
CalendarModule: "DatePickerModule",
|
|
24
|
-
};
|
|
25
|
-
class RenameCalendarIdentifiers extends rewrite_1.Recipe {
|
|
26
|
-
constructor() {
|
|
27
|
-
super(...arguments);
|
|
28
|
-
this.name = "org.openrewrite.primeng.RenameCalendarToDatePicker.identifiers";
|
|
29
|
-
this.displayName = "Rename `Calendar` identifiers to `DatePicker`";
|
|
30
|
-
this.description = "Renames `Calendar` and `CalendarModule` identifier usages in files importing them from `primeng/calendar`.";
|
|
31
|
-
}
|
|
32
|
-
editor() {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
return new class extends javascript_1.JavaScriptVisitor {
|
|
35
|
-
constructor() {
|
|
36
|
-
super(...arguments);
|
|
37
|
-
this.importedNames = new Set();
|
|
38
|
-
}
|
|
39
|
-
visitImportDeclaration(jsImport, p) {
|
|
40
|
-
const _super = Object.create(null, {
|
|
41
|
-
visitImportDeclaration: { get: () => super.visitImportDeclaration }
|
|
42
|
-
});
|
|
43
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
var _a;
|
|
45
|
-
const imp = yield _super.visitImportDeclaration.call(this, jsImport, p);
|
|
46
|
-
if (!(imp === null || imp === void 0 ? void 0 : imp.moduleSpecifier))
|
|
47
|
-
return imp;
|
|
48
|
-
const moduleSpec = imp.moduleSpecifier.element;
|
|
49
|
-
if (moduleSpec.kind !== java_1.J.Kind.Literal)
|
|
50
|
-
return imp;
|
|
51
|
-
if (moduleSpec.value !== "primeng/calendar")
|
|
52
|
-
return imp;
|
|
53
|
-
const namedBindings = (_a = imp.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings;
|
|
54
|
-
if ((namedBindings === null || namedBindings === void 0 ? void 0 : namedBindings.kind) === javascript_1.JS.Kind.NamedImports) {
|
|
55
|
-
for (const specifier of namedBindings.elements.elements) {
|
|
56
|
-
const spec = specifier.element;
|
|
57
|
-
if ((0, java_1.isIdentifier)(spec.specifier) && RENAMES[spec.specifier.simpleName]) {
|
|
58
|
-
this.importedNames.add(spec.specifier.simpleName);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return imp;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
visitIdentifier(identifier, p) {
|
|
66
|
-
const _super = Object.create(null, {
|
|
67
|
-
visitIdentifier: { get: () => super.visitIdentifier }
|
|
68
|
-
});
|
|
69
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
const id = yield _super.visitIdentifier.call(this, identifier, p);
|
|
71
|
-
if (!id)
|
|
72
|
-
return id;
|
|
73
|
-
if (this.importedNames.has(id.simpleName) && RENAMES[id.simpleName]) {
|
|
74
|
-
const newName = RENAMES[id.simpleName];
|
|
75
|
-
return (0, rewrite_1.produceAsync)(id, (draft) => __awaiter(this, void 0, void 0, function* () { draft.simpleName = newName; }));
|
|
76
|
-
}
|
|
77
|
-
return id;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
20
|
class RenameCalendarToDatePicker extends rewrite_1.Recipe {
|
|
85
21
|
constructor() {
|
|
86
22
|
super(...arguments);
|
|
@@ -93,7 +29,6 @@ class RenameCalendarToDatePicker extends rewrite_1.Recipe {
|
|
|
93
29
|
recipeList() {
|
|
94
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
31
|
return [
|
|
96
|
-
new RenameCalendarIdentifiers(),
|
|
97
32
|
new javascript_1.ChangeImport({
|
|
98
33
|
oldModule: "primeng/calendar",
|
|
99
34
|
oldMember: "CalendarModule",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rename-calendar-to-datepicker.js","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-calendar-to-datepicker.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"rename-calendar-to-datepicker.js","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-calendar-to-datepicker.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,kDAA4C;AAC5C,gEAA6D;AAE7D,MAAa,0BAA2B,SAAQ,gBAAM;IAAtD;;QACa,SAAI,GAAG,oDAAoD,CAAC;QAC5D,gBAAW,GAAG,mCAAmC,CAAC;QAClD,gBAAW,GAAG,0EAA0E;YAC7F,uGAAuG;YACvG,6CAA6C,CAAC;IAkBtD,CAAC;IAhBS,UAAU;;YACZ,OAAO;gBACH,IAAI,yBAAY,CAAC;oBACb,SAAS,EAAE,kBAAkB;oBAC7B,SAAS,EAAE,gBAAgB;oBAC3B,SAAS,EAAE,oBAAoB;oBAC/B,SAAS,EAAE,kBAAkB;iBAChC,CAAC;gBACF,IAAI,yBAAY,CAAC;oBACb,SAAS,EAAE,kBAAkB;oBAC7B,SAAS,EAAE,UAAU;oBACrB,SAAS,EAAE,oBAAoB;oBAC/B,SAAS,EAAE,YAAY;iBAC1B,CAAC;aACL,CAAC;QACN,CAAC;KAAA;CACJ;AAvBD,gEAuBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rename-dropdown-to-select.d.ts","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-dropdown-to-select.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"rename-dropdown-to-select.d.ts","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-dropdown-to-select.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAG5C,qBAAa,sBAAuB,SAAQ,MAAM;IAC9C,QAAQ,CAAC,IAAI,oDAAoD;IACjE,QAAQ,CAAC,WAAW,mCAAmC;IACvD,QAAQ,CAAC,WAAW,SAE8B;IAE5C,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAgBxC"}
|
|
@@ -17,70 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.RenameDropdownToSelect = void 0;
|
|
18
18
|
const rewrite_1 = require("@openrewrite/rewrite");
|
|
19
19
|
const javascript_1 = require("@openrewrite/rewrite/javascript");
|
|
20
|
-
const java_1 = require("@openrewrite/rewrite/java");
|
|
21
|
-
const RENAMES = {
|
|
22
|
-
Dropdown: "Select",
|
|
23
|
-
DropdownModule: "SelectModule",
|
|
24
|
-
};
|
|
25
|
-
class RenameDropdownIdentifiers extends rewrite_1.Recipe {
|
|
26
|
-
constructor() {
|
|
27
|
-
super(...arguments);
|
|
28
|
-
this.name = "org.openrewrite.primeng.RenameDropdownToSelect.identifiers";
|
|
29
|
-
this.displayName = "Rename `Dropdown` identifiers to `Select`";
|
|
30
|
-
this.description = "Renames `Dropdown` and `DropdownModule` identifier usages in files importing them from `primeng/dropdown`.";
|
|
31
|
-
}
|
|
32
|
-
editor() {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
return new class extends javascript_1.JavaScriptVisitor {
|
|
35
|
-
constructor() {
|
|
36
|
-
super(...arguments);
|
|
37
|
-
this.importedNames = new Set();
|
|
38
|
-
}
|
|
39
|
-
visitImportDeclaration(jsImport, p) {
|
|
40
|
-
const _super = Object.create(null, {
|
|
41
|
-
visitImportDeclaration: { get: () => super.visitImportDeclaration }
|
|
42
|
-
});
|
|
43
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
var _a;
|
|
45
|
-
const imp = yield _super.visitImportDeclaration.call(this, jsImport, p);
|
|
46
|
-
if (!(imp === null || imp === void 0 ? void 0 : imp.moduleSpecifier))
|
|
47
|
-
return imp;
|
|
48
|
-
const moduleSpec = imp.moduleSpecifier.element;
|
|
49
|
-
if (moduleSpec.kind !== java_1.J.Kind.Literal)
|
|
50
|
-
return imp;
|
|
51
|
-
if (moduleSpec.value !== "primeng/dropdown")
|
|
52
|
-
return imp;
|
|
53
|
-
const namedBindings = (_a = imp.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings;
|
|
54
|
-
if ((namedBindings === null || namedBindings === void 0 ? void 0 : namedBindings.kind) === javascript_1.JS.Kind.NamedImports) {
|
|
55
|
-
for (const specifier of namedBindings.elements.elements) {
|
|
56
|
-
const spec = specifier.element;
|
|
57
|
-
if ((0, java_1.isIdentifier)(spec.specifier) && RENAMES[spec.specifier.simpleName]) {
|
|
58
|
-
this.importedNames.add(spec.specifier.simpleName);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return imp;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
visitIdentifier(identifier, p) {
|
|
66
|
-
const _super = Object.create(null, {
|
|
67
|
-
visitIdentifier: { get: () => super.visitIdentifier }
|
|
68
|
-
});
|
|
69
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
const id = yield _super.visitIdentifier.call(this, identifier, p);
|
|
71
|
-
if (!id)
|
|
72
|
-
return id;
|
|
73
|
-
if (this.importedNames.has(id.simpleName) && RENAMES[id.simpleName]) {
|
|
74
|
-
const newName = RENAMES[id.simpleName];
|
|
75
|
-
return (0, rewrite_1.produceAsync)(id, (draft) => __awaiter(this, void 0, void 0, function* () { draft.simpleName = newName; }));
|
|
76
|
-
}
|
|
77
|
-
return id;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
20
|
class RenameDropdownToSelect extends rewrite_1.Recipe {
|
|
85
21
|
constructor() {
|
|
86
22
|
super(...arguments);
|
|
@@ -93,7 +29,6 @@ class RenameDropdownToSelect extends rewrite_1.Recipe {
|
|
|
93
29
|
recipeList() {
|
|
94
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
31
|
return [
|
|
96
|
-
new RenameDropdownIdentifiers(),
|
|
97
32
|
new javascript_1.ChangeImport({
|
|
98
33
|
oldModule: "primeng/dropdown",
|
|
99
34
|
oldMember: "DropdownModule",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rename-dropdown-to-select.js","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-dropdown-to-select.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"rename-dropdown-to-select.js","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-dropdown-to-select.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,kDAA4C;AAC5C,gEAA6D;AAE7D,MAAa,sBAAuB,SAAQ,gBAAM;IAAlD;;QACa,SAAI,GAAG,gDAAgD,CAAC;QACxD,gBAAW,GAAG,+BAA+B,CAAC;QAC9C,gBAAW,GAAG,0EAA0E;YAC7F,2FAA2F;YAC3F,6CAA6C,CAAC;IAkBtD,CAAC;IAhBS,UAAU;;YACZ,OAAO;gBACH,IAAI,yBAAY,CAAC;oBACb,SAAS,EAAE,kBAAkB;oBAC7B,SAAS,EAAE,gBAAgB;oBAC3B,SAAS,EAAE,gBAAgB;oBAC3B,SAAS,EAAE,cAAc;iBAC5B,CAAC;gBACF,IAAI,yBAAY,CAAC;oBACb,SAAS,EAAE,kBAAkB;oBAC7B,SAAS,EAAE,UAAU;oBACrB,SAAS,EAAE,gBAAgB;oBAC3B,SAAS,EAAE,QAAQ;iBACtB,CAAC;aACL,CAAC;QACN,CAAC;KAAA;CACJ;AAvBD,wDAuBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rename-inputswitch-to-toggleswitch.d.ts","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-inputswitch-to-toggleswitch.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"rename-inputswitch-to-toggleswitch.d.ts","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-inputswitch-to-toggleswitch.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAG5C,qBAAa,+BAAgC,SAAQ,MAAM;IACvD,QAAQ,CAAC,IAAI,6DAA6D;IAC1E,QAAQ,CAAC,WAAW,4CAA4C;IAChE,QAAQ,CAAC,WAAW,SAE8B;IAE5C,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAgBxC"}
|
|
@@ -17,70 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.RenameInputSwitchToToggleSwitch = void 0;
|
|
18
18
|
const rewrite_1 = require("@openrewrite/rewrite");
|
|
19
19
|
const javascript_1 = require("@openrewrite/rewrite/javascript");
|
|
20
|
-
const java_1 = require("@openrewrite/rewrite/java");
|
|
21
|
-
const RENAMES = {
|
|
22
|
-
InputSwitch: "ToggleSwitch",
|
|
23
|
-
InputSwitchModule: "ToggleSwitchModule",
|
|
24
|
-
};
|
|
25
|
-
class RenameInputSwitchIdentifiers extends rewrite_1.Recipe {
|
|
26
|
-
constructor() {
|
|
27
|
-
super(...arguments);
|
|
28
|
-
this.name = "org.openrewrite.primeng.RenameInputSwitchToToggleSwitch.identifiers";
|
|
29
|
-
this.displayName = "Rename `InputSwitch` identifiers to `ToggleSwitch`";
|
|
30
|
-
this.description = "Renames `InputSwitch` and `InputSwitchModule` identifier usages in files importing them from `primeng/inputswitch`.";
|
|
31
|
-
}
|
|
32
|
-
editor() {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
return new class extends javascript_1.JavaScriptVisitor {
|
|
35
|
-
constructor() {
|
|
36
|
-
super(...arguments);
|
|
37
|
-
this.importedNames = new Set();
|
|
38
|
-
}
|
|
39
|
-
visitImportDeclaration(jsImport, p) {
|
|
40
|
-
const _super = Object.create(null, {
|
|
41
|
-
visitImportDeclaration: { get: () => super.visitImportDeclaration }
|
|
42
|
-
});
|
|
43
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
var _a;
|
|
45
|
-
const imp = yield _super.visitImportDeclaration.call(this, jsImport, p);
|
|
46
|
-
if (!(imp === null || imp === void 0 ? void 0 : imp.moduleSpecifier))
|
|
47
|
-
return imp;
|
|
48
|
-
const moduleSpec = imp.moduleSpecifier.element;
|
|
49
|
-
if (moduleSpec.kind !== java_1.J.Kind.Literal)
|
|
50
|
-
return imp;
|
|
51
|
-
if (moduleSpec.value !== "primeng/inputswitch")
|
|
52
|
-
return imp;
|
|
53
|
-
const namedBindings = (_a = imp.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings;
|
|
54
|
-
if ((namedBindings === null || namedBindings === void 0 ? void 0 : namedBindings.kind) === javascript_1.JS.Kind.NamedImports) {
|
|
55
|
-
for (const specifier of namedBindings.elements.elements) {
|
|
56
|
-
const spec = specifier.element;
|
|
57
|
-
if ((0, java_1.isIdentifier)(spec.specifier) && RENAMES[spec.specifier.simpleName]) {
|
|
58
|
-
this.importedNames.add(spec.specifier.simpleName);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return imp;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
visitIdentifier(identifier, p) {
|
|
66
|
-
const _super = Object.create(null, {
|
|
67
|
-
visitIdentifier: { get: () => super.visitIdentifier }
|
|
68
|
-
});
|
|
69
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
const id = yield _super.visitIdentifier.call(this, identifier, p);
|
|
71
|
-
if (!id)
|
|
72
|
-
return id;
|
|
73
|
-
if (this.importedNames.has(id.simpleName) && RENAMES[id.simpleName]) {
|
|
74
|
-
const newName = RENAMES[id.simpleName];
|
|
75
|
-
return (0, rewrite_1.produceAsync)(id, (draft) => __awaiter(this, void 0, void 0, function* () { draft.simpleName = newName; }));
|
|
76
|
-
}
|
|
77
|
-
return id;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
20
|
class RenameInputSwitchToToggleSwitch extends rewrite_1.Recipe {
|
|
85
21
|
constructor() {
|
|
86
22
|
super(...arguments);
|
|
@@ -93,7 +29,6 @@ class RenameInputSwitchToToggleSwitch extends rewrite_1.Recipe {
|
|
|
93
29
|
recipeList() {
|
|
94
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
31
|
return [
|
|
96
|
-
new RenameInputSwitchIdentifiers(),
|
|
97
32
|
new javascript_1.ChangeImport({
|
|
98
33
|
oldModule: "primeng/inputswitch",
|
|
99
34
|
oldMember: "InputSwitchModule",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rename-inputswitch-to-toggleswitch.js","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-inputswitch-to-toggleswitch.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"rename-inputswitch-to-toggleswitch.js","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-inputswitch-to-toggleswitch.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,kDAA4C;AAC5C,gEAA6D;AAE7D,MAAa,+BAAgC,SAAQ,gBAAM;IAA3D;;QACa,SAAI,GAAG,yDAAyD,CAAC;QACjE,gBAAW,GAAG,wCAAwC,CAAC;QACvD,gBAAW,GAAG,mFAAmF;YACtG,6GAA6G;YAC7G,6CAA6C,CAAC;IAkBtD,CAAC;IAhBS,UAAU;;YACZ,OAAO;gBACH,IAAI,yBAAY,CAAC;oBACb,SAAS,EAAE,qBAAqB;oBAChC,SAAS,EAAE,mBAAmB;oBAC9B,SAAS,EAAE,sBAAsB;oBACjC,SAAS,EAAE,oBAAoB;iBAClC,CAAC;gBACF,IAAI,yBAAY,CAAC;oBACb,SAAS,EAAE,qBAAqB;oBAChC,SAAS,EAAE,aAAa;oBACxB,SAAS,EAAE,sBAAsB;oBACjC,SAAS,EAAE,cAAc;iBAC5B,CAAC;aACL,CAAC;QACN,CAAC;KAAA;CACJ;AAvBD,0EAuBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rename-overlaypanel-to-popover.d.ts","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-overlaypanel-to-popover.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"rename-overlaypanel-to-popover.d.ts","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-overlaypanel-to-popover.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAG5C,qBAAa,2BAA4B,SAAQ,MAAM;IACnD,QAAQ,CAAC,IAAI,yDAAyD;IACtE,QAAQ,CAAC,WAAW,wCAAwC;IAC5D,QAAQ,CAAC,WAAW,SAE8B;IAE5C,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAgBxC"}
|
|
@@ -17,70 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.RenameOverlayPanelToPopover = void 0;
|
|
18
18
|
const rewrite_1 = require("@openrewrite/rewrite");
|
|
19
19
|
const javascript_1 = require("@openrewrite/rewrite/javascript");
|
|
20
|
-
const java_1 = require("@openrewrite/rewrite/java");
|
|
21
|
-
const RENAMES = {
|
|
22
|
-
OverlayPanel: "Popover",
|
|
23
|
-
OverlayPanelModule: "PopoverModule",
|
|
24
|
-
};
|
|
25
|
-
class RenameOverlayPanelIdentifiers extends rewrite_1.Recipe {
|
|
26
|
-
constructor() {
|
|
27
|
-
super(...arguments);
|
|
28
|
-
this.name = "org.openrewrite.primeng.RenameOverlayPanelToPopover.identifiers";
|
|
29
|
-
this.displayName = "Rename `OverlayPanel` identifiers to `Popover`";
|
|
30
|
-
this.description = "Renames `OverlayPanel` and `OverlayPanelModule` identifier usages in files importing them from `primeng/overlaypanel`.";
|
|
31
|
-
}
|
|
32
|
-
editor() {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
return new class extends javascript_1.JavaScriptVisitor {
|
|
35
|
-
constructor() {
|
|
36
|
-
super(...arguments);
|
|
37
|
-
this.importedNames = new Set();
|
|
38
|
-
}
|
|
39
|
-
visitImportDeclaration(jsImport, p) {
|
|
40
|
-
const _super = Object.create(null, {
|
|
41
|
-
visitImportDeclaration: { get: () => super.visitImportDeclaration }
|
|
42
|
-
});
|
|
43
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
var _a;
|
|
45
|
-
const imp = yield _super.visitImportDeclaration.call(this, jsImport, p);
|
|
46
|
-
if (!(imp === null || imp === void 0 ? void 0 : imp.moduleSpecifier))
|
|
47
|
-
return imp;
|
|
48
|
-
const moduleSpec = imp.moduleSpecifier.element;
|
|
49
|
-
if (moduleSpec.kind !== java_1.J.Kind.Literal)
|
|
50
|
-
return imp;
|
|
51
|
-
if (moduleSpec.value !== "primeng/overlaypanel")
|
|
52
|
-
return imp;
|
|
53
|
-
const namedBindings = (_a = imp.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings;
|
|
54
|
-
if ((namedBindings === null || namedBindings === void 0 ? void 0 : namedBindings.kind) === javascript_1.JS.Kind.NamedImports) {
|
|
55
|
-
for (const specifier of namedBindings.elements.elements) {
|
|
56
|
-
const spec = specifier.element;
|
|
57
|
-
if ((0, java_1.isIdentifier)(spec.specifier) && RENAMES[spec.specifier.simpleName]) {
|
|
58
|
-
this.importedNames.add(spec.specifier.simpleName);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return imp;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
visitIdentifier(identifier, p) {
|
|
66
|
-
const _super = Object.create(null, {
|
|
67
|
-
visitIdentifier: { get: () => super.visitIdentifier }
|
|
68
|
-
});
|
|
69
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
const id = yield _super.visitIdentifier.call(this, identifier, p);
|
|
71
|
-
if (!id)
|
|
72
|
-
return id;
|
|
73
|
-
if (this.importedNames.has(id.simpleName) && RENAMES[id.simpleName]) {
|
|
74
|
-
const newName = RENAMES[id.simpleName];
|
|
75
|
-
return (0, rewrite_1.produceAsync)(id, (draft) => __awaiter(this, void 0, void 0, function* () { draft.simpleName = newName; }));
|
|
76
|
-
}
|
|
77
|
-
return id;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
20
|
class RenameOverlayPanelToPopover extends rewrite_1.Recipe {
|
|
85
21
|
constructor() {
|
|
86
22
|
super(...arguments);
|
|
@@ -93,7 +29,6 @@ class RenameOverlayPanelToPopover extends rewrite_1.Recipe {
|
|
|
93
29
|
recipeList() {
|
|
94
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
31
|
return [
|
|
96
|
-
new RenameOverlayPanelIdentifiers(),
|
|
97
32
|
new javascript_1.ChangeImport({
|
|
98
33
|
oldModule: "primeng/overlaypanel",
|
|
99
34
|
oldMember: "OverlayPanelModule",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rename-overlaypanel-to-popover.js","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-overlaypanel-to-popover.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"rename-overlaypanel-to-popover.js","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-overlaypanel-to-popover.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,kDAA4C;AAC5C,gEAA6D;AAE7D,MAAa,2BAA4B,SAAQ,gBAAM;IAAvD;;QACa,SAAI,GAAG,qDAAqD,CAAC;QAC7D,gBAAW,GAAG,oCAAoC,CAAC;QACnD,gBAAW,GAAG,sFAAsF;YACzG,8FAA8F;YAC9F,6CAA6C,CAAC;IAkBtD,CAAC;IAhBS,UAAU;;YACZ,OAAO;gBACH,IAAI,yBAAY,CAAC;oBACb,SAAS,EAAE,sBAAsB;oBACjC,SAAS,EAAE,oBAAoB;oBAC/B,SAAS,EAAE,iBAAiB;oBAC5B,SAAS,EAAE,eAAe;iBAC7B,CAAC;gBACF,IAAI,yBAAY,CAAC;oBACb,SAAS,EAAE,sBAAsB;oBACjC,SAAS,EAAE,cAAc;oBACzB,SAAS,EAAE,iBAAiB;oBAC5B,SAAS,EAAE,SAAS;iBACvB,CAAC;aACL,CAAC;QACN,CAAC;KAAA;CACJ;AAvBD,kEAuBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rename-sidebar-to-drawer.d.ts","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-sidebar-to-drawer.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"rename-sidebar-to-drawer.d.ts","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-sidebar-to-drawer.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAG5C,qBAAa,qBAAsB,SAAQ,MAAM;IAC7C,QAAQ,CAAC,IAAI,mDAAmD;IAChE,QAAQ,CAAC,WAAW,kCAAkC;IACtD,QAAQ,CAAC,WAAW,SAE8B;IAE5C,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAgBxC"}
|
|
@@ -17,70 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.RenameSidebarToDrawer = void 0;
|
|
18
18
|
const rewrite_1 = require("@openrewrite/rewrite");
|
|
19
19
|
const javascript_1 = require("@openrewrite/rewrite/javascript");
|
|
20
|
-
const java_1 = require("@openrewrite/rewrite/java");
|
|
21
|
-
const RENAMES = {
|
|
22
|
-
Sidebar: "Drawer",
|
|
23
|
-
SidebarModule: "DrawerModule",
|
|
24
|
-
};
|
|
25
|
-
class RenameSidebarIdentifiers extends rewrite_1.Recipe {
|
|
26
|
-
constructor() {
|
|
27
|
-
super(...arguments);
|
|
28
|
-
this.name = "org.openrewrite.primeng.RenameSidebarToDrawer.identifiers";
|
|
29
|
-
this.displayName = "Rename `Sidebar` identifiers to `Drawer`";
|
|
30
|
-
this.description = "Renames `Sidebar` and `SidebarModule` identifier usages in files importing them from `primeng/sidebar`.";
|
|
31
|
-
}
|
|
32
|
-
editor() {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
return new class extends javascript_1.JavaScriptVisitor {
|
|
35
|
-
constructor() {
|
|
36
|
-
super(...arguments);
|
|
37
|
-
this.importedNames = new Set();
|
|
38
|
-
}
|
|
39
|
-
visitImportDeclaration(jsImport, p) {
|
|
40
|
-
const _super = Object.create(null, {
|
|
41
|
-
visitImportDeclaration: { get: () => super.visitImportDeclaration }
|
|
42
|
-
});
|
|
43
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
var _a;
|
|
45
|
-
const imp = yield _super.visitImportDeclaration.call(this, jsImport, p);
|
|
46
|
-
if (!(imp === null || imp === void 0 ? void 0 : imp.moduleSpecifier))
|
|
47
|
-
return imp;
|
|
48
|
-
const moduleSpec = imp.moduleSpecifier.element;
|
|
49
|
-
if (moduleSpec.kind !== java_1.J.Kind.Literal)
|
|
50
|
-
return imp;
|
|
51
|
-
if (moduleSpec.value !== "primeng/sidebar")
|
|
52
|
-
return imp;
|
|
53
|
-
const namedBindings = (_a = imp.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings;
|
|
54
|
-
if ((namedBindings === null || namedBindings === void 0 ? void 0 : namedBindings.kind) === javascript_1.JS.Kind.NamedImports) {
|
|
55
|
-
for (const specifier of namedBindings.elements.elements) {
|
|
56
|
-
const spec = specifier.element;
|
|
57
|
-
if ((0, java_1.isIdentifier)(spec.specifier) && RENAMES[spec.specifier.simpleName]) {
|
|
58
|
-
this.importedNames.add(spec.specifier.simpleName);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return imp;
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
visitIdentifier(identifier, p) {
|
|
66
|
-
const _super = Object.create(null, {
|
|
67
|
-
visitIdentifier: { get: () => super.visitIdentifier }
|
|
68
|
-
});
|
|
69
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
const id = yield _super.visitIdentifier.call(this, identifier, p);
|
|
71
|
-
if (!id)
|
|
72
|
-
return id;
|
|
73
|
-
if (this.importedNames.has(id.simpleName) && RENAMES[id.simpleName]) {
|
|
74
|
-
const newName = RENAMES[id.simpleName];
|
|
75
|
-
return (0, rewrite_1.produceAsync)(id, (draft) => __awaiter(this, void 0, void 0, function* () { draft.simpleName = newName; }));
|
|
76
|
-
}
|
|
77
|
-
return id;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
20
|
class RenameSidebarToDrawer extends rewrite_1.Recipe {
|
|
85
21
|
constructor() {
|
|
86
22
|
super(...arguments);
|
|
@@ -93,7 +29,6 @@ class RenameSidebarToDrawer extends rewrite_1.Recipe {
|
|
|
93
29
|
recipeList() {
|
|
94
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
31
|
return [
|
|
96
|
-
new RenameSidebarIdentifiers(),
|
|
97
32
|
new javascript_1.ChangeImport({
|
|
98
33
|
oldModule: "primeng/sidebar",
|
|
99
34
|
oldMember: "SidebarModule",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rename-sidebar-to-drawer.js","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-sidebar-to-drawer.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"rename-sidebar-to-drawer.js","sourceRoot":"","sources":["../../../../src/libraries/primeng/18/rename-sidebar-to-drawer.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;AAEH,kDAA4C;AAC5C,gEAA6D;AAE7D,MAAa,qBAAsB,SAAQ,gBAAM;IAAjD;;QACa,SAAI,GAAG,+CAA+C,CAAC;QACvD,gBAAW,GAAG,8BAA8B,CAAC;QAC7C,gBAAW,GAAG,uEAAuE;YAC1F,2FAA2F;YAC3F,6CAA6C,CAAC;IAkBtD,CAAC;IAhBS,UAAU;;YACZ,OAAO;gBACH,IAAI,yBAAY,CAAC;oBACb,SAAS,EAAE,iBAAiB;oBAC5B,SAAS,EAAE,eAAe;oBAC1B,SAAS,EAAE,gBAAgB;oBAC3B,SAAS,EAAE,cAAc;iBAC5B,CAAC;gBACF,IAAI,yBAAY,CAAC;oBACb,SAAS,EAAE,iBAAiB;oBAC5B,SAAS,EAAE,SAAS;oBACpB,SAAS,EAAE,gBAAgB;oBAC3B,SAAS,EAAE,QAAQ;iBACtB,CAAC;aACL,CAAC;QACN,CAAC;KAAA;CACJ;AAvBD,sDAuBC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Recipe } from "@openrewrite/rewrite";
|
|
2
2
|
export declare class RenameAfterRender extends Recipe {
|
|
3
3
|
readonly name = "org.openrewrite.angular.migration.rename-after-render";
|
|
4
4
|
readonly displayName: string;
|
|
5
5
|
readonly description: string;
|
|
6
|
-
|
|
6
|
+
recipeList(): Promise<Recipe[]>;
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=rename-after-render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rename-after-render.d.ts","sourceRoot":"","sources":["../../src/migration/rename-after-render.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"rename-after-render.d.ts","sourceRoot":"","sources":["../../src/migration/rename-after-render.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAG5C,qBAAa,iBAAkB,SAAQ,MAAM;IACzC,QAAQ,CAAC,IAAI,2DAA2D;IACxE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAgD;IAC5E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAiN;IAEvO,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAUxC"}
|