Skip to content

Commit 83913c3

Browse files
authored
Merge branch 'master' into master
2 parents 4cc9e49 + 0ae3111 commit 83913c3

File tree

3 files changed

+42
-33
lines changed

3 files changed

+42
-33
lines changed

dist/index.js

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64585,10 +64585,23 @@ function resolveCollection(CN, ctx, token, onError, tagName, tag) {
6458564585
coll.tag = tagName;
6458664586
return coll;
6458764587
}
64588-
function composeCollection(CN, ctx, token, tagToken, onError) {
64588+
function composeCollection(CN, ctx, token, props, onError) {
64589+
const tagToken = props.tag;
6458964590
const tagName = !tagToken
6459064591
? null
6459164592
: ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg));
64593+
if (token.type === 'block-seq') {
64594+
const { anchor, newlineAfterProp: nl } = props;
64595+
const lastProp = anchor && tagToken
64596+
? anchor.offset > tagToken.offset
64597+
? anchor
64598+
: tagToken
64599+
: (anchor ?? tagToken);
64600+
if (lastProp && (!nl || nl.offset < lastProp.offset)) {
64601+
const message = 'Missing newline after block sequence props';
64602+
onError(lastProp, 'MISSING_CHAR', message);
64603+
}
64604+
}
6459264605
const expType = token.type === 'block-map'
6459364606
? 'map'
6459464607
: token.type === 'block-seq'
@@ -64602,8 +64615,7 @@ function composeCollection(CN, ctx, token, tagToken, onError) {
6460264615
!tagName ||
6460364616
tagName === '!' ||
6460464617
(tagName === YAMLMap.YAMLMap.tagName && expType === 'map') ||
64605-
(tagName === YAMLSeq.YAMLSeq.tagName && expType === 'seq') ||
64606-
!expType) {
64618+
(tagName === YAMLSeq.YAMLSeq.tagName && expType === 'seq')) {
6460764619
return resolveCollection(CN, ctx, token, onError, tagName);
6460864620
}
6460964621
let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);
@@ -64726,7 +64738,7 @@ function composeNode(ctx, token, props, onError) {
6472664738
case 'block-map':
6472764739
case 'block-seq':
6472864740
case 'flow-collection':
64729-
node = composeCollection.composeCollection(CN, ctx, token, tag, onError);
64741+
node = composeCollection.composeCollection(CN, ctx, token, props, onError);
6473064742
if (anchor)
6473164743
node.anchor = anchor.source.substring(1);
6473264744
break;
@@ -65164,7 +65176,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, ta
6516465176
}
6516565177
continue;
6516665178
}
65167-
if (keyProps.hasNewlineAfterProp || utilContainsNewline.containsNewline(key)) {
65179+
if (keyProps.newlineAfterProp || utilContainsNewline.containsNewline(key)) {
6516865180
onError(key ?? start[start.length - 1], 'MULTILINE_IMPLICIT_KEY', 'Implicit keys need to be on a single line');
6516965181
}
6517065182
}
@@ -66006,11 +66018,11 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn
6600666018
let comment = '';
6600766019
let commentSep = '';
6600866020
let hasNewline = false;
66009-
let hasNewlineAfterProp = false;
6601066021
let reqSpace = false;
6601166022
let tab = null;
6601266023
let anchor = null;
6601366024
let tag = null;
66025+
let newlineAfterProp = null;
6601466026
let comma = null;
6601566027
let found = null;
6601666028
let start = null;
@@ -66064,7 +66076,7 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn
6606466076
atNewline = true;
6606566077
hasNewline = true;
6606666078
if (anchor || tag)
66067-
hasNewlineAfterProp = true;
66079+
newlineAfterProp = token;
6606866080
hasSpace = true;
6606966081
break;
6607066082
case 'anchor':
@@ -66138,9 +66150,9 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIn
6613866150
spaceBefore,
6613966151
comment,
6614066152
hasNewline,
66141-
hasNewlineAfterProp,
6614266153
anchor,
6614366154
tag,
66155+
newlineAfterProp,
6614466156
end,
6614566157
start: start ?? end
6614666158
};
@@ -67479,7 +67491,6 @@ class Collection extends Node.NodeBase {
6747967491
}
6748067492
}
6748167493
}
67482-
Collection.maxFlowStringSingleLineLength = 60;
6748367494

6748467495
exports.Collection = Collection;
6748567496
exports.collectionFromPath = collectionFromPath;
@@ -68940,15 +68951,11 @@ class Lexer {
6894068951
if (!this.atEnd && !this.hasChars(4))
6894168952
return this.setNext('line-start');
6894268953
const s = this.peek(3);
68943-
if (s === '---' && isEmpty(this.charAt(3))) {
68954+
if ((s === '---' || s === '...') && isEmpty(this.charAt(3))) {
6894468955
yield* this.pushCount(3);
6894568956
this.indentValue = 0;
6894668957
this.indentNext = 0;
68947-
return 'doc';
68948-
}
68949-
else if (s === '...' && isEmpty(this.charAt(3))) {
68950-
yield* this.pushCount(3);
68951-
return 'stream';
68958+
return s === '---' ? 'doc' : 'stream';
6895268959
}
6895368960
}
6895468961
this.indentValue = yield* this.pushSpaces(false);
@@ -71693,6 +71700,8 @@ const FOLD_QUOTED = 'quoted';
7169371700
function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
7169471701
if (!lineWidth || lineWidth < 0)
7169571702
return text;
71703+
if (lineWidth < minContentWidth)
71704+
minContentWidth = 0;
7169671705
const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
7169771706
if (text.length <= endStep)
7169871707
return text;

package-lock.json

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
"@actions/core": "^1.10.1",
2929
"@aws-sdk/client-codedeploy": "^3.598.0",
3030
"@aws-sdk/client-ecs": "^3.620.0",
31-
"yaml": "^2.4.5"
31+
"yaml": "^2.5.0"
3232
},
3333
"devDependencies": {
3434
"@eslint/js": "^9.6.0",
3535
"@vercel/ncc": "^0.38.1",
36-
"eslint": "^9.7.0",
36+
"eslint": "^9.8.0",
3737
"globals": "^15.8.0",
3838
"jest": "^29.7.0"
3939
}

0 commit comments

Comments
 (0)