@uniformdev/cli 19.5.1-alpha.22 → 19.7.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.
Files changed (2) hide show
  1. package/dist/index.mjs +16 -10
  2. package/package.json +6 -6
package/dist/index.mjs CHANGED
@@ -57,11 +57,12 @@ async function createArraySyncEngineDataSource({
57
57
  if (result[identifier]) {
58
58
  throw new Error(`Identifier ${identifier} was not unique.`);
59
59
  }
60
+ const displayName = selectDisplayName12(current);
60
61
  result[identifier] = {
61
62
  id: identifier,
62
63
  object: current,
63
64
  providerId: identifier,
64
- displayName: selectDisplayName12(current)[0]
65
+ displayName: Array.isArray(displayName) ? displayName[0] : displayName
65
66
  };
66
67
  }
67
68
  return result;
@@ -245,7 +246,7 @@ async function createFileSyncEngineDataSource({
245
246
  format = "yaml",
246
247
  selectIdentifier: selectIdentifier12,
247
248
  selectDisplayName: selectDisplayName12 = selectIdentifier12,
248
- selectFilename: selectFilename2,
249
+ selectFilename: selectFilename3,
249
250
  selectSchemaUrl: selectSchemaUrl2
250
251
  }) {
251
252
  const dirExists = existsSync(directory);
@@ -285,7 +286,7 @@ ${e == null ? void 0 : e.message}`));
285
286
  await unlink(providerId);
286
287
  },
287
288
  writeObject: async (object) => {
288
- const filename = selectFilename2 ? join(directory, `${selectFilename2(object.object)}.${format}`) : getFullFilename(object.id);
289
+ const filename = selectFilename3 ? join(directory, `${selectFilename3(object.object)}.${format}`) : getFullFilename(object.id);
289
290
  let contents = object.object;
290
291
  if (selectSchemaUrl2) {
291
292
  contents = {
@@ -3233,7 +3234,7 @@ import { PostHog } from "posthog-node";
3233
3234
  // package.json
3234
3235
  var package_default = {
3235
3236
  name: "@uniformdev/cli",
3236
- version: "19.5.0",
3237
+ version: "19.7.0",
3237
3238
  description: "Uniform command line interface tool",
3238
3239
  license: "SEE LICENSE IN LICENSE.txt",
3239
3240
  main: "./cli.js",
@@ -5044,10 +5045,17 @@ function writeContextPackage3(filename, packageContents) {
5044
5045
 
5045
5046
  // src/commands/redirect/commands/RedirectDefinition/_util.ts
5046
5047
  var selectIdentifier11 = (source) => source.redirect.id;
5048
+ var selectFilename2 = (source) => {
5049
+ const index = source.redirect.sourceUrl.lastIndexOf("/");
5050
+ return source.redirect.sourceUrl.substring(index + 1).replace(/[/<>$+%>!`&*'|{}?"=:\\@]/g, "-") + `_${source.redirect.id}`;
5051
+ };
5047
5052
  var selectDisplayName11 = (source) => {
5048
- console.log(JSON.stringify(source, void 0, " "));
5049
- console.log(`${source.redirect.sourceUrl} (pid: ${source.redirect.id})`);
5050
- return `${source.redirect.sourceUrl} (pid: ${source.redirect.id})`;
5053
+ let pathName = source.redirect.sourceUrl;
5054
+ if (pathName.length > 30) {
5055
+ const slashIndex = source.redirect.sourceUrl.indexOf("/", source.redirect.sourceUrl.length - 30);
5056
+ pathName = "..." + pathName.substring(slashIndex);
5057
+ }
5058
+ return `${pathName} (id: ${source.redirect.id})`;
5051
5059
  };
5052
5060
 
5053
5061
  // src/commands/redirect/RedirectEngineDataSource.ts
@@ -5138,9 +5146,7 @@ var RedirectDefinitionPullModule = {
5138
5146
  } else {
5139
5147
  target = await createFileSyncEngineDataSource({
5140
5148
  directory,
5141
- selectFilename: (o) => {
5142
- return o.redirect.sourceUrl.replace(/[/<>$+%>!`&*'|{}?"=:\\@]/g, "-");
5143
- },
5149
+ selectFilename: selectFilename2,
5144
5150
  selectIdentifier: selectIdentifier11,
5145
5151
  selectDisplayName: selectDisplayName11,
5146
5152
  format
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/cli",
3
- "version": "19.5.1-alpha.22+5b4a94102",
3
+ "version": "19.7.0",
4
4
  "description": "Uniform command line interface tool",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./cli.js",
@@ -16,10 +16,10 @@
16
16
  "format": "prettier --write \"src/**/*.{js,ts,tsx}\""
17
17
  },
18
18
  "dependencies": {
19
- "@uniformdev/canvas": "19.5.1-alpha.22+5b4a94102",
20
- "@uniformdev/context": "19.5.1-alpha.22+5b4a94102",
21
- "@uniformdev/project-map": "19.5.1-alpha.22+5b4a94102",
22
- "@uniformdev/redirect": "19.5.1-alpha.22+5b4a94102",
19
+ "@uniformdev/canvas": "19.7.0",
20
+ "@uniformdev/context": "19.7.0",
21
+ "@uniformdev/project-map": "19.7.0",
22
+ "@uniformdev/redirect": "19.7.0",
23
23
  "chalk": "^5.2.0",
24
24
  "diff": "^5.0.0",
25
25
  "dotenv": "^16.0.3",
@@ -60,5 +60,5 @@
60
60
  "publishConfig": {
61
61
  "access": "public"
62
62
  },
63
- "gitHead": "5b4a94102c83a88c9fbf888a24d633e8abf96b76"
63
+ "gitHead": "bbcd8d36ccb082d87f1f434a94d6d9402ddb5424"
64
64
  }