@uniformdev/cli 20.53.1-alpha.7 → 20.53.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 +45 -13
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -722,7 +722,7 @@ import mitt from "mitt";
|
|
|
722
722
|
|
|
723
723
|
// src/sync/serializedDequal.ts
|
|
724
724
|
var has = Object.prototype.hasOwnProperty;
|
|
725
|
-
var ignoredProperties = /* @__PURE__ */ new Set(["created", "modified", "updated"]);
|
|
725
|
+
var ignoredProperties = /* @__PURE__ */ new Set(["created", "modified", "updated", "createdBy", "modifiedBy", "updatedBy"]);
|
|
726
726
|
function serializedDequal(foo, bar) {
|
|
727
727
|
let ctor, len;
|
|
728
728
|
if (foo === bar) {
|
|
@@ -1107,7 +1107,7 @@ import { PostHog } from "posthog-node";
|
|
|
1107
1107
|
// package.json
|
|
1108
1108
|
var package_default = {
|
|
1109
1109
|
name: "@uniformdev/cli",
|
|
1110
|
-
version: "20.53.
|
|
1110
|
+
version: "20.53.1",
|
|
1111
1111
|
description: "Uniform command line interface tool",
|
|
1112
1112
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
1113
1113
|
main: "./cli.js",
|
|
@@ -2459,7 +2459,7 @@ import {
|
|
|
2459
2459
|
walkNodeTree,
|
|
2460
2460
|
walkPropertyValues
|
|
2461
2461
|
} from "@uniformdev/canvas";
|
|
2462
|
-
var UNIFORM_FILE_MATCH = /"(https:\/\/([^"]*?)?(img|files)\.(eu
|
|
2462
|
+
var UNIFORM_FILE_MATCH = /"(https:\/\/([^"]*?)?(img|files)\.(eu([1-9]\d*)?\.)?uniform\.(rocks|global)\/([^"]*?))"/g;
|
|
2463
2463
|
var walkFileUrlsForCompositionOrEntry = ({
|
|
2464
2464
|
entity,
|
|
2465
2465
|
callback
|
|
@@ -2742,7 +2742,7 @@ var escapeRegExp = (string4) => {
|
|
|
2742
2742
|
var findUrlMatchingPartialPathname = (source, pathname) => {
|
|
2743
2743
|
const escapedPathname = escapeRegExp(pathname);
|
|
2744
2744
|
const regex = new RegExp(
|
|
2745
|
-
`"(https://([^"]*?)?(img|files).uniform.(rocks|global)${escapedPathname}([^"]*?))"`
|
|
2745
|
+
`"(https://([^"]*?)?(img|files).(eu([1-9]\\d*)?\\.)?uniform.(rocks|global)${escapedPathname}([^"]*?))"`
|
|
2746
2746
|
);
|
|
2747
2747
|
const match = source.match(regex);
|
|
2748
2748
|
if (match && match[1]) {
|
|
@@ -7090,6 +7090,10 @@ function getLabelClient(options) {
|
|
|
7090
7090
|
}
|
|
7091
7091
|
|
|
7092
7092
|
// src/commands/canvas/labelsEngineDataSource.ts
|
|
7093
|
+
function normalizeLabelForSync(label) {
|
|
7094
|
+
const { projectId: _projectId, ...labelWithoutProjectId } = label;
|
|
7095
|
+
return labelWithoutProjectId;
|
|
7096
|
+
}
|
|
7093
7097
|
function createLabelsEngineDataSource({
|
|
7094
7098
|
client
|
|
7095
7099
|
}) {
|
|
@@ -7100,7 +7104,7 @@ function createLabelsEngineDataSource({
|
|
|
7100
7104
|
id: label.label.publicId,
|
|
7101
7105
|
displayName: `${label.label.displayName} (pid: ${label.label.publicId})`,
|
|
7102
7106
|
providerId: label.label.publicId,
|
|
7103
|
-
object: label
|
|
7107
|
+
object: normalizeLabelForSync(label)
|
|
7104
7108
|
};
|
|
7105
7109
|
yield result;
|
|
7106
7110
|
}
|
|
@@ -7204,6 +7208,7 @@ var LabelPullModule = {
|
|
|
7204
7208
|
};
|
|
7205
7209
|
|
|
7206
7210
|
// src/commands/canvas/commands/label/push.ts
|
|
7211
|
+
var __INTERNAL_MISSING_PARENT_LABEL_ERROR = "Parent label with public ID";
|
|
7207
7212
|
var LabelPushModule = {
|
|
7208
7213
|
command: "push <directory>",
|
|
7209
7214
|
describe: "Pushes all labels from files in a directory to Uniform",
|
|
@@ -7261,14 +7266,41 @@ var LabelPushModule = {
|
|
|
7261
7266
|
});
|
|
7262
7267
|
}
|
|
7263
7268
|
const target = createLabelsEngineDataSource({ client });
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7269
|
+
const labelsFailedDueToMissingParent = /* @__PURE__ */ new Set();
|
|
7270
|
+
const attemptSync = async () => {
|
|
7271
|
+
const lastFailedLabelsCount = labelsFailedDueToMissingParent.size;
|
|
7272
|
+
labelsFailedDueToMissingParent.clear();
|
|
7273
|
+
await syncEngine({
|
|
7274
|
+
source,
|
|
7275
|
+
target,
|
|
7276
|
+
mode,
|
|
7277
|
+
whatIf,
|
|
7278
|
+
allowEmptySource,
|
|
7279
|
+
log: createSyncEngineConsoleLogger({ diffMode }),
|
|
7280
|
+
onError: (error, object4) => {
|
|
7281
|
+
if (error.message.includes(__INTERNAL_MISSING_PARENT_LABEL_ERROR)) {
|
|
7282
|
+
labelsFailedDueToMissingParent.add(object4.object);
|
|
7283
|
+
} else {
|
|
7284
|
+
throw error;
|
|
7285
|
+
}
|
|
7286
|
+
}
|
|
7287
|
+
});
|
|
7288
|
+
if (labelsFailedDueToMissingParent.size !== 0) {
|
|
7289
|
+
const newFailedLabelsCount = labelsFailedDueToMissingParent.size;
|
|
7290
|
+
if (newFailedLabelsCount !== lastFailedLabelsCount) {
|
|
7291
|
+
source = await createArraySyncEngineDataSource({
|
|
7292
|
+
name: `Labels re-push from ${directory}`,
|
|
7293
|
+
objects: Array.from(labelsFailedDueToMissingParent),
|
|
7294
|
+
selectIdentifier: selectLabelIdentifier,
|
|
7295
|
+
selectDisplayName: selectLabelDisplayName
|
|
7296
|
+
});
|
|
7297
|
+
await attemptSync();
|
|
7298
|
+
} else {
|
|
7299
|
+
throw new Error("Failed to push labels due to missing parent labels");
|
|
7300
|
+
}
|
|
7301
|
+
}
|
|
7302
|
+
};
|
|
7303
|
+
await attemptSync();
|
|
7272
7304
|
}
|
|
7273
7305
|
};
|
|
7274
7306
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/cli",
|
|
3
|
-
"version": "20.53.1
|
|
3
|
+
"version": "20.53.1",
|
|
4
4
|
"description": "Uniform command line interface tool",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./cli.js",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@inquirer/prompts": "^7.10.1",
|
|
30
30
|
"@thi.ng/mime": "^2.2.23",
|
|
31
|
-
"@uniformdev/assets": "20.53.1
|
|
32
|
-
"@uniformdev/canvas": "20.53.1
|
|
33
|
-
"@uniformdev/context": "20.53.1
|
|
34
|
-
"@uniformdev/files": "20.53.1
|
|
35
|
-
"@uniformdev/project-map": "20.53.1
|
|
36
|
-
"@uniformdev/redirect": "20.53.1
|
|
37
|
-
"@uniformdev/richtext": "20.53.1
|
|
31
|
+
"@uniformdev/assets": "20.53.1",
|
|
32
|
+
"@uniformdev/canvas": "20.53.1",
|
|
33
|
+
"@uniformdev/context": "20.53.1",
|
|
34
|
+
"@uniformdev/files": "20.53.1",
|
|
35
|
+
"@uniformdev/project-map": "20.53.1",
|
|
36
|
+
"@uniformdev/redirect": "20.53.1",
|
|
37
|
+
"@uniformdev/richtext": "20.53.1",
|
|
38
38
|
"call-bind": "^1.0.2",
|
|
39
39
|
"colorette": "2.0.20",
|
|
40
40
|
"cosmiconfig": "9.0.0",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "2a33fdce31a3a0f83b7b762356e03cdd65013a42"
|
|
85
85
|
}
|