@cdklabs/cdk-cicd-wrapper 0.2.15 → 0.2.17

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 (164) hide show
  1. package/.eslintrc.js +1 -1
  2. package/.jsii +6 -6
  3. package/lib/code-pipeline/AppStage.js +1 -1
  4. package/lib/code-pipeline/CDKPipeline.js +1 -1
  5. package/lib/code-pipeline/PostDeployBuildStep.js +1 -1
  6. package/lib/code-pipeline/PreDeployBuildStep.js +1 -1
  7. package/lib/common/spi/ResourceContext.js +1 -1
  8. package/lib/common/types/BaseStackProvider.js +1 -1
  9. package/lib/common/types/DefaultStackProvider.js +1 -1
  10. package/lib/common/types/Types.js +2 -2
  11. package/lib/constructs/CodeCommitRepositoryConstruct.js +1 -1
  12. package/lib/constructs/CodeStarConnectionConstruct.js +1 -1
  13. package/lib/plugins/index.js +1 -1
  14. package/lib/plugins/optimization/DestroyEncryptionKeysOnDeletePlugin.js +1 -1
  15. package/lib/plugins/pipeline/GitHubPipelinePlugin.js +1 -1
  16. package/lib/plugins/security/AccessLogsForBucketPlugin.js +1 -1
  17. package/lib/plugins/security/DisablePublicIPAssignmentForEC2Plugin.js +1 -1
  18. package/lib/plugins/security/EncryptBucketOnTransitPlugin.js +1 -1
  19. package/lib/plugins/security/EncryptCloudWatchLogGroupsPlugin.js +1 -1
  20. package/lib/plugins/security/EncryptSNSTopicOnTransitPlugin.js +1 -1
  21. package/lib/plugins/security/LambdaDLQPlugin.js +1 -1
  22. package/lib/plugins/security/RotateEncryptionKeysPlugin.js +1 -1
  23. package/lib/plugins/utils/CodeArtifactPlugin.js +1 -1
  24. package/lib/resource-providers/CIDefinitionProvider.js +2 -2
  25. package/lib/resource-providers/CodeBuildFactoryProvider.js +2 -2
  26. package/lib/resource-providers/ComplianceBucketProvider.js +1 -1
  27. package/lib/resource-providers/EncryptionProvider.js +1 -1
  28. package/lib/resource-providers/HooksProvider.js +2 -2
  29. package/lib/resource-providers/LoggingProvider.js +1 -1
  30. package/lib/resource-providers/ParameterProvider.js +1 -1
  31. package/lib/resource-providers/PhaseCommandProvider.js +6 -6
  32. package/lib/resource-providers/ProxyProvider.js +1 -1
  33. package/lib/resource-providers/RepositoryProvider.js +4 -4
  34. package/lib/resource-providers/StageProvider.js +1 -1
  35. package/lib/resource-providers/VPCProvider.js +1 -1
  36. package/lib/stacks/CodeStarConnectRepositoryStack.js +1 -1
  37. package/lib/stacks/EncryptionStack.js +1 -1
  38. package/lib/stacks/PipelineBlueprint.js +2 -2
  39. package/lib/stacks/PostDeployExecutorStack.js +1 -1
  40. package/lib/stacks/SSMParameterStack.js +1 -1
  41. package/lib/stacks/compliance-bucket/ComplianceBucketStack.js +1 -1
  42. package/lib/stacks/vpc/ManagedVPCStack.js +1 -1
  43. package/lib/stacks/vpc/NoVPCStack.js +1 -1
  44. package/lib/stacks/vpc/VPCFromLookUpStack.js +1 -1
  45. package/lib/utils/ParameterResolver.js +1 -1
  46. package/node_modules/yaml/README.md +44 -11
  47. package/node_modules/yaml/browser/dist/compose/compose-doc.js +1 -0
  48. package/node_modules/yaml/browser/dist/compose/compose-node.js +10 -0
  49. package/node_modules/yaml/browser/dist/compose/compose-scalar.js +14 -8
  50. package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +2 -0
  51. package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +2 -0
  52. package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +4 -0
  53. package/node_modules/yaml/browser/dist/compose/resolve-props.js +1 -1
  54. package/node_modules/yaml/browser/dist/compose/util-map-includes.js +1 -5
  55. package/node_modules/yaml/browser/dist/doc/Document.js +3 -2
  56. package/node_modules/yaml/browser/dist/log.js +1 -4
  57. package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +7 -49
  58. package/node_modules/yaml/browser/dist/public-api.js +3 -0
  59. package/node_modules/yaml/browser/dist/schema/Schema.js +1 -2
  60. package/node_modules/yaml/browser/dist/schema/json/schema.js +1 -1
  61. package/node_modules/yaml/browser/dist/schema/tags.js +26 -13
  62. package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +2 -11
  63. package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +64 -0
  64. package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +2 -0
  65. package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +1 -1
  66. package/node_modules/yaml/browser/dist/stringify/stringify.js +6 -1
  67. package/node_modules/yaml/browser/dist/stringify/stringifyString.js +20 -11
  68. package/node_modules/yaml/browser/dist/util.js +1 -1
  69. package/node_modules/yaml/dist/compose/compose-collection.d.ts +4 -4
  70. package/node_modules/yaml/dist/compose/compose-doc.d.ts +6 -6
  71. package/node_modules/yaml/dist/compose/compose-doc.js +1 -0
  72. package/node_modules/yaml/dist/compose/compose-node.d.ts +8 -7
  73. package/node_modules/yaml/dist/compose/compose-node.js +10 -0
  74. package/node_modules/yaml/dist/compose/compose-scalar.d.ts +4 -4
  75. package/node_modules/yaml/dist/compose/compose-scalar.js +13 -7
  76. package/node_modules/yaml/dist/compose/composer.d.ts +7 -6
  77. package/node_modules/yaml/dist/compose/composer.js +2 -1
  78. package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +5 -5
  79. package/node_modules/yaml/dist/compose/resolve-block-map.js +2 -0
  80. package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +5 -5
  81. package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +5 -5
  82. package/node_modules/yaml/dist/compose/resolve-block-seq.js +2 -0
  83. package/node_modules/yaml/dist/compose/resolve-end.d.ts +2 -2
  84. package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -7
  85. package/node_modules/yaml/dist/compose/resolve-flow-collection.js +4 -0
  86. package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +4 -4
  87. package/node_modules/yaml/dist/compose/resolve-props.d.ts +2 -2
  88. package/node_modules/yaml/dist/compose/resolve-props.js +1 -1
  89. package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +1 -1
  90. package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +1 -1
  91. package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +2 -2
  92. package/node_modules/yaml/dist/compose/util-map-includes.d.ts +3 -3
  93. package/node_modules/yaml/dist/compose/util-map-includes.js +1 -5
  94. package/node_modules/yaml/dist/doc/Document.d.ts +11 -11
  95. package/node_modules/yaml/dist/doc/Document.js +3 -2
  96. package/node_modules/yaml/dist/doc/anchors.d.ts +2 -2
  97. package/node_modules/yaml/dist/doc/createNode.d.ts +4 -4
  98. package/node_modules/yaml/dist/doc/directives.d.ts +1 -1
  99. package/node_modules/yaml/dist/errors.d.ts +1 -1
  100. package/node_modules/yaml/dist/index.d.ts +21 -18
  101. package/node_modules/yaml/dist/log.js +4 -2
  102. package/node_modules/yaml/dist/nodes/Alias.d.ts +9 -8
  103. package/node_modules/yaml/dist/nodes/Collection.d.ts +4 -4
  104. package/node_modules/yaml/dist/nodes/Node.d.ts +15 -9
  105. package/node_modules/yaml/dist/nodes/Pair.d.ts +9 -8
  106. package/node_modules/yaml/dist/nodes/Scalar.d.ts +4 -3
  107. package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +10 -10
  108. package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +10 -10
  109. package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +3 -3
  110. package/node_modules/yaml/dist/nodes/addPairToJSMap.js +6 -48
  111. package/node_modules/yaml/dist/nodes/identity.d.ts +7 -7
  112. package/node_modules/yaml/dist/nodes/toJS.d.ts +2 -2
  113. package/node_modules/yaml/dist/options.d.ts +16 -10
  114. package/node_modules/yaml/dist/parse/cst-scalar.d.ts +4 -4
  115. package/node_modules/yaml/dist/parse/cst-stringify.d.ts +1 -1
  116. package/node_modules/yaml/dist/parse/cst-visit.d.ts +2 -2
  117. package/node_modules/yaml/dist/parse/cst.d.ts +4 -3
  118. package/node_modules/yaml/dist/parse/lexer.d.ts +1 -1
  119. package/node_modules/yaml/dist/parse/parser.d.ts +4 -4
  120. package/node_modules/yaml/dist/parse/parser.js +2 -1
  121. package/node_modules/yaml/dist/public-api.d.ts +6 -5
  122. package/node_modules/yaml/dist/public-api.js +3 -0
  123. package/node_modules/yaml/dist/schema/Schema.d.ts +4 -5
  124. package/node_modules/yaml/dist/schema/Schema.js +1 -2
  125. package/node_modules/yaml/dist/schema/common/map.d.ts +1 -1
  126. package/node_modules/yaml/dist/schema/common/null.d.ts +1 -1
  127. package/node_modules/yaml/dist/schema/common/seq.d.ts +1 -1
  128. package/node_modules/yaml/dist/schema/common/string.d.ts +1 -1
  129. package/node_modules/yaml/dist/schema/core/bool.d.ts +1 -1
  130. package/node_modules/yaml/dist/schema/core/float.d.ts +1 -1
  131. package/node_modules/yaml/dist/schema/core/int.d.ts +1 -1
  132. package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -1
  133. package/node_modules/yaml/dist/schema/json/schema.d.ts +1 -1
  134. package/node_modules/yaml/dist/schema/json/schema.js +1 -1
  135. package/node_modules/yaml/dist/schema/tags.d.ts +11 -3
  136. package/node_modules/yaml/dist/schema/tags.js +26 -13
  137. package/node_modules/yaml/dist/schema/types.d.ts +14 -12
  138. package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +1 -1
  139. package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +6 -5
  140. package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +1 -1
  141. package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +1 -1
  142. package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +1 -1
  143. package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
  144. package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +68 -0
  145. package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +11 -17
  146. package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +7 -7
  147. package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -1
  148. package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +2 -0
  149. package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +9 -9
  150. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +1 -1
  151. package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +1 -1
  152. package/node_modules/yaml/dist/stringify/stringify.d.ts +3 -3
  153. package/node_modules/yaml/dist/stringify/stringify.js +6 -1
  154. package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +2 -2
  155. package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +3 -3
  156. package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +1 -1
  157. package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +2 -2
  158. package/node_modules/yaml/dist/stringify/stringifyString.d.ts +2 -2
  159. package/node_modules/yaml/dist/stringify/stringifyString.js +20 -11
  160. package/node_modules/yaml/dist/util.d.ts +16 -12
  161. package/node_modules/yaml/dist/util.js +2 -2
  162. package/node_modules/yaml/dist/visit.d.ts +7 -7
  163. package/node_modules/yaml/package.json +4 -4
  164. package/package.json +13 -13
@@ -0,0 +1,68 @@
1
+ 'use strict';
2
+
3
+ var identity = require('../../nodes/identity.js');
4
+ var Scalar = require('../../nodes/Scalar.js');
5
+
6
+ // If the value associated with a merge key is a single mapping node, each of
7
+ // its key/value pairs is inserted into the current mapping, unless the key
8
+ // already exists in it. If the value associated with the merge key is a
9
+ // sequence, then this sequence is expected to contain mapping nodes and each
10
+ // of these nodes is merged in turn according to its order in the sequence.
11
+ // Keys in mapping nodes earlier in the sequence override keys specified in
12
+ // later mapping nodes. -- http://yaml.org/type/merge.html
13
+ const MERGE_KEY = '<<';
14
+ const merge = {
15
+ identify: value => value === MERGE_KEY ||
16
+ (typeof value === 'symbol' && value.description === MERGE_KEY),
17
+ default: 'key',
18
+ tag: 'tag:yaml.org,2002:merge',
19
+ test: /^<<$/,
20
+ resolve: () => Object.assign(new Scalar.Scalar(Symbol(MERGE_KEY)), {
21
+ addToJSMap: addMergeToJSMap
22
+ }),
23
+ stringify: () => MERGE_KEY
24
+ };
25
+ const isMergeKey = (ctx, key) => (merge.identify(key) ||
26
+ (identity.isScalar(key) &&
27
+ (!key.type || key.type === Scalar.Scalar.PLAIN) &&
28
+ merge.identify(key.value))) &&
29
+ ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
30
+ function addMergeToJSMap(ctx, map, value) {
31
+ value = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
32
+ if (identity.isSeq(value))
33
+ for (const it of value.items)
34
+ mergeValue(ctx, map, it);
35
+ else if (Array.isArray(value))
36
+ for (const it of value)
37
+ mergeValue(ctx, map, it);
38
+ else
39
+ mergeValue(ctx, map, value);
40
+ }
41
+ function mergeValue(ctx, map, value) {
42
+ const source = ctx && identity.isAlias(value) ? value.resolve(ctx.doc) : value;
43
+ if (!identity.isMap(source))
44
+ throw new Error('Merge sources must be maps or map aliases');
45
+ const srcMap = source.toJSON(null, ctx, Map);
46
+ for (const [key, value] of srcMap) {
47
+ if (map instanceof Map) {
48
+ if (!map.has(key))
49
+ map.set(key, value);
50
+ }
51
+ else if (map instanceof Set) {
52
+ map.add(key);
53
+ }
54
+ else if (!Object.prototype.hasOwnProperty.call(map, key)) {
55
+ Object.defineProperty(map, key, {
56
+ value,
57
+ writable: true,
58
+ enumerable: true,
59
+ configurable: true
60
+ });
61
+ }
62
+ }
63
+ return map;
64
+ }
65
+
66
+ exports.addMergeToJSMap = addMergeToJSMap;
67
+ exports.isMergeKey = isMergeKey;
68
+ exports.merge = merge;
@@ -1,23 +1,17 @@
1
- import { ToJSContext } from '../../nodes/toJS.js';
2
- import { YAMLSeq } from '../../nodes/YAMLSeq.js';
3
- import { CreateNodeContext } from '../../util.js';
4
- import type { Schema } from '../Schema.js';
5
- import { CollectionTag } from '../types.js';
1
+ import type { ToJSContext } from '../../nodes/toJS';
2
+ import { YAMLMap } from '../../nodes/YAMLMap';
3
+ import { YAMLSeq } from '../../nodes/YAMLSeq';
4
+ import type { CreateNodeContext } from '../../util';
5
+ import type { Schema } from '../Schema';
6
+ import type { CollectionTag } from '../types';
6
7
  export declare class YAMLOMap extends YAMLSeq {
7
8
  static tag: string;
8
9
  constructor();
9
- add: (pair: import("../../index.js").Pair<any, any> | {
10
- key: any;
11
- value: any;
12
- }, overwrite?: boolean) => void;
13
- delete: (key: unknown) => boolean;
14
- get: {
15
- (key: unknown, keepScalar: true): import("../../index.js").Scalar<any> | undefined;
16
- (key: unknown, keepScalar?: false): any;
17
- (key: unknown, keepScalar?: boolean): any;
18
- };
19
- has: (key: unknown) => boolean;
20
- set: (key: any, value: any) => void;
10
+ add: typeof YAMLMap.prototype.add;
11
+ delete: typeof YAMLMap.prototype.delete;
12
+ get: typeof YAMLMap.prototype.get;
13
+ has: typeof YAMLMap.prototype.has;
14
+ set: typeof YAMLMap.prototype.set;
21
15
  /**
22
16
  * If `ctx` is given, the return type is actually `Map<unknown, unknown>`,
23
17
  * but TypeScript won't allow widening the signature of a child method.
@@ -1,10 +1,10 @@
1
- import type { CreateNodeContext } from '../../doc/createNode.js';
2
- import type { ParsedNode } from '../../nodes/Node.js';
3
- import { Pair } from '../../nodes/Pair.js';
4
- import { YAMLMap } from '../../nodes/YAMLMap.js';
5
- import { YAMLSeq } from '../../nodes/YAMLSeq.js';
6
- import type { Schema } from '../../schema/Schema.js';
7
- import type { CollectionTag } from '../types.js';
1
+ import type { CreateNodeContext } from '../../doc/createNode';
2
+ import type { ParsedNode } from '../../nodes/Node';
3
+ import { Pair } from '../../nodes/Pair';
4
+ import type { YAMLMap } from '../../nodes/YAMLMap';
5
+ import { YAMLSeq } from '../../nodes/YAMLSeq';
6
+ import type { Schema } from '../../schema/Schema';
7
+ import type { CollectionTag } from '../types';
8
8
  export declare function resolvePairs(seq: YAMLSeq.Parsed<ParsedNode | Pair<ParsedNode, ParsedNode | null>> | YAMLMap.Parsed, onError: (message: string) => void): YAMLSeq.Parsed<Pair<ParsedNode, ParsedNode | null>>;
9
9
  export declare function createPairs(schema: Schema, iterable: unknown, ctx: CreateNodeContext): YAMLSeq<unknown>;
10
10
  export declare const pairs: CollectionTag;
@@ -1 +1 @@
1
- export declare const schema: (import("../types.js").CollectionTag | import("../types.js").ScalarTag)[];
1
+ export declare const schema: (import('../types').CollectionTag | import('../types').ScalarTag)[];
@@ -8,6 +8,7 @@ var binary = require('./binary.js');
8
8
  var bool = require('./bool.js');
9
9
  var float = require('./float.js');
10
10
  var int = require('./int.js');
11
+ var merge = require('./merge.js');
11
12
  var omap = require('./omap.js');
12
13
  var pairs = require('./pairs.js');
13
14
  var set = require('./set.js');
@@ -28,6 +29,7 @@ const schema = [
28
29
  float.floatExp,
29
30
  float.float,
30
31
  binary.binary,
32
+ merge.merge,
31
33
  omap.omap,
32
34
  pairs.pairs,
33
35
  set.set,
@@ -1,11 +1,11 @@
1
- import { Pair } from '../../nodes/Pair.js';
2
- import { Scalar } from '../../nodes/Scalar.js';
3
- import { ToJSContext } from '../../nodes/toJS.js';
4
- import { YAMLMap } from '../../nodes/YAMLMap.js';
5
- import type { Schema } from '../../schema/Schema.js';
6
- import type { StringifyContext } from '../../stringify/stringify.js';
7
- import { CreateNodeContext } from '../../util.js';
8
- import type { CollectionTag } from '../types.js';
1
+ import { Pair } from '../../nodes/Pair';
2
+ import type { Scalar } from '../../nodes/Scalar';
3
+ import type { ToJSContext } from '../../nodes/toJS';
4
+ import { YAMLMap } from '../../nodes/YAMLMap';
5
+ import type { Schema } from '../../schema/Schema';
6
+ import type { StringifyContext } from '../../stringify/stringify';
7
+ import type { CreateNodeContext } from '../../util';
8
+ import type { CollectionTag } from '../types';
9
9
  export declare class YAMLSet<T = unknown> extends YAMLMap<T, Scalar<null> | null> {
10
10
  static tag: string;
11
11
  constructor(schema?: Schema);
@@ -23,6 +23,6 @@ export declare class YAMLSet<T = unknown> extends YAMLMap<T, Scalar<null> | null
23
23
  set(key: T, value: null): void;
24
24
  toJSON(_?: unknown, ctx?: ToJSContext): any;
25
25
  toString(ctx?: StringifyContext, onComment?: () => void, onChompKeep?: () => void): string;
26
- static from(schema: Schema, iterable: unknown, ctx: CreateNodeContext): YAMLSet<unknown>;
26
+ static from(schema: Schema, iterable: unknown, ctx: CreateNodeContext): YAMLSet;
27
27
  }
28
28
  export declare const set: CollectionTag;
@@ -1,4 +1,4 @@
1
- import type { ScalarTag } from '../types.js';
1
+ import type { ScalarTag } from '../types';
2
2
  export declare const intTime: ScalarTag;
3
3
  export declare const floatTime: ScalarTag;
4
4
  export declare const timestamp: ScalarTag & {
@@ -97,7 +97,7 @@ const timestamp = {
97
97
  }
98
98
  return new Date(date);
99
99
  },
100
- stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
100
+ stringify: ({ value }) => value.toISOString().replace(/(T00:00:00)?\.000Z$/, '')
101
101
  };
102
102
 
103
103
  exports.floatTime = floatTime;
@@ -1,6 +1,6 @@
1
- import type { Document } from '../doc/Document.js';
2
- import type { Alias } from '../nodes/Alias.js';
3
- import type { ToStringOptions } from '../options.js';
1
+ import type { Document } from '../doc/Document';
2
+ import type { Alias } from '../nodes/Alias';
3
+ import type { ToStringOptions } from '../options';
4
4
  export type StringifyContext = {
5
5
  actualString?: boolean;
6
6
  allNullValues?: boolean;
@@ -56,7 +56,12 @@ function getTagObject(tags, item) {
56
56
  let obj;
57
57
  if (identity.isScalar(item)) {
58
58
  obj = item.value;
59
- const match = tags.filter(t => t.identify?.(obj));
59
+ let match = tags.filter(t => t.identify?.(obj));
60
+ if (match.length > 1) {
61
+ const testMatch = match.filter(t => t.test);
62
+ if (testMatch.length > 0)
63
+ match = testMatch;
64
+ }
60
65
  tagObj =
61
66
  match.find(t => t.format === item.format) ?? match.find(t => !t.format);
62
67
  }
@@ -1,5 +1,5 @@
1
- import { Collection } from '../nodes/Collection.js';
2
- import { StringifyContext } from './stringify.js';
1
+ import type { Collection } from '../nodes/Collection';
2
+ import type { StringifyContext } from './stringify';
3
3
  interface StringifyCollectionOptions {
4
4
  blockItemPrefix: string;
5
5
  flowChars: {
@@ -1,4 +1,4 @@
1
- import type { Document } from '../doc/Document.js';
2
- import type { Node } from '../nodes/Node.js';
3
- import type { ToStringOptions } from '../options.js';
1
+ import type { Document } from '../doc/Document';
2
+ import type { Node } from '../nodes/Node';
3
+ import type { ToStringOptions } from '../options';
4
4
  export declare function stringifyDocument(doc: Readonly<Document<Node, boolean>>, options: ToStringOptions): string;
@@ -1,2 +1,2 @@
1
- import type { Scalar } from '../nodes/Scalar.js';
1
+ import type { Scalar } from '../nodes/Scalar';
2
2
  export declare function stringifyNumber({ format, minFractionDigits, tag, value }: Scalar): string;
@@ -1,3 +1,3 @@
1
- import type { Pair } from '../nodes/Pair.js';
2
- import { StringifyContext } from './stringify.js';
1
+ import type { Pair } from '../nodes/Pair';
2
+ import type { StringifyContext } from './stringify';
3
3
  export declare function stringifyPair({ key, value }: Readonly<Pair>, ctx: StringifyContext, onComment?: () => void, onChompKeep?: () => void): string;
@@ -1,5 +1,5 @@
1
- import { Scalar } from '../nodes/Scalar.js';
2
- import type { StringifyContext } from './stringify.js';
1
+ import { Scalar } from '../nodes/Scalar';
2
+ import type { StringifyContext } from './stringify';
3
3
  interface StringifyScalar {
4
4
  value: string;
5
5
  comment?: string | null;
@@ -221,23 +221,32 @@ function blockString({ comment, type, value }, ctx, onComment, onChompKeep) {
221
221
  start = start.replace(/\n+/g, `$&${indent}`);
222
222
  }
223
223
  const indentSize = indent ? '2' : '1'; // root is at -1
224
- let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
224
+ // Leading | or > is added later
225
+ let header = (startWithSpace ? indentSize : '') + chomp;
225
226
  if (comment) {
226
227
  header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
227
228
  if (onComment)
228
229
  onComment();
229
230
  }
230
- if (literal) {
231
- value = value.replace(/\n+/g, `$&${indent}`);
232
- return `${header}\n${indent}${start}${value}${end}`;
231
+ if (!literal) {
232
+ const foldedValue = value
233
+ .replace(/\n+/g, '\n$&')
234
+ .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
235
+ // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
236
+ .replace(/\n+/g, `$&${indent}`);
237
+ let literalFallback = false;
238
+ const foldOptions = getFoldOptions(ctx, true);
239
+ if (blockQuote !== 'folded' && type !== Scalar.Scalar.BLOCK_FOLDED) {
240
+ foldOptions.onOverflow = () => {
241
+ literalFallback = true;
242
+ };
243
+ }
244
+ const body = foldFlowLines.foldFlowLines(`${start}${foldedValue}${end}`, indent, foldFlowLines.FOLD_BLOCK, foldOptions);
245
+ if (!literalFallback)
246
+ return `>${header}\n${indent}${body}`;
233
247
  }
234
- value = value
235
- .replace(/\n+/g, '\n$&')
236
- .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
237
- // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
238
- .replace(/\n+/g, `$&${indent}`);
239
- const body = foldFlowLines.foldFlowLines(`${start}${value}${end}`, indent, foldFlowLines.FOLD_BLOCK, getFoldOptions(ctx, true));
240
- return `${header}\n${indent}${body}`;
248
+ value = value.replace(/\n+/g, `$&${indent}`);
249
+ return `|${header}\n${indent}${start}${value}${end}`;
241
250
  }
242
251
  function plainString(item, ctx, onComment, onChompKeep) {
243
252
  const { type, value } = item;
@@ -1,12 +1,16 @@
1
- export { createNode, CreateNodeContext } from './doc/createNode.js';
2
- export { debug, LogLevelId, warn } from './log.js';
3
- export { createPair } from './nodes/Pair.js';
4
- export { findPair } from './nodes/YAMLMap.js';
5
- export { toJS, ToJSContext } from './nodes/toJS.js';
6
- export { map as mapTag } from './schema/common/map.js';
7
- export { seq as seqTag } from './schema/common/seq.js';
8
- export { string as stringTag } from './schema/common/string.js';
9
- export { foldFlowLines, FoldOptions } from './stringify/foldFlowLines';
10
- export { StringifyContext } from './stringify/stringify.js';
11
- export { stringifyNumber } from './stringify/stringifyNumber.js';
12
- export { stringifyString } from './stringify/stringifyString.js';
1
+ export { createNode } from './doc/createNode';
2
+ export type { CreateNodeContext } from './doc/createNode';
3
+ export { debug, warn } from './log';
4
+ export type { LogLevelId } from './log';
5
+ export { createPair } from './nodes/Pair';
6
+ export { toJS } from './nodes/toJS';
7
+ export type { ToJSContext } from './nodes/toJS';
8
+ export { findPair } from './nodes/YAMLMap';
9
+ export { map as mapTag } from './schema/common/map';
10
+ export { seq as seqTag } from './schema/common/seq';
11
+ export { string as stringTag } from './schema/common/string';
12
+ export { foldFlowLines } from './stringify/foldFlowLines';
13
+ export type { FoldOptions } from './stringify/foldFlowLines';
14
+ export type { StringifyContext } from './stringify/stringify';
15
+ export { stringifyNumber } from './stringify/stringifyNumber';
16
+ export { stringifyString } from './stringify/stringifyString';
@@ -3,8 +3,8 @@
3
3
  var createNode = require('./doc/createNode.js');
4
4
  var log = require('./log.js');
5
5
  var Pair = require('./nodes/Pair.js');
6
- var YAMLMap = require('./nodes/YAMLMap.js');
7
6
  var toJS = require('./nodes/toJS.js');
7
+ var YAMLMap = require('./nodes/YAMLMap.js');
8
8
  var map = require('./schema/common/map.js');
9
9
  var seq = require('./schema/common/seq.js');
10
10
  var string = require('./schema/common/string.js');
@@ -18,8 +18,8 @@ exports.createNode = createNode.createNode;
18
18
  exports.debug = log.debug;
19
19
  exports.warn = log.warn;
20
20
  exports.createPair = Pair.createPair;
21
- exports.findPair = YAMLMap.findPair;
22
21
  exports.toJS = toJS.toJS;
22
+ exports.findPair = YAMLMap.findPair;
23
23
  exports.mapTag = map.map;
24
24
  exports.seqTag = seq.seq;
25
25
  exports.stringTag = string.string;
@@ -1,10 +1,10 @@
1
- import type { Document } from './doc/Document.js';
2
- import type { Alias } from './nodes/Alias.js';
3
- import { Node } from './nodes/Node.js';
4
- import type { Pair } from './nodes/Pair.js';
5
- import type { Scalar } from './nodes/Scalar.js';
6
- import type { YAMLMap } from './nodes/YAMLMap.js';
7
- import type { YAMLSeq } from './nodes/YAMLSeq.js';
1
+ import type { Document } from './doc/Document';
2
+ import type { Alias } from './nodes/Alias';
3
+ import type { Node } from './nodes/Node';
4
+ import type { Pair } from './nodes/Pair';
5
+ import type { Scalar } from './nodes/Scalar';
6
+ import type { YAMLMap } from './nodes/YAMLMap';
7
+ import type { YAMLSeq } from './nodes/YAMLSeq';
8
8
  export type visitorFn<T> = (key: number | 'key' | 'value' | null, node: T, path: readonly (Document | Node | Pair)[]) => void | symbol | number | Node | Pair;
9
9
  export type visitor = visitorFn<unknown> | {
10
10
  Alias?: visitorFn<Alias>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaml",
3
- "version": "2.5.1",
3
+ "version": "2.7.0",
4
4
  "license": "ISC",
5
5
  "author": "Eemeli Aro <eemeli@gmail.com>",
6
6
  "repository": "github:eemeli/yaml",
@@ -74,7 +74,7 @@
74
74
  "@eslint/js": "^9.9.1",
75
75
  "@rollup/plugin-babel": "^6.0.3",
76
76
  "@rollup/plugin-replace": "^5.0.2",
77
- "@rollup/plugin-typescript": "^11.0.0",
77
+ "@rollup/plugin-typescript": "^12.1.1",
78
78
  "@types/jest": "^29.2.4",
79
79
  "@types/node": "^20.11.20",
80
80
  "babel-jest": "^29.0.1",
@@ -86,8 +86,8 @@
86
86
  "jest-ts-webcompat-resolver": "^1.0.0",
87
87
  "prettier": "^3.0.2",
88
88
  "rollup": "^4.12.0",
89
- "tslib": "^2.1.0",
90
- "typescript": "^5.0.3",
89
+ "tslib": "^2.8.1",
90
+ "typescript": "^5.7.2",
91
91
  "typescript-eslint": "^8.4.0"
92
92
  },
93
93
  "engines": {
package/package.json CHANGED
@@ -38,7 +38,7 @@
38
38
  "devDependencies": {
39
39
  "@aws-cdk/integ-runner": "2.149.0-alpha.0",
40
40
  "@aws-cdk/integ-tests-alpha": "2.149.0-alpha.0",
41
- "@types/jest": "^29.5.13",
41
+ "@types/jest": "^29.5.14",
42
42
  "@types/node": "^18",
43
43
  "@typescript-eslint/eslint-plugin": "^7",
44
44
  "@typescript-eslint/parser": "^7",
@@ -46,34 +46,34 @@
46
46
  "aws-cdk-lib": "2.149.0",
47
47
  "cdk-nag": "2.28.0",
48
48
  "commit-and-tag-version": "^12",
49
- "constructs": "10.3.0",
49
+ "constructs": "^10.0.0",
50
50
  "copyfiles": "^2.4.1",
51
51
  "eslint": "^8",
52
52
  "eslint-config-prettier": "^9.1.0",
53
- "eslint-import-resolver-typescript": "^3.6.3",
54
- "eslint-plugin-import": "^2.30.0",
53
+ "eslint-import-resolver-typescript": "^3.7.0",
54
+ "eslint-plugin-import": "^2.31.0",
55
55
  "eslint-plugin-prettier": "^5.2.1",
56
56
  "jest": "^29.7.0",
57
57
  "jest-junit": "^15",
58
58
  "jsii": "~5.4.0",
59
- "jsii-diff": "^1.103.1",
60
- "jsii-pacmak": "^1.103.1",
59
+ "jsii-diff": "^1.106.0",
60
+ "jsii-pacmak": "^1.106.0",
61
61
  "jsii-rosetta": "~5.4.0",
62
- "prettier": "^3.3.3",
63
- "projen": "^0.88.0",
62
+ "prettier": "^3.4.2",
63
+ "projen": "^0.91.5",
64
64
  "ts-jest": "^29.2.5",
65
- "typescript": "^5.6.2"
65
+ "typescript": "^5.7.2"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "aws-cdk-lib": "^2.149.0",
69
69
  "cdk-nag": "^2.28.0",
70
- "constructs": "^10.3.0"
70
+ "constructs": "^10.0.0"
71
71
  },
72
72
  "dependencies": {
73
73
  "@cloudcomponents/cdk-pull-request-approval-rule": "^2.4.0",
74
74
  "@cloudcomponents/cdk-pull-request-check": "^2.4.0",
75
- "cdk-pipelines-github": "^0.4.125",
76
- "yaml": "^2.5.1"
75
+ "cdk-pipelines-github": "^0.4.128",
76
+ "yaml": "^2.7.0"
77
77
  },
78
78
  "bundledDependencies": [
79
79
  "@cloudcomponents/cdk-pull-request-approval-rule",
@@ -94,7 +94,7 @@
94
94
  "publishConfig": {
95
95
  "access": "public"
96
96
  },
97
- "version": "0.2.15",
97
+ "version": "0.2.17",
98
98
  "jest": {
99
99
  "coverageProvider": "v8",
100
100
  "testMatch": [