mirror of
https://github.com/danbulant/monaco-yaml
synced 2026-07-08 20:40:46 +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: ['*']
|
tags: ['*']
|
||||||
|
|
||||||
jobs:
|
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:
|
pack:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -16,14 +25,14 @@ jobs:
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm pack
|
- run: npm pack
|
||||||
|
|
||||||
lint:
|
prettier:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with: { node-version: 16 }
|
with: { node-version: 16 }
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run lint
|
- run: npx prettier --check .
|
||||||
|
|
||||||
tsc:
|
tsc:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -33,3 +42,15 @@ jobs:
|
||||||
with: { node-version: 16 }
|
with: { node-version: 16 }
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npx tsc
|
- 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",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "webpack serve --open --mode development",
|
"start": "webpack serve --open --mode development",
|
||||||
"build": "webpack --mode production"
|
"build": "webpack --mode production"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-free": "^5.15.4",
|
"@fortawesome/fontawesome-free": "^5.15.4",
|
||||||
"css-loader": "^6.2.0",
|
"css-loader": "^6.2.0",
|
||||||
"css-minimizer-webpack-plugin": "^3.0.2",
|
"css-minimizer-webpack-plugin": "^3.0.2",
|
||||||
|
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
|
|
@ -1,3 +1,3 @@
|
||||||
[build]
|
[build]
|
||||||
publish = 'examples/webpack/dist/'
|
publish = 'examples/demo/dist/'
|
||||||
command = 'npm ci && npm run prepack && npm --workspace webpack-example run build'
|
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",
|
"homepage": "https://monaco-yaml.js.org",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepack": "node build.js",
|
"prepack": "node build.js",
|
||||||
"prepare": "husky install",
|
"prepare": "husky install"
|
||||||
"lint": "eslint . && prettier --check ."
|
|
||||||
},
|
},
|
||||||
"main": "./lib/esm/monaco.contribution.js",
|
"main": "./lib/esm/monaco.contribution.js",
|
||||||
"module": "./lib/esm/monaco.contribution.js",
|
"module": "./lib/esm/monaco.contribution.js",
|
||||||
|
|
@ -59,6 +58,7 @@
|
||||||
"husky": "^7.0.1",
|
"husky": "^7.0.1",
|
||||||
"lint-staged": "^11.1.1",
|
"lint-staged": "^11.1.1",
|
||||||
"monaco-editor": "^0.27.0",
|
"monaco-editor": "^0.27.0",
|
||||||
|
"type-fest": "^2.1.0",
|
||||||
"typescript": "^4.3.5",
|
"typescript": "^4.3.5",
|
||||||
"yaml-language-server": "^0.22.0"
|
"yaml-language-server": "^0.22.0"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { worker } from 'monaco-editor/esm/vs/editor/editor.api';
|
import { worker } from 'monaco-editor/esm/vs/editor/editor.api';
|
||||||
|
import { Promisable } from 'type-fest';
|
||||||
import { TextDocument } from 'vscode-languageserver-textdocument';
|
import { TextDocument } from 'vscode-languageserver-textdocument';
|
||||||
import * as ls from 'vscode-languageserver-types';
|
import * as ls from 'vscode-languageserver-types';
|
||||||
import {
|
import {
|
||||||
|
|
@ -14,19 +15,19 @@ if (typeof fetch !== 'undefined') {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface YAMLWorker {
|
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(
|
export function createYAMLWorker(
|
||||||
|
|
@ -63,7 +64,7 @@ export function createYAMLWorker(
|
||||||
if (document) {
|
if (document) {
|
||||||
return languageService.doValidation(document, isKubernetes);
|
return languageService.doValidation(document, isKubernetes);
|
||||||
}
|
}
|
||||||
return Promise.resolve([]);
|
return [];
|
||||||
},
|
},
|
||||||
|
|
||||||
doComplete(uri, position) {
|
doComplete(uri, position) {
|
||||||
|
|
@ -78,18 +79,16 @@ export function createYAMLWorker(
|
||||||
|
|
||||||
format(uri, options) {
|
format(uri, options) {
|
||||||
const document = getTextDocument(uri);
|
const document = getTextDocument(uri);
|
||||||
const textEdits = languageService.doFormat(document, options);
|
return languageService.doFormat(document, options);
|
||||||
return Promise.resolve(textEdits);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
resetSchema(uri) {
|
resetSchema(uri) {
|
||||||
return Promise.resolve(languageService.resetSchema(uri));
|
return languageService.resetSchema(uri);
|
||||||
},
|
},
|
||||||
|
|
||||||
findDocumentSymbols(uri) {
|
findDocumentSymbols(uri) {
|
||||||
const document = getTextDocument(uri);
|
const document = getTextDocument(uri);
|
||||||
const symbols = languageService.findDocumentSymbols2(document, {});
|
return languageService.findDocumentSymbols2(document, {});
|
||||||
return Promise.resolve(symbols);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
findLinks(uri) {
|
findLinks(uri) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue