Updates to support the upcoming welcome message

This commit is contained in:
Elio Struyf
2021-08-26 20:28:43 +02:00
parent 939cf94de6
commit 2c1fd2890c
4 changed files with 26 additions and 14 deletions
+6 -3
View File
@@ -51,12 +51,14 @@
"@headlessui/react": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.4.0.tgz",
"integrity": "sha512-C+FmBVF6YGvqcEI5fa2dfVbEaXr2RGR6Kw1E5HXIISIZEfsrH/yuCgsjWw5nlRF9vbCxmQ/EKs64GAdKeb8gCw=="
"integrity": "sha512-C+FmBVF6YGvqcEI5fa2dfVbEaXr2RGR6Kw1E5HXIISIZEfsrH/yuCgsjWw5nlRF9vbCxmQ/EKs64GAdKeb8gCw==",
"dev": true
},
"@heroicons/react": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@heroicons/react/-/react-1.0.4.tgz",
"integrity": "sha512-3kOrTmo8+Z8o6AL0rzN82MOf8J5CuxhRLFhpI8mrn+3OqekA6d5eb1GYO3EYYo1Vn6mYQSMNTzCWbEwUInb0cQ=="
"integrity": "sha512-3kOrTmo8+Z8o6AL0rzN82MOf8J5CuxhRLFhpI8mrn+3OqekA6d5eb1GYO3EYYo1Vn6mYQSMNTzCWbEwUInb0cQ==",
"dev": true
},
"@iarna/toml": {
"version": "2.2.3",
@@ -3263,7 +3265,8 @@
"lodash.uniqby": {
"version": "4.7.0",
"resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz",
"integrity": "sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI="
"integrity": "sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI=",
"dev": true
},
"loose-envify": {
"version": "1.4.0",
+6 -9
View File
@@ -30,10 +30,8 @@
],
"keywords": [
"Front Matter",
"Hugo",
"Jekyll",
"Gatsby",
"Hexo",
"CMS",
"Markdown",
"Taxonomy"
],
"license": "MIT",
@@ -113,7 +111,7 @@
"markdownDescription": "Specify the path to a Node.js script to execute. The current file path will be provided as an argument."
},
"frontMatter.dashboard.openOnStart": {
"type": "boolean",
"type": ["boolean", "null"],
"default": null,
"description": "Specify if you want to open the dashboard when you start VS Code."
},
@@ -410,11 +408,10 @@
"typescript": "4.0.2",
"wc-react": "github:estruyf/wc-react",
"webpack": "4.44.2",
"webpack-cli": "3.3.12"
},
"dependencies": {
"webpack-cli": "3.3.12",
"@headlessui/react": "1.4.0",
"@heroicons/react": "1.0.4",
"lodash.uniqby": "4.7.0"
}
},
"dependencies": {}
}
+3
View File
@@ -1,5 +1,8 @@
const extensionName = "frontMatter";
export const EXTENSION_ID = 'eliostruyf.vscode-front-matter';
export const EXTENSION_STATE_VERSION = 'frontMatter:Version';
export const getCommandName = (command: string) => {
return `${extensionName}.${command}`;
};
+11 -2
View File
@@ -5,11 +5,12 @@ import { Folders } from './commands/Folders';
import { Preview } from './commands/Preview';
import { Project } from './commands/Project';
import { Template } from './commands/Template';
import { COMMAND_NAME } from './constants/Extension';
import { COMMAND_NAME, EXTENSION_ID, EXTENSION_STATE_VERSION } from './constants/Extension';
import { TaxonomyType } from './models';
import { MarkdownFoldingProvider } from './providers/MarkdownFoldingProvider';
import { TagType } from './viewpanel/TagType';
import { ExplorerView } from './webview/ExplorerView';
import { Notifications } from './helpers/Notifications';
let frontMatterStatusBar: vscode.StatusBarItem;
let statusDebouncer: { (fnc: any, time: number): void; };
@@ -18,15 +19,23 @@ let collection: vscode.DiagnosticCollection;
const mdSelector: vscode.DocumentSelector = { language: 'markdown', scheme: 'file' };
export async function activate({ subscriptions, extensionUri, extensionPath }: vscode.ExtensionContext) {
export async function activate({ subscriptions, extensionUri, extensionPath, globalState }: vscode.ExtensionContext) {
collection = vscode.languages.createDiagnosticCollection('frontMatter');
const frontMatter = vscode.extensions.getExtension(EXTENSION_ID)!;
const frontMatterVersoin = frontMatter.packageJSON.version;
const crntVersion = globalState.get<string>(EXTENSION_STATE_VERSION);
// Pages dashboard
Dashboard.init(extensionPath);
subscriptions.push(vscode.commands.registerCommand(COMMAND_NAME.dashboard, () => {
Dashboard.open(extensionPath);
}));
if (!crntVersion) {
vscode.commands.executeCommand(COMMAND_NAME.dashboard);
}
// Register the explorer view
const explorerSidebar = ExplorerView.getInstance(extensionUri);
let explorerView = vscode.window.registerWebviewViewProvider(ExplorerView.viewType, explorerSidebar, {