@uniformdev/cli 19.173.1-alpha.17 → 19.173.2-alpha.258
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.
|
@@ -5,7 +5,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
5
5
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
// ../../node_modules/.pnpm/tsup@8.
|
|
8
|
+
// ../../node_modules/.pnpm/tsup@8.2.4_@microsoft+api-extractor@7.43.2_tsx@4.17.0_typescript@5.5.4/node_modules/tsup/assets/esm_shims.js
|
|
9
9
|
import { fileURLToPath } from "url";
|
|
10
10
|
import path from "path";
|
|
11
11
|
var getFilename = () => fileURLToPath(import.meta.url);
|
package/dist/defaultConfig.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
withFormatOptions,
|
|
16
16
|
withProjectOptions,
|
|
17
17
|
withTeamOptions
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-VMUNHMVI.mjs";
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
import * as dotenv from "dotenv";
|
|
@@ -236,7 +236,8 @@ async function syncEngine({
|
|
|
236
236
|
log = () => {
|
|
237
237
|
},
|
|
238
238
|
onBeforeCompareObjects,
|
|
239
|
-
onBeforeWriteObject
|
|
239
|
+
onBeforeWriteObject,
|
|
240
|
+
onError
|
|
240
241
|
}) {
|
|
241
242
|
const targetItems = /* @__PURE__ */ new Map();
|
|
242
243
|
const deleteTracker = /* @__PURE__ */ new Set();
|
|
@@ -246,18 +247,22 @@ async function syncEngine({
|
|
|
246
247
|
if (!whatIf) {
|
|
247
248
|
try {
|
|
248
249
|
await target.deleteObject(object.providerId, object);
|
|
250
|
+
log({
|
|
251
|
+
action: "delete",
|
|
252
|
+
id: object.id[0],
|
|
253
|
+
providerId: object.providerId,
|
|
254
|
+
displayName: object.displayName ?? object.providerId,
|
|
255
|
+
whatIf,
|
|
256
|
+
diff: diffLines(JSON.stringify(object.object, null, 2), "")
|
|
257
|
+
});
|
|
249
258
|
} catch (e) {
|
|
250
|
-
|
|
259
|
+
if (onError) {
|
|
260
|
+
onError(e, object);
|
|
261
|
+
} else {
|
|
262
|
+
throw new SyncEngineError(e, object);
|
|
263
|
+
}
|
|
251
264
|
}
|
|
252
265
|
}
|
|
253
|
-
log({
|
|
254
|
-
action: "delete",
|
|
255
|
-
id: object.id[0],
|
|
256
|
-
providerId: object.providerId,
|
|
257
|
-
displayName: object.displayName ?? object.providerId,
|
|
258
|
-
whatIf,
|
|
259
|
-
diff: diffLines(JSON.stringify(object.object, null, 2), "")
|
|
260
|
-
});
|
|
261
266
|
};
|
|
262
267
|
for await (const obj of target.objects) {
|
|
263
268
|
if (Array.isArray(obj.id)) {
|
|
@@ -282,18 +287,22 @@ async function syncEngine({
|
|
|
282
287
|
try {
|
|
283
288
|
const finalSourceObject = onBeforeWriteObject ? await onBeforeWriteObject(sourceObject2, targetObject2) : sourceObject2;
|
|
284
289
|
await target.writeObject(finalSourceObject, targetObject2);
|
|
290
|
+
log({
|
|
291
|
+
action: "update",
|
|
292
|
+
id: ids[0],
|
|
293
|
+
providerId: sourceObject2.providerId,
|
|
294
|
+
displayName: sourceObject2.displayName ?? sourceObject2.providerId,
|
|
295
|
+
whatIf,
|
|
296
|
+
diff: diffJson(targetObject2.object, sourceObject2.object)
|
|
297
|
+
});
|
|
285
298
|
} catch (e) {
|
|
286
|
-
|
|
299
|
+
if (onError) {
|
|
300
|
+
onError(e, sourceObject2);
|
|
301
|
+
} else {
|
|
302
|
+
throw new SyncEngineError(e, sourceObject2);
|
|
303
|
+
}
|
|
287
304
|
}
|
|
288
305
|
}
|
|
289
|
-
log({
|
|
290
|
-
action: "update",
|
|
291
|
-
id: ids[0],
|
|
292
|
-
providerId: sourceObject2.providerId,
|
|
293
|
-
displayName: sourceObject2.displayName ?? sourceObject2.providerId,
|
|
294
|
-
whatIf,
|
|
295
|
-
diff: diffJson(targetObject2.object, sourceObject2.object)
|
|
296
|
-
});
|
|
297
306
|
};
|
|
298
307
|
actions.push(process2(sourceObject, targetObject));
|
|
299
308
|
}
|
|
@@ -305,18 +314,22 @@ async function syncEngine({
|
|
|
305
314
|
try {
|
|
306
315
|
const finalSourceObject = onBeforeWriteObject ? await onBeforeWriteObject(sourceObject2) : sourceObject2;
|
|
307
316
|
await target.writeObject(finalSourceObject);
|
|
317
|
+
log({
|
|
318
|
+
action: "create",
|
|
319
|
+
id,
|
|
320
|
+
providerId: id,
|
|
321
|
+
displayName: sourceObject2.displayName ?? sourceObject2.providerId,
|
|
322
|
+
whatIf,
|
|
323
|
+
diff: diffLines("", JSON.stringify(sourceObject2.object, null, 2))
|
|
324
|
+
});
|
|
308
325
|
} catch (e) {
|
|
309
|
-
|
|
326
|
+
if (onError) {
|
|
327
|
+
onError(e, sourceObject2);
|
|
328
|
+
} else {
|
|
329
|
+
throw new SyncEngineError(e, sourceObject2);
|
|
330
|
+
}
|
|
310
331
|
}
|
|
311
332
|
}
|
|
312
|
-
log({
|
|
313
|
-
action: "create",
|
|
314
|
-
id,
|
|
315
|
-
providerId: id,
|
|
316
|
-
displayName: sourceObject2.displayName ?? sourceObject2.providerId,
|
|
317
|
-
whatIf,
|
|
318
|
-
diff: diffLines("", JSON.stringify(sourceObject2.object, null, 2))
|
|
319
|
-
});
|
|
320
333
|
};
|
|
321
334
|
if (invalidTargetObjects.length > 0) {
|
|
322
335
|
[...invalidTargetObjects, targetObject].forEach((o) => {
|
|
@@ -1883,7 +1896,7 @@ var CompositionListModule = {
|
|
|
1883
1896
|
const res = await client.getCompositionList({
|
|
1884
1897
|
limit,
|
|
1885
1898
|
offset,
|
|
1886
|
-
search: search.length > 0 ? search : void 0,
|
|
1899
|
+
search: search && search.length > 0 ? search : void 0,
|
|
1887
1900
|
pattern: onlyCompositions ? false : onlyPatterns ? true : void 0,
|
|
1888
1901
|
patternType,
|
|
1889
1902
|
state: convertStateOption(state),
|
|
@@ -1947,7 +1960,17 @@ var ComponentPatternListModule = {
|
|
|
1947
1960
|
import { UncachedCanvasClient as UncachedCanvasClient9 } from "@uniformdev/canvas";
|
|
1948
1961
|
|
|
1949
1962
|
// src/commands/canvas/commands/composition/_util.ts
|
|
1950
|
-
var selectIdentifier3 = (
|
|
1963
|
+
var selectIdentifier3 = (response) => {
|
|
1964
|
+
let baseId = response.composition._id;
|
|
1965
|
+
if (response.editionId) {
|
|
1966
|
+
baseId += ` (${response.editionId})`;
|
|
1967
|
+
}
|
|
1968
|
+
return baseId;
|
|
1969
|
+
};
|
|
1970
|
+
function parseCompositionSerializedId(providerId) {
|
|
1971
|
+
const [compositionId, editionId] = providerId.split(" (");
|
|
1972
|
+
return { compositionId, editionId: editionId?.slice(0, -1) };
|
|
1973
|
+
}
|
|
1951
1974
|
var selectDisplayName3 = (component) => `${component.composition._name ?? component.composition._slug ?? component.composition._id} (pid: ${component.composition._id})`;
|
|
1952
1975
|
|
|
1953
1976
|
// src/commands/canvas/componentInstanceEngineDataSource.ts
|
|
@@ -1971,7 +1994,8 @@ function createComponentInstanceEngineDataSource({
|
|
|
1971
1994
|
skipPatternResolution: true,
|
|
1972
1995
|
skipOverridesResolution: true,
|
|
1973
1996
|
withComponentIDs: true,
|
|
1974
|
-
patternType
|
|
1997
|
+
patternType,
|
|
1998
|
+
editions: "all"
|
|
1975
1999
|
})).compositions,
|
|
1976
2000
|
{ pageSize: 100 }
|
|
1977
2001
|
);
|
|
@@ -1979,7 +2003,7 @@ function createComponentInstanceEngineDataSource({
|
|
|
1979
2003
|
const result = {
|
|
1980
2004
|
id: selectIdentifier3(compositionListItem),
|
|
1981
2005
|
displayName: selectDisplayName3(compositionListItem),
|
|
1982
|
-
providerId: compositionListItem
|
|
2006
|
+
providerId: selectIdentifier3(compositionListItem),
|
|
1983
2007
|
object: prepCompositionForDisk(compositionListItem)
|
|
1984
2008
|
};
|
|
1985
2009
|
yield result;
|
|
@@ -1989,7 +2013,7 @@ function createComponentInstanceEngineDataSource({
|
|
|
1989
2013
|
name: "Uniform API",
|
|
1990
2014
|
objects: getObjects(),
|
|
1991
2015
|
deleteObject: async (providerId) => {
|
|
1992
|
-
await client.removeComposition(
|
|
2016
|
+
await client.removeComposition(parseCompositionSerializedId(providerId));
|
|
1993
2017
|
},
|
|
1994
2018
|
writeObject: async (object) => {
|
|
1995
2019
|
await client.updateComposition({ ...object.object, state: stateId });
|
|
@@ -3588,7 +3612,6 @@ var EntryGetModule = {
|
|
|
3588
3612
|
withApiOptions(
|
|
3589
3613
|
withProjectOptions(
|
|
3590
3614
|
withStateOptions(
|
|
3591
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3592
3615
|
yargs36.positional("id", { demandOption: true, describe: "Entry public ID to fetch" }).option({
|
|
3593
3616
|
resolveData: {
|
|
3594
3617
|
type: "boolean",
|
|
@@ -4151,7 +4174,6 @@ var EntryPatternGetModule = {
|
|
|
4151
4174
|
withApiOptions(
|
|
4152
4175
|
withProjectOptions(
|
|
4153
4176
|
withStateOptions(
|
|
4154
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4155
4177
|
yargs36.positional("id", {
|
|
4156
4178
|
demandOption: true,
|
|
4157
4179
|
describe: "Entry pattern public ID to fetch"
|
|
@@ -7463,7 +7485,7 @@ import { PostHog } from "posthog-node";
|
|
|
7463
7485
|
// package.json
|
|
7464
7486
|
var package_default = {
|
|
7465
7487
|
name: "@uniformdev/cli",
|
|
7466
|
-
version: "19.
|
|
7488
|
+
version: "19.188.0",
|
|
7467
7489
|
description: "Uniform command line interface tool",
|
|
7468
7490
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
7469
7491
|
main: "./cli.js",
|
|
@@ -9109,7 +9131,10 @@ var ProjectMapNodePullModule = {
|
|
|
9109
9131
|
};
|
|
9110
9132
|
|
|
9111
9133
|
// src/commands/project-map/commands/ProjectMapNode/push.ts
|
|
9112
|
-
import {
|
|
9134
|
+
import {
|
|
9135
|
+
__INTERNAL_MISSING_PARENT_NODE_ERROR,
|
|
9136
|
+
UncachedProjectMapClient as UncachedProjectMapClient10
|
|
9137
|
+
} from "@uniformdev/project-map";
|
|
9113
9138
|
var ProjectMapNodePushModule = {
|
|
9114
9139
|
command: "push <directory>",
|
|
9115
9140
|
describe: "Pushes all project maps nodes from files in a directory or package to Uniform",
|
|
@@ -9163,7 +9188,9 @@ var ProjectMapNodePushModule = {
|
|
|
9163
9188
|
const packageContents = readContextPackage2(directory, true);
|
|
9164
9189
|
source = await createArraySyncEngineDataSource({
|
|
9165
9190
|
name: `Package file ${directory}`,
|
|
9166
|
-
objects: packageContents.projectMapNodes
|
|
9191
|
+
objects: packageContents.projectMapNodes.sort((a, b) => {
|
|
9192
|
+
return a.path.length - b.path.length;
|
|
9193
|
+
}) ?? [],
|
|
9167
9194
|
selectIdentifier: expandedSelectIdentifier,
|
|
9168
9195
|
selectDisplayName: selectDisplayName12
|
|
9169
9196
|
});
|
|
@@ -9176,14 +9203,41 @@ var ProjectMapNodePushModule = {
|
|
|
9176
9203
|
});
|
|
9177
9204
|
}
|
|
9178
9205
|
const target = createProjectMapNodeEngineDataSource({ client, projectId });
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9206
|
+
const nodesFailedDueToMissingParent = /* @__PURE__ */ new Set();
|
|
9207
|
+
const attemptSync = async () => {
|
|
9208
|
+
const lastFailedNodesCount = nodesFailedDueToMissingParent.size;
|
|
9209
|
+
nodesFailedDueToMissingParent.clear();
|
|
9210
|
+
await syncEngine({
|
|
9211
|
+
source,
|
|
9212
|
+
target,
|
|
9213
|
+
mode,
|
|
9214
|
+
whatIf,
|
|
9215
|
+
allowEmptySource,
|
|
9216
|
+
log: createSyncEngineConsoleLogger({ diffMode }),
|
|
9217
|
+
onError: (error, object) => {
|
|
9218
|
+
if (error.message.includes(__INTERNAL_MISSING_PARENT_NODE_ERROR)) {
|
|
9219
|
+
nodesFailedDueToMissingParent.add(object.object);
|
|
9220
|
+
} else {
|
|
9221
|
+
throw error;
|
|
9222
|
+
}
|
|
9223
|
+
}
|
|
9224
|
+
});
|
|
9225
|
+
if (nodesFailedDueToMissingParent.size !== 0) {
|
|
9226
|
+
const newFailedNodesCount = nodesFailedDueToMissingParent.size;
|
|
9227
|
+
if (newFailedNodesCount !== lastFailedNodesCount) {
|
|
9228
|
+
source = await createArraySyncEngineDataSource({
|
|
9229
|
+
name: `Nodes re-push from ${directory}`,
|
|
9230
|
+
objects: Array.from(nodesFailedDueToMissingParent),
|
|
9231
|
+
selectIdentifier: expandedSelectIdentifier,
|
|
9232
|
+
selectDisplayName: selectDisplayName12
|
|
9233
|
+
});
|
|
9234
|
+
await attemptSync();
|
|
9235
|
+
} else {
|
|
9236
|
+
throw new Error("Failed to push nodes due to missing parent nodes");
|
|
9237
|
+
}
|
|
9238
|
+
}
|
|
9239
|
+
};
|
|
9240
|
+
await attemptSync();
|
|
9187
9241
|
}
|
|
9188
9242
|
};
|
|
9189
9243
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/cli",
|
|
3
|
-
"version": "19.173.
|
|
3
|
+
"version": "19.173.2-alpha.258+e8775b83de",
|
|
4
4
|
"description": "Uniform command line interface tool",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./cli.js",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@thi.ng/mime": "^2.2.23",
|
|
30
|
-
"@uniformdev/assets": "19.173.
|
|
31
|
-
"@uniformdev/canvas": "19.173.
|
|
32
|
-
"@uniformdev/context": "19.173.
|
|
33
|
-
"@uniformdev/files": "19.173.
|
|
34
|
-
"@uniformdev/project-map": "19.173.
|
|
35
|
-
"@uniformdev/redirect": "19.173.
|
|
30
|
+
"@uniformdev/assets": "19.173.2-alpha.258+e8775b83de",
|
|
31
|
+
"@uniformdev/canvas": "19.173.2-alpha.258+e8775b83de",
|
|
32
|
+
"@uniformdev/context": "19.173.2-alpha.258+e8775b83de",
|
|
33
|
+
"@uniformdev/files": "19.173.2-alpha.258+e8775b83de",
|
|
34
|
+
"@uniformdev/project-map": "19.173.2-alpha.258+e8775b83de",
|
|
35
|
+
"@uniformdev/redirect": "19.173.2-alpha.258+e8775b83de",
|
|
36
36
|
"call-bind": "^1.0.2",
|
|
37
37
|
"colorette": "2.0.20",
|
|
38
38
|
"cosmiconfig": "9.0.0",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "e8775b83dec606ce6e2198182152d8b386e15f94"
|
|
82
82
|
}
|