projen 0.51.4 → 0.51.8
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/.jsii +69 -9
- package/API.md +12 -1
- package/changelog.md +1 -1
- package/lib/awscdk/auto-discover.js +1 -1
- package/lib/awscdk/awscdk-app-java.js +1 -1
- package/lib/awscdk/awscdk-app-ts.js +1 -1
- package/lib/awscdk/awscdk-construct.js +2 -2
- package/lib/awscdk/awscdk-deps-java.js +1 -1
- package/lib/awscdk/awscdk-deps-js.js +1 -1
- package/lib/awscdk/awscdk-deps.js +1 -1
- package/lib/awscdk/cdk-config.js +1 -1
- package/lib/awscdk/cdk-tasks.js +1 -1
- package/lib/awscdk/integration-test.js +9 -2
- package/lib/awscdk/lambda-function.js +2 -2
- package/lib/build/build-workflow.js +1 -1
- package/lib/cdk/construct-lib.js +1 -1
- package/lib/cdk/jsii-docgen.js +1 -1
- package/lib/cdk/jsii-project.js +1 -1
- package/lib/cdk8s/cdk8s-app-ts.js +1 -1
- package/lib/cdk8s/cdk8s-construct.js +1 -1
- package/lib/cdktf/cdktf-construct.js +1 -1
- package/lib/component.js +1 -1
- package/lib/dependencies.js +1 -1
- package/lib/dev-env.js +1 -1
- package/lib/docker-compose.js +2 -2
- package/lib/file.js +1 -1
- package/lib/gitattributes.js +1 -1
- package/lib/github/auto-approve.js +1 -1
- package/lib/github/auto-merge.js +1 -1
- package/lib/github/dependabot.js +1 -1
- package/lib/github/github-project.js +1 -1
- package/lib/github/github.js +1 -1
- package/lib/github/mergify.js +1 -1
- package/lib/github/pr-template.js +1 -1
- package/lib/github/pull-request-lint.js +1 -1
- package/lib/github/stale-util.js +12 -7
- package/lib/github/stale.d.ts +10 -1
- package/lib/github/stale.js +10 -2
- package/lib/github/task-workflow.js +1 -1
- package/lib/github/workflows.js +1 -1
- package/lib/gitlab/configuration.js +1 -1
- package/lib/gitlab/gitlab-configuration.js +1 -1
- package/lib/gitlab/nested-configuration.js +1 -1
- package/lib/gitpod.js +1 -1
- package/lib/ignore-file.js +1 -1
- package/lib/ini.js +1 -1
- package/lib/java/java-project.js +1 -1
- package/lib/java/junit.js +1 -1
- package/lib/java/maven-compile.js +1 -1
- package/lib/java/maven-packaging.js +1 -1
- package/lib/java/maven-sample.js +1 -1
- package/lib/java/pom.js +1 -1
- package/lib/java/projenrc.js +1 -1
- package/lib/javascript/bundler.js +1 -1
- package/lib/javascript/eslint.js +1 -1
- package/lib/javascript/jest.js +1 -1
- package/lib/javascript/node-package.js +1 -1
- package/lib/javascript/node-project.js +1 -1
- package/lib/javascript/npm-config.js +1 -1
- package/lib/javascript/prettier.js +1 -1
- package/lib/javascript/projenrc.js +1 -1
- package/lib/javascript/typescript-config.js +1 -1
- package/lib/javascript/upgrade-dependencies.js +2 -2
- package/lib/json.js +1 -1
- package/lib/license.js +1 -1
- package/lib/logger.js +1 -1
- package/lib/makefile.js +1 -1
- package/lib/object-file.js +1 -1
- package/lib/project-build.js +1 -1
- package/lib/project.js +1 -1
- package/lib/projects.js +1 -1
- package/lib/projenrc-json.js +1 -1
- package/lib/python/pip.js +1 -1
- package/lib/python/poetry.js +2 -2
- package/lib/python/projenrc.js +1 -1
- package/lib/python/pytest.js +1 -1
- package/lib/python/python-project.js +1 -1
- package/lib/python/python-sample.js +1 -1
- package/lib/python/requirements-file.js +1 -1
- package/lib/python/setuppy.js +1 -1
- package/lib/python/setuptools.js +1 -1
- package/lib/python/venv.js +1 -1
- package/lib/readme.js +1 -1
- package/lib/release/publisher.js +1 -1
- package/lib/release/release-trigger.js +1 -1
- package/lib/release/release.js +1 -1
- package/lib/sample-file.js +2 -2
- package/lib/semver.js +1 -1
- package/lib/source-code.js +1 -1
- package/lib/task-runtime.js +1 -1
- package/lib/task.js +1 -1
- package/lib/tasks.js +1 -1
- package/lib/testing.js +1 -1
- package/lib/textfile.js +1 -1
- package/lib/toml.js +1 -1
- package/lib/typescript/projenrc.js +1 -1
- package/lib/typescript/typescript-typedoc.js +1 -1
- package/lib/typescript/typescript.js +3 -3
- package/lib/version.js +1 -1
- package/lib/vscode/devcontainer.js +1 -1
- package/lib/vscode/launch-config.js +1 -1
- package/lib/vscode/vscode.js +1 -1
- package/lib/web/next.js +3 -3
- package/lib/web/postcss.js +1 -1
- package/lib/web/react.js +4 -4
- package/lib/web/tailwind.js +1 -1
- package/lib/xmlfile.js +1 -1
- package/lib/yaml.d.ts +13 -0
- package/lib/yaml.js +8 -3
- package/node_modules/{fs-extra/node_modules/universalify → universalify}/LICENSE +0 -0
- package/node_modules/{fs-extra/node_modules/universalify → universalify}/README.md +0 -0
- package/node_modules/{fs-extra/node_modules/universalify → universalify}/index.js +0 -0
- package/node_modules/{fs-extra/node_modules/universalify → universalify}/package.json +0 -0
- package/node_modules/yaml/LICENSE +1 -1
- package/node_modules/yaml/README.md +57 -41
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +59 -0
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +40 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +81 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +81 -0
- package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +107 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +185 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +45 -0
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +200 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +223 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +128 -0
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +27 -0
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +17 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +321 -0
- package/node_modules/yaml/browser/dist/doc/anchors.js +72 -0
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +54 -0
- package/node_modules/yaml/browser/dist/doc/createNode.js +84 -0
- package/node_modules/yaml/browser/dist/doc/directives.js +166 -0
- package/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/yaml/browser/dist/index.js +18 -1002
- package/node_modules/yaml/browser/dist/log.js +14 -0
- package/node_modules/yaml/browser/dist/node_modules/tslib/tslib.es6.js +164 -0
- package/node_modules/yaml/browser/dist/nodes/Alias.js +94 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +146 -0
- package/node_modules/yaml/browser/dist/nodes/Node.js +48 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +23 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +116 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +105 -0
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +104 -0
- package/node_modules/yaml/browser/dist/nodes/toJS.js +35 -0
- package/node_modules/yaml/browser/dist/options.js +18 -0
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +215 -0
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/yaml/browser/dist/parse/lexer.js +692 -0
- package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +882 -0
- package/node_modules/yaml/browser/dist/public-api.js +99 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +34 -0
- package/node_modules/yaml/browser/dist/schema/common/map.js +42 -0
- package/node_modules/yaml/browser/dist/schema/common/null.js +13 -0
- package/node_modules/yaml/browser/dist/schema/common/seq.js +33 -0
- package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/yaml/browser/dist/schema/tags.js +83 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +66 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +73 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +77 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +37 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +87 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +135 -0
- package/node_modules/yaml/browser/dist/stringify/stringify.js +124 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +152 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +18 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +68 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +24 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +122 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +314 -0
- package/node_modules/yaml/browser/dist/util.js +9 -2
- package/node_modules/yaml/browser/dist/visit.js +146 -0
- package/node_modules/yaml/browser/index.js +5 -1
- package/node_modules/yaml/browser/package.json +3 -0
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +61 -0
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +6 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +42 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +26 -0
- package/node_modules/yaml/dist/compose/compose-node.js +84 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +83 -0
- package/node_modules/yaml/dist/compose/composer.d.ts +62 -0
- package/node_modules/yaml/dist/compose/composer.js +223 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +109 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +187 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +5 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +47 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +202 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +225 -0
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +21 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +130 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +29 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +19 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +139 -0
- package/node_modules/yaml/dist/doc/Document.js +323 -0
- package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/yaml/dist/doc/anchors.js +77 -0
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +56 -0
- package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/yaml/dist/doc/createNode.js +86 -0
- package/node_modules/yaml/dist/doc/directives.d.ts +47 -0
- package/node_modules/yaml/dist/doc/directives.js +168 -0
- package/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.d.ts +19 -0
- package/node_modules/yaml/dist/index.js +49 -77
- package/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/yaml/dist/log.js +17 -0
- package/node_modules/yaml/dist/node_modules/tslib/tslib.es6.js +76 -0
- package/node_modules/yaml/dist/nodes/Alias.d.ts +28 -0
- package/node_modules/yaml/dist/nodes/Alias.js +96 -0
- package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/yaml/dist/nodes/Collection.js +150 -0
- package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/Node.js +66 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +21 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +42 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +26 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +41 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +119 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +55 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +107 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +3 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +106 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +30 -0
- package/node_modules/yaml/dist/nodes/toJS.js +37 -0
- package/node_modules/yaml/dist/options.d.ts +338 -0
- package/node_modules/yaml/dist/options.js +20 -0
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +219 -0
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.d.ts +106 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/yaml/dist/parse/lexer.js +694 -0
- package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/yaml/dist/parse/parser.js +886 -0
- package/node_modules/yaml/dist/public-api.d.ts +43 -0
- package/node_modules/yaml/dist/public-api.js +104 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +18 -0
- package/node_modules/yaml/dist/schema/Schema.js +36 -0
- package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/map.js +44 -0
- package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/yaml/dist/schema/common/null.js +15 -0
- package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/seq.js +35 -0
- package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +40 -0
- package/node_modules/yaml/dist/schema/tags.js +86 -0
- package/node_modules/yaml/dist/schema/types.d.ts +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +68 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +21 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +81 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +22 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +90 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +140 -0
- package/node_modules/yaml/dist/stringify/stringify.d.ts +20 -0
- package/node_modules/yaml/dist/stringify/stringify.js +127 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +154 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +22 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +70 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +26 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +124 -0
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +316 -0
- package/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/yaml/dist/test-events.js +126 -152
- package/node_modules/yaml/dist/util.d.ts +9 -0
- package/node_modules/yaml/dist/util.js +19 -14
- package/node_modules/yaml/dist/visit.d.ts +63 -0
- package/node_modules/yaml/dist/visit.js +148 -0
- package/node_modules/yaml/package.json +43 -55
- package/node_modules/yaml/util.d.ts +3 -86
- package/node_modules/yaml/util.js +2 -16
- package/package.json +3 -3
- package/releasetag.txt +1 -1
- package/version.txt +1 -1
- package/node_modules/jsonfile/node_modules/universalify/LICENSE +0 -20
- package/node_modules/jsonfile/node_modules/universalify/README.md +0 -76
- package/node_modules/jsonfile/node_modules/universalify/index.js +0 -24
- package/node_modules/jsonfile/node_modules/universalify/package.json +0 -34
- package/node_modules/yaml/browser/dist/PlainValue-b8036b75.js +0 -1275
- package/node_modules/yaml/browser/dist/Schema-e94716c8.js +0 -682
- package/node_modules/yaml/browser/dist/legacy-exports.js +0 -3
- package/node_modules/yaml/browser/dist/package.json +0 -1
- package/node_modules/yaml/browser/dist/parse-cst.js +0 -1904
- package/node_modules/yaml/browser/dist/resolveSeq-492ab440.js +0 -2419
- package/node_modules/yaml/browser/dist/types.js +0 -4
- package/node_modules/yaml/browser/dist/warnings-df54cb69.js +0 -499
- package/node_modules/yaml/browser/map.js +0 -2
- package/node_modules/yaml/browser/pair.js +0 -2
- package/node_modules/yaml/browser/parse-cst.js +0 -1
- package/node_modules/yaml/browser/scalar.js +0 -2
- package/node_modules/yaml/browser/schema.js +0 -9
- package/node_modules/yaml/browser/seq.js +0 -2
- package/node_modules/yaml/browser/types/binary.js +0 -8
- package/node_modules/yaml/browser/types/omap.js +0 -3
- package/node_modules/yaml/browser/types/pairs.js +0 -3
- package/node_modules/yaml/browser/types/set.js +0 -3
- package/node_modules/yaml/browser/types/timestamp.js +0 -10
- package/node_modules/yaml/browser/types.js +0 -1
- package/node_modules/yaml/browser/util.js +0 -1
- package/node_modules/yaml/dist/Document-9b4560a1.js +0 -757
- package/node_modules/yaml/dist/PlainValue-ec8e588e.js +0 -876
- package/node_modules/yaml/dist/Schema-88e323a7.js +0 -525
- package/node_modules/yaml/dist/legacy-exports.js +0 -16
- package/node_modules/yaml/dist/parse-cst.js +0 -1753
- package/node_modules/yaml/dist/resolveSeq-d03cb037.js +0 -2161
- package/node_modules/yaml/dist/types.js +0 -23
- package/node_modules/yaml/dist/warnings-1000a372.js +0 -416
- package/node_modules/yaml/index.d.ts +0 -372
- package/node_modules/yaml/index.js +0 -1
- package/node_modules/yaml/map.js +0 -2
- package/node_modules/yaml/pair.js +0 -2
- package/node_modules/yaml/parse-cst.d.ts +0 -191
- package/node_modules/yaml/parse-cst.js +0 -1
- package/node_modules/yaml/scalar.js +0 -2
- package/node_modules/yaml/schema.js +0 -9
- package/node_modules/yaml/seq.js +0 -2
- package/node_modules/yaml/types/binary.js +0 -8
- package/node_modules/yaml/types/omap.js +0 -3
- package/node_modules/yaml/types/pairs.js +0 -3
- package/node_modules/yaml/types/set.js +0 -3
- package/node_modules/yaml/types/timestamp.js +0 -10
- package/node_modules/yaml/types.d.ts +0 -407
- package/node_modules/yaml/types.js +0 -17
- package/node_modules/yaml/types.mjs +0 -17
- package/node_modules/yaml/util.mjs +0 -18
|
@@ -1,876 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const Char = {
|
|
4
|
-
ANCHOR: '&',
|
|
5
|
-
COMMENT: '#',
|
|
6
|
-
TAG: '!',
|
|
7
|
-
DIRECTIVES_END: '-',
|
|
8
|
-
DOCUMENT_END: '.'
|
|
9
|
-
};
|
|
10
|
-
const Type = {
|
|
11
|
-
ALIAS: 'ALIAS',
|
|
12
|
-
BLANK_LINE: 'BLANK_LINE',
|
|
13
|
-
BLOCK_FOLDED: 'BLOCK_FOLDED',
|
|
14
|
-
BLOCK_LITERAL: 'BLOCK_LITERAL',
|
|
15
|
-
COMMENT: 'COMMENT',
|
|
16
|
-
DIRECTIVE: 'DIRECTIVE',
|
|
17
|
-
DOCUMENT: 'DOCUMENT',
|
|
18
|
-
FLOW_MAP: 'FLOW_MAP',
|
|
19
|
-
FLOW_SEQ: 'FLOW_SEQ',
|
|
20
|
-
MAP: 'MAP',
|
|
21
|
-
MAP_KEY: 'MAP_KEY',
|
|
22
|
-
MAP_VALUE: 'MAP_VALUE',
|
|
23
|
-
PLAIN: 'PLAIN',
|
|
24
|
-
QUOTE_DOUBLE: 'QUOTE_DOUBLE',
|
|
25
|
-
QUOTE_SINGLE: 'QUOTE_SINGLE',
|
|
26
|
-
SEQ: 'SEQ',
|
|
27
|
-
SEQ_ITEM: 'SEQ_ITEM'
|
|
28
|
-
};
|
|
29
|
-
const defaultTagPrefix = 'tag:yaml.org,2002:';
|
|
30
|
-
const defaultTags = {
|
|
31
|
-
MAP: 'tag:yaml.org,2002:map',
|
|
32
|
-
SEQ: 'tag:yaml.org,2002:seq',
|
|
33
|
-
STR: 'tag:yaml.org,2002:str'
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
function findLineStarts(src) {
|
|
37
|
-
const ls = [0];
|
|
38
|
-
let offset = src.indexOf('\n');
|
|
39
|
-
|
|
40
|
-
while (offset !== -1) {
|
|
41
|
-
offset += 1;
|
|
42
|
-
ls.push(offset);
|
|
43
|
-
offset = src.indexOf('\n', offset);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return ls;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function getSrcInfo(cst) {
|
|
50
|
-
let lineStarts, src;
|
|
51
|
-
|
|
52
|
-
if (typeof cst === 'string') {
|
|
53
|
-
lineStarts = findLineStarts(cst);
|
|
54
|
-
src = cst;
|
|
55
|
-
} else {
|
|
56
|
-
if (Array.isArray(cst)) cst = cst[0];
|
|
57
|
-
|
|
58
|
-
if (cst && cst.context) {
|
|
59
|
-
if (!cst.lineStarts) cst.lineStarts = findLineStarts(cst.context.src);
|
|
60
|
-
lineStarts = cst.lineStarts;
|
|
61
|
-
src = cst.context.src;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return {
|
|
66
|
-
lineStarts,
|
|
67
|
-
src
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* @typedef {Object} LinePos - One-indexed position in the source
|
|
72
|
-
* @property {number} line
|
|
73
|
-
* @property {number} col
|
|
74
|
-
*/
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Determine the line/col position matching a character offset.
|
|
78
|
-
*
|
|
79
|
-
* Accepts a source string or a CST document as the second parameter. With
|
|
80
|
-
* the latter, starting indices for lines are cached in the document as
|
|
81
|
-
* `lineStarts: number[]`.
|
|
82
|
-
*
|
|
83
|
-
* Returns a one-indexed `{ line, col }` location if found, or
|
|
84
|
-
* `undefined` otherwise.
|
|
85
|
-
*
|
|
86
|
-
* @param {number} offset
|
|
87
|
-
* @param {string|Document|Document[]} cst
|
|
88
|
-
* @returns {?LinePos}
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
function getLinePos(offset, cst) {
|
|
93
|
-
if (typeof offset !== 'number' || offset < 0) return null;
|
|
94
|
-
const {
|
|
95
|
-
lineStarts,
|
|
96
|
-
src
|
|
97
|
-
} = getSrcInfo(cst);
|
|
98
|
-
if (!lineStarts || !src || offset > src.length) return null;
|
|
99
|
-
|
|
100
|
-
for (let i = 0; i < lineStarts.length; ++i) {
|
|
101
|
-
const start = lineStarts[i];
|
|
102
|
-
|
|
103
|
-
if (offset < start) {
|
|
104
|
-
return {
|
|
105
|
-
line: i,
|
|
106
|
-
col: offset - lineStarts[i - 1] + 1
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (offset === start) return {
|
|
111
|
-
line: i + 1,
|
|
112
|
-
col: 1
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const line = lineStarts.length;
|
|
117
|
-
return {
|
|
118
|
-
line,
|
|
119
|
-
col: offset - lineStarts[line - 1] + 1
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Get a specified line from the source.
|
|
124
|
-
*
|
|
125
|
-
* Accepts a source string or a CST document as the second parameter. With
|
|
126
|
-
* the latter, starting indices for lines are cached in the document as
|
|
127
|
-
* `lineStarts: number[]`.
|
|
128
|
-
*
|
|
129
|
-
* Returns the line as a string if found, or `null` otherwise.
|
|
130
|
-
*
|
|
131
|
-
* @param {number} line One-indexed line number
|
|
132
|
-
* @param {string|Document|Document[]} cst
|
|
133
|
-
* @returns {?string}
|
|
134
|
-
*/
|
|
135
|
-
|
|
136
|
-
function getLine(line, cst) {
|
|
137
|
-
const {
|
|
138
|
-
lineStarts,
|
|
139
|
-
src
|
|
140
|
-
} = getSrcInfo(cst);
|
|
141
|
-
if (!lineStarts || !(line >= 1) || line > lineStarts.length) return null;
|
|
142
|
-
const start = lineStarts[line - 1];
|
|
143
|
-
let end = lineStarts[line]; // undefined for last line; that's ok for slice()
|
|
144
|
-
|
|
145
|
-
while (end && end > start && src[end - 1] === '\n') --end;
|
|
146
|
-
|
|
147
|
-
return src.slice(start, end);
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Pretty-print the starting line from the source indicated by the range `pos`
|
|
151
|
-
*
|
|
152
|
-
* Trims output to `maxWidth` chars while keeping the starting column visible,
|
|
153
|
-
* using `…` at either end to indicate dropped characters.
|
|
154
|
-
*
|
|
155
|
-
* Returns a two-line string (or `null`) with `\n` as separator; the second line
|
|
156
|
-
* will hold appropriately indented `^` marks indicating the column range.
|
|
157
|
-
*
|
|
158
|
-
* @param {Object} pos
|
|
159
|
-
* @param {LinePos} pos.start
|
|
160
|
-
* @param {LinePos} [pos.end]
|
|
161
|
-
* @param {string|Document|Document[]*} cst
|
|
162
|
-
* @param {number} [maxWidth=80]
|
|
163
|
-
* @returns {?string}
|
|
164
|
-
*/
|
|
165
|
-
|
|
166
|
-
function getPrettyContext({
|
|
167
|
-
start,
|
|
168
|
-
end
|
|
169
|
-
}, cst, maxWidth = 80) {
|
|
170
|
-
let src = getLine(start.line, cst);
|
|
171
|
-
if (!src) return null;
|
|
172
|
-
let {
|
|
173
|
-
col
|
|
174
|
-
} = start;
|
|
175
|
-
|
|
176
|
-
if (src.length > maxWidth) {
|
|
177
|
-
if (col <= maxWidth - 10) {
|
|
178
|
-
src = src.substr(0, maxWidth - 1) + '…';
|
|
179
|
-
} else {
|
|
180
|
-
const halfWidth = Math.round(maxWidth / 2);
|
|
181
|
-
if (src.length > col + halfWidth) src = src.substr(0, col + halfWidth - 1) + '…';
|
|
182
|
-
col -= src.length - maxWidth;
|
|
183
|
-
src = '…' + src.substr(1 - maxWidth);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
let errLen = 1;
|
|
188
|
-
let errEnd = '';
|
|
189
|
-
|
|
190
|
-
if (end) {
|
|
191
|
-
if (end.line === start.line && col + (end.col - start.col) <= maxWidth + 1) {
|
|
192
|
-
errLen = end.col - start.col;
|
|
193
|
-
} else {
|
|
194
|
-
errLen = Math.min(src.length + 1, maxWidth) - col;
|
|
195
|
-
errEnd = '…';
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const offset = col > 1 ? ' '.repeat(col - 1) : '';
|
|
200
|
-
const err = '^'.repeat(errLen);
|
|
201
|
-
return `${src}\n${offset}${err}${errEnd}`;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
class Range {
|
|
205
|
-
static copy(orig) {
|
|
206
|
-
return new Range(orig.start, orig.end);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
constructor(start, end) {
|
|
210
|
-
this.start = start;
|
|
211
|
-
this.end = end || start;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
isEmpty() {
|
|
215
|
-
return typeof this.start !== 'number' || !this.end || this.end <= this.start;
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Set `origStart` and `origEnd` to point to the original source range for
|
|
219
|
-
* this node, which may differ due to dropped CR characters.
|
|
220
|
-
*
|
|
221
|
-
* @param {number[]} cr - Positions of dropped CR characters
|
|
222
|
-
* @param {number} offset - Starting index of `cr` from the last call
|
|
223
|
-
* @returns {number} - The next offset, matching the one found for `origStart`
|
|
224
|
-
*/
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
setOrigRange(cr, offset) {
|
|
228
|
-
const {
|
|
229
|
-
start,
|
|
230
|
-
end
|
|
231
|
-
} = this;
|
|
232
|
-
|
|
233
|
-
if (cr.length === 0 || end <= cr[0]) {
|
|
234
|
-
this.origStart = start;
|
|
235
|
-
this.origEnd = end;
|
|
236
|
-
return offset;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
let i = offset;
|
|
240
|
-
|
|
241
|
-
while (i < cr.length) {
|
|
242
|
-
if (cr[i] > start) break;else ++i;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
this.origStart = start + i;
|
|
246
|
-
const nextOffset = i;
|
|
247
|
-
|
|
248
|
-
while (i < cr.length) {
|
|
249
|
-
// if end was at \n, it should now be at \r
|
|
250
|
-
if (cr[i] >= end) break;else ++i;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
this.origEnd = end + i;
|
|
254
|
-
return nextOffset;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/** Root class of all nodes */
|
|
260
|
-
|
|
261
|
-
class Node {
|
|
262
|
-
static addStringTerminator(src, offset, str) {
|
|
263
|
-
if (str[str.length - 1] === '\n') return str;
|
|
264
|
-
const next = Node.endOfWhiteSpace(src, offset);
|
|
265
|
-
return next >= src.length || src[next] === '\n' ? str + '\n' : str;
|
|
266
|
-
} // ^(---|...)
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
static atDocumentBoundary(src, offset, sep) {
|
|
270
|
-
const ch0 = src[offset];
|
|
271
|
-
if (!ch0) return true;
|
|
272
|
-
const prev = src[offset - 1];
|
|
273
|
-
if (prev && prev !== '\n') return false;
|
|
274
|
-
|
|
275
|
-
if (sep) {
|
|
276
|
-
if (ch0 !== sep) return false;
|
|
277
|
-
} else {
|
|
278
|
-
if (ch0 !== Char.DIRECTIVES_END && ch0 !== Char.DOCUMENT_END) return false;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
const ch1 = src[offset + 1];
|
|
282
|
-
const ch2 = src[offset + 2];
|
|
283
|
-
if (ch1 !== ch0 || ch2 !== ch0) return false;
|
|
284
|
-
const ch3 = src[offset + 3];
|
|
285
|
-
return !ch3 || ch3 === '\n' || ch3 === '\t' || ch3 === ' ';
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
static endOfIdentifier(src, offset) {
|
|
289
|
-
let ch = src[offset];
|
|
290
|
-
const isVerbatim = ch === '<';
|
|
291
|
-
const notOk = isVerbatim ? ['\n', '\t', ' ', '>'] : ['\n', '\t', ' ', '[', ']', '{', '}', ','];
|
|
292
|
-
|
|
293
|
-
while (ch && notOk.indexOf(ch) === -1) ch = src[offset += 1];
|
|
294
|
-
|
|
295
|
-
if (isVerbatim && ch === '>') offset += 1;
|
|
296
|
-
return offset;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
static endOfIndent(src, offset) {
|
|
300
|
-
let ch = src[offset];
|
|
301
|
-
|
|
302
|
-
while (ch === ' ') ch = src[offset += 1];
|
|
303
|
-
|
|
304
|
-
return offset;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
static endOfLine(src, offset) {
|
|
308
|
-
let ch = src[offset];
|
|
309
|
-
|
|
310
|
-
while (ch && ch !== '\n') ch = src[offset += 1];
|
|
311
|
-
|
|
312
|
-
return offset;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
static endOfWhiteSpace(src, offset) {
|
|
316
|
-
let ch = src[offset];
|
|
317
|
-
|
|
318
|
-
while (ch === '\t' || ch === ' ') ch = src[offset += 1];
|
|
319
|
-
|
|
320
|
-
return offset;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
static startOfLine(src, offset) {
|
|
324
|
-
let ch = src[offset - 1];
|
|
325
|
-
if (ch === '\n') return offset;
|
|
326
|
-
|
|
327
|
-
while (ch && ch !== '\n') ch = src[offset -= 1];
|
|
328
|
-
|
|
329
|
-
return offset + 1;
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* End of indentation, or null if the line's indent level is not more
|
|
333
|
-
* than `indent`
|
|
334
|
-
*
|
|
335
|
-
* @param {string} src
|
|
336
|
-
* @param {number} indent
|
|
337
|
-
* @param {number} lineStart
|
|
338
|
-
* @returns {?number}
|
|
339
|
-
*/
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
static endOfBlockIndent(src, indent, lineStart) {
|
|
343
|
-
const inEnd = Node.endOfIndent(src, lineStart);
|
|
344
|
-
|
|
345
|
-
if (inEnd > lineStart + indent) {
|
|
346
|
-
return inEnd;
|
|
347
|
-
} else {
|
|
348
|
-
const wsEnd = Node.endOfWhiteSpace(src, inEnd);
|
|
349
|
-
const ch = src[wsEnd];
|
|
350
|
-
if (!ch || ch === '\n') return wsEnd;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
return null;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
static atBlank(src, offset, endAsBlank) {
|
|
357
|
-
const ch = src[offset];
|
|
358
|
-
return ch === '\n' || ch === '\t' || ch === ' ' || endAsBlank && !ch;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
static nextNodeIsIndented(ch, indentDiff, indicatorAsIndent) {
|
|
362
|
-
if (!ch || indentDiff < 0) return false;
|
|
363
|
-
if (indentDiff > 0) return true;
|
|
364
|
-
return indicatorAsIndent && ch === '-';
|
|
365
|
-
} // should be at line or string end, or at next non-whitespace char
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
static normalizeOffset(src, offset) {
|
|
369
|
-
const ch = src[offset];
|
|
370
|
-
return !ch ? offset : ch !== '\n' && src[offset - 1] === '\n' ? offset - 1 : Node.endOfWhiteSpace(src, offset);
|
|
371
|
-
} // fold single newline into space, multiple newlines to N - 1 newlines
|
|
372
|
-
// presumes src[offset] === '\n'
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
static foldNewline(src, offset, indent) {
|
|
376
|
-
let inCount = 0;
|
|
377
|
-
let error = false;
|
|
378
|
-
let fold = '';
|
|
379
|
-
let ch = src[offset + 1];
|
|
380
|
-
|
|
381
|
-
while (ch === ' ' || ch === '\t' || ch === '\n') {
|
|
382
|
-
switch (ch) {
|
|
383
|
-
case '\n':
|
|
384
|
-
inCount = 0;
|
|
385
|
-
offset += 1;
|
|
386
|
-
fold += '\n';
|
|
387
|
-
break;
|
|
388
|
-
|
|
389
|
-
case '\t':
|
|
390
|
-
if (inCount <= indent) error = true;
|
|
391
|
-
offset = Node.endOfWhiteSpace(src, offset + 2) - 1;
|
|
392
|
-
break;
|
|
393
|
-
|
|
394
|
-
case ' ':
|
|
395
|
-
inCount += 1;
|
|
396
|
-
offset += 1;
|
|
397
|
-
break;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
ch = src[offset + 1];
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
if (!fold) fold = ' ';
|
|
404
|
-
if (ch && inCount <= indent) error = true;
|
|
405
|
-
return {
|
|
406
|
-
fold,
|
|
407
|
-
offset,
|
|
408
|
-
error
|
|
409
|
-
};
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
constructor(type, props, context) {
|
|
413
|
-
Object.defineProperty(this, 'context', {
|
|
414
|
-
value: context || null,
|
|
415
|
-
writable: true
|
|
416
|
-
});
|
|
417
|
-
this.error = null;
|
|
418
|
-
this.range = null;
|
|
419
|
-
this.valueRange = null;
|
|
420
|
-
this.props = props || [];
|
|
421
|
-
this.type = type;
|
|
422
|
-
this.value = null;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
getPropValue(idx, key, skipKey) {
|
|
426
|
-
if (!this.context) return null;
|
|
427
|
-
const {
|
|
428
|
-
src
|
|
429
|
-
} = this.context;
|
|
430
|
-
const prop = this.props[idx];
|
|
431
|
-
return prop && src[prop.start] === key ? src.slice(prop.start + (skipKey ? 1 : 0), prop.end) : null;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
get anchor() {
|
|
435
|
-
for (let i = 0; i < this.props.length; ++i) {
|
|
436
|
-
const anchor = this.getPropValue(i, Char.ANCHOR, true);
|
|
437
|
-
if (anchor != null) return anchor;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
return null;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
get comment() {
|
|
444
|
-
const comments = [];
|
|
445
|
-
|
|
446
|
-
for (let i = 0; i < this.props.length; ++i) {
|
|
447
|
-
const comment = this.getPropValue(i, Char.COMMENT, true);
|
|
448
|
-
if (comment != null) comments.push(comment);
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
return comments.length > 0 ? comments.join('\n') : null;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
commentHasRequiredWhitespace(start) {
|
|
455
|
-
const {
|
|
456
|
-
src
|
|
457
|
-
} = this.context;
|
|
458
|
-
if (this.header && start === this.header.end) return false;
|
|
459
|
-
if (!this.valueRange) return false;
|
|
460
|
-
const {
|
|
461
|
-
end
|
|
462
|
-
} = this.valueRange;
|
|
463
|
-
return start !== end || Node.atBlank(src, end - 1);
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
get hasComment() {
|
|
467
|
-
if (this.context) {
|
|
468
|
-
const {
|
|
469
|
-
src
|
|
470
|
-
} = this.context;
|
|
471
|
-
|
|
472
|
-
for (let i = 0; i < this.props.length; ++i) {
|
|
473
|
-
if (src[this.props[i].start] === Char.COMMENT) return true;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
return false;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
get hasProps() {
|
|
481
|
-
if (this.context) {
|
|
482
|
-
const {
|
|
483
|
-
src
|
|
484
|
-
} = this.context;
|
|
485
|
-
|
|
486
|
-
for (let i = 0; i < this.props.length; ++i) {
|
|
487
|
-
if (src[this.props[i].start] !== Char.COMMENT) return true;
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
return false;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
get includesTrailingLines() {
|
|
495
|
-
return false;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
get jsonLike() {
|
|
499
|
-
const jsonLikeTypes = [Type.FLOW_MAP, Type.FLOW_SEQ, Type.QUOTE_DOUBLE, Type.QUOTE_SINGLE];
|
|
500
|
-
return jsonLikeTypes.indexOf(this.type) !== -1;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
get rangeAsLinePos() {
|
|
504
|
-
if (!this.range || !this.context) return undefined;
|
|
505
|
-
const start = getLinePos(this.range.start, this.context.root);
|
|
506
|
-
if (!start) return undefined;
|
|
507
|
-
const end = getLinePos(this.range.end, this.context.root);
|
|
508
|
-
return {
|
|
509
|
-
start,
|
|
510
|
-
end
|
|
511
|
-
};
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
get rawValue() {
|
|
515
|
-
if (!this.valueRange || !this.context) return null;
|
|
516
|
-
const {
|
|
517
|
-
start,
|
|
518
|
-
end
|
|
519
|
-
} = this.valueRange;
|
|
520
|
-
return this.context.src.slice(start, end);
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
get tag() {
|
|
524
|
-
for (let i = 0; i < this.props.length; ++i) {
|
|
525
|
-
const tag = this.getPropValue(i, Char.TAG, false);
|
|
526
|
-
|
|
527
|
-
if (tag != null) {
|
|
528
|
-
if (tag[1] === '<') {
|
|
529
|
-
return {
|
|
530
|
-
verbatim: tag.slice(2, -1)
|
|
531
|
-
};
|
|
532
|
-
} else {
|
|
533
|
-
// eslint-disable-next-line no-unused-vars
|
|
534
|
-
const [_, handle, suffix] = tag.match(/^(.*!)([^!]*)$/);
|
|
535
|
-
return {
|
|
536
|
-
handle,
|
|
537
|
-
suffix
|
|
538
|
-
};
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
return null;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
get valueRangeContainsNewline() {
|
|
547
|
-
if (!this.valueRange || !this.context) return false;
|
|
548
|
-
const {
|
|
549
|
-
start,
|
|
550
|
-
end
|
|
551
|
-
} = this.valueRange;
|
|
552
|
-
const {
|
|
553
|
-
src
|
|
554
|
-
} = this.context;
|
|
555
|
-
|
|
556
|
-
for (let i = start; i < end; ++i) {
|
|
557
|
-
if (src[i] === '\n') return true;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
return false;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
parseComment(start) {
|
|
564
|
-
const {
|
|
565
|
-
src
|
|
566
|
-
} = this.context;
|
|
567
|
-
|
|
568
|
-
if (src[start] === Char.COMMENT) {
|
|
569
|
-
const end = Node.endOfLine(src, start + 1);
|
|
570
|
-
const commentRange = new Range(start, end);
|
|
571
|
-
this.props.push(commentRange);
|
|
572
|
-
return end;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
return start;
|
|
576
|
-
}
|
|
577
|
-
/**
|
|
578
|
-
* Populates the `origStart` and `origEnd` values of all ranges for this
|
|
579
|
-
* node. Extended by child classes to handle descendant nodes.
|
|
580
|
-
*
|
|
581
|
-
* @param {number[]} cr - Positions of dropped CR characters
|
|
582
|
-
* @param {number} offset - Starting index of `cr` from the last call
|
|
583
|
-
* @returns {number} - The next offset, matching the one found for `origStart`
|
|
584
|
-
*/
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
setOrigRanges(cr, offset) {
|
|
588
|
-
if (this.range) offset = this.range.setOrigRange(cr, offset);
|
|
589
|
-
if (this.valueRange) this.valueRange.setOrigRange(cr, offset);
|
|
590
|
-
this.props.forEach(prop => prop.setOrigRange(cr, offset));
|
|
591
|
-
return offset;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
toString() {
|
|
595
|
-
const {
|
|
596
|
-
context: {
|
|
597
|
-
src
|
|
598
|
-
},
|
|
599
|
-
range,
|
|
600
|
-
value
|
|
601
|
-
} = this;
|
|
602
|
-
if (value != null) return value;
|
|
603
|
-
const str = src.slice(range.start, range.end);
|
|
604
|
-
return Node.addStringTerminator(src, range.end, str);
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
class YAMLError extends Error {
|
|
610
|
-
constructor(name, source, message) {
|
|
611
|
-
if (!message || !(source instanceof Node)) throw new Error(`Invalid arguments for new ${name}`);
|
|
612
|
-
super();
|
|
613
|
-
this.name = name;
|
|
614
|
-
this.message = message;
|
|
615
|
-
this.source = source;
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
makePretty() {
|
|
619
|
-
if (!this.source) return;
|
|
620
|
-
this.nodeType = this.source.type;
|
|
621
|
-
const cst = this.source.context && this.source.context.root;
|
|
622
|
-
|
|
623
|
-
if (typeof this.offset === 'number') {
|
|
624
|
-
this.range = new Range(this.offset, this.offset + 1);
|
|
625
|
-
const start = cst && getLinePos(this.offset, cst);
|
|
626
|
-
|
|
627
|
-
if (start) {
|
|
628
|
-
const end = {
|
|
629
|
-
line: start.line,
|
|
630
|
-
col: start.col + 1
|
|
631
|
-
};
|
|
632
|
-
this.linePos = {
|
|
633
|
-
start,
|
|
634
|
-
end
|
|
635
|
-
};
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
delete this.offset;
|
|
639
|
-
} else {
|
|
640
|
-
this.range = this.source.range;
|
|
641
|
-
this.linePos = this.source.rangeAsLinePos;
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
if (this.linePos) {
|
|
645
|
-
const {
|
|
646
|
-
line,
|
|
647
|
-
col
|
|
648
|
-
} = this.linePos.start;
|
|
649
|
-
this.message += ` at line ${line}, column ${col}`;
|
|
650
|
-
const ctx = cst && getPrettyContext(this.linePos, cst);
|
|
651
|
-
if (ctx) this.message += `:\n\n${ctx}\n`;
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
delete this.source;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
}
|
|
658
|
-
class YAMLReferenceError extends YAMLError {
|
|
659
|
-
constructor(source, message) {
|
|
660
|
-
super('YAMLReferenceError', source, message);
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
}
|
|
664
|
-
class YAMLSemanticError extends YAMLError {
|
|
665
|
-
constructor(source, message) {
|
|
666
|
-
super('YAMLSemanticError', source, message);
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
}
|
|
670
|
-
class YAMLSyntaxError extends YAMLError {
|
|
671
|
-
constructor(source, message) {
|
|
672
|
-
super('YAMLSyntaxError', source, message);
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
}
|
|
676
|
-
class YAMLWarning extends YAMLError {
|
|
677
|
-
constructor(source, message) {
|
|
678
|
-
super('YAMLWarning', source, message);
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
function _defineProperty(obj, key, value) {
|
|
684
|
-
if (key in obj) {
|
|
685
|
-
Object.defineProperty(obj, key, {
|
|
686
|
-
value: value,
|
|
687
|
-
enumerable: true,
|
|
688
|
-
configurable: true,
|
|
689
|
-
writable: true
|
|
690
|
-
});
|
|
691
|
-
} else {
|
|
692
|
-
obj[key] = value;
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
return obj;
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
class PlainValue extends Node {
|
|
699
|
-
static endOfLine(src, start, inFlow) {
|
|
700
|
-
let ch = src[start];
|
|
701
|
-
let offset = start;
|
|
702
|
-
|
|
703
|
-
while (ch && ch !== '\n') {
|
|
704
|
-
if (inFlow && (ch === '[' || ch === ']' || ch === '{' || ch === '}' || ch === ',')) break;
|
|
705
|
-
const next = src[offset + 1];
|
|
706
|
-
if (ch === ':' && (!next || next === '\n' || next === '\t' || next === ' ' || inFlow && next === ',')) break;
|
|
707
|
-
if ((ch === ' ' || ch === '\t') && next === '#') break;
|
|
708
|
-
offset += 1;
|
|
709
|
-
ch = next;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
return offset;
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
get strValue() {
|
|
716
|
-
if (!this.valueRange || !this.context) return null;
|
|
717
|
-
let {
|
|
718
|
-
start,
|
|
719
|
-
end
|
|
720
|
-
} = this.valueRange;
|
|
721
|
-
const {
|
|
722
|
-
src
|
|
723
|
-
} = this.context;
|
|
724
|
-
let ch = src[end - 1];
|
|
725
|
-
|
|
726
|
-
while (start < end && (ch === '\n' || ch === '\t' || ch === ' ')) ch = src[--end - 1];
|
|
727
|
-
|
|
728
|
-
let str = '';
|
|
729
|
-
|
|
730
|
-
for (let i = start; i < end; ++i) {
|
|
731
|
-
const ch = src[i];
|
|
732
|
-
|
|
733
|
-
if (ch === '\n') {
|
|
734
|
-
const {
|
|
735
|
-
fold,
|
|
736
|
-
offset
|
|
737
|
-
} = Node.foldNewline(src, i, -1);
|
|
738
|
-
str += fold;
|
|
739
|
-
i = offset;
|
|
740
|
-
} else if (ch === ' ' || ch === '\t') {
|
|
741
|
-
// trim trailing whitespace
|
|
742
|
-
const wsStart = i;
|
|
743
|
-
let next = src[i + 1];
|
|
744
|
-
|
|
745
|
-
while (i < end && (next === ' ' || next === '\t')) {
|
|
746
|
-
i += 1;
|
|
747
|
-
next = src[i + 1];
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
if (next !== '\n') str += i > wsStart ? src.slice(wsStart, i + 1) : ch;
|
|
751
|
-
} else {
|
|
752
|
-
str += ch;
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
const ch0 = src[start];
|
|
757
|
-
|
|
758
|
-
switch (ch0) {
|
|
759
|
-
case '\t':
|
|
760
|
-
{
|
|
761
|
-
const msg = 'Plain value cannot start with a tab character';
|
|
762
|
-
const errors = [new YAMLSemanticError(this, msg)];
|
|
763
|
-
return {
|
|
764
|
-
errors,
|
|
765
|
-
str
|
|
766
|
-
};
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
case '@':
|
|
770
|
-
case '`':
|
|
771
|
-
{
|
|
772
|
-
const msg = `Plain value cannot start with reserved character ${ch0}`;
|
|
773
|
-
const errors = [new YAMLSemanticError(this, msg)];
|
|
774
|
-
return {
|
|
775
|
-
errors,
|
|
776
|
-
str
|
|
777
|
-
};
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
default:
|
|
781
|
-
return str;
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
parseBlockValue(start) {
|
|
786
|
-
const {
|
|
787
|
-
indent,
|
|
788
|
-
inFlow,
|
|
789
|
-
src
|
|
790
|
-
} = this.context;
|
|
791
|
-
let offset = start;
|
|
792
|
-
let valueEnd = start;
|
|
793
|
-
|
|
794
|
-
for (let ch = src[offset]; ch === '\n'; ch = src[offset]) {
|
|
795
|
-
if (Node.atDocumentBoundary(src, offset + 1)) break;
|
|
796
|
-
const end = Node.endOfBlockIndent(src, indent, offset + 1);
|
|
797
|
-
if (end === null || src[end] === '#') break;
|
|
798
|
-
|
|
799
|
-
if (src[end] === '\n') {
|
|
800
|
-
offset = end;
|
|
801
|
-
} else {
|
|
802
|
-
valueEnd = PlainValue.endOfLine(src, end, inFlow);
|
|
803
|
-
offset = valueEnd;
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
if (this.valueRange.isEmpty()) this.valueRange.start = start;
|
|
808
|
-
this.valueRange.end = valueEnd;
|
|
809
|
-
return valueEnd;
|
|
810
|
-
}
|
|
811
|
-
/**
|
|
812
|
-
* Parses a plain value from the source
|
|
813
|
-
*
|
|
814
|
-
* Accepted forms are:
|
|
815
|
-
* ```
|
|
816
|
-
* #comment
|
|
817
|
-
*
|
|
818
|
-
* first line
|
|
819
|
-
*
|
|
820
|
-
* first line #comment
|
|
821
|
-
*
|
|
822
|
-
* first line
|
|
823
|
-
* block
|
|
824
|
-
* lines
|
|
825
|
-
*
|
|
826
|
-
* #comment
|
|
827
|
-
* block
|
|
828
|
-
* lines
|
|
829
|
-
* ```
|
|
830
|
-
* where block lines are empty or have an indent level greater than `indent`.
|
|
831
|
-
*
|
|
832
|
-
* @param {ParseContext} context
|
|
833
|
-
* @param {number} start - Index of first character
|
|
834
|
-
* @returns {number} - Index of the character after this scalar, may be `\n`
|
|
835
|
-
*/
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
parse(context, start) {
|
|
839
|
-
this.context = context;
|
|
840
|
-
const {
|
|
841
|
-
inFlow,
|
|
842
|
-
src
|
|
843
|
-
} = context;
|
|
844
|
-
let offset = start;
|
|
845
|
-
const ch = src[offset];
|
|
846
|
-
|
|
847
|
-
if (ch && ch !== '#' && ch !== '\n') {
|
|
848
|
-
offset = PlainValue.endOfLine(src, start, inFlow);
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
this.valueRange = new Range(start, offset);
|
|
852
|
-
offset = Node.endOfWhiteSpace(src, offset);
|
|
853
|
-
offset = this.parseComment(offset);
|
|
854
|
-
|
|
855
|
-
if (!this.hasComment || this.valueRange.isEmpty()) {
|
|
856
|
-
offset = this.parseBlockValue(offset);
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
return offset;
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
}
|
|
863
|
-
|
|
864
|
-
exports.Char = Char;
|
|
865
|
-
exports.Node = Node;
|
|
866
|
-
exports.PlainValue = PlainValue;
|
|
867
|
-
exports.Range = Range;
|
|
868
|
-
exports.Type = Type;
|
|
869
|
-
exports.YAMLError = YAMLError;
|
|
870
|
-
exports.YAMLReferenceError = YAMLReferenceError;
|
|
871
|
-
exports.YAMLSemanticError = YAMLSemanticError;
|
|
872
|
-
exports.YAMLSyntaxError = YAMLSyntaxError;
|
|
873
|
-
exports.YAMLWarning = YAMLWarning;
|
|
874
|
-
exports._defineProperty = _defineProperty;
|
|
875
|
-
exports.defaultTagPrefix = defaultTagPrefix;
|
|
876
|
-
exports.defaultTags = defaultTags;
|