@openrewrite/rewrite 8.91.2 → 8.91.3
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/execution.d.ts +8 -0
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +31 -0
- package/dist/execution.js.map +1 -1
- package/dist/javascript/add-import.d.ts +64 -9
- package/dist/javascript/add-import.d.ts.map +1 -1
- package/dist/javascript/add-import.js +398 -71
- package/dist/javascript/add-import.js.map +1 -1
- package/dist/javascript/amd.d.ts +11 -1
- package/dist/javascript/amd.d.ts.map +1 -1
- package/dist/javascript/amd.js +43 -9
- package/dist/javascript/amd.js.map +1 -1
- package/dist/javascript/binding.d.ts +10 -2
- package/dist/javascript/binding.d.ts.map +1 -1
- package/dist/javascript/binding.js +44 -71
- package/dist/javascript/binding.js.map +1 -1
- package/dist/javascript/comparator.d.ts +2 -0
- package/dist/javascript/comparator.d.ts.map +1 -1
- package/dist/javascript/comparator.js +5 -1
- package/dist/javascript/comparator.js.map +1 -1
- package/dist/javascript/format/format.d.ts +5 -2
- package/dist/javascript/format/format.d.ts.map +1 -1
- package/dist/javascript/format/format.js +51 -11
- package/dist/javascript/format/format.js.map +1 -1
- package/dist/javascript/format/minimum-viable-spacing-visitor.d.ts +19 -0
- package/dist/javascript/format/minimum-viable-spacing-visitor.d.ts.map +1 -1
- package/dist/javascript/format/minimum-viable-spacing-visitor.js +180 -7
- package/dist/javascript/format/minimum-viable-spacing-visitor.js.map +1 -1
- package/dist/javascript/format/prettier-format.d.ts +2 -1
- package/dist/javascript/format/prettier-format.d.ts.map +1 -1
- package/dist/javascript/format/prettier-format.js +33 -23
- package/dist/javascript/format/prettier-format.js.map +1 -1
- package/dist/javascript/index.d.ts +3 -3
- package/dist/javascript/index.d.ts.map +1 -1
- package/dist/javascript/index.js +21 -1
- package/dist/javascript/index.js.map +1 -1
- package/dist/javascript/parser-utils.d.ts.map +1 -1
- package/dist/javascript/parser-utils.js +5 -9
- package/dist/javascript/parser-utils.js.map +1 -1
- package/dist/javascript/parser.d.ts.map +1 -1
- package/dist/javascript/parser.js +48 -3
- package/dist/javascript/parser.js.map +1 -1
- package/dist/javascript/print.d.ts +1 -0
- package/dist/javascript/print.d.ts.map +1 -1
- package/dist/javascript/print.js +9 -0
- package/dist/javascript/print.js.map +1 -1
- package/dist/javascript/recipes/change-import.d.ts +6 -3
- package/dist/javascript/recipes/change-import.d.ts.map +1 -1
- package/dist/javascript/recipes/change-import.js +17 -277
- package/dist/javascript/recipes/change-import.js.map +1 -1
- package/dist/javascript/rpc.js +2 -0
- package/dist/javascript/rpc.js.map +1 -1
- package/dist/javascript/scope.d.ts +40 -7
- package/dist/javascript/scope.d.ts.map +1 -1
- package/dist/javascript/scope.js +182 -30
- package/dist/javascript/scope.js.map +1 -1
- package/dist/javascript/templating/bindings.js +2 -20
- package/dist/javascript/templating/bindings.js.map +1 -1
- package/dist/javascript/templating/comparator.d.ts +2 -0
- package/dist/javascript/templating/comparator.d.ts.map +1 -1
- package/dist/javascript/templating/comparator.js +25 -0
- package/dist/javascript/templating/comparator.js.map +1 -1
- package/dist/javascript/templating/engine.d.ts +5 -0
- package/dist/javascript/templating/engine.d.ts.map +1 -1
- package/dist/javascript/templating/engine.js +30 -12
- package/dist/javascript/templating/engine.js.map +1 -1
- package/dist/javascript/templating/template.d.ts.map +1 -1
- package/dist/javascript/templating/template.js +6 -0
- package/dist/javascript/templating/template.js.map +1 -1
- package/dist/javascript/templating/types.d.ts +5 -0
- package/dist/javascript/templating/types.d.ts.map +1 -1
- package/dist/javascript/tree.d.ts +1 -0
- package/dist/javascript/tree.d.ts.map +1 -1
- package/dist/javascript/tree.js.map +1 -1
- package/dist/javascript/type-mapping.d.ts.map +1 -1
- package/dist/javascript/type-mapping.js +14 -0
- package/dist/javascript/type-mapping.js.map +1 -1
- package/dist/javascript/visitor.d.ts.map +1 -1
- package/dist/javascript/visitor.js +1 -0
- package/dist/javascript/visitor.js.map +1 -1
- package/dist/parser.d.ts +6 -0
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +23 -1
- package/dist/parser.js.map +1 -1
- package/dist/print.d.ts.map +1 -1
- package/dist/print.js +5 -2
- package/dist/print.js.map +1 -1
- package/dist/rewrite-javascript-version.txt +1 -1
- package/dist/rpc/request/parse-project.d.ts +11 -1
- package/dist/rpc/request/parse-project.d.ts.map +1 -1
- package/dist/rpc/request/parse-project.js +7 -2
- package/dist/rpc/request/parse-project.js.map +1 -1
- package/dist/rpc/request/parse.d.ts +13 -1
- package/dist/rpc/request/parse.d.ts.map +1 -1
- package/dist/rpc/request/parse.js +8 -2
- package/dist/rpc/request/parse.js.map +1 -1
- package/package.json +1 -1
- package/src/execution.ts +23 -0
- package/src/javascript/add-import.ts +449 -78
- package/src/javascript/amd.ts +49 -10
- package/src/javascript/binding.ts +60 -74
- package/src/javascript/comparator.ts +6 -1
- package/src/javascript/format/format.ts +56 -12
- package/src/javascript/format/minimum-viable-spacing-visitor.ts +196 -7
- package/src/javascript/format/prettier-format.ts +35 -25
- package/src/javascript/index.ts +10 -3
- package/src/javascript/parser-utils.ts +5 -11
- package/src/javascript/parser.ts +65 -6
- package/src/javascript/print.ts +10 -0
- package/src/javascript/recipes/change-import.ts +19 -349
- package/src/javascript/rpc.ts +2 -0
- package/src/javascript/scope.ts +210 -31
- package/src/javascript/templating/bindings.ts +2 -25
- package/src/javascript/templating/comparator.ts +29 -2
- package/src/javascript/templating/engine.ts +41 -14
- package/src/javascript/templating/template.ts +6 -0
- package/src/javascript/templating/types.ts +6 -0
- package/src/javascript/tree.ts +1 -0
- package/src/javascript/type-mapping.ts +15 -0
- package/src/javascript/visitor.ts +1 -0
- package/src/parser.ts +24 -1
- package/src/print.ts +5 -2
- package/src/rpc/request/parse-project.ts +6 -2
- package/src/rpc/request/parse.ts +7 -2
|
@@ -25,8 +25,6 @@ exports.ChangeImport = void 0;
|
|
|
25
25
|
const recipe_1 = require("../../recipe");
|
|
26
26
|
const index_1 = require("../index");
|
|
27
27
|
const binding_1 = require("../binding");
|
|
28
|
-
const java_1 = require("../../java");
|
|
29
|
-
const mutative_1 = require("mutative");
|
|
30
28
|
/**
|
|
31
29
|
* Changes an import from one module to another, updating all type attributions.
|
|
32
30
|
*
|
|
@@ -46,15 +44,16 @@ const mutative_1 = require("mutative");
|
|
|
46
44
|
* // After: import { act } from 'react';
|
|
47
45
|
*
|
|
48
46
|
* @example
|
|
49
|
-
* //
|
|
47
|
+
* // Rename a member, carrying the references that resolve to it
|
|
50
48
|
* const recipe = new ChangeImport({
|
|
51
49
|
* oldModule: "lodash",
|
|
52
50
|
* oldMember: "extend",
|
|
53
51
|
* newModule: "lodash",
|
|
54
52
|
* newMember: "assign"
|
|
55
53
|
* });
|
|
56
|
-
* // Before: import { extend } from 'lodash';
|
|
57
|
-
* // After: import { assign
|
|
54
|
+
* // Before: import { extend } from 'lodash'; extend({}, {});
|
|
55
|
+
* // After: import { assign } from 'lodash'; assign({}, {});
|
|
56
|
+
* // Adding `newAlias: "extend"` instead binds it as `import { assign as extend }`.
|
|
58
57
|
*/
|
|
59
58
|
class ChangeImport extends recipe_1.Recipe {
|
|
60
59
|
constructor(options) {
|
|
@@ -69,283 +68,15 @@ class ChangeImport extends recipe_1.Recipe {
|
|
|
69
68
|
const oldMember = this.oldMember;
|
|
70
69
|
const newModule = this.newModule;
|
|
71
70
|
const newMember = (_a = this.newMember) !== null && _a !== void 0 ? _a : oldMember;
|
|
72
|
-
|
|
73
|
-
const oldFqn = oldMember === 'default' || oldMember === '*'
|
|
74
|
-
? oldModule
|
|
75
|
-
: `${oldModule}.${oldMember}`;
|
|
76
|
-
const newFqn = newMember === 'default' || newMember === '*'
|
|
77
|
-
? newModule
|
|
78
|
-
: `${newModule}.${newMember}`;
|
|
71
|
+
const newAlias = this.newAlias;
|
|
79
72
|
return new class extends index_1.JavaScriptVisitor {
|
|
80
|
-
constructor() {
|
|
81
|
-
super(...arguments);
|
|
82
|
-
this.hasOldImport = false;
|
|
83
|
-
}
|
|
84
73
|
async visitJsCompilationUnit(cu, ctx) {
|
|
85
|
-
|
|
74
|
+
(0, binding_1.maybeRebind)(this, {
|
|
86
75
|
from: { module: oldModule, member: oldMember },
|
|
87
|
-
to: { module: newModule, member: newMember }
|
|
88
|
-
})
|
|
76
|
+
to: { module: newModule, member: newMember, alias: newAlias }
|
|
77
|
+
});
|
|
89
78
|
return super.visitJsCompilationUnit(cu, ctx);
|
|
90
79
|
}
|
|
91
|
-
async visitIdentifier(identifier, ctx) {
|
|
92
|
-
let ident = await super.visitIdentifier(identifier, ctx);
|
|
93
|
-
if (!this.hasOldImport) {
|
|
94
|
-
return ident;
|
|
95
|
-
}
|
|
96
|
-
// Check and update type attribution
|
|
97
|
-
let changed = false;
|
|
98
|
-
// Update type if it references the old module
|
|
99
|
-
const updatedType = this.updateType(ident.type);
|
|
100
|
-
if (updatedType !== ident.type) {
|
|
101
|
-
changed = true;
|
|
102
|
-
}
|
|
103
|
-
// Update fieldType if it references the old module
|
|
104
|
-
// fieldType is specifically Type.Variable, so we need to handle it specially
|
|
105
|
-
let updatedFieldType = ident.fieldType;
|
|
106
|
-
if (ident.fieldType) {
|
|
107
|
-
const updated = this.updateVariableType(ident.fieldType);
|
|
108
|
-
if (updated !== ident.fieldType) {
|
|
109
|
-
updatedFieldType = updated;
|
|
110
|
-
changed = true;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (changed) {
|
|
114
|
-
return (0, mutative_1.create)(ident, draft => {
|
|
115
|
-
if (updatedType !== ident.type) {
|
|
116
|
-
draft.type = updatedType;
|
|
117
|
-
}
|
|
118
|
-
if (updatedFieldType !== ident.fieldType) {
|
|
119
|
-
draft.fieldType = updatedFieldType;
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
return ident;
|
|
124
|
-
}
|
|
125
|
-
async visitMethodInvocation(method, ctx) {
|
|
126
|
-
let m = await super.visitMethodInvocation(method, ctx);
|
|
127
|
-
if (!this.hasOldImport) {
|
|
128
|
-
return m;
|
|
129
|
-
}
|
|
130
|
-
// Update methodType if it references the old module
|
|
131
|
-
const updatedMethodType = this.updateMethodType(m.methodType);
|
|
132
|
-
if (updatedMethodType !== m.methodType) {
|
|
133
|
-
return (0, mutative_1.create)(m, draft => {
|
|
134
|
-
draft.methodType = updatedMethodType;
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
return m;
|
|
138
|
-
}
|
|
139
|
-
async visitFieldAccess(fieldAccess, ctx) {
|
|
140
|
-
let fa = await super.visitFieldAccess(fieldAccess, ctx);
|
|
141
|
-
if (!this.hasOldImport) {
|
|
142
|
-
return fa;
|
|
143
|
-
}
|
|
144
|
-
// Update type if it references the old module
|
|
145
|
-
const updatedType = this.updateType(fa.type);
|
|
146
|
-
if (updatedType !== fa.type) {
|
|
147
|
-
return (0, mutative_1.create)(fa, draft => {
|
|
148
|
-
draft.type = updatedType;
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
return fa;
|
|
152
|
-
}
|
|
153
|
-
async visitFunctionCall(functionCall, ctx) {
|
|
154
|
-
let fc = await super.visitFunctionCall(functionCall, ctx);
|
|
155
|
-
if (!this.hasOldImport) {
|
|
156
|
-
return fc;
|
|
157
|
-
}
|
|
158
|
-
// Update methodType if it references the old module
|
|
159
|
-
const updatedMethodType = this.updateMethodType(fc.methodType);
|
|
160
|
-
if (updatedMethodType !== fc.methodType) {
|
|
161
|
-
return (0, mutative_1.create)(fc, draft => {
|
|
162
|
-
draft.methodType = updatedMethodType;
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
return fc;
|
|
166
|
-
}
|
|
167
|
-
async visitNewClass(newClass, ctx) {
|
|
168
|
-
let nc = await super.visitNewClass(newClass, ctx);
|
|
169
|
-
if (!this.hasOldImport) {
|
|
170
|
-
return nc;
|
|
171
|
-
}
|
|
172
|
-
let changed = false;
|
|
173
|
-
// Update methodType if it references the old module
|
|
174
|
-
const updatedMethodType = this.updateMethodType(nc.methodType);
|
|
175
|
-
if (updatedMethodType !== nc.methodType) {
|
|
176
|
-
changed = true;
|
|
177
|
-
}
|
|
178
|
-
// Update constructorType if it references the old module
|
|
179
|
-
const updatedConstructorType = this.updateMethodType(nc.constructorType);
|
|
180
|
-
if (updatedConstructorType !== nc.constructorType) {
|
|
181
|
-
changed = true;
|
|
182
|
-
}
|
|
183
|
-
// Update type if it references the old module
|
|
184
|
-
const updatedType = this.updateType(nc.type);
|
|
185
|
-
if (updatedType !== nc.type) {
|
|
186
|
-
changed = true;
|
|
187
|
-
}
|
|
188
|
-
if (changed) {
|
|
189
|
-
return (0, mutative_1.create)(nc, draft => {
|
|
190
|
-
if (updatedMethodType !== nc.methodType) {
|
|
191
|
-
draft.methodType = updatedMethodType;
|
|
192
|
-
}
|
|
193
|
-
if (updatedConstructorType !== nc.constructorType) {
|
|
194
|
-
draft.constructorType = updatedConstructorType;
|
|
195
|
-
}
|
|
196
|
-
if (updatedType !== nc.type) {
|
|
197
|
-
draft.type = updatedType;
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
return nc;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Update a type if it references the old module
|
|
205
|
-
*/
|
|
206
|
-
updateType(type) {
|
|
207
|
-
if (!type)
|
|
208
|
-
return type;
|
|
209
|
-
switch (type.kind) {
|
|
210
|
-
case java_1.Type.Kind.Class:
|
|
211
|
-
case java_1.Type.Kind.ShallowClass:
|
|
212
|
-
return this.updateClassType(type);
|
|
213
|
-
case java_1.Type.Kind.Method:
|
|
214
|
-
return this.updateMethodType(type);
|
|
215
|
-
case java_1.Type.Kind.Variable:
|
|
216
|
-
return this.updateVariableType(type);
|
|
217
|
-
case java_1.Type.Kind.Parameterized:
|
|
218
|
-
return this.updateParameterizedType(type);
|
|
219
|
-
case java_1.Type.Kind.Array:
|
|
220
|
-
return this.updateArrayType(type);
|
|
221
|
-
default:
|
|
222
|
-
return type;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Update a Class type if its FQN references the old module
|
|
227
|
-
*/
|
|
228
|
-
updateClassType(classType) {
|
|
229
|
-
let changed = false;
|
|
230
|
-
let newFullyQualifiedName = classType.fullyQualifiedName;
|
|
231
|
-
let newOwningClass = classType.owningClass;
|
|
232
|
-
// Check if the FQN matches or starts with the old module
|
|
233
|
-
if (classType.fullyQualifiedName === oldFqn) {
|
|
234
|
-
newFullyQualifiedName = newFqn;
|
|
235
|
-
changed = true;
|
|
236
|
-
}
|
|
237
|
-
else if (classType.fullyQualifiedName === oldModule) {
|
|
238
|
-
newFullyQualifiedName = newModule;
|
|
239
|
-
changed = true;
|
|
240
|
-
}
|
|
241
|
-
else if (classType.fullyQualifiedName.startsWith(oldModule + '.')) {
|
|
242
|
-
newFullyQualifiedName = newModule + classType.fullyQualifiedName.substring(oldModule.length);
|
|
243
|
-
changed = true;
|
|
244
|
-
}
|
|
245
|
-
// Recursively update owningClass
|
|
246
|
-
if (classType.owningClass) {
|
|
247
|
-
const updatedOwningClass = this.updateClassType(classType.owningClass);
|
|
248
|
-
if (updatedOwningClass !== classType.owningClass) {
|
|
249
|
-
newOwningClass = updatedOwningClass;
|
|
250
|
-
changed = true;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
if (changed) {
|
|
254
|
-
// Type objects are marked as non-draftable, so we manually create new objects
|
|
255
|
-
return Object.assign(Object.assign({}, classType), { fullyQualifiedName: newFullyQualifiedName, owningClass: newOwningClass });
|
|
256
|
-
}
|
|
257
|
-
return classType;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Update a Method type if its declaringType references the old module
|
|
261
|
-
*/
|
|
262
|
-
updateMethodType(methodType) {
|
|
263
|
-
if (!methodType)
|
|
264
|
-
return methodType;
|
|
265
|
-
// Update the declaring type
|
|
266
|
-
if (java_1.Type.isFullyQualified(methodType.declaringType)) {
|
|
267
|
-
const declaringTypeFqn = java_1.Type.FullyQualified.getFullyQualifiedName(methodType.declaringType);
|
|
268
|
-
if (declaringTypeFqn === oldModule ||
|
|
269
|
-
declaringTypeFqn === oldFqn ||
|
|
270
|
-
declaringTypeFqn.startsWith(oldModule + '.')) {
|
|
271
|
-
// Need to update the declaring type
|
|
272
|
-
const updatedDeclaringType = this.updateType(methodType.declaringType);
|
|
273
|
-
// Also update the method name if we're renaming the member
|
|
274
|
-
const updatedName = (oldMember !== 'default' && oldMember !== '*' &&
|
|
275
|
-
methodType.name === oldMember && newMember !== oldMember)
|
|
276
|
-
? newMember
|
|
277
|
-
: methodType.name;
|
|
278
|
-
// Type objects are marked as non-draftable, so we manually create new objects
|
|
279
|
-
return Object.assign(Object.assign({}, methodType), { declaringType: updatedDeclaringType, name: updatedName });
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
return methodType;
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Update a Variable type if its owner references the old module
|
|
286
|
-
*/
|
|
287
|
-
updateVariableType(variableType) {
|
|
288
|
-
let changed = false;
|
|
289
|
-
let newOwner = variableType.owner;
|
|
290
|
-
let newInnerType = variableType.type;
|
|
291
|
-
// Update owner if it references the old module
|
|
292
|
-
if (variableType.owner) {
|
|
293
|
-
const updatedOwner = this.updateType(variableType.owner);
|
|
294
|
-
if (updatedOwner !== variableType.owner) {
|
|
295
|
-
newOwner = updatedOwner;
|
|
296
|
-
changed = true;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
// Update inner type if it references the old module
|
|
300
|
-
const updatedInnerType = this.updateType(variableType.type);
|
|
301
|
-
if (updatedInnerType !== variableType.type) {
|
|
302
|
-
newInnerType = updatedInnerType;
|
|
303
|
-
changed = true;
|
|
304
|
-
}
|
|
305
|
-
if (changed) {
|
|
306
|
-
// Type objects are marked as non-draftable, so we manually create new objects
|
|
307
|
-
return Object.assign(Object.assign({}, variableType), { owner: newOwner, type: newInnerType });
|
|
308
|
-
}
|
|
309
|
-
return variableType;
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* Update a Parameterized type if its base type references the old module
|
|
313
|
-
*/
|
|
314
|
-
updateParameterizedType(paramType) {
|
|
315
|
-
let changed = false;
|
|
316
|
-
let newBaseType = paramType.type;
|
|
317
|
-
let newTypeParams = paramType.typeParameters;
|
|
318
|
-
// Update base type
|
|
319
|
-
if (java_1.Type.isFullyQualified(paramType.type)) {
|
|
320
|
-
const updatedType = this.updateType(paramType.type);
|
|
321
|
-
if (updatedType !== paramType.type) {
|
|
322
|
-
newBaseType = updatedType;
|
|
323
|
-
changed = true;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
// Update type parameters
|
|
327
|
-
const updatedParams = paramType.typeParameters.map(tp => this.updateType(tp));
|
|
328
|
-
if (updatedParams.some((p, i) => p !== paramType.typeParameters[i])) {
|
|
329
|
-
newTypeParams = updatedParams;
|
|
330
|
-
changed = true;
|
|
331
|
-
}
|
|
332
|
-
if (changed) {
|
|
333
|
-
// Type objects are marked as non-draftable, so we manually create new objects
|
|
334
|
-
return Object.assign(Object.assign({}, paramType), { type: newBaseType, typeParameters: newTypeParams });
|
|
335
|
-
}
|
|
336
|
-
return paramType;
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* Update an Array type if its element type references the old module
|
|
340
|
-
*/
|
|
341
|
-
updateArrayType(arrayType) {
|
|
342
|
-
const updatedElemType = this.updateType(arrayType.elemType);
|
|
343
|
-
if (updatedElemType !== arrayType.elemType) {
|
|
344
|
-
// Type objects are marked as non-draftable, so we manually create new objects
|
|
345
|
-
return Object.assign(Object.assign({}, arrayType), { elemType: updatedElemType });
|
|
346
|
-
}
|
|
347
|
-
return arrayType;
|
|
348
|
-
}
|
|
349
80
|
}();
|
|
350
81
|
}
|
|
351
82
|
}
|
|
@@ -379,4 +110,13 @@ __decorate([
|
|
|
379
110
|
required: false
|
|
380
111
|
})
|
|
381
112
|
], ChangeImport.prototype, "newMember", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
(0, recipe_1.Option)({
|
|
115
|
+
displayName: "New alias",
|
|
116
|
+
description: "The local name to bind the new member under. Defaults to the alias the import " +
|
|
117
|
+
"already had, or to the new member name where it had none.",
|
|
118
|
+
example: "act",
|
|
119
|
+
required: false
|
|
120
|
+
})
|
|
121
|
+
], ChangeImport.prototype, "newAlias", void 0);
|
|
382
122
|
//# sourceMappingURL=change-import.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-import.js","sourceRoot":"","sources":["../../../src/javascript/recipes/change-import.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;AAEH,yCAA8C;AAG9C,oCAAiD;AACjD,wCAAyC;
|
|
1
|
+
{"version":3,"file":"change-import.js","sourceRoot":"","sources":["../../../src/javascript/recipes/change-import.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;AAEH,yCAA8C;AAG9C,oCAAiD;AACjD,wCAAyC;AAGzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAa,YAAa,SAAQ,eAAM;IA2CpC,YAAY,OAMX;QACG,KAAK,CAAC,OAAO,CAAC,CAAC;QAjDV,SAAI,GAAG,0CAA0C,CAAC;QAClD,gBAAW,GAAG,eAAe,CAAC;QAC9B,gBAAW,GAAG,sFAAsF,CAAC;IAgD9G,CAAC;IAED,KAAK,CAAC,MAAM;;QACR,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,SAAS,mCAAI,SAAS,CAAC;QAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE/B,OAAO,IAAI,KAAM,SAAQ,yBAAmC;YAC/C,KAAK,CAAC,sBAAsB,CAAC,EAAsB,EAAE,GAAqB;gBAC/E,IAAA,qBAAW,EAAC,IAAI,EAAE;oBACd,IAAI,EAAE,EAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAC;oBAC5C,EAAE,EAAE,EAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAC;iBAC9D,CAAC,CAAC;gBACH,OAAO,KAAK,CAAC,sBAAsB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YACjD,CAAC;SACJ,EAAE,CAAC;IACR,CAAC;CACJ;AAtED,oCAsEC;AA5DG;IALC,IAAA,eAAM,EAAC;QACJ,WAAW,EAAE,YAAY;QACzB,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,sBAAsB;KAClC,CAAC;+CACiB;AAOnB;IALC,IAAA,eAAM,EAAC;QACJ,WAAW,EAAE,YAAY;QACzB,WAAW,EAAE,oFAAoF;QACjG,OAAO,EAAE,KAAK;KACjB,CAAC;+CACiB;AAOnB;IALC,IAAA,eAAM,EAAC;QACJ,WAAW,EAAE,YAAY;QACzB,WAAW,EAAE,iCAAiC;QAC9C,OAAO,EAAE,OAAO;KACnB,CAAC;+CACiB;AAQnB;IANC,IAAA,eAAM,EAAC;QACJ,WAAW,EAAE,YAAY;QACzB,WAAW,EAAE,oEAAoE;QACjF,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,KAAK;KAClB,CAAC;+CACiB;AASnB;IAPC,IAAA,eAAM,EAAC;QACJ,WAAW,EAAE,WAAW;QACxB,WAAW,EAAE,gFAAgF;YACzF,2DAA2D;QAC/D,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,KAAK;KAClB,CAAC;8CACgB"}
|
package/dist/javascript/rpc.js
CHANGED
|
@@ -196,6 +196,7 @@ class JavaScriptSender extends visitor_1.JavaScriptVisitor {
|
|
|
196
196
|
return objectBindingPattern;
|
|
197
197
|
}
|
|
198
198
|
async visitPropertyAssignment(propertyAssignment, q) {
|
|
199
|
+
await q.getAndSendList(propertyAssignment, el => el.modifiers, el => el.id, el => this.visit(el, q));
|
|
199
200
|
await q.getAndSend(propertyAssignment, el => el.name, el => this.visitRightPadded(el, q));
|
|
200
201
|
await q.getAndSend(propertyAssignment, el => el.assigmentToken);
|
|
201
202
|
await q.getAndSend(propertyAssignment, el => el.initializer, el => this.visit(el, q));
|
|
@@ -698,6 +699,7 @@ class JavaScriptReceiver extends visitor_1.JavaScriptVisitor {
|
|
|
698
699
|
}
|
|
699
700
|
async visitPropertyAssignment(propertyAssignment, q) {
|
|
700
701
|
const updates = {
|
|
702
|
+
modifiers: await q.receiveList(propertyAssignment.modifiers, el => this.visitDefined(el, q)),
|
|
701
703
|
name: await q.receive(propertyAssignment.name, el => this.visitRightPadded(el, q)),
|
|
702
704
|
assigmentToken: await q.receive(propertyAssignment.assigmentToken),
|
|
703
705
|
initializer: await q.receive(propertyAssignment.initializer, el => this.visitDefined(el, q))
|