diff --git a/.gitignore b/.gitignore index aab5678aabd83..9e11d6e34bac8 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ errorShots examples/*/src-gen examples/*/gen-webpack.config.js examples/*/gen-webpack.node.config.js +examples/*/gen-esbuild.*.mjs examples/*/.test .browser_modules **/docs/api diff --git a/dev-packages/application-manager/package.json b/dev-packages/application-manager/package.json index 2b2369070bdfa..9594609598c21 100644 --- a/dev-packages/application-manager/package.json +++ b/dev-packages/application-manager/package.json @@ -36,6 +36,7 @@ "@theia/application-package": "1.55.0", "@theia/ffmpeg": "1.55.0", "@theia/native-webpack-plugin": "1.55.0", + "@theia/native-esbuild-plugin": "1.55.0", "@types/fs-extra": "^4.0.2", "@types/semver": "^7.5.0", "babel-loader": "^8.2.2", @@ -44,6 +45,9 @@ "copy-webpack-plugin": "^8.1.1", "css-loader": "^6.2.0", "electron-rebuild": "^3.2.7", + "esbuild": "^0.24.0", + "esbuild-plugins-node-modules-polyfill": "^1.6.7", + "esbuild-plugin-copy": "^2.1.1", "fs-extra": "^4.0.2", "http-server": "^14.1.1", "ignore-loader": "^0.1.2", diff --git a/dev-packages/application-manager/src/application-package-manager.ts b/dev-packages/application-manager/src/application-package-manager.ts index 09d3d26956789..e44bb3fbfc905 100644 --- a/dev-packages/application-manager/src/application-package-manager.ts +++ b/dev-packages/application-manager/src/application-package-manager.ts @@ -19,7 +19,7 @@ import * as fs from 'fs-extra'; import * as cp from 'child_process'; import * as semver from 'semver'; import { ApplicationPackage, ApplicationPackageOptions } from '@theia/application-package'; -import { WebpackGenerator, FrontendGenerator, BackendGenerator } from './generator'; +import { BundlerGenerator, FrontendGenerator, BackendGenerator } from './generator'; import { ApplicationProcess } from './application-process'; import { GeneratorOptions } from './generator/abstract-generator'; import yargs = require('yargs'); @@ -73,12 +73,14 @@ export class ApplicationPackageManager { } async clean(): Promise { - const webpackGenerator = new WebpackGenerator(this.pck); + const bundlerGenerator = new BundlerGenerator(this.pck); await Promise.all([ this.remove(this.pck.lib()), this.remove(this.pck.srcGen()), - this.remove(webpackGenerator.genConfigPath), - this.remove(webpackGenerator.genNodeConfigPath) + this.remove(bundlerGenerator.genConfigPath), + this.remove(bundlerGenerator.genNodeConfigPath), + this.remove(bundlerGenerator.genESBuildBrowserPath), + this.remove(bundlerGenerator.genESBuildNodePath), ]); } @@ -99,7 +101,7 @@ export class ApplicationPackageManager { throw error; } await Promise.all([ - new WebpackGenerator(this.pck, options).generate(), + new BundlerGenerator(this.pck, options).generate(), new BackendGenerator(this.pck, options).generate(), new FrontendGenerator(this.pck, options).generate(), ]); @@ -111,9 +113,15 @@ export class ApplicationPackageManager { } async build(args: string[] = [], options: GeneratorOptions = {}): Promise { + const bundlerGenerator = new BundlerGenerator(this.pck); await this.generate(options); await this.copy(); - return this.__process.run('webpack', args); + if (await bundlerGenerator.preferESBuild()) { + const process = this.__process.spawn('node', [bundlerGenerator.esbuildPath, ...args]); + return this.__process.promisify('esbuild', process); + } else { + return this.__process.run('webpack', args); + } } start(args: string[] = []): cp.ChildProcess { diff --git a/dev-packages/application-manager/src/application-process.ts b/dev-packages/application-manager/src/application-process.ts index 2befd37bcfc50..9871d60bfeb5b 100644 --- a/dev-packages/application-manager/src/application-process.ts +++ b/dev-packages/application-manager/src/application-process.ts @@ -64,7 +64,7 @@ export class ApplicationProcess { return process.platform === 'win32' ? commandPath + '.cmd' : commandPath; } - protected promisify(command: string, p: cp.ChildProcess): Promise { + promisify(command: string, p: cp.ChildProcess): Promise { return new Promise((resolve, reject) => { p.stdout!.on('data', data => this.pck.log(data.toString())); p.stderr!.on('data', data => this.pck.error(data.toString())); diff --git a/dev-packages/application-manager/src/generator/webpack-generator.ts b/dev-packages/application-manager/src/generator/bundler-generator.ts similarity index 60% rename from dev-packages/application-manager/src/generator/webpack-generator.ts rename to dev-packages/application-manager/src/generator/bundler-generator.ts index 9cad52452cfb5..0303d0a21a750 100644 --- a/dev-packages/application-manager/src/generator/webpack-generator.ts +++ b/dev-packages/application-manager/src/generator/bundler-generator.ts @@ -18,16 +18,42 @@ import * as paths from 'path'; import * as fs from 'fs-extra'; import { AbstractGenerator } from './abstract-generator'; -export class WebpackGenerator extends AbstractGenerator { +export class BundlerGenerator extends AbstractGenerator { async generate(): Promise { - await this.write(this.genConfigPath, this.compileWebpackConfig()); - if (!this.pck.isBrowserOnly()) { - await this.write(this.genNodeConfigPath, this.compileNodeWebpackConfig()); + if (await this.preferESBuild()) { + await this.write(this.genESBuildBrowserPath, this.compileESBuildBrowserConfig()); + if (!this.pck.isBrowserOnly()) { + await this.write(this.genESBuildNodePath, this.compileESBuildNodeConfig()); + if (this.pck.isElectron()) { + await this.write(this.genESBuildElectronPath, this.compileESBuildElectronConfig()); + } + } + if (await this.shouldGenerateUserESBuildConfig()) { + await this.write(this.esbuildPath, this.compileESBuildUserConfig()); + } + } else { + await this.write(this.genConfigPath, this.compileWebpackConfig()); + if (!this.pck.isBrowserOnly()) { + await this.write(this.genNodeConfigPath, this.compileNodeWebpackConfig()); + } + if (await this.shouldGenerateUserWebpackConfig()) { + await this.write(this.configPath, this.compileUserWebpackConfig()); + } } - if (await this.shouldGenerateUserWebpackConfig()) { - await this.write(this.configPath, this.compileUserWebpackConfig()); + } + + async preferESBuild(): Promise { + // If a esbuild file already exists, prefer esbuild + if (await fs.pathExists(this.esbuildPath)) { + return true; + } + // If a webpack file already exists, prefer webpack + if (await fs.pathExists(this.configPath)) { + return false; } + // Otherwise, prefer ESBuild (for performance) + return true; } protected async shouldGenerateUserWebpackConfig(): Promise { @@ -35,7 +61,15 @@ export class WebpackGenerator extends AbstractGenerator { return true; } const content = await fs.readFile(this.configPath, 'utf8'); - return content.indexOf('gen-webpack') === -1; + return !content.includes('gen-webpack'); + } + + protected async shouldGenerateUserESBuildConfig(): Promise { + if (!(await fs.pathExists(this.esbuildPath))) { + return true; + } + const content = await fs.readFile(this.esbuildPath, 'utf8'); + return !content.includes('gen-esbuild'); } get configPath(): string { @@ -50,6 +84,22 @@ export class WebpackGenerator extends AbstractGenerator { return this.pck.path('gen-webpack.node.config.js'); } + get esbuildPath(): string { + return this.pck.path('esbuild.mjs'); + } + + get genESBuildBrowserPath(): string { + return this.pck.path('gen-esbuild.browser.mjs'); + } + + get genESBuildNodePath(): string { + return this.pck.path('gen-esbuild.node.mjs'); + } + + get genESBuildElectronPath(): string { + return this.pck.path('gen-esbuild.electron.mjs'); + } + protected resolve(moduleName: string, path: string): string { return this.pck.resolveModulePath(moduleName, path).split(paths.sep).join('/'); } @@ -497,6 +547,255 @@ module.exports = { nativePlugin, ignoredResources }; +`; + } + + compileESBuildBrowserConfig(): string { + return `/** + * Don't touch this file. It will be regenerated by theia build. + * To customize the build process, change ./esbuild.mjs + */ +import { nodeModulesPolyfillPlugin } from 'esbuild-plugins-node-modules-polyfill'; +import { copy } from 'esbuild-plugin-copy'; +import { problemMatcherPlugin } from '@theia/native-esbuild-plugin'; +import yargs from 'yargs'; +import resolvePackagePath from 'resolve-package-path'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +function join(...parts) { + return path.join(...parts).replace(/\\\\/g, '/'); +} + +const { mode, staticCompression, watch } = yargs.option('mode', { + description: "Mode to use", + choices: ["development", "production"], + default: "production" +}).option('static-compression', { + description: 'Controls whether to enable compression of static artifacts. TODO: Not implemented yet.', + type: 'boolean', + default: true +}).option('watch', { + description: 'Controls whether to enable watch mode', + type: 'boolean', + default: false +}).argv; + +const production = mode === 'production'; +const sourcemap = production ? false : 'linked'; +const minify = production; + +export { mode, staticCompression, watch, sourcemap, minify }; + +/** + * @type {Record} + */ +export const loader = { + '.css': 'css', + '.ttf': 'dataurl', + '.eot': 'dataurl', + '.svg': 'dataurl', + '.woff': 'dataurl', + '.woff2': 'dataurl', + '.jpg': 'dataurl', + '.png': 'dataurl', + '.gif': 'dataurl', + '.wasm': 'dataurl', + '.plist': 'dataurl', + '.node': 'file' +}; + +/** + * {@type {import('esbuild').BuildOptions}} + */ +export const browserOptions = { + entryPoints: { + 'bundle': './src-gen/frontend/index.js', + 'secondary-window': './src-gen/frontend/secondary-index.js', + ${this.ifMonaco(() => "'editor.worker': '@theia/monaco-editor-core/esm/vs/editor/editor.worker.js'")} + }, + assetNames: '[name]', + bundle: true, + outdir: 'lib/frontend', + platform: 'browser', + // Support UMD libraries + // but ensure that we also prioritize browser exports where possible + mainFields: ['browser', 'module', 'main'], + loader, + minify, + sourcemap, + plugins: [ + problemMatcherPlugin(watch, 'browser'), + nodeModulesPolyfillPlugin({ + globals: { + Buffer: true, + process: false + } + }), + copy({ + assets: [ + { + // copy secondary window html file to lib folder + from: join(__dirname, 'src-gen/frontend/secondary-window.html'), + to: join(__dirname, 'lib', 'frontend') + }${this.ifPackage('@theia/plugin-ext', `, + { + // copy webview files to lib folder + from: join(resolvePackagePath('@theia/plugin-ext', __dirname), '..', 'src', 'main', 'browser', 'webview', 'pre', '*'), + to: join(__dirname, 'lib', 'webview', 'pre') + }`)}${this.ifPackage('@theia/plugin-ext-vscode', `, + { + // copy frontend plugin host files + from: join(resolvePackagePath('@theia/plugin-ext-vscode', __dirname), '..', 'lib', 'node', 'context', 'plugin-vscode-init-fe.js'), + to: join(__dirname, 'lib', 'frontend', 'context') + }`)} + ] + }) + ] +}; +`; + } + + compileESBuildNodeConfig(): string { + return `/** + * Don't touch this file. It will be regenerated by theia build. + * To customize the build process, change ./esbuild.mjs + */ +import { nativeDependenciesPlugin, problemMatcherPlugin } from '@theia/native-esbuild-plugin'; +import { watch, loader, minify, sourcemap } from './gen-esbuild.browser.mjs'; + +/** + * @type {Record} + */ +export const nativeBindings = { + drivelist: 'drivelist/build/Release/drivelist.node' +}; + +/** + * {@type {import('esbuild').BuildOptions}} + */ +export const nodeOptions = { + entryPoints: { + 'main': './src-gen/backend/main', + 'ipc-bootstrap': '@theia/core/lib/node/messaging/ipc-bootstrap', + ${this.ifElectron("'electron-main': './src-gen/backend/electron-main',")} + ${this.ifPackage('@theia/plugin-ext', () => `// VS Code extension support: + 'plugin-host': '@theia/plugin-ext/lib/hosted/node/plugin-host',`)} + ${this.ifPackage('@theia/plugin-ext-headless', () => `// Theia Headless Plugin support: + 'plugin-host-headless': '@theia/plugin-ext-headless/lib/hosted/node/plugin-host-headless',`)} + ${this.ifPackage('@theia/process', () => `// Make sure the node-pty thread worker can be executed: + 'worker/conoutSocketWorker': 'node-pty/lib/worker/conoutSocketWorker',`)} + ${this.ifPackage('@theia/dev-container', () => `// VS Code Dev-Container communication: + 'dev-container-server': '@theia/dev-container/lib/dev-container-server/dev-container-server',`)} + ${this.ifPackage('@theia/plugin-ext', "'backend-init-theia': '@theia/plugin-ext/lib/hosted/node/scanners/backend-init-theia',")} + ${this.ifPackage('@theia/filesystem', "'parcel-watcher': '@theia/filesystem/lib/node/parcel-watcher',")} + ${this.ifPackage('@theia/plugin-ext-vscode', "'plugin-vscode-init': '@theia/plugin-ext-vscode/lib/node/plugin-vscode-init',")} + ${this.ifPackage('@theia/api-provider-sample', "'gotd-api-init': '@theia/api-provider-sample/lib/plugin/gotd-api-init',")} + ${this.ifPackage('@theia/git', "'git-locator-host': '@theia/git/lib/node/git-locator/git-locator-host',")} + }, + assetNames: 'native/[name]', + bundle: true, + outdir: 'lib/backend', + platform: 'node', + mainFields: ['node', 'module', 'main'], + external: ['electron'], + loader, + minify, + sourcemap, + plugins: [ + problemMatcherPlugin(watch, 'node'), + nativeDependenciesPlugin({ + pty: ${this.ifPackage('@theia/process', 'true', 'false')}, + ripgrep: ${this.ifPackage(['@theia/search-in-workspace', '@theia/file-search'], 'true', 'false')}, + trash: ${this.ifPackage('@theia/filesystem', 'true', 'false')}, + nativeBindings + }) + ] +}; +`; + }; + + compileESBuildUserConfig(): string { + return `/** + * This file can be edited to the ESBuild build process. + * To reset, delete this file and rerun theia build again. + */ +import { browserOptions, watch } from './gen-esbuild.browser.mjs'; +${this.ifBrowserOnly(`import esbuild from 'esbuild'; + +const browserContext = await esbuild.context(browserOptions); + +if (watch) { + await browserContext.watch(); +} else { + try { + await browserContext.rebuild(); + await browserContext.dispose(); + } catch (err) { + process.exit(1); + } +}`, `import { nodeOptions } from './gen-esbuild.node.mjs'; +${this.ifElectron("import { electronOptions } from './gen-esbuild.electron.mjs';")} +import esbuild from 'esbuild'; + +const browserContext = await esbuild.context(browserOptions); +const nodeContext = await esbuild.context(nodeOptions); +${this.ifElectron('const electronContext = await esbuild.context(electronOptions);')} + +if (watch) { + await Promise.all([ + browserContext.watch(), + nodeContext.watch(), + ${this.ifElectron('electronContext.watch(),')} + ]); +} else { + try { + await Promise.all([ + browserContext.rebuild(), + nodeContext.rebuild(), + ${this.ifElectron('electronContext.rebuild(),')} + ]); + await Promise.all([ + browserContext.dispose(), + nodeContext.dispose(), + ${this.ifElectron('electronContext.dispose(),')} + ]); + } catch (err) { + process.exit(1); + } +}`)} +`; + } + + compileESBuildElectronConfig(): string { + return `/** + * Don't touch this file. It will be regenerated by theia build. + * To customize the build process, change ./esbuild.mjs + */ +import { problemMatcherPlugin } from '@theia/native-esbuild-plugin'; +import { watch, loader, minify, sourcemap } from './gen-esbuild.browser.mjs'; + +/** + * {@type {import('esbuild').BuildOptions}} + */ +export const electronOptions = { + entryPoints: { + 'preload': './src-gen/frontend/preload' + }, + bundle: true, + outdir: 'lib/frontend', + platform: 'node', + mainFields: ['node', 'module', 'main'], + external: ['electron'], + loader, + minify, + sourcemap, + plugins: [ + problemMatcherPlugin(watch, 'electron') + ] +}; `; } diff --git a/dev-packages/application-manager/src/generator/frontend-generator.ts b/dev-packages/application-manager/src/generator/frontend-generator.ts index bbfd134bdb3b8..45a594e8d23ac 100644 --- a/dev-packages/application-manager/src/generator/frontend-generator.ts +++ b/dev-packages/application-manager/src/generator/frontend-generator.ts @@ -66,6 +66,7 @@ export class FrontendGenerator extends AbstractGenerator { + ${this.pck.props.frontend.config.applicationName}`; } diff --git a/dev-packages/application-manager/src/generator/index.ts b/dev-packages/application-manager/src/generator/index.ts index 9d3cac8ce4b0a..a76dbbc788134 100644 --- a/dev-packages/application-manager/src/generator/index.ts +++ b/dev-packages/application-manager/src/generator/index.ts @@ -14,6 +14,6 @@ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 // ***************************************************************************** -export * from './webpack-generator'; +export * from './bundler-generator'; export * from './frontend-generator'; export * from './backend-generator'; diff --git a/dev-packages/application-manager/tsconfig.json b/dev-packages/application-manager/tsconfig.json index bff525f824f30..79dd071efe110 100644 --- a/dev-packages/application-manager/tsconfig.json +++ b/dev-packages/application-manager/tsconfig.json @@ -15,6 +15,9 @@ { "path": "../ffmpeg" }, + { + "path": "../native-esbuild-plugin" + }, { "path": "../native-webpack-plugin" } diff --git a/dev-packages/native-esbuild-plugin/.eslintrc.js b/dev-packages/native-esbuild-plugin/.eslintrc.js new file mode 100644 index 0000000000000..13089943582b6 --- /dev/null +++ b/dev-packages/native-esbuild-plugin/.eslintrc.js @@ -0,0 +1,10 @@ +/** @type {import('eslint').Linter.Config} */ +module.exports = { + extends: [ + '../../configs/build.eslintrc.json' + ], + parserOptions: { + tsconfigRootDir: __dirname, + project: 'tsconfig.json' + } +}; diff --git a/dev-packages/native-esbuild-plugin/README.md b/dev-packages/native-esbuild-plugin/README.md new file mode 100644 index 0000000000000..4226f155557d1 --- /dev/null +++ b/dev-packages/native-esbuild-plugin/README.md @@ -0,0 +1,29 @@ +
+ +
+ +theia-ext-logo + +

ECLIPSE THEIA - NATIVE-WEBPACK-PLUGIN

+ +
+ +
+ +## Description + +The `@theia/native-webpack-plugin` package contains a webpack plugin that is used to handle native dependencies for bundling Theia based application backends. + +## Additional Information + +- [Theia - GitHub](https://github.com/eclipse-theia/theia) +- [Theia - Website](https://theia-ide.org/) + +## License + +- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/) +- [δΈ€ (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp) + +## Trademark +"Theia" is a trademark of the Eclipse Foundation +https://www.eclipse.org/theia diff --git a/dev-packages/native-esbuild-plugin/package.json b/dev-packages/native-esbuild-plugin/package.json new file mode 100644 index 0000000000000..db1be1550b492 --- /dev/null +++ b/dev-packages/native-esbuild-plugin/package.json @@ -0,0 +1,36 @@ +{ + "name": "@theia/native-esbuild-plugin", + "version": "1.55.0", + "description": "ESBuild Plugin for native dependencies of Theia.", + "publishConfig": { + "access": "public" + }, + "license": "EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0", + "repository": { + "type": "git", + "url": "https://github.com/eclipse-theia/theia.git" + }, + "bugs": { + "url": "https://github.com/eclipse-theia/theia/issues" + }, + "homepage": "https://github.com/eclipse-theia/theia", + "files": [ + "lib", + "src" + ], + "main": "lib/index.js", + "typings": "lib/index.d.ts", + "scripts": { + "build": "theiaext build", + "clean": "theiaext clean", + "compile": "theiaext compile", + "lint": "theiaext lint", + "test": "theiaext test", + "watch": "theiaext watch" + }, + "dependencies": { + "detect-libc": "^2.0.2", + "tslib": "^2.6.2", + "webpack": "^5.76.0" + } +} diff --git a/dev-packages/native-esbuild-plugin/src/index.ts b/dev-packages/native-esbuild-plugin/src/index.ts new file mode 100644 index 0000000000000..586b890edf0f6 --- /dev/null +++ b/dev-packages/native-esbuild-plugin/src/index.ts @@ -0,0 +1,17 @@ +// ***************************************************************************** +// Copyright (C) 2023 TypeFox and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// ***************************************************************************** + +export * from './native-esbuild-plugin'; diff --git a/dev-packages/native-esbuild-plugin/src/native-esbuild-plugin.ts b/dev-packages/native-esbuild-plugin/src/native-esbuild-plugin.ts new file mode 100644 index 0000000000000..43308cfb239c6 --- /dev/null +++ b/dev-packages/native-esbuild-plugin/src/native-esbuild-plugin.ts @@ -0,0 +1,230 @@ +// ***************************************************************************** +// Copyright (C) 2024 TypeFox and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// ***************************************************************************** + +import * as path from 'path'; +import * as fs from 'fs'; +import resolvePackagePath = require('resolve-package-path'); + +import type { Plugin, PluginBuild } from 'esbuild'; + +function join(...parts: string[]): string { + return path.join(...parts).replace(/\\/g, '/'); +} + +function resolveModulePath(module: string): string { + const modulePath = resolvePackagePath(module, process.cwd()); + if (!modulePath) { + throw new Error('Could not resolve path of module: ' + module); + } + return path.resolve(modulePath, '..'); +} + +export function problemMatcherPlugin(watch: boolean, type: string): Plugin { + const buildType = watch ? 'watch' : 'build'; + const prefix = `[${buildType}/${type}]`; + let time = Date.now(); + return { + name: 'esbuild-problem-matcher', + setup(build: PluginBuild): void { + build.onStart(() => { + time = Date.now(); + console.log(prefix + ' Build started'); + }); + build.onEnd(result => { + console.log(prefix + ' Finished with ' + result.errors.length + ' errors in ' + (Date.now() - time) + 'ms.'); + }); + }, + }; +}; + +export interface NativeDependenciesPluginOptions { + trash: boolean; + ripgrep: boolean; + pty: boolean; + nativeBindings: Record; +} + +export function nativeDependenciesPlugin(options: NativeDependenciesPluginOptions): Plugin { + const plugin = new PluginImpl(options); + // create wrapper over plugin + // esbuild validates the plugin object and expects no additional properties + return { + name: plugin.name, + setup: plugin.setup.bind(plugin) + }; +} + +class PluginImpl implements Plugin { + + name = '@theia/native-esbuild-plugin'; + + private bindings: Record = {}; + private options: NativeDependenciesPluginOptions; + + constructor(options: NativeDependenciesPluginOptions) { + this.options = options; + for (const [name, value] of Object.entries(options.nativeBindings)) { + this.nativeBinding(name, value); + } + } + + nativeBinding(dependency: string, nodePath: string): void { + this.bindings[dependency] = nodePath; + } + + setup(build: PluginBuild): void { + const outdir = build.initialOptions.outdir; + if (!outdir) { + throw new Error('The `outdir` option is required.'); + } + build.onResolve({ filter: /^@vscode\/windows-ca-certs$/ }, args => { + const windows = process.platform === 'win32'; + return { + path: windows + ? join(resolveModulePath('@vscode/windows-ca-certs'), 'build', 'Release', 'crypt32.node') + : '', + // Simply mark the dependency as external on non-Windows platforms + external: !windows + }; + }); + build.onResolve({ filter: /\.\/build\/Release\/keymapping$/ }, () => ({ + path: join(resolveModulePath('native-keymap'), 'build', 'Release', 'keymapping.node') + })); + build.onResolve({ filter: /\.\/build\/Release\/watcher\.node$/ }, args => { + let name = `@parcel/watcher-${process.platform}-${process.arch}`; + if (process.platform === 'linux') { + const { MUSL, family } = require('detect-libc'); + if (family === MUSL) { + name += '-musl'; + } else { + name += '-glibc'; + } + } + return { + path: join(resolveModulePath(name), 'watcher.node') + }; + }); + build.onLoad({ filter: /bindings[\\\/]bindings\.js$/ }, async () => ({ + contents: bindingsReplacement(this.bindings), + loader: 'js' + })); + build.onLoad({ filter: /@vscode[\\\/]ripgrep[\\\/]lib[\\\/]index\.js$/ }, async () => ({ + contents: 'exports.rgPath = require("path").join(__dirname, `./native/rg${process.platform === "win32" ? ".exe" : ""}`);', + loader: 'js' + })); + build.onEnd(() => { + if (this.options.trash) { + copyTrashHelper(outdir); + } + if (this.options.ripgrep) { + copyRipgrep(outdir); + } + if (this.options.pty) { + copyNodePtySpawnHelper(outdir); + } + }); + this.setupNodeRequires(build); + } + + private setupNodeRequires(build: PluginBuild): void { + // By default, ESBuild does not handle `.node` files. We need to handle them ourselves. + // When using the `file` loader directly, the files only get exposed via their paths. + // However, we want to load them directly as native modules via `require`. + build.onResolve({ filter: /\.node$/, namespace: 'file' }, args => { + try { + // Move the resolved path to the `node-file` namespace to load it as a native module. + const resolved = require.resolve(args.path, { paths: [args.resolveDir] }); + return { + path: resolved, + namespace: 'node-file', + }; + } catch { + // If the module cannot be resolved, mark it as external. + return { + external: true + }; + } + }); + build.onLoad({ filter: /.*/, namespace: 'node-file' }, args => ({ + // Replace the require statement with a direct require call to the native module. + contents: ` + import path from ${JSON.stringify(args.path)} + try { module.exports = require(path) } + catch { throw new Error('Could not load native module from "${args.path}"') } + `, + })); + build.onResolve({ filter: /\.node$/, namespace: 'node-file' }, args => ({ + // Finally, resolve the `.node` file to the local path. + path: args.path, + namespace: 'file', + })); + } +} + +async function copyRipgrep(outdir: string): Promise { + const fileName = process.platform === 'win32' ? 'rg.exe' : 'rg'; + const sourceFile = join(resolveModulePath('@vscode/ripgrep'), 'bin', fileName); + const targetFile = path.join(outdir, 'native', fileName); + await copyExecutable(sourceFile, targetFile); +} + +async function copyNodePtySpawnHelper(outdir: string): Promise { + const targetDirectory = path.resolve(outdir, '..', 'build', 'Release'); + if (process.platform === 'win32') { + const agentFile = join(resolveModulePath('node-pty'), 'build', 'Release', 'winpty-agent.exe'); + const targetAgentFile = path.join(targetDirectory, 'winpty-agent.exe'); + await copyExecutable(agentFile, targetAgentFile); + const dllFile = join(resolveModulePath('node-pty'), 'build', 'Release', 'winpty.dll'); + const targetDllFile = path.join(targetDirectory, 'winpty.dll'); + await copyExecutable(dllFile, targetDllFile); + } else { + const sourceFile = join(resolveModulePath('node-pty'), 'build', 'Release', 'spawn-helper'); + const targetFile = path.join(targetDirectory, 'spawn-helper'); + await copyExecutable(sourceFile, targetFile); + } +} + +async function copyTrashHelper(outdir: string): Promise { + const fileName = process.platform === 'win32' ? 'windows-trash.exe' : 'macos-trash'; + if (process.platform === 'win32' || process.platform === 'darwin') { + const sourceFile = join(resolveModulePath('trash'), 'lib', fileName); + const targetFile = path.join(outdir, fileName); + await copyExecutable(sourceFile, targetFile); + } +} + +async function copyExecutable(source: string, target: string): Promise { + const targetDirectory = path.dirname(target); + await fs.promises.mkdir(targetDirectory, { recursive: true }); + await fs.promises.copyFile(source, target); + await fs.promises.chmod(target, 0o777); +} + +const bindingsReplacement = (bindings: Record) => { + const cases = []; + + for (const [module, node] of Object.entries(bindings)) { + cases.push(`${' '.repeat(8)}case '${module}': return require('${node}');`); + } + + return ` +module.exports = function (jsModule) { + switch (jsModule) { +${cases.join('/')} + } + throw new Error(\`unhandled module: "\${jsModule}"\`); +}`.trim(); +}; diff --git a/dev-packages/native-esbuild-plugin/src/package.spec.ts b/dev-packages/native-esbuild-plugin/src/package.spec.ts new file mode 100644 index 0000000000000..4e6f3abdcdccd --- /dev/null +++ b/dev-packages/native-esbuild-plugin/src/package.spec.ts @@ -0,0 +1,28 @@ +// ***************************************************************************** +// Copyright (C) 2023 TypeFox and others. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License v. 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0. +// +// This Source Code may also be made available under the following Secondary +// Licenses when the conditions for such availability set forth in the Eclipse +// Public License v. 2.0 are satisfied: GNU General Public License, version 2 +// with the GNU Classpath Exception which is available at +// https://www.gnu.org/software/classpath/license.html. +// +// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 +// ***************************************************************************** + +/* note: this bogus test file is required so that + we are able to run mocha unit tests on this + package, without having any actual unit tests in it. + This way a coverage report will be generated, + showing 0% coverage, instead of no report. + This file can be removed once we have real unit + tests in place. */ + +describe('request package', () => { + + it('should support code coverage statistics', () => true); +}); diff --git a/dev-packages/native-esbuild-plugin/tsconfig.json b/dev-packages/native-esbuild-plugin/tsconfig.json new file mode 100644 index 0000000000000..b973ddbc673a2 --- /dev/null +++ b/dev-packages/native-esbuild-plugin/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../configs/base.tsconfig", + "compilerOptions": { + "composite": true, + "rootDir": "src", + "outDir": "lib" + }, + "include": [ + "src" + ], + "references": [] +} diff --git a/examples/browser-only/esbuild.mjs b/examples/browser-only/esbuild.mjs new file mode 100644 index 0000000000000..559314126d0c8 --- /dev/null +++ b/examples/browser-only/esbuild.mjs @@ -0,0 +1,19 @@ +/** + * This file can be edited to the ESBuild build process. + * To reset, delete this file and rerun theia build again. + */ +import { browserOptions, watch } from './gen-esbuild.browser.mjs'; +import esbuild from 'esbuild'; + +const browserContext = await esbuild.context(browserOptions); + +if (watch) { + await browserContext.watch(); +} else { + try { + await browserContext.rebuild(); + await browserContext.dispose(); + } catch (err) { + process.exit(1); + } +} diff --git a/examples/browser-only/package.json b/examples/browser-only/package.json index 3f268a6aecf40..a24e353c59c06 100644 --- a/examples/browser-only/package.json +++ b/examples/browser-only/package.json @@ -34,7 +34,6 @@ "@theia/file-search": "1.55.0", "@theia/filesystem": "1.55.0", "@theia/getting-started": "1.55.0", - "@theia/git": "1.55.0", "@theia/keymaps": "1.55.0", "@theia/markers": "1.55.0", "@theia/memory-inspector": "1.55.0", diff --git a/examples/browser-only/tsconfig.json b/examples/browser-only/tsconfig.json index 2c35a886f30d0..8370783204625 100644 --- a/examples/browser-only/tsconfig.json +++ b/examples/browser-only/tsconfig.json @@ -62,9 +62,6 @@ { "path": "../../packages/getting-started" }, - { - "path": "../../packages/git" - }, { "path": "../../packages/keymaps" }, diff --git a/examples/browser-only/webpack.config.js b/examples/browser-only/webpack.config.js deleted file mode 100644 index 40e4ee963ba9f..0000000000000 --- a/examples/browser-only/webpack.config.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file can be edited to customize webpack configuration. - * To reset delete this file and rerun theia build again. - */ -// @ts-check -const configs = require('./gen-webpack.config.js'); - - -/** - * Expose bundled modules on window.theia.moduleName namespace, e.g. - * window['theia']['@theia/core/lib/common/uri']. - * Such syntax can be used by external code, for instance, for testing. -configs[0].module.rules.push({ - test: /\.js$/, - loader: require.resolve('@theia/application-manager/lib/expose-loader') -}); */ - -module.exports = configs; diff --git a/examples/browser/esbuild.mjs b/examples/browser/esbuild.mjs new file mode 100644 index 0000000000000..fab65db5a34db --- /dev/null +++ b/examples/browser/esbuild.mjs @@ -0,0 +1,30 @@ +/** + * This file can be edited to the ESBuild build process. + * To reset, delete this file and rerun theia build again. + */ +import { browserOptions, watch } from './gen-esbuild.browser.mjs'; +import { nodeOptions } from './gen-esbuild.node.mjs'; +import esbuild from 'esbuild'; + +const browserContext = await esbuild.context(browserOptions); +const nodeContext = await esbuild.context(nodeOptions); + +if (watch) { + await Promise.all([ + browserContext.watch(), + nodeContext.watch() + ]); +} else { + try { + await Promise.all([ + browserContext.rebuild(), + nodeContext.rebuild() + ]); + await Promise.all([ + browserContext.dispose(), + nodeContext.dispose() + ]); + } catch (err) { + process.exit(1); + } +} diff --git a/examples/browser/webpack.config.js b/examples/browser/webpack.config.js deleted file mode 100644 index 69246fc75b5cd..0000000000000 --- a/examples/browser/webpack.config.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * This file can be edited to customize webpack configuration. - * To reset delete this file and rerun theia build again. - */ -// @ts-check -const configs = require('./gen-webpack.config.js'); -const nodeConfig = require('./gen-webpack.node.config.js'); - -/** - * Expose bundled modules on window.theia.moduleName namespace, e.g. - * window['theia']['@theia/core/lib/common/uri']. - * Such syntax can be used by external code, for instance, for testing. - */ -configs[0].module.rules.push({ - test: /\.js$/, - loader: require.resolve('@theia/application-manager/lib/expose-loader') -}); - -module.exports = [ - ...configs, - nodeConfig.config -]; diff --git a/examples/electron/esbuild.mjs b/examples/electron/esbuild.mjs new file mode 100644 index 0000000000000..a512772aba3ef --- /dev/null +++ b/examples/electron/esbuild.mjs @@ -0,0 +1,35 @@ +/** + * This file can be edited to the ESBuild build process. + * To reset, delete this file and rerun theia build again. + */ +import { browserOptions, watch } from './gen-esbuild.browser.mjs'; +import { nodeOptions } from './gen-esbuild.node.mjs'; +import { electronOptions } from './gen-esbuild.electron.mjs'; +import esbuild from 'esbuild'; + +const browserContext = await esbuild.context(browserOptions); +const nodeContext = await esbuild.context(nodeOptions); +const electronContext = await esbuild.context(electronOptions); + +if (watch) { + await Promise.all([ + browserContext.watch(), + nodeContext.watch(), + electronContext.watch(), + ]); +} else { + try { + await Promise.all([ + browserContext.rebuild(), + nodeContext.rebuild(), + electronContext.rebuild(), + ]); + await Promise.all([ + browserContext.dispose(), + nodeContext.dispose(), + electronContext.dispose(), + ]); + } catch (err) { + process.exit(1); + } +} diff --git a/examples/electron/webpack.config.js b/examples/electron/webpack.config.js deleted file mode 100644 index 8c8bfd55c3b64..0000000000000 --- a/examples/electron/webpack.config.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file can be edited to customize webpack configuration. - * To reset delete this file and rerun theia build again. - */ -// @ts-check -const configs = require('./gen-webpack.config.js'); -const nodeConfig = require('./gen-webpack.node.config.js'); - -/** - * Expose bundled modules on window.theia.moduleName namespace, e.g. - * window['theia']['@theia/core/lib/common/uri']. - * Such syntax can be used by external code, for instance, for testing. -config.module.rules.push({ - test: /\.js$/, - loader: require.resolve('@theia/application-manager/lib/expose-loader') -}); */ - -module.exports = [ - ...configs, - nodeConfig.config -]; diff --git a/packages/core/src/browser/frontend-application-module.ts b/packages/core/src/browser/frontend-application-module.ts index ea29eff0ebf87..ebde45ba17000 100644 --- a/packages/core/src/browser/frontend-application-module.ts +++ b/packages/core/src/browser/frontend-application-module.ts @@ -15,9 +15,11 @@ // ***************************************************************************** import '../../src/browser/style/index.css'; -require('../../src/browser/style/materialcolors.css').use(); +import '../../src/browser/style/materialcolors.css'; +import '@phosphor/widgets/style/index.css'; import 'font-awesome/css/font-awesome.min.css'; import 'file-icons-js/css/style.css'; +import 'perfect-scrollbar/css/perfect-scrollbar.css'; import '@vscode/codicons/dist/codicon.css'; import { ContainerModule } from 'inversify'; diff --git a/packages/core/src/browser/style/index.css b/packages/core/src/browser/style/index.css index 3a69dc7c2c1c6..3bacbf9212e4c 100644 --- a/packages/core/src/browser/style/index.css +++ b/packages/core/src/browser/style/index.css @@ -14,8 +14,33 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 ********************************************************************************/ -@import url("~@phosphor/widgets/style/index.css"); -@import url("~font-awesome/css/font-awesome.min.css"); +/*----------------------------------------------------------------------------- +| Import children style files +|----------------------------------------------------------------------------*/ + +@import "./os.css"; +@import "./dockpanel.css"; +@import "./dialog.css"; +@import "./menus.css"; +@import "./sidepanel.css"; +@import "./tabs.css"; +@import "./scrollbars.css"; +@import "./tree.css"; +@import "./status-bar.css"; +@import "./tree-decorators.css"; +@import "./about.css"; +@import "./search-box.css"; +@import "./ansi.css"; +@import "./view-container.css"; +@import "./notification.css"; +@import "./alert-messages.css"; +@import "./icons.css"; +@import "./widget.css"; +@import "./quick-title-bar.css"; +@import "./progress-bar.css"; +@import "./breadcrumbs.css"; +@import "./tooltip.css"; +@import "./split-widget.css"; /*----------------------------------------------------------------------------- | General @@ -161,6 +186,7 @@ blockquote { right: 0; bottom: 0; background: var(--theia-editor-background); + height: 100%; } .theia-preload { @@ -323,31 +349,3 @@ button.secondary[disabled], .theia-cursor-no-drop:active { cursor: no-drop; } - -/*----------------------------------------------------------------------------- -| Import children style files -|----------------------------------------------------------------------------*/ - -@import "./os.css"; -@import "./dockpanel.css"; -@import "./dialog.css"; -@import "./menus.css"; -@import "./sidepanel.css"; -@import "./tabs.css"; -@import "./scrollbars.css"; -@import "./tree.css"; -@import "./status-bar.css"; -@import "./tree-decorators.css"; -@import "./about.css"; -@import "./search-box.css"; -@import "./ansi.css"; -@import "./view-container.css"; -@import "./notification.css"; -@import "./alert-messages.css"; -@import "./icons.css"; -@import "./widget.css"; -@import "./quick-title-bar.css"; -@import "./progress-bar.css"; -@import "./breadcrumbs.css"; -@import "./tooltip.css"; -@import "./split-widget.css"; diff --git a/packages/core/src/browser/style/scrollbars.css b/packages/core/src/browser/style/scrollbars.css index 17e96058a76d6..f9b6b5b840422 100644 --- a/packages/core/src/browser/style/scrollbars.css +++ b/packages/core/src/browser/style/scrollbars.css @@ -14,8 +14,6 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 ********************************************************************************/ -@import url("~perfect-scrollbar/css/perfect-scrollbar.css"); - ::-webkit-scrollbar { height: var(--theia-scrollbar-width); width: var(--theia-scrollbar-width); diff --git a/packages/debug/package.json b/packages/debug/package.json index 6a9893971ffbb..3c58f6bac0a27 100644 --- a/packages/debug/package.json +++ b/packages/debug/package.json @@ -19,7 +19,7 @@ "@theia/workspace": "1.55.0", "@vscode/debugprotocol": "^1.51.0", "fast-deep-equal": "^3.1.3", - "jsonc-parser": "^2.2.0", + "jsonc-parser": "^3.3.1", "p-debounce": "^2.1.0", "tslib": "^2.6.2" }, diff --git a/packages/dev-container/package.json b/packages/dev-container/package.json index 44574d491d55a..2ee718a95ad9f 100644 --- a/packages/dev-container/package.json +++ b/packages/dev-container/package.json @@ -8,7 +8,7 @@ "@theia/remote": "1.55.0", "@theia/workspace": "1.55.0", "dockerode": "^4.0.2", - "jsonc-parser": "^2.2.0", + "jsonc-parser": "^3.3.1", "uuid": "^8.0.0" }, "publishConfig": { diff --git a/packages/keymaps/package.json b/packages/keymaps/package.json index c4db592886fa1..60766be429e6e 100644 --- a/packages/keymaps/package.json +++ b/packages/keymaps/package.json @@ -8,7 +8,7 @@ "@theia/monaco-editor-core": "1.83.101", "@theia/preferences": "1.55.0", "@theia/userstorage": "1.55.0", - "jsonc-parser": "^2.2.0", + "jsonc-parser": "^3.3.1", "tslib": "^2.6.2" }, "devDependencies": { diff --git a/packages/monaco/package.json b/packages/monaco/package.json index e70cdd87cf0be..390ed0131d1aa 100644 --- a/packages/monaco/package.json +++ b/packages/monaco/package.json @@ -12,7 +12,7 @@ "@theia/workspace": "1.55.0", "fast-plist": "^0.1.2", "idb": "^4.0.5", - "jsonc-parser": "^2.2.0", + "jsonc-parser": "^3.3.1", "tslib": "^2.6.2", "vscode-oniguruma": "1.6.1", "vscode-textmate": "^9.0.0" diff --git a/packages/plugin-ext/package.json b/packages/plugin-ext/package.json index 78b9fe4ff45fa..e3362e50c168b 100644 --- a/packages/plugin-ext/package.json +++ b/packages/plugin-ext/package.json @@ -40,7 +40,7 @@ "escape-html": "^1.0.3", "filenamify": "^4.1.0", "is-electron": "^2.2.0", - "jsonc-parser": "^2.2.0", + "jsonc-parser": "^3.3.1", "lodash.clonedeep": "^4.5.0", "macaddress": "^0.5.3", "mime": "^2.4.4", diff --git a/packages/plugin-ext/src/hosted/browser/plugin-worker.ts b/packages/plugin-ext/src/hosted/browser/plugin-worker.ts index e500140a553f5..9ad56e366e04a 100644 --- a/packages/plugin-ext/src/hosted/browser/plugin-worker.ts +++ b/packages/plugin-ext/src/hosted/browser/plugin-worker.ts @@ -27,9 +27,8 @@ export class PluginWorker { constructor() { this.worker = new Worker(new URL('./worker/worker-main', - // @ts-expect-error (TS1343) // We compile to CommonJS but `import.meta` is still available in the browser - import.meta.url)); + '')); const channel = new BasicChannel(() => { const writer = new Uint8ArrayWriteBuffer(); diff --git a/packages/plugin-ext/src/main/browser/style/index.css b/packages/plugin-ext/src/main/browser/style/index.css index a8ba00ae4400d..c677693d23f95 100644 --- a/packages/plugin-ext/src/main/browser/style/index.css +++ b/packages/plugin-ext/src/main/browser/style/index.css @@ -14,6 +14,10 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 ********************************************************************************/ +@import "./plugin-sidebar.css"; +@import "./webview.css"; +@import "./tree.css"; + .spinnerContainer { width: 100%; height: 100%; @@ -78,7 +82,3 @@ background-size: var(--theia-private-sidebar-icon-size) !important; font-size: var(--theia-private-sidebar-icon-size) !important; } - -@import "./plugin-sidebar.css"; -@import "./webview.css"; -@import "./tree.css"; diff --git a/packages/plugin-ext/src/main/browser/webview/pre/fake.html b/packages/plugin-ext/src/main/browser/webview/pre/fake.html index 18c40421e34bc..3b2f95d78dc1e 100644 --- a/packages/plugin-ext/src/main/browser/webview/pre/fake.html +++ b/packages/plugin-ext/src/main/browser/webview/pre/fake.html @@ -1,6 +1,8 @@ +Test + diff --git a/packages/preferences/package.json b/packages/preferences/package.json index b98b411078f33..f2dedbd3bb9ab 100644 --- a/packages/preferences/package.json +++ b/packages/preferences/package.json @@ -12,7 +12,7 @@ "@theia/workspace": "1.55.0", "async-mutex": "^0.3.1", "fast-deep-equal": "^3.1.3", - "jsonc-parser": "^2.2.0", + "jsonc-parser": "^3.3.1", "p-debounce": "^2.1.0", "tslib": "^2.6.2" }, diff --git a/packages/preferences/src/browser/style/index.css b/packages/preferences/src/browser/style/index.css index dd598700451c9..db99fa3e63367 100644 --- a/packages/preferences/src/browser/style/index.css +++ b/packages/preferences/src/browser/style/index.css @@ -14,6 +14,12 @@ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 ********************************************************************************/ +@import url("./preference-context-menu.css"); +@import url("./preference-array.css"); +@import url("./preference-file.css"); +@import url("./preference-object.css"); +@import url("./search-input.css"); + #preferences_container_widget .p-SplitPanel-handle { border-right: var(--theia-border-width) solid var(--theia-editorGroup-border); } @@ -26,12 +32,6 @@ /* UI View */ -@import url("./preference-context-menu.css"); -@import url("./preference-array.css"); -@import url("./preference-file.css"); -@import url("./preference-object.css"); -@import url("./search-input.css"); - .theia-settings-container { max-width: 1000px; padding-top: 11px; diff --git a/packages/task/package.json b/packages/task/package.json index c53b640b78f64..a7971ff943b33 100644 --- a/packages/task/package.json +++ b/packages/task/package.json @@ -15,7 +15,7 @@ "@theia/variable-resolver": "1.55.0", "@theia/workspace": "1.55.0", "async-mutex": "^0.3.1", - "jsonc-parser": "^2.2.0", + "jsonc-parser": "^3.3.1", "p-debounce": "^2.1.0", "tslib": "^2.6.2" }, diff --git a/packages/test/src/browser/view/test-tree-widget.tsx b/packages/test/src/browser/view/test-tree-widget.tsx index 3c5e0c7852bb7..2cca19467d4e2 100644 --- a/packages/test/src/browser/view/test-tree-widget.tsx +++ b/packages/test/src/browser/view/test-tree-widget.tsx @@ -274,7 +274,6 @@ export class TestTreeWidget extends TreeWidget { case TestExecutionState.Failed: return `${codicon('error')} failed`; case TestExecutionState.Errored: return `${codicon('issues')} errored`; case TestExecutionState.Passed: return `${codicon('pass')} passed`; - case TestExecutionState.Running: return `${codicon('sync-spin')} running`; default: return codicon('circle'); } } diff --git a/packages/toolbar/package.json b/packages/toolbar/package.json index 98085f8c5b77c..5001e2365914c 100644 --- a/packages/toolbar/package.json +++ b/packages/toolbar/package.json @@ -37,7 +37,7 @@ "@theia/userstorage": "1.55.0", "@theia/workspace": "1.55.0", "ajv": "^6.5.3", - "jsonc-parser": "^2.2.0", + "jsonc-parser": "^3.3.1", "perfect-scrollbar": "^1.3.0", "tslib": "^2.6.2" }, diff --git a/packages/workspace/package.json b/packages/workspace/package.json index 0acc10966a7d6..3de473bba9ae0 100644 --- a/packages/workspace/package.json +++ b/packages/workspace/package.json @@ -6,7 +6,7 @@ "@theia/core": "1.55.0", "@theia/filesystem": "1.55.0", "@theia/variable-resolver": "1.55.0", - "jsonc-parser": "^2.2.0", + "jsonc-parser": "^3.3.1", "tslib": "^2.6.2", "valid-filename": "^2.0.1" }, diff --git a/tsconfig.json b/tsconfig.json index 9b9553dfdd5a1..7eb80e7a90052 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,6 +21,9 @@ { "path": "dev-packages/localization-manager" }, + { + "path": "dev-packages/native-esbuild-plugin" + }, { "path": "dev-packages/native-webpack-plugin" }, diff --git a/yarn.lock b/yarn.lock index 103ac1c1f0914..fd3931dd7aede 100644 --- a/yarn.lock +++ b/yarn.lock @@ -991,6 +991,126 @@ optionalDependencies: global-agent "^3.0.0" +"@esbuild/aix-ppc64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz#b57697945b50e99007b4c2521507dc613d4a648c" + integrity sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw== + +"@esbuild/android-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz#1add7e0af67acefd556e407f8497e81fddad79c0" + integrity sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w== + +"@esbuild/android-arm@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.24.0.tgz#ab7263045fa8e090833a8e3c393b60d59a789810" + integrity sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew== + +"@esbuild/android-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.24.0.tgz#e8f8b196cfdfdd5aeaebbdb0110983460440e705" + integrity sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ== + +"@esbuild/darwin-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz#2d0d9414f2acbffd2d86e98253914fca603a53dd" + integrity sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw== + +"@esbuild/darwin-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz#33087aab31a1eb64c89daf3d2cf8ce1775656107" + integrity sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA== + +"@esbuild/freebsd-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz#bb76e5ea9e97fa3c753472f19421075d3a33e8a7" + integrity sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA== + +"@esbuild/freebsd-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz#e0e2ce9249fdf6ee29e5dc3d420c7007fa579b93" + integrity sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ== + +"@esbuild/linux-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz#d1b2aa58085f73ecf45533c07c82d81235388e75" + integrity sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g== + +"@esbuild/linux-arm@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz#8e4915df8ea3e12b690a057e77a47b1d5935ef6d" + integrity sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw== + +"@esbuild/linux-ia32@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz#8200b1110666c39ab316572324b7af63d82013fb" + integrity sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA== + +"@esbuild/linux-loong64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz#6ff0c99cf647504df321d0640f0d32e557da745c" + integrity sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g== + +"@esbuild/linux-mips64el@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz#3f720ccd4d59bfeb4c2ce276a46b77ad380fa1f3" + integrity sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA== + +"@esbuild/linux-ppc64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz#9d6b188b15c25afd2e213474bf5f31e42e3aa09e" + integrity sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ== + +"@esbuild/linux-riscv64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz#f989fdc9752dfda286c9cd87c46248e4dfecbc25" + integrity sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw== + +"@esbuild/linux-s390x@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz#29ebf87e4132ea659c1489fce63cd8509d1c7319" + integrity sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g== + +"@esbuild/linux-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz#4af48c5c0479569b1f359ffbce22d15f261c0cef" + integrity sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA== + +"@esbuild/netbsd-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz#1ae73d23cc044a0ebd4f198334416fb26c31366c" + integrity sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg== + +"@esbuild/openbsd-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz#5d904a4f5158c89859fd902c427f96d6a9e632e2" + integrity sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg== + +"@esbuild/openbsd-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz#4c8aa88c49187c601bae2971e71c6dc5e0ad1cdf" + integrity sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q== + +"@esbuild/sunos-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz#8ddc35a0ea38575fa44eda30a5ee01ae2fa54dd4" + integrity sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA== + +"@esbuild/win32-arm64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz#6e79c8543f282c4539db684a207ae0e174a9007b" + integrity sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA== + +"@esbuild/win32-ia32@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz#057af345da256b7192d18b676a02e95d0fa39103" + integrity sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw== + +"@esbuild/win32-x64@0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz#168ab1c7e1c318b922637fad8f339d48b01e1244" + integrity sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA== + "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" @@ -1117,6 +1237,11 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jspm/core@^2.0.1": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@jspm/core/-/core-2.1.0.tgz#ee21ff64591d68de98b79ca8e4bd6c5249fded53" + integrity sha512-3sRl+pkyFY/kLmHl0cgHiFp2xEqErA8N3ECjMs7serSUBmoJ70lBa0PG5t0IM6WJgdZNyyI0R8YFfi5wM8+mzg== + "@lerna/child-process@7.4.2": version "7.4.2" resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-7.4.2.tgz#a2fd013ac2150dc288270d3e0d0b850c06bec511" @@ -2903,6 +3028,11 @@ acorn@^7.4.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== +acorn@^8.12.1: + version "8.14.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== + acorn@^8.7.1, acorn@^8.8.2: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" @@ -4065,6 +4195,21 @@ chokidar@3.5.3: optionalDependencies: fsevents "~2.3.2" +chokidar@^3.5.3: + version "3.6.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + chownr@^1.0.1, chownr@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" @@ -4345,6 +4490,11 @@ conf@^10.2.0: pkg-up "^3.1.0" semver "^7.3.5" +confbox@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/confbox/-/confbox-0.1.8.tgz#820d73d3b3c82d9bd910652c5d4d599ef8ff8b06" + integrity sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w== + console-control-strings@^1.0.0, console-control-strings@^1.1.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -5427,6 +5577,55 @@ es6-promise@^4.1.1, es6-promise@^4.2.4: resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== +esbuild-plugin-copy@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/esbuild-plugin-copy/-/esbuild-plugin-copy-2.1.1.tgz#638308ecfd679e4c7c76b71c62f7dd9a4cc7f901" + integrity sha512-Bk66jpevTcV8KMFzZI1P7MZKZ+uDcrZm2G2egZ2jNIvVnivDpodZI+/KnpL3Jnap0PBdIHU7HwFGB8r+vV5CVw== + dependencies: + chalk "^4.1.2" + chokidar "^3.5.3" + fs-extra "^10.0.1" + globby "^11.0.3" + +esbuild-plugins-node-modules-polyfill@^1.6.7: + version "1.6.7" + resolved "https://registry.yarnpkg.com/esbuild-plugins-node-modules-polyfill/-/esbuild-plugins-node-modules-polyfill-1.6.7.tgz#653b3eb5c77396c2fa2bc35a515570a69ee8c819" + integrity sha512-1lzsVFT/6OO1ZATHKZqSP+qYzyFo2d+QF9QzMKsyJR7GMRScYizYb1uEEE4NxTsBSxWviY3xnmN9dEOTaKFbJA== + dependencies: + "@jspm/core" "^2.0.1" + local-pkg "^0.5.0" + resolve.exports "^2.0.2" + +esbuild@^0.24.0: + version "0.24.0" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.24.0.tgz#f2d470596885fcb2e91c21eb3da3b3c89c0b55e7" + integrity sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ== + optionalDependencies: + "@esbuild/aix-ppc64" "0.24.0" + "@esbuild/android-arm" "0.24.0" + "@esbuild/android-arm64" "0.24.0" + "@esbuild/android-x64" "0.24.0" + "@esbuild/darwin-arm64" "0.24.0" + "@esbuild/darwin-x64" "0.24.0" + "@esbuild/freebsd-arm64" "0.24.0" + "@esbuild/freebsd-x64" "0.24.0" + "@esbuild/linux-arm" "0.24.0" + "@esbuild/linux-arm64" "0.24.0" + "@esbuild/linux-ia32" "0.24.0" + "@esbuild/linux-loong64" "0.24.0" + "@esbuild/linux-mips64el" "0.24.0" + "@esbuild/linux-ppc64" "0.24.0" + "@esbuild/linux-riscv64" "0.24.0" + "@esbuild/linux-s390x" "0.24.0" + "@esbuild/linux-x64" "0.24.0" + "@esbuild/netbsd-x64" "0.24.0" + "@esbuild/openbsd-arm64" "0.24.0" + "@esbuild/openbsd-x64" "0.24.0" + "@esbuild/sunos-x64" "0.24.0" + "@esbuild/win32-arm64" "0.24.0" + "@esbuild/win32-ia32" "0.24.0" + "@esbuild/win32-x64" "0.24.0" + escalade@^3.1.1: version "3.1.2" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" @@ -6149,7 +6348,7 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra@^10.0.0: +fs-extra@^10.0.0, fs-extra@^10.0.1: version "10.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== @@ -7677,16 +7876,16 @@ jsonc-parser@3.2.0: resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== -jsonc-parser@^2.2.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.3.1.tgz#59549150b133f2efacca48fe9ce1ec0659af2342" - integrity sha512-H8jvkz1O50L3dMZCsLqiuB2tA7muqbSg1AtGEkN0leAqGjsUzDJir3Zwr02BhqdcITPg3ei3mZ+HjMocAknhhg== - jsonc-parser@^3.0.0, jsonc-parser@^3.2.0: version "3.2.1" resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.1.tgz#031904571ccf929d7670ee8c547545081cb37f1a" integrity sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA== +jsonc-parser@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.3.1.tgz#f2a524b4f7fd11e3d791e559977ad60b98b798b4" + integrity sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ== + jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" @@ -8000,6 +8199,14 @@ loader-utils@^2.0.0: emojis-list "^3.0.0" json5 "^2.1.2" +local-pkg@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.5.0.tgz#093d25a346bae59a99f80e75f6e9d36d7e8c925c" + integrity sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg== + dependencies: + mlly "^1.4.2" + pkg-types "^1.0.3" + locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -8619,6 +8826,16 @@ mkdirp@^1.0.3, mkdirp@^1.0.4: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== +mlly@^1.4.2, mlly@^1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.7.2.tgz#21c0d04543207495b8d867eff0ac29fac9a023c0" + integrity sha512-tN3dvVHYVz4DhSXinXIk7u9syPYaJvio118uomkovAtWBT+RdbP6Lfh/5Lvo519YMmwBafwlh20IPTXIStscpA== + dependencies: + acorn "^8.12.1" + pathe "^1.1.2" + pkg-types "^1.2.0" + ufo "^1.5.4" + mocha@^10.1.0: version "10.3.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.3.0.tgz#0e185c49e6dccf582035c05fa91084a4ff6e3fe9" @@ -9840,6 +10057,11 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== +pathe@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.2.tgz#6c4cb47a945692e48a1ddd6e4094d170516437ec" + integrity sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ== + pathval@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" @@ -9916,6 +10138,15 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +pkg-types@^1.0.3, pkg-types@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.2.1.tgz#6ac4e455a5bb4b9a6185c1c79abd544c901db2e5" + integrity sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw== + dependencies: + confbox "^0.1.8" + mlly "^1.7.2" + pathe "^1.1.2" + pkg-up@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-3.1.0.tgz#100ec235cc150e4fd42519412596a28512a0def5" @@ -10662,6 +10893,11 @@ resolve-package-path@^4.0.3: dependencies: path-root "^0.1.1" +resolve.exports@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.2.tgz#f8c934b8e6a13f539e38b7098e2e36134f01e800" + integrity sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg== + resolve@^1.10.0, resolve@^1.14.2, resolve@^1.22.4, resolve@^1.3.2, resolve@^1.9.0: version "1.22.8" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" @@ -11477,7 +11713,7 @@ string-argv@^0.1.1: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.1.2.tgz#c5b7bc03fb2b11983ba3a72333dd0559e77e4738" integrity sha512-mBqPGEOMNJKXRo7z0keX0wlAhbBAjilUdPW13nN0PecVryZxdHIeM7TqbsSUA7VYuS00HGC6mojP7DlQzfa9ZA== -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -11495,15 +11731,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -11569,7 +11796,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -11590,13 +11817,6 @@ strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -12276,6 +12496,11 @@ uc.micro@^1.0.1, uc.micro@^1.0.5: resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac" integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA== +ufo@^1.5.4: + version "1.5.4" + resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.5.4.tgz#16d6949674ca0c9e0fbbae1fa20a71d7b1ded754" + integrity sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ== + uglify-js@^3.1.4: version "3.17.4" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" @@ -12849,7 +13074,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -12867,15 +13092,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"