@diagonal-hq/cli 0.28.1 → 0.28.2

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/cli.mjs +17 -12
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -1563,7 +1563,7 @@ var require_stringifyString = __commonJS({
1563
1563
  ${indent}`) + "'";
1564
1564
  return ctx.implicitKey ? res : foldFlowLines.foldFlowLines(res, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
1565
1565
  }
1566
- function quotedString2(value, ctx) {
1566
+ function quotedString(value, ctx) {
1567
1567
  const { singleQuote } = ctx.options;
1568
1568
  let qs;
1569
1569
  if (singleQuote === false)
@@ -1589,7 +1589,7 @@ ${indent}`) + "'";
1589
1589
  function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
1590
1590
  const { blockQuote, commentString, lineWidth } = ctx.options;
1591
1591
  if (!blockQuote || /\n[\t ]+$/.test(value)) {
1592
- return quotedString2(value, ctx);
1592
+ return quotedString(value, ctx);
1593
1593
  }
1594
1594
  const indent = ctx.indent || (ctx.forceBlockIndent || containsDocumentMarker(value) ? " " : "");
1595
1595
  const literal2 = blockQuote === "literal" ? true : blockQuote === "folded" || type === Scalar.Scalar.BLOCK_FOLDED ? false : type === Scalar.Scalar.BLOCK_LITERAL ? true : !lineLengthOverLimit(value, lineWidth, indent.length);
@@ -1665,10 +1665,10 @@ ${indent}${start}${value}${end}`;
1665
1665
  const { type, value } = item;
1666
1666
  const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;
1667
1667
  if (implicitKey && value.includes("\n") || inFlow && /[[\]{},]/.test(value)) {
1668
- return quotedString2(value, ctx);
1668
+ return quotedString(value, ctx);
1669
1669
  }
1670
1670
  if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
1671
- return implicitKey || inFlow || !value.includes("\n") ? quotedString2(value, ctx) : blockString(item, ctx, onComment, onChompKeep);
1671
+ return implicitKey || inFlow || !value.includes("\n") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep);
1672
1672
  }
1673
1673
  if (!implicitKey && !inFlow && type !== Scalar.Scalar.PLAIN && value.includes("\n")) {
1674
1674
  return blockString(item, ctx, onComment, onChompKeep);
@@ -1678,7 +1678,7 @@ ${indent}${start}${value}${end}`;
1678
1678
  ctx.forceBlockIndent = true;
1679
1679
  return blockString(item, ctx, onComment, onChompKeep);
1680
1680
  } else if (implicitKey && indent === indentStep) {
1681
- return quotedString2(value, ctx);
1681
+ return quotedString(value, ctx);
1682
1682
  }
1683
1683
  }
1684
1684
  const str = value.replace(/\n+/g, `$&
@@ -1687,7 +1687,7 @@ ${indent}`);
1687
1687
  const test = (tag) => tag.default && tag.tag !== "tag:yaml.org,2002:str" && tag.test?.test(str);
1688
1688
  const { compat, tags } = ctx.doc.schema;
1689
1689
  if (tags.some(test) || compat?.some(test))
1690
- return quotedString2(value, ctx);
1690
+ return quotedString(value, ctx);
1691
1691
  }
1692
1692
  return implicitKey ? str : foldFlowLines.foldFlowLines(str, indent, foldFlowLines.FOLD_FLOW, getFoldOptions(ctx, false));
1693
1693
  }
@@ -1703,7 +1703,7 @@ ${indent}`);
1703
1703
  switch (_type) {
1704
1704
  case Scalar.Scalar.BLOCK_FOLDED:
1705
1705
  case Scalar.Scalar.BLOCK_LITERAL:
1706
- return implicitKey || inFlow ? quotedString2(ss.value, ctx) : blockString(ss, ctx, onComment, onChompKeep);
1706
+ return implicitKey || inFlow ? quotedString(ss.value, ctx) : blockString(ss, ctx, onComment, onChompKeep);
1707
1707
  case Scalar.Scalar.QUOTE_DOUBLE:
1708
1708
  return doubleQuotedString(ss.value, ctx);
1709
1709
  case Scalar.Scalar.QUOTE_SINGLE:
@@ -324073,10 +324073,13 @@ function seoReadProblem({ key, read: read2, inTemplate }, bindings, resourcesByS
324073
324073
  return null;
324074
324074
  }
324075
324075
 
324076
- // scripts/lib/runtime-build/page-options-migration.mjs
324077
- function quotedString(value) {
324078
- return `'${value.replaceAll("\\", "\\\\").replaceAll("'", "\\'").replaceAll("\n", "\\n")}'`;
324076
+ // scripts/lib/runtime-build/source-literal.mjs
324077
+ init_define_globalThis_DIAGONAL_SDK_RUNTIME();
324078
+ function quotedLiteral(value) {
324079
+ return `'${value.replaceAll("\\", "\\\\").replaceAll("'", "\\'").replaceAll("\r", "\\r").replaceAll("\n", "\\n").replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029")}'`;
324079
324080
  }
324081
+
324082
+ // scripts/lib/runtime-build/page-options-migration.mjs
324080
324083
  function movableMetaValue(value) {
324081
324084
  if (value !== null && typeof value !== "string" && !isPlainObject2(value)) {
324082
324085
  return void 0;
@@ -324144,13 +324147,15 @@ function migratePageOptions(source, ast) {
324144
324147
  keepsAllowedResolver = true;
324145
324148
  continue;
324146
324149
  }
324147
- const text2 = value === null ? "null" : property.value.type === "StringLiteral" && property.value.value === value ? sliceOf(source, property.value) : quotedString(value);
324150
+ const text2 = value === null ? "null" : property.value.type === "StringLiteral" && property.value.value === value ? sliceOf(source, property.value) : quotedLiteral(value);
324148
324151
  moved.push({ property, grouped, text: text2 });
324149
324152
  }
324150
324153
  }
324151
324154
  if (moved.length > 0 && !keepsAllowedResolver) {
324152
324155
  const entries = moved.toSorted((left, right) => SEO_KEYS.indexOf(left.grouped) - SEO_KEYS.indexOf(right.grouped)).map((entry) => `${entry.grouped}: ${entry.text}`);
324153
- const last2 = moved.reduce((latest, entry) => entry.property.start > latest.property.start ? entry : latest);
324156
+ const last2 = moved.reduce(
324157
+ (latest, entry) => entry.property.start > latest.property.start ? entry : latest
324158
+ );
324154
324159
  const singleLine = options2.loc.start.line === options2.loc.end.line;
324155
324160
  const indent = lineIndent(source, last2.property.start);
324156
324161
  const seoText = singleLine ? `seo: { ${entries.join(", ")} }` : `seo: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diagonal-hq/cli",
3
- "version": "0.28.1",
3
+ "version": "0.28.2",
4
4
  "description": "The diagonal CLI and the configuration helpers for file-based Diagonal workspaces.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {