@weapp-vite/miniprogram-automator 1.5.5 → 1.5.6-dev.20261119.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/index.mjs
CHANGED
|
@@ -1402,7 +1402,7 @@ var Connection = class Connection extends EventEmitter {
|
|
|
1402
1402
|
};
|
|
1403
1403
|
// src/headless.ts
|
|
1404
1404
|
async function launchHeadlessAutomator(options) {
|
|
1405
|
-
return await (await import("./launch-
|
|
1405
|
+
return await (await import("./launch-DwFRvd2s.mjs")).launch({ projectPath: options.projectPath });
|
|
1406
1406
|
}
|
|
1407
1407
|
// src/launcher/diagnostics.ts
|
|
1408
1408
|
/** 将本次 CLI 的有界输出附到原始错误,避免泄露登录票据及账号参数。 */
|
|
@@ -1658,7 +1658,7 @@ function spawnWechatCli(cliPath, args, cwd, scope) {
|
|
|
1658
1658
|
return Object.assign(state, { release });
|
|
1659
1659
|
}
|
|
1660
1660
|
// package.json
|
|
1661
|
-
var version = "1.5.
|
|
1661
|
+
var version = "1.5.6-dev.20261119.1";
|
|
1662
1662
|
// src/appServiceHeap.ts
|
|
1663
1663
|
function isRecord$1(value) {
|
|
1664
1664
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -199,6 +199,7 @@ function mergeRecord(...records) {
|
|
|
199
199
|
return Object.assign({}, ...records.filter(Boolean));
|
|
200
200
|
}
|
|
201
201
|
// ../../mpcore/packages/simulator/src/runtime/componentInstance/observers.ts
|
|
202
|
+
const observerRunStates = /* @__PURE__ */ new WeakMap();
|
|
202
203
|
function runPropertyObservers(definition, instance, changedKeys, previousProperties) {
|
|
203
204
|
const propOptions = definition.properties;
|
|
204
205
|
if (!propOptions || typeof propOptions !== "object" || Array.isArray(propOptions)) return;
|
|
@@ -244,7 +245,7 @@ function matchObserverPattern(pattern, changedKeys) {
|
|
|
244
245
|
});
|
|
245
246
|
});
|
|
246
247
|
}
|
|
247
|
-
function
|
|
248
|
+
function runComponentObserversOnce(definition, instance, changedKeys, previousProperties = {}, includePropertyObservers = true) {
|
|
248
249
|
if (changedKeys.length === 0) return;
|
|
249
250
|
const observers = definition.observers;
|
|
250
251
|
if (observers && typeof observers === "object" && !Array.isArray(observers)) for (const [pattern, handler] of Object.entries(observers)) {
|
|
@@ -252,7 +253,41 @@ function runComponentObservers(definition, instance, changedKeys, previousProper
|
|
|
252
253
|
const args = normalizeObserverPattern(pattern).map((item) => resolveObservedValue(instance, item));
|
|
253
254
|
handler.call(instance, ...args);
|
|
254
255
|
}
|
|
255
|
-
runPropertyObservers(definition, instance, changedKeys, previousProperties);
|
|
256
|
+
if (includePropertyObservers) runPropertyObservers(definition, instance, changedKeys, previousProperties);
|
|
257
|
+
}
|
|
258
|
+
function runComponentObservers(definition, instance, changedKeys, previousProperties = {}) {
|
|
259
|
+
if (changedKeys.length === 0) return;
|
|
260
|
+
const state = observerRunStates.get(instance) ?? {
|
|
261
|
+
running: false,
|
|
262
|
+
pending: []
|
|
263
|
+
};
|
|
264
|
+
observerRunStates.set(instance, state);
|
|
265
|
+
if (state.running) {
|
|
266
|
+
runPropertyObservers(definition, instance, changedKeys, previousProperties);
|
|
267
|
+
state.pending.push({
|
|
268
|
+
changedKeys: [...changedKeys],
|
|
269
|
+
previousProperties,
|
|
270
|
+
includePropertyObservers: false
|
|
271
|
+
});
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
state.pending.push({
|
|
275
|
+
changedKeys: [...changedKeys],
|
|
276
|
+
previousProperties,
|
|
277
|
+
includePropertyObservers: true
|
|
278
|
+
});
|
|
279
|
+
state.running = true;
|
|
280
|
+
try {
|
|
281
|
+
while (state.pending.length > 0) {
|
|
282
|
+
const next = state.pending.shift();
|
|
283
|
+
runComponentObserversOnce(definition, instance, next.changedKeys, next.previousProperties, next.includePropertyObservers);
|
|
284
|
+
}
|
|
285
|
+
} catch (error) {
|
|
286
|
+
state.pending.length = 0;
|
|
287
|
+
throw error;
|
|
288
|
+
} finally {
|
|
289
|
+
state.running = false;
|
|
290
|
+
}
|
|
256
291
|
}
|
|
257
292
|
// ../../mpcore/packages/simulator/src/runtime/componentInstance/lifetimes.ts
|
|
258
293
|
function mergeComponentLifetimes(behaviors, definition) {
|
|
@@ -294,27 +329,45 @@ function flattenBehaviors(definition) {
|
|
|
294
329
|
}
|
|
295
330
|
return flattened;
|
|
296
331
|
}
|
|
332
|
+
function applyBehaviorDefinitionFilters(definition, behaviors) {
|
|
333
|
+
if (!behaviors.some((behavior) => typeof behavior.definitionFilter === "function")) return definition;
|
|
334
|
+
const filteredDefinition = {
|
|
335
|
+
...definition,
|
|
336
|
+
...definition.observers && typeof definition.observers === "object" && !Array.isArray(definition.observers) ? { observers: { ...definition.observers } } : {}
|
|
337
|
+
};
|
|
338
|
+
for (const behavior of behaviors) if (typeof behavior.definitionFilter === "function") behavior.definitionFilter(filteredDefinition);
|
|
339
|
+
return filteredDefinition;
|
|
340
|
+
}
|
|
297
341
|
function resolveComponentPropertyDefinitions(definition, behaviors = flattenBehaviors(definition)) {
|
|
298
342
|
return behaviors.length === 0 ? definition.properties ?? {} : mergeRecord(...behaviors.map((item) => item.properties), definition.properties);
|
|
299
343
|
}
|
|
344
|
+
const RESERVED_COMPONENT_HOST_PROPERTIES = /* @__PURE__ */ new Set([
|
|
345
|
+
"id",
|
|
346
|
+
"class",
|
|
347
|
+
"slot"
|
|
348
|
+
]);
|
|
349
|
+
function isReservedComponentHostProperty(key) {
|
|
350
|
+
return RESERVED_COMPONENT_HOST_PROPERTIES.has(key);
|
|
351
|
+
}
|
|
300
352
|
function normalizeComponentDefinition(definition) {
|
|
301
353
|
const behaviors = flattenBehaviors(definition);
|
|
302
354
|
if (behaviors.length === 0) return definition;
|
|
355
|
+
const filteredDefinition = applyBehaviorDefinitionFilters(definition, behaviors);
|
|
303
356
|
const mergedDataEntries = behaviors.map((item) => item.data).filter(Boolean);
|
|
304
357
|
const mergedDefinition = {
|
|
305
|
-
...mergeRecord(...behaviors,
|
|
306
|
-
methods: mergeRecord(...behaviors.map((item) => item.methods),
|
|
307
|
-
observers: mergeRecord(...behaviors.map((item) => item.observers),
|
|
308
|
-
pageLifetimes: mergeRecord(...behaviors.map((item) => item.pageLifetimes),
|
|
309
|
-
properties: resolveComponentPropertyDefinitions(
|
|
310
|
-
relations: mergeRecord(...behaviors.map((item) => item.relations),
|
|
311
|
-
lifetimes: mergeComponentLifetimes(behaviors,
|
|
358
|
+
...mergeRecord(...behaviors, filteredDefinition),
|
|
359
|
+
methods: mergeRecord(...behaviors.map((item) => item.methods), filteredDefinition.methods),
|
|
360
|
+
observers: mergeRecord(...behaviors.map((item) => item.observers), filteredDefinition.observers),
|
|
361
|
+
pageLifetimes: mergeRecord(...behaviors.map((item) => item.pageLifetimes), filteredDefinition.pageLifetimes),
|
|
362
|
+
properties: resolveComponentPropertyDefinitions(filteredDefinition, behaviors),
|
|
363
|
+
relations: mergeRecord(...behaviors.map((item) => item.relations), filteredDefinition.relations),
|
|
364
|
+
lifetimes: mergeComponentLifetimes(behaviors, filteredDefinition)
|
|
312
365
|
};
|
|
313
|
-
if (mergedDataEntries.length > 0 ||
|
|
366
|
+
if (mergedDataEntries.length > 0 || filteredDefinition.data) mergedDefinition.data = function mergedComponentData() {
|
|
314
367
|
return mergeRecord(mergeRecord(...mergedDataEntries.map((entry) => {
|
|
315
368
|
if (typeof entry === "function") return entry.call(this);
|
|
316
369
|
return entry;
|
|
317
|
-
})), typeof
|
|
370
|
+
})), typeof filteredDefinition.data === "function" ? filteredDefinition.data.call(this) : filteredDefinition.data);
|
|
318
371
|
};
|
|
319
372
|
return mergedDefinition;
|
|
320
373
|
}
|
|
@@ -20926,7 +20979,7 @@ function resolveComponentProperties(clonedNode, scope, definition) {
|
|
|
20926
20979
|
const bindingExpressions = {};
|
|
20927
20980
|
const declaredProperties = resolveComponentPropertyDefinitions(definition);
|
|
20928
20981
|
for (const [key, value] of Object.entries(clonedNode.attribs ?? {})) {
|
|
20929
|
-
if (key.startsWith("bind") || key.startsWith("generic:")) continue;
|
|
20982
|
+
if (key.startsWith("bind") || key.startsWith("generic:") || key.startsWith("wx:") || isReservedComponentHostProperty(key)) continue;
|
|
20930
20983
|
const camelizedKey = key.replace(/-([a-z])/g, (_match, char) => char.toUpperCase());
|
|
20931
20984
|
const propertyKey = key in declaredProperties || !(camelizedKey in declaredProperties) ? key : camelizedKey;
|
|
20932
20985
|
if (isMustacheOnly$1(String(value))) bindingExpressions[propertyKey] = String(value).trim().slice(2, -2).trim();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-vite/miniprogram-automator",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.6-dev.20261119.1",
|
|
5
5
|
"description": "完全兼容微信 miniprogram-automator 的现代化替代实现",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -49,13 +49,14 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@types/ws": "^8.18.2",
|
|
52
|
-
"@weapp-vite/qr": "1.2.
|
|
52
|
+
"@weapp-vite/qr": "1.2.6-dev.20261119.1",
|
|
53
53
|
"obug": "^3.0.0",
|
|
54
54
|
"ws": "^8.23.0"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public",
|
|
58
|
-
"registry": "https://registry.npmjs.org"
|
|
58
|
+
"registry": "https://registry.npmjs.org/",
|
|
59
|
+
"tag": "snapshot-nightly"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
62
|
"sharp": "^0.35.5"
|
|
@@ -66,6 +67,13 @@
|
|
|
66
67
|
"moduleResolution": "NodeNext"
|
|
67
68
|
}
|
|
68
69
|
},
|
|
70
|
+
"repoctlSnapshot": {
|
|
71
|
+
"kind": "nightly",
|
|
72
|
+
"commit": "29a77f1e58e5686dbbfceefa78673afa59d2a1ef",
|
|
73
|
+
"buildId": "44450884003-1",
|
|
74
|
+
"identityKey": "0c330c88d6a9536155ce29b9033403e7ca04e00c3d490aa29ff68859371758e7",
|
|
75
|
+
"tag": "snapshot-nightly"
|
|
76
|
+
},
|
|
69
77
|
"scripts": {
|
|
70
78
|
"dev": "tsdown -w --sourcemap",
|
|
71
79
|
"build": "tsdown",
|
|
@@ -77,4 +85,4 @@
|
|
|
77
85
|
"lint": "eslint .",
|
|
78
86
|
"lint:fix": "eslint . --fix"
|
|
79
87
|
}
|
|
80
|
-
}
|
|
88
|
+
}
|