mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-08-07 09:23:00 +02:00
Beta schema
This commit is contained in:
@@ -4,10 +4,13 @@ const path = require('path');
|
||||
const pkgJson = require('../../package.json');
|
||||
|
||||
if (pkgJson?.contributes?.configuration) {
|
||||
const idUrl = process.env.VERCEL_ENV === "preview" ? "https://beta.frontmatter.codes/frontmatter.schema.json" : "https://frontmatter.codes/frontmatter.schema.json";
|
||||
|
||||
const schema = {
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://frontmatter.codes/frontmatter.schema.json",
|
||||
...pkgJson.contributes.configuration
|
||||
"$id": idUrl,
|
||||
...pkgJson.contributes.configuration,
|
||||
"title": "Front Matter - Team Settings"
|
||||
}
|
||||
|
||||
fs.writeFileSync(path.join(path.resolve('.'), '/public/frontmatter.schema.json'), JSON.stringify(schema, null, 2));
|
||||
|
||||
@@ -455,7 +455,13 @@ export class Dashboard {
|
||||
* @param msg
|
||||
*/
|
||||
private static postWebviewMessage(msg: { command: DashboardCommand, data?: any }) {
|
||||
Dashboard.webview?.webview.postMessage(msg);
|
||||
if (Dashboard.isDisposed) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Dashboard.webview) {
|
||||
Dashboard.webview?.webview.postMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,13 +5,14 @@ import { SETTING_TAXONOMY_TAGS, SETTING_TAXONOMY_CATEGORIES, CONFIG_KEY } from '
|
||||
import { Folders } from '../commands/Folders';
|
||||
import { join, basename } from 'path';
|
||||
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
||||
import { Extension } from './Extension';
|
||||
|
||||
export class Settings {
|
||||
private static config: vscode.WorkspaceConfiguration;
|
||||
private static globalFile = "frontmatter.json";
|
||||
private static globalConfig: any;
|
||||
private static initialConfig = {
|
||||
"$schema": "https://frontmatter.codes/frontmatter.schema.json"
|
||||
"$schema": `https://${Extension.getInstance().isBetaVersion() ? `beta.` : ``}frontmatter.codes/frontmatter.schema.json`
|
||||
};
|
||||
|
||||
public static init() {
|
||||
|
||||
Reference in New Issue
Block a user