diff --git a/package-lock.json b/package-lock.json index c1ecd49d..2dff6d2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1442,6 +1442,158 @@ "is-symbol": "^1.0.2" } }, + "esbuild": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.17.tgz", + "integrity": "sha512-JLgyC6Uv31mv9T9Mm2xF1LntUMCNBSzvg2n32d8cTKZMwFr1wmMFY2FkVum98TSoEsDff0cR+Aj49H2sbBcjKQ==", + "dev": true, + "requires": { + "esbuild-android-arm64": "0.14.17", + "esbuild-darwin-64": "0.14.17", + "esbuild-darwin-arm64": "0.14.17", + "esbuild-freebsd-64": "0.14.17", + "esbuild-freebsd-arm64": "0.14.17", + "esbuild-linux-32": "0.14.17", + "esbuild-linux-64": "0.14.17", + "esbuild-linux-arm": "0.14.17", + "esbuild-linux-arm64": "0.14.17", + "esbuild-linux-mips64le": "0.14.17", + "esbuild-linux-ppc64le": "0.14.17", + "esbuild-linux-s390x": "0.14.17", + "esbuild-netbsd-64": "0.14.17", + "esbuild-openbsd-64": "0.14.17", + "esbuild-sunos-64": "0.14.17", + "esbuild-windows-32": "0.14.17", + "esbuild-windows-64": "0.14.17", + "esbuild-windows-arm64": "0.14.17" + } + }, + "esbuild-android-arm64": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.17.tgz", + "integrity": "sha512-y7EJm8ADC9qKbo/dJ2zBXwNdIILJ76tTv7JDGvOkbLT8HJXIsgbpa0NJk7iFhyvP4GpsYvXTbvEQNn0DhyBhLA==", + "dev": true, + "optional": true + }, + "esbuild-darwin-64": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.17.tgz", + "integrity": "sha512-V2JAP8yyVbW6qR4SVXsEDqRicYM0x5niUuB05IFiE5itPI45k8j2dA2l+DtirR2SGXr+LEqgX347+2VA6eyTiA==", + "dev": true, + "optional": true + }, + "esbuild-darwin-arm64": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.17.tgz", + "integrity": "sha512-ENkSKpjF4SImyA2TdHhKiZqtYc1DkMykICe1KSBw0YNF1sentjFI6wu+CRiYMpC7REf/3TQXoems2XPqIqDMlQ==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-64": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.17.tgz", + "integrity": "sha512-2i0nTNJM8ftNTvtR00vdqkru8XpHwAbkR2MBLoK2IDSzjsLStwCj+mxf6v83eVM9Abe3QA8xP+irqOdBlwDQ2g==", + "dev": true, + "optional": true + }, + "esbuild-freebsd-arm64": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.17.tgz", + "integrity": "sha512-QOmRi1n+uly2G7BbMbHb86YiFA5aM7B2T96A6OF1VG57LNwXwy8LPVM0PVjl7f9cV3pE3fy3VtXPJHJo8XggTA==", + "dev": true, + "optional": true + }, + "esbuild-linux-32": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.17.tgz", + "integrity": "sha512-qG5NDk7FHHUVw01rjHESON0HvigF2X80b645TUlgTKsWRlrbzzHhMCmQguA01O5PiCimKnyoxti8aJIFNHpQnQ==", + "dev": true, + "optional": true + }, + "esbuild-linux-64": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.17.tgz", + "integrity": "sha512-De8OcmNvfNyFfQRLWbfuZqau6NpYBJxNTLP7Ls/PqQcw0HAwfaYThutY8ozHpPbKFPa7wgqabXlIC4NVSWT0/A==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.17.tgz", + "integrity": "sha512-ZwsgFUk3gR2pEMJdh5z4Ds18fvGETgElPqmNdx1NtZTCOVlFMAwFB5u/tOR2FrXbMFv+LkGnNxPDh48PYPDz9A==", + "dev": true, + "optional": true + }, + "esbuild-linux-arm64": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.17.tgz", + "integrity": "sha512-WDEOD/YRA4J1lxhETKZff3gRxGYqqZEiVwIOqNfvCh2YcwWU2y6UmNGZsxcuKk18wot4dAXCXQyNZgBkVUTCLw==", + "dev": true, + "optional": true + }, + "esbuild-linux-mips64le": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.17.tgz", + "integrity": "sha512-Lf4X9NB7r6imzp/11TaGs4kWL0DUn1JxI9gAAKotnKh6T8Y/0sLvZSvQS8WvSZcr0V8RRCrRZwiQqjOALUU/9g==", + "dev": true, + "optional": true + }, + "esbuild-linux-ppc64le": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.17.tgz", + "integrity": "sha512-aExhxbrK7/Mh9FArdiC9MbvrQz2bGCDI8cBALKJbmhKg0h7LNt6y1E1S9GGBZ/ZXkHDvV9FFVrXXZKFVU5Qpiw==", + "dev": true, + "optional": true + }, + "esbuild-linux-s390x": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.17.tgz", + "integrity": "sha512-b0T20rNcS7POi5YLw5dFlsiC+riobR5IfppQGn5NWer6QiIkdL1vOx9eC9CUD3z1itpkLboRAZYieZfKfhCA2Q==", + "dev": true, + "optional": true + }, + "esbuild-netbsd-64": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.17.tgz", + "integrity": "sha512-pFgTaAa2JF18nqNfCND9wOu1jbZ/mbDSaMxUp5fTkLlofyHhXeb5aChgXUkeipty2Pgq0OwOnxjHmiAxMI7N4g==", + "dev": true, + "optional": true + }, + "esbuild-openbsd-64": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.17.tgz", + "integrity": "sha512-K5+plb6gsAfBcFqB0EG4KvLbgBKslVAfEyJggicwt/QoDwQGJAzao4M6zOA4PG7LlXOwWSqv7VmSFbH+b6DyKw==", + "dev": true, + "optional": true + }, + "esbuild-sunos-64": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.17.tgz", + "integrity": "sha512-o1FINkbHRi9JB1YteOSXZdkDOmVUbmnCxRmTLkHvk8pfCFNpv/5/7ktt95teYKbEiJna2dEt3M4ckJ/+UVnW+w==", + "dev": true, + "optional": true + }, + "esbuild-windows-32": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.17.tgz", + "integrity": "sha512-Qutilz0I7OADWBtWrC/FD+2O/TNAkhwbZ+wIns7kF87lxIMtmqpBt3KnMk1e4F47aTrZRr0oH55Zhztd7m2PAA==", + "dev": true, + "optional": true + }, + "esbuild-windows-64": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.17.tgz", + "integrity": "sha512-b21/oRV+PHrav0HkRpKjbM2yNRVe34gAfbdMppbZFea416wa8SrjcmVfSd7n4jgqoTQG0xe+MGgOpwXtjiB3DQ==", + "dev": true, + "optional": true + }, + "esbuild-windows-arm64": { + "version": "0.14.17", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.17.tgz", + "integrity": "sha512-4HN9E1idllewYvptcrrdfTA6DIWgg11kK0Zrv6yjxstJZLJeKxfilGBEaksLGs4Pst2rAYMx3H2vbYq7AWLQNA==", + "dev": true, + "optional": true + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", diff --git a/package.json b/package.json index 318f7d54..590e3e38 100644 --- a/package.json +++ b/package.json @@ -18,10 +18,10 @@ "bugs": "https://github.com/asciidoctor/asciidoctor-vscode/issues", "homepage": "https://github.com/asciidoctor/asciidoctor-vscode/blob/master/README.md", "icon": "images/icon.png", + "main": "./out/extension.js", "browser": "./dist/browser/extension", - "main": "./dist/src/extension.js", "engines": { - "vscode": "^1.31.0" + "vscode": "^1.60.0" }, "categories": [ "Programming Languages" @@ -466,11 +466,14 @@ ] }, "scripts": { + "vscode:prepublish": "npm run build-ext -- --minify", "copy-assets": "cp node_modules/@highlightjs/cdn-assets/highlight.min.js media/highlightjs && cp -r node_modules/@highlightjs/cdn-assets/languages media/highlightjs && cp -r node_modules/@highlightjs/cdn-assets/styles media/highlightjs", "dev": "npm run build", "build": "npm run copy-assets && npm run build-ext && npm run build-preview", "build-web": "webpack --config extension-browser.webpack.config --mode none", "build-preview": "webpack --config extension-preview.webpack.config --mode production", + "build-ext": "esbuild ./src/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node", + "build-ext:watch": "npm run build-ext -- --sourcemap --watch", "build-ext": "tsc -p ./", "package": "npm run build && npm run build-web && vsce package", "deploy": "vsce publish -p", @@ -488,6 +491,7 @@ "@typescript-eslint/eslint-plugin": "^4.31.1", "@typescript-eslint/parser": "^4.31.1", "copy-webpack-plugin": "^9.0.1", + "esbuild": "^0.14.17", "eslint": "^7.32.0", "eslint-plugin-import": "^2.20.2", "eslint-plugin-node": "^11.1.0", diff --git a/src/commands/exportAsPDF.ts b/src/commands/exportAsPDF.ts index 441eb281..e93716e9 100644 --- a/src/commands/exportAsPDF.ts +++ b/src/commands/exportAsPDF.ts @@ -3,7 +3,7 @@ import * as os from 'os' import * as fs from 'fs' import * as path from 'path' import { exec, spawn } from 'child_process' -import { uuidv4 } from 'uuid' +import { v4 as uuidv4 } from 'uuid' import * as zlib from 'zlib' import { AsciidocEngine } from '../asciidocEngine' import { Command } from '../commandManager' diff --git a/src/image-paste.ts b/src/image-paste.ts index 11ac5e25..99925980 100644 --- a/src/image-paste.ts +++ b/src/image-paste.ts @@ -1,7 +1,7 @@ import * as path from 'path' import * as vscode from 'vscode' import { spawn } from 'child_process' -import * as moment from 'moment' +import moment from 'moment' import * as fs from 'fs' import { AsciidocParser } from './asciidocParser' diff --git a/src/test/suite/index.ts b/src/test/suite/index.ts index b47511db..80a23b94 100644 --- a/src/test/suite/index.ts +++ b/src/test/suite/index.ts @@ -1,6 +1,6 @@ -import * as path from 'path' -import * as Mocha from 'mocha' -import * as glob from 'glob' +import path from 'path' +import Mocha from 'mocha' +import glob from 'glob' export function run (): Promise { // Create the mocha test diff --git a/tsconfig.json b/tsconfig.json index 40227eea..12ad19fa 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,9 @@ { "compilerOptions": { + "esModuleInterop": true, "resolveJsonModule": true, "module": "commonjs", - "target": "es6", + "target": "es2020", "outDir": "dist", "lib": [ "es6",