mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-06-23 08:31:58 +00:00
Merge branch 'main' into support-json-links
This commit is contained in:
commit
cf4b843ce5
12 changed files with 856 additions and 2824 deletions
25
.github/workflows/ci.yaml
vendored
25
.github/workflows/ci.yaml
vendored
|
|
@ -7,6 +7,15 @@ on:
|
|||
tags: ['*']
|
||||
|
||||
jobs:
|
||||
eslint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with: { node-version: 16 }
|
||||
- run: npm ci
|
||||
- run: npx eslint .
|
||||
|
||||
pack:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
@ -16,14 +25,14 @@ jobs:
|
|||
- run: npm ci
|
||||
- run: npm pack
|
||||
|
||||
lint:
|
||||
prettier:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with: { node-version: 16 }
|
||||
- run: npm ci
|
||||
- run: npm run lint
|
||||
- run: npx prettier --check .
|
||||
|
||||
tsc:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
@ -33,3 +42,15 @@ jobs:
|
|||
with: { node-version: 16 }
|
||||
- run: npm ci
|
||||
- run: npx tsc
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [eslint, pack, prettier, tsc]
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- uses: actions/setup-node@v2
|
||||
with: { node-version: 16 }
|
||||
- run: npm ci
|
||||
- run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "webpack-example",
|
||||
"name": "demo",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "webpack serve --open --mode development",
|
||||
"build": "webpack --mode production"
|
||||
},
|
||||
"devDependencies": {
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-free": "^5.15.4",
|
||||
"css-loader": "^6.2.0",
|
||||
"css-minimizer-webpack-plugin": "^3.0.2",
|
||||
|
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
|
|
@ -1,3 +1,3 @@
|
|||
[build]
|
||||
publish = 'examples/webpack/dist/'
|
||||
command = 'npm ci && npm run prepack && npm --workspace webpack-example run build'
|
||||
publish = 'examples/demo/dist/'
|
||||
command = 'npm ci && npm run prepack && npm --workspace demo run build'
|
||||
|
|
|
|||
3618
package-lock.json
generated
3618
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -5,8 +5,7 @@
|
|||
"homepage": "https://monaco-yaml.js.org",
|
||||
"scripts": {
|
||||
"prepack": "node build.js",
|
||||
"prepare": "husky install",
|
||||
"lint": "eslint . && prettier --check ."
|
||||
"prepare": "husky install"
|
||||
},
|
||||
"main": "./lib/esm/monaco.contribution.js",
|
||||
"module": "./lib/esm/monaco.contribution.js",
|
||||
|
|
@ -59,6 +58,7 @@
|
|||
"husky": "^7.0.1",
|
||||
"lint-staged": "^11.1.1",
|
||||
"monaco-editor": "^0.27.0",
|
||||
"type-fest": "^2.1.0",
|
||||
"typescript": "^4.3.5",
|
||||
"yaml-language-server": "^0.22.0"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { worker } from 'monaco-editor/esm/vs/editor/editor.api';
|
||||
import { Promisable } from 'type-fest';
|
||||
import { TextDocument } from 'vscode-languageserver-textdocument';
|
||||
import * as ls from 'vscode-languageserver-types';
|
||||
import {
|
||||
|
|
@ -14,19 +15,19 @@ if (typeof fetch !== 'undefined') {
|
|||
}
|
||||
|
||||
export interface YAMLWorker {
|
||||
doValidation: (uri: string) => PromiseLike<ls.Diagnostic[]>;
|
||||
doValidation: (uri: string) => Promisable<ls.Diagnostic[]>;
|
||||
|
||||
doComplete: (uri: string, position: ls.Position) => PromiseLike<ls.CompletionList>;
|
||||
doComplete: (uri: string, position: ls.Position) => Promisable<ls.CompletionList>;
|
||||
|
||||
doHover: (uri: string, position: ls.Position) => PromiseLike<ls.Hover>;
|
||||
doHover: (uri: string, position: ls.Position) => Promisable<ls.Hover>;
|
||||
|
||||
format: (uri: string, options: CustomFormatterOptions) => PromiseLike<ls.TextEdit[]>;
|
||||
format: (uri: string, options: CustomFormatterOptions) => Promisable<ls.TextEdit[]>;
|
||||
|
||||
resetSchema: (uri: string) => PromiseLike<boolean>;
|
||||
resetSchema: (uri: string) => Promisable<boolean>;
|
||||
|
||||
findDocumentSymbols: (uri: string) => PromiseLike<ls.DocumentSymbol[]>;
|
||||
findDocumentSymbols: (uri: string) => Promisable<ls.DocumentSymbol[]>;
|
||||
|
||||
findLinks: (uri: string) => PromiseLike<ls.DocumentLink[]>;
|
||||
findLinks: (uri: string) => Promisable<ls.DocumentLink[]>;
|
||||
}
|
||||
|
||||
export function createYAMLWorker(
|
||||
|
|
@ -63,7 +64,7 @@ export function createYAMLWorker(
|
|||
if (document) {
|
||||
return languageService.doValidation(document, isKubernetes);
|
||||
}
|
||||
return Promise.resolve([]);
|
||||
return [];
|
||||
},
|
||||
|
||||
doComplete(uri, position) {
|
||||
|
|
@ -78,18 +79,16 @@ export function createYAMLWorker(
|
|||
|
||||
format(uri, options) {
|
||||
const document = getTextDocument(uri);
|
||||
const textEdits = languageService.doFormat(document, options);
|
||||
return Promise.resolve(textEdits);
|
||||
return languageService.doFormat(document, options);
|
||||
},
|
||||
|
||||
resetSchema(uri) {
|
||||
return Promise.resolve(languageService.resetSchema(uri));
|
||||
return languageService.resetSchema(uri);
|
||||
},
|
||||
|
||||
findDocumentSymbols(uri) {
|
||||
const document = getTextDocument(uri);
|
||||
const symbols = languageService.findDocumentSymbols2(document, {});
|
||||
return Promise.resolve(symbols);
|
||||
return languageService.findDocumentSymbols2(document, {});
|
||||
},
|
||||
|
||||
findLinks(uri) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue