chore(vscode): update to 1.56.0
This commit is contained in:
@ -0,0 +1,41 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
const path = require('path');
|
||||
const fse = require('fs-extra');
|
||||
const esbuild = require('esbuild');
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
|
||||
const isWatch = args.indexOf('--watch') >= 0;
|
||||
|
||||
let outputRoot = __dirname;
|
||||
const outputRootIndex = args.indexOf('--outputRoot');
|
||||
if (outputRootIndex >= 0) {
|
||||
outputRoot = args[outputRootIndex + 1];
|
||||
}
|
||||
|
||||
const outDir = path.join(outputRoot, 'notebook-out');
|
||||
esbuild.build({
|
||||
entryPoints: [
|
||||
path.join(__dirname, 'notebook', 'katex.ts'),
|
||||
path.join(__dirname, 'notebook', 'emoji.ts')
|
||||
],
|
||||
bundle: true,
|
||||
minify: true,
|
||||
sourcemap: false,
|
||||
format: 'esm',
|
||||
outdir: outDir,
|
||||
platform: 'browser',
|
||||
target: ['es2020'],
|
||||
incremental: isWatch,
|
||||
}).catch(() => process.exit(1));
|
||||
|
||||
fse.copySync(
|
||||
path.join(__dirname, 'node_modules/katex/dist/katex.min.css'),
|
||||
path.join(outDir, 'katex.min.css'));
|
||||
|
||||
fse.copySync(
|
||||
path.join(__dirname, 'node_modules/katex/dist/fonts'),
|
||||
path.join(outDir, 'fonts/'));
|
@ -4,17 +4,8 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import type * as markdownIt from 'markdown-it';
|
||||
|
||||
declare const extendMarkdownIt: undefined | (
|
||||
(f: (md: markdownIt.MarkdownIt) => void) => void
|
||||
);
|
||||
|
||||
(function () {
|
||||
if (typeof extendMarkdownIt !== 'undefined') {
|
||||
const emoji = require('markdown-it-emoji');
|
||||
|
||||
extendMarkdownIt((md: markdownIt.MarkdownIt) => {
|
||||
md.use(emoji);
|
||||
});
|
||||
}
|
||||
}());
|
||||
const emoji = require('markdown-it-emoji');
|
||||
|
||||
export function extendMarkdownIt(md: markdownIt.MarkdownIt) {
|
||||
return md.use(emoji);
|
||||
}
|
||||
|
@ -4,24 +4,17 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import type * as markdownIt from 'markdown-it';
|
||||
|
||||
declare const extendMarkdownIt: undefined | (
|
||||
(f: (md: markdownIt.MarkdownIt) => void) => void
|
||||
);
|
||||
|
||||
const styleHref = (document.currentScript as any).src.replace(/katex.js$/, 'katex.min.css');
|
||||
const styleHref = import.meta.url.replace(/katex.js$/, 'katex.min.css');
|
||||
|
||||
const link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.classList.add('markdown-style');
|
||||
link.href = styleHref;
|
||||
|
||||
document.head.append(link);
|
||||
|
||||
(function () {
|
||||
const katex = require('@iktakahiro/markdown-it-katex');
|
||||
if (typeof extendMarkdownIt !== 'undefined') {
|
||||
const katex = require('@iktakahiro/markdown-it-katex');
|
||||
|
||||
extendMarkdownIt((md: markdownIt.MarkdownIt) => {
|
||||
md.use(katex);
|
||||
});
|
||||
}
|
||||
}());
|
||||
export function extendMarkdownIt(md: markdownIt.MarkdownIt) {
|
||||
return md.use(katex);
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
{
|
||||
"extends": "../../shared.tsconfig.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist/",
|
||||
"jsx": "react",
|
||||
"module": "es2020",
|
||||
"lib": [
|
||||
"es2018",
|
||||
"DOM",
|
||||
|
@ -14,27 +14,32 @@
|
||||
"categories": [
|
||||
"Other"
|
||||
],
|
||||
"capabilities": {
|
||||
"virtualWorkspaces": false
|
||||
},
|
||||
"contributes": {
|
||||
"notebookMarkdownRenderer": [
|
||||
"notebookMarkupRenderers": [
|
||||
{
|
||||
"id": "markdownItRenderer-katex",
|
||||
"displayName": "Markdown it katex renderer",
|
||||
"entrypoint": "./notebook-out/katex.js"
|
||||
"entrypoint": "./notebook-out/katex.js",
|
||||
"dependsOn": "markdownItRenderer"
|
||||
},
|
||||
{
|
||||
"id": "markdownItRenderer-emoji",
|
||||
"displayName": "Markdown it emoji renderer",
|
||||
"entrypoint": "./notebook-out/emoji.js"
|
||||
"entrypoint": "./notebook-out/emoji.js",
|
||||
"dependsOn": "markdownItRenderer"
|
||||
}
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "npm run build-notebook",
|
||||
"watch": "npm run build-notebook",
|
||||
"build-notebook": "npx webpack-cli --config webpack.notebook.js --mode production"
|
||||
"build-notebook": "node ./esbuild"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@iktakahiro/markdown-it-katex": "^4.0.1",
|
||||
"@iktakahiro/markdown-it-katex": "https://github.com/mjbvz/markdown-it-katex.git",
|
||||
"@types/markdown-it": "^0.0.0",
|
||||
"markdown-it": "^12.0.4",
|
||||
"markdown-it-emoji": "^2.0.0"
|
||||
|
@ -1,50 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
const path = require('path');
|
||||
const CopyPlugin = require('copy-webpack-plugin');
|
||||
|
||||
module.exports = {
|
||||
context: path.resolve(__dirname),
|
||||
mode: 'production',
|
||||
performance: {
|
||||
hints: false,
|
||||
maxEntrypointSize: 512000,
|
||||
maxAssetSize: 512000
|
||||
},
|
||||
entry: {
|
||||
katex: './notebook/katex.ts',
|
||||
emoji: './notebook/emoji.ts',
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: 'ts-loader',
|
||||
},
|
||||
],
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.js']
|
||||
},
|
||||
output: {
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname, 'notebook-out')
|
||||
},
|
||||
plugins: [
|
||||
// @ts-ignore
|
||||
new CopyPlugin({
|
||||
patterns: [
|
||||
{
|
||||
from: './node_modules/katex/dist/katex.min.css',
|
||||
to: 'katex.min.css'
|
||||
},
|
||||
{
|
||||
from: './node_modules/katex/dist/fonts',
|
||||
to: 'fonts/'
|
||||
},
|
||||
],
|
||||
}),
|
||||
]
|
||||
};
|
@ -2,12 +2,11 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@iktakahiro/markdown-it-katex@^4.0.1":
|
||||
"@iktakahiro/markdown-it-katex@https://github.com/mjbvz/markdown-it-katex.git":
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/@iktakahiro/markdown-it-katex/-/markdown-it-katex-4.0.1.tgz#65ff9d12afd4c0b7684dd247abe7ce42fc1edac3"
|
||||
integrity sha512-kGFooO7fIOgY34PSG8ZNVsUlKhhNoqhzW2kq94TNGa8COzh73PO4KsEoPOsQVG1mEAe8tg7GqG0FoVao0aMHaw==
|
||||
resolved "https://github.com/mjbvz/markdown-it-katex.git#e88925a7cb3fd593a14ed117fb43627c4ba910b6"
|
||||
dependencies:
|
||||
katex "^0.12.0"
|
||||
katex "^0.13.0"
|
||||
|
||||
"@types/markdown-it@^0.0.0":
|
||||
version "0.0.0"
|
||||
@ -19,22 +18,22 @@ argparse@^2.0.1:
|
||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
|
||||
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
|
||||
|
||||
commander@^2.19.0:
|
||||
version "2.20.3"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
|
||||
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
|
||||
commander@^6.0.0:
|
||||
version "6.2.1"
|
||||
resolved "https://registry.yarnpkg.com/commander/-/commander-6.2.1.tgz#0792eb682dfbc325999bb2b84fddddba110ac73c"
|
||||
integrity sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==
|
||||
|
||||
entities@~2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5"
|
||||
integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==
|
||||
|
||||
katex@^0.12.0:
|
||||
version "0.12.0"
|
||||
resolved "https://registry.yarnpkg.com/katex/-/katex-0.12.0.tgz#2fb1c665dbd2b043edcf8a1f5c555f46beaa0cb9"
|
||||
integrity sha512-y+8btoc/CK70XqcHqjxiGWBOeIL8upbS0peTPXTvgrh21n1RiWWcIpSWM+4uXq+IAgNh9YYQWdc7LVDPDAEEAg==
|
||||
katex@^0.13.0:
|
||||
version "0.13.0"
|
||||
resolved "https://registry.yarnpkg.com/katex/-/katex-0.13.0.tgz#62900e56c1ad8fdf7da23399e50d7a7b690b39ab"
|
||||
integrity sha512-6cHbzbegYgS9vvVGuH8UA+o97X+ZshtboSqJJCdq7trBYzuD75JNwr7Ef606xkUjecPPhFnyB+afx1dVafielg==
|
||||
dependencies:
|
||||
commander "^2.19.0"
|
||||
commander "^6.0.0"
|
||||
|
||||
linkify-it@^3.0.1:
|
||||
version "3.0.2"
|
||||
|
Reference in New Issue
Block a user