@quilted/create 0.2.44 → 0.2.45
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/CHANGELOG.md +8 -0
- package/build/esm/_virtual/index3.mjs +1 -1
- package/build/esm/_virtual/index7.mjs +2 -2
- package/build/esm/_virtual/index8.mjs +2 -2
- package/build/esm/node_modules/.pnpm/{braces@3.0.2 → braces@3.0.3}/node_modules/braces/index.mjs +2 -2
- package/build/esm/node_modules/.pnpm/{braces@3.0.2 → braces@3.0.3}/node_modules/braces/lib/compile.mjs +12 -10
- package/build/esm/node_modules/.pnpm/{braces@3.0.2 → braces@3.0.3}/node_modules/braces/lib/constants.mjs +1 -2
- package/build/esm/node_modules/.pnpm/{braces@3.0.2 → braces@3.0.3}/node_modules/braces/lib/expand.mjs +9 -9
- package/build/esm/node_modules/.pnpm/{braces@3.0.2 → braces@3.0.3}/node_modules/braces/lib/parse.mjs +14 -14
- package/build/esm/node_modules/.pnpm/{braces@3.0.2 → braces@3.0.3}/node_modules/braces/lib/stringify.mjs +4 -4
- package/build/esm/node_modules/.pnpm/{braces@3.0.2 → braces@3.0.3}/node_modules/braces/lib/utils.mjs +9 -3
- package/build/esm/node_modules/.pnpm/dir-glob@3.0.1/node_modules/dir-glob/index.mjs +1 -3
- package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/index.mjs +39 -8
- package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/managers/tasks.mjs +40 -10
- package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/filters/deep.mjs +2 -2
- package/build/esm/node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/entry.mjs +101 -0
- package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/matchers/matcher.mjs +1 -6
- package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/matchers/partial.mjs +6 -6
- package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/settings.mjs +7 -5
- package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/utils/index.mjs +1 -1
- package/build/esm/node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.mjs +79 -0
- package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/utils/pattern.mjs +69 -29
- package/build/esm/node_modules/.pnpm/{fill-range@7.0.1 → fill-range@7.1.1}/node_modules/fill-range/index.mjs +4 -4
- package/build/esm/node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.mjs +2 -2
- package/build/esm/node_modules/.pnpm/{globby@13.1.1 → globby@13.2.2}/node_modules/globby/ignore.mjs +9 -3
- package/build/esm/node_modules/.pnpm/{globby@13.1.1 → globby@13.2.2}/node_modules/globby/index.mjs +3 -5
- package/build/esm/node_modules/.pnpm/{micromatch@4.0.5 → micromatch@4.0.8}/node_modules/micromatch/index.mjs +9 -3
- package/build/esm/node_modules/.pnpm/{prettier@3.0.0 → prettier@3.5.1}/node_modules/prettier/plugins/babel.mjs +2448 -3000
- package/build/esm/node_modules/.pnpm/prettier@3.5.1/node_modules/prettier/plugins/estree.mjs +6611 -0
- package/build/esm/node_modules/.pnpm/prettier@3.5.1/node_modules/prettier/plugins/typescript.mjs +22 -0
- package/build/esm/node_modules/.pnpm/{prettier@3.0.0 → prettier@3.5.1}/node_modules/prettier/plugins/yaml.mjs +1008 -1007
- package/build/esm/node_modules/.pnpm/prettier@3.5.1/node_modules/prettier/standalone.mjs +3878 -0
- package/build/esm/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.mjs +0 -1
- package/build/esm/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.mjs +1 -1
- package/build/esm/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.mjs +0 -1
- package/build/esm/node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.mjs +1 -1
- package/build/esm/node_modules/.pnpm/yaml@2.7.0/node_modules/yaml/browser/dist/compose/compose-collection.mjs +67 -0
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/compose-doc.mjs +3 -0
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/compose-node.mjs +13 -3
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/compose-scalar.mjs +8 -4
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/composer.mjs +1 -1
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/resolve-block-map.mjs +12 -5
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/resolve-block-scalar.mjs +6 -2
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/resolve-block-seq.mjs +10 -7
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/resolve-flow-collection.mjs +11 -3
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.mjs +14 -1
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/resolve-props.mjs +20 -7
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/util-map-includes.mjs +2 -2
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/doc/Document.mjs +13 -10
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/doc/anchors.mjs +1 -1
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/doc/applyReviver.mjs +1 -0
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/doc/createNode.mjs +4 -4
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/doc/directives.mjs +10 -3
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/errors.mjs +1 -1
- package/build/esm/node_modules/.pnpm/yaml@2.7.0/node_modules/yaml/browser/dist/log.mjs +7 -0
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/Alias.mjs +9 -2
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/Collection.mjs +2 -2
- package/build/esm/node_modules/.pnpm/yaml@2.7.0/node_modules/yaml/browser/dist/nodes/Node.mjs +44 -0
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/Pair.mjs +1 -1
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/Scalar.mjs +2 -1
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/YAMLMap.mjs +28 -4
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/YAMLSeq.mjs +22 -4
- package/build/esm/node_modules/.pnpm/yaml@2.7.0/node_modules/yaml/browser/dist/nodes/addPairToJSMap.mjs +53 -0
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1/node_modules/yaml/browser/dist/nodes/Node.mjs → yaml@2.7.0/node_modules/yaml/browser/dist/nodes/identity.mjs} +1 -14
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/toJS.mjs +1 -1
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/parse/cst.mjs +1 -0
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/parse/lexer.mjs +34 -21
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/parse/parser.mjs +16 -9
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/public-api.mjs +2 -0
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/Schema.mjs +2 -3
- package/build/esm/node_modules/.pnpm/yaml@2.7.0/node_modules/yaml/browser/dist/schema/common/map.mjs +16 -0
- package/build/esm/node_modules/.pnpm/yaml@2.7.0/node_modules/yaml/browser/dist/schema/common/seq.mjs +16 -0
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/core/float.mjs +1 -1
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/json/schema.mjs +1 -1
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/tags.mjs +20 -9
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.mjs +3 -6
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.mjs +1 -1
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/float.mjs +1 -1
- package/build/esm/node_modules/.pnpm/yaml@2.7.0/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.mjs +48 -0
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.mjs +10 -9
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.mjs +4 -2
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.mjs +2 -1
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/set.mjs +15 -14
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.mjs +2 -4
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/foldFlowLines.mjs +19 -10
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/stringify.mjs +8 -2
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/stringifyCollection.mjs +9 -17
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/stringifyDocument.mjs +1 -1
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/stringifyPair.mjs +40 -17
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/stringifyString.mjs +40 -20
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/visit.mjs +1 -1
- package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/index.mjs +2 -1
- package/build/esm/package.mjs +1 -1
- package/build/esm/shared/package-manager.mjs +1 -2
- package/build/esm/shared.mjs +1 -3
- package/build/esnext/_virtual/index3.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/async.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/providers/sync.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/async.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/providers/sync.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/@nodelib_fs.walk@1.2.8/node_modules/@nodelib/fs.walk/out/settings.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/{braces@3.0.2 → braces@3.0.3}/node_modules/braces/index.esnext +2 -2
- package/build/esnext/node_modules/.pnpm/{braces@3.0.2 → braces@3.0.3}/node_modules/braces/lib/compile.esnext +10 -9
- package/build/esnext/node_modules/.pnpm/{braces@3.0.2 → braces@3.0.3}/node_modules/braces/lib/constants.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/{braces@3.0.2 → braces@3.0.3}/node_modules/braces/lib/expand.esnext +9 -9
- package/build/esnext/node_modules/.pnpm/{braces@3.0.2 → braces@3.0.3}/node_modules/braces/lib/parse.esnext +14 -14
- package/build/esnext/node_modules/.pnpm/{braces@3.0.2 → braces@3.0.3}/node_modules/braces/lib/stringify.esnext +4 -4
- package/build/esnext/node_modules/.pnpm/{braces@3.0.2 → braces@3.0.3}/node_modules/braces/lib/utils.esnext +9 -3
- package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/index.esnext +35 -4
- package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/managers/tasks.esnext +14 -2
- package/build/esnext/node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/providers/filters/entry.esnext +92 -0
- package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/matchers/matcher.esnext +1 -2
- package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/settings.esnext +3 -2
- package/build/esnext/node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/path.esnext +58 -0
- package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/utils/pattern.esnext +27 -6
- package/build/esnext/node_modules/.pnpm/{fill-range@7.0.1 → fill-range@7.1.1}/node_modules/fill-range/index.esnext +4 -4
- package/build/esnext/node_modules/.pnpm/glob-parent@5.1.2/node_modules/glob-parent/index.esnext +2 -2
- package/build/esnext/node_modules/.pnpm/{globby@13.1.1 → globby@13.2.2}/node_modules/globby/ignore.esnext +6 -4
- package/build/esnext/node_modules/.pnpm/{globby@13.1.1 → globby@13.2.2}/node_modules/globby/index.esnext +3 -3
- package/build/esnext/node_modules/.pnpm/{micromatch@4.0.5 → micromatch@4.0.8}/node_modules/micromatch/index.esnext +8 -3
- package/build/esnext/node_modules/.pnpm/prettier@3.5.1/node_modules/prettier/plugins/babel.esnext +6956 -0
- package/build/esnext/node_modules/.pnpm/prettier@3.5.1/node_modules/prettier/plugins/estree.esnext +4320 -0
- package/build/esnext/node_modules/.pnpm/prettier@3.5.1/node_modules/prettier/plugins/typescript.esnext +12888 -0
- package/build/esnext/node_modules/.pnpm/prettier@3.5.1/node_modules/prettier/plugins/yaml.esnext +4156 -0
- package/build/esnext/node_modules/.pnpm/prettier@3.5.1/node_modules/prettier/standalone.esnext +2369 -0
- package/build/esnext/node_modules/.pnpm/yaml@2.7.0/node_modules/yaml/browser/dist/compose/compose-collection.esnext +60 -0
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/compose-doc.esnext +2 -0
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/compose-node.esnext +11 -3
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/compose-scalar.esnext +13 -5
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/composer.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/resolve-block-map.esnext +13 -4
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/resolve-block-scalar.esnext +6 -2
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/resolve-block-seq.esnext +11 -6
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/resolve-flow-collection.esnext +12 -3
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.esnext +14 -1
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/resolve-props.esnext +20 -9
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/util-map-includes.esnext +2 -2
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/doc/Document.esnext +8 -13
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/doc/anchors.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/doc/createNode.esnext +5 -3
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/doc/directives.esnext +10 -4
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/errors.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/yaml@2.7.0/node_modules/yaml/browser/dist/log.esnext +7 -0
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/Alias.esnext +8 -2
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/Collection.esnext +2 -2
- package/build/esnext/node_modules/.pnpm/yaml@2.7.0/node_modules/yaml/browser/dist/nodes/Node.esnext +36 -0
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/Pair.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/Scalar.esnext +2 -1
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/YAMLMap.esnext +31 -4
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/YAMLSeq.esnext +20 -4
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/addPairToJSMap.esnext +8 -38
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1/node_modules/yaml/browser/dist/nodes/Node.esnext → yaml@2.7.0/node_modules/yaml/browser/dist/nodes/identity.esnext} +1 -13
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/nodes/toJS.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/parse/cst.esnext +1 -0
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/parse/lexer.esnext +45 -33
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/parse/parser.esnext +12 -9
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/public-api.esnext +3 -0
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/Schema.esnext +2 -3
- package/build/esnext/node_modules/.pnpm/yaml@2.7.0/node_modules/yaml/browser/dist/schema/common/map.esnext +17 -0
- package/build/esnext/node_modules/.pnpm/yaml@2.7.0/node_modules/yaml/browser/dist/schema/common/seq.esnext +17 -0
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/core/float.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/json/schema.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/tags.esnext +22 -11
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.esnext +3 -6
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/float.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/yaml@2.7.0/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.esnext +50 -0
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.esnext +10 -9
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.esnext +4 -3
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.esnext +2 -0
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/set.esnext +15 -14
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.esnext +2 -2
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/foldFlowLines.esnext +20 -10
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/stringify.esnext +9 -2
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/stringifyCollection.esnext +20 -28
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/stringifyDocument.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/stringifyPair.esnext +44 -23
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/stringifyString.esnext +38 -20
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/visit.esnext +1 -1
- package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/index.esnext +2 -1
- package/build/esnext/package.esnext +1 -1
- package/build/esnext/shared/package-manager.esnext +1 -1
- package/build/esnext/shared.esnext +5 -6
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/typescript/shared/package-manager.d.ts.map +1 -1
- package/build/typescript/shared.d.ts.map +1 -1
- package/package.json +7 -7
- package/source/shared/package-manager.ts +0 -1
- package/source/shared.ts +1 -2
- package/templates/workspace/_nvmrc +1 -1
- package/build/esm/_virtual/patterns.mjs +0 -3
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/managers/patterns.mjs +0 -32
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/filters/entry.mjs +0 -76
- package/build/esm/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/path.mjs +0 -45
- package/build/esm/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/estree.mjs +0 -6172
- package/build/esm/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/typescript.mjs +0 -29
- package/build/esm/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/standalone.mjs +0 -4076
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/compose/compose-collection.mjs +0 -58
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/log.mjs +0 -7
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/nodes/addPairToJSMap.mjs +0 -83
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/common/map.mjs +0 -37
- package/build/esm/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/common/seq.mjs +0 -34
- package/build/esnext/_virtual/patterns.esnext +0 -3
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/managers/patterns.esnext +0 -21
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/providers/filters/entry.esnext +0 -71
- package/build/esnext/node_modules/.pnpm/fast-glob@3.2.12/node_modules/fast-glob/out/utils/path.esnext +0 -38
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/babel.esnext +0 -18
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/estree.esnext +0 -37
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/typescript.esnext +0 -29
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/plugins/yaml.esnext +0 -163
- package/build/esnext/node_modules/.pnpm/prettier@3.0.0/node_modules/prettier/standalone.esnext +0 -36
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/compose/compose-collection.esnext +0 -55
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/log.esnext +0 -10
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/common/map.esnext +0 -41
- package/build/esnext/node_modules/.pnpm/yaml@2.1.1/node_modules/yaml/browser/dist/schema/common/seq.esnext +0 -33
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/async.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/filters/error.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/provider.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/stream.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/sync.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/transformers/entry.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/readers/async.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/readers/reader.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/readers/stream.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/readers/sync.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/utils/array.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/utils/errno.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/utils/fs.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/utils/stream.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/utils/string.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{globby@13.1.1 → globby@13.2.2}/node_modules/globby/utilities.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/resolve-end.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/util-contains-newline.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/util-flow-indent-check.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/parse/line-counter.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/common/null.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/common/string.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/core/bool.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/core/int.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/core/schema.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/int.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/stringifyComment.mjs +0 -0
- /package/build/esm/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/stringifyNumber.mjs +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/async.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/filters/deep.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/filters/error.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/matchers/partial.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/provider.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/stream.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/sync.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/providers/transformers/entry.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/readers/async.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/readers/reader.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/readers/stream.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/readers/sync.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/utils/array.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/utils/errno.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/utils/fs.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/utils/index.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/utils/stream.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{fast-glob@3.2.12 → fast-glob@3.3.3}/node_modules/fast-glob/out/utils/string.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{globby@13.1.1 → globby@13.2.2}/node_modules/globby/utilities.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/resolve-end.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/util-contains-newline.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/compose/util-flow-indent-check.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/doc/applyReviver.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/parse/line-counter.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/common/null.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/common/string.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/core/bool.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/core/int.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/core/schema.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/schema/yaml-1.1/int.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/stringifyComment.esnext +0 -0
- /package/build/esnext/node_modules/.pnpm/{yaml@2.1.1 → yaml@2.7.0}/node_modules/yaml/browser/dist/stringify/stringifyNumber.esnext +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { isNode } from '../nodes/identity.esnext';
|
|
2
|
+
import { Scalar } from '../nodes/Scalar.esnext';
|
|
3
|
+
import { YAMLMap } from '../nodes/YAMLMap.esnext';
|
|
4
|
+
import { YAMLSeq } from '../nodes/YAMLSeq.esnext';
|
|
5
|
+
import { resolveBlockMap } from './resolve-block-map.esnext';
|
|
6
|
+
import { resolveBlockSeq } from './resolve-block-seq.esnext';
|
|
7
|
+
import { resolveFlowCollection } from './resolve-flow-collection.esnext';
|
|
8
|
+
|
|
9
|
+
function resolveCollection(CN, ctx, token, onError, tagName, tag) {
|
|
10
|
+
const coll = token.type === "block-map" ? resolveBlockMap(CN, ctx, token, onError, tag) : token.type === "block-seq" ? resolveBlockSeq(CN, ctx, token, onError, tag) : resolveFlowCollection(CN, ctx, token, onError, tag);
|
|
11
|
+
const Coll = coll.constructor;
|
|
12
|
+
if (tagName === "!" || tagName === Coll.tagName) {
|
|
13
|
+
coll.tag = Coll.tagName;
|
|
14
|
+
return coll;
|
|
15
|
+
}
|
|
16
|
+
if (tagName)
|
|
17
|
+
coll.tag = tagName;
|
|
18
|
+
return coll;
|
|
19
|
+
}
|
|
20
|
+
function composeCollection(CN, ctx, token, props, onError) {
|
|
21
|
+
const tagToken = props.tag;
|
|
22
|
+
const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg));
|
|
23
|
+
if (token.type === "block-seq") {
|
|
24
|
+
const { anchor, newlineAfterProp: nl } = props;
|
|
25
|
+
const lastProp = anchor && tagToken ? anchor.offset > tagToken.offset ? anchor : tagToken : anchor ?? tagToken;
|
|
26
|
+
if (lastProp && (!nl || nl.offset < lastProp.offset)) {
|
|
27
|
+
const message = "Missing newline after block sequence props";
|
|
28
|
+
onError(lastProp, "MISSING_CHAR", message);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const expType = token.type === "block-map" ? "map" : token.type === "block-seq" ? "seq" : token.start.source === "{" ? "map" : "seq";
|
|
32
|
+
if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.tagName && expType === "seq") {
|
|
33
|
+
return resolveCollection(CN, ctx, token, onError, tagName);
|
|
34
|
+
}
|
|
35
|
+
let tag = ctx.schema.tags.find((t) => t.tag === tagName && t.collection === expType);
|
|
36
|
+
if (!tag) {
|
|
37
|
+
const kt = ctx.schema.knownTags[tagName];
|
|
38
|
+
if (kt && kt.collection === expType) {
|
|
39
|
+
ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
|
|
40
|
+
tag = kt;
|
|
41
|
+
} else {
|
|
42
|
+
if (kt?.collection) {
|
|
43
|
+
onError(tagToken, "BAD_COLLECTION_TYPE", `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
|
|
44
|
+
} else {
|
|
45
|
+
onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, true);
|
|
46
|
+
}
|
|
47
|
+
return resolveCollection(CN, ctx, token, onError, tagName);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
|
|
51
|
+
const res = tag.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll;
|
|
52
|
+
const node = isNode(res) ? res : new Scalar(res);
|
|
53
|
+
node.range = coll.range;
|
|
54
|
+
node.tag = tagName;
|
|
55
|
+
if (tag?.format)
|
|
56
|
+
node.format = tag.format;
|
|
57
|
+
return node;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { composeCollection };
|
|
@@ -7,6 +7,7 @@ function composeDoc(options, directives, { offset, start, value, end }, onError)
|
|
|
7
7
|
const opts = Object.assign({ _directives: directives }, options);
|
|
8
8
|
const doc = new Document(void 0, opts);
|
|
9
9
|
const ctx = {
|
|
10
|
+
atKey: false,
|
|
10
11
|
atRoot: true,
|
|
11
12
|
directives: doc.directives,
|
|
12
13
|
options: doc.options,
|
|
@@ -17,6 +18,7 @@ function composeDoc(options, directives, { offset, start, value, end }, onError)
|
|
|
17
18
|
next: value ?? end?.[0],
|
|
18
19
|
offset,
|
|
19
20
|
onError,
|
|
21
|
+
parentIndent: 0,
|
|
20
22
|
startOnNewline: true
|
|
21
23
|
});
|
|
22
24
|
if (props.found) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Alias } from '../nodes/Alias.esnext';
|
|
2
|
+
import { isScalar } from '../nodes/identity.esnext';
|
|
2
3
|
import { composeCollection } from './compose-collection.esnext';
|
|
3
4
|
import { composeScalar } from './compose-scalar.esnext';
|
|
4
5
|
import { resolveEnd } from './resolve-end.esnext';
|
|
@@ -6,6 +7,7 @@ import { emptyScalarPosition } from './util-empty-scalar-position.esnext';
|
|
|
6
7
|
|
|
7
8
|
const CN = { composeNode, composeEmptyNode };
|
|
8
9
|
function composeNode(ctx, token, props, onError) {
|
|
10
|
+
const atKey = ctx.atKey;
|
|
9
11
|
const { spaceBefore, comment, anchor, tag } = props;
|
|
10
12
|
let node;
|
|
11
13
|
let isSrcToken = true;
|
|
@@ -26,7 +28,7 @@ function composeNode(ctx, token, props, onError) {
|
|
|
26
28
|
case "block-map":
|
|
27
29
|
case "block-seq":
|
|
28
30
|
case "flow-collection":
|
|
29
|
-
node = composeCollection(CN, ctx, token,
|
|
31
|
+
node = composeCollection(CN, ctx, token, props, onError);
|
|
30
32
|
if (anchor)
|
|
31
33
|
node.anchor = anchor.source.substring(1);
|
|
32
34
|
break;
|
|
@@ -39,6 +41,10 @@ function composeNode(ctx, token, props, onError) {
|
|
|
39
41
|
}
|
|
40
42
|
if (anchor && node.anchor === "")
|
|
41
43
|
onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
|
|
44
|
+
if (atKey && ctx.options.stringKeys && (!isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) {
|
|
45
|
+
const msg = "With stringKeys, all keys must be strings";
|
|
46
|
+
onError(tag ?? token, "NON_STRING_KEY", msg);
|
|
47
|
+
}
|
|
42
48
|
if (spaceBefore)
|
|
43
49
|
node.spaceBefore = true;
|
|
44
50
|
if (comment) {
|
|
@@ -51,7 +57,7 @@ function composeNode(ctx, token, props, onError) {
|
|
|
51
57
|
node.srcToken = token;
|
|
52
58
|
return node;
|
|
53
59
|
}
|
|
54
|
-
function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag }, onError) {
|
|
60
|
+
function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {
|
|
55
61
|
const token = {
|
|
56
62
|
type: "scalar",
|
|
57
63
|
offset: emptyScalarPosition(offset, before, pos),
|
|
@@ -66,8 +72,10 @@ function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anch
|
|
|
66
72
|
}
|
|
67
73
|
if (spaceBefore)
|
|
68
74
|
node.spaceBefore = true;
|
|
69
|
-
if (comment)
|
|
75
|
+
if (comment) {
|
|
70
76
|
node.comment = comment;
|
|
77
|
+
node.range[2] = end;
|
|
78
|
+
}
|
|
71
79
|
return node;
|
|
72
80
|
}
|
|
73
81
|
function composeAlias({ options }, { offset, source, end }, onError) {
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { SCALAR, isScalar } from '../nodes/
|
|
1
|
+
import { SCALAR, isScalar } from '../nodes/identity.esnext';
|
|
2
2
|
import { Scalar } from '../nodes/Scalar.esnext';
|
|
3
3
|
import { resolveBlockScalar } from './resolve-block-scalar.esnext';
|
|
4
4
|
import { resolveFlowScalar } from './resolve-flow-scalar.esnext';
|
|
5
5
|
|
|
6
6
|
function composeScalar(ctx, token, tagToken, onError) {
|
|
7
|
-
const { value, type, comment, range } = token.type === "block-scalar" ? resolveBlockScalar(
|
|
7
|
+
const { value, type, comment, range } = token.type === "block-scalar" ? resolveBlockScalar(ctx, token, onError) : resolveFlowScalar(token, ctx.options.strict, onError);
|
|
8
8
|
const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null;
|
|
9
|
-
|
|
9
|
+
let tag;
|
|
10
|
+
if (ctx.options.stringKeys && ctx.atKey) {
|
|
11
|
+
tag = ctx.schema[SCALAR];
|
|
12
|
+
} else if (tagName)
|
|
13
|
+
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
|
14
|
+
else if (token.type === "scalar")
|
|
15
|
+
tag = findScalarTagByTest(ctx, value, token, onError);
|
|
16
|
+
else
|
|
17
|
+
tag = ctx.schema[SCALAR];
|
|
10
18
|
let scalar;
|
|
11
19
|
try {
|
|
12
20
|
const res = tag.resolve(value, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options);
|
|
@@ -51,8 +59,8 @@ function findScalarTagByName(schema, value, tagName, tagToken, onError) {
|
|
|
51
59
|
onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
|
|
52
60
|
return schema[SCALAR];
|
|
53
61
|
}
|
|
54
|
-
function findScalarTagByTest({ directives, schema }, value, token, onError) {
|
|
55
|
-
const tag = schema.tags.find((tag2) => tag2.default && tag2.test?.test(value)) || schema[SCALAR];
|
|
62
|
+
function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
|
|
63
|
+
const tag = schema.tags.find((tag2) => (tag2.default === true || atKey && tag2.default === "key") && tag2.test?.test(value)) || schema[SCALAR];
|
|
56
64
|
if (schema.compat) {
|
|
57
65
|
const compat = schema.compat.find((tag2) => tag2.default && tag2.test?.test(value)) ?? schema[SCALAR];
|
|
58
66
|
if (tag.tag !== compat.tag) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Directives } from '../doc/directives.esnext';
|
|
2
2
|
import { Document } from '../doc/Document.esnext';
|
|
3
3
|
import { YAMLWarning, YAMLParseError } from '../errors.esnext';
|
|
4
|
-
import { isCollection, isPair } from '../nodes/
|
|
4
|
+
import { isCollection, isPair } from '../nodes/identity.esnext';
|
|
5
5
|
import { composeDoc } from './compose-doc.esnext';
|
|
6
6
|
import { resolveEnd } from './resolve-end.esnext';
|
|
7
7
|
|
|
@@ -6,11 +6,13 @@ import { flowIndentCheck } from './util-flow-indent-check.esnext';
|
|
|
6
6
|
import { mapIncludes } from './util-map-includes.esnext';
|
|
7
7
|
|
|
8
8
|
const startColMsg = "All mapping items must start at the same column";
|
|
9
|
-
function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
|
|
10
|
-
const
|
|
9
|
+
function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) {
|
|
10
|
+
const NodeClass = tag?.nodeClass ?? YAMLMap;
|
|
11
|
+
const map = new NodeClass(ctx.schema);
|
|
11
12
|
if (ctx.atRoot)
|
|
12
13
|
ctx.atRoot = false;
|
|
13
14
|
let offset = bm.offset;
|
|
15
|
+
let commentEnd = null;
|
|
14
16
|
for (const collItem of bm.items) {
|
|
15
17
|
const { start, key, sep, value } = collItem;
|
|
16
18
|
const keyProps = resolveProps(start, {
|
|
@@ -18,6 +20,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
|
|
|
18
20
|
next: key ?? sep?.[0],
|
|
19
21
|
offset,
|
|
20
22
|
onError,
|
|
23
|
+
parentIndent: bm.indent,
|
|
21
24
|
startOnNewline: true
|
|
22
25
|
});
|
|
23
26
|
const implicitKey = !keyProps.found;
|
|
@@ -29,6 +32,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
|
|
|
29
32
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
30
33
|
}
|
|
31
34
|
if (!keyProps.anchor && !keyProps.tag && !sep) {
|
|
35
|
+
commentEnd = keyProps.end;
|
|
32
36
|
if (keyProps.comment) {
|
|
33
37
|
if (map.comment)
|
|
34
38
|
map.comment += "\n" + keyProps.comment;
|
|
@@ -37,16 +41,18 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
|
|
|
37
41
|
}
|
|
38
42
|
continue;
|
|
39
43
|
}
|
|
40
|
-
if (keyProps.
|
|
44
|
+
if (keyProps.newlineAfterProp || containsNewline(key)) {
|
|
41
45
|
onError(key ?? start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
|
|
42
46
|
}
|
|
43
47
|
} else if (keyProps.found?.indent !== bm.indent) {
|
|
44
48
|
onError(offset, "BAD_INDENT", startColMsg);
|
|
45
49
|
}
|
|
50
|
+
ctx.atKey = true;
|
|
46
51
|
const keyStart = keyProps.end;
|
|
47
52
|
const keyNode = key ? composeNode(ctx, key, keyProps, onError) : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
|
|
48
53
|
if (ctx.schema.compat)
|
|
49
54
|
flowIndentCheck(bm.indent, key, onError);
|
|
55
|
+
ctx.atKey = false;
|
|
50
56
|
if (mapIncludes(ctx, map.items, keyNode))
|
|
51
57
|
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
52
58
|
const valueProps = resolveProps(sep ?? [], {
|
|
@@ -54,6 +60,7 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
|
|
|
54
60
|
next: value,
|
|
55
61
|
offset: keyNode.range[2],
|
|
56
62
|
onError,
|
|
63
|
+
parentIndent: bm.indent,
|
|
57
64
|
startOnNewline: !key || key.type === "block-scalar"
|
|
58
65
|
});
|
|
59
66
|
offset = valueProps.end;
|
|
@@ -87,7 +94,9 @@ function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError) {
|
|
|
87
94
|
map.items.push(pair);
|
|
88
95
|
}
|
|
89
96
|
}
|
|
90
|
-
|
|
97
|
+
if (commentEnd && commentEnd < offset)
|
|
98
|
+
onError(commentEnd, "IMPOSSIBLE", "Map comment with trailing content");
|
|
99
|
+
map.range = [bm.offset, offset, commentEnd ?? offset];
|
|
91
100
|
return map;
|
|
92
101
|
}
|
|
93
102
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Scalar } from '../nodes/Scalar.esnext';
|
|
2
2
|
|
|
3
|
-
function resolveBlockScalar(
|
|
3
|
+
function resolveBlockScalar(ctx, scalar, onError) {
|
|
4
4
|
const start = scalar.offset;
|
|
5
|
-
const header = parseBlockScalarHeader(scalar, strict, onError);
|
|
5
|
+
const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
|
|
6
6
|
if (!header)
|
|
7
7
|
return { value: "", type: null, comment: "", range: [start, start, start] };
|
|
8
8
|
const type = header.mode === ">" ? Scalar.BLOCK_FOLDED : Scalar.BLOCK_LITERAL;
|
|
@@ -38,6 +38,10 @@ function resolveBlockScalar(scalar, strict, onError) {
|
|
|
38
38
|
if (header.indent === 0)
|
|
39
39
|
trimIndent = indent.length;
|
|
40
40
|
contentStart = i;
|
|
41
|
+
if (trimIndent === 0 && !ctx.atRoot) {
|
|
42
|
+
const message = "Block scalar values in collections must be indented";
|
|
43
|
+
onError(offset, "BAD_INDENT", message);
|
|
44
|
+
}
|
|
41
45
|
break;
|
|
42
46
|
}
|
|
43
47
|
offset += indent.length + content.length + 1;
|
|
@@ -2,39 +2,44 @@ import { YAMLSeq } from '../nodes/YAMLSeq.esnext';
|
|
|
2
2
|
import { resolveProps } from './resolve-props.esnext';
|
|
3
3
|
import { flowIndentCheck } from './util-flow-indent-check.esnext';
|
|
4
4
|
|
|
5
|
-
function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError) {
|
|
6
|
-
const
|
|
5
|
+
function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) {
|
|
6
|
+
const NodeClass = tag?.nodeClass ?? YAMLSeq;
|
|
7
|
+
const seq = new NodeClass(ctx.schema);
|
|
7
8
|
if (ctx.atRoot)
|
|
8
9
|
ctx.atRoot = false;
|
|
10
|
+
if (ctx.atKey)
|
|
11
|
+
ctx.atKey = false;
|
|
9
12
|
let offset = bs.offset;
|
|
13
|
+
let commentEnd = null;
|
|
10
14
|
for (const { start, value } of bs.items) {
|
|
11
15
|
const props = resolveProps(start, {
|
|
12
16
|
indicator: "seq-item-ind",
|
|
13
17
|
next: value,
|
|
14
18
|
offset,
|
|
15
19
|
onError,
|
|
20
|
+
parentIndent: bs.indent,
|
|
16
21
|
startOnNewline: true
|
|
17
22
|
});
|
|
18
|
-
offset = props.end;
|
|
19
23
|
if (!props.found) {
|
|
20
24
|
if (props.anchor || props.tag || value) {
|
|
21
25
|
if (value && value.type === "block-seq")
|
|
22
|
-
onError(
|
|
26
|
+
onError(props.end, "BAD_INDENT", "All sequence items must start at the same column");
|
|
23
27
|
else
|
|
24
28
|
onError(offset, "MISSING_CHAR", "Sequence item without - indicator");
|
|
25
29
|
} else {
|
|
30
|
+
commentEnd = props.end;
|
|
26
31
|
if (props.comment)
|
|
27
32
|
seq.comment = props.comment;
|
|
28
33
|
continue;
|
|
29
34
|
}
|
|
30
35
|
}
|
|
31
|
-
const node = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx,
|
|
36
|
+
const node = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError);
|
|
32
37
|
if (ctx.schema.compat)
|
|
33
38
|
flowIndentCheck(bs.indent, value, onError);
|
|
34
39
|
offset = node.range[2];
|
|
35
40
|
seq.items.push(node);
|
|
36
41
|
}
|
|
37
|
-
seq.range = [bs.offset, offset, offset];
|
|
42
|
+
seq.range = [bs.offset, offset, commentEnd ?? offset];
|
|
38
43
|
return seq;
|
|
39
44
|
}
|
|
40
45
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isPair } from '../nodes/
|
|
1
|
+
import { isPair } from '../nodes/identity.esnext';
|
|
2
2
|
import { Pair } from '../nodes/Pair.esnext';
|
|
3
3
|
import { YAMLMap } from '../nodes/YAMLMap.esnext';
|
|
4
4
|
import { YAMLSeq } from '../nodes/YAMLSeq.esnext';
|
|
@@ -9,14 +9,17 @@ import { mapIncludes } from './util-map-includes.esnext';
|
|
|
9
9
|
|
|
10
10
|
const blockMsg = "Block collections are not allowed within flow collections";
|
|
11
11
|
const isBlock = (token) => token && (token.type === "block-map" || token.type === "block-seq");
|
|
12
|
-
function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError) {
|
|
12
|
+
function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) {
|
|
13
13
|
const isMap = fc.start.source === "{";
|
|
14
14
|
const fcName = isMap ? "flow map" : "flow sequence";
|
|
15
|
-
const
|
|
15
|
+
const NodeClass = tag?.nodeClass ?? (isMap ? YAMLMap : YAMLSeq);
|
|
16
|
+
const coll = new NodeClass(ctx.schema);
|
|
16
17
|
coll.flow = true;
|
|
17
18
|
const atRoot = ctx.atRoot;
|
|
18
19
|
if (atRoot)
|
|
19
20
|
ctx.atRoot = false;
|
|
21
|
+
if (ctx.atKey)
|
|
22
|
+
ctx.atKey = false;
|
|
20
23
|
let offset = fc.offset + fc.start.source.length;
|
|
21
24
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
22
25
|
const collItem = fc.items[i];
|
|
@@ -27,6 +30,7 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
|
|
|
27
30
|
next: key ?? sep?.[0],
|
|
28
31
|
offset,
|
|
29
32
|
onError,
|
|
33
|
+
parentIndent: fc.indent,
|
|
30
34
|
startOnNewline: false
|
|
31
35
|
});
|
|
32
36
|
if (!props.found) {
|
|
@@ -91,16 +95,19 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
|
|
|
91
95
|
if (isBlock(value))
|
|
92
96
|
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
93
97
|
} else {
|
|
98
|
+
ctx.atKey = true;
|
|
94
99
|
const keyStart = props.end;
|
|
95
100
|
const keyNode = key ? composeNode(ctx, key, props, onError) : composeEmptyNode(ctx, keyStart, start, null, props, onError);
|
|
96
101
|
if (isBlock(key))
|
|
97
102
|
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
103
|
+
ctx.atKey = false;
|
|
98
104
|
const valueProps = resolveProps(sep ?? [], {
|
|
99
105
|
flow: fcName,
|
|
100
106
|
indicator: "map-value-ind",
|
|
101
107
|
next: value,
|
|
102
108
|
offset: keyNode.range[2],
|
|
103
109
|
onError,
|
|
110
|
+
parentIndent: fc.indent,
|
|
104
111
|
startOnNewline: false
|
|
105
112
|
});
|
|
106
113
|
if (valueProps.found) {
|
|
@@ -145,6 +152,8 @@ function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onErr
|
|
|
145
152
|
const map = new YAMLMap(ctx.schema);
|
|
146
153
|
map.flow = true;
|
|
147
154
|
map.items.push(pair);
|
|
155
|
+
const endRange = (valueNode ?? keyNode).range;
|
|
156
|
+
map.range = [keyNode.range[0], endRange[1], endRange[2]];
|
|
148
157
|
coll.items.push(map);
|
|
149
158
|
}
|
|
150
159
|
offset = valueNode ? valueNode.range[2] : valueProps.end;
|
|
@@ -76,7 +76,7 @@ function foldLines(source) {
|
|
|
76
76
|
try {
|
|
77
77
|
first = new RegExp("(.*?)(?<![ ])[ ]*\r?\n", "sy");
|
|
78
78
|
line = new RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n", "sy");
|
|
79
|
-
} catch
|
|
79
|
+
} catch {
|
|
80
80
|
first = /(.*?)[ \t]*\r?\n/sy;
|
|
81
81
|
line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
|
|
82
82
|
}
|
|
@@ -168,18 +168,31 @@ function foldNewline(source, offset) {
|
|
|
168
168
|
}
|
|
169
169
|
const escapeCodes = {
|
|
170
170
|
"0": "\0",
|
|
171
|
+
// null character
|
|
171
172
|
a: "\x07",
|
|
173
|
+
// bell character
|
|
172
174
|
b: "\b",
|
|
175
|
+
// backspace
|
|
173
176
|
e: "\x1B",
|
|
177
|
+
// escape character
|
|
174
178
|
f: "\f",
|
|
179
|
+
// form feed
|
|
175
180
|
n: "\n",
|
|
181
|
+
// line feed
|
|
176
182
|
r: "\r",
|
|
183
|
+
// carriage return
|
|
177
184
|
t: " ",
|
|
185
|
+
// horizontal tab
|
|
178
186
|
v: "\v",
|
|
187
|
+
// vertical tab
|
|
179
188
|
N: "\x85",
|
|
189
|
+
// Unicode next line
|
|
180
190
|
_: "\xA0",
|
|
191
|
+
// Unicode non-breaking space
|
|
181
192
|
L: "\u2028",
|
|
193
|
+
// Unicode line separator
|
|
182
194
|
P: "\u2029",
|
|
195
|
+
// Unicode paragraph separator
|
|
183
196
|
" ": " ",
|
|
184
197
|
'"': '"',
|
|
185
198
|
"/": "/",
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnNewline }) {
|
|
1
|
+
function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
|
|
2
2
|
let spaceBefore = false;
|
|
3
3
|
let atNewline = startOnNewline;
|
|
4
4
|
let hasSpace = startOnNewline;
|
|
5
5
|
let comment = "";
|
|
6
6
|
let commentSep = "";
|
|
7
7
|
let hasNewline = false;
|
|
8
|
-
let hasNewlineAfterProp = false;
|
|
9
8
|
let reqSpace = false;
|
|
9
|
+
let tab = null;
|
|
10
10
|
let anchor = null;
|
|
11
11
|
let tag = null;
|
|
12
|
+
let newlineAfterProp = null;
|
|
12
13
|
let comma = null;
|
|
13
14
|
let found = null;
|
|
14
15
|
let start = null;
|
|
@@ -18,10 +19,17 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
|
|
|
18
19
|
onError(token.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space");
|
|
19
20
|
reqSpace = false;
|
|
20
21
|
}
|
|
22
|
+
if (tab) {
|
|
23
|
+
if (atNewline && token.type !== "comment" && token.type !== "newline") {
|
|
24
|
+
onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation");
|
|
25
|
+
}
|
|
26
|
+
tab = null;
|
|
27
|
+
}
|
|
21
28
|
switch (token.type) {
|
|
22
29
|
case "space":
|
|
23
|
-
if (!flow &&
|
|
24
|
-
|
|
30
|
+
if (!flow && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes(" ")) {
|
|
31
|
+
tab = token;
|
|
32
|
+
}
|
|
25
33
|
hasSpace = true;
|
|
26
34
|
break;
|
|
27
35
|
case "comment": {
|
|
@@ -40,14 +48,14 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
|
|
|
40
48
|
if (atNewline) {
|
|
41
49
|
if (comment)
|
|
42
50
|
comment += token.source;
|
|
43
|
-
else
|
|
51
|
+
else if (!found || indicator !== "seq-item-ind")
|
|
44
52
|
spaceBefore = true;
|
|
45
53
|
} else
|
|
46
54
|
commentSep += token.source;
|
|
47
55
|
atNewline = true;
|
|
48
56
|
hasNewline = true;
|
|
49
57
|
if (anchor || tag)
|
|
50
|
-
|
|
58
|
+
newlineAfterProp = token;
|
|
51
59
|
hasSpace = true;
|
|
52
60
|
break;
|
|
53
61
|
case "anchor":
|
|
@@ -79,7 +87,7 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
|
|
|
79
87
|
if (found)
|
|
80
88
|
onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow ?? "collection"}`);
|
|
81
89
|
found = token;
|
|
82
|
-
atNewline =
|
|
90
|
+
atNewline = indicator === "seq-item-ind" || indicator === "explicit-key-ind";
|
|
83
91
|
hasSpace = false;
|
|
84
92
|
break;
|
|
85
93
|
case "comma":
|
|
@@ -100,17 +108,20 @@ function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnN
|
|
|
100
108
|
}
|
|
101
109
|
const last = tokens[tokens.length - 1];
|
|
102
110
|
const end = last ? last.offset + last.source.length : offset;
|
|
103
|
-
if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== ""))
|
|
111
|
+
if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== "")) {
|
|
104
112
|
onError(next.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space");
|
|
113
|
+
}
|
|
114
|
+
if (tab && (atNewline && tab.indent <= parentIndent || next?.type === "block-map" || next?.type === "block-seq"))
|
|
115
|
+
onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation");
|
|
105
116
|
return {
|
|
106
117
|
comma,
|
|
107
118
|
found,
|
|
108
119
|
spaceBefore,
|
|
109
120
|
comment,
|
|
110
121
|
hasNewline,
|
|
111
|
-
hasNewlineAfterProp,
|
|
112
122
|
anchor,
|
|
113
123
|
tag,
|
|
124
|
+
newlineAfterProp,
|
|
114
125
|
end,
|
|
115
126
|
start: start ?? end
|
|
116
127
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { isScalar } from '../nodes/
|
|
1
|
+
import { isScalar } from '../nodes/identity.esnext';
|
|
2
2
|
|
|
3
3
|
function mapIncludes(ctx, items, search) {
|
|
4
4
|
const { uniqueKeys } = ctx.options;
|
|
5
5
|
if (uniqueKeys === false)
|
|
6
6
|
return false;
|
|
7
|
-
const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || isScalar(a) && isScalar(b) && a.value === b.value
|
|
7
|
+
const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || isScalar(a) && isScalar(b) && a.value === b.value;
|
|
8
8
|
return items.some((pair) => isEqual(pair.key, search));
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Alias } from '../nodes/Alias.esnext';
|
|
2
2
|
import { isEmptyPath, collectionFromPath } from '../nodes/Collection.esnext';
|
|
3
|
-
import { NODE_TYPE, DOC, isNode, isCollection, isScalar } from '../nodes/
|
|
3
|
+
import { NODE_TYPE, DOC, isNode, isCollection, isScalar } from '../nodes/identity.esnext';
|
|
4
4
|
import { Pair } from '../nodes/Pair.esnext';
|
|
5
5
|
import { toJS } from '../nodes/toJS.esnext';
|
|
6
6
|
import { Schema } from '../schema/Schema.esnext';
|
|
7
|
-
import { stringify } from '../stringify/stringify.esnext';
|
|
8
7
|
import { stringifyDocument } from '../stringify/stringifyDocument.esnext';
|
|
9
8
|
import { anchorNames, findNewAnchor, createNodeAnchors } from './anchors.esnext';
|
|
10
9
|
import { applyReviver } from './applyReviver.esnext';
|
|
@@ -31,6 +30,7 @@ class Document {
|
|
|
31
30
|
logLevel: "warn",
|
|
32
31
|
prettyErrors: true,
|
|
33
32
|
strict: true,
|
|
33
|
+
stringKeys: false,
|
|
34
34
|
uniqueKeys: true,
|
|
35
35
|
version: "1.2"
|
|
36
36
|
}, options);
|
|
@@ -43,11 +43,7 @@ class Document {
|
|
|
43
43
|
} else
|
|
44
44
|
this.directives = new Directives({ version });
|
|
45
45
|
this.setSchema(version, options);
|
|
46
|
-
|
|
47
|
-
this.contents = null;
|
|
48
|
-
else {
|
|
49
|
-
this.contents = this.createNode(value, _replacer, options);
|
|
50
|
-
}
|
|
46
|
+
this.contents = value === void 0 ? null : this.createNode(value, _replacer, options);
|
|
51
47
|
}
|
|
52
48
|
/**
|
|
53
49
|
* Create a deep copy of this Document and its contents.
|
|
@@ -211,9 +207,9 @@ class Document {
|
|
|
211
207
|
* boolean to add/remove the item from the set.
|
|
212
208
|
*/
|
|
213
209
|
setIn(path, value) {
|
|
214
|
-
if (isEmptyPath(path))
|
|
210
|
+
if (isEmptyPath(path)) {
|
|
215
211
|
this.contents = value;
|
|
216
|
-
else if (this.contents == null) {
|
|
212
|
+
} else if (this.contents == null) {
|
|
217
213
|
this.contents = collectionFromPath(this.schema, Array.from(path), value);
|
|
218
214
|
} else if (assertCollection(this.contents)) {
|
|
219
215
|
this.contents.setIn(path, value);
|
|
@@ -236,7 +232,7 @@ class Document {
|
|
|
236
232
|
this.directives.yaml.version = "1.1";
|
|
237
233
|
else
|
|
238
234
|
this.directives = new Directives({ version: "1.1" });
|
|
239
|
-
opt = {
|
|
235
|
+
opt = { resolveKnownTags: false, schema: "yaml-1.1" };
|
|
240
236
|
break;
|
|
241
237
|
case "1.2":
|
|
242
238
|
case "next":
|
|
@@ -244,7 +240,7 @@ class Document {
|
|
|
244
240
|
this.directives.yaml.version = version;
|
|
245
241
|
else
|
|
246
242
|
this.directives = new Directives({ version });
|
|
247
|
-
opt = {
|
|
243
|
+
opt = { resolveKnownTags: true, schema: "core" };
|
|
248
244
|
break;
|
|
249
245
|
case null:
|
|
250
246
|
if (this.directives)
|
|
@@ -271,8 +267,7 @@ class Document {
|
|
|
271
267
|
keep: !json,
|
|
272
268
|
mapAsMap: mapAsMap === true,
|
|
273
269
|
mapKeyWarned: false,
|
|
274
|
-
maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100
|
|
275
|
-
stringify
|
|
270
|
+
maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100
|
|
276
271
|
};
|
|
277
272
|
const res = toJS(this.contents, jsonArg ?? "", ctx);
|
|
278
273
|
if (typeof onAnchor === "function")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Alias } from '../nodes/Alias.esnext';
|
|
2
|
-
import { isDocument, isNode, isPair, MAP, SEQ } from '../nodes/
|
|
2
|
+
import { isDocument, isNode, isPair, MAP, SEQ } from '../nodes/identity.esnext';
|
|
3
3
|
import { Scalar } from '../nodes/Scalar.esnext';
|
|
4
4
|
|
|
5
5
|
const defaultTagPrefix = "tag:yaml.org,2002:";
|
|
@@ -23,7 +23,7 @@ function createNode(value, tagName, ctx) {
|
|
|
23
23
|
map.items.push(value);
|
|
24
24
|
return map;
|
|
25
25
|
}
|
|
26
|
-
if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt
|
|
26
|
+
if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
|
|
27
27
|
value = value.valueOf();
|
|
28
28
|
}
|
|
29
29
|
const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx;
|
|
@@ -58,9 +58,11 @@ function createNode(value, tagName, ctx) {
|
|
|
58
58
|
onTagObj(tagObj);
|
|
59
59
|
delete ctx.onTagObj;
|
|
60
60
|
}
|
|
61
|
-
const node = tagObj?.createNode ? tagObj.createNode(ctx.schema, value, ctx) : new Scalar(value);
|
|
61
|
+
const node = tagObj?.createNode ? tagObj.createNode(ctx.schema, value, ctx) : typeof tagObj?.nodeClass?.from === "function" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new Scalar(value);
|
|
62
62
|
if (tagName)
|
|
63
63
|
node.tag = tagName;
|
|
64
|
+
else if (!tagObj.default)
|
|
65
|
+
node.tag = tagObj.tag;
|
|
64
66
|
if (ref)
|
|
65
67
|
ref.node = node;
|
|
66
68
|
return node;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isNode } from '../nodes/
|
|
1
|
+
import { isNode } from '../nodes/identity.esnext';
|
|
2
2
|
import { visit } from '../visit.esnext';
|
|
3
3
|
|
|
4
4
|
const escapeChars = {
|
|
@@ -110,12 +110,18 @@ class Directives {
|
|
|
110
110
|
onError("Verbatim tags must end with a >");
|
|
111
111
|
return verbatim;
|
|
112
112
|
}
|
|
113
|
-
const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/);
|
|
113
|
+
const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);
|
|
114
114
|
if (!suffix)
|
|
115
115
|
onError(`The ${source} tag has no suffix`);
|
|
116
116
|
const prefix = this.tags[handle];
|
|
117
|
-
if (prefix)
|
|
118
|
-
|
|
117
|
+
if (prefix) {
|
|
118
|
+
try {
|
|
119
|
+
return prefix + decodeURIComponent(suffix);
|
|
120
|
+
} catch (error) {
|
|
121
|
+
onError(String(error));
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
119
125
|
if (handle === "!")
|
|
120
126
|
return source;
|
|
121
127
|
onError(`Could not resolve tag: ${source}`);
|