deploy: v0.12 fix 存档key名

This commit is contained in:
2026-06-24 03:09:02 +00:00
parent 7a08d49fe3
commit e0a5281119
58743 changed files with 7297269 additions and 39505 deletions
+16
View File
@@ -0,0 +1,16 @@
name: Trigger CI
on: push
jobs:
build:
name: Dispatch to main repo
runs-on: ubuntu-latest
steps:
- name: Emit repository_dispatch
uses: mvasigh/dispatch-action@main
with:
# You should create a personal access token and store it in your repository
token: ${{ secrets.DISPATCH_AUTH }}
repo: dev
owner: codemirror
event_type: push
+25
View File
@@ -0,0 +1,25 @@
## 6.1.2 (2024-12-10)
### Bug fixes
List `@lezer/lr` as a direct dependency for tools that require this.
Make block sequence items, rather than the whole sequence, fold targets.
## 6.1.1 (2024-04-12)
### Bug fixes
Make block mapping entries, rather than the entire mapping, foldable.
## 6.1.0 (2024-04-07)
### New features
`yamlFrontmatter` can now be used to wrap a language with a YAML frontmatter.
## 6.0.0 (2024-01-22)
### New Features
First versioned release.
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (C) 2024 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+46
View File
@@ -0,0 +1,46 @@
<!-- NOTE: README.md is generated from src/README.md -->
# @codemirror/lang-yaml [![NPM version](https://img.shields.io/npm/v/@codemirror/lang-yaml.svg)](https://www.npmjs.org/package/@codemirror/lang-yaml)
[ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-yaml/blob/main/CHANGELOG.md) ]
This package implements YAML language support for the
[CodeMirror](https://codemirror.net/) code editor.
The [project page](https://codemirror.net/) has more information, a
number of [examples](https://codemirror.net/examples/) and the
[documentation](https://codemirror.net/docs/).
This code is released under an
[MIT license](https://github.com/codemirror/lang-yaml/tree/main/LICENSE).
We aim to be an inclusive, welcoming community. To make that explicit,
we have a [code of
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
to communication around the project.
The initial implementation of this package was funded by [Braintrust Data](https://braintrustdata.com/).
## API Reference
<dl>
<dt id="user-content-yaml">
<code><strong><a href="#user-content-yaml">yaml</a></strong>() → <a href="https://codemirror.net/docs/ref#language.LanguageSupport">LanguageSupport</a></code></dt>
<dd><p>Language support for YAML.</p>
</dd>
<dt id="user-content-yamllanguage">
<code><strong><a href="#user-content-yamllanguage">yamlLanguage</a></strong>: <a href="https://codemirror.net/docs/ref#language.LRLanguage">LRLanguage</a></code></dt>
<dd><p>A language provider based on the <a href="https://github.com/lezer-parser/yaml">Lezer YAML
parser</a>, extended with
highlighting and indentation information.</p>
</dd>
<dt id="user-content-yamlfrontmatter">
<code><strong><a href="#user-content-yamlfrontmatter">yamlFrontmatter</a></strong>(<a id="user-content-yamlfrontmatter^config" href="#user-content-yamlfrontmatter^config">config</a>: {content: <a href="https://codemirror.net/docs/ref#language.Language">Language</a> | <a href="https://codemirror.net/docs/ref#language.LanguageSupport">LanguageSupport</a>}) → <a href="https://codemirror.net/docs/ref#language.LanguageSupport">LanguageSupport</a></code></dt>
<dd><p>Returns language support for a document parsed as <code>config.content</code>
with an optional YAML &quot;frontmatter&quot; delimited by lines that
contain three dashes.</p>
</dd>
</dl>
+100
View File
@@ -0,0 +1,100 @@
'use strict';
var yaml$1 = require('@lezer/yaml');
var language = require('@codemirror/language');
var common = require('@lezer/common');
var highlight = require('@lezer/highlight');
var lr = require('@lezer/lr');
// This file was generated by lezer-generator. You probably shouldn't edit it.
const parser = lr.LRParser.deserialize({
version: 14,
states: "!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",
stateData: "!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",
goto: "vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",
nodeNames: "⚠ Document Frontmatter DashLine FrontmatterContent Body",
maxTerm: 10,
skippedNodes: [0],
repeatNodeCount: 2,
tokenData: "$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",
tokenizers: [0],
topRules: {"Document":[0,1]},
tokenPrec: 67
});
/**
A language provider based on the [Lezer YAML
parser](https://github.com/lezer-parser/yaml), extended with
highlighting and indentation information.
*/
const yamlLanguage = language.LRLanguage.define({
name: "yaml",
parser: yaml$1.parser.configure({
props: [
language.indentNodeProp.add({
Stream: cx => {
for (let before = cx.node.resolve(cx.pos, -1); before && before.to >= cx.pos; before = before.parent) {
if (before.name == "BlockLiteralContent" && before.from < before.to)
return cx.baseIndentFor(before);
if (before.name == "BlockLiteral")
return cx.baseIndentFor(before) + cx.unit;
if (before.name == "BlockSequence" || before.name == "BlockMapping")
return cx.column(before.from, 1);
if (before.name == "QuotedLiteral")
return null;
if (before.name == "Literal") {
let col = cx.column(before.from, 1);
if (col == cx.lineIndent(before.from, 1))
return col; // Start on own line
if (before.to > cx.pos)
return null;
}
}
return null;
},
FlowMapping: language.delimitedIndent({ closing: "}" }),
FlowSequence: language.delimitedIndent({ closing: "]" }),
}),
language.foldNodeProp.add({
"FlowMapping FlowSequence": language.foldInside,
"Item Pair BlockLiteral": (node, state) => ({ from: state.doc.lineAt(node.from).to, to: node.to })
})
]
}),
languageData: {
commentTokens: { line: "#" },
indentOnInput: /^\s*[\]\}]$/,
}
});
/**
Language support for YAML.
*/
function yaml() {
return new language.LanguageSupport(yamlLanguage);
}
const frontmatterLanguage = language.LRLanguage.define({
name: "yaml-frontmatter",
parser: parser.configure({
props: [highlight.styleTags({ DashLine: highlight.tags.meta })]
})
});
/**
Returns language support for a document parsed as `config.content`
with an optional YAML "frontmatter" delimited by lines that
contain three dashes.
*/
function yamlFrontmatter(config) {
let { language: language$1, support } = config.content instanceof language.LanguageSupport ? config.content
: { language: config.content, support: [] };
return new language.LanguageSupport(frontmatterLanguage.configure({
wrap: common.parseMixed(node => {
return node.name == "FrontmatterContent" ? { parser: yamlLanguage.parser }
: node.name == "Body" ? { parser: language$1.parser }
: null;
})
}), support);
}
exports.yaml = yaml;
exports.yamlFrontmatter = yamlFrontmatter;
exports.yamlLanguage = yamlLanguage;
+22
View File
@@ -0,0 +1,22 @@
import { LRLanguage, LanguageSupport, Language } from '@codemirror/language';
/**
A language provider based on the [Lezer YAML
parser](https://github.com/lezer-parser/yaml), extended with
highlighting and indentation information.
*/
declare const yamlLanguage: LRLanguage;
/**
Language support for YAML.
*/
declare function yaml(): LanguageSupport;
/**
Returns language support for a document parsed as `config.content`
with an optional YAML "frontmatter" delimited by lines that
contain three dashes.
*/
declare function yamlFrontmatter(config: {
content: Language | LanguageSupport;
}): LanguageSupport;
export { yaml, yamlFrontmatter, yamlLanguage };
+22
View File
@@ -0,0 +1,22 @@
import { LRLanguage, LanguageSupport, Language } from '@codemirror/language';
/**
A language provider based on the [Lezer YAML
parser](https://github.com/lezer-parser/yaml), extended with
highlighting and indentation information.
*/
declare const yamlLanguage: LRLanguage;
/**
Language support for YAML.
*/
declare function yaml(): LanguageSupport;
/**
Returns language support for a document parsed as `config.content`
with an optional YAML "frontmatter" delimited by lines that
contain three dashes.
*/
declare function yamlFrontmatter(config: {
content: Language | LanguageSupport;
}): LanguageSupport;
export { yaml, yamlFrontmatter, yamlLanguage };
+96
View File
@@ -0,0 +1,96 @@
import { parser as parser$1 } from '@lezer/yaml';
import { LRLanguage, indentNodeProp, delimitedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language';
import { parseMixed } from '@lezer/common';
import { styleTags, tags } from '@lezer/highlight';
import { LRParser } from '@lezer/lr';
// This file was generated by lezer-generator. You probably shouldn't edit it.
const parser = /*@__PURE__*/LRParser.deserialize({
version: 14,
states: "!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",
stateData: "!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",
goto: "vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",
nodeNames: "⚠ Document Frontmatter DashLine FrontmatterContent Body",
maxTerm: 10,
skippedNodes: [0],
repeatNodeCount: 2,
tokenData: "$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",
tokenizers: [0],
topRules: {"Document":[0,1]},
tokenPrec: 67
});
/**
A language provider based on the [Lezer YAML
parser](https://github.com/lezer-parser/yaml), extended with
highlighting and indentation information.
*/
const yamlLanguage = /*@__PURE__*/LRLanguage.define({
name: "yaml",
parser: /*@__PURE__*/parser$1.configure({
props: [
/*@__PURE__*/indentNodeProp.add({
Stream: cx => {
for (let before = cx.node.resolve(cx.pos, -1); before && before.to >= cx.pos; before = before.parent) {
if (before.name == "BlockLiteralContent" && before.from < before.to)
return cx.baseIndentFor(before);
if (before.name == "BlockLiteral")
return cx.baseIndentFor(before) + cx.unit;
if (before.name == "BlockSequence" || before.name == "BlockMapping")
return cx.column(before.from, 1);
if (before.name == "QuotedLiteral")
return null;
if (before.name == "Literal") {
let col = cx.column(before.from, 1);
if (col == cx.lineIndent(before.from, 1))
return col; // Start on own line
if (before.to > cx.pos)
return null;
}
}
return null;
},
FlowMapping: /*@__PURE__*/delimitedIndent({ closing: "}" }),
FlowSequence: /*@__PURE__*/delimitedIndent({ closing: "]" }),
}),
/*@__PURE__*/foldNodeProp.add({
"FlowMapping FlowSequence": foldInside,
"Item Pair BlockLiteral": (node, state) => ({ from: state.doc.lineAt(node.from).to, to: node.to })
})
]
}),
languageData: {
commentTokens: { line: "#" },
indentOnInput: /^\s*[\]\}]$/,
}
});
/**
Language support for YAML.
*/
function yaml() {
return new LanguageSupport(yamlLanguage);
}
const frontmatterLanguage = /*@__PURE__*/LRLanguage.define({
name: "yaml-frontmatter",
parser: /*@__PURE__*/parser.configure({
props: [/*@__PURE__*/styleTags({ DashLine: tags.meta })]
})
});
/**
Returns language support for a document parsed as `config.content`
with an optional YAML "frontmatter" delimited by lines that
contain three dashes.
*/
function yamlFrontmatter(config) {
let { language, support } = config.content instanceof LanguageSupport ? config.content
: { language: config.content, support: [] };
return new LanguageSupport(frontmatterLanguage.configure({
wrap: parseMixed(node => {
return node.name == "FrontmatterContent" ? { parser: yamlLanguage.parser }
: node.name == "Body" ? { parser: language.parser }
: null;
})
}), support);
}
export { yaml, yamlFrontmatter, yamlLanguage };
+44
View File
@@ -0,0 +1,44 @@
{
"name": "@codemirror/lang-yaml",
"version": "6.1.2",
"description": "YAML language support for the CodeMirror code editor",
"scripts": {
"test": "cm-runtests",
"prepare": "cm-buildhelper src/yaml.ts"
},
"keywords": [
"editor",
"code"
],
"author": {
"name": "Marijn Haverbeke",
"email": "marijn@haverbeke.berlin",
"url": "http://marijnhaverbeke.nl"
},
"type": "module",
"main": "dist/index.cjs",
"exports": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"types": "dist/index.d.ts",
"module": "dist/index.js",
"sideEffects": false,
"license": "MIT",
"dependencies": {
"@codemirror/autocomplete": "^6.0.0",
"@codemirror/language": "^6.0.0",
"@codemirror/state": "^6.0.0",
"@lezer/common": "^1.2.0",
"@lezer/highlight": "^1.2.0",
"@lezer/lr": "^1.0.0",
"@lezer/yaml": "^1.0.0"
},
"devDependencies": {
"@codemirror/buildhelper": "^1.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/codemirror/lang-yaml.git"
}
}