diff --git a/.changeset/config.json b/.changeset/config.json index b77f0535..c61232fc 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -8,18 +8,17 @@ "updateInternalDependencies": "patch", "ignore": [ "browser-extension-manifest-fields", + "webpack-browser-extension-common-errors-plugin", "eslint-config-extension-create", - "webpack-run-chrome-extension", - "webpack-run-edge-extension", "webpack-browser-extension-html-plugin", "webpack-browser-extension-icons-plugin", "webpack-browser-extension-json-plugin", "webpack-browser-extension-locales-plugin", + "webpack-browser-extension-manifest-compat-plugin", "webpack-browser-extension-manifest-plugin", - "webpack-browser-extension-polyfill-plugin", - "webpack-browser-extension-polyfill-loader", - "webpack-browser-extension-web-resouces-plugin", - "webpack-common-errors-plugin", + "webpack-browser-extension-resouces-plugin", + "webpack-run-chrome-extension", + "webpack-browser-extension-scripts-plugin", "tsconfig" ] } diff --git a/.eslintignore b/.eslintignore index 28ec74f7..e81ffe93 100644 --- a/.eslintignore +++ b/.eslintignore @@ -25,5 +25,5 @@ browser-extension-test-data __hmr-tests__ __utils__ reloadService.js - - +__examples +**/html-bundler-webpack-plugin/**/* \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5c031ae5..8cb253e2 100644 --- a/.gitignore +++ b/.gitignore @@ -55,9 +55,8 @@ yarn-error.log* .vercel # extension-create (alpha) -__hmr-tests__ +packages/*/demo +packages/*/spec browser-extension-test-data -__utils__ -packages/reload-plugin -packages/web-resources-plugin TODO.yml +_examples diff --git a/.prettierignore b/.prettierignore index 71de18cd..e9cde963 100644 --- a/.prettierignore +++ b/.prettierignore @@ -15,3 +15,4 @@ __hmr-tests__ __utils__ browser-extension-test-data dist +packages/html-plugin/plugins/html-bundler-webpack-plugin \ No newline at end of file diff --git a/packages/browser-extension-manifest-fields/fields/html-fields/sandbox.ts b/packages/browser-extension-manifest-fields/fields/html-fields/sandbox.ts index 77b9236f..80e503af 100644 --- a/packages/browser-extension-manifest-fields/fields/html-fields/sandbox.ts +++ b/packages/browser-extension-manifest-fields/fields/html-fields/sandbox.ts @@ -2,13 +2,16 @@ import path from 'path' import getHtmlResources from '../../helpers/getHtmlFileResources' import {type ManifestData} from '../../types' -type SandboxType = Record; +type SandboxType = Record< + string, + | { + css: string[] + js: string[] + static: string[] + html: string + } + | undefined +> export default function sandbox( manifestPath: string, diff --git a/packages/browser-extension-manifest-fields/fields/scripts-fields/background.ts b/packages/browser-extension-manifest-fields/fields/scripts-fields/background.ts index de16686c..faae9e14 100644 --- a/packages/browser-extension-manifest-fields/fields/scripts-fields/background.ts +++ b/packages/browser-extension-manifest-fields/fields/scripts-fields/background.ts @@ -19,18 +19,5 @@ export default function background( }) } - const serviceWorker = manifest.background.service_worker - - if (serviceWorker) { - const serviceWorker = manifest.background.service_worker - - const serviceWorkerAbsolutePath = path.join( - path.dirname(manifestPath), - serviceWorker - ) - - return serviceWorkerAbsolutePath - } - return undefined } diff --git a/packages/browser-extension-manifest-fields/fields/scripts-fields/content_scripts.ts b/packages/browser-extension-manifest-fields/fields/scripts-fields/content_scripts.ts index de547d29..6f9b5f85 100644 --- a/packages/browser-extension-manifest-fields/fields/scripts-fields/content_scripts.ts +++ b/packages/browser-extension-manifest-fields/fields/scripts-fields/content_scripts.ts @@ -35,6 +35,7 @@ export default function contentScript( const css = contentCss(content) contentScriptsData[`content_scripts-${index}`] = [ + // contentScriptsData.content_scripts = [ ...(js || []).filter((js) => js != null), ...(css || []).filter((css) => css != null) ] diff --git a/packages/browser-extension-manifest-fields/fields/scripts-fields/index.ts b/packages/browser-extension-manifest-fields/fields/scripts-fields/index.ts index 4ac8c217..84447269 100644 --- a/packages/browser-extension-manifest-fields/fields/scripts-fields/index.ts +++ b/packages/browser-extension-manifest-fields/fields/scripts-fields/index.ts @@ -1,5 +1,6 @@ import {type ManifestData} from '../../types' import backgroundScripts from './background' +import serviceWorker from './service_worker' import contentScripts from './content_scripts' import userScripts from './user_scripts' @@ -9,7 +10,8 @@ export default function getScriptFields( ) { return { background: backgroundScripts(manifestPath, manifest), + service_worker: serviceWorker(manifestPath, manifest), ...contentScripts(manifestPath, manifest), - userScripts: userScripts(manifestPath, manifest) + user_scripts: userScripts(manifestPath, manifest) } } diff --git a/packages/browser-extension-manifest-fields/fields/scripts-fields/service_worker.ts b/packages/browser-extension-manifest-fields/fields/scripts-fields/service_worker.ts new file mode 100644 index 00000000..75b1784d --- /dev/null +++ b/packages/browser-extension-manifest-fields/fields/scripts-fields/service_worker.ts @@ -0,0 +1,26 @@ +import path from 'path' +import {type ManifestData} from '../../types' + +export default function serviceWorker( + manifestPath: string, + manifest: ManifestData +) { + if (!manifest || !manifest.background) { + return undefined + } + + const serviceWorker = manifest.background.service_worker + + if (serviceWorker) { + const serviceWorker = manifest.background.service_worker + + const serviceWorkerAbsolutePath = path.join( + path.dirname(manifestPath), + serviceWorker + ) + + return serviceWorkerAbsolutePath + } + + return undefined +} diff --git a/packages/browser-extension-manifest-fields/fields/web-resources-fields/index.ts b/packages/browser-extension-manifest-fields/fields/web-resources-fields/index.ts index 87b811a9..69c9b6e6 100644 --- a/packages/browser-extension-manifest-fields/fields/web-resources-fields/index.ts +++ b/packages/browser-extension-manifest-fields/fields/web-resources-fields/index.ts @@ -53,5 +53,5 @@ export default function getWebAccessibleResources( webAccessibleResources.push(resourcesAbsolutePath) } - return webAccessibleResources.flat().filter(arr => arr.length > 0) + return webAccessibleResources.flat().filter((arr) => arr.length > 0) } diff --git a/packages/browser-extension-manifest-fields/module.ts b/packages/browser-extension-manifest-fields/module.ts index 2f3a9e0d..c844299d 100644 --- a/packages/browser-extension-manifest-fields/module.ts +++ b/packages/browser-extension-manifest-fields/module.ts @@ -22,7 +22,10 @@ function browserExtensionManifestFields( json: jsonFromManifest(manifestPath, manifestContent), locales: localesFromManifest(manifestPath, manifestContent), scripts: scriptsFromManifest(manifestPath, manifestContent), - webResources: webResourcesFromManifest(manifestPath, manifestContent) + web_accessible_resources: webResourcesFromManifest( + manifestPath, + manifestContent + ) } } diff --git a/packages/browser-extension-manifest-fields/types.ts b/packages/browser-extension-manifest-fields/types.ts index 63ab3935..6f77b52c 100644 --- a/packages/browser-extension-manifest-fields/types.ts +++ b/packages/browser-extension-manifest-fields/types.ts @@ -15,4 +15,4 @@ export interface ManifestFields { webResources: any } -export type ManifestData = Record; +export type ManifestData = Record diff --git a/packages/common-errors-plugin/module.ts b/packages/common-errors-plugin/module.ts new file mode 100644 index 00000000..8d7a6911 --- /dev/null +++ b/packages/common-errors-plugin/module.ts @@ -0,0 +1,70 @@ +import webpack from 'webpack' +import { + handleMultipleAssetsError + // handleCantResolveError +} from './src/compilationErrorHandlers' +import { + handleInsecureCSPValue, + handleWrongWebResourceFormatError +} from './src/browserRuntimeErrorHandlers' +import {CommonErrorsPluginInterface} from './types' + +export default class CommonErrorsPlugin { + public readonly manifestPath: string + + constructor(options: CommonErrorsPluginInterface) { + this.manifestPath = options.manifestPath + } + + private handleCompilations(compilation: webpack.Compilation) { + compilation.errors.forEach((error, index) => { + const multipleAssetsError = handleMultipleAssetsError(error) + // const cantResolveError = handleCantResolveError(error) + + if (multipleAssetsError) { + compilation.errors[index] = multipleAssetsError + } + + // if (cantResolveError) { + // compilation.errors[index] = cantResolveError + // } + }) + } + + private handleBrowserRuntimeErrors(compilation: webpack.Compilation) { + const insecureCSPValueError = handleInsecureCSPValue(this.manifestPath) + const wrongWebResourceFormatError = handleWrongWebResourceFormatError( + this.manifestPath + ) + + if (insecureCSPValueError) { + compilation.errors.push(insecureCSPValueError) + } + + if (wrongWebResourceFormatError) { + compilation.errors.push(wrongWebResourceFormatError) + } + } + + apply(compiler: webpack.Compiler) { + compiler.hooks.compilation.tap( + 'HandleCommonErrorsPlugin', + (compilation) => { + compilation.hooks.afterSeal.tapAsync( + 'HandleCommonErrorsPlugin', + (done) => { + // Handle errors related to compilation such + // as multiple assets with the same name, + // or missing dependencies. + this.handleCompilations(compilation) + + // Handle errors related to the browser + // runtime such as insecure CSP values. + this.handleBrowserRuntimeErrors(compilation) + done() + } + ) + } + ) + } +} diff --git a/packages/common-errors-plugin/package.json b/packages/common-errors-plugin/package.json new file mode 100644 index 00000000..6fa437fe --- /dev/null +++ b/packages/common-errors-plugin/package.json @@ -0,0 +1,56 @@ +{ + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/cezaraugusto/webpack-browser-extension-common-errors-plugin.git" + }, + "engines": { + "node": ">=16" + }, + "name": "webpack-browser-extension-common-errors-plugin", + "version": "0.0.0", + "description": "webpack plugin to handle common errors from browser extensions", + "main": "./dist/module.js", + "types": "./dist/module.d.ts", + "files": [ + "dist" + ], + "author": { + "name": "Cezar Augusto", + "email": "boss@cezaraugusto.net", + "url": "https://cezaraugusto.com" + }, + "scripts": { + "watch": "yarn compile --watch", + "compile": "tsup-node ./module.ts --format cjs --dts --target=node16 --minify", + "lint": "eslint \"./**/*.ts*\"", + "test": "echo \"Note: no test specified\" && exit 0" + }, + "keywords": [ + "webpack", + "plugin", + "browser", + "web", + "extension", + "web-ext", + "manifest", + "manifest.json" + ], + "peerDependencies": { + "webpack": "^5.0.0" + }, + "dependencies": { + "browser-extension-manifest-fields": "*", + "content-security-policy-parser": "^0.4.1" + }, + "devDependencies": { + "eslint": "^7.32.0", + "eslint-config-extension-create": "*", + "jasmine": "^4.0.2", + "rimraf": "^3.0.2", + "webpack": "^5.9.0", + "webpack-cli": "^4.2.0", + "tsconfig": "*", + "tsup": "^7.1.0" + } +} diff --git a/packages/common-errors-plugin/src/browserRuntimeErrorHandlers.ts b/packages/common-errors-plugin/src/browserRuntimeErrorHandlers.ts new file mode 100644 index 00000000..09fe1946 --- /dev/null +++ b/packages/common-errors-plugin/src/browserRuntimeErrorHandlers.ts @@ -0,0 +1,67 @@ +import webpack from 'webpack' +import parseCSP from 'content-security-policy-parser' + +export function handleInsecureCSPValue( + manifestPath: string +): webpack.WebpackError | null { + const manifest = require(manifestPath) + const manifestCSP = manifest.content_security_policy + const extensionPagesCSP = manifest.content_security_policy?.extension_pages + + const checkCSP = (cspString: string) => { + const parsedCSP = parseCSP(cspString) + + if ( + parsedCSP['script-src'] && + parsedCSP['script-src'].includes("'unsafe-eval'") + ) { + return `[manifest.json]: Insecure CSP value "'unsafe-eval'" in directive 'script-src'.` + } + } + + if (manifest.manifest_version === 3) { + const mainCSPError = manifestCSP ? checkCSP(manifestCSP) : null + const extensionPagesCSPError = extensionPagesCSP + ? checkCSP(extensionPagesCSP) + : null + + if (mainCSPError) return new webpack.WebpackError(mainCSPError) + if (extensionPagesCSPError) + return new webpack.WebpackError(extensionPagesCSPError) + } + + return null +} + +export function handleWrongWebResourceFormatError( + manifestPath: string +): webpack.WebpackError | null { + const manifest = require(manifestPath) + const webResources = manifest.web_accessible_resources + + if (webResources) { + const mv2Format = webResources.some((resource: string) => { + return typeof resource === 'string' + }) + + const mv3Format = webResources.some((resource: any) => { + return ( + typeof resource === 'object' || resource.resources || resource.matches + ) + }) + + if (manifest.manifest_version === 2 && !mv2Format) { + return new webpack.WebpackError( + `[manifest.json]: web_accessible_resources must be a string array in Manifest V2` + ) + } + + if (manifest.manifest_version === 3 && !mv3Format) { + return new webpack.WebpackError( + `[manifest.json]: web_accessible_resources must be an array of objects in Manifest V3` + ) + } + } + + return null +} diff --git a/packages/common-errors-plugin/src/compilationErrorHandlers.ts b/packages/common-errors-plugin/src/compilationErrorHandlers.ts new file mode 100644 index 00000000..abb8c023 --- /dev/null +++ b/packages/common-errors-plugin/src/compilationErrorHandlers.ts @@ -0,0 +1,32 @@ +import webpack from 'webpack' + +export function handleMultipleAssetsError( + error: webpack.WebpackError +): webpack.WebpackError | null { + const actualMsg = + 'Conflict: Multiple assets emit different content to the same filename ' + if (error.message.includes(actualMsg)) { + const filename = error.message.replace(actualMsg, '') + const extFilename = filename.split('.').pop() + const errorMsg = `[content_scripts] One of your \`${extFilename}\` file imports is also defined as a content_script in manifest.json. Remove the duplicate entry and try again.` + + if (filename.startsWith('content_scripts')) { + return new webpack.WebpackError(errorMsg) + } + } + return null +} + +export function handleCantResolveError( + error: webpack.WebpackError +): webpack.WebpackError | null { + const cantResolveMsg = "Module not found: Error: Can't resolve" + + if (error.message.includes(cantResolveMsg)) { + // Customize the error message or handle it as needed + const customMessage = 'Custom Error Message: ' + error.message + return new webpack.WebpackError(customMessage) + } + + return null +} diff --git a/packages/common-errors-plugin/types.ts b/packages/common-errors-plugin/types.ts new file mode 100644 index 00000000..d3b1374d --- /dev/null +++ b/packages/common-errors-plugin/types.ts @@ -0,0 +1,3 @@ +export interface CommonErrorsPluginInterface { + manifestPath: string +} diff --git a/packages/html-plugin/.editorconfig b/packages/html-plugin/.editorconfig deleted file mode 100644 index c3dcfccd..00000000 --- a/packages/html-plugin/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -indent_style = space -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[{*.json,*.yml}] -indent_style = space -indent_size = 2 diff --git a/packages/html-plugin/.gitignore b/packages/html-plugin/.gitignore deleted file mode 100644 index 7c9b3594..00000000 --- a/packages/html-plugin/.gitignore +++ /dev/null @@ -1,234 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.*# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -demo/**/dist -demo/ diff --git a/packages/html-plugin/LICENSE b/packages/html-plugin/LICENSE deleted file mode 100644 index ad134960..00000000 --- a/packages/html-plugin/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Cezar Augusto (https://cezaraugusto.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/html-plugin/README.md b/packages/html-plugin/README.md deleted file mode 100644 index 500de0d8..00000000 --- a/packages/html-plugin/README.md +++ /dev/null @@ -1,175 +0,0 @@ -[action-image]: https://github.com/cezaraugusto/webpack-browser-extension-html-plugin/workflows/CI/badge.svg -[action-url]: https://github.com/cezaraugusto/webpack-browser-extension-html-plugin/actions?query=workflow%3ACI -[npm-image]: https://img.shields.io/npm/v/webpack-browser-extension-html-plugin.svg -[npm-url]: https://npmjs.org/package/webpack-browser-extension-html-plugin - -> # This plugin is experimental and not ready for production yet. - -# webpack-browser-extension-html-plugin [![workflow][action-image]][action-url] [![npm][npm-image]][npm-url] - -> webpack plugin to handle HTML assets for browser extensions - -Handle HTML assets for browser extensions by utilizing the HTML fields declared in the manifest.json file as the source for webpack. It treats each ` - - - - Hello popup! - - -``` - -After running the plugin, we generate a file `popup_public_path/action.my-popup-page.html` like: - -```html - - - - - - My Popup page - - - - - - - Hello popup! - - -``` - -And the output folder without hot-module-replacement, including icons declared along with the action object: - -``` -- my_extension_output/ - - popup_public_path/ - - action.popup_style.css - - action.hmr-bundle.js - - action.test_16.png - - action.test_32.png - - action.test_48.png - - action.test_64.png -``` - -Output folder with hot-module-replacement: - -``` -- my_extension_output/ - - popup_public_path/ - - action.action.popup_style.css - - action.popup_script_1.js - - action.popup_script_2.js - - action.test_16.png - - action.test_32.png - - action.test_48.png - - action.test_64.png -``` - -### Automatic static/ path detection. - -If you want to prevent webpack from compiling some files (usually static assets), create a "/static" folder in your project root and the plugin will copy its contents to the output path. - -## Options - -```js -new HtmlPlugin({ - // Manifest input file (required) - manifestPath: '' -}) -``` - -## License - -MIT (c) Cezar Augusto. diff --git a/packages/html-plugin/demo/background-page-mv2/DOES_NOT_WORK.md b/packages/html-plugin/demo/background-page-mv2/DOES_NOT_WORK.md deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/html-plugin/demo/background-page-mv2/manifest-plugin.json b/packages/html-plugin/demo/background-page-mv2/manifest-plugin.json deleted file mode 100644 index 1418b856..00000000 --- a/packages/html-plugin/demo/background-page-mv2/manifest-plugin.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "background": { - "page": "./src/background.html" - } -} diff --git a/packages/html-plugin/demo/background-page-mv2/manifest.json b/packages/html-plugin/demo/background-page-mv2/manifest.json deleted file mode 100644 index cdd175b8..00000000 --- a/packages/html-plugin/demo/background-page-mv2/manifest.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "manifest_version": 2, - "name": "Background page MV2", - "version": "1.0.0", - "background": { - "page": "dist/background.background.html" - }, - "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self';", - "web_accessible_resources": ["/dist/*.json", "/dist/*.txt"], - "content_scripts": [ - { - "matches": [""], - "js": ["dist/content.js"] - } - ], - "permissions": ["tabs", ""] -} diff --git a/packages/html-plugin/demo/background-page-mv2/package.json b/packages/html-plugin/demo/background-page-mv2/package.json deleted file mode 100644 index a87e25ad..00000000 --- a/packages/html-plugin/demo/background-page-mv2/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "scripts": { - "dev": "npx webpack serve --mode development", - "build": "npx webpack --mode production" - } -} diff --git a/packages/html-plugin/demo/background-page-mv2/src/background.html b/packages/html-plugin/demo/background-page-mv2/src/background.html deleted file mode 100644 index 80304c9b..00000000 --- a/packages/html-plugin/demo/background-page-mv2/src/background.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - New Tab Override Extension - - - - - - diff --git a/packages/html-plugin/demo/background-page-mv2/src/content.js b/packages/html-plugin/demo/background-page-mv2/src/content.js deleted file mode 100644 index b45176a3..00000000 --- a/packages/html-plugin/demo/background-page-mv2/src/content.js +++ /dev/null @@ -1 +0,0 @@ -document.body.style.backgroundColor = 'red' diff --git a/packages/html-plugin/demo/background-page-mv2/src/dep.js b/packages/html-plugin/demo/background-page-mv2/src/dep.js deleted file mode 100644 index 33c1d29e..00000000 --- a/packages/html-plugin/demo/background-page-mv2/src/dep.js +++ /dev/null @@ -1 +0,0 @@ -console.log("[HtmlPlugin] I'm a dependency") diff --git a/packages/html-plugin/demo/background-page-mv2/src/reloader.js b/packages/html-plugin/demo/background-page-mv2/src/reloader.js deleted file mode 100644 index 33c1d29e..00000000 --- a/packages/html-plugin/demo/background-page-mv2/src/reloader.js +++ /dev/null @@ -1 +0,0 @@ -console.log("[HtmlPlugin] I'm a dependency") diff --git a/packages/html-plugin/demo/background-page-mv2/src/script1.js b/packages/html-plugin/demo/background-page-mv2/src/script1.js deleted file mode 100644 index 34989ab4..00000000 --- a/packages/html-plugin/demo/background-page-mv2/src/script1.js +++ /dev/null @@ -1,3 +0,0 @@ -chrome.browserAction.onClicked.addListener(function (tab) { - chrome.tabs.executeScript(tab.id, {file: 'content.js'}) -}) diff --git a/packages/html-plugin/demo/background-page-mv2/src/script2.js b/packages/html-plugin/demo/background-page-mv2/src/script2.js deleted file mode 100644 index 4006a22c..00000000 --- a/packages/html-plugin/demo/background-page-mv2/src/script2.js +++ /dev/null @@ -1,3 +0,0 @@ -import dep from './dep' - -console.log('[HtmlPlugin] Background script 2 with dep', dep) diff --git a/packages/html-plugin/demo/background-page-mv2/static/reloader.js b/packages/html-plugin/demo/background-page-mv2/static/reloader.js deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/html-plugin/demo/background-page-mv2/webpack.config.js b/packages/html-plugin/demo/background-page-mv2/webpack.config.js deleted file mode 100644 index b7b24bd0..00000000 --- a/packages/html-plugin/demo/background-page-mv2/webpack.config.js +++ /dev/null @@ -1,30 +0,0 @@ -const path = require('path') -const webpack = require('webpack') -const HtmlPlugin = require('../../dist/module').default -const WebExtension = require('webpack-target-webextension') - -/** @type {webpack.Configuration} */ -const config = { - devtool: 'cheap-source-map', - entry: { - content: path.join(__dirname, './src/content.js'), - reloader: path.join(__dirname, './src/reloader.js') - }, - output: { - path: path.join(__dirname, './dist'), - publicPath: '/dist/', - environment: { - dynamicImport: true - } - }, - plugins: [ - new HtmlPlugin({ - manifestPath: path.join(__dirname, './manifest-plugin.json') - }), - new WebExtension({background: {entry: 'reloader'}}) - ], - devServer: { - hot: 'only' - } -} -module.exports = config diff --git a/packages/html-plugin/demo/background-page-mv2/yarn.lock b/packages/html-plugin/demo/background-page-mv2/yarn.lock deleted file mode 100644 index fb57ccd1..00000000 --- a/packages/html-plugin/demo/background-page-mv2/yarn.lock +++ /dev/null @@ -1,4 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - diff --git a/packages/html-plugin/demo/newtab-react-hmr-mv2/manifest-plugin.json b/packages/html-plugin/demo/newtab-react-hmr-mv2/manifest-plugin.json deleted file mode 100644 index bb8491d5..00000000 --- a/packages/html-plugin/demo/newtab-react-hmr-mv2/manifest-plugin.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "chrome_url_overrides": { - "newtab": "./src/newtab.html" - } -} diff --git a/packages/html-plugin/demo/newtab-react-hmr-mv2/manifest.json b/packages/html-plugin/demo/newtab-react-hmr-mv2/manifest.json deleted file mode 100644 index 0a68fc1e..00000000 --- a/packages/html-plugin/demo/newtab-react-hmr-mv2/manifest.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "manifest_version": 2, - "name": "React Newtab MV2", - "version": "1.0.0", - "background": { - "scripts": ["./dist/reloader.js"] - }, - "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self';", - "web_accessible_resources": ["/dist/*.json", "/dist/*.js", "/dist/*.css"], - "permissions": [""], - "chrome_url_overrides": { - "newtab": "./dist/newtab.newtab.html" - } -} diff --git a/packages/html-plugin/demo/newtab-react-hmr-mv2/package.json b/packages/html-plugin/demo/newtab-react-hmr-mv2/package.json deleted file mode 100755 index 50f6834b..00000000 --- a/packages/html-plugin/demo/newtab-react-hmr-mv2/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "scripts": { - "dev": "npx webpack serve --mode development", - "build": "npx webpack --mode production" - }, - "devDependencies": { - "@pmmmwh/react-refresh-webpack-plugin": "^0.5.4", - "css-loader": "^6.6.0", - "html-webpack-plugin": "^5.5.0", - "mini-css-extract-plugin": "^2.5.3", - "react-refresh": "^0.11.0", - "react-refresh-typescript": "^2.0.3", - "ts-loader": "^9.2.6", - "typescript": "^4.5.5", - "webpack": "^5.68.0", - "webpack-cli": "^4.9.2", - "webpack-dev-server": "^4.7.4", - "webpack-target-webextension": "*" - }, - "dependencies": { - "@types/react": "^17.0.38", - "@types/react-dom": "^17.0.11", - "react": "^17.0.2", - "react-dom": "^17.0.2" - } -} diff --git a/packages/html-plugin/demo/newtab-react-hmr-mv2/src/App.tsx b/packages/html-plugin/demo/newtab-react-hmr-mv2/src/App.tsx deleted file mode 100644 index e6662013..00000000 --- a/packages/html-plugin/demo/newtab-react-hmr-mv2/src/App.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import {useState} from 'react' - -export function App() { - const [count, setCount] = useState(100) - - const handlePlusOne = () => { - setCount((prevCount) => prevCount + 1) - } - - const handleMinusOne = () => { - setCount((prevCount) => prevCount - 1) - } - return ( -
-

🧩 How cool are browser extensions?

-

(using React)

-
-
- -
-
- {count}% -
-
- -
-
-
- ) -} diff --git a/packages/html-plugin/demo/newtab-react-hmr-mv2/src/newtab.css b/packages/html-plugin/demo/newtab-react-hmr-mv2/src/newtab.css deleted file mode 100644 index ecadd0e8..00000000 --- a/packages/html-plugin/demo/newtab-react-hmr-mv2/src/newtab.css +++ /dev/null @@ -1,28 +0,0 @@ -#extension-root { - width: 100vw; - height: 100vh; - display: flex; - align-items: center; - justify-content: center; -} - -h1, h2 { - text-align: center; -} - -section { - display: flex; - align-items: center; - justify-content: center; -} - -section > div { - padding: 10px; -} - -button { - background: black; - color: white; - width: 24px; - height: 24px; -} \ No newline at end of file diff --git a/packages/html-plugin/demo/newtab-react-hmr-mv2/src/newtab.html b/packages/html-plugin/demo/newtab-react-hmr-mv2/src/newtab.html deleted file mode 100644 index b8a75cd1..00000000 --- a/packages/html-plugin/demo/newtab-react-hmr-mv2/src/newtab.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - New Tab Override Extension - - - - - diff --git a/packages/html-plugin/demo/newtab-react-hmr-mv2/src/newtab.tsx b/packages/html-plugin/demo/newtab-react-hmr-mv2/src/newtab.tsx deleted file mode 100644 index d966f88d..00000000 --- a/packages/html-plugin/demo/newtab-react-hmr-mv2/src/newtab.tsx +++ /dev/null @@ -1,14 +0,0 @@ -// content script don't have an HTML file -// therefore we cannot load CSS in the initial chunk -// @ts-ignore -import('./newtab.css') -import {render} from 'react-dom' -import {App} from './App' - -setTimeout(initial, 1000) -function initial() { - const root = document.createElement('div') - root.id = 'extension-root' - document.body.appendChild(root) - render(, root) -} diff --git a/packages/html-plugin/demo/newtab-react-hmr-mv2/src/reloader.ts b/packages/html-plugin/demo/newtab-react-hmr-mv2/src/reloader.ts deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/html-plugin/demo/newtab-react-hmr-mv2/static/file.txt b/packages/html-plugin/demo/newtab-react-hmr-mv2/static/file.txt deleted file mode 100644 index a0c20400..00000000 --- a/packages/html-plugin/demo/newtab-react-hmr-mv2/static/file.txt +++ /dev/null @@ -1 +0,0 @@ -nothing here \ No newline at end of file diff --git a/packages/html-plugin/demo/newtab-react-hmr-mv2/tsconfig.json b/packages/html-plugin/demo/newtab-react-hmr-mv2/tsconfig.json deleted file mode 100644 index 13d87ed8..00000000 --- a/packages/html-plugin/demo/newtab-react-hmr-mv2/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "compilerOptions": { - "module": "esnext", - "jsx": "react-jsx", - "target": "es2018" - } -} diff --git a/packages/html-plugin/demo/newtab-react-hmr-mv2/webpack.config.js b/packages/html-plugin/demo/newtab-react-hmr-mv2/webpack.config.js deleted file mode 100755 index 4fa0d093..00000000 --- a/packages/html-plugin/demo/newtab-react-hmr-mv2/webpack.config.js +++ /dev/null @@ -1,66 +0,0 @@ -const path = require('path') -const webpack = require('webpack') -const ReactRefreshTypeScript = require('react-refresh-typescript') -const ReactRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin') -const MiniCssExtractPlugin = require('mini-css-extract-plugin') -const HtmlPlugin = require('../../dist/module').default -const WebExtension = require('webpack-target-webextension') - -/** @returns {webpack.Configuration} */ -const config = (a, env) => ({ - devtool: env.mode === 'production' ? undefined : 'eval-cheap-source-map', - resolve: { - extensions: ['.ts', '.tsx', '.js'] - }, - module: { - rules: [ - { - test: /\.css$/, - use: [MiniCssExtractPlugin.loader, 'css-loader'] - }, - { - test: /\.tsx?$/, - use: { - loader: 'ts-loader', - options: { - transpileOnly: true, - getCustomTransformers: () => ({ - before: [ - env.mode === 'development' && ReactRefreshTypeScript() - ].filter(Boolean) - }) - } - } - } - ] - }, - entry: { - reloader: path.join(__dirname, './src/reloader.ts') - }, - output: { - path: path.join(__dirname, './dist'), - publicPath: '/dist/', - environment: { - dynamicImport: true - } - }, - plugins: [ - new HtmlPlugin({ - manifestPath: path.join(__dirname, './manifest-plugin.json') - }), - new MiniCssExtractPlugin(), - new WebExtension({ - background: {entry: 'reloader'}, - weakRuntimeCheck: true - }), - env.mode === 'development' && new ReactRefreshPlugin() - ], - devServer: { - hot: 'only', - watchFiles: ['src/**/*.html'] - }, - optimization: { - minimize: false - } -}) -module.exports = config diff --git a/packages/html-plugin/demo/newtab-react-hmr-mv2/yarn.lock b/packages/html-plugin/demo/newtab-react-hmr-mv2/yarn.lock deleted file mode 100755 index fb5a1959..00000000 --- a/packages/html-plugin/demo/newtab-react-hmr-mv2/yarn.lock +++ /dev/null @@ -1,2835 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@discoveryjs/json-ext@^0.5.0": - version "0.5.6" - resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.6.tgz" - integrity sha512-ws57AidsDvREKrZKYffXddNkyaF14iHNHm8VQnZH6t99E8gczjNN0GpvcGny0imC80yQ0tHz1xVUKk/KFQSUyA== - -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3": - version "1.2.8" - resolved "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - -"@pmmmwh/react-refresh-webpack-plugin@^0.5.4": - version "0.5.4" - resolved "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.4.tgz" - integrity sha512-zZbZeHQDnoTlt2AF+diQT0wsSXpvWiaIOZwBRdltNFhG1+I3ozyaw7U/nBiUwyJ0D+zwdXp0E3bWOl38Ag2BMw== - dependencies: - ansi-html-community "^0.0.8" - common-path-prefix "^3.0.0" - core-js-pure "^3.8.1" - error-stack-parser "^2.0.6" - find-up "^5.0.0" - html-entities "^2.1.0" - loader-utils "^2.0.0" - schema-utils "^3.0.0" - source-map "^0.7.3" - -"@types/body-parser@*": - version "1.19.2" - resolved "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz" - integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== - dependencies: - "@types/connect" "*" - "@types/node" "*" - -"@types/bonjour@^3.5.9": - version "3.5.10" - resolved "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.10.tgz" - integrity sha512-p7ienRMiS41Nu2/igbJxxLDWrSZ0WxM8UQgCeO9KhoVF7cOVFkrKsiDr1EsJIla8vV3oEEjGcz11jc5yimhzZw== - dependencies: - "@types/node" "*" - -"@types/connect-history-api-fallback@^1.3.5": - version "1.3.5" - resolved "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz" - integrity sha512-h8QJa8xSb1WD4fpKBDcATDNGXghFj6/3GRWG6dhmRcu0RX1Ubasur2Uvx5aeEwlf0MwblEC2bMzzMQntxnw/Cw== - dependencies: - "@types/express-serve-static-core" "*" - "@types/node" "*" - -"@types/connect@*": - version "3.4.35" - resolved "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz" - integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== - dependencies: - "@types/node" "*" - -"@types/eslint-scope@^3.7.0": - version "3.7.3" - resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz" - integrity sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g== - dependencies: - "@types/eslint" "*" - "@types/estree" "*" - -"@types/eslint@*": - version "8.4.1" - resolved "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz" - integrity sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA== - dependencies: - "@types/estree" "*" - "@types/json-schema" "*" - -"@types/estree@*", "@types/estree@^0.0.50": - version "0.0.50" - resolved "https://registry.npmjs.org/@types/estree/-/estree-0.0.50.tgz" - integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== - -"@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18": - version "4.17.28" - resolved "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz" - integrity sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig== - dependencies: - "@types/node" "*" - "@types/qs" "*" - "@types/range-parser" "*" - -"@types/express@*", "@types/express@^4.17.13": - version "4.17.13" - resolved "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz" - integrity sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA== - dependencies: - "@types/body-parser" "*" - "@types/express-serve-static-core" "^4.17.18" - "@types/qs" "*" - "@types/serve-static" "*" - -"@types/html-minifier-terser@^6.0.0": - version "6.1.0" - resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#4fc33a00c1d0c16987b1a20cf92d20614c55ac35" - integrity sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg== - -"@types/http-proxy@^1.17.8": - version "1.17.8" - resolved "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.8.tgz" - integrity sha512-5kPLG5BKpWYkw/LVOGWpiq3nEVqxiN32rTgI53Sk12/xHFQ2rG3ehI9IO+O3W2QoKeyB92dJkoka8SUm6BX1pA== - dependencies: - "@types/node" "*" - -"@types/json-schema@*", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": - version "7.0.9" - resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz" - integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== - -"@types/mime@^1": - version "1.3.2" - resolved "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz" - integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== - -"@types/node@*": - version "17.0.14" - resolved "https://registry.npmjs.org/@types/node/-/node-17.0.14.tgz" - integrity sha512-SbjLmERksKOGzWzPNuW7fJM7fk3YXVTFiZWB/Hs99gwhk+/dnrQRPBQjPW9aO+fi1tAffi9PrwFvsmOKmDTyng== - -"@types/prop-types@*": - version "15.7.4" - resolved "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.4.tgz" - integrity sha512-rZ5drC/jWjrArrS8BR6SIr4cWpW09RNTYt9AMZo3Jwwif+iacXAqgVjm0B0Bv/S1jhDXKHqRVNCbACkJ89RAnQ== - -"@types/qs@*": - version "6.9.7" - resolved "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz" - integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== - -"@types/range-parser@*": - version "1.2.4" - resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz" - integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== - -"@types/react-dom@^17.0.11": - version "17.0.11" - resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.11.tgz" - integrity sha512-f96K3k+24RaLGVu/Y2Ng3e1EbZ8/cVJvypZWd7cy0ofCBaf2lcM46xNhycMZ2xGwbBjRql7hOlZ+e2WlJ5MH3Q== - dependencies: - "@types/react" "*" - -"@types/react@*", "@types/react@^17.0.38": - version "17.0.38" - resolved "https://registry.npmjs.org/@types/react/-/react-17.0.38.tgz" - integrity sha512-SI92X1IA+FMnP3qM5m4QReluXzhcmovhZnLNm3pyeQlooi02qI7sLiepEYqT678uNiyc25XfCqxREFpy3W7YhQ== - dependencies: - "@types/prop-types" "*" - "@types/scheduler" "*" - csstype "^3.0.2" - -"@types/retry@^0.12.0": - version "0.12.1" - resolved "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz" - integrity sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g== - -"@types/scheduler@*": - version "0.16.2" - resolved "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz" - integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== - -"@types/serve-index@^1.9.1": - version "1.9.1" - resolved "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz" - integrity sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg== - dependencies: - "@types/express" "*" - -"@types/serve-static@*": - version "1.13.10" - resolved "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz" - integrity sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ== - dependencies: - "@types/mime" "^1" - "@types/node" "*" - -"@types/sockjs@^0.3.33": - version "0.3.33" - resolved "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.33.tgz" - integrity sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw== - dependencies: - "@types/node" "*" - -"@types/ws@^8.2.2": - version "8.2.2" - resolved "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz" - integrity sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg== - dependencies: - "@types/node" "*" - -"@webassemblyjs/ast@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz" - integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== - dependencies: - "@webassemblyjs/helper-numbers" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - -"@webassemblyjs/floating-point-hex-parser@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz" - integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== - -"@webassemblyjs/helper-api-error@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz" - integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== - -"@webassemblyjs/helper-buffer@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz" - integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== - -"@webassemblyjs/helper-numbers@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz" - integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== - dependencies: - "@webassemblyjs/floating-point-hex-parser" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" - "@xtuc/long" "4.2.2" - -"@webassemblyjs/helper-wasm-bytecode@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz" - integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== - -"@webassemblyjs/helper-wasm-section@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz" - integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - -"@webassemblyjs/ieee754@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz" - integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== - dependencies: - "@xtuc/ieee754" "^1.2.0" - -"@webassemblyjs/leb128@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz" - integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== - dependencies: - "@xtuc/long" "4.2.2" - -"@webassemblyjs/utf8@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz" - integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== - -"@webassemblyjs/wasm-edit@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz" - integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/helper-wasm-section" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-opt" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - "@webassemblyjs/wast-printer" "1.11.1" - -"@webassemblyjs/wasm-gen@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz" - integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - -"@webassemblyjs/wasm-opt@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz" - integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - -"@webassemblyjs/wasm-parser@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz" - integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - -"@webassemblyjs/wast-printer@1.11.1": - version "1.11.1" - resolved "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz" - integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@xtuc/long" "4.2.2" - -"@webpack-cli/configtest@^1.1.1": - version "1.1.1" - resolved "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.1.tgz" - integrity sha512-1FBc1f9G4P/AxMqIgfZgeOTuRnwZMten8E7zap5zgpPInnCrP8D4Q81+4CWIch8i/Nf7nXjP0v6CjjbHOrXhKg== - -"@webpack-cli/info@^1.4.1": - version "1.4.1" - resolved "https://registry.npmjs.org/@webpack-cli/info/-/info-1.4.1.tgz" - integrity sha512-PKVGmazEq3oAo46Q63tpMr4HipI3OPfP7LiNOEJg963RMgT0rqheag28NCML0o3GIzA3DmxP1ZIAv9oTX1CUIA== - dependencies: - envinfo "^7.7.3" - -"@webpack-cli/serve@^1.6.1": - version "1.6.1" - resolved "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.1.tgz" - integrity sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw== - -"@xtuc/ieee754@^1.2.0": - version "1.2.0" - resolved "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz" - integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== - -"@xtuc/long@4.2.2": - version "4.2.2" - resolved "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz" - integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== - -accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: - version "1.3.7" - resolved "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - -acorn-import-assertions@^1.7.6: - version "1.8.0" - resolved "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz" - integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== - -acorn@^8.4.1, acorn@^8.5.0: - version "8.7.0" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz" - integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== - -aggregate-error@^3.0.0: - version "3.1.0" - resolved "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz" - integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== - dependencies: - clean-stack "^2.0.0" - indent-string "^4.0.0" - -ajv-formats@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz" - integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== - dependencies: - ajv "^8.0.0" - -ajv-keywords@^3.5.2: - version "3.5.2" - resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz" - integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== - -ajv-keywords@^5.0.0: - version "5.1.0" - resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz" - integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== - dependencies: - fast-deep-equal "^3.1.3" - -ajv@^6.12.5: - version "6.12.6" - resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ajv@^8.0.0, ajv@^8.8.0: - version "8.9.0" - resolved "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz" - integrity sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ== - dependencies: - fast-deep-equal "^3.1.1" - json-schema-traverse "^1.0.0" - require-from-string "^2.0.2" - uri-js "^4.2.2" - -ansi-html-community@^0.0.8: - version "0.0.8" - resolved "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz" - integrity sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw== - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-regex@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz" - integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== - -ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= - -array-flatten@^2.1.0: - version "2.1.2" - resolved "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz" - integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ== - -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - -async@^2.6.2: - version "2.6.3" - resolved "https://registry.npmjs.org/async/-/async-2.6.3.tgz" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== - dependencies: - lodash "^4.17.14" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -batch@0.6.1: - version "0.6.1" - resolved "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz" - integrity sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY= - -big.js@^5.2.2: - version "5.2.2" - resolved "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz" - integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== - -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -body-parser@1.19.1: - version "1.19.1" - resolved "https://registry.npmjs.org/body-parser/-/body-parser-1.19.1.tgz" - integrity sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA== - dependencies: - bytes "3.1.1" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "1.8.1" - iconv-lite "0.4.24" - on-finished "~2.3.0" - qs "6.9.6" - raw-body "2.4.2" - type-is "~1.6.18" - -bonjour@^3.5.0: - version "3.5.0" - resolved "https://registry.npmjs.org/bonjour/-/bonjour-3.5.0.tgz" - integrity sha1-jokKGD2O6aI5OzhExpGkK897yfU= - dependencies: - array-flatten "^2.1.0" - deep-equal "^1.0.1" - dns-equal "^1.0.0" - dns-txt "^2.0.2" - multicast-dns "^6.0.1" - multicast-dns-service-types "^1.1.0" - -boolbase@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" - integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^3.0.1, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -browserslist@^4.14.5: - version "4.19.1" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz" - integrity sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A== - dependencies: - caniuse-lite "^1.0.30001286" - electron-to-chromium "^1.4.17" - escalade "^3.1.1" - node-releases "^2.0.1" - picocolors "^1.0.0" - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -buffer-indexof@^1.0.0: - version "1.1.1" - resolved "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz" - integrity sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g== - -bytes@3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz" - integrity sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg= - -bytes@3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.1.tgz" - integrity sha512-dWe4nWO/ruEOY7HkUJ5gFt1DCFV9zPRoJr8pV0/ASQermOZjtq8jMjOprC0Kd10GLN+l7xaUPvxzJFWtxGu8Fg== - -call-bind@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -camel-case@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-4.1.2.tgz#9728072a954f805228225a6deea6b38461e1bd5a" - integrity sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw== - dependencies: - pascal-case "^3.1.2" - tslib "^2.0.3" - -caniuse-lite@^1.0.30001286: - version "1.0.30001305" - resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001305.tgz" - integrity sha512-p7d9YQMji8haf0f+5rbcv9WlQ+N5jMPfRAnUmZRlNxsNeBO3Yr7RYG6M2uTY1h9tCVdlkJg6YNNc4kiAiBLdWA== - -chalk@^4.1.0: - version "4.1.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -chokidar@^3.5.3: - version "3.5.3" - resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - 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" - -chrome-trace-event@^1.0.2: - version "1.0.3" - resolved "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz" - integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== - -clean-css@^5.2.2: - version "5.2.4" - resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-5.2.4.tgz#982b058f8581adb2ae062520808fb2429bd487a4" - integrity sha512-nKseG8wCzEuji/4yrgM/5cthL9oTDc5UOQyFMvW/Q53oP6gLH690o1NbuTh6Y18nujr7BxlsFuS7gXLnLzKJGg== - dependencies: - source-map "~0.6.0" - -clean-stack@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz" - integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== - -clone-deep@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz" - integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== - dependencies: - is-plain-object "^2.0.4" - kind-of "^6.0.2" - shallow-clone "^3.0.0" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -colorette@^2.0.10, colorette@^2.0.14: - version "2.0.16" - resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz" - integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== - -commander@^2.20.0: - version "2.20.3" - resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - -commander@^7.0.0: - version "7.2.0" - resolved "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz" - integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== - -commander@^8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" - integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== - -common-path-prefix@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz" - integrity sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w== - -compressible@~2.0.16: - version "2.0.18" - resolved "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz" - integrity sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg== - dependencies: - mime-db ">= 1.43.0 < 2" - -compression@^1.7.4: - version "1.7.4" - resolved "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz" - integrity sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ== - dependencies: - accepts "~1.3.5" - bytes "3.0.0" - compressible "~2.0.16" - debug "2.6.9" - on-headers "~1.0.2" - safe-buffer "5.1.2" - vary "~1.1.2" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -connect-history-api-fallback@^1.6.0: - version "1.6.0" - resolved "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz" - integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg== - -content-disposition@0.5.4: - version "0.5.4" - resolved "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz" - integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== - dependencies: - safe-buffer "5.2.1" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - -cookie@0.4.1: - version "0.4.1" - resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz" - integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== - -core-js-pure@^3.8.1: - version "3.20.3" - resolved "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.20.3.tgz" - integrity sha512-Q2H6tQ5MtPtcC7f3HxJ48i4Q7T9ybPKgvWyuH7JXIoNa2pm0KuBnycsET/qw1SLLZYfbsbrZQNMeIOClb+6WIA== - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -css-loader@^6.6.0: - version "6.6.0" - resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-6.6.0.tgz#c792ad5510bd1712618b49381bd0310574fafbd3" - integrity sha512-FK7H2lisOixPT406s5gZM1S3l8GrfhEBT3ZiL2UX1Ng1XWs0y2GPllz/OTyvbaHe12VgQrIXIzuEGVlbUhodqg== - dependencies: - icss-utils "^5.1.0" - postcss "^8.4.5" - postcss-modules-extract-imports "^3.0.0" - postcss-modules-local-by-default "^4.0.0" - postcss-modules-scope "^3.0.0" - postcss-modules-values "^4.0.0" - postcss-value-parser "^4.2.0" - semver "^7.3.5" - -css-select@^4.1.3: - version "4.2.1" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.2.1.tgz#9e665d6ae4c7f9d65dbe69d0316e3221fb274cdd" - integrity sha512-/aUslKhzkTNCQUB2qTX84lVmfia9NyjP3WpDGtj/WxhwBzWBYUV3DgUpurHTme8UTPcPlAD1DJ+b0nN/t50zDQ== - dependencies: - boolbase "^1.0.0" - css-what "^5.1.0" - domhandler "^4.3.0" - domutils "^2.8.0" - nth-check "^2.0.1" - -css-what@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.1.0.tgz#3f7b707aadf633baf62c2ceb8579b545bb40f7fe" - integrity sha512-arSMRWIIFY0hV8pIxZMEfmMI47Wj3R/aWpZDDxWYCPEiOMv6tfOrnpDtgxBYPEQD4V0Y/958+1TdC3iWTFcUPw== - -cssesc@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" - integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== - -csstype@^3.0.2: - version "3.0.10" - resolved "https://registry.npmjs.org/csstype/-/csstype-3.0.10.tgz" - integrity sha512-2u44ZG2OcNUO9HDp/Jl8C07x6pU/eTR3ncV91SiK3dhG9TWvRVsCoJw14Ckx5DgWkzGA3waZWO3d7pgqpUI/XA== - -debug@2.6.9: - version "2.6.9" - resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@^3.1.1: - version "3.2.7" - resolved "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz" - integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== - dependencies: - ms "^2.1.1" - -debug@^4.1.0: - version "4.3.3" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== - dependencies: - ms "2.1.2" - -deep-equal@^1.0.1: - version "1.1.1" - resolved "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz" - integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g== - dependencies: - is-arguments "^1.0.4" - is-date-object "^1.0.1" - is-regex "^1.0.4" - object-is "^1.0.1" - object-keys "^1.1.1" - regexp.prototype.flags "^1.2.0" - -default-gateway@^6.0.3: - version "6.0.3" - resolved "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz" - integrity sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg== - dependencies: - execa "^5.0.0" - -define-lazy-prop@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz" - integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== - -define-properties@^1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -del@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/del/-/del-6.0.0.tgz" - integrity sha512-1shh9DQ23L16oXSZKB2JxpL7iMy2E0S9d517ptA1P8iw0alkPtQcrKH7ru31rYtKwF499HkTu+DRzq3TCKDFRQ== - dependencies: - globby "^11.0.1" - graceful-fs "^4.2.4" - is-glob "^4.0.1" - is-path-cwd "^2.2.0" - is-path-inside "^3.0.2" - p-map "^4.0.0" - rimraf "^3.0.2" - slash "^3.0.0" - -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - -detect-node@^2.0.4: - version "2.1.0" - resolved "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz" - integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g== - -dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - -dns-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz" - integrity sha1-s55/HabrCnW6nBcySzR1PEfgZU0= - -dns-packet@^1.3.1: - version "1.3.4" - resolved "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz" - integrity sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA== - dependencies: - ip "^1.1.0" - safe-buffer "^5.0.1" - -dns-txt@^2.0.2: - version "2.0.2" - resolved "https://registry.npmjs.org/dns-txt/-/dns-txt-2.0.2.tgz" - integrity sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY= - dependencies: - buffer-indexof "^1.0.0" - -dom-converter@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" - integrity sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA== - dependencies: - utila "~0.4" - -dom-serializer@^1.0.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.3.2.tgz#6206437d32ceefaec7161803230c7a20bc1b4d91" - integrity sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig== - dependencies: - domelementtype "^2.0.1" - domhandler "^4.2.0" - entities "^2.0.0" - -domelementtype@^2.0.1, domelementtype@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.2.0.tgz#9a0b6c2782ed6a1c7323d42267183df9bd8b1d57" - integrity sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A== - -domhandler@^4.0.0, domhandler@^4.2.0, domhandler@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.3.0.tgz#16c658c626cf966967e306f966b431f77d4a5626" - integrity sha512-fC0aXNQXqKSFTr2wDNZDhsEYjCiYsDWl3D01kwt25hm1YIPyDGHvvi3rw+PLqHAl/m71MaiF7d5zvBr0p5UB2g== - dependencies: - domelementtype "^2.2.0" - -domutils@^2.5.2, domutils@^2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" - integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== - dependencies: - dom-serializer "^1.0.1" - domelementtype "^2.2.0" - domhandler "^4.2.0" - -dot-case@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" - integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== - dependencies: - no-case "^3.0.4" - tslib "^2.0.3" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -electron-to-chromium@^1.4.17: - version "1.4.61" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.61.tgz" - integrity sha512-kpzCOOFlx63C9qKRyIDEsKIUgzoe98ump7T4gU+/OLzj8gYkkWf2SIyBjhTSE0keAjMAp3i7C262YtkQOMYrGw== - -emojis-list@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz" - integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== - -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -enhanced-resolve@^5.0.0, enhanced-resolve@^5.8.3: - version "5.8.3" - resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz" - integrity sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA== - dependencies: - graceful-fs "^4.2.4" - tapable "^2.2.0" - -entities@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" - integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== - -envinfo@^7.7.3: - version "7.8.1" - resolved "https://registry.npmjs.org/envinfo/-/envinfo-7.8.1.tgz" - integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== - -error-stack-parser@^2.0.6: - version "2.0.6" - resolved "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.0.6.tgz" - integrity sha512-d51brTeqC+BHlwF0BhPtcYgF5nlzf9ZZ0ZIUQNZpc9ZB9qw5IJ2diTrBY9jlCJkTLITYPjmiX6OWCwH+fuyNgQ== - dependencies: - stackframe "^1.1.1" - -es-module-lexer@^0.9.0: - version "0.9.3" - resolved "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz" - integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -eslint-scope@5.1.1: - version "5.1.1" - resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" - integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== - dependencies: - esrecurse "^4.3.0" - estraverse "^4.1.1" - -esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^4.1.1: - version "4.3.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz" - integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== - -estraverse@^5.2.0: - version "5.3.0" - resolved "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== - -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - -eventemitter3@^4.0.0: - version "4.0.7" - resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz" - integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== - -events@^3.2.0: - version "3.3.0" - resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz" - integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== - -execa@^5.0.0: - version "5.1.1" - resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - -express@^4.17.1: - version "4.17.2" - resolved "https://registry.npmjs.org/express/-/express-4.17.2.tgz" - integrity sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg== - dependencies: - accepts "~1.3.7" - array-flatten "1.1.1" - body-parser "1.19.1" - content-disposition "0.5.4" - content-type "~1.0.4" - cookie "0.4.1" - cookie-signature "1.0.6" - debug "2.6.9" - depd "~1.1.2" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "~1.1.2" - fresh "0.5.2" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "~2.3.0" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.7" - qs "6.9.6" - range-parser "~1.2.1" - safe-buffer "5.2.1" - send "0.17.2" - serve-static "1.14.2" - setprototypeof "1.2.0" - statuses "~1.5.0" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - -fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: - version "3.1.3" - resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" - integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== - -fast-glob@^3.2.9: - version "3.2.11" - resolved "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz" - integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fastest-levenshtein@^1.0.12: - version "1.0.12" - resolved "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz" - integrity sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow== - -fastq@^1.6.0: - version "1.13.0" - resolved "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz" - integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== - dependencies: - reusify "^1.0.4" - -faye-websocket@^0.11.3: - version "0.11.4" - resolved "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz" - integrity sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g== - dependencies: - websocket-driver ">=0.5.1" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -finalhandler@~1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz" - integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.3" - statuses "~1.5.0" - unpipe "~1.0.0" - -find-up@^4.0.0: - version "4.1.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -follow-redirects@^1.0.0: - version "1.14.7" - resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz" - integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ== - -forwarded@0.2.0: - version "0.2.0" - resolved "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz" - integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -fs-monkey@1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.3.tgz" - integrity sha512-cybjIfiiE+pTWicSCLFHSrXZ6EilF30oh91FDP9S2B051prEa7QWfrVTQm10/dDpswBDXZugPa1Ogu8Yh+HV0Q== - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -get-intrinsic@^1.0.2: - version "1.1.1" - resolved "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -get-stream@^6.0.0: - version "6.0.1" - resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== - -glob-parent@^5.1.2, glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob-to-regexp@^0.4.1: - version "0.4.1" - resolved "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz" - integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== - -glob@^7.1.3: - version "7.2.0" - resolved "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globby@^11.0.1: - version "11.1.0" - resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" - integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.2.9" - ignore "^5.2.0" - merge2 "^1.4.1" - slash "^3.0.0" - -graceful-fs@^4.1.2, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: - version "4.2.9" - resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.9.tgz" - integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== - -handle-thing@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz" - integrity sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-symbols@^1.0.1, has-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz" - integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== - -has-tostringtag@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz" - integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== - dependencies: - has-symbols "^1.0.2" - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/has/-/has-1.0.3.tgz" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -he@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -hpack.js@^2.1.6: - version "2.1.6" - resolved "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz" - integrity sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI= - dependencies: - inherits "^2.0.1" - obuf "^1.0.0" - readable-stream "^2.0.1" - wbuf "^1.1.0" - -html-entities@^2.1.0, html-entities@^2.3.2: - version "2.3.2" - resolved "https://registry.npmjs.org/html-entities/-/html-entities-2.3.2.tgz" - integrity sha512-c3Ab/url5ksaT0WyleslpBEthOzWhrjQbg75y7XUsfSzi3Dgzt0l8w5e7DylRn15MTlMMD58dTfzddNS2kcAjQ== - -html-minifier-terser@^6.0.2: - version "6.1.0" - resolved "https://registry.yarnpkg.com/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz#bfc818934cc07918f6b3669f5774ecdfd48f32ab" - integrity sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw== - dependencies: - camel-case "^4.1.2" - clean-css "^5.2.2" - commander "^8.3.0" - he "^1.2.0" - param-case "^3.0.4" - relateurl "^0.2.7" - terser "^5.10.0" - -html-webpack-plugin@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-5.5.0.tgz#c3911936f57681c1f9f4d8b68c158cd9dfe52f50" - integrity sha512-sy88PC2cRTVxvETRgUHFrL4No3UxvcH8G1NepGhqaTT+GXN2kTamqasot0inS5hXeg1cMbFDt27zzo9p35lZVw== - dependencies: - "@types/html-minifier-terser" "^6.0.0" - html-minifier-terser "^6.0.2" - lodash "^4.17.21" - pretty-error "^4.0.0" - tapable "^2.0.0" - -htmlparser2@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-6.1.0.tgz#c4d762b6c3371a05dbe65e94ae43a9f845fb8fb7" - integrity sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A== - dependencies: - domelementtype "^2.0.1" - domhandler "^4.0.0" - domutils "^2.5.2" - entities "^2.0.0" - -http-deceiver@^1.2.7: - version "1.2.7" - resolved "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz" - integrity sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc= - -http-errors@1.8.1: - version "1.8.1" - resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz" - integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.1" - -http-errors@~1.6.2: - version "1.6.3" - resolved "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz" - integrity sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0= - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.0" - statuses ">= 1.4.0 < 2" - -http-parser-js@>=0.5.1: - version "0.5.5" - resolved "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.5.tgz" - integrity sha512-x+JVEkO2PoM8qqpbPbOL3cqHPwerep7OwzK7Ay+sMQjKzaKCqWvjoXm5tqMP9tXWWTnTzAjIhXg+J99XYuPhPA== - -http-proxy-middleware@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.2.tgz" - integrity sha512-XtmDN5w+vdFTBZaYhdJAbMqn0DP/EhkUaAeo963mojwpKMMbw6nivtFKw07D7DDOH745L5k0VL0P8KRYNEVF/g== - dependencies: - "@types/http-proxy" "^1.17.8" - http-proxy "^1.18.1" - is-glob "^4.0.1" - is-plain-obj "^3.0.0" - micromatch "^4.0.2" - -http-proxy@^1.18.1: - version "1.18.1" - resolved "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz" - integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ== - dependencies: - eventemitter3 "^4.0.0" - follow-redirects "^1.0.0" - requires-port "^1.0.0" - -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -icss-utils@^5.0.0, icss-utils@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" - integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA== - -ignore@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz" - integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== - -import-local@^3.0.2: - version "3.1.0" - resolved "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz" - integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== - dependencies: - pkg-dir "^4.2.0" - resolve-cwd "^3.0.0" - -indent-string@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz" - integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -interpret@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz" - integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw== - -ip@^1.1.0: - version "1.1.5" - resolved "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz" - integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= - -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - -ipaddr.js@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.1.tgz" - integrity sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng== - -is-arguments@^1.0.4: - version "1.1.1" - resolved "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz" - integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-core-module@^2.8.1: - version "2.8.1" - resolved "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz" - integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== - dependencies: - has "^1.0.3" - -is-date-object@^1.0.1: - version "1.0.5" - resolved "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz" - integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== - dependencies: - has-tostringtag "^1.0.0" - -is-docker@^2.0.0, is-docker@^2.1.1: - version "2.2.1" - resolved "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz" - integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-path-cwd@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz" - integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ== - -is-path-inside@^3.0.2: - version "3.0.3" - resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz" - integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== - -is-plain-obj@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-3.0.0.tgz" - integrity sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA== - -is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-regex@^1.0.4: - version "1.1.4" - resolved "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz" - integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== - dependencies: - call-bind "^1.0.2" - has-tostringtag "^1.0.0" - -is-stream@^2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" - integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== - -is-wsl@^2.2.0: - version "2.2.0" - resolved "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz" - integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== - dependencies: - is-docker "^2.0.0" - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -jest-worker@^27.4.5: - version "27.4.6" - resolved "https://registry.npmjs.org/jest-worker/-/jest-worker-27.4.6.tgz" - integrity sha512-gHWJF/6Xi5CTG5QCvROr6GcmpIqNYpDJyc8A1h/DyXqH1tD6SnRCM0d3U5msV31D2LB/U+E0M+W4oyvKV44oNw== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^8.0.0" - -"js-tokens@^3.0.0 || ^4.0.0": - version "4.0.0" - resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -json-parse-better-errors@^1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema-traverse@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz" - integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== - -json5@^2.1.2: - version "2.2.0" - resolved "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" - -kind-of@^6.0.2: - version "6.0.3" - resolved "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz" - integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== - -loader-runner@^4.2.0: - version "4.2.0" - resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.2.0.tgz" - integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== - -loader-utils@^2.0.0: - version "2.0.2" - resolved "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz" - integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^2.1.2" - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - -lodash@^4.17.14, lodash@^4.17.20, lodash@^4.17.21: - version "4.17.21" - resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" - integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== - -loose-envify@^1.1.0: - version "1.4.0" - resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - -lower-case@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" - integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== - dependencies: - tslib "^2.0.3" - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -memfs@^3.4.1: - version "3.4.1" - resolved "https://registry.npmjs.org/memfs/-/memfs-3.4.1.tgz" - integrity sha512-1c9VPVvW5P7I85c35zAdEr1TD5+F11IToIHIlrVIcflfnzPkJa0ZoYEoEdYDP8KgPFoSZ/opDrUsAoZWym3mtw== - dependencies: - fs-monkey "1.0.3" - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -merge2@^1.3.0, merge2@^1.4.1: - version "1.4.1" - resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - -micromatch@^4.0.0, micromatch@^4.0.2, micromatch@^4.0.4: - version "4.0.4" - resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== - dependencies: - braces "^3.0.1" - picomatch "^2.2.3" - -mime-db@1.51.0, "mime-db@>= 1.43.0 < 2": - version "1.51.0" - resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== - -mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.24: - version "2.1.34" - resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== - dependencies: - mime-db "1.51.0" - -mime@1.6.0: - version "1.6.0" - resolved "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -mini-css-extract-plugin@^2.5.3: - version "2.5.3" - resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.5.3.tgz#c5c79f9b22ce9b4f164e9492267358dbe35376d9" - integrity sha512-YseMB8cs8U/KCaAGQoqYmfUuhhGW0a9p9XvWXrxVOkE3/IiISTLw4ALNt7JR5B2eYauFM+PQGSbXMDmVbR7Tfw== - dependencies: - schema-utils "^4.0.0" - -minimalistic-assert@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz" - integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@^1.2.5: - version "1.2.5" - resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz" - integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== - -mkdirp@^0.5.5: - version "0.5.5" - resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz" - integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== - dependencies: - minimist "^1.2.5" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@2.1.3, ms@^2.1.1: - version "2.1.3" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -multicast-dns-service-types@^1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz" - integrity sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE= - -multicast-dns@^6.0.1: - version "6.2.3" - resolved "https://registry.npmjs.org/multicast-dns/-/multicast-dns-6.2.3.tgz" - integrity sha512-ji6J5enbMyGRHIAkAOu3WdV8nggqviKCEKtXcOqfphZZtQrmHKycfynJ2V7eVPUA4NhJ6V7Wf4TmGbTwKE9B6g== - dependencies: - dns-packet "^1.3.1" - thunky "^1.0.2" - -nanoid@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c" - integrity sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA== - -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - -neo-async@^2.6.2: - version "2.6.2" - resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz" - integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== - -no-case@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" - integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== - dependencies: - lower-case "^2.0.2" - tslib "^2.0.3" - -node-forge@^1.2.0: - version "1.2.1" - resolved "https://registry.npmjs.org/node-forge/-/node-forge-1.2.1.tgz" - integrity sha512-Fcvtbb+zBcZXbTTVwqGA5W+MKBj56UjVRevvchv5XrcyXbmNdesfZL37nlcWOfpgHhgmxApw3tQbTr4CqNmX4w== - -node-releases@^2.0.1: - version "2.0.1" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz" - integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -npm-run-path@^4.0.1: - version "4.0.1" - resolved "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - -nth-check@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.0.1.tgz#2efe162f5c3da06a28959fbd3db75dbeea9f0fc2" - integrity sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w== - dependencies: - boolbase "^1.0.0" - -object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-is@^1.0.1: - version "1.1.5" - resolved "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz" - integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -object-keys@^1.0.12, object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -obuf@^1.0.0, obuf@^1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz" - integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== - -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - -on-headers@~1.0.2: - version "1.0.2" - resolved "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz" - integrity sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA== - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onetime@^5.1.2: - version "5.1.2" - resolved "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -open@^8.0.9: - version "8.4.0" - resolved "https://registry.npmjs.org/open/-/open-8.4.0.tgz" - integrity sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q== - dependencies: - define-lazy-prop "^2.0.0" - is-docker "^2.1.1" - is-wsl "^2.2.0" - -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -p-map@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz" - integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== - dependencies: - aggregate-error "^3.0.0" - -p-retry@^4.5.0: - version "4.6.1" - resolved "https://registry.npmjs.org/p-retry/-/p-retry-4.6.1.tgz" - integrity sha512-e2xXGNhZOZ0lfgR9kL34iGlU8N/KO0xZnQxVEwdeOvpqNDQfdnxIYizvWtK8RglUa3bGqI8g0R/BdfzLMxRkiA== - dependencies: - "@types/retry" "^0.12.0" - retry "^0.13.1" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -param-case@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/param-case/-/param-case-3.0.4.tgz#7d17fe4aa12bde34d4a77d91acfb6219caad01c5" - integrity sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A== - dependencies: - dot-case "^3.0.4" - tslib "^2.0.3" - -parseurl@~1.3.2, parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -pascal-case@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb" - integrity sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g== - dependencies: - no-case "^3.0.4" - tslib "^2.0.3" - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.7: - version "1.0.7" - resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -picocolors@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" - integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== - -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: - version "2.3.1" - resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -portfinder@^1.0.28: - version "1.0.28" - resolved "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz" - integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA== - dependencies: - async "^2.6.2" - debug "^3.1.1" - mkdirp "^0.5.5" - -postcss-modules-extract-imports@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz#cda1f047c0ae80c97dbe28c3e76a43b88025741d" - integrity sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw== - -postcss-modules-local-by-default@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz#ebbb54fae1598eecfdf691a02b3ff3b390a5a51c" - integrity sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ== - dependencies: - icss-utils "^5.0.0" - postcss-selector-parser "^6.0.2" - postcss-value-parser "^4.1.0" - -postcss-modules-scope@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz#9ef3151456d3bbfa120ca44898dfca6f2fa01f06" - integrity sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg== - dependencies: - postcss-selector-parser "^6.0.4" - -postcss-modules-values@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz#d7c5e7e68c3bb3c9b27cbf48ca0bb3ffb4602c9c" - integrity sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ== - dependencies: - icss-utils "^5.0.0" - -postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4: - version "6.0.9" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.9.tgz#ee71c3b9ff63d9cd130838876c13a2ec1a992b2f" - integrity sha512-UO3SgnZOVTwu4kyLR22UQ1xZh086RyNZppb7lLAKBFK8a32ttG5i87Y/P3+2bRSjZNyJ1B7hfFNo273tKe9YxQ== - dependencies: - cssesc "^3.0.0" - util-deprecate "^1.0.2" - -postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" - integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== - -postcss@^8.4.5: - version "8.4.6" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.6.tgz#c5ff3c3c457a23864f32cb45ac9b741498a09ae1" - integrity sha512-OovjwIzs9Te46vlEx7+uXB0PLijpwjXGKXjVGGPIGubGpq7uh5Xgf6D6FiJ/SzJMBosHDp6a2hiXOS97iBXcaA== - dependencies: - nanoid "^3.2.0" - picocolors "^1.0.0" - source-map-js "^1.0.2" - -pretty-error@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-4.0.0.tgz#90a703f46dd7234adb46d0f84823e9d1cb8f10d6" - integrity sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw== - dependencies: - lodash "^4.17.20" - renderkid "^3.0.0" - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -proxy-addr@~2.0.7: - version "2.0.7" - resolved "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz" - integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== - dependencies: - forwarded "0.2.0" - ipaddr.js "1.9.1" - -punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -qs@6.9.6: - version "6.9.6" - resolved "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz" - integrity sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ== - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - -range-parser@^1.2.1, range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@2.4.2: - version "2.4.2" - resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.4.2.tgz" - integrity sha512-RPMAFUJP19WIet/99ngh6Iv8fzAbqum4Li7AD6DtGaW2RpMB/11xDoalPiJMTbu6I3hkbMVkATvZrqb9EEqeeQ== - dependencies: - bytes "3.1.1" - http-errors "1.8.1" - iconv-lite "0.4.24" - unpipe "1.0.0" - -react-dom@^17.0.2: - version "17.0.2" - resolved "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz" - integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - scheduler "^0.20.2" - -react-refresh-typescript@^2.0.3: - version "2.0.3" - resolved "https://registry.npmjs.org/react-refresh-typescript/-/react-refresh-typescript-2.0.3.tgz" - integrity sha512-CnR+UkpCFUIxW3u+KPxc6UhSO3M3aQxd9XCvgdry4a22LFwwITnjbANFUKtPGxA/Skw3PbZJrLiZ08UQnpXprQ== - -react-refresh@^0.11.0: - version "0.11.0" - resolved "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz" - integrity sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A== - -react@^17.0.2: - version "17.0.2" - resolved "https://registry.npmjs.org/react/-/react-17.0.2.tgz" - integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - -readable-stream@^2.0.1: - version "2.3.7" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readable-stream@^3.0.6: - version "3.6.0" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -rechoir@^0.7.0: - version "0.7.1" - resolved "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz" - integrity sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg== - dependencies: - resolve "^1.9.0" - -regexp.prototype.flags@^1.2.0: - version "1.4.1" - resolved "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.4.1.tgz" - integrity sha512-pMR7hBVUUGI7PMA37m2ofIdQCsomVnas+Jn5UPGAHQ+/LlwKm/aTLJHdasmHRzlfeZwHiAOaRSo2rbBDm3nNUQ== - dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" - -relateurl@^0.2.7: - version "0.2.7" - resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" - integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= - -renderkid@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-3.0.0.tgz#5fd823e4d6951d37358ecc9a58b1f06836b6268a" - integrity sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg== - dependencies: - css-select "^4.1.3" - dom-converter "^0.2.0" - htmlparser2 "^6.1.0" - lodash "^4.17.21" - strip-ansi "^6.0.1" - -require-from-string@^2.0.2: - version "2.0.2" - resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz" - integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz" - integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= - -resolve-cwd@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz" - integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== - dependencies: - resolve-from "^5.0.0" - -resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -resolve@^1.9.0: - version "1.22.0" - resolved "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz" - integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== - dependencies: - is-core-module "^2.8.1" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -retry@^0.13.1: - version "0.13.1" - resolved "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz" - integrity sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg== - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -rimraf@^3.0.2: - version "3.0.2" - resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -scheduler@^0.20.2: - version "0.20.2" - resolved "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz" - integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== - dependencies: - loose-envify "^1.1.0" - object-assign "^4.1.1" - -schema-utils@^3.0.0, schema-utils@^3.1.0, schema-utils@^3.1.1: - version "3.1.1" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz" - integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== - dependencies: - "@types/json-schema" "^7.0.8" - ajv "^6.12.5" - ajv-keywords "^3.5.2" - -schema-utils@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/schema-utils/-/schema-utils-4.0.0.tgz" - integrity sha512-1edyXKgh6XnJsJSQ8mKWXnN/BVaIbFMLpouRUrXgVq7WYne5kw3MW7UPhO44uRXQSIpTSXoJbmrR2X0w9kUTyg== - dependencies: - "@types/json-schema" "^7.0.9" - ajv "^8.8.0" - ajv-formats "^2.1.1" - ajv-keywords "^5.0.0" - -select-hose@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz" - integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo= - -selfsigned@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/selfsigned/-/selfsigned-2.0.0.tgz" - integrity sha512-cUdFiCbKoa1mZ6osuJs2uDHrs0k0oprsKveFiiaBKCNq3SYyb5gs2HxhQyDNLCmL51ZZThqi4YNDpCK6GOP1iQ== - dependencies: - node-forge "^1.2.0" - -semver@^7.3.4, semver@^7.3.5: - version "7.3.5" - resolved "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== - dependencies: - lru-cache "^6.0.0" - -send@0.17.2: - version "0.17.2" - resolved "https://registry.npmjs.org/send/-/send-0.17.2.tgz" - integrity sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww== - dependencies: - debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "1.8.1" - mime "1.6.0" - ms "2.1.3" - on-finished "~2.3.0" - range-parser "~1.2.1" - statuses "~1.5.0" - -serialize-javascript@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz" - integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== - dependencies: - randombytes "^2.1.0" - -serve-index@^1.9.1: - version "1.9.1" - resolved "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz" - integrity sha1-03aNabHn2C5c4FD/9bRTvqEqkjk= - dependencies: - accepts "~1.3.4" - batch "0.6.1" - debug "2.6.9" - escape-html "~1.0.3" - http-errors "~1.6.2" - mime-types "~2.1.17" - parseurl "~1.3.2" - -serve-static@1.14.2: - version "1.14.2" - resolved "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz" - integrity sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.17.2" - -setprototypeof@1.1.0: - version "1.1.0" - resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz" - integrity sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ== - -setprototypeof@1.2.0: - version "1.2.0" - resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz" - integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== - -shallow-clone@^3.0.0: - version "3.0.1" - resolved "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz" - integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== - dependencies: - kind-of "^6.0.2" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -signal-exit@^3.0.3: - version "3.0.6" - resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz" - integrity sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -sockjs@^0.3.21: - version "0.3.24" - resolved "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz" - integrity sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ== - dependencies: - faye-websocket "^0.11.3" - uuid "^8.3.2" - websocket-driver "^0.7.4" - -source-map-js@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" - integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== - -source-map-support@~0.5.20: - version "0.5.21" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0: - version "0.6.1" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -source-map@^0.7.3, source-map@~0.7.2: - version "0.7.3" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz" - integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== - -spdy-transport@^3.0.0: - version "3.0.0" - resolved "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz" - integrity sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw== - dependencies: - debug "^4.1.0" - detect-node "^2.0.4" - hpack.js "^2.1.6" - obuf "^1.1.2" - readable-stream "^3.0.6" - wbuf "^1.7.3" - -spdy@^4.0.2: - version "4.0.2" - resolved "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz" - integrity sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA== - dependencies: - debug "^4.1.0" - handle-thing "^2.0.0" - http-deceiver "^1.2.7" - select-hose "^2.0.0" - spdy-transport "^3.0.0" - -stackframe@^1.1.1: - version "1.2.0" - resolved "https://registry.npmjs.org/stackframe/-/stackframe-1.2.0.tgz" - integrity sha512-GrdeshiRmS1YLMYgzF16olf2jJ/IzxXY9lhKOskuVziubpTYcYqyOwYeJKzQkwy7uN0fYSsbsC4RQaXf9LCrYA== - -"statuses@>= 1.4.0 < 2", "statuses@>= 1.5.0 < 2", statuses@~1.5.0: - version "1.5.0" - resolved "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.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.0: - version "7.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz" - integrity sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw== - dependencies: - ansi-regex "^6.0.1" - -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-color@^8.0.0: - version "8.1.1" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - -tapable@^2.0.0, tapable@^2.1.1, tapable@^2.2.0: - version "2.2.1" - resolved "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz" - integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== - -terser-webpack-plugin@^5.1.3: - version "5.3.1" - resolved "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.1.tgz" - integrity sha512-GvlZdT6wPQKbDNW/GDQzZFg/j4vKU96yl2q6mcUkzKOgW4gwf1Z8cZToUCrz31XHlPWH8MVb1r2tFtdDtTGJ7g== - dependencies: - jest-worker "^27.4.5" - schema-utils "^3.1.1" - serialize-javascript "^6.0.0" - source-map "^0.6.1" - terser "^5.7.2" - -terser@^5.10.0: - version "5.12.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.12.0.tgz#728c6bff05f7d1dcb687d8eace0644802a9dae8a" - integrity sha512-R3AUhNBGWiFc77HXag+1fXpAxTAFRQTJemlJKjAgD9r8xXTpjNKqIXwHM/o7Rh+O0kUJtS3WQVdBeMKFk5sw9A== - dependencies: - acorn "^8.5.0" - commander "^2.20.0" - source-map "~0.7.2" - source-map-support "~0.5.20" - -terser@^5.7.2: - version "5.10.0" - resolved "https://registry.npmjs.org/terser/-/terser-5.10.0.tgz" - integrity sha512-AMmF99DMfEDiRJfxfY5jj5wNH/bYO09cniSqhfoyxc8sFoYIgkJy86G04UoZU5VjlpnplVu0K6Tx6E9b5+DlHA== - dependencies: - commander "^2.20.0" - source-map "~0.7.2" - source-map-support "~0.5.20" - -thunky@^1.0.2: - version "1.1.0" - resolved "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz" - integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -toidentifier@1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz" - integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== - -ts-loader@^9.2.6: - version "9.2.6" - resolved "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.6.tgz" - integrity sha512-QMTC4UFzHmu9wU2VHZEmWWE9cUajjfcdcws+Gh7FhiO+Dy0RnR1bNz0YCHqhI0yRowCE9arVnNxYHqELOy9Hjw== - dependencies: - chalk "^4.1.0" - enhanced-resolve "^5.0.0" - micromatch "^4.0.0" - semver "^7.3.4" - -tslib@^2.0.3: - version "2.3.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" - integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== - -type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -typescript@^4.5.5: - version "4.5.5" - resolved "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz" - integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - -util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" - integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -utila@~0.4: - version "0.4.0" - resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" - integrity sha1-ihagXURWV6Oupe7MWxKk+lN5dyw= - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -uuid@^8.3.2: - version "8.3.2" - resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" - integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== - -vary@~1.1.2: - version "1.1.2" - resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -watchpack@^2.3.1: - version "2.3.1" - resolved "https://registry.npmjs.org/watchpack/-/watchpack-2.3.1.tgz" - integrity sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA== - dependencies: - glob-to-regexp "^0.4.1" - graceful-fs "^4.1.2" - -wbuf@^1.1.0, wbuf@^1.7.3: - version "1.7.3" - resolved "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz" - integrity sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA== - dependencies: - minimalistic-assert "^1.0.0" - -webpack-cli@^4.9.2: - version "4.9.2" - resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.9.2.tgz" - integrity sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ== - dependencies: - "@discoveryjs/json-ext" "^0.5.0" - "@webpack-cli/configtest" "^1.1.1" - "@webpack-cli/info" "^1.4.1" - "@webpack-cli/serve" "^1.6.1" - colorette "^2.0.14" - commander "^7.0.0" - execa "^5.0.0" - fastest-levenshtein "^1.0.12" - import-local "^3.0.2" - interpret "^2.2.0" - rechoir "^0.7.0" - webpack-merge "^5.7.3" - -webpack-dev-middleware@^5.3.1: - version "5.3.1" - resolved "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-5.3.1.tgz" - integrity sha512-81EujCKkyles2wphtdrnPg/QqegC/AtqNH//mQkBYSMqwFVCQrxM6ktB2O/SPlZy7LqeEfTbV3cZARGQz6umhg== - dependencies: - colorette "^2.0.10" - memfs "^3.4.1" - mime-types "^2.1.31" - range-parser "^1.2.1" - schema-utils "^4.0.0" - -webpack-dev-server@^4.7.4: - version "4.7.4" - resolved "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.7.4.tgz" - integrity sha512-nfdsb02Zi2qzkNmgtZjkrMOcXnYZ6FLKcQwpxT7MvmHKc+oTtDsBju8j+NMyAygZ9GW1jMEUpy3itHtqgEhe1A== - dependencies: - "@types/bonjour" "^3.5.9" - "@types/connect-history-api-fallback" "^1.3.5" - "@types/express" "^4.17.13" - "@types/serve-index" "^1.9.1" - "@types/sockjs" "^0.3.33" - "@types/ws" "^8.2.2" - ansi-html-community "^0.0.8" - bonjour "^3.5.0" - chokidar "^3.5.3" - colorette "^2.0.10" - compression "^1.7.4" - connect-history-api-fallback "^1.6.0" - default-gateway "^6.0.3" - del "^6.0.0" - express "^4.17.1" - graceful-fs "^4.2.6" - html-entities "^2.3.2" - http-proxy-middleware "^2.0.0" - ipaddr.js "^2.0.1" - open "^8.0.9" - p-retry "^4.5.0" - portfinder "^1.0.28" - schema-utils "^4.0.0" - selfsigned "^2.0.0" - serve-index "^1.9.1" - sockjs "^0.3.21" - spdy "^4.0.2" - strip-ansi "^7.0.0" - webpack-dev-middleware "^5.3.1" - ws "^8.4.2" - -webpack-merge@^5.7.3: - version "5.8.0" - resolved "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz" - integrity sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q== - dependencies: - clone-deep "^4.0.1" - wildcard "^2.0.0" - -webpack-sources@^3.2.3: - version "3.2.3" - resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz" - integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== - -"webpack-target-webextension@link:../..": - version "0.0.0" - uid "" - -webpack@^5.68.0: - version "5.68.0" - resolved "https://registry.npmjs.org/webpack/-/webpack-5.68.0.tgz" - integrity sha512-zUcqaUO0772UuuW2bzaES2Zjlm/y3kRBQDVFVCge+s2Y8mwuUTdperGaAv65/NtRL/1zanpSJOq/MD8u61vo6g== - dependencies: - "@types/eslint-scope" "^3.7.0" - "@types/estree" "^0.0.50" - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/wasm-edit" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - acorn "^8.4.1" - acorn-import-assertions "^1.7.6" - browserslist "^4.14.5" - chrome-trace-event "^1.0.2" - enhanced-resolve "^5.8.3" - es-module-lexer "^0.9.0" - eslint-scope "5.1.1" - events "^3.2.0" - glob-to-regexp "^0.4.1" - graceful-fs "^4.2.9" - json-parse-better-errors "^1.0.2" - loader-runner "^4.2.0" - mime-types "^2.1.27" - neo-async "^2.6.2" - schema-utils "^3.1.0" - tapable "^2.1.1" - terser-webpack-plugin "^5.1.3" - watchpack "^2.3.1" - webpack-sources "^3.2.3" - -websocket-driver@>=0.5.1, websocket-driver@^0.7.4: - version "0.7.4" - resolved "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz" - integrity sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg== - dependencies: - http-parser-js ">=0.5.1" - safe-buffer ">=5.1.0" - websocket-extensions ">=0.1.1" - -websocket-extensions@>=0.1.1: - version "0.1.4" - resolved "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz" - integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg== - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wildcard@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz" - integrity sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw== - -wrappy@1: - version "1.0.2" - resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -ws@^8.4.2: - version "8.4.2" - resolved "https://registry.npmjs.org/ws/-/ws-8.4.2.tgz" - integrity sha512-Kbk4Nxyq7/ZWqr/tarI9yIt/+iNNFOjBXEWgTb4ydaNHBNGgvf2QHbS9fdfsndfjFlFwEd4Al+mw83YkaD10ZA== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/packages/html-plugin/demo/popup-mv3/manifest-plugin.json b/packages/html-plugin/demo/popup-mv3/manifest-plugin.json deleted file mode 100644 index 02975f04..00000000 --- a/packages/html-plugin/demo/popup-mv3/manifest-plugin.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "action": { - "default_popup": "./src/popup.html", - "default_title": "Test" - } -} diff --git a/packages/html-plugin/demo/popup-mv3/manifest.json b/packages/html-plugin/demo/popup-mv3/manifest.json deleted file mode 100644 index 053900a3..00000000 --- a/packages/html-plugin/demo/popup-mv3/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "manifest_version": 3, - "name": "Popup MV3", - "version": "1.0.0", - "action": { - "default_popup": "dist/action.popup.html", - "default_title": "Test" - }, - "background": { - "service_worker": "./dist/background.js" - }, - "web_accessible_resources": [ - { - "resources": [ - "/dist/*.json", - "/dist/*.js", - "/dist/*.css", - "/dist/*.js.map" - ], - "matches": [""] - } - ], - "permissions": ["scripting"], - "host_permissions": [""] -} diff --git a/packages/html-plugin/demo/popup-mv3/package.json b/packages/html-plugin/demo/popup-mv3/package.json deleted file mode 100644 index a87e25ad..00000000 --- a/packages/html-plugin/demo/popup-mv3/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "scripts": { - "dev": "npx webpack serve --mode development", - "build": "npx webpack --mode production" - } -} diff --git a/packages/html-plugin/demo/popup-mv3/src/background.js b/packages/html-plugin/demo/popup-mv3/src/background.js deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/html-plugin/demo/popup-mv3/src/dep.js b/packages/html-plugin/demo/popup-mv3/src/dep.js deleted file mode 100644 index 33c1d29e..00000000 --- a/packages/html-plugin/demo/popup-mv3/src/dep.js +++ /dev/null @@ -1 +0,0 @@ -console.log("[HtmlPlugin] I'm a dependency") diff --git a/packages/html-plugin/demo/popup-mv3/src/popup.css b/packages/html-plugin/demo/popup-mv3/src/popup.css deleted file mode 100644 index 57e92459..00000000 --- a/packages/html-plugin/demo/popup-mv3/src/popup.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: red; -} diff --git a/packages/html-plugin/demo/popup-mv3/src/popup.html b/packages/html-plugin/demo/popup-mv3/src/popup.html deleted file mode 100644 index 07568568..00000000 --- a/packages/html-plugin/demo/popup-mv3/src/popup.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - popup Extension - - -

Hello popup page 🧩

- - - - - diff --git a/packages/html-plugin/demo/popup-mv3/src/popup1.js b/packages/html-plugin/demo/popup-mv3/src/popup1.js deleted file mode 100644 index 9b5b5171..00000000 --- a/packages/html-plugin/demo/popup-mv3/src/popup1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('[HtmlPlugin] Popup script 1 loaded') diff --git a/packages/html-plugin/demo/popup-mv3/src/popup2.js b/packages/html-plugin/demo/popup-mv3/src/popup2.js deleted file mode 100644 index 2292dea0..00000000 --- a/packages/html-plugin/demo/popup-mv3/src/popup2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('[HtmlPlugin] Popup script 2 loaded') diff --git a/packages/html-plugin/demo/popup-mv3/src/popup3.js b/packages/html-plugin/demo/popup-mv3/src/popup3.js deleted file mode 100644 index 2f4bf16b..00000000 --- a/packages/html-plugin/demo/popup-mv3/src/popup3.js +++ /dev/null @@ -1,3 +0,0 @@ -import dep from './dep' - -console.log('[HtmlPlugin] Popup script 3 with dep', dep) diff --git a/packages/html-plugin/demo/popup-mv3/webpack.config.js b/packages/html-plugin/demo/popup-mv3/webpack.config.js deleted file mode 100644 index 5e43506e..00000000 --- a/packages/html-plugin/demo/popup-mv3/webpack.config.js +++ /dev/null @@ -1,34 +0,0 @@ -const path = require('path') -const webpack = require('webpack') -const HtmlPlugin = require('../../dist/module').default -const WebExtension = require('webpack-target-webextension') - -/** @type {webpack.Configuration} */ -const config = { - // No eval allowed in MV3 - devtool: 'cheap-source-map', - entry: { - background: path.join(__dirname, './src/background.js') - }, - output: { - path: path.join(__dirname, './dist'), - publicPath: '/dist/' - }, - plugins: [ - new HtmlPlugin({ - manifestPath: path.join(__dirname, './manifest-plugin.json') - }), - new WebExtension({ - background: { - entry: 'background', - manifest: 3 - } - }) - ], - devServer: { - hot: 'only', - watchFiles: ['src/**/*.html'] - } -} - -module.exports = config diff --git a/packages/html-plugin/demo/popup-mv3/yarn.lock b/packages/html-plugin/demo/popup-mv3/yarn.lock deleted file mode 100644 index a0549485..00000000 --- a/packages/html-plugin/demo/popup-mv3/yarn.lock +++ /dev/null @@ -1,8 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -webpack-target-webextension@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/webpack-target-webextension/-/webpack-target-webextension-1.0.5.tgz#7b10d97e9f4bdd2ed6691c74c1d8c6a82f46382a" - integrity sha512-0xgugW+9yzLjJENX9t0Hgfjz60Mje15hPlLpTOEMX/LOVIOvCBLN9hsmk3LG9HWr2FSLeDda7L9RFlk4bGhhcg== diff --git a/packages/html-plugin/extension-html-reloader.ts b/packages/html-plugin/extension-html-reloader.ts deleted file mode 100644 index ef9251fd..00000000 --- a/packages/html-plugin/extension-html-reloader.ts +++ /dev/null @@ -1 +0,0 @@ -export default function (): void {} diff --git a/packages/html-plugin/helpers/getResourceName.ts b/packages/html-plugin/helpers/getResourceName.ts index aebb755d..c0189a57 100644 --- a/packages/html-plugin/helpers/getResourceName.ts +++ b/packages/html-plugin/helpers/getResourceName.ts @@ -22,18 +22,14 @@ function getOutputExtname(extname: string) { } } -export function getFilePathWithinFolder(feature: string, filePath: string) { +export function getFilepath(feature: string, filePath: string) { const entryExt = path.extname(filePath) const entryName = path.basename(filePath, entryExt) const extname = getOutputExtname(entryExt) - return `${feature}/${entryName}${extname}` -} - -export function getFilePathSplitByDots(feature: string, filePath: string) { - const entryExt = path.extname(filePath) - const entryName = path.basename(filePath, entryExt) - const extname = getOutputExtname(entryExt) + if (extname === '.html' || extname === '.js' || extname === '.css') { + return `${feature}/index${extname}` + } - return `${feature}.${entryName}${extname}` + return `assets/${entryName}${extname}` } diff --git a/packages/html-plugin/helpers/isHMREnabled.ts b/packages/html-plugin/helpers/isHMREnabled.ts deleted file mode 100644 index 33501cef..00000000 --- a/packages/html-plugin/helpers/isHMREnabled.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type webpack from 'webpack' - -export default function isHMREnabled(compiler: webpack.Compiler) { - return ( - compiler.options.mode !== 'production' || !!compiler.options.devServer?.hot - ) -} diff --git a/packages/html-plugin/helpers/isUsingReact.ts b/packages/html-plugin/helpers/isUsingReact.ts new file mode 100644 index 00000000..7dc4f46f --- /dev/null +++ b/packages/html-plugin/helpers/isUsingReact.ts @@ -0,0 +1,17 @@ +import path from 'path' +import fs from 'fs' + +export function isUsingReact(projectDir: string) { + const packageJsonPath = path.join(projectDir, 'package.json') + + if (!fs.existsSync(packageJsonPath)) { + return false + } + + const packageJson = require(packageJsonPath) + const reactAsDevDep = + packageJson.devDependencies && packageJson.devDependencies.react + const reactAsDep = packageJson.dependencies && packageJson.dependencies.react + + return reactAsDevDep || reactAsDep +} diff --git a/packages/html-plugin/helpers/messages.ts b/packages/html-plugin/helpers/messages.ts index 2940c9f3..ac37bb03 100644 --- a/packages/html-plugin/helpers/messages.ts +++ b/packages/html-plugin/helpers/messages.ts @@ -21,6 +21,35 @@ export function fileError(feature: string | undefined, filePath: string) { } } +export function serverRestartRequired( + projectDir: string, + filePath: string + // contentChanged: { + // prevFile: string + // updatedFile: string + // } | null +) { + const basename = path.relative(projectDir, filePath) + const extname = path.extname(filePath) + // const extname = path.extname( + // contentChanged?.prevFile || contentChanged?.updatedFile || '' + // ) + // const tag = ['js', 'ts', 'jsx', 'tsx'].includes(extname) ? 'script' : 'link' + // const prevFileRelative = path.relative(filePath, contentChanged?.prevFile!) + // const updatedFileRelative = path.relative( + // filePath, + // contentChanged?.updatedFile! + // ) + const errorMessage = `[${basename}] Entry Point Modification Found + +Changing - - - diff --git a/packages/html-plugin/spec/fixtures/action-html/popup1.js b/packages/html-plugin/spec/fixtures/action-html/popup1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/html-plugin/spec/fixtures/action-html/popup1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/html-plugin/spec/fixtures/action-html/popup2.js b/packages/html-plugin/spec/fixtures/action-html/popup2.js deleted file mode 100644 index 683355f9..00000000 --- a/packages/html-plugin/spec/fixtures/action-html/popup2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script (2) loaded') diff --git a/packages/html-plugin/spec/fixtures/action-html/webpack.config.js b/packages/html-plugin/spec/fixtures/action-html/webpack.config.js deleted file mode 100644 index 12bc5e53..00000000 --- a/packages/html-plugin/spec/fixtures/action-html/webpack.config.js +++ /dev/null @@ -1,23 +0,0 @@ -const path = require('path') -const HtmlPlugin = require('../../../dist/module').default - -const manifestPath = path.join(__dirname, 'manifest.json') -const output = path.resolve(__dirname, './dist') - -module.exports = { - mode: 'development', - entry: {}, - output: { - path: output, - clean: true - }, - - plugins: [ - new HtmlPlugin({ - manifestPath, - output: { - action: 'action' - } - }) - ] -} diff --git a/packages/html-plugin/spec/fixtures/background-html/background/background.html b/packages/html-plugin/spec/fixtures/background-html/background/background.html deleted file mode 100644 index 46d5613d..00000000 --- a/packages/html-plugin/spec/fixtures/background-html/background/background.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Background page - - - selva - - - - diff --git a/packages/html-plugin/spec/fixtures/background-html/background/background1.js b/packages/html-plugin/spec/fixtures/background-html/background/background1.js deleted file mode 100644 index b73dbf7c..00000000 --- a/packages/html-plugin/spec/fixtures/background-html/background/background1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('background script loaded') diff --git a/packages/html-plugin/spec/fixtures/background-html/background/background2.js b/packages/html-plugin/spec/fixtures/background-html/background/background2.js deleted file mode 100644 index 4c32f669..00000000 --- a/packages/html-plugin/spec/fixtures/background-html/background/background2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('background script (2) loaded') diff --git a/packages/html-plugin/spec/fixtures/background-html/manifest.json b/packages/html-plugin/spec/fixtures/background-html/manifest.json deleted file mode 100644 index cf1fba54..00000000 --- a/packages/html-plugin/spec/fixtures/background-html/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "manifest_version": 2, - "version": "0.1", - "name": "Testing extension", - "author": "Cezar Augusto", - "background": { - "persistent": false, - "page": "background/background.html" - } -} diff --git a/packages/html-plugin/spec/fixtures/background-html/webpack.config.js b/packages/html-plugin/spec/fixtures/background-html/webpack.config.js deleted file mode 100644 index 614a2730..00000000 --- a/packages/html-plugin/spec/fixtures/background-html/webpack.config.js +++ /dev/null @@ -1,22 +0,0 @@ -const path = require('path') -const HtmlPlugin = require('../../../dist/module').default - -const manifestPath = path.join(__dirname, 'manifest.json') -const output = path.resolve(__dirname, './dist') - -module.exports = { - mode: 'development', - entry: {}, - output: { - path: output, - clean: true - }, - plugins: [ - new HtmlPlugin({ - manifestPath, - output: { - background: 'background' - } - }) - ] -} diff --git a/packages/html-plugin/spec/fixtures/bookmarks-html/bookmarks.css b/packages/html-plugin/spec/fixtures/bookmarks-html/bookmarks.css deleted file mode 100644 index dc39c47e..00000000 --- a/packages/html-plugin/spec/fixtures/bookmarks-html/bookmarks.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightcoral; -} diff --git a/packages/html-plugin/spec/fixtures/bookmarks-html/bookmarks.html b/packages/html-plugin/spec/fixtures/bookmarks-html/bookmarks.html deleted file mode 100644 index 4af21d68..00000000 --- a/packages/html-plugin/spec/fixtures/bookmarks-html/bookmarks.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - Bookmarks Extension - - -

Hello bookmarks page 🧩

- puzzle - - - - diff --git a/packages/html-plugin/spec/fixtures/bookmarks-html/bookmarks1.js b/packages/html-plugin/spec/fixtures/bookmarks-html/bookmarks1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/html-plugin/spec/fixtures/bookmarks-html/bookmarks1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/html-plugin/spec/fixtures/bookmarks-html/bookmarks2.js b/packages/html-plugin/spec/fixtures/bookmarks-html/bookmarks2.js deleted file mode 100644 index 683355f9..00000000 --- a/packages/html-plugin/spec/fixtures/bookmarks-html/bookmarks2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script (2) loaded') diff --git a/packages/html-plugin/spec/fixtures/bookmarks-html/manifest.json b/packages/html-plugin/spec/fixtures/bookmarks-html/manifest.json deleted file mode 100644 index 17ee59e7..00000000 --- a/packages/html-plugin/spec/fixtures/bookmarks-html/manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "manifest_version": 2, - "version": "0.1", - "name": "Testing extension", - "author": "Cezar Augusto", - "chrome_url_overrides": { - "bookmarks": "bookmarks.html" - } -} diff --git a/packages/html-plugin/spec/fixtures/bookmarks-html/puzzle.png b/packages/html-plugin/spec/fixtures/bookmarks-html/puzzle.png deleted file mode 100644 index bed9389a..00000000 Binary files a/packages/html-plugin/spec/fixtures/bookmarks-html/puzzle.png and /dev/null differ diff --git a/packages/html-plugin/spec/fixtures/bookmarks-html/webpack.config.js b/packages/html-plugin/spec/fixtures/bookmarks-html/webpack.config.js deleted file mode 100644 index 55a428d9..00000000 --- a/packages/html-plugin/spec/fixtures/bookmarks-html/webpack.config.js +++ /dev/null @@ -1,23 +0,0 @@ -const path = require('path') -const HtmlPlugin = require('../../../dist/module').default - -const manifestPath = path.join(__dirname, 'manifest.json') -const output = path.resolve(__dirname, './dist') - -module.exports = { - mode: 'development', - entry: {}, - output: { - path: output, - clean: true - }, - - plugins: [ - new HtmlPlugin({ - manifestPath, - output: { - bookmarks: 'bookmarks' - } - }) - ] -} diff --git a/packages/html-plugin/spec/fixtures/browser-action-html/browser-action.css b/packages/html-plugin/spec/fixtures/browser-action-html/browser-action.css deleted file mode 100644 index dc39c47e..00000000 --- a/packages/html-plugin/spec/fixtures/browser-action-html/browser-action.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightcoral; -} diff --git a/packages/html-plugin/spec/fixtures/browser-action-html/browser-action.html b/packages/html-plugin/spec/fixtures/browser-action-html/browser-action.html deleted file mode 100644 index 3ec27bbb..00000000 --- a/packages/html-plugin/spec/fixtures/browser-action-html/browser-action.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - popup Extension - - -

Hello popup page 🧩

- - - - diff --git a/packages/html-plugin/spec/fixtures/browser-action-html/browser-action1.js b/packages/html-plugin/spec/fixtures/browser-action-html/browser-action1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/html-plugin/spec/fixtures/browser-action-html/browser-action1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/html-plugin/spec/fixtures/browser-action-html/browser-action2.js b/packages/html-plugin/spec/fixtures/browser-action-html/browser-action2.js deleted file mode 100644 index 683355f9..00000000 --- a/packages/html-plugin/spec/fixtures/browser-action-html/browser-action2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script (2) loaded') diff --git a/packages/html-plugin/spec/fixtures/browser-action-html/manifest.json b/packages/html-plugin/spec/fixtures/browser-action-html/manifest.json deleted file mode 100644 index 402f3546..00000000 --- a/packages/html-plugin/spec/fixtures/browser-action-html/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "manifest_version": 2, - "version": "0.1", - "name": "Testing extension", - "author": "Cezar Augusto", - "browser_action": { - "default_popup": "browser-action.html", - "default_title": "Test" - } -} diff --git a/packages/html-plugin/spec/fixtures/browser-action-html/webpack.config.js b/packages/html-plugin/spec/fixtures/browser-action-html/webpack.config.js deleted file mode 100644 index 12bc5e53..00000000 --- a/packages/html-plugin/spec/fixtures/browser-action-html/webpack.config.js +++ /dev/null @@ -1,23 +0,0 @@ -const path = require('path') -const HtmlPlugin = require('../../../dist/module').default - -const manifestPath = path.join(__dirname, 'manifest.json') -const output = path.resolve(__dirname, './dist') - -module.exports = { - mode: 'development', - entry: {}, - output: { - path: output, - clean: true - }, - - plugins: [ - new HtmlPlugin({ - manifestPath, - output: { - action: 'action' - } - }) - ] -} diff --git a/packages/html-plugin/spec/fixtures/devtools-html/devtools.css b/packages/html-plugin/spec/fixtures/devtools-html/devtools.css deleted file mode 100644 index dc39c47e..00000000 --- a/packages/html-plugin/spec/fixtures/devtools-html/devtools.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightcoral; -} diff --git a/packages/html-plugin/spec/fixtures/devtools-html/devtools.html b/packages/html-plugin/spec/fixtures/devtools-html/devtools.html deleted file mode 100644 index ecf99bfa..00000000 --- a/packages/html-plugin/spec/fixtures/devtools-html/devtools.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - devtools Extension - - -

Hello devtools page 🧩

- - - - diff --git a/packages/html-plugin/spec/fixtures/devtools-html/devtools1.js b/packages/html-plugin/spec/fixtures/devtools-html/devtools1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/html-plugin/spec/fixtures/devtools-html/devtools1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/html-plugin/spec/fixtures/devtools-html/devtools2.js b/packages/html-plugin/spec/fixtures/devtools-html/devtools2.js deleted file mode 100644 index 683355f9..00000000 --- a/packages/html-plugin/spec/fixtures/devtools-html/devtools2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script (2) loaded') diff --git a/packages/html-plugin/spec/fixtures/devtools-html/manifest.json b/packages/html-plugin/spec/fixtures/devtools-html/manifest.json deleted file mode 100644 index 8c8cdb4b..00000000 --- a/packages/html-plugin/spec/fixtures/devtools-html/manifest.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "manifest_version": 2, - "version": "0.1", - "name": "Testing extension", - "author": "Cezar Augusto", - "devtools_page": "devtools.html" -} diff --git a/packages/html-plugin/spec/fixtures/devtools-html/webpack.config.js b/packages/html-plugin/spec/fixtures/devtools-html/webpack.config.js deleted file mode 100644 index 481e05b2..00000000 --- a/packages/html-plugin/spec/fixtures/devtools-html/webpack.config.js +++ /dev/null @@ -1,23 +0,0 @@ -const path = require('path') -const HtmlPlugin = require('../../../dist/module').default - -const manifestPath = path.join(__dirname, 'manifest.json') -const output = path.resolve(__dirname, './dist') - -module.exports = { - mode: 'development', - entry: {}, - output: { - path: output, - clean: true - }, - - plugins: [ - new HtmlPlugin({ - manifestPath, - output: { - devtools: 'devtools' - } - }) - ] -} diff --git a/packages/html-plugin/spec/fixtures/history-html/history.css b/packages/html-plugin/spec/fixtures/history-html/history.css deleted file mode 100644 index dc39c47e..00000000 --- a/packages/html-plugin/spec/fixtures/history-html/history.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightcoral; -} diff --git a/packages/html-plugin/spec/fixtures/history-html/history.html b/packages/html-plugin/spec/fixtures/history-html/history.html deleted file mode 100644 index 283b7c79..00000000 --- a/packages/html-plugin/spec/fixtures/history-html/history.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - history Extension - - -

Hello history page 🧩

- - - - diff --git a/packages/html-plugin/spec/fixtures/history-html/history1.js b/packages/html-plugin/spec/fixtures/history-html/history1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/html-plugin/spec/fixtures/history-html/history1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/html-plugin/spec/fixtures/history-html/history2.js b/packages/html-plugin/spec/fixtures/history-html/history2.js deleted file mode 100644 index 683355f9..00000000 --- a/packages/html-plugin/spec/fixtures/history-html/history2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script (2) loaded') diff --git a/packages/html-plugin/spec/fixtures/history-html/manifest.json b/packages/html-plugin/spec/fixtures/history-html/manifest.json deleted file mode 100644 index 93db85d2..00000000 --- a/packages/html-plugin/spec/fixtures/history-html/manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "manifest_version": 2, - "version": "0.1", - "name": "Testing extension", - "author": "Cezar Augusto", - "chrome_url_overrides": { - "history": "history.html" - } -} diff --git a/packages/html-plugin/spec/fixtures/history-html/webpack.config.js b/packages/html-plugin/spec/fixtures/history-html/webpack.config.js deleted file mode 100644 index 21728fcb..00000000 --- a/packages/html-plugin/spec/fixtures/history-html/webpack.config.js +++ /dev/null @@ -1,23 +0,0 @@ -const path = require('path') -const HtmlPlugin = require('../../../dist/module').default - -const manifestPath = path.join(__dirname, 'manifest.json') -const output = path.resolve(__dirname, './dist') - -module.exports = { - mode: 'development', - entry: {}, - output: { - path: output, - clean: true - }, - - plugins: [ - new HtmlPlugin({ - manifestPath, - output: { - history: 'history' - } - }) - ] -} diff --git a/packages/html-plugin/spec/fixtures/newtab-html/manifest.json b/packages/html-plugin/spec/fixtures/newtab-html/manifest.json deleted file mode 100644 index e4e20d44..00000000 --- a/packages/html-plugin/spec/fixtures/newtab-html/manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "manifest_version": 2, - "version": "0.1", - "name": "Testing extension", - "author": "Cezar Augusto", - "chrome_url_overrides": { - "newtab": "newtab.html" - } -} diff --git a/packages/html-plugin/spec/fixtures/newtab-html/newtab.css b/packages/html-plugin/spec/fixtures/newtab-html/newtab.css deleted file mode 100644 index dc39c47e..00000000 --- a/packages/html-plugin/spec/fixtures/newtab-html/newtab.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightcoral; -} diff --git a/packages/html-plugin/spec/fixtures/newtab-html/newtab.html b/packages/html-plugin/spec/fixtures/newtab-html/newtab.html deleted file mode 100644 index 0a665fdf..00000000 --- a/packages/html-plugin/spec/fixtures/newtab-html/newtab.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - newtab Extension - - -

Hello newtab page 🧩

- - - - diff --git a/packages/html-plugin/spec/fixtures/newtab-html/newtab1.js b/packages/html-plugin/spec/fixtures/newtab-html/newtab1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/html-plugin/spec/fixtures/newtab-html/newtab1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/html-plugin/spec/fixtures/newtab-html/newtab2.js b/packages/html-plugin/spec/fixtures/newtab-html/newtab2.js deleted file mode 100644 index 683355f9..00000000 --- a/packages/html-plugin/spec/fixtures/newtab-html/newtab2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script (2) loaded') diff --git a/packages/html-plugin/spec/fixtures/newtab-html/webpack.config.js b/packages/html-plugin/spec/fixtures/newtab-html/webpack.config.js deleted file mode 100644 index f338fbb6..00000000 --- a/packages/html-plugin/spec/fixtures/newtab-html/webpack.config.js +++ /dev/null @@ -1,23 +0,0 @@ -const path = require('path') -const HtmlPlugin = require('../../../dist/module').default - -const manifestPath = path.join(__dirname, 'manifest.json') -const output = path.resolve(__dirname, './dist') - -module.exports = { - mode: 'development', - entry: {}, - output: { - path: output, - clean: true - }, - - plugins: [ - new HtmlPlugin({ - manifestPath, - output: { - newtab: 'newtab' - } - }) - ] -} diff --git a/packages/html-plugin/spec/fixtures/options-html/manifest.json b/packages/html-plugin/spec/fixtures/options-html/manifest.json deleted file mode 100644 index e05158ee..00000000 --- a/packages/html-plugin/spec/fixtures/options-html/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "manifest_version": 2, - "version": "0.1", - "name": "Testing extension", - "author": "Cezar Augusto", - "options_ui": { - "chrome_style": true, - "page": "options.html" - } -} diff --git a/packages/html-plugin/spec/fixtures/options-html/options.css b/packages/html-plugin/spec/fixtures/options-html/options.css deleted file mode 100644 index dc39c47e..00000000 --- a/packages/html-plugin/spec/fixtures/options-html/options.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightcoral; -} diff --git a/packages/html-plugin/spec/fixtures/options-html/options.html b/packages/html-plugin/spec/fixtures/options-html/options.html deleted file mode 100644 index e5dc0e9f..00000000 --- a/packages/html-plugin/spec/fixtures/options-html/options.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - options Extension - - -

Hello options page 🧩

- - - - diff --git a/packages/html-plugin/spec/fixtures/options-html/options1.js b/packages/html-plugin/spec/fixtures/options-html/options1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/html-plugin/spec/fixtures/options-html/options1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/html-plugin/spec/fixtures/options-html/options2.js b/packages/html-plugin/spec/fixtures/options-html/options2.js deleted file mode 100644 index 683355f9..00000000 --- a/packages/html-plugin/spec/fixtures/options-html/options2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script (2) loaded') diff --git a/packages/html-plugin/spec/fixtures/options-html/webpack.config.js b/packages/html-plugin/spec/fixtures/options-html/webpack.config.js deleted file mode 100644 index 12c20cfe..00000000 --- a/packages/html-plugin/spec/fixtures/options-html/webpack.config.js +++ /dev/null @@ -1,23 +0,0 @@ -const path = require('path') -const HtmlPlugin = require('../../../dist/module').default - -const manifestPath = path.join(__dirname, 'manifest.json') -const output = path.resolve(__dirname, './dist') - -module.exports = { - mode: 'development', - entry: {}, - output: { - path: output, - clean: true - }, - - plugins: [ - new HtmlPlugin({ - manifestPath, - output: { - options: 'options' - } - }) - ] -} diff --git a/packages/html-plugin/spec/fixtures/page-action-html/manifest.json b/packages/html-plugin/spec/fixtures/page-action-html/manifest.json deleted file mode 100644 index 1e00a276..00000000 --- a/packages/html-plugin/spec/fixtures/page-action-html/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "manifest_version": 2, - "version": "0.1", - "name": "Testing extension", - "author": "Cezar Augusto", - "page_action": { - "default_popup": "page-action.html", - "default_title": "Test" - } -} diff --git a/packages/html-plugin/spec/fixtures/page-action-html/page-action.css b/packages/html-plugin/spec/fixtures/page-action-html/page-action.css deleted file mode 100644 index dc39c47e..00000000 --- a/packages/html-plugin/spec/fixtures/page-action-html/page-action.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightcoral; -} diff --git a/packages/html-plugin/spec/fixtures/page-action-html/page-action.html b/packages/html-plugin/spec/fixtures/page-action-html/page-action.html deleted file mode 100644 index 8954f360..00000000 --- a/packages/html-plugin/spec/fixtures/page-action-html/page-action.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Popup Extension - - -

Hello page-action page 🧩

- - - - diff --git a/packages/html-plugin/spec/fixtures/page-action-html/page-action1.js b/packages/html-plugin/spec/fixtures/page-action-html/page-action1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/html-plugin/spec/fixtures/page-action-html/page-action1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/html-plugin/spec/fixtures/page-action-html/page-action2.js b/packages/html-plugin/spec/fixtures/page-action-html/page-action2.js deleted file mode 100644 index 683355f9..00000000 --- a/packages/html-plugin/spec/fixtures/page-action-html/page-action2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script (2) loaded') diff --git a/packages/html-plugin/spec/fixtures/page-action-html/webpack.config.js b/packages/html-plugin/spec/fixtures/page-action-html/webpack.config.js deleted file mode 100644 index 12bc5e53..00000000 --- a/packages/html-plugin/spec/fixtures/page-action-html/webpack.config.js +++ /dev/null @@ -1,23 +0,0 @@ -const path = require('path') -const HtmlPlugin = require('../../../dist/module').default - -const manifestPath = path.join(__dirname, 'manifest.json') -const output = path.resolve(__dirname, './dist') - -module.exports = { - mode: 'development', - entry: {}, - output: { - path: output, - clean: true - }, - - plugins: [ - new HtmlPlugin({ - manifestPath, - output: { - action: 'action' - } - }) - ] -} diff --git a/packages/html-plugin/spec/fixtures/settings-html/manifest.json b/packages/html-plugin/spec/fixtures/settings-html/manifest.json deleted file mode 100644 index 0bf42f49..00000000 --- a/packages/html-plugin/spec/fixtures/settings-html/manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "manifest_version": 2, - "version": "0.1", - "name": "Testing extension", - "author": "Cezar Augusto", - "chrome_settings_overrides": { - "homepage": "./settings.html" - } -} diff --git a/packages/html-plugin/spec/fixtures/settings-html/settings.css b/packages/html-plugin/spec/fixtures/settings-html/settings.css deleted file mode 100644 index dc39c47e..00000000 --- a/packages/html-plugin/spec/fixtures/settings-html/settings.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightcoral; -} diff --git a/packages/html-plugin/spec/fixtures/settings-html/settings.html b/packages/html-plugin/spec/fixtures/settings-html/settings.html deleted file mode 100644 index 2eff9118..00000000 --- a/packages/html-plugin/spec/fixtures/settings-html/settings.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - settings Extension - - -

Hello settings page 🧩

- - - - diff --git a/packages/html-plugin/spec/fixtures/settings-html/settings1.js b/packages/html-plugin/spec/fixtures/settings-html/settings1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/html-plugin/spec/fixtures/settings-html/settings1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/html-plugin/spec/fixtures/settings-html/settings2.js b/packages/html-plugin/spec/fixtures/settings-html/settings2.js deleted file mode 100644 index 683355f9..00000000 --- a/packages/html-plugin/spec/fixtures/settings-html/settings2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script (2) loaded') diff --git a/packages/html-plugin/spec/fixtures/settings-html/webpack.config.js b/packages/html-plugin/spec/fixtures/settings-html/webpack.config.js deleted file mode 100644 index e75ca3e9..00000000 --- a/packages/html-plugin/spec/fixtures/settings-html/webpack.config.js +++ /dev/null @@ -1,23 +0,0 @@ -const path = require('path') -const HtmlPlugin = require('../../../dist/module').default - -const manifestPath = path.join(__dirname, 'manifest.json') -const output = path.resolve(__dirname, './dist') - -module.exports = { - mode: 'development', - entry: {}, - output: { - path: output, - clean: true - }, - - plugins: [ - new HtmlPlugin({ - manifestPath, - output: { - settings: 'settings' - } - }) - ] -} diff --git a/packages/html-plugin/spec/fixtures/sidebar-html/manifest.json b/packages/html-plugin/spec/fixtures/sidebar-html/manifest.json deleted file mode 100644 index d47f18d6..00000000 --- a/packages/html-plugin/spec/fixtures/sidebar-html/manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "manifest_version": 2, - "version": "0.1", - "name": "Testing extension", - "author": "Cezar Augusto", - "sidebar_action": { - "default_panel": "sidebar.html" - } -} diff --git a/packages/html-plugin/spec/fixtures/sidebar-html/sidebar.css b/packages/html-plugin/spec/fixtures/sidebar-html/sidebar.css deleted file mode 100644 index dc39c47e..00000000 --- a/packages/html-plugin/spec/fixtures/sidebar-html/sidebar.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightcoral; -} diff --git a/packages/html-plugin/spec/fixtures/sidebar-html/sidebar.html b/packages/html-plugin/spec/fixtures/sidebar-html/sidebar.html deleted file mode 100644 index 0f16ce11..00000000 --- a/packages/html-plugin/spec/fixtures/sidebar-html/sidebar.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - sidebar Extension - - -

Hello sidebar page 🧩

- - - - diff --git a/packages/html-plugin/spec/fixtures/sidebar-html/sidebar1.js b/packages/html-plugin/spec/fixtures/sidebar-html/sidebar1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/html-plugin/spec/fixtures/sidebar-html/sidebar1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/html-plugin/spec/fixtures/sidebar-html/sidebar2.js b/packages/html-plugin/spec/fixtures/sidebar-html/sidebar2.js deleted file mode 100644 index 683355f9..00000000 --- a/packages/html-plugin/spec/fixtures/sidebar-html/sidebar2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script (2) loaded') diff --git a/packages/html-plugin/spec/fixtures/sidebar-html/webpack.config.js b/packages/html-plugin/spec/fixtures/sidebar-html/webpack.config.js deleted file mode 100644 index ff9f4750..00000000 --- a/packages/html-plugin/spec/fixtures/sidebar-html/webpack.config.js +++ /dev/null @@ -1,23 +0,0 @@ -const path = require('path') -const HtmlPlugin = require('../../../dist/module').default - -const manifestPath = path.join(__dirname, 'manifest.json') -const output = path.resolve(__dirname, './dist') - -module.exports = { - mode: 'development', - entry: {}, - output: { - path: output, - clean: true - }, - - plugins: [ - new HtmlPlugin({ - manifestPath, - output: { - sidebar: 'sidebar' - } - }) - ] -} diff --git a/packages/html-plugin/spec/history.spec.js b/packages/html-plugin/spec/history.spec.js deleted file mode 100644 index 481a2444..00000000 --- a/packages/html-plugin/spec/history.spec.js +++ /dev/null @@ -1,114 +0,0 @@ -/* eslint-env jasmine */ -const fs = require('fs') -const path = require('path') -const webpack = require('webpack') -const jsdom = require('jsdom') - -const {JSDOM} = jsdom - -const demoWebpackConfig = (demoDir) => - require(path.join(__dirname, 'fixtures', demoDir, 'webpack.config.js')) - -describe('HtmlPlugin', function () { - describe('browser history html', function () { - const webpackConfig = demoWebpackConfig('history-html') - - beforeAll(function (done) { - webpack(webpackConfig, function (err) { - expect(err).toBeFalsy() - done() - }) - }) - - it('outputs html file to destination folder with css paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'history.history.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const stylesheets = [...document.querySelectorAll('link')] - - expect(stylesheets[0].href).toBe('history.history.css') - - done() - }) - }) - - it('outputs css file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'history.history.css' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - - describe('without hot-module-replacement', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'history.history.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - expect(scripts[0].src).toBe('history.history1.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'history.history1.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - }) - - describe('with hot-module-replacement (TODO)', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'history.history.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - // expect(scripts[0].src).toBe('history.hmr-bundle.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'history.hmr-bundle.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - // expect(data).toBeDefined() - done() - }) - }) - }) - }) -}) diff --git a/packages/html-plugin/spec/newtab.spec.js b/packages/html-plugin/spec/newtab.spec.js deleted file mode 100644 index fe4b2d52..00000000 --- a/packages/html-plugin/spec/newtab.spec.js +++ /dev/null @@ -1,114 +0,0 @@ -/* eslint-env jasmine */ -const fs = require('fs') -const path = require('path') -const webpack = require('webpack') -const jsdom = require('jsdom') - -const {JSDOM} = jsdom - -const demoWebpackConfig = (demoDir) => - require(path.join(__dirname, 'fixtures', demoDir, 'webpack.config.js')) - -describe('HtmlPlugin', function () { - describe('browser newtab html', function () { - const webpackConfig = demoWebpackConfig('newtab-html') - - beforeAll(function (done) { - webpack(webpackConfig, function (err) { - expect(err).toBeFalsy() - done() - }) - }) - - it('outputs html file to destination folder with css paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'newtab.newtab.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const stylesheets = [...document.querySelectorAll('link')] - - expect(stylesheets[0].href).toBe('newtab.newtab.css') - - done() - }) - }) - - it('outputs css file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'newtab.newtab.css' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - - describe('without hot-module-replacement', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'newtab.newtab.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - expect(scripts[0].src).toBe('newtab.newtab1.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'newtab.newtab1.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - }) - - describe('with hot-module-replacement (TODO)', function () { - it('outputs html file to destination folder with css paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'newtab.newtab.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - // expect(scripts[0].src).toBe('newtab.hmr-bundle.js') - - done() - }) - }) - - it('outputs js file to destination folder (TODO)', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'newtab.hmr-bundle.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - // expect(data).toBeDefined() - done() - }) - }) - }) - }) -}) diff --git a/packages/html-plugin/spec/options.spec.js b/packages/html-plugin/spec/options.spec.js deleted file mode 100644 index 6efcfd63..00000000 --- a/packages/html-plugin/spec/options.spec.js +++ /dev/null @@ -1,114 +0,0 @@ -/* eslint-env jasmine */ -const fs = require('fs') -const path = require('path') -const webpack = require('webpack') -const jsdom = require('jsdom') - -const {JSDOM} = jsdom - -const demoWebpackConfig = (demoDir) => - require(path.join(__dirname, 'fixtures', demoDir, 'webpack.config.js')) - -describe('HtmlPlugin', function () { - describe('browser options html', function () { - const webpackConfig = demoWebpackConfig('options-html') - - beforeAll(function (done) { - webpack(webpackConfig, function (err) { - expect(err).toBeFalsy() - done() - }) - }) - - it('outputs html file to destination folder with css paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'options.options.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const stylesheets = [...document.querySelectorAll('link')] - - expect(stylesheets[0].href).toBe('options.options.css') - - done() - }) - }) - - it('outputs css file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'options.options.css' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - - describe('without hot-module-replacement', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'options.options.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - expect(scripts[0].src).toBe('options.options1.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'options.options1.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - }) - - describe('with hot-module-replacement (TODO)', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'options.options.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - // expect(scripts[0].src).toBe('options.hmr-bundle.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'options.hmr-bundle.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - // expect(data).toBeDefined() - done() - }) - }) - }) - }) -}) diff --git a/packages/html-plugin/spec/page-action.spec.js b/packages/html-plugin/spec/page-action.spec.js deleted file mode 100644 index c7b15adc..00000000 --- a/packages/html-plugin/spec/page-action.spec.js +++ /dev/null @@ -1,114 +0,0 @@ -/* eslint-env jasmine */ -const fs = require('fs') -const path = require('path') -const webpack = require('webpack') -const jsdom = require('jsdom') - -const {JSDOM} = jsdom - -const demoWebpackConfig = (demoDir) => - require(path.join(__dirname, 'fixtures', demoDir, 'webpack.config.js')) - -describe('HtmlPlugin', function () { - describe('browser page-action html', function () { - const webpackConfig = demoWebpackConfig('page-action-html') - - beforeAll(function (done) { - webpack(webpackConfig, function (err) { - expect(err).toBeFalsy() - done() - }) - }) - - it('outputs html file to destination folder with css paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'action.page-action.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const stylesheets = [...document.querySelectorAll('link')] - - expect(stylesheets[0].href).toBe('action.page-action.css') - - done() - }) - }) - - it('outputs css file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'action.page-action.css' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - - describe('without hot-module-replacement', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'action.page-action.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - expect(scripts[0].src).toBe('action.page-action1.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'action.page-action1.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - }) - - describe('with hot-module-replacement (TODO)', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'action.page-action.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - // expect(scripts[0].src).toBe('action.hmr-bundle.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'action.hmr-bundle.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - // expect(data).toBeDefined() - done() - }) - }) - }) - }) -}) diff --git a/packages/html-plugin/spec/sandbox.spec.js b/packages/html-plugin/spec/sandbox.spec.js deleted file mode 100644 index 4ae707af..00000000 --- a/packages/html-plugin/spec/sandbox.spec.js +++ /dev/null @@ -1,114 +0,0 @@ -/* eslint-env jasmine */ -const fs = require('fs') -const path = require('path') -const webpack = require('webpack') -const jsdom = require('jsdom') - -const {JSDOM} = jsdom - -const demoWebpackConfig = (demoDir) => - require(path.join(__dirname, 'fixtures', demoDir, 'webpack.config.js')) - -describe('HtmlPlugin', function () { - describe('browser sandbox html', function () { - const webpackConfig = demoWebpackConfig('sandbox-html') - - beforeAll(function (done) { - webpack(webpackConfig, function (err) { - expect(err).toBeFalsy() - done() - }) - }) - - it('outputs html file to destination folder with css paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const stylesheets = [...document.querySelectorAll('link')] - - expect(stylesheets[0].href).toBe('sidebar.sidebar.css') - - done() - }) - }) - - it('outputs css file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.css' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - - describe('without hot-module-replacement', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - expect(scripts[0].src).toBe('sidebar.sidebar1.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar1.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - }) - - describe('with hot-module-replacement (TODO)', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - // expect(scripts[0].src).toBe('sidebar.hmr-bundle.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'sidebar.hmr-bundle.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - // expect(data).toBeDefined() - done() - }) - }) - }) - }) -}) diff --git a/packages/html-plugin/spec/settings.spec.js b/packages/html-plugin/spec/settings.spec.js deleted file mode 100644 index f990abe6..00000000 --- a/packages/html-plugin/spec/settings.spec.js +++ /dev/null @@ -1,114 +0,0 @@ -/* eslint-env jasmine */ -const fs = require('fs') -const path = require('path') -const webpack = require('webpack') -const jsdom = require('jsdom') - -const {JSDOM} = jsdom - -const demoWebpackConfig = (demoDir) => - require(path.join(__dirname, 'fixtures', demoDir, 'webpack.config.js')) - -describe('HtmlPlugin', function () { - describe('browser settings html', function () { - const webpackConfig = demoWebpackConfig('settings-html') - - beforeAll(function (done) { - webpack(webpackConfig, function (err) { - expect(err).toBeFalsy() - done() - }) - }) - - it('outputs html file to destination folder with css paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'settings.settings.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const stylesheets = [...document.querySelectorAll('link')] - - expect(stylesheets[0].href).toBe('settings.settings.css') - - done() - }) - }) - - it('outputs css file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'settings.settings.css' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - - describe('without hot-module-replacement', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'settings.settings.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - expect(scripts[0].src).toBe('settings.settings1.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'settings.settings1.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - }) - - describe('with hot-module-replacement (TODO)', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'settings.settings.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - // expect(scripts[0].src).toBe('settings.hmr-bundle.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'settings.hmr-bundle.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - // expect(data).toBeDefined() - done() - }) - }) - }) - }) -}) diff --git a/packages/html-plugin/spec/side-panel.spec.js b/packages/html-plugin/spec/side-panel.spec.js deleted file mode 100644 index a78c67d2..00000000 --- a/packages/html-plugin/spec/side-panel.spec.js +++ /dev/null @@ -1,114 +0,0 @@ -/* eslint-env jasmine */ -const fs = require('fs') -const path = require('path') -const webpack = require('webpack') -const jsdom = require('jsdom') - -const {JSDOM} = jsdom - -const demoWebpackConfig = (demoDir) => - require(path.join(__dirname, 'fixtures', demoDir, 'webpack.config.js')) - -describe('HtmlPlugin', function () { - describe('browser sidebar html', function () { - const webpackConfig = demoWebpackConfig('side-panel-html') - - beforeAll(function (done) { - webpack(webpackConfig, function (err) { - expect(err).toBeFalsy() - done() - }) - }) - - it('outputs html file to destination folder with css paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const stylesheets = [...document.querySelectorAll('link')] - - expect(stylesheets[0].href).toBe('sidebar.sidebar.css') - - done() - }) - }) - - it('outputs css file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.css' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - - describe('without hot-module-replacement', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - expect(scripts[0].src).toBe('sidebar.sidebar1.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar1.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - }) - - describe('with hot-module-replacement (TODO)', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - // expect(scripts[0].src).toBe('sidebar.hmr-bundle.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'sidebar.hmr-bundle.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - // expect(data).toBeDefined() - done() - }) - }) - }) - }) -}) diff --git a/packages/html-plugin/spec/sidebar.spec.js b/packages/html-plugin/spec/sidebar.spec.js deleted file mode 100644 index 1b5c447b..00000000 --- a/packages/html-plugin/spec/sidebar.spec.js +++ /dev/null @@ -1,114 +0,0 @@ -/* eslint-env jasmine */ -const fs = require('fs') -const path = require('path') -const webpack = require('webpack') -const jsdom = require('jsdom') - -const {JSDOM} = jsdom - -const demoWebpackConfig = (demoDir) => - require(path.join(__dirname, 'fixtures', demoDir, 'webpack.config.js')) - -describe('HtmlPlugin', function () { - describe('browser sidebar html', function () { - const webpackConfig = demoWebpackConfig('sidebar-html') - - beforeAll(function (done) { - webpack(webpackConfig, function (err) { - expect(err).toBeFalsy() - done() - }) - }) - - it('outputs html file to destination folder with css paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const stylesheets = [...document.querySelectorAll('link')] - - expect(stylesheets[0].href).toBe('sidebar.sidebar.css') - - done() - }) - }) - - it('outputs css file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.css' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - - describe('without hot-module-replacement', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - expect(scripts[0].src).toBe('sidebar.sidebar1.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar1.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - }) - - describe('with hot-module-replacement (TODO)', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - // expect(scripts[0].src).toBe('sidebar.hmr-bundle.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'sidebar.hmr-bundle.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - // expect(data).toBeDefined() - done() - }) - }) - }) - }) -}) diff --git a/packages/html-plugin/spec/support/clearDistFolder.js b/packages/html-plugin/spec/support/clearDistFolder.js deleted file mode 100644 index 23f9fe45..00000000 --- a/packages/html-plugin/spec/support/clearDistFolder.js +++ /dev/null @@ -1,15 +0,0 @@ -const fs = require('fs') -const path = require('path') -const rm = require('rimraf') - -fs.readdir(path.join(__dirname, '..', 'fixtures'), (err, files) => { - files.forEach((file) => { - const filePath = path.resolve('fixtures', file, 'dist') - - if (!fs.existsSync(filePath)) return - - console.log(`Cleaning up ${filePath} before tests start`) - - rm.sync(filePath) - }) -}) diff --git a/packages/html-plugin/spec/support/jasmine.json b/packages/html-plugin/spec/support/jasmine.json deleted file mode 100755 index bcdfdf7c..00000000 --- a/packages/html-plugin/spec/support/jasmine.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "spec_dir": "spec", - "spec_files": ["**/*.spec.js"], - "stopSpecOnExpectationFailure": false, - "random": true -} diff --git a/packages/html-plugin/spec/with-static-dir.spec.js b/packages/html-plugin/spec/with-static-dir.spec.js deleted file mode 100644 index 4269a54f..00000000 --- a/packages/html-plugin/spec/with-static-dir.spec.js +++ /dev/null @@ -1,114 +0,0 @@ -/* eslint-env jasmine */ -const fs = require('fs') -const path = require('path') -const webpack = require('webpack') -const jsdom = require('jsdom') - -const {JSDOM} = jsdom - -const demoWebpackConfig = (demoDir) => - require(path.join(__dirname, 'fixtures', demoDir, 'webpack.config.js')) - -describe('HtmlPlugin', function () { - describe('using static dir', function () { - const webpackConfig = demoWebpackConfig('static-dir-html') - - beforeAll(function (done) { - webpack(webpackConfig, function (err) { - expect(err).toBeFalsy() - done() - }) - }) - - it('outputs html file to destination folder with css paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const stylesheets = [...document.querySelectorAll('link')] - - expect(stylesheets[0].href).toBe('sidebar.sidebar.css') - - done() - }) - }) - - it('outputs css file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.css' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - - describe('without hot-module-replacement', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - expect(scripts[0].src).toBe('sidebar.sidebar1.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar1.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - expect(data).toBeDefined() - done() - }) - }) - }) - - describe('with hot-module-replacement (TODO)', function () { - it('outputs html file to destination folder with js paths resolved', function (done) { - const htmlFile = path.resolve( - webpackConfig.output.path, - 'sidebar.sidebar.html' - ) - - fs.readFile(htmlFile, {encoding: 'utf8'}, function (err, data) { - const {document} = new JSDOM(data).window - - const scripts = [...document.querySelectorAll('script')] - - // expect(scripts[0].src).toBe('sidebar.hmr-bundle.js') - - done() - }) - }) - - it('outputs js file to destination folder', function (done) { - const jsFile = path.resolve( - webpackConfig.output.path, - 'sidebar.hmr-bundle.js' - ) - - fs.readFile(jsFile, {encoding: 'utf8'}, function (err, data) { - // expect(data).toBeDefined() - done() - }) - }) - }) - }) -}) diff --git a/packages/html-plugin/steps/AddAssetsToCompilation.ts b/packages/html-plugin/steps/AddAssetsToCompilation.ts new file mode 100644 index 00000000..ac6dc8ee --- /dev/null +++ b/packages/html-plugin/steps/AddAssetsToCompilation.ts @@ -0,0 +1,97 @@ +import path from 'path' +import fs from 'fs' +import webpack, {sources, Compilation} from 'webpack' + +import {type HtmlPluginInterface} from '../types' + +// Manifest fields +import manifestFields from 'browser-extension-manifest-fields' + +import {getFilepath} from '../helpers/getResourceName' + +import getAssetsFromHtml from '../lib/getAssetsFromHtml' +import {fileError} from '../helpers/messages' +import shouldEmitFile from '../helpers/shouldEmitFile' + +export default class AddAssetsToCompilation { + public readonly manifestPath: string + public readonly exclude?: string[] + + constructor(options: HtmlPluginInterface) { + this.manifestPath = options.manifestPath + this.exclude = options.exclude || [] + } + + private fileNotFoundWarn( + compilation: webpack.Compilation, + htmlFilePath: string, + filePath: string + ) { + const errorMessage = fileError(htmlFilePath, filePath) + + compilation.warnings.push(new webpack.WebpackError(errorMessage)) + } + + public apply(compiler: webpack.Compiler): void { + compiler.hooks.thisCompilation.tap( + 'AddAssetsToCompilationPlugin', + (compilation) => { + compilation.hooks.processAssets.tap( + { + name: 'AddAssetsToCompilationPlugin', + // Derive new assets from the existing assets. + stage: Compilation.PROCESS_ASSETS_STAGE_DERIVED + }, + (assets) => { + if (compilation.errors.length > 0) return + + const manifestSource = assets['manifest.json'] + ? JSON.parse(assets['manifest.json'].source().toString()) + : require(this.manifestPath) + + const htmlFields = manifestFields( + this.manifestPath, + manifestSource + ).html + + for (const field of Object.entries(htmlFields)) { + const [feature, resource] = field + + // Resources from the manifest lib can come as undefined. + if (resource?.html) { + if (!fs.existsSync(resource?.html)) return + + const htmlAssets = getAssetsFromHtml(resource?.html) + const fileAssets = htmlAssets?.static || [] + + for (const asset of [...fileAssets]) { + // Handle missing static assets. This is not covered + // by HandleCommonErrorsPlugin because static assets + // are not entrypoints. + if (!fs.existsSync(asset)) { + this.fileNotFoundWarn(compilation, resource?.html, asset) + return + } + + const source = fs.readFileSync(asset) + const rawSource = new sources.RawSource(source) + const context = compiler.options.context || '' + + if (shouldEmitFile(context, asset, this.exclude)) { + // check if asset is emitted + if (!compilation.getAsset(asset)) { + compilation.emitAsset( + getFilepath(feature, asset), + rawSource + ) + } + } + } + } + } + } + ) + } + ) + } +} diff --git a/packages/html-plugin/steps/AddHtmlFileToCompilation.ts b/packages/html-plugin/steps/AddHtmlFileToCompilation.ts new file mode 100644 index 00000000..71245a5c --- /dev/null +++ b/packages/html-plugin/steps/AddHtmlFileToCompilation.ts @@ -0,0 +1,106 @@ +import path from 'path' +import fs from 'fs' +import webpack, {sources, Compilation} from 'webpack' + +import {type HtmlPluginInterface} from '../types' + +// Manifest fields +import manifestFields from 'browser-extension-manifest-fields' + +import {getFilepath} from '../helpers/getResourceName' +import shouldEmitFile from '../helpers/shouldEmitFile' +import patchHtml from '../lib/patchHtml' +import {manifestFieldError} from '../helpers/messages' + +export default class AddHtmlFileToCompilation { + public readonly manifestPath: string + public readonly exclude?: string[] + + constructor(options: HtmlPluginInterface) { + this.manifestPath = options.manifestPath + this.exclude = options.exclude || [] + } + + private manifestNotFoundError(compilation: webpack.Compilation) { + const errorMessage = `A manifest file is required for this plugin to run.` + + compilation.errors.push( + new webpack.WebpackError(`[manifest.json]: ${errorMessage}`) + ) + } + + private entryNotFoundWarn( + compilation: webpack.Compilation, + feature: string, + htmlFilePath: string + ) { + const errorMessage = manifestFieldError(feature, htmlFilePath) + + compilation.warnings.push( + new webpack.WebpackError(`[manifest.json]: ${errorMessage}`) + ) + } + + public apply(compiler: webpack.Compiler): void { + compiler.hooks.thisCompilation.tap( + 'BrowserExtensionAddHtmlFileToCompilation', + (compilation) => { + compilation.hooks.processAssets.tap( + { + name: 'BrowserExtensionAddHtmlFileToCompilation4', + // Add additional assets to the compilation. + stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONS + }, + (assets) => { + // Do not emit if manifest doesn't exist. + if (!fs.existsSync(this.manifestPath)) { + this.manifestNotFoundError(compilation) + return + } + + if (compilation.errors.length > 0) return + + const manifestSource = assets['manifest.json'] + ? JSON.parse(assets['manifest.json'].source().toString()) + : require(this.manifestPath) + + const htmlFields = manifestFields( + this.manifestPath, + manifestSource + ).html + + for (const field of Object.entries(htmlFields)) { + const [feature, resource] = field + + // Resources from the manifest lib can come as undefined. + if (resource?.html) { + // Do not output if file doesn't exist. + // If the user updates the path, this script runs again + // and output the file accordingly. + if (!fs.existsSync(resource?.html)) { + this.entryNotFoundWarn(compilation, feature, resource?.html) + return + } + + const updatedHtml = patchHtml( + feature, + resource?.html, + this.exclude! + ) + + const assetName = getFilepath(feature, resource?.html) + + const rawSource = new sources.RawSource(updatedHtml) + const context = compiler.options.context || '' + + if (shouldEmitFile(context, resource?.html, this.exclude)) { + compilation.emitAsset(assetName, rawSource) + } + } + } + } + ) + } + ) + } +} diff --git a/packages/html-plugin/steps/AddScriptsAndStyles.ts b/packages/html-plugin/steps/AddScriptsAndStyles.ts new file mode 100644 index 00000000..a3b80baf --- /dev/null +++ b/packages/html-plugin/steps/AddScriptsAndStyles.ts @@ -0,0 +1,65 @@ +import path from 'path' +import fs from 'fs' +import webpack from 'webpack' + +import {type HtmlPluginInterface} from '../types' + +// Manifest fields +import manifestFields from 'browser-extension-manifest-fields' + +import {getFilepath} from '../helpers/getResourceName' +import getAssetsFromHtml from '../lib/getAssetsFromHtml' +import shouldEmitFile from '../helpers/shouldEmitFile' +import shouldExclude from '../helpers/shouldExclude' + +export default class AddScriptsAndStyles { + public readonly manifestPath: string + public readonly exclude?: string[] + + constructor(options: HtmlPluginInterface) { + this.manifestPath = options.manifestPath + this.exclude = options.exclude || [] + } + + public apply(compiler: webpack.Compiler): void { + const htmlFields = manifestFields(this.manifestPath).html + + for (const field of Object.entries(htmlFields)) { + const [feature, resource] = field + + // Resources from the manifest lib can come as undefined. + if (resource?.html) { + if (!fs.existsSync(resource?.html)) return + + const htmlAssets = getAssetsFromHtml(resource?.html) + const jsAssets = htmlAssets?.js || [] + const cssAssets = htmlAssets?.css || [] + const fileAssets = [...jsAssets, ...cssAssets].filter( + (asset) => !shouldExclude(this.exclude || [], asset) + ) + + if (compiler.options.mode === 'development') { + const hmrScript = path.resolve(__dirname, 'html-reloader.js') + fileAssets.push(hmrScript) + } + + const fileName = getFilepath(feature, resource?.html) + const context = compiler.options.context || '' + const fileNameExt = path.extname(fileName) + const fileNameNoExt = fileName.replace(fileNameExt, '') + + if (fs.existsSync(resource?.html)) { + if (shouldEmitFile(context, resource?.html, this.exclude)) { + compiler.options.entry = { + ...compiler.options.entry, + // https://webpack.js.org/configuration/entry-context/#entry-descriptor + [fileNameNoExt]: { + import: fileAssets + } + } + } + } + } + } + } +} diff --git a/packages/html-plugin/steps/AddToFileDependencies.ts b/packages/html-plugin/steps/AddToFileDependencies.ts new file mode 100644 index 00000000..7838af58 --- /dev/null +++ b/packages/html-plugin/steps/AddToFileDependencies.ts @@ -0,0 +1,62 @@ +import fs from 'fs' +import webpack, {Compilation} from 'webpack' + +import {type HtmlPluginInterface} from '../types' + +// Manifest fields +import manifestFields from 'browser-extension-manifest-fields' + +export default class AddToFileDependencies { + public readonly manifestPath: string + public readonly exclude?: string[] + + constructor(options: HtmlPluginInterface) { + this.manifestPath = options.manifestPath + this.exclude = options.exclude || [] + } + + public apply(compiler: webpack.Compiler): void { + compiler.hooks.thisCompilation.tap( + 'BrowserExtensionAddToFileDependencies', + (compilation) => { + compilation.hooks.processAssets.tap( + { + name: 'BrowserExtensionAddToFileDependencies4', + stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONS + }, + (assets) => { + if (compilation.errors?.length) return + + const manifestSource = assets['manifest.json'] + ? JSON.parse(assets['manifest.json'].source().toString()) + : require(this.manifestPath) + + const htmlFields = manifestFields( + this.manifestPath, + manifestSource + ).html + + for (const field of Object.entries(htmlFields)) { + const [, resource] = field + + if (resource?.html) { + const fileDependencies = new Set(compilation.fileDependencies) + + if (fs.existsSync(resource?.html)) { + const fileResources = [resource?.html, ...resource?.static] + + for (const thisResource of fileResources) { + if (!fileDependencies.has(thisResource)) { + fileDependencies.add(thisResource) + compilation.fileDependencies.add(thisResource) + } + } + } + } + } + } + ) + } + ) + } +} diff --git a/packages/html-plugin/steps/EnsureHMRForScripts.ts b/packages/html-plugin/steps/EnsureHMRForScripts.ts new file mode 100644 index 00000000..cf0b086c --- /dev/null +++ b/packages/html-plugin/steps/EnsureHMRForScripts.ts @@ -0,0 +1,29 @@ +import path from 'path' +import webpack from 'webpack' + +import {type HtmlPluginInterface} from '../types' + +export default class EnsureHMRForScripts { + public readonly manifestPath: string + public readonly exclude?: string[] + + constructor(options: HtmlPluginInterface) { + this.manifestPath = options.manifestPath + this.exclude = options.exclude || [] + } + + public apply(compiler: webpack.Compiler): void { + compiler.options.module.rules.push({ + test: /\.(t|j)sx?$/, + use: [ + { + loader: path.resolve(__dirname, './loaders/InjectHmrAcceptLoader'), + options: { + manifestPath: this.manifestPath, + exclude: this.exclude + } + } + ] + }) + } +} diff --git a/packages/html-plugin/steps/HandleCommonErrors.ts b/packages/html-plugin/steps/HandleCommonErrors.ts new file mode 100644 index 00000000..9a745c63 --- /dev/null +++ b/packages/html-plugin/steps/HandleCommonErrors.ts @@ -0,0 +1,77 @@ +import fs from 'fs' +import webpack from 'webpack' +import manifestFields from 'browser-extension-manifest-fields' + +import {fileError} from '../helpers/messages' +import getAssetsFromHtml from '../lib/getAssetsFromHtml' +import {HtmlPluginInterface} from '../types' + +export function handleCantResolveError( + manifestPath: string, + error: webpack.WebpackError +) { + const cantResolveMsg = "Module not found: Error: Can't resolve " + const customError = error.message.replace(cantResolveMsg, '') + const wrongFilename = customError.split("'")[1] + + if (error.message.includes(cantResolveMsg)) { + const htmlFields = manifestFields(manifestPath).html + + for (const field of Object.entries(htmlFields)) { + const [feature, resource] = field + + // Resources from the manifest lib can come as undefined. + if (resource?.html) { + if (!fs.existsSync(resource?.html)) return null + + const htmlAssets = getAssetsFromHtml(resource?.html) + const jsAssets = htmlAssets?.js || [] + const cssAssets = htmlAssets?.css || [] + + if ( + jsAssets.includes(wrongFilename) || + cssAssets.includes(wrongFilename) + ) { + const errorMsg = fileError(resource?.html, wrongFilename) + return new webpack.WebpackError(errorMsg) + } + } + } + } + + return null +} + +export default class CommonErrorsPlugin { + public readonly manifestPath: string + + constructor(options: HtmlPluginInterface) { + this.manifestPath = options.manifestPath + } + + apply(compiler: webpack.Compiler) { + compiler.hooks.compilation.tap( + 'HandleCommonErrorsPlugin', + (compilation) => { + compilation.hooks.afterSeal.tapPromise( + 'HandleCommonErrorsPlugin', + async () => { + compilation.errors.forEach((error, index) => { + // Handle "Module not found" errors. + // This is needed because we can't recompile entrypoints at runtime. + // This does not cover static assets because they are not entrypoints. + // For that we use the AddAssetsToCompilationPlugin. + const cantResolveError = handleCantResolveError( + this.manifestPath, + error + ) + if (cantResolveError) { + compilation.errors[index] = cantResolveError + } + }) + } + ) + } + ) + } +} diff --git a/packages/html-plugin/steps/ThrowIfRecompileIsNeeded.ts b/packages/html-plugin/steps/ThrowIfRecompileIsNeeded.ts new file mode 100644 index 00000000..560b90ca --- /dev/null +++ b/packages/html-plugin/steps/ThrowIfRecompileIsNeeded.ts @@ -0,0 +1,130 @@ +import path from 'path' +import webpack from 'webpack' +import manifestFields from 'browser-extension-manifest-fields' + +import {type HtmlPluginInterface} from '../types' +import getAssetsFromHtml from '../lib/getAssetsFromHtml' +import {serverRestartRequired} from '../helpers/messages' + +export default class ThrowIfRecompileIsNeeded { + public readonly manifestPath: string + public readonly exclude?: string[] + private initialHtmlAssets: Record = {} + + constructor(options: HtmlPluginInterface) { + this.manifestPath = options.manifestPath + this.exclude = options.exclude || [] + } + + private hasEntriesChanged( + updatedEntries: string[] | undefined, + prevEntries: string[] | undefined + ): boolean { + if (!prevEntries || !updatedEntries) return true + + if (updatedEntries.length !== prevEntries.length) return true + + for (let i = 0; i < updatedEntries.length; i++) { + if (updatedEntries[i] !== prevEntries[i]) { + return true + } + } + return false + } + + private whichEntryChanged( + prevEntries: string[] | undefined, + updatedEntries: string[] | undefined + ): {prevFile: string; updatedFile: string} | null { + if (!prevEntries || !updatedEntries) { + return null + } + + // Check for added or removed entries in updatedEntries + if (updatedEntries.length > prevEntries.length) { + const newEntries = updatedEntries.filter( + (entry) => !prevEntries.includes(entry) + ) + + return { + updatedFile: newEntries.join(', '), + prevFile: prevEntries.join(', ') + } + } + + // Compare entries when lengths are the same + for (let i = 0; i < updatedEntries.length; i++) { + if (updatedEntries[i] !== prevEntries[i]) { + return {prevFile: prevEntries[i], updatedFile: updatedEntries[i]} + } + } + + return null + } + + private storeInitialHtmlAssets(htmlFields: Record) { + Object.entries(htmlFields).forEach(([key, resource]) => { + const htmlFile = resource?.html + if (htmlFile) { + this.initialHtmlAssets[htmlFile] = { + js: getAssetsFromHtml(htmlFile)?.js || [], + css: getAssetsFromHtml(htmlFile)?.css || [] + } + } + }) + } + + public apply(compiler: webpack.Compiler): void { + const manifest = require(this.manifestPath) + const htmlFields = manifestFields(this.manifestPath, manifest).html + this.storeInitialHtmlAssets(htmlFields) + + compiler.hooks.make.tapAsync( + 'RunChromeExtensionPlugin', + (compilation, done) => { + const files = compiler.modifiedFiles || new Set() + const changedFile = Array.from(files)[0] + + if (changedFile && this.initialHtmlAssets[changedFile]) { + const updatedJsEntries = getAssetsFromHtml(changedFile)?.js || [] + const updatedCssEntries = getAssetsFromHtml(changedFile)?.css || [] + + const {js: initialJsEntries, css: initialCssEntries} = + this.initialHtmlAssets[changedFile] + + if (this.hasEntriesChanged(updatedJsEntries, initialJsEntries)) { + const projectDir = path.dirname(this.manifestPath) + const contentChanged = this.whichEntryChanged( + initialJsEntries, + updatedJsEntries + ) + + const errorMessage = serverRestartRequired( + projectDir, + changedFile + // contentChanged + ) + compilation.errors.push(new webpack.WebpackError(errorMessage)) + } + + if (this.hasEntriesChanged(updatedCssEntries, initialCssEntries)) { + const projectDir = path.dirname(this.manifestPath) + const contentChanged = this.whichEntryChanged( + initialCssEntries, + updatedCssEntries + ) + + const errorMessage = serverRestartRequired( + projectDir, + changedFile + // contentChanged + ) + compilation.errors.push(new webpack.WebpackError(errorMessage)) + } + } + + done() + } + ) + } +} diff --git a/packages/html-plugin/types.ts b/packages/html-plugin/types.ts index ad1f91e8..424533c1 100644 --- a/packages/html-plugin/types.ts +++ b/packages/html-plugin/types.ts @@ -1,7 +1,7 @@ export interface HtmlPluginInterface { manifestPath: string + pages?: string exclude?: string[] - experimentalHMREnabled?: boolean } export interface OutputPath { diff --git a/packages/icons-plugin/module.ts b/packages/icons-plugin/module.ts index 3d41ea95..cc7e0607 100644 --- a/packages/icons-plugin/module.ts +++ b/packages/icons-plugin/module.ts @@ -67,16 +67,14 @@ export default class ScriptsPlugin { // Do not emit if manifest doesn't exist. if (!fs.existsSync(this.manifestPath)) { this.manifestNotFoundError(compilation) - return } if (compilation.errors.length > 0) return - const manifestSource = assets['manifest.json'] - ? assets['manifest.json'].source() + const manifest = assets['manifest.json'] + ? JSON.parse(assets['manifest.json'].source().toString()) : require(this.manifestPath) - const manifest = JSON.parse(manifestSource.toString()) const iconFields = manifestFields(this.manifestPath, manifest).icons for (const field of Object.entries(iconFields)) { @@ -128,11 +126,10 @@ export default class ScriptsPlugin { (assets) => { if (compilation.errors?.length) return - const manifestSource = compilation.getAsset('manifest.json') - ? compilation.getAsset('manifest.json')?.source.source() + const manifest = assets['manifest.json'] + ? JSON.parse(assets['manifest.json'].source().toString()) : require(this.manifestPath) - const manifest = JSON.parse(manifestSource.toString()) const iconFields = manifestFields(this.manifestPath, manifest).icons for (const field of Object.entries(iconFields)) { diff --git a/packages/json-plugin/helpers/getResourceName.ts b/packages/json-plugin/helpers/getResourceName.ts index 35fa3c4f..0a6185a3 100644 --- a/packages/json-plugin/helpers/getResourceName.ts +++ b/packages/json-plugin/helpers/getResourceName.ts @@ -29,4 +29,3 @@ export function getFileOutputPath(feature: string, filePath: string) { return `${feature}/${entryName}${extname}` } - diff --git a/packages/json-plugin/module.ts b/packages/json-plugin/module.ts index 3bb2cb47..783a80af 100644 --- a/packages/json-plugin/module.ts +++ b/packages/json-plugin/module.ts @@ -70,11 +70,10 @@ export default class JsonPlugin { if (compilation.errors.length > 0) return - const manifestSource = assets['manifest.json'] - ? assets['manifest.json'].source() + const manifest = assets['manifest.json'] + ? JSON.parse(assets['manifest.json'].source().toString()) : require(this.manifestPath) - const manifest = JSON.parse(manifestSource.toString()) const jsonFields = manifestFields(this.manifestPath, manifest).json for (const field of Object.entries(jsonFields)) { @@ -126,11 +125,9 @@ export default class JsonPlugin { (assets) => { if (compilation.errors?.length) return - const manifestSource = compilation.getAsset('manifest.json') - ? compilation.getAsset('manifest.json')?.source.source() + const manifest = assets['manifest.json'] + ? JSON.parse(assets['manifest.json'].source().toString()) : require(this.manifestPath) - - const manifest = JSON.parse(manifestSource.toString()) const jsonFields = manifestFields(this.manifestPath, manifest).json for (const field of Object.entries(jsonFields)) { diff --git a/packages/locales-plugin/module.ts b/packages/locales-plugin/module.ts index 1d210025..541bb8dd 100644 --- a/packages/locales-plugin/module.ts +++ b/packages/locales-plugin/module.ts @@ -78,12 +78,10 @@ export default class LocalesPlugin { if (compilation.errors.length > 0) return - const manifestSource = assets['manifest.json'] - ? assets['manifest.json'].source() + const manifest = assets['manifest.json'] + ? JSON.parse(assets['manifest.json'].source().toString()) : require(this.manifestPath) - const manifest = JSON.parse(manifestSource.toString()) - const localesFields = manifestFields( this.manifestPath, manifest @@ -136,11 +134,9 @@ export default class LocalesPlugin { (assets) => { if (compilation.errors?.length) return - const manifestSource = compilation.getAsset('manifest.json') - ? compilation.getAsset('manifest.json')?.source.source() + const manifest = assets['manifest.json'] + ? JSON.parse(assets['manifest.json'].source().toString()) : require(this.manifestPath) - - const manifest = JSON.parse(manifestSource.toString()) const localesFields = manifestFields( this.manifestPath, manifest diff --git a/packages/manifest-compat-plugin/module.ts b/packages/manifest-compat-plugin/module.ts new file mode 100644 index 00000000..a871ddb1 --- /dev/null +++ b/packages/manifest-compat-plugin/module.ts @@ -0,0 +1,60 @@ +import Ajv from 'ajv' +import fs from 'fs' +import path from 'path' +import {Compiler, WebpackError} from 'webpack' +import v2Schema from 'chrome-extension-manifest-json-schema/manifest/manifest.schema.v2.json' +import v3Schema from 'chrome-extension-manifest-json-schema/manifest/manifest.schema.v3.json' +import addCustomFormats from './src/helpers/customValidators' + +interface ManifestCompatPluginOptions { + manifestPath: string +} + +export default class ManifestCompatPlugin { + private options: ManifestCompatPluginOptions + + constructor(options: ManifestCompatPluginOptions) { + this.options = options + } + + apply(compiler: Compiler) { + compiler.hooks.emit.tapAsync( + 'ValidateManifestPlugin', + (compilation, done) => { + const manifestPath = path.resolve( + compiler.options.context!, + this.options.manifestPath + ) + const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8')) + + const ajv = new Ajv() + addCustomFormats(ajv) + + let schema + if (manifest.manifest_version === 2) { + schema = v2Schema + } else if (manifest.manifest_version === 3) { + schema = v3Schema + } else { + compilation.warnings.push( + new WebpackError('Unsupported manifest version') + ) + return done() + } + + const validate = ajv.compile(schema) + const valid = validate(manifest) + + if (!valid) { + compilation.warnings.push( + new WebpackError( + 'Manifest validation error: ' + ajv.errorsText(validate.errors) + ) + ) + } + + done() + } + ) + } +} diff --git a/packages/manifest-compat-plugin/package.json b/packages/manifest-compat-plugin/package.json new file mode 100644 index 00000000..9975c974 --- /dev/null +++ b/packages/manifest-compat-plugin/package.json @@ -0,0 +1,63 @@ +{ + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/cezaraugusto/webpack-browser-extension-manifest-compat-plugin.git" + }, + "engines": { + "node": ">=16" + }, + "name": "webpack-browser-extension-manifest-compat-plugin", + "version": "0.0.0", + "description": "webpack plugin to handle browser extensions incompatibilities", + "main": "./dist/module.js", + "types": "./dist/module.d.ts", + "author": { + "name": "Cezar Augusto", + "email": "boss@cezaraugusto.net", + "url": "https://cezaraugusto.com" + }, + "scripts": { + "watch": "yarn compile --watch", + "compile": "tsup-node ./module.ts --format cjs --dts --target=node16 --minify", + "lint": "eslint \"./**/*.ts*\"", + "test": "echo \"Note: no test specified\" && exit 0" + }, + "files": [ + "manifest", + "generate", + "module.js" + ], + "keywords": [ + "webpack", + "plugin", + "browser", + "web", + "extension", + "web-ext", + "manifest", + "manifest.json", + "parse", + "parser", + "compat", + "validate" + ], + "peerDependencies": { + "webpack": "^5.0.0" + }, + "devDependencies": { + "eslint": "^7.32.0", + "eslint-config-extension-create": "*", + "jasmine": "^4.1.0", + "rimraf": "^3.0.2", + "tsconfig": "*", + "tsup": "^7.1.0", + "webpack": "^5.9.0", + "webpack-cli": "^4.2.0" + }, + "dependencies": { + "ajv": "^8.12.0", + "browser-extension-manifest-fields": "*", + "chrome-extension-manifest-json-schema": "^0.2.0" + } +} diff --git a/packages/manifest-compat-plugin/src/helpers/customValidators.ts b/packages/manifest-compat-plugin/src/helpers/customValidators.ts new file mode 100644 index 00000000..c9a6b358 --- /dev/null +++ b/packages/manifest-compat-plugin/src/helpers/customValidators.ts @@ -0,0 +1,79 @@ +import Ajv from 'ajv' + +export function addCustomFormats(ajv: Ajv) { + // Permission format + ajv.addFormat('permission', { + type: 'string', + validate: (data: any) => typeof data === 'string' && data.trim() !== '' + }) + + // Content-security-policy format + ajv.addFormat('content-security-policy', { + type: 'string', + validate: (data: any) => typeof data === 'string' + }) + + // Glob pattern format + ajv.addFormat('glob-pattern', { + type: 'string', + validate: (data: any) => { + // Basic glob pattern validation + return typeof data === 'string' && /[\*\?\[\]]/.test(data) + } + }) + + // Match pattern format + // https://developer.chrome.com/docs/extensions/develop/concepts/match-patterns + ajv.addFormat('match-pattern', { + type: 'string', + validate: (data: any) => { + // Special cases + // * "" - Matches any URL that starts with a permitted scheme, + // including any pattern listed under valid patterns. Because it affects + // all hosts, Chrome web store reviews for extensions that use it may take longer. + // * "file:///" Allows your extension to run on local files. This pattern requires + // the user to manually grant access. Note that this case requires three slashes, not two. + // * Localhost URLs and IP addresses + // To match any localhost port during development, use http://localhost/*. + // For IP addresses, specify the address plus a wildcard in the path, as in + // http://127.0.0.1/*. You can also use http://*:*/* to match localhost, IP addresses, + // and any port. + // * Top Level domain match patterns + // Chrome doesn't support match patterns for top Level domains (TLD). Specify your + // match patterns within individual TLDs, as in http://google.es/* and + // http://google.fr/*. + if (data === '') return true + if (data === 'file:///') return true + if (data.startsWith('http://localhost')) return true + if (data.startsWith('http:// ')) return true + if (data.startsWith('http://*:*/*')) return true + + // Basic URL pattern validation + return ( + typeof data === 'string' && /^(\*|http|https|file|ftp):\/\//.test(data) + ) + } + }) + + // URI format + ajv.addFormat('uri', { + type: 'string', + validate: (data: any) => { + // Basic URI validation + return typeof data === 'string' && /^(\w+:)?\/\//.test(data) + } + }) + + // MIME type format + ajv.addFormat('mime-type', { + type: 'string', + validate: (data: any) => { + // Basic MIME type validation + return typeof data === 'string' && /^[a-z]+\/[a-z0-9\-\+]+$/.test(data) + } + }) + + // Add more custom formats as needed... +} + +export default addCustomFormats diff --git a/packages/manifest-compat-plugin/tsconfig.json b/packages/manifest-compat-plugin/tsconfig.json new file mode 100644 index 00000000..405d5a4c --- /dev/null +++ b/packages/manifest-compat-plugin/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../../packages/tsconfig/base.json", + "include": ["."], + "exclude": ["dist", "node_modules"] +} diff --git a/packages/manifest-plugin/.editorconfig b/packages/manifest-plugin/.editorconfig deleted file mode 100644 index c3dcfccd..00000000 --- a/packages/manifest-plugin/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -indent_style = space -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[{*.json,*.yml}] -indent_style = space -indent_size = 2 diff --git a/packages/manifest-plugin/.gitignore b/packages/manifest-plugin/.gitignore deleted file mode 100644 index 073cc069..00000000 --- a/packages/manifest-plugin/.gitignore +++ /dev/null @@ -1,235 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.*# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -todo.md -spec/ -.github diff --git a/packages/manifest-plugin/LICENSE b/packages/manifest-plugin/LICENSE deleted file mode 100644 index 52420dc4..00000000 --- a/packages/manifest-plugin/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Cezar Augusto (https://cezaraugusto.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/manifest-plugin/helpers/getOutput.ts b/packages/manifest-plugin/helpers/getOutput.ts deleted file mode 100644 index 396b971c..00000000 --- a/packages/manifest-plugin/helpers/getOutput.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type {OutputPath} from '../types' - -export default function getOutput(entries?: OutputPath) { - return { - background: - (entries != null && entries.background) || '[feature].[name].[ext]', - content_scripts: - (entries != null && entries.contentScripts) || '[feature].[name].[ext]', - action: (entries != null && entries.action) || '[feature].[name].[ext]', - chrome_url_overrides: - (entries != null && entries.newtab) || '[feature].[name].[ext]', - devtools_page: - (entries != null && entries.devtools) || '[feature].[name].[ext]', - options_ui: - (entries != null && entries.options) || '[feature].[name].[ext]', - sandbox: (entries != null && entries.sandbox) || '[feature].[name].[ext]', - sidebar_action: - (entries != null && entries.sidebar) || '[feature].[name].[ext]', - chrome_settings_overrides: - (entries != null && entries.settings) || '[feature].[name].[ext]', - user_scripts: - (entries != null && entries.userScripts) || '[feature].[name].[ext]', - web_accessible_resources: - (entries != null && entries.webResources) || '[feature]/[name].[ext]', - icons: (entries != null && entries.action) || '[feature]/[name].[ext]', - action_icon: - (entries != null && entries.action) || '[feature]/[name].[ext]', - settings_icon: - (entries != null && entries.settings) || '[feature]/[name].[ext]', - sidebar_icon: - (entries != null && entries.sidebar) || '[feature]/[name].[ext]', - declarative_net_request: - (entries != null && entries.declarativeNetRequest) || - '[feature].[name].[ext]', - storage: (entries != null && entries.storage) || '[feature].[name].[ext]', - side_panel: - (entries != null && entries.sidePanel) || '[feature].[name].[ext]' - } -} diff --git a/packages/manifest-plugin/manifest-overrides/common/content_scripts.ts b/packages/manifest-plugin/manifest-overrides/common/content_scripts.ts deleted file mode 100644 index 35208f49..00000000 --- a/packages/manifest-plugin/manifest-overrides/common/content_scripts.ts +++ /dev/null @@ -1,29 +0,0 @@ -import {type ManifestData} from '../types' -import getFilename from '../../helpers/getFilename' - -export default function contentScripts( - manifest: ManifestData, - exclude: string[] -) { - return ( - manifest.content_scripts && { - content_scripts: manifest.content_scripts.map( - (contentObj: {js: string[]; css: string[]}, index: number) => { - return { - ...contentObj, - js: - contentObj.js && - contentObj.js.map((js: string) => { - return getFilename(`content_scripts-${index}`, js, exclude) - }), - css: - contentObj.css && - contentObj.css.map((css: string) => { - return getFilename(`content_scripts-${index}`, css, exclude) - }) - } - } - ) - } - ) -} diff --git a/packages/manifest-plugin/module.ts b/packages/manifest-plugin/module.ts index 7ceb346c..b444c309 100644 --- a/packages/manifest-plugin/module.ts +++ b/packages/manifest-plugin/module.ts @@ -1,12 +1,13 @@ import type webpack from 'webpack' -import {type ManifestPluginInterface} from './types' +import {type ManifestPluginInterface} from './src/types' // Manifest plugins -import EmitManifestPlugin from './plugins/EmitManifestPlugin' -import MinimumRequirementsPlugin from './plugins/MinimumRequirementsPlugin' -import UpdateManifestPlugin from './plugins/UpdateManifestPlugin' -import AddDependenciesPlugin from './plugins/AddDependenciesPlugin' -// import WatchRecompilePlugin from './plugins/WatchRecompilePlugin' +import EmitManifestPlugin from './src/plugins/EmitManifestPlugin' +import MinimumRequirementsPlugin from './src/plugins/MinimumRequirementsPlugin' +import UpdateManifestPlugin from './src/plugins/UpdateManifestPlugin' +import AddDependenciesPlugin from './src/plugins/AddDependenciesPlugin' +import CheckManifestFilesPlugin from './src/plugins/CheckManifestFilesPlugin' +import ThrowIfRecompileIsNeeded from './src/plugins/ThrowIfRecompileIsNeeded' export default class ManifestPlugin { public readonly browser?: string @@ -20,6 +21,10 @@ export default class ManifestPlugin { } public apply(compiler: webpack.Compiler) { + // Before attempting to do anything, check + // if manifest meets the minimum requirements. + new MinimumRequirementsPlugin().apply(compiler) + // Add the manifest to the assets bundle. // This is important so other plugins can // get it via the compilation.assets object, @@ -28,9 +33,9 @@ export default class ManifestPlugin { manifestPath: this.manifestPath }).apply(compiler) - // Before attempting to do anything, check - // if manifest meets the minimum requirements. - new MinimumRequirementsPlugin().apply(compiler) + new CheckManifestFilesPlugin({ + manifestPath: this.manifestPath + }).apply(compiler) // Override the manifest with the updated version. new UpdateManifestPlugin({ @@ -41,5 +46,13 @@ export default class ManifestPlugin { // Ensure this manifest is stored as file dependency // so webpack can watch and trigger changes. new AddDependenciesPlugin([this.manifestPath]).apply(compiler) + + // Some files in manifest are used as entrypoints. Since + // we can't recompile entrypoints at runtime, we need to + // throw an error if any of those files change. + new ThrowIfRecompileIsNeeded({ + manifestPath: this.manifestPath, + exclude: this.exclude + }).apply(compiler) } } diff --git a/packages/manifest-plugin/package.json b/packages/manifest-plugin/package.json index f215c8e8..60b225e1 100644 --- a/packages/manifest-plugin/package.json +++ b/packages/manifest-plugin/package.json @@ -52,7 +52,10 @@ "webpack-cli": "^4.2.0" }, "dependencies": { + "ajv": "^8.12.0", "browser-extension-manifest-fields": "*", - "minimatch": "^9.0.3" + "chrome-extension-manifest-json-schema": "^0.2.0", + "minimatch": "^9.0.3", + "webpack-manifest-plugin": "^5.0.0" } } diff --git a/packages/manifest-plugin/plugins/EmitManifestPlugin.ts b/packages/manifest-plugin/plugins/EmitManifestPlugin.ts deleted file mode 100644 index 9b90e6d3..00000000 --- a/packages/manifest-plugin/plugins/EmitManifestPlugin.ts +++ /dev/null @@ -1,59 +0,0 @@ -import fs from 'fs' -import webpack, {sources} from 'webpack' - -interface Options { - manifestPath: string -} - -export default class EmitManifestPlugin { - private readonly options: Options - - constructor(options: Options) { - this.options = options - } - - private manifestNotFoundError(compilation: webpack.Compilation) { - const hintMessage = `Ensure you have a manifest.json file at the root direcotry of your project.` - const errorMessage = `A manifest file is required. ${hintMessage}` - compilation.errors.push( - new webpack.WebpackError(`[manifest.json]: ${errorMessage}`) - ) - } - - private manifestInvalidError(compilation: webpack.Compilation, error: any) { - const hintMessage = `Update your manifest file and run the program again.` - const errorMessage = `${error}. ${hintMessage}` - compilation.errors.push( - new webpack.WebpackError(`[manifest.json]: ${errorMessage}`) - ) - } - - apply(compiler: webpack.Compiler): void { - compiler.hooks.thisCompilation.tap('BrowserExtensionManifestPlugin', (compilation) => { - // Fired when the compilation stops accepting new modules. - compilation.hooks.seal.tap('BrowserExtensionManifestPlugin', () => { - // Do not emit manifest if it doesn't exist. - if (!fs.existsSync(this.options.manifestPath)) { - this.manifestNotFoundError(compilation) - return - } - - // Do not emit manifest if json is invalid. - try { - JSON.parse(fs.readFileSync(this.options.manifestPath).toString()) - } catch (error: any) { - this.manifestInvalidError(compilation, error) - return - } - - if (compilation.errors.length > 0) return - - const filename = 'manifest.json' - const source = fs.readFileSync(this.options.manifestPath) - const rawSource = new sources.RawSource(source) - - compilation.emitAsset(filename, rawSource) - }) - }) - } -} diff --git a/packages/manifest-plugin/helpers/getFilename.ts b/packages/manifest-plugin/src/helpers/getFilename.ts similarity index 52% rename from packages/manifest-plugin/helpers/getFilename.ts rename to packages/manifest-plugin/src/helpers/getFilename.ts index 1c4681d8..cb6932b9 100644 --- a/packages/manifest-plugin/helpers/getFilename.ts +++ b/packages/manifest-plugin/src/helpers/getFilename.ts @@ -1,8 +1,4 @@ -import { - // getAssetOutputPath, - getFilePathWithinFolder, - getFilePathSplitByDots -} from './getResourceName' +import {getFilepath} from './getResourceName' import shouldExclude from './shouldExclude' import path from 'path' @@ -12,28 +8,25 @@ export default function getFilename( exclude: string[] ) { const entryExt = path.extname(filepath) - // Do not attempt to rewrite the asset path if it's in the exclude list. + // Do not attempt to rewrite the asset path if it's in the exclude list. const shouldSkipRewrite = shouldExclude(exclude, filepath) - // TODO: After testing HMR and ensuring the custom file path - // works, consider making features as [feature]/folder.ext - // instead of [feature].folder.ext. This will prettify the output. const fileOutputpath = shouldSkipRewrite ? path.normalize(filepath) - : getFilePathSplitByDots(feature, filepath) - - const assetOutputpath = shouldSkipRewrite - ? path.normalize(filepath) - : getFilePathWithinFolder(feature, filepath) + : getFilepath(feature, filepath) if (['.js', '.jsx', '.tsx', '.ts'].includes(entryExt)) { return fileOutputpath.replace(entryExt, '.js') } + if (['.html', '.njk', '.nunjucks'].includes(entryExt)) { + return fileOutputpath.replace(entryExt, '.html') + } + if (['.css', '.scss', '.sass', '.less'].includes(entryExt)) { - return assetOutputpath.replace(entryExt, '.css') + return fileOutputpath.replace(entryExt, '.css') } - return assetOutputpath + return fileOutputpath } diff --git a/packages/manifest-plugin/helpers/getResourceName.ts b/packages/manifest-plugin/src/helpers/getResourceName.ts similarity index 54% rename from packages/manifest-plugin/helpers/getResourceName.ts rename to packages/manifest-plugin/src/helpers/getResourceName.ts index aebb755d..824a670c 100644 --- a/packages/manifest-plugin/helpers/getResourceName.ts +++ b/packages/manifest-plugin/src/helpers/getResourceName.ts @@ -22,18 +22,29 @@ function getOutputExtname(extname: string) { } } -export function getFilePathWithinFolder(feature: string, filePath: string) { +export function getFilepath(feature: string, filePath: string) { const entryExt = path.extname(filePath) const entryName = path.basename(filePath, entryExt) const extname = getOutputExtname(entryExt) - return `${feature}/${entryName}${extname}` -} + if (extname === '.html') { + return `${feature}/index${extname}` + } -export function getFilePathSplitByDots(feature: string, filePath: string) { - const entryExt = path.extname(filePath) - const entryName = path.basename(filePath, entryExt) - const extname = getOutputExtname(entryExt) + if (feature.startsWith('content_scripts')) { + const [featureName, index] = feature.split('-') + return `${featureName}/script-${index}${extname}` + } - return `${feature}.${entryName}${extname}` + if ( + extname.endsWith('.js') || + extname.endsWith('.jsx') || + extname.endsWith('.ts') || + extname.endsWith('.tsx') || + extname.endsWith('.mjs') + ) { + return `${feature}/script${extname}` + } + + return `${feature}/${entryName}${extname}` } diff --git a/packages/manifest-plugin/src/helpers/messages.ts b/packages/manifest-plugin/src/helpers/messages.ts new file mode 100644 index 00000000..29a2f46c --- /dev/null +++ b/packages/manifest-plugin/src/helpers/messages.ts @@ -0,0 +1,14 @@ +export function serverRestartRequired() { + const errorMessage = `[manifest.json] Entry Point Modification Found. + +Changing the path of non-static assets defined in manifest.json requires a server restart. To apply these changes, restart the program and try again. + ` + return errorMessage +} + +export function manifestFieldError(feature: string, htmlFilePath: string) { + const hintMessage = `Check the \`${feature}\` field in your manifest.json file and try again.` + + const errorMessage = `[manifest.json] File path \`${htmlFilePath}\` not found. ${hintMessage}` + return errorMessage +} diff --git a/packages/manifest-plugin/helpers/shouldExclude.ts b/packages/manifest-plugin/src/helpers/shouldExclude.ts similarity index 100% rename from packages/manifest-plugin/helpers/shouldExclude.ts rename to packages/manifest-plugin/src/helpers/shouldExclude.ts diff --git a/packages/manifest-plugin/manifest-overrides/common/background.ts b/packages/manifest-plugin/src/manifest-overrides/common/background.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/common/background.ts rename to packages/manifest-plugin/src/manifest-overrides/common/background.ts diff --git a/packages/manifest-plugin/manifest-overrides/common/chrome_settings_overrides.ts b/packages/manifest-plugin/src/manifest-overrides/common/chrome_settings_overrides.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/common/chrome_settings_overrides.ts rename to packages/manifest-plugin/src/manifest-overrides/common/chrome_settings_overrides.ts diff --git a/packages/manifest-plugin/manifest-overrides/common/chrome_url_overrides.ts b/packages/manifest-plugin/src/manifest-overrides/common/chrome_url_overrides.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/common/chrome_url_overrides.ts rename to packages/manifest-plugin/src/manifest-overrides/common/chrome_url_overrides.ts diff --git a/packages/manifest-plugin/src/manifest-overrides/common/content_scripts.ts b/packages/manifest-plugin/src/manifest-overrides/common/content_scripts.ts new file mode 100644 index 00000000..c3cfbc9e --- /dev/null +++ b/packages/manifest-plugin/src/manifest-overrides/common/content_scripts.ts @@ -0,0 +1,34 @@ +import {type ManifestData} from '../types' +import getFilename from '../../helpers/getFilename' + +export default function contentScripts( + manifest: ManifestData, + exclude: string[] +) { + return ( + manifest.content_scripts && { + content_scripts: manifest.content_scripts.map( + (contentObj: {js: string[]; css: string[]}, index: number) => { + // Manifest overrides work by getting the manifest.json + // before compilation and re-naming the files to be + // bundled. But in reality the compilation returns here + // all the bundled files into a single script plus the + // public files path. The hack below is to prevent having + // multiple bundles with the same name. + const contentJs = [...new Set(contentObj.js)] + const contentCss = [...new Set(contentObj.css)] + + return { + ...contentObj, + js: contentJs.map((js: string) => { + return getFilename(`content_scripts-${index}`, js, exclude) + }), + css: contentCss.map((css: string) => { + return getFilename(`content_scripts-${index}`, css, exclude) + }) + } + } + ) + } + ) +} diff --git a/packages/manifest-plugin/manifest-overrides/common/devtools_page.ts b/packages/manifest-plugin/src/manifest-overrides/common/devtools_page.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/common/devtools_page.ts rename to packages/manifest-plugin/src/manifest-overrides/common/devtools_page.ts diff --git a/packages/manifest-plugin/manifest-overrides/common/icons.ts b/packages/manifest-plugin/src/manifest-overrides/common/icons.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/common/icons.ts rename to packages/manifest-plugin/src/manifest-overrides/common/icons.ts diff --git a/packages/manifest-plugin/manifest-overrides/common/index.ts b/packages/manifest-plugin/src/manifest-overrides/common/index.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/common/index.ts rename to packages/manifest-plugin/src/manifest-overrides/common/index.ts diff --git a/packages/manifest-plugin/manifest-overrides/common/options_page.ts b/packages/manifest-plugin/src/manifest-overrides/common/options_page.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/common/options_page.ts rename to packages/manifest-plugin/src/manifest-overrides/common/options_page.ts diff --git a/packages/manifest-plugin/manifest-overrides/common/options_ui.ts b/packages/manifest-plugin/src/manifest-overrides/common/options_ui.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/common/options_ui.ts rename to packages/manifest-plugin/src/manifest-overrides/common/options_ui.ts diff --git a/packages/manifest-plugin/manifest-overrides/common/page_action.ts b/packages/manifest-plugin/src/manifest-overrides/common/page_action.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/common/page_action.ts rename to packages/manifest-plugin/src/manifest-overrides/common/page_action.ts diff --git a/packages/manifest-plugin/manifest-overrides/common/sandbox.ts b/packages/manifest-plugin/src/manifest-overrides/common/sandbox.ts similarity index 77% rename from packages/manifest-plugin/manifest-overrides/common/sandbox.ts rename to packages/manifest-plugin/src/manifest-overrides/common/sandbox.ts index 22278d27..a2d4e183 100644 --- a/packages/manifest-plugin/manifest-overrides/common/sandbox.ts +++ b/packages/manifest-plugin/src/manifest-overrides/common/sandbox.ts @@ -10,8 +10,8 @@ export default function sandbox(manifest: ManifestData, exclude: string[]) { sandbox: { ...manifest.sandbox, ...(manifest.sandbox.pages && { - pages: manifest.sandbox.pages.map((page: string) => { - return getFilename('sandbox', page, exclude) + pages: manifest.sandbox.pages.map((page: string, index: number) => { + return getFilename(`sandbox-${index}`, page, exclude) }) }) } diff --git a/packages/manifest-plugin/manifest-overrides/common/sidebar_action.ts b/packages/manifest-plugin/src/manifest-overrides/common/sidebar_action.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/common/sidebar_action.ts rename to packages/manifest-plugin/src/manifest-overrides/common/sidebar_action.ts diff --git a/packages/manifest-plugin/manifest-overrides/common/storage.ts b/packages/manifest-plugin/src/manifest-overrides/common/storage.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/common/storage.ts rename to packages/manifest-plugin/src/manifest-overrides/common/storage.ts diff --git a/packages/manifest-plugin/manifest-overrides/common/theme.ts b/packages/manifest-plugin/src/manifest-overrides/common/theme.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/common/theme.ts rename to packages/manifest-plugin/src/manifest-overrides/common/theme.ts diff --git a/packages/manifest-plugin/manifest-overrides/common/user_scripts.ts b/packages/manifest-plugin/src/manifest-overrides/common/user_scripts.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/common/user_scripts.ts rename to packages/manifest-plugin/src/manifest-overrides/common/user_scripts.ts diff --git a/packages/manifest-plugin/manifest-overrides/common/web_accessible_resources.ts b/packages/manifest-plugin/src/manifest-overrides/common/web_accessible_resources.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/common/web_accessible_resources.ts rename to packages/manifest-plugin/src/manifest-overrides/common/web_accessible_resources.ts diff --git a/packages/manifest-plugin/manifest-overrides/index.ts b/packages/manifest-plugin/src/manifest-overrides/index.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/index.ts rename to packages/manifest-plugin/src/manifest-overrides/index.ts diff --git a/packages/manifest-plugin/manifest-overrides/mv2/background.ts b/packages/manifest-plugin/src/manifest-overrides/mv2/background.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/mv2/background.ts rename to packages/manifest-plugin/src/manifest-overrides/mv2/background.ts diff --git a/packages/manifest-plugin/manifest-overrides/mv2/browser_action.ts b/packages/manifest-plugin/src/manifest-overrides/mv2/browser_action.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/mv2/browser_action.ts rename to packages/manifest-plugin/src/manifest-overrides/mv2/browser_action.ts diff --git a/packages/manifest-plugin/manifest-overrides/mv2/declarative_net_request.ts b/packages/manifest-plugin/src/manifest-overrides/mv2/declarative_net_request.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/mv2/declarative_net_request.ts rename to packages/manifest-plugin/src/manifest-overrides/mv2/declarative_net_request.ts diff --git a/packages/manifest-plugin/manifest-overrides/mv2/index.ts b/packages/manifest-plugin/src/manifest-overrides/mv2/index.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/mv2/index.ts rename to packages/manifest-plugin/src/manifest-overrides/mv2/index.ts diff --git a/packages/manifest-plugin/manifest-overrides/mv3/action.ts b/packages/manifest-plugin/src/manifest-overrides/mv3/action.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/mv3/action.ts rename to packages/manifest-plugin/src/manifest-overrides/mv3/action.ts diff --git a/packages/manifest-plugin/manifest-overrides/mv3/background.ts b/packages/manifest-plugin/src/manifest-overrides/mv3/background.ts similarity index 94% rename from packages/manifest-plugin/manifest-overrides/mv3/background.ts rename to packages/manifest-plugin/src/manifest-overrides/mv3/background.ts index 85b7f3e3..214384bf 100644 --- a/packages/manifest-plugin/manifest-overrides/mv3/background.ts +++ b/packages/manifest-plugin/src/manifest-overrides/mv3/background.ts @@ -12,7 +12,7 @@ export default function getBackground( ...manifest.background, ...(manifest.background.service_worker && { service_worker: getFilename( - 'background', + 'service_worker', manifest.background.service_worker, exclude ) diff --git a/packages/manifest-plugin/manifest-overrides/mv3/index.ts b/packages/manifest-plugin/src/manifest-overrides/mv3/index.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/mv3/index.ts rename to packages/manifest-plugin/src/manifest-overrides/mv3/index.ts diff --git a/packages/manifest-plugin/manifest-overrides/mv3/side_panel.ts b/packages/manifest-plugin/src/manifest-overrides/mv3/side_panel.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/mv3/side_panel.ts rename to packages/manifest-plugin/src/manifest-overrides/mv3/side_panel.ts diff --git a/packages/manifest-plugin/manifest-overrides/types.ts b/packages/manifest-plugin/src/manifest-overrides/types.ts similarity index 100% rename from packages/manifest-plugin/manifest-overrides/types.ts rename to packages/manifest-plugin/src/manifest-overrides/types.ts diff --git a/packages/manifest-plugin/plugins/AddDependenciesPlugin.ts b/packages/manifest-plugin/src/plugins/AddDependenciesPlugin.ts similarity index 100% rename from packages/manifest-plugin/plugins/AddDependenciesPlugin.ts rename to packages/manifest-plugin/src/plugins/AddDependenciesPlugin.ts diff --git a/packages/manifest-plugin/src/plugins/CheckManifestFilesPlugin.ts b/packages/manifest-plugin/src/plugins/CheckManifestFilesPlugin.ts new file mode 100644 index 00000000..17ddfb78 --- /dev/null +++ b/packages/manifest-plugin/src/plugins/CheckManifestFilesPlugin.ts @@ -0,0 +1,163 @@ +import fs from 'fs' +import webpack, {Compilation, type Compiler} from 'webpack' +import manifestFields from 'browser-extension-manifest-fields' +import {manifestFieldError} from '../helpers/messages' + +class CheckManifestFilesPlugin { + private readonly manifestPath: string + + constructor(options: {manifestPath: string}) { + this.manifestPath = options.manifestPath + } + + private handleHtmlErrors( + compilation: Compilation, + WebpackError: typeof webpack.WebpackError + ) { + const manifest = require(this.manifestPath) + const htmlFields = manifestFields(this.manifestPath, manifest).html + + for (const [field, value] of Object.entries(htmlFields)) { + if (value) { + const fieldError = manifestFieldError(field, value?.html) + + if (!fs.existsSync(value.html)) { + compilation.errors.push(new WebpackError(fieldError)) + } + } + } + } + + private handleIconsErrors( + compilation: Compilation, + WebpackError: typeof webpack.WebpackError + ) { + const manifest = require(this.manifestPath) + const iconsFields = manifestFields(this.manifestPath, manifest).icons + + for (const [field, value] of Object.entries(iconsFields)) { + if (value) { + if (typeof value === 'string') { + const fieldError = manifestFieldError(field, value) + + if (!fs.existsSync(value)) { + compilation.errors.push(new WebpackError(fieldError)) + } + } + } + + if (value != null && value.constructor.name === 'Object') { + const icon = value as {light?: string; dark?: string} + + if (icon.light) { + const fieldError = manifestFieldError(field, icon.light as string) + + if (!fs.existsSync(icon.dark as string)) { + compilation.errors.push(new WebpackError(fieldError)) + } + } + + if (icon.dark) { + const fieldError = manifestFieldError(field, icon.dark as string) + + if (!fs.existsSync(icon.dark as string)) { + compilation.errors.push(new WebpackError(fieldError)) + } + } + } + + if (Array.isArray(value)) { + for (const icon of value) { + const fieldError = manifestFieldError(field, icon as string) + + if (!fs.existsSync(icon as string)) { + compilation.errors.push(new WebpackError(fieldError)) + } + } + } + } + } + + private handleJsonErrors( + compilation: Compilation, + WebpackError: typeof webpack.WebpackError + ) { + const manifest = require(this.manifestPath) + const jsonFields = manifestFields(this.manifestPath, manifest).json + + for (const [field, value] of Object.entries(jsonFields)) { + if (value) { + const valueArr = Array.isArray(value) ? value : [value] + + for (const json of valueArr) { + const fieldError = manifestFieldError(field, json) + + if (!fs.existsSync(json)) { + compilation.errors.push(new WebpackError(fieldError)) + } + } + } + } + } + + private handleScriptsErrors( + compilation: Compilation, + WebpackError: typeof webpack.WebpackError + ) { + const manifest = require(this.manifestPath) + const scriptsFields = manifestFields(this.manifestPath, manifest).scripts + + for (const [field, value] of Object.entries(scriptsFields)) { + if (value) { + const valueArr = Array.isArray(value) ? value : [value] + + for (const script of valueArr) { + if (field.startsWith('content_scripts')) { + const [featureName, index] = field.split('-') + const prettyFeature = `${featureName} (index ${index})` + const fieldError = manifestFieldError(prettyFeature, script) + + if (!fs.existsSync(script)) { + compilation.errors.push(new WebpackError(fieldError)) + } + } else { + const fieldError = manifestFieldError(field, script) + + if (!fs.existsSync(script)) { + compilation.errors.push(new WebpackError(fieldError)) + } + } + } + } + } + } + + apply(compiler: Compiler) { + compiler.hooks.compilation.tap( + 'HandleCommonErrorsPlugin', + (compilation) => { + compilation.hooks.afterSeal.tapAsync( + 'HandleCommonErrorsPlugin', + (done) => { + const WebpackError = webpack.WebpackError + // Handle HTML errors. + this.handleHtmlErrors(compilation, WebpackError) + + // Handle icons errors. + this.handleIconsErrors(compilation, WebpackError) + + // Handle JSON errors. + this.handleJsonErrors(compilation, WebpackError) + + // Handle scripts errors. + this.handleScriptsErrors(compilation, WebpackError) + + done() + } + ) + } + ) + } +} + +export default CheckManifestFilesPlugin diff --git a/packages/manifest-plugin/src/plugins/EmitManifestPlugin.ts b/packages/manifest-plugin/src/plugins/EmitManifestPlugin.ts new file mode 100644 index 00000000..6830f32c --- /dev/null +++ b/packages/manifest-plugin/src/plugins/EmitManifestPlugin.ts @@ -0,0 +1,62 @@ +import fs from 'fs' +import webpack, {sources} from 'webpack' + +interface Options { + manifestPath: string +} + +export default class EmitManifestPlugin { + private readonly options: Options + + constructor(options: Options) { + this.options = options + } + + private manifestNotFoundError(compilation: webpack.Compilation) { + const hintMessage = `Ensure you have a manifest.json file at the root direcotry of your project.` + const errorMessage = `A manifest file is required. ${hintMessage}` + compilation.errors.push( + new webpack.WebpackError(`[manifest.json]: ${errorMessage}`) + ) + } + + private manifestInvalidError(compilation: webpack.Compilation, error: any) { + const hintMessage = `Update your manifest file and run the program again.` + const errorMessage = `${error}. ${hintMessage}` + compilation.errors.push( + new webpack.WebpackError(`[manifest.json]: ${errorMessage}`) + ) + } + + apply(compiler: webpack.Compiler): void { + compiler.hooks.thisCompilation.tap( + 'BrowserExtensionManifestPlugin', + (compilation) => { + // Fired when the compilation stops accepting new modules. + compilation.hooks.seal.tap('BrowserExtensionManifestPlugin', () => { + // Do not emit manifest if it doesn't exist. + if (!fs.existsSync(this.options.manifestPath)) { + this.manifestNotFoundError(compilation) + return + } + + // Do not emit manifest if json is invalid. + try { + JSON.parse(fs.readFileSync(this.options.manifestPath).toString()) + } catch (error: any) { + this.manifestInvalidError(compilation, error) + return + } + + if (compilation.errors.length > 0) return + + const filename = 'manifest.json' + const source = fs.readFileSync(this.options.manifestPath) + const rawSource = new sources.RawSource(source) + + compilation.emitAsset(filename, rawSource) + }) + } + ) + } +} diff --git a/packages/manifest-plugin/plugins/MinimumRequirementsPlugin.ts b/packages/manifest-plugin/src/plugins/MinimumRequirementsPlugin.ts similarity index 100% rename from packages/manifest-plugin/plugins/MinimumRequirementsPlugin.ts rename to packages/manifest-plugin/src/plugins/MinimumRequirementsPlugin.ts diff --git a/packages/manifest-plugin/src/plugins/ThrowIfRecompileIsNeeded.ts b/packages/manifest-plugin/src/plugins/ThrowIfRecompileIsNeeded.ts new file mode 100644 index 00000000..4651cc07 --- /dev/null +++ b/packages/manifest-plugin/src/plugins/ThrowIfRecompileIsNeeded.ts @@ -0,0 +1,77 @@ +import path from 'path' +import webpack, {Compilation} from 'webpack' +import manifestFields from 'browser-extension-manifest-fields' + +import {type ManifestPluginInterface} from '../types' +import {serverRestartRequired} from '../helpers/messages' + +export default class ThrowIfRecompileIsNeeded { + public readonly manifestPath: string + public readonly exclude?: string[] + private initialValues: string[] = [] + private manifestChanged: boolean = false + + constructor(options: ManifestPluginInterface) { + this.manifestPath = options.manifestPath + this.exclude = options.exclude || [] + this.initialValues = this.getFlattenedAssets() + } + + private getFlattenedAssets( + updatedManifest?: Record + ): string[] { + const html = manifestFields(this.manifestPath, updatedManifest).html + const scripts = manifestFields(this.manifestPath, updatedManifest).scripts + const htmlFields = Object.values(html).map((value) => value?.html) + const scriptFields = Object.values(scripts).flat() + const initialValues = [...htmlFields, ...scriptFields] + const values = initialValues + .map((value) => value || '') + .filter((value) => value !== '') + + return values + } + + public apply(compiler: webpack.Compiler): void { + compiler.hooks.watchRun.tapAsync( + 'RunChromeExtensionPlugin', + (compiler, done) => { + const files = compiler.modifiedFiles || new Set() + const changedFile = Array.from(files)[0] + + if (changedFile && path.basename(changedFile) === 'manifest.json') { + this.manifestChanged = true + } + + done() + } + ) + + compiler.hooks.compilation.tap( + 'RunChromeExtensionPlugin', + (compilation) => { + compilation.hooks.processAssets.tap( + { + name: 'BrowserExtensionJsonPlugin', + stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONS + }, + (assets) => { + if (this.manifestChanged) { + const manifestAsset = assets['manifest.json']?.source() + const manifest = JSON.parse(manifestAsset?.toString() || '{}') + const initialValues = this.initialValues.sort() + const updatedValues = this.getFlattenedAssets(manifest).sort() + + if (initialValues.toString() !== updatedValues.toString()) { + const errorMessage = serverRestartRequired() + + compilation.errors.push(new webpack.WebpackError(errorMessage)) + this.manifestChanged = false + } + } + } + ) + } + ) + } +} diff --git a/packages/manifest-plugin/plugins/UpdateManifestPlugin.ts b/packages/manifest-plugin/src/plugins/UpdateManifestPlugin.ts similarity index 61% rename from packages/manifest-plugin/plugins/UpdateManifestPlugin.ts rename to packages/manifest-plugin/src/plugins/UpdateManifestPlugin.ts index 73ec9aa4..60024c1a 100644 --- a/packages/manifest-plugin/plugins/UpdateManifestPlugin.ts +++ b/packages/manifest-plugin/src/plugins/UpdateManifestPlugin.ts @@ -1,5 +1,6 @@ import {type Compiler, Compilation, sources} from 'webpack' import getManifestOverrides from '../manifest-overrides' +import getFilename from '../helpers/getFilename' interface Options { manifestPath: string @@ -15,6 +16,22 @@ export default class UpdateManifestPlugin { this.exclude = options.exclude } + private applyDevOverrides(overrides: Record) { + if (!overrides.content_scripts) return {} + + return overrides.content_scripts.map( + (contentObj: {js: string[]; css: string[]}, index: number) => { + if (contentObj.css.length && !contentObj.js.length) { + contentObj.js = [ + getFilename(`content_scripts-${index}`, 'dev.js', []) + ] + } + + return contentObj + } + ) + } + apply(compiler: Compiler) { compiler.hooks.thisCompilation.tap( 'BrowserExtensionManifestPlugin', @@ -41,7 +58,17 @@ export default class UpdateManifestPlugin { const patchedManifest = { // Preserve all uncatched user entries ...manifest, - ...(overrides && JSON.parse(overrides)) + ...JSON.parse(overrides) + } + + // During development, if user has only CSS files in content_scripts, + // we add a JS file to the content_scripts bundle so that + // these files can be dynamically imported, thus allowing HMR. + if (compiler.options.mode !== 'production') { + if (patchedManifest.content_scripts) { + patchedManifest.content_scripts = + this.applyDevOverrides(patchedManifest) + } } const source = JSON.stringify(patchedManifest, null, 2) diff --git a/packages/manifest-plugin/src/plugins/_HardReloadManifestPlugin.ts b/packages/manifest-plugin/src/plugins/_HardReloadManifestPlugin.ts new file mode 100644 index 00000000..702ff527 --- /dev/null +++ b/packages/manifest-plugin/src/plugins/_HardReloadManifestPlugin.ts @@ -0,0 +1,70 @@ +import path from 'path' +import webpack from 'webpack' + +interface Options { + manifestPath: string +} + +export default class HardReloadManifestPlugin { + private readonly options: Options + private readonly logger: any // WebpackLogger + + constructor(options: Options) { + this.options = options + } + + apply(compiler: webpack.Compiler): void { + // this.logger = compiler.getInfrastructureLogger('webpack-cli') + + compiler.hooks.watchRun.tapAsync( + 'RunChromeExtensionPlugin', + (compiler, done) => { + const files = compiler.modifiedFiles || new Set() + const changedFile = files.values().next().value + + if (!changedFile || path.basename(changedFile) !== 'manifest.json') { + done() + return + } + + compiler.hooks.afterCompile.tap( + 'BrowserExtensionHtmlPlugin', + (compilation) => { + if ( + compilation.errors?.length > 0 || + compilation.warnings?.length > 0 + ) { + return + } + + const webpackCompiler = webpack({ + ...compilation.options, + output: { + ...compilation.options.output, + uniqueName: 'browser-extension-manifest-plugin' + }, + plugins: [ + ...compilation.options.plugins.filter((data) => { + return ( + (data as any)?.name !== 'browserPlugins' && + (data as any)?.name !== 'reloadPlugins' + ) + }) + ] + } as any) + + webpackCompiler.run((err, stats) => { + if (err) { + console.error(err) + return + } + + console.log('-----------------------------------') + }) + } + ) + done() + } + ) + } +} diff --git a/packages/manifest-plugin/types.ts b/packages/manifest-plugin/src/types.ts similarity index 100% rename from packages/manifest-plugin/types.ts rename to packages/manifest-plugin/src/types.ts diff --git a/packages/html-plugin/.github/workflows/ci.yml b/packages/resources-plugin/.github/workflows/ci.yml similarity index 100% rename from packages/html-plugin/.github/workflows/ci.yml rename to packages/resources-plugin/.github/workflows/ci.yml diff --git a/packages/resources-plugin/README.md b/packages/resources-plugin/README.md new file mode 100644 index 00000000..cfa49a13 --- /dev/null +++ b/packages/resources-plugin/README.md @@ -0,0 +1,8 @@ +[action-image]: https://github.com/cezaraugusto/webpack-browser-extension-resources-plugin/workflows/CI/badge.svg +[action-url]: https://github.com/cezaraugusto/webpack-browser-extension-resources-plugin/actions?query=workflow%3ACI +[npm-image]: https://img.shields.io/npm/v/webpack-browser-extension-resources-plugin.svg +[npm-url]: https://npmjs.org/package/webpack-browser-extension-resources-plugin + +# webpack-browser-extension-resources-plugin [![workflow][action-image]][action-url] [![npm][npm-image]][npm-url] + +> webpack plugin to handle manifest resources assets from browser extensions diff --git a/packages/resources-plugin/module.ts b/packages/resources-plugin/module.ts new file mode 100644 index 00000000..65650a2f --- /dev/null +++ b/packages/resources-plugin/module.ts @@ -0,0 +1,71 @@ +import path from 'path' +import type webpack from 'webpack' +import {type WebResourcesPluginInterface} from './types' +import CopyStaticFolder from './src/steps/CopyStaticFolder' +// import AutoParseWebResourcesFolder from './src/steps/AutoParseWebResourcesFolder' +import ApplyCommonFileLoaders from './src/steps/ApplyCommonFileLoaders' +import UpdateManifest from './src/steps/UpdateManifest' + +export default class WebResourcesPlugin { + private readonly manifestPath: string + private readonly exclude?: string[] + + constructor(options: WebResourcesPluginInterface) { + this.manifestPath = options.manifestPath + this.exclude = options.exclude + } + + /** + * WebResourcesPlugin is responsible for handling all assets + * declared in: + * + * - web_accessible_resources paths in the manifest.json file. + * - Assets imported from content_scripts. + * + * and outputting them in the web_accessible_resources folder. + * + * Assets supported: + * - Images: png|jpg|jpeg|gif|webp|avif|ico|bmp|svg + * - Text: txt|md|csv|tsv|xml|pdf|docx|doc|xls|xlsx|ppt|pptx|zip|gz|gzip|tgz + * - Fonts: woff|woff2|eot|ttf|otf + * - CSV: csv|tsv + * - XML: xml + * + * For MV2, the assets are outputted to the web_accessible_resources + * folder. For MV3, the assets are outputted to web_accessible_resources/resource-[index]. + * These entries are also added to the manifest.json file. + */ + apply(compiler: webpack.Compiler) { + const projectPath = path.dirname(this.manifestPath) + const staticDir = path.join( + compiler.options.context || projectPath, + 'public/' + ) + + // Copy the static folder recursively, keeping the original + // folder structure. + new CopyStaticFolder({staticDir}).apply(compiler) + + // Iterate over the list of web_accessible_resources + // defined in the manifest.json file and output them + // to the web_accessible_resources folder. + // TODO: cezaraugusto this needs more testing. + // new AutoParseWebResourcesFolder({ + // manifestPath: this.manifestPath, + // exclude: this.exclude + // }).apply(compiler) + + // 2 - Apply common loaders to handle assets + // imported from content_scripts and output them + // in the web_accessible_resources folder. + new ApplyCommonFileLoaders({ + manifestPath: this.manifestPath, + exclude: this.exclude + }).apply(compiler) + + // 3 - Write the web_accessible_resources folder to the manifest allowlist. + new UpdateManifest({ + manifestPath: this.manifestPath + }).apply(compiler) + } +} diff --git a/packages/resources-plugin/package.json b/packages/resources-plugin/package.json new file mode 100644 index 00000000..b00ea36d --- /dev/null +++ b/packages/resources-plugin/package.json @@ -0,0 +1,63 @@ +{ + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/cezaraugusto/webpack-browser-extension-resources-plugin.git" + }, + "engines": { + "node": ">=16" + }, + "name": "webpack-browser-extension-resources-plugin", + "version": "0.0.0", + "description": "webpack plugin to handle manifest web resources assets from browser extensions", + "main": "./dist/module.js", + "types": "./dist/module.d.ts", + "files": [ + "dist" + ], + "author": { + "name": "Cezar Augusto", + "email": "boss@cezaraugusto.net", + "url": "https://cezaraugusto.com" + }, + "scripts": { + "watch": "yarn compile --watch", + "compile": "tsup-node ./module.ts --format cjs --dts --target=node16 --minify", + "lint": "eslint \"./**/*.ts*\"", + "test": "echo \"Note: no test specified\" && exit 0" + }, + "keywords": [ + "webpack", + "plugin", + "browser", + "web", + "extension", + "web-ext", + "web", + "resources", + "manifest", + "manifest.json" + ], + "peerDependencies": { + "webpack": "^5.0.0" + }, + "devDependencies": { + "@types/glob": "^8.1.0", + "eslint": "^7.32.0", + "eslint-config-extension-create": "*", + "jasmine": "^4.0.2", + "rimraf": "^3.0.2", + "tsconfig": "*", + "tsup": "^6.7.0", + "webpack": "^5.9.0", + "webpack-cli": "^4.2.0" + }, + "dependencies": { + "@babel/parser": "^7.22.7", + "@babel/traverse": "^7.22.8", + "browser-extension-manifest-fields": "*", + "csv-loader": "^3.0.5", + "glob": "^10.3.9", + "xml-loader": "^1.2.1" + } +} diff --git a/packages/resources-plugin/src/helpers/shoudExclude.ts b/packages/resources-plugin/src/helpers/shoudExclude.ts new file mode 100644 index 00000000..abe5d504 --- /dev/null +++ b/packages/resources-plugin/src/helpers/shoudExclude.ts @@ -0,0 +1,17 @@ +import path from 'path' + +export default function shouldExclude( + manifestPath: string, + filepath: string, + excludedFolders?: string[] +) { + const manifestDir = path.dirname(manifestPath) + const resolvedFilePath = path.resolve(manifestDir, filepath) + + return ( + excludedFolders?.some((excludePath) => { + const resolvedExcludePath = path.resolve(manifestDir, excludePath) + return resolvedFilePath.startsWith(resolvedExcludePath) + }) ?? false + ) +} diff --git a/packages/resources-plugin/src/steps/ApplyCommonFileLoaders.ts b/packages/resources-plugin/src/steps/ApplyCommonFileLoaders.ts new file mode 100644 index 00000000..2839d086 --- /dev/null +++ b/packages/resources-plugin/src/steps/ApplyCommonFileLoaders.ts @@ -0,0 +1,82 @@ +import type webpack from 'webpack' +import {type WebResourcesPluginInterface} from '../../types' + +export default class ApplyCommonFileLoaders { + private readonly manifestPath: string + + constructor(options: WebResourcesPluginInterface) { + this.manifestPath = options.manifestPath + } + + private loaders() { + const getFilename = (runtime: string, folderPath: string) => { + if (runtime.startsWith('content_scripts')) { + return 'web_accessible_resources/[name].[hash:8][ext]' + } + + return `${folderPath}/[name].[hash:8][ext]` + } + + const assetLoaders = [ + { + test: /\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$/i, + type: 'asset/resource', + generator: { + filename: ({runtime}: {runtime: string}) => + getFilename(runtime, 'images') + }, + parser: { + dataUrlCondition: { + // inline images < 2 KB + maxSize: 2 * 1024 + } + } + }, + { + test: /\.(woff|woff2|eot|ttf|otf)$/i, + type: 'asset/resource', + generator: { + filename: ({runtime}: {runtime: string}) => + getFilename(runtime, 'fonts') + } + }, + { + test: /\.(txt|md|csv|tsv|xml|pdf|docx|doc|xls|xlsx|ppt|pptx|zip|gz|gzip|tgz)$/i, + type: 'asset/resource', + generator: { + filename: ({runtime}: {runtime: string}) => + getFilename(runtime, 'assets') + }, + parser: { + dataUrlCondition: { + // inline images < 2 KB + maxSize: 2 * 1024 + } + } + }, + { + test: /\.(csv|tsv)$/i, + use: ['csv-loader'], + generator: { + filename: ({runtime}: {runtime: string}) => + getFilename(runtime, 'assets') + } + }, + { + test: /\.xml$/i, + use: ['xml-loader'], + generator: { + filename: ({runtime}: {runtime: string}) => + getFilename(runtime, 'assets') + } + } + ] + + return assetLoaders + } + + apply(compiler: webpack.Compiler) { + const supportedLoaders = this.loaders() + compiler.options.module?.rules.push(...supportedLoaders) + } +} diff --git a/packages/resources-plugin/src/steps/AutoParseWebResourcesFolder.ts b/packages/resources-plugin/src/steps/AutoParseWebResourcesFolder.ts new file mode 100644 index 00000000..261a5927 --- /dev/null +++ b/packages/resources-plugin/src/steps/AutoParseWebResourcesFolder.ts @@ -0,0 +1,76 @@ +import webpack from 'webpack' +import manifestFields from 'browser-extension-manifest-fields' +import shouldExclude from '../helpers/shoudExclude' +import {WebResourcesPluginInterface} from '../../types' + +export default class OutputWebAccessibleResourcesFolder { + private readonly manifestPath: string + private readonly exclude?: string[] + + constructor(options: WebResourcesPluginInterface) { + this.manifestPath = options.manifestPath + this.exclude = options.exclude + } + + private getContentScriptsCss() { + const manifestScripts = manifestFields(this.manifestPath).scripts + const contentScriptsEntries = Object.entries(manifestScripts) + const contentScripts = contentScriptsEntries.filter(([key]) => { + return key.startsWith('content_scripts') + }) + const contentScriptsCss = contentScripts.filter(([key]) => { + return ( + key.endsWith('.css') || + key.endsWith('.scss') || + key.endsWith('.sass') || + key.endsWith('.less') + ) + }) + + return contentScriptsCss + } + + apply(compiler: webpack.Compiler) { + compiler.hooks.emit.tapAsync('WebResourcesPlugin', (compilation, done) => { + const {web_accessible_resources} = manifestFields(this.manifestPath) + const contentScriptsCss = this.getContentScriptsCss() + + if (web_accessible_resources?.length) { + for (const resource of web_accessible_resources) { + // Manifest V2 + if (typeof resource === 'string') { + const isContentCss = contentScriptsCss?.some( + ([key]) => key === resource + ) + + if (!isContentCss) { + if (!shouldExclude(this.manifestPath, resource, this.exclude)) { + compilation.assets[`web_accessible_resources/${resource}`] = + compilation.assets[resource] + } + } + } else { + // Manifest V3 + resource.forEach((resourcePath, index) => { + const isContentCss = contentScriptsCss?.some( + ([key]) => key === resourcePath + ) + + if (!isContentCss) { + if ( + !shouldExclude(this.manifestPath, resourcePath, this.exclude) + ) { + compilation.assets[ + `web_accessible_resources/resource-${index}/${resourcePath}` + ] = compilation.assets[resourcePath] + } + } + }) + } + } + } + + done() + }) + } +} diff --git a/programs/develop/webpack/plugins/copy-static-folder-plugin.ts b/packages/resources-plugin/src/steps/CopyStaticFolder.ts similarity index 93% rename from programs/develop/webpack/plugins/copy-static-folder-plugin.ts rename to packages/resources-plugin/src/steps/CopyStaticFolder.ts index 2d643aff..20e04ee3 100644 --- a/programs/develop/webpack/plugins/copy-static-folder-plugin.ts +++ b/packages/resources-plugin/src/steps/CopyStaticFolder.ts @@ -6,7 +6,7 @@ interface CopyStaticFolderOptions { staticDir: string } -export default class CopyStaticFolderPlugin { +export default class CopyStaticFolder { private readonly options: CopyStaticFolderOptions constructor(options: CopyStaticFolderOptions) { @@ -34,7 +34,7 @@ export default class CopyStaticFolderPlugin { const {staticDir} = this.options const output = compiler.options.output?.path || '' - compiler.hooks.afterEmit.tap('CopyStaticFolderPlugin', () => { + compiler.hooks.afterEmit.tap('CopyStaticFolder', () => { if (!staticDir) return const source = staticDir diff --git a/packages/resources-plugin/src/steps/UpdateManifest.ts b/packages/resources-plugin/src/steps/UpdateManifest.ts new file mode 100644 index 00000000..b71dc08f --- /dev/null +++ b/packages/resources-plugin/src/steps/UpdateManifest.ts @@ -0,0 +1,82 @@ +import {type Compiler, Compilation, sources} from 'webpack' +import {WebResourcesPluginInterface} from '../../types' + +export default class UpdateManifest { + private readonly manifestPath: string + + constructor(options: WebResourcesPluginInterface) { + this.manifestPath = options.manifestPath + } + + private addFolderToWebResourcesField(manifest: Record) { + const isV2 = manifest.manifest_version === 2 + const isV3 = manifest.manifest_version === 3 + + // Check for Manifest V2 + if (isV2) { + if (!manifest.web_accessible_resources) { + manifest.web_accessible_resources = ['web_accessible_resources/*'] + } else if (Array.isArray(manifest.web_accessible_resources)) { + const newResource = 'web_accessible_resources/*' + if (!manifest.web_accessible_resources.includes(newResource)) { + manifest.web_accessible_resources.push(newResource) + } + } + } + + // Check for Manifest V3 + else if (isV3) { + if (!manifest.web_accessible_resources) { + manifest.web_accessible_resources = [ + { + resources: ['web_accessible_resources/*'], + matches: [''] + } + ] + } else if (Array.isArray(manifest.web_accessible_resources)) { + manifest.web_accessible_resources.forEach( + (resource: any, index: number) => { + const newResource = `web_accessible_resources/resource-${index}/*` + if (!resource.resources.includes(newResource)) { + resource.resources.push(newResource) + } + } + ) + } + } + + return manifest + } + + apply(compiler: Compiler) { + compiler.hooks.thisCompilation.tap( + 'BrowserExtensionManifestPlugin', + (compilation) => { + compilation.hooks.processAssets.tap( + { + name: 'BrowserExtensionManifestPlugin', + stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE + }, + (assets) => { + if (compilation.errors.length > 0) return + + const manifest = assets['manifest.json'] + ? JSON.parse(assets['manifest.json'].source().toString()) + : require(this.manifestPath) + + const patchedManifest = this.addFolderToWebResourcesField(manifest) + + const source = JSON.stringify(patchedManifest, null, 2) + const rawSource = new sources.RawSource(source) + + if (assets['manifest.json']) { + compilation.updateAsset('manifest.json', rawSource) + } else { + compilation.emitAsset('manifest.json', rawSource) + } + } + ) + } + ) + } +} diff --git a/packages/resources-plugin/tsconfig.json b/packages/resources-plugin/tsconfig.json new file mode 100644 index 00000000..405d5a4c --- /dev/null +++ b/packages/resources-plugin/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../../packages/tsconfig/base.json", + "include": ["."], + "exclude": ["dist", "node_modules"] +} diff --git a/packages/resources-plugin/types.ts b/packages/resources-plugin/types.ts new file mode 100644 index 00000000..776d1004 --- /dev/null +++ b/packages/resources-plugin/types.ts @@ -0,0 +1,4 @@ +export interface WebResourcesPluginInterface { + manifestPath: string + exclude?: string[] +} diff --git a/packages/run-chrome-extension/.gitignore b/packages/run-chrome-extension/.gitignore deleted file mode 100644 index de4a0ab7..00000000 --- a/packages/run-chrome-extension/.gitignore +++ /dev/null @@ -1,238 +0,0 @@ -dist -.turbo - -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -code_to_inject -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.*# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -todo.md -spec/ -.github diff --git a/packages/run-chrome-extension/LICENSE b/packages/run-chrome-extension/LICENSE deleted file mode 100644 index a0b5d14c..00000000 --- a/packages/run-chrome-extension/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Cezar Augusto (https://cezaraugusto.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/run-chrome-extension/extensions/manager-extension/manifest.json b/packages/run-chrome-extension/extensions/manager-extension/manifest.json index b0b9d6fb..370d425f 100644 --- a/packages/run-chrome-extension/extensions/manager-extension/manifest.json +++ b/packages/run-chrome-extension/extensions/manager-extension/manifest.json @@ -1,9 +1,11 @@ { "name": "⌘ Extension Manager", "version": "1.0", - "manifest_version": 2, + "manifest_version": 3, + "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA02Q4Zwr24MA5XW/tGzqQnK6tUmS2VnhmomJ1oP1mHqaE7DiGzITpmvWnixUl7zJd5LEr5c0LS58tRzBckGOSE7hfEUNCztQc4ywKa1b4L+67VdvG7PZJLMd525cou82ZkAnmEvb/qgR8qAQa74Jpd4ePZV3M0Gm0nvKIajvVTWbN2lq33nE+a5Yry91RkgkVm6EZgJBUJrxZtdoU5kfCV23Uf1+t6XkDqMYy2BrJ+cE9WT3FhV5DtP1kfYkkCzUxO6pd+wVxmhkXjygLI02lc0OR7Xs69QPfNcGJoJBRH3X4srMdwSCO3JONv/yp+2GH/5mvFx07AtenKg8lGauUXwIDAQAB", "background": { - "scripts": ["initialTab.js"] + "service_worker": "initialTab.js", + "type": "module" }, "permissions": ["management", "tabs"] } diff --git a/packages/run-chrome-extension/extensions/reload-extension/manifest.json b/packages/run-chrome-extension/extensions/reload-extension/manifest.json index 9938114b..ca42f7b9 100644 --- a/packages/run-chrome-extension/extensions/reload-extension/manifest.json +++ b/packages/run-chrome-extension/extensions/reload-extension/manifest.json @@ -1,9 +1,10 @@ { "name": "Chrome Reload", + "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0JArZNM1bEHau4QvPAB1AoO0R9I9J73rqijM41GPSuvBiteX/BZ7tE4qcA1Gl1qbf/qi+5ovXfV+6dkgVjobjnJDzzk0xmQ8x+vBjah+cjs637hwpRbUVs8gASFQytlm8D0fbJzgxlyUYZsj077Q+lk//tLk4GE9fI29X91r+NiK644u9GNMttfGWg6Mg1LLkSz0FIO+GeynURaO0zY8WbbIE/ryQjohFkUHy1wInbbrkzR8oUbV4r+gf/7SBgZ+1ukb0zFEF0/QLMlzMKNPhlhBsES2jZG056Cz37kYqWeSGf7r2+sPp98SiBJRf8cxqfwKPssTpwpueeqsQDq9PQIDAQAB", "version": "1.0", - "manifest_version": 2, + "manifest_version": 3, "background": { - "scripts": ["reloadService.js"] + "service_worker": "reloadService.js" }, "permissions": ["management", "tabs"] } diff --git a/packages/run-chrome-extension/extensions/reload-extension/reloadService.js b/packages/run-chrome-extension/extensions/reload-extension/reloadService.js index d762adc7..6a2f3b5d 100644 --- a/packages/run-chrome-extension/extensions/reload-extension/reloadService.js +++ b/packages/run-chrome-extension/extensions/reload-extension/reloadService.js @@ -1,56 +1,62 @@ -/** global 8082 chrome */ -function executeWs(port) { - const ws = new window.WebSocket(`ws://localhost:${port}`) - - // Gracefully close websocket connection before unloading app - window.onbeforeunload = () => { - ws.onclose = () => { - ws.close() - } +/* global chrome WebSocket */ + +const TEN_SECONDS_MS = 10 * 1000 +let webSocket = null + +chrome.runtime.onInstalled.addListener(async () => { + if (webSocket) { + disconnect() + } else { + await connect() + keepAlive() } +}) - ws.onopen = () => { - ws.send(JSON.stringify({status: 'clientReady'})) - console.log('[Reload Service] Extension ready. Watching changes...') +async function connect() { + if (webSocket) { + // If already connected, do nothing + return } - ws.onmessage = async (event) => { + webSocket = new WebSocket('ws://localhost:8082') + + webSocket.onerror = (event) => { + console.error(`[Reload Service] Connection error: ${JSON.stringify(event)}`) + webSocket.close() + } + + webSocket.onopen = () => { + console.info(`[Reload Service] Connection opened.`) + } + + webSocket.onmessage = async (event) => { const message = JSON.parse(event.data) - // Response status - if (message.status === 'reload') { - console.log( - `[Reload Service] Changed detected on ${message.where}. Extension reloaded. Watching changes...` + if (message.status === 'serverReady') { + console.info('[Reload Service] Connection ready.') + await requestInitialLoadData() + } + + if (message.changedFile) { + console.info( + `[Reload Service] Changes detected on ${message.changedFile}. Reloading extension...` ) - if (message.where === 'background') { - await reloadAllExtensions() - ws.send(JSON.stringify({status: 'allExtensionsReloaded'})) - } - - if (message.where === 'manifest') { - ws.send(JSON.stringify({status: 'manifestReloaded'})) - } - - if ( - message.where === 'manifest' || - message.where === 'html' || - message.where === 'content' || - message.where === 'locale' - ) { - await reloadAllExtensions() - await reloadAllTabs() - ws.send( - JSON.stringify({ - status: 'everythingReloaded', - where: message.where - }) - ) - } + + await messageAllExtensions(message.changedFile) } } + + webSocket.onclose = () => { + console.info('[Reload Service] Connection closed.') + webSocket = null + } } -executeWs(8082) +function disconnect() { + if (webSocket) { + webSocket.close() + } +} async function getDevExtensions() { const allExtensions = await new Promise((resolve) => { @@ -61,54 +67,91 @@ async function getDevExtensions() { return ( // Do not include itself extension.id !== chrome.runtime.id && + // Manager extension + extension.id !== 'hkklidinfhnfidkjiknmmbmcloigimco' && // Show only unpackaged extensions extension.installType === 'development' ) }) } -async function reloadExtension(extensionId) { - setTimeout(async () => { - await setEnabled(extensionId, false) - await setEnabled(extensionId, true) - }, 1000) -} +async function messageAllExtensions(changedFile) { + // Check if the external extension is ready + const isExtensionReady = await checkExtensionReadiness() + + if (isExtensionReady) { + const devExtensions = await getDevExtensions() + const reloadAll = devExtensions.map((extension) => { + chrome.runtime.sendMessage(extension.id, {changedFile}, (response) => { + if (response) { + console.info('[Reload Service] Extension reloaded and ready.') + } + }) -async function setEnabled(extensionId, value) { - if (extensionId === chrome.runtime.id) { - return Promise.resolve() - } + return true + }) - await new Promise((resolve) => { - chrome.management.setEnabled(extensionId, value, resolve) - }) + await Promise.all(reloadAll) + } else { + console.info('[Reload Service] External extension is not ready.') + } } -async function reloadAllExtensions() { +async function requestInitialLoadData() { const devExtensions = await getDevExtensions() - const reloadAll = devExtensions.map((extension) => - reloadExtension(extension.id) - ) - - await Promise.all(reloadAll) -} -// eslint-disable-next-line no-unused-expressions -async function reloadTab() { - await new Promise((resolve) => { - chrome.tabs.getCurrent((tab) => { - chrome.tabs.reload(tab?.id) - resolve + const messagePromises = devExtensions.map((extension) => { + return new Promise((resolve) => { + chrome.runtime.sendMessage( + extension.id, + {initialLoadData: true}, + (response) => { + if (chrome.runtime.lastError) { + console.error( + `Error sending message to ${extension.id}: ${chrome.runtime.lastError.message}` + ) + resolve(null) + } else { + console.log({response}) + resolve(response) + } + } + ) }) }) -} -async function reloadAllTabs() { - setTimeout(async () => { - await new Promise((resolve) => { - return chrome.tabs.query({}, (tabs) => { - tabs.forEach((tab) => chrome.tabs.reload(tab.id), resolve) - }) + const responses = await Promise.all(messagePromises) + + // We received the info from the use extension. + // All good, client is ready. Inform the server. + if (webSocket && webSocket.readyState === WebSocket.OPEN) { + const message = JSON.stringify({ + status: 'clientReady', + data: responses[0] }) - }, 1000) + + webSocket.send(message) + } +} + +async function checkExtensionReadiness() { + // Delay for 1 second + await delay(1000) + // Assume the extension is ready + return true +} + +async function delay(ms) { + return new Promise((resolve) => setTimeout(resolve, ms)) +} + +function keepAlive() { + const keepAliveIntervalId = setInterval(() => { + if (webSocket) { + webSocket.send(JSON.stringify({status: 'ping'})) + console.info('[Reload Service] Listening for changes...') + } else { + clearInterval(keepAliveIntervalId) + } + }, TEN_SECONDS_MS) } diff --git a/packages/run-chrome-extension/fixtures/demo-extension/README.md b/packages/run-chrome-extension/fixtures/demo-extension/README.md deleted file mode 100644 index a0064b14..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# demo-extension - -> A demo extension - - diff --git a/packages/run-chrome-extension/fixtures/demo-extension/_locales/en/messages.json b/packages/run-chrome-extension/fixtures/demo-extension/_locales/en/messages.json deleted file mode 100644 index 42190a6c..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/_locales/en/messages.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extName": { - "message": "Demo extension" - }, - "extDesc": { - "message": "A demo extension." - }, - "ext_default_title": { - "message": "Demo extension title" - } -} diff --git a/packages/run-chrome-extension/fixtures/demo-extension/background/background.html b/packages/run-chrome-extension/fixtures/demo-extension/background/background.html deleted file mode 100644 index 1613eb50..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/background/background.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Background page - - - - - - diff --git a/packages/run-chrome-extension/fixtures/demo-extension/background/background.js b/packages/run-chrome-extension/fixtures/demo-extension/background/background.js deleted file mode 100644 index b73dbf7c..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/background/background.js +++ /dev/null @@ -1 +0,0 @@ -console.log('background script loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/background/background2.js b/packages/run-chrome-extension/fixtures/demo-extension/background/background2.js deleted file mode 100644 index 4c32f669..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/background/background2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('background script (2) loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/background/command.js b/packages/run-chrome-extension/fixtures/demo-extension/background/command.js deleted file mode 100644 index 8519793d..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/background/command.js +++ /dev/null @@ -1,6 +0,0 @@ -/* global chrome */ - -console.log('command listener opened in background') -chrome.commands.onCommand.addListener((command) => { - console.log('command received on the background:', command) -}) diff --git a/packages/run-chrome-extension/fixtures/demo-extension/content/content1.css b/packages/run-chrome-extension/fixtures/demo-extension/content/content1.css deleted file mode 100644 index fcc712f7..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/content/content1.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: purple; -} diff --git a/packages/run-chrome-extension/fixtures/demo-extension/content/content1.js b/packages/run-chrome-extension/fixtures/demo-extension/content/content1.js deleted file mode 100644 index de0869e4..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/content/content1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('content script loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/content/content2.css b/packages/run-chrome-extension/fixtures/demo-extension/content/content2.css deleted file mode 100644 index bd5f6c7a..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/content/content2.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: green; -} diff --git a/packages/run-chrome-extension/fixtures/demo-extension/content/content2.js b/packages/run-chrome-extension/fixtures/demo-extension/content/content2.js deleted file mode 100644 index 12e892c8..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/content/content2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('content script (2) loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/custom/custom.css b/packages/run-chrome-extension/fixtures/demo-extension/custom/custom.css deleted file mode 100644 index 030a5c91..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/custom/custom.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightgoldenrodyellow; -} diff --git a/packages/run-chrome-extension/fixtures/demo-extension/custom/custom.html b/packages/run-chrome-extension/fixtures/demo-extension/custom/custom.html deleted file mode 100644 index 49a7b0d5..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/custom/custom.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Custom page - - - - -

Custom HTML Loaded 🧩

- - - diff --git a/packages/run-chrome-extension/fixtures/demo-extension/custom/custom1.js b/packages/run-chrome-extension/fixtures/demo-extension/custom/custom1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/custom/custom1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/custom/custom2.js b/packages/run-chrome-extension/fixtures/demo-extension/custom/custom2.js deleted file mode 100644 index 80f79e34..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/custom/custom2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script2 loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/devtools/devtools.css b/packages/run-chrome-extension/fixtures/demo-extension/devtools/devtools.css deleted file mode 100644 index e19ba603..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/devtools/devtools.css +++ /dev/null @@ -1,4 +0,0 @@ -body { - background: white; - color: #000; -} diff --git a/packages/run-chrome-extension/fixtures/demo-extension/devtools/devtools.html b/packages/run-chrome-extension/fixtures/demo-extension/devtools/devtools.html deleted file mode 100644 index 36653f3e..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/devtools/devtools.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - devtools page - - - - -

devtools panel 🧩

- - - - diff --git a/packages/run-chrome-extension/fixtures/demo-extension/devtools/devtools.js b/packages/run-chrome-extension/fixtures/demo-extension/devtools/devtools.js deleted file mode 100644 index 3b13ea3d..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/devtools/devtools.js +++ /dev/null @@ -1,19 +0,0 @@ -/* global chrome */ - -function handleShown() { - console.log('panel visible') -} - -function handleHidden() { - console.log('panel invisible') -} - -chrome.devtools.panels.create( - 'Extension Panel', - 'public/icon/test_32.png', - 'devtools/devtools.html', - (newPanel) => { - newPanel.onShown.addListener(handleShown) - newPanel.onHidden.addListener(handleHidden) - } -) diff --git a/packages/run-chrome-extension/fixtures/demo-extension/devtools/sidebar.js b/packages/run-chrome-extension/fixtures/demo-extension/devtools/sidebar.js deleted file mode 100644 index d7377e19..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/devtools/sidebar.js +++ /dev/null @@ -1,10 +0,0 @@ -/* global chrome */ - -chrome.devtools.panels.elements.createSidebarPane( - 'My Own Sidebar', - (sidebar) => { - chrome.devtools.panels.elements.onSelectionChanged.addListener(() => { - sidebar.setExpression('$0') - }) - } -) diff --git a/packages/run-chrome-extension/fixtures/demo-extension/manifest.json b/packages/run-chrome-extension/fixtures/demo-extension/manifest.json deleted file mode 100644 index 084bf063..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/manifest.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "author": "Cezar Augusto", - "background": { - "persistent": false, - "page": "background/background.html" - }, - "browser_action": { - "default_icon": { - "16": "public/icon/test_16.png", - "32": "public/icon/test_32.png", - "48": "public/icon/test_48.png", - "64": "public/icon/test_64.png" - }, - "default_popup": "popup/popup.html", - "default_title": "Test" - }, - "chrome_url_overrides": { - "newtab": "overrides/newtab/newtab.html" - }, - "commands": { - "_execute_browser_action": { - "suggested_key": { - "default": "Ctrl+Shift+F", - "mac": "MacCtrl+Shift+F" - } - }, - "toggle-feature": { - "description": "Send a 'toggle-feature' event to the extension", - "suggested_key": { - "default": "Ctrl+Shift+Y", - "mac": "MacCtrl+Shift+Y" - } - } - }, - "content_scripts": [ - { - "css": ["content/content1.css", "content/content2.css"], - "js": ["content/content1.js", "content/content2.js"], - "matches": [""], - "run_at": "document_start" - } - ], - "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'", - "default_locale": "en", - "description": "A demo extension", - "devtools_page": "devtools/devtools.html", - "externally_connectable": { - "matches": ["*://*.example.com/*"] - }, - "homepage_url": "https://github.com/cezaraugusto/demo-extension", - "icons": { - "16": "public/icon/test_16.png", - "32": "public/icon/test_32.png", - "48": "public/icon/test_48.png", - "64": "public/icon/test_64.png" - }, - "incognito": "not_allowed", - "manifest_version": 2, - "name": "Demo extension", - "offline_enabled": true, - "omnibox": { - "keyword": "demo" - }, - "options_ui": { - "chrome_style": true, - "page": "options/options.html" - }, - "permissions": ["tabs"], - "short_name": "Short Name", - "version": "1.0", - "version_name": "", - "web_accessible_resources": ["resources/*"] -} diff --git a/packages/run-chrome-extension/fixtures/demo-extension/options/options.css b/packages/run-chrome-extension/fixtures/demo-extension/options/options.css deleted file mode 100644 index b7934987..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/options/options.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - background: lightsteelblue; -} diff --git a/packages/run-chrome-extension/fixtures/demo-extension/options/options.html b/packages/run-chrome-extension/fixtures/demo-extension/options/options.html deleted file mode 100644 index 5673d134..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/options/options.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Options page - - - - -

Options page 🧩

- Click to open a Custom HTML page - - - - diff --git a/packages/run-chrome-extension/fixtures/demo-extension/options/options1.js b/packages/run-chrome-extension/fixtures/demo-extension/options/options1.js deleted file mode 100644 index 9ba2aecd..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/options/options1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('options script loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/options/options2.js b/packages/run-chrome-extension/fixtures/demo-extension/options/options2.js deleted file mode 100644 index 21bca1ee..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/options/options2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('options2 script2 loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/overrides/bookmarks/bookmarks.css b/packages/run-chrome-extension/fixtures/demo-extension/overrides/bookmarks/bookmarks.css deleted file mode 100644 index dc39c47e..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/overrides/bookmarks/bookmarks.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightcoral; -} diff --git a/packages/run-chrome-extension/fixtures/demo-extension/overrides/bookmarks/bookmarks.html b/packages/run-chrome-extension/fixtures/demo-extension/overrides/bookmarks/bookmarks.html deleted file mode 100644 index a4e84ebd..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/overrides/bookmarks/bookmarks.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - New tab page - - - - -

Bookmarks Extension Loaded 🧩

- - - - diff --git a/packages/run-chrome-extension/fixtures/demo-extension/overrides/bookmarks/bookmarks1.js b/packages/run-chrome-extension/fixtures/demo-extension/overrides/bookmarks/bookmarks1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/overrides/bookmarks/bookmarks1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/overrides/bookmarks/bookmarks2.js b/packages/run-chrome-extension/fixtures/demo-extension/overrides/bookmarks/bookmarks2.js deleted file mode 100644 index 683355f9..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/overrides/bookmarks/bookmarks2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script (2) loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/overrides/history/history.css b/packages/run-chrome-extension/fixtures/demo-extension/overrides/history/history.css deleted file mode 100644 index b2ef0393..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/overrides/history/history.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightyellow; -} diff --git a/packages/run-chrome-extension/fixtures/demo-extension/overrides/history/history.html b/packages/run-chrome-extension/fixtures/demo-extension/overrides/history/history.html deleted file mode 100644 index 75297e10..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/overrides/history/history.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - History page - - - - -

History Extension Loaded 🧩

- - - - diff --git a/packages/run-chrome-extension/fixtures/demo-extension/overrides/history/history1.js b/packages/run-chrome-extension/fixtures/demo-extension/overrides/history/history1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/overrides/history/history1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/overrides/history/history2.js b/packages/run-chrome-extension/fixtures/demo-extension/overrides/history/history2.js deleted file mode 100644 index 683355f9..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/overrides/history/history2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script (2) loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/overrides/newtab/newtab.css b/packages/run-chrome-extension/fixtures/demo-extension/overrides/newtab/newtab.css deleted file mode 100644 index eda93fa7..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/overrides/newtab/newtab.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: white; -} diff --git a/packages/run-chrome-extension/fixtures/demo-extension/overrides/newtab/newtab.html b/packages/run-chrome-extension/fixtures/demo-extension/overrides/newtab/newtab.html deleted file mode 100644 index 99fb26e2..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/overrides/newtab/newtab.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - New tab page - - - - -

Browser Extension Loaded 🧩

- - - - diff --git a/packages/run-chrome-extension/fixtures/demo-extension/overrides/newtab/newtab1.js b/packages/run-chrome-extension/fixtures/demo-extension/overrides/newtab/newtab1.js deleted file mode 100644 index 3a123101..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/overrides/newtab/newtab1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('newtab script loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/overrides/newtab/newtab2.js b/packages/run-chrome-extension/fixtures/demo-extension/overrides/newtab/newtab2.js deleted file mode 100644 index d2ba9749..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/overrides/newtab/newtab2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('newtab script (2) loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/popup/popup.css b/packages/run-chrome-extension/fixtures/demo-extension/popup/popup.css deleted file mode 100644 index fdda04d1..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/popup/popup.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - background: lightgreen; -} diff --git a/packages/run-chrome-extension/fixtures/demo-extension/popup/popup.html b/packages/run-chrome-extension/fixtures/demo-extension/popup/popup.html deleted file mode 100644 index 3809c478..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/popup/popup.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - Popup page - - - - -

Hello popup 🧩

- - - - diff --git a/packages/run-chrome-extension/fixtures/demo-extension/popup/popup1.js b/packages/run-chrome-extension/fixtures/demo-extension/popup/popup1.js deleted file mode 100644 index 6d422cbc..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/popup/popup1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('popup script loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/popup/popup2.js b/packages/run-chrome-extension/fixtures/demo-extension/popup/popup2.js deleted file mode 100644 index 6d422cbc..00000000 --- a/packages/run-chrome-extension/fixtures/demo-extension/popup/popup2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('popup script loaded') diff --git a/packages/run-chrome-extension/fixtures/demo-extension/public/icon/puzzle.png b/packages/run-chrome-extension/fixtures/demo-extension/public/icon/puzzle.png deleted file mode 100644 index bed9389a..00000000 Binary files a/packages/run-chrome-extension/fixtures/demo-extension/public/icon/puzzle.png and /dev/null differ diff --git a/packages/run-chrome-extension/fixtures/demo-extension/public/icon/test_16.png b/packages/run-chrome-extension/fixtures/demo-extension/public/icon/test_16.png deleted file mode 100644 index 651139b5..00000000 Binary files a/packages/run-chrome-extension/fixtures/demo-extension/public/icon/test_16.png and /dev/null differ diff --git a/packages/run-chrome-extension/fixtures/demo-extension/public/icon/test_32.png b/packages/run-chrome-extension/fixtures/demo-extension/public/icon/test_32.png deleted file mode 100644 index a411754c..00000000 Binary files a/packages/run-chrome-extension/fixtures/demo-extension/public/icon/test_32.png and /dev/null differ diff --git a/packages/run-chrome-extension/fixtures/demo-extension/public/icon/test_48.png b/packages/run-chrome-extension/fixtures/demo-extension/public/icon/test_48.png deleted file mode 100644 index 73b36f0f..00000000 Binary files a/packages/run-chrome-extension/fixtures/demo-extension/public/icon/test_48.png and /dev/null differ diff --git a/packages/run-chrome-extension/fixtures/demo-extension/public/icon/test_64.png b/packages/run-chrome-extension/fixtures/demo-extension/public/icon/test_64.png deleted file mode 100644 index 53aea884..00000000 Binary files a/packages/run-chrome-extension/fixtures/demo-extension/public/icon/test_64.png and /dev/null differ diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/README.md b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/README.md deleted file mode 100644 index a0064b14..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# demo-extension - -> A demo extension - - diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/_locales/en/messages.json b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/_locales/en/messages.json deleted file mode 100644 index 42190a6c..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/_locales/en/messages.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extName": { - "message": "Demo extension" - }, - "extDesc": { - "message": "A demo extension." - }, - "ext_default_title": { - "message": "Demo extension title" - } -} diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/background/background.html b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/background/background.html deleted file mode 100644 index 1613eb50..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/background/background.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Background page - - - - - - diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/background/background.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/background/background.js deleted file mode 100644 index b73dbf7c..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/background/background.js +++ /dev/null @@ -1 +0,0 @@ -console.log('background script loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/background/background2.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/background/background2.js deleted file mode 100644 index 4c32f669..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/background/background2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('background script (2) loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/background/command.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/background/command.js deleted file mode 100644 index 8519793d..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/background/command.js +++ /dev/null @@ -1,6 +0,0 @@ -/* global chrome */ - -console.log('command listener opened in background') -chrome.commands.onCommand.addListener((command) => { - console.log('command received on the background:', command) -}) diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/content/content1.css b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/content/content1.css deleted file mode 100644 index fcc712f7..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/content/content1.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: purple; -} diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/content/content1.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/content/content1.js deleted file mode 100644 index de0869e4..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/content/content1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('content script loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/content/content2.css b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/content/content2.css deleted file mode 100644 index 3e4e0e45..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/content/content2.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightgreen; -} diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/content/content2.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/content/content2.js deleted file mode 100644 index 12e892c8..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/content/content2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('content script (2) loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/custom/custom.css b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/custom/custom.css deleted file mode 100644 index 030a5c91..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/custom/custom.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightgoldenrodyellow; -} diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/custom/custom.html b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/custom/custom.html deleted file mode 100644 index 49a7b0d5..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/custom/custom.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - Custom page - - - - -

Custom HTML Loaded 🧩

- - - diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/custom/custom1.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/custom/custom1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/custom/custom1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/custom/custom2.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/custom/custom2.js deleted file mode 100644 index 80f79e34..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/custom/custom2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script2 loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/devtools/devtools.css b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/devtools/devtools.css deleted file mode 100644 index e19ba603..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/devtools/devtools.css +++ /dev/null @@ -1,4 +0,0 @@ -body { - background: white; - color: #000; -} diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/devtools/devtools.html b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/devtools/devtools.html deleted file mode 100644 index 36653f3e..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/devtools/devtools.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - devtools page - - - - -

devtools panel 🧩

- - - - diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/devtools/devtools.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/devtools/devtools.js deleted file mode 100644 index 3b13ea3d..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/devtools/devtools.js +++ /dev/null @@ -1,19 +0,0 @@ -/* global chrome */ - -function handleShown() { - console.log('panel visible') -} - -function handleHidden() { - console.log('panel invisible') -} - -chrome.devtools.panels.create( - 'Extension Panel', - 'public/icon/test_32.png', - 'devtools/devtools.html', - (newPanel) => { - newPanel.onShown.addListener(handleShown) - newPanel.onHidden.addListener(handleHidden) - } -) diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/devtools/sidebar.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/devtools/sidebar.js deleted file mode 100644 index d7377e19..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/devtools/sidebar.js +++ /dev/null @@ -1,10 +0,0 @@ -/* global chrome */ - -chrome.devtools.panels.elements.createSidebarPane( - 'My Own Sidebar', - (sidebar) => { - chrome.devtools.panels.elements.onSelectionChanged.addListener(() => { - sidebar.setExpression('$0') - }) - } -) diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/manifest.json b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/manifest.json deleted file mode 100644 index 084bf063..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/manifest.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "author": "Cezar Augusto", - "background": { - "persistent": false, - "page": "background/background.html" - }, - "browser_action": { - "default_icon": { - "16": "public/icon/test_16.png", - "32": "public/icon/test_32.png", - "48": "public/icon/test_48.png", - "64": "public/icon/test_64.png" - }, - "default_popup": "popup/popup.html", - "default_title": "Test" - }, - "chrome_url_overrides": { - "newtab": "overrides/newtab/newtab.html" - }, - "commands": { - "_execute_browser_action": { - "suggested_key": { - "default": "Ctrl+Shift+F", - "mac": "MacCtrl+Shift+F" - } - }, - "toggle-feature": { - "description": "Send a 'toggle-feature' event to the extension", - "suggested_key": { - "default": "Ctrl+Shift+Y", - "mac": "MacCtrl+Shift+Y" - } - } - }, - "content_scripts": [ - { - "css": ["content/content1.css", "content/content2.css"], - "js": ["content/content1.js", "content/content2.js"], - "matches": [""], - "run_at": "document_start" - } - ], - "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'", - "default_locale": "en", - "description": "A demo extension", - "devtools_page": "devtools/devtools.html", - "externally_connectable": { - "matches": ["*://*.example.com/*"] - }, - "homepage_url": "https://github.com/cezaraugusto/demo-extension", - "icons": { - "16": "public/icon/test_16.png", - "32": "public/icon/test_32.png", - "48": "public/icon/test_48.png", - "64": "public/icon/test_64.png" - }, - "incognito": "not_allowed", - "manifest_version": 2, - "name": "Demo extension", - "offline_enabled": true, - "omnibox": { - "keyword": "demo" - }, - "options_ui": { - "chrome_style": true, - "page": "options/options.html" - }, - "permissions": ["tabs"], - "short_name": "Short Name", - "version": "1.0", - "version_name": "", - "web_accessible_resources": ["resources/*"] -} diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/options/options.css b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/options/options.css deleted file mode 100644 index b7934987..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/options/options.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - background: lightsteelblue; -} diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/options/options.html b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/options/options.html deleted file mode 100644 index 5673d134..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/options/options.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Options page - - - - -

Options page 🧩

- Click to open a Custom HTML page - - - - diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/options/options1.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/options/options1.js deleted file mode 100644 index 9ba2aecd..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/options/options1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('options script loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/options/options2.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/options/options2.js deleted file mode 100644 index 21bca1ee..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/options/options2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('options2 script2 loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/bookmarks/bookmarks.css b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/bookmarks/bookmarks.css deleted file mode 100644 index dc39c47e..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/bookmarks/bookmarks.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightcoral; -} diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/bookmarks/bookmarks.html b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/bookmarks/bookmarks.html deleted file mode 100644 index a4e84ebd..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/bookmarks/bookmarks.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - New tab page - - - - -

Bookmarks Extension Loaded 🧩

- - - - diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/bookmarks/bookmarks1.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/bookmarks/bookmarks1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/bookmarks/bookmarks1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/bookmarks/bookmarks2.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/bookmarks/bookmarks2.js deleted file mode 100644 index 683355f9..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/bookmarks/bookmarks2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script (2) loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/history/history.css b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/history/history.css deleted file mode 100644 index b2ef0393..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/history/history.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: lightyellow; -} diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/history/history.html b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/history/history.html deleted file mode 100644 index 75297e10..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/history/history.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - History page - - - - -

History Extension Loaded 🧩

- - - - diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/history/history1.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/history/history1.js deleted file mode 100644 index fdecdff5..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/history/history1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/history/history2.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/history/history2.js deleted file mode 100644 index 683355f9..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/history/history2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('custom script (2) loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/newtab/newtab.css b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/newtab/newtab.css deleted file mode 100644 index eda93fa7..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/newtab/newtab.css +++ /dev/null @@ -1,3 +0,0 @@ -* { - background: white; -} diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/newtab/newtab.html b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/newtab/newtab.html deleted file mode 100644 index 99fb26e2..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/newtab/newtab.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - New tab page - - - - -

Browser Extension Loaded 🧩

- - - - diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/newtab/newtab1.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/newtab/newtab1.js deleted file mode 100644 index 3a123101..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/newtab/newtab1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('newtab script loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/newtab/newtab2.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/newtab/newtab2.js deleted file mode 100644 index d2ba9749..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/overrides/newtab/newtab2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('newtab script (2) loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/package.json b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/package.json deleted file mode 100644 index a87e25ad..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "scripts": { - "dev": "npx webpack serve --mode development", - "build": "npx webpack --mode production" - } -} diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/popup/popup.css b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/popup/popup.css deleted file mode 100644 index 90439bac..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/popup/popup.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - background: green; -} diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/popup/popup.html b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/popup/popup.html deleted file mode 100644 index eca64b57..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/popup/popup.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - Popup page - - - - -

Hello popup! 🧩

- - - - diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/popup/popup1.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/popup/popup1.js deleted file mode 100644 index 6d422cbc..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/popup/popup1.js +++ /dev/null @@ -1 +0,0 @@ -console.log('popup script loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/popup/popup2.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/popup/popup2.js deleted file mode 100644 index 6d422cbc..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/popup/popup2.js +++ /dev/null @@ -1 +0,0 @@ -console.log('popup script loaded') diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/puzzle.png b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/puzzle.png deleted file mode 100644 index bed9389a..00000000 Binary files a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/puzzle.png and /dev/null differ diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/test_16.png b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/test_16.png deleted file mode 100644 index 651139b5..00000000 Binary files a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/test_16.png and /dev/null differ diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/test_32.png b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/test_32.png deleted file mode 100644 index a411754c..00000000 Binary files a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/test_32.png and /dev/null differ diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/test_48.png b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/test_48.png deleted file mode 100644 index 73b36f0f..00000000 Binary files a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/test_48.png and /dev/null differ diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/test_64.png b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/test_64.png deleted file mode 100644 index 53aea884..00000000 Binary files a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/public/icon/test_64.png and /dev/null differ diff --git a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/webpack.config.js b/packages/run-chrome-extension/fixtures/dev-server-no-hmr/webpack.config.js deleted file mode 100644 index f9ac8912..00000000 --- a/packages/run-chrome-extension/fixtures/dev-server-no-hmr/webpack.config.js +++ /dev/null @@ -1,58 +0,0 @@ -const path = require('path') - -const RunChromeExtension = require('../../dist/module').default - -module.exports = { - cache: false, - mode: 'development', - entry: {}, - output: { - path: path.resolve(__dirname, 'dist') - }, - plugins: [ - new RunChromeExtension({ - // Needed for autoReload to work - manifestPath: path.resolve(__dirname, 'manifest.json'), - // Needed for the browser to load the extension properly - extensionPath: path.resolve(__dirname), - // Fields below are not required - browserFlags: [ - '--enable-experimental-extension-apis', - '--embedded-extension-options' - ], - userDataDir: path.resolve(__dirname, 'dist', 'my-awesome-user-data-dir'), - startingUrl: 'https://example.com', - autoReload: true, - port: 8082 - }) - ], - devServer: { - allowedHosts: 'all', - static: { - directory: path.resolve(__dirname), - watch: { - ignored: [/\bnode_modules\b/] - } - }, - client: { - // Allows to set log level in the browser, e.g. before reloading, - // before an error or when Hot Module Replacement is enabled. - logging: 'error', - // Prints compilation progress in percentage in the browser. - progress: true, - // Shows a full-screen overlay in the browser - // when there are compiler errors or warnings. - overlay: { - errors: true, - warnings: true - } - }, - devMiddleware: { - writeToDisk: true - }, - headers: { - 'Access-Control-Allow-Origin': '*' - }, - hot: false - } -} diff --git a/packages/run-chrome-extension/fixtures/webpack.config.js b/packages/run-chrome-extension/fixtures/webpack.config.js deleted file mode 100644 index ca5fab49..00000000 --- a/packages/run-chrome-extension/fixtures/webpack.config.js +++ /dev/null @@ -1,39 +0,0 @@ -const path = require('path') - -const RunChromeExtension = require('../dist/module').default - -module.exports = { - cache: false, - mode: 'development', - watch: true, - entry: {}, - output: { - path: path.resolve(__dirname, 'dist') - }, - plugins: [ - new RunChromeExtension({ - // Needed for autoReload to work - manifestPath: path.resolve( - __dirname, - './demo-extension', - 'manifest.json' - ), - // Needed for the browser to load the extension properly - extensionPath: path.resolve(__dirname, './demo-extension'), - // Fields below are not required - browserFlags: [ - '--enable-experimental-extension-apis', - '--embedded-extension-options' - ], - userDataDir: path.resolve( - __dirname, - 'demo-extension', - 'dist', - 'my-awesome-user-data-dir' - ), - startingUrl: 'https://example.com', - autoReload: true, - port: 8082 - }) - ] -} diff --git a/packages/run-chrome-extension/loaders/InjectBackgroundRuntimeLoader.ts b/packages/run-chrome-extension/loaders/InjectBackgroundRuntimeLoader.ts new file mode 100644 index 00000000..782aad71 --- /dev/null +++ b/packages/run-chrome-extension/loaders/InjectBackgroundRuntimeLoader.ts @@ -0,0 +1,89 @@ +import path from 'path' +import {urlToRequest} from 'loader-utils' +import {validate} from 'schema-utils' +import {type LoaderContext} from 'webpack' +import {type Schema} from 'schema-utils/declarations/validate' + +const schema: Schema = { + type: 'object', + properties: { + test: { + type: 'string' + }, + manifestPath: { + type: 'string' + } + } +} + +interface InjectBackgroundAcceptContext extends LoaderContext { + getOptions: () => { + manifestPath: string + } +} + +export default function (this: InjectBackgroundAcceptContext, source: string) { + const options = this.getOptions() + const manifestPath = options.manifestPath + const projectPath = path.dirname(manifestPath) + const manifest = require(manifestPath) + + validate(schema, options, { + name: 'Inject Reload (background.scripts and background.service_worker) Script', + baseDataPath: 'options' + }) + + if (this._compilation?.options.mode === 'production') return source + + const url = urlToRequest(this.resourcePath) + const reloadCode = ` +;chrome.runtime.onMessageExternal.addListener( + (request, _sender, sendResponse) => { + if (request.initialLoadData) { + sendResponse({ + id: chrome.runtime.id, + manifest: chrome.runtime.getManifest() + }) + return true + } + + if ( + request.changedFile === 'manifest.json' || + request.changedFile === 'service_worker' + ) { + sendResponse({reloaded: true}) + setTimeout(() => { + chrome.runtime.reload() + }, 1000) + } + + return true + } +); + ` + + // Let the react reload plugin handle the reload. + if (manifest.background) { + if (manifest.background.scripts) { + for (const bgScript of [manifest.background.scripts[0]]) { + const absoluteUrl = path.resolve(projectPath, bgScript) + + if (url.includes(absoluteUrl)) { + return `${reloadCode}${source}` + } + } + } + + if (manifest.background.service_worker) { + const absoluteUrl = path.resolve( + projectPath, + manifest.background.service_worker + ) + if (url.includes(absoluteUrl)) { + return `${reloadCode}${source}` + } + } + } + + return source +} diff --git a/packages/run-chrome-extension/module.ts b/packages/run-chrome-extension/module.ts index a585defb..5d739f18 100644 --- a/packages/run-chrome-extension/module.ts +++ b/packages/run-chrome-extension/module.ts @@ -1,16 +1,14 @@ -// import path from 'path' -// import fs from 'fs' import type webpack from 'webpack' import {type RunChromeExtensionInterface} from './types' -import SimpleReloadPlugin from './plugins/SimpleReloadPlugin' -import RunChromePlugin from './plugins/RunChromePlugin' -import createUserDataDir from './plugins/RunChromePlugin/chrome/createUserDataDir' +import CreateWebSocketServer from './src/steps/CreateWebSocketServer' +import SetupReloadStrategy from './src/steps/SetupReloadStrategy' +import RunChromePlugin from './src/steps/RunChromePlugin' +import createUserDataDir from './src/steps/RunChromePlugin/chrome/createUserDataDir' export default class RunChromeExtension { private readonly options: RunChromeExtensionInterface constructor(options: RunChromeExtensionInterface) { - // User-defined options this.options = { manifestPath: options.manifestPath, extensionPath: options.extensionPath, @@ -22,58 +20,27 @@ export default class RunChromeExtension { } } - // copyExtensionToOutput(extensionToCopy: string) { - // const sourceDir = path.resolve(`./extensions/${extensionToCopy}`) - // const destinationDir = path.resolve(__dirname, `./dist/extensions/${extensionToCopy}`) - // // Check if the source directory exists - // if (!fs.existsSync(sourceDir)) { - // console.error(`Source directory '${sourceDir}' not found.`) - // return - // } - - // // Create the destination directory if it doesn't exist - // if (!fs.existsSync(destinationDir)) { - // fs.mkdirSync(destinationDir) - // } - - // // copy folders recursively - // const filesToCreate = fs.readdirSync(sourceDir) - - // filesToCreate.forEach(file => { - // const origFilePath = `${sourceDir}/${file}` - // const stats = fs.statSync(origFilePath) - - // if (stats.isSymbolicLink()) return - - // if (stats.isFile()) { - // const contents = fs.readFileSync(origFilePath, 'utf8') - - // // Rename the extension from .js to .ts - // fs.writeFileSync(file, contents, 'utf8') - // } else if (stats.isDirectory()) { - // fs.mkdirSync(`${destinationDir}/${file}`) - - // // Call recursively - // this.copyExtensionToOutput(extensionToCopy) - // } - // }) - // } - apply(compiler: webpack.Compiler) { - if (this.options.autoReload) { - // We don't need to watch anything on production - if (compiler.options.mode === 'production') return - - // Optional auto-reload strategy - // this.copyExtensionToOutput('reload-extension') - new SimpleReloadPlugin(this.options).apply(compiler) - } - - // this.copyExtensionToOutput('manager-extension') - // Serve extensions to the browser. At this point - // both the reload manager extension and the user extension - // are loaded with key files being watched. - // Now we inject these two extensions into the browser. + // This plugin: + + // 1 - Creates a WebSockets server to communicate with the browser. + // This server is responsible for sending reload requests to the client, + // which is a browser extension that is injected into the browser called + // reload-extension. This extension is responsible for sending messages + // to the user extension. + new CreateWebSocketServer(this.options).apply(compiler) + + // 2 - Patches the manifest file, modifies the background script to + // accept both extension runtime updates (service_worker, manifest.json) + // and HMR updates (background, content scripts). The HMR part is done by + // webpack-target-webextension. + new SetupReloadStrategy(this.options).apply(compiler) + + // 3 - Bundle the reloader and manager extensions. The reloader extension + // is injected into the browser and is responsible for sending reload + // requests to the user extension. The manager extension is responsible + // for everything else, for now opening the chrome://extension page on startup. + // It starts a new browser instance with the user extension loaded. new RunChromePlugin(this.options).apply(compiler) } } diff --git a/packages/run-chrome-extension/package.json b/packages/run-chrome-extension/package.json index 9207c7e7..0ef25ab1 100644 --- a/packages/run-chrome-extension/package.json +++ b/packages/run-chrome-extension/package.json @@ -18,7 +18,7 @@ "url": "https://cezaraugusto.com" }, "scripts": { - "compile": "tsup-node ./module.ts --format cjs --dts --target=node16 && node ./copyExtensions.js", + "compile": "tsup-node ./module.ts ./loaders/* --format cjs --dts --target=node16 && node ./copyExtensions.js", "lint": "eslint \"./**/*.ts*\"", "test": "echo \"Note: no test specified\" && exit 0", "test:fixture": "yarn --cwd=./fixtures/dev-server-no-hmr dev", @@ -41,16 +41,21 @@ "webpack": "^5.68.0" }, "dependencies": { - "chrome-location": "^1.2.1", + "@types/loader-utils": "^2.0.6", + "@types/schema-utils": "^2.4.0", "browser-extension-manifest-fields": "*", + "chrome-location": "^1.2.1", + "content-security-policy-parser": "^0.4.1", + "loader-utils": "^3.2.1", + "schema-utils": "^4.2.0", "ws": "^8.4.2" }, "devDependencies": { "@types/fs-extra": "^11.0.1", - "eslint": "^7.32.0", - "eslint-config-extension-create": "*", "copy-webpack-plugin": "^10.2.4", "css-loader": "^6.6.0", + "eslint": "^7.32.0", + "eslint-config-extension-create": "*", "html-webpack-plugin": "^5.5.0", "mini-css-extract-plugin": "^2.5.3", "style-loader": "^3.3.1", diff --git a/packages/run-chrome-extension/plugins/AddDependenciesPlugin.ts b/packages/run-chrome-extension/plugins/AddDependenciesPlugin.ts deleted file mode 100644 index bbd5b5cc..00000000 --- a/packages/run-chrome-extension/plugins/AddDependenciesPlugin.ts +++ /dev/null @@ -1,74 +0,0 @@ -import fs from 'fs' -import type webpack from 'webpack' -import manifestFields from 'browser-extension-manifest-fields' - -export default class AddDependenciesPlugin { - public readonly manifestPath: string - - constructor(options: {manifestPath: string}) { - this.manifestPath = options.manifestPath - } - - apply(compiler: webpack.Compiler): void { - compiler.hooks.afterCompile.tap( - 'RunChromeExtensionPlugin', - (compilation) => { - if (compilation.errors?.length) return - - const manifestFilePath = this.manifestPath - const manifestHtml = manifestFields(manifestFilePath).html - const manifestJson = manifestFields(manifestFilePath).json - const manifestLocale = manifestFields(manifestFilePath).locales - const manifestScripts = manifestFields(manifestFilePath).scripts - - const allEntries = [ - ...Object.values(manifestHtml), - ...Object.values(manifestJson), - ...Object.values(manifestScripts), - ...Object.values(manifestLocale), - ...Object.values(manifestScripts) - ] - - const fileDependencies = new Set(compilation.fileDependencies) - - if (allEntries) { - allEntries.forEach((dependency) => { - const dependencyArray = Array.isArray(dependency) - ? dependency - : [dependency] - - dependencyArray.forEach((dependency) => { - if (typeof dependency === 'string') { - if (!dependency) return - if (!fs.existsSync(dependency)) return - - if (!fileDependencies.has(dependency)) { - fileDependencies.add(dependency) - compilation.fileDependencies.add(dependency) - } - } else { - if (!dependency) return - const htmlAssetsList = Object.entries(dependency) - - for (const [, htmldependency] of htmlAssetsList) { - const htmldependencyArray = Array.isArray(htmldependency) - ? htmldependency - : [htmldependency] - - htmldependencyArray.forEach((htmlDependency) => { - if (!htmlDependency) return - if (!fs.existsSync(htmlDependency)) return - if (!fileDependencies.has(htmlDependency)) { - fileDependencies.add(htmlDependency) - compilation.fileDependencies.add(htmlDependency) - } - }) - } - } - }) - }) - } - } - ) - } -} diff --git a/packages/run-chrome-extension/plugins/SimpleReloadPlugin/rewriteReloadPort.ts b/packages/run-chrome-extension/plugins/SimpleReloadPlugin/rewriteReloadPort.ts deleted file mode 100644 index ca80b3fd..00000000 --- a/packages/run-chrome-extension/plugins/SimpleReloadPlugin/rewriteReloadPort.ts +++ /dev/null @@ -1,24 +0,0 @@ -import path from 'path' -import fs from 'fs' - -export default function replacePortInFile(port: number) { - const filePath = path.resolve( - __dirname, - '../extensions/reload-extension/reloadService.js' - ) - - fs.readFile(filePath, 'utf8', (err, data) => { - if (err) { - console.error(`Error reading file: ${err.message}`) - return - } - - const updatedData = data.replace(/__PORT__/g, port.toString()) - - fs.writeFile(filePath, updatedData, 'utf8', (err) => { - if (err) { - console.error(`Error writing to file: ${err.message}`) - } - }) - }) -} diff --git a/packages/run-chrome-extension/plugins/SimpleReloadPlugin/webSocketServer/messageDispatcher.ts b/packages/run-chrome-extension/plugins/SimpleReloadPlugin/webSocketServer/messageDispatcher.ts deleted file mode 100644 index 72962638..00000000 --- a/packages/run-chrome-extension/plugins/SimpleReloadPlugin/webSocketServer/messageDispatcher.ts +++ /dev/null @@ -1,109 +0,0 @@ -import path from 'path' -import WebSocket from 'ws' -import manifestFields from 'browser-extension-manifest-fields' -import {type RunChromeExtensionInterface} from '../../../types' - -function dispatchMessage( - server: WebSocket.Server, - message: { - status: string - where: string - } -) { - server.clients.forEach((client) => { - if (client.readyState === WebSocket.OPEN) { - client.send(JSON.stringify(message)) - } - }) -} - -export default function messageDispatcher( - server: WebSocket.Server, - options: RunChromeExtensionInterface, - updatedFile: string -) { - if (!updatedFile) return - - const manifestLocales = manifestFields(options.manifestPath!).locales - const manifestScripts = manifestFields(options.manifestPath!).scripts - const manifestHtml = manifestFields(options.manifestPath!).html - - // Ensure the manifest itself is watched. - if (path.basename(updatedFile) === 'manifest.json') { - dispatchMessage(server, { - status: 'reload', - where: 'manifest' - }) - } - - // Handle _locales files - manifestLocales.forEach((path) => { - if (path.includes(updatedFile)) { - dispatchMessage(server, { - status: 'reload', - where: 'locale' - }) - } - }) - - // Reload strategy for background/content/user scripts. - // The options below applies to both autoReload: true and autoReload: 'background'. - // This file is never read if autoReload: false. - Object.entries(manifestScripts).forEach(([entryName, entryData]) => { - const entryDataArr = Array.isArray(entryData) ? entryData : [entryData] - const entryFiles = Object.values(entryDataArr).flatMap((arr) => arr) - - if (entryFiles.includes(updatedFile)) { - if ( - // Handle background.scripts for v2 - // and background.service_worker for v3 - entryName === 'background' || - // Content script CSS files. - // Content scripts JS files. - entryName.startsWith('content') - ) { - dispatchMessage(server, { - status: 'reload', - where: 'background' - }) - } - } - }) - - // The options below applies only to autoReload: true. - if (options.autoReload && options.autoReload !== 'background') { - Object.entries(manifestHtml).forEach(([_entryName, entryData]) => { - // Handle HTML files - if (entryData?.html.includes(updatedFile)) { - dispatchMessage(server, { - status: 'reload', - where: 'html' - }) - } - - // Handle JS files inside HTML files - if (entryData?.js.length) { - entryData.js.forEach((path) => { - if (path.includes(updatedFile)) { - dispatchMessage(server, { - status: 'reload', - where: 'html' - }) - } - }) - } - - // Handle CSS files inside HTML files - if (entryData?.css.length) { - entryData.css.forEach((path) => { - if (path.includes(updatedFile)) { - dispatchMessage(server, { - status: 'reload', - where: 'html' - }) - } - }) - } - }) - } -} diff --git a/packages/run-chrome-extension/plugins/SimpleReloadPlugin/webSocketServer/startServer.ts b/packages/run-chrome-extension/plugins/SimpleReloadPlugin/webSocketServer/startServer.ts deleted file mode 100644 index e6b33999..00000000 --- a/packages/run-chrome-extension/plugins/SimpleReloadPlugin/webSocketServer/startServer.ts +++ /dev/null @@ -1,68 +0,0 @@ -import WebSocket from 'ws' - -export default function (port?: number) { - const webSocketServer = new WebSocket.Server({host: 'localhost', port}) - webSocketServer.on('connection', (ws) => { - ws.send(JSON.stringify({status: 'serverReady'})) - console.log('\n[Reload Service] Starting a new browser instance...\n') - - ws.on('error', (error) => { - console.log('Error', error) - webSocketServer.close() - }) - - ws.on('close', () => { - console.log('[Reload Service] Watch mode closed. Exiting...\n') - webSocketServer.close() - }) - - // We're only ready when the extension says so - ws.on('message', (msg) => { - const message = JSON.parse(JSON.stringify(msg)) - - if (message.status === 'clientReady') { - console.log( - '[Reload Service] Browser setup completed! Extension loaded.\n' - ) - } - - if (message.status === 'extensionReloaded') { - console.log( - '[Reload Service] Extension reloaded. Watching for changes...\n' - ) - } - - if (message.status === 'tabReloaded') { - console.log( - '[Reload Service] Extension tab reloaded. Watching for changes...\n' - ) - } - - if (message.status === 'allTabsReloaded') { - console.log( - '[Reload Service] All tabs reloaded. Watching for changes...\n' - ) - } - - if (message.status === 'allExtensionsReloaded') { - console.log( - '[Reload Service] All extensions reloaded. Watching for changes...\n' - ) - } - - if (message.status === 'manifestReloaded') { - console.log( - '[Reload Service] Manifest change detected. Watching for changes...\n' - ) - } - - if (message.status === 'everythingReloaded') { - console.log( - '[Reload Service] Extension and tabs reloaded. Watching for changes...\n' - ) - } - }) - }) - - return webSocketServer -} diff --git a/packages/run-chrome-extension/spec/run-chrome.spec.js b/packages/run-chrome-extension/spec/run-chrome.spec.js deleted file mode 100644 index 70b786d1..00000000 --- a/packages/run-chrome-extension/spec/run-chrome.spec.js +++ /dev/null @@ -1 +0,0 @@ -// TODO diff --git a/packages/run-chrome-extension/spec/simple-reload.spec.js b/packages/run-chrome-extension/spec/simple-reload.spec.js deleted file mode 100644 index 70b786d1..00000000 --- a/packages/run-chrome-extension/spec/simple-reload.spec.js +++ /dev/null @@ -1 +0,0 @@ -// TODO diff --git a/packages/run-chrome-extension/src/helpers/getResourceName.ts b/packages/run-chrome-extension/src/helpers/getResourceName.ts new file mode 100644 index 00000000..2abefafd --- /dev/null +++ b/packages/run-chrome-extension/src/helpers/getResourceName.ts @@ -0,0 +1,27 @@ +import path from 'path' + +function getOutputExtname(extname: string) { + switch (extname) { + case '.css': + return '.css' + case '.js': + case '.jsx': + case '.ts': + case '.tsx': + case '.mjs': + return '.js' + case '.html': + return extname + case 'empty': + return '' + case 'static': + case 'staticSrc': + case 'staticHref': + default: + return extname + } +} + +export function getFilepath(feature: string, filePath?: string) { + return `${feature}/script` +} diff --git a/packages/run-chrome-extension/messages.ts b/packages/run-chrome-extension/src/helpers/messages.ts similarity index 100% rename from packages/run-chrome-extension/messages.ts rename to packages/run-chrome-extension/src/helpers/messages.ts diff --git a/packages/run-chrome-extension/plugins/SimpleReloadPlugin/index.ts b/packages/run-chrome-extension/src/steps/CreateWebSocketServer/index.ts similarity index 66% rename from packages/run-chrome-extension/plugins/SimpleReloadPlugin/index.ts rename to packages/run-chrome-extension/src/steps/CreateWebSocketServer/index.ts index 87cbf05d..65340a56 100644 --- a/packages/run-chrome-extension/plugins/SimpleReloadPlugin/index.ts +++ b/packages/run-chrome-extension/src/steps/CreateWebSocketServer/index.ts @@ -1,13 +1,11 @@ import path from 'path' import {type Compiler} from 'webpack' -// import manifestFields from 'browser-extension-manifest-fields' -import {type RunChromeExtensionInterface} from '../../types' +import {type RunChromeExtensionInterface} from '../../../types' import messageDispatcher from './webSocketServer/messageDispatcher' import startServer from './webSocketServer/startServer' import rewriteReloadPort from './rewriteReloadPort' -import AddDependenciesPlugin from '../AddDependenciesPlugin' -export default class SimpleReloadPlugin { +export default class CreateWebSocketServer { private readonly options: RunChromeExtensionInterface constructor(options: RunChromeExtensionInterface) { @@ -16,15 +14,13 @@ export default class SimpleReloadPlugin { apply(compiler: Compiler) { if (!this.options.manifestPath) return - if (!this.options.autoReload) return // Before all, rewrite the reload service file // with the user-provided port. - rewriteReloadPort(this.options.port!) + rewriteReloadPort(this.options.port) - // Start webSocket server to communicate - // with the extension. - const wss = startServer(this.options.port) + // Start webSocket server to communicate with the extension. + const wss = startServer(compiler, this.options.port) compiler.hooks.watchRun.tapAsync( 'RunChromeExtensionPlugin', @@ -45,9 +41,5 @@ export default class SimpleReloadPlugin { done() } ) - - new AddDependenciesPlugin({ - manifestPath: this.options.manifestPath - }).apply(compiler) } } diff --git a/packages/run-chrome-extension/src/steps/CreateWebSocketServer/rewriteReloadPort.ts b/packages/run-chrome-extension/src/steps/CreateWebSocketServer/rewriteReloadPort.ts new file mode 100644 index 00000000..614e48f4 --- /dev/null +++ b/packages/run-chrome-extension/src/steps/CreateWebSocketServer/rewriteReloadPort.ts @@ -0,0 +1,21 @@ +// import path from 'path' +// import fs from 'fs' + +export default function replacePortInFile(port: number = 8082) { + // const filePath = path.resolve( + // __dirname, + // '../extensions/reload-extension/reloadService.js' + // ) + // fs.readFile(filePath, 'utf8', (err, data) => { + // if (err) { + // console.error(`Error reading file: ${err.message}`) + // return + // } + // const updatedData = data.replace(/__PORT__/g, port.toString()) + // fs.writeFile(filePath, updatedData, 'utf8', (err) => { + // if (err) { + // console.error(`Error writing to file: ${err.message}`) + // } + // }) + // }) +} diff --git a/packages/run-chrome-extension/plugins/SimpleReloadPlugin/webSocketServer/broadcastMessage.ts b/packages/run-chrome-extension/src/steps/CreateWebSocketServer/webSocketServer/broadcastMessage.ts similarity index 100% rename from packages/run-chrome-extension/plugins/SimpleReloadPlugin/webSocketServer/broadcastMessage.ts rename to packages/run-chrome-extension/src/steps/CreateWebSocketServer/webSocketServer/broadcastMessage.ts diff --git a/packages/run-chrome-extension/src/steps/CreateWebSocketServer/webSocketServer/messageDispatcher.ts b/packages/run-chrome-extension/src/steps/CreateWebSocketServer/webSocketServer/messageDispatcher.ts new file mode 100644 index 00000000..c4916d74 --- /dev/null +++ b/packages/run-chrome-extension/src/steps/CreateWebSocketServer/webSocketServer/messageDispatcher.ts @@ -0,0 +1,67 @@ +import path from 'path' +import WebSocket from 'ws' +import manifestFields from 'browser-extension-manifest-fields' +import {type RunChromeExtensionInterface} from '../../../../types' + +function dispatchMessage( + server: WebSocket.Server, + message: { + changedFile: string + } +) { + server.clients.forEach((client) => { + if (client.readyState === WebSocket.OPEN) { + client.send(JSON.stringify(message)) + } + }) +} + +export default function messageDispatcher( + server: WebSocket.Server, + options: RunChromeExtensionInterface, + updatedFile: string +) { + if (!updatedFile) return + const manifestHtml = manifestFields(options.manifestPath!).html + const manifestLocales = manifestFields(options.manifestPath!).locales + const manifestScripts = manifestFields(options.manifestPath!).scripts + + // Ensure the manifest itself is watched. + if (path.basename(updatedFile) === 'manifest.json') { + dispatchMessage(server, { + changedFile: 'manifest.json' + }) + } + + // Handle HTML files + Object.entries(manifestHtml).forEach(([, entryData]) => { + if (entryData?.html === updatedFile) { + dispatchMessage(server, { + changedFile: 'html' + }) + } + }) + + // Handle _locales files + manifestLocales.forEach((path) => { + if (path.includes(updatedFile)) { + dispatchMessage(server, { + changedFile: 'locale' + }) + } + }) + + // Handle background/content/user scripts. + Object.entries(manifestScripts).forEach(([entryName, entryData]) => { + const entryDataArr = Array.isArray(entryData) ? entryData : [entryData] + const entryFiles = Object.values(entryDataArr).flatMap((arr) => arr) + + if (entryFiles.includes(updatedFile)) { + if (entryName === 'service_worker') { + dispatchMessage(server, { + changedFile: 'service_worker' + }) + } + } + }) +} diff --git a/packages/run-chrome-extension/src/steps/CreateWebSocketServer/webSocketServer/startServer.ts b/packages/run-chrome-extension/src/steps/CreateWebSocketServer/webSocketServer/startServer.ts new file mode 100644 index 00000000..151fbf8f --- /dev/null +++ b/packages/run-chrome-extension/src/steps/CreateWebSocketServer/webSocketServer/startServer.ts @@ -0,0 +1,65 @@ +import {type Compiler} from 'webpack' +import WebSocket from 'ws' + +export default function (compiler: Compiler, port?: number) { + const webSocketServer = new WebSocket.Server({ + host: 'localhost', + port + }) + + webSocketServer.on('connection', (ws) => { + ws.send(JSON.stringify({status: 'serverReady'})) + if (process.env.EXTENSION_ENV === 'development') { + console.log( + '\n[extension-create setup] Starting a new Chrome instance...\n' + ) + } + + ws.on('error', (error) => { + console.log('Error', error) + webSocketServer.close() + }) + + ws.on('close', () => { + console.log('[😓] Watch mode closed. Exiting...\n') + webSocketServer.close() + }) + + // We're only ready when the extension says so + ws.on('message', (msg) => { + const message = JSON.parse(msg.toString()) + + if (message.status === 'clientReady') { + if (!message.data) { + compiler.getInfrastructureLogger('🧩').error( + '[run-chrome] No data received from client.' + ) + // throw new Error('[run-chrome] No data received from client.') + } + + const {id, manifest} = message.data + const isMutableId = id !== manifest.id + // TODO: cezaraugusto Also interesting: + // • Size: 1.2 MB + // • Static Pages: /pages + // • Static Resources: /public + // • Web Accessible Resources: /web_accessible_resources + // const logger = compiler.getInfrastructureLogger('🧩') + // logger.info(`${manifest.name}`) + // logger.info(`Version: ${manifest.version}`) + // logger.info(`ID: ${id} (${isMutableId ? 'dynamic' : 'fixed'})`) + // logger.info(`Permissions: ${manifest.permissions.join(', ')}`) + // logger.info(`Settings URL: chrome://extensions/?id=${id}`) + // logger.info(`Started a new Chrome instance. Extension ready.\n`) + console.log(`• Name: ${manifest.version}`) + console.log(`• Version: ${manifest.version}`) + console.log(`• ID: ${id} (${isMutableId ? 'dynamic' : 'fixed'})`) + console.log(`• Permissions: ${manifest.permissions.join(', ')}`) + console.log(`• Settings URL: chrome://extensions/?id=${id}\n`) + console.log(`[🧩] Started a new Chrome instance. Extension ready.\n`) + } + }) + }) + + return webSocketServer +} diff --git a/packages/run-chrome-extension/plugins/RunChromePlugin/chrome/browser.config.ts b/packages/run-chrome-extension/src/steps/RunChromePlugin/chrome/browser.config.ts similarity index 88% rename from packages/run-chrome-extension/plugins/RunChromePlugin/chrome/browser.config.ts rename to packages/run-chrome-extension/src/steps/RunChromePlugin/chrome/browser.config.ts index 003cf53f..8e42dd43 100644 --- a/packages/run-chrome-extension/plugins/RunChromePlugin/chrome/browser.config.ts +++ b/packages/run-chrome-extension/src/steps/RunChromePlugin/chrome/browser.config.ts @@ -23,10 +23,6 @@ export default function browserConfig( const extensionsToLoad = [userBrowserExtension, managerExtension] if (configOptions.autoReload) { - console.log( - 'nao eh pra tu esexaaskldaskldaskldaksldhklasjdlaksjdlasjdlaskjdlasjdaslkj', - configOptions - ) extensionsToLoad.push(reloadExtension) } diff --git a/packages/run-chrome-extension/plugins/RunChromePlugin/chrome/createUserDataDir.ts b/packages/run-chrome-extension/src/steps/RunChromePlugin/chrome/createUserDataDir.ts similarity index 100% rename from packages/run-chrome-extension/plugins/RunChromePlugin/chrome/createUserDataDir.ts rename to packages/run-chrome-extension/src/steps/RunChromePlugin/chrome/createUserDataDir.ts diff --git a/packages/run-chrome-extension/plugins/RunChromePlugin/index.ts b/packages/run-chrome-extension/src/steps/RunChromePlugin/index.ts similarity index 100% rename from packages/run-chrome-extension/plugins/RunChromePlugin/index.ts rename to packages/run-chrome-extension/src/steps/RunChromePlugin/index.ts diff --git a/packages/run-chrome-extension/src/steps/SetupReloadStrategy/AddRuntimeListener.ts b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/AddRuntimeListener.ts new file mode 100644 index 00000000..623bdc2b --- /dev/null +++ b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/AddRuntimeListener.ts @@ -0,0 +1,22 @@ +import path from 'path' +import {type Compiler} from 'webpack' + +export default function AddRuntimeListener( + compiler: Compiler, + manifestPath?: string +) { + compiler.options.module.rules.push({ + test: /\.(t|j)sx?$/, + use: [ + { + loader: path.resolve( + __dirname, + './loaders/InjectBackgroundRuntimeLoader' + ), + options: { + manifestPath + } + } + ] + }) +} diff --git a/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/index.ts b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/index.ts new file mode 100644 index 00000000..5b3120fb --- /dev/null +++ b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/index.ts @@ -0,0 +1,108 @@ +import type webpack from 'webpack' +import {Compilation, sources} from 'webpack' +import {patchV2CSP, patchV3CSP} from './patchCSP' +import {patchWebResourcesV2, patchWebResourcesV3} from './patchWebResources' +import patchBackground from './patchBackground' +// import patchContentScripts from './patchContentScripts' +import injectScriptToPage from './injectScriptToPage' +import {type RunChromeExtensionInterface} from '../../../types' + +class ApplyManifestDevDefaultsPlugin { + private readonly manifestPath?: string + + constructor(options: RunChromeExtensionInterface) { + this.manifestPath = options.manifestPath + } + + private generateManifestPatches( + compilation: webpack.Compilation + // manifest: any + ) { + const manifest = compilation.getAsset('manifest.json') + ? JSON.parse( + (compilation.getAsset('manifest.json')?.source.source() as string) || + '{}' + ) + : require(this.manifestPath!) + + const patchedManifest = { + // Preserve all other user entries + ...manifest, + // Allow usig source map based on eval, using Manifest V2. + // script-src 'self' 'unsafe-eval'; + // See https://github.com/awesome-webextension/webpack-target-webextension#source-map. + // For V3, see https://developer.chrome.com/docs/extensions/migrating/improve-security/#update-csp + content_security_policy: + manifest.manifest_version === 2 + ? patchV2CSP(manifest.content_security_policy) + : {extension_pages: patchV3CSP(manifest.content_security_policy)}, + + // Set permission scripting as it's required for reload to work + // with content scripts in v3. See: + // https://github.com/awesome-webextension/webpack-target-webextension#content-script + ...(manifest.manifest_version === 3 + ? manifest.permissions + ? {permissions: ['scripting', ...manifest.permissions]} + : {permissions: ['scripting']} + : // : {permissions: []} + {}), + + // Use content_scripts to inject the reload dispatcher. + // content_scripts: patchContentScripts(manifest), + + // Use the background script to inject the reload handler. + ...patchBackground(manifest), + + // We need to allow /*.json', '/*.js', '/*.css to be able to load + // the reload script and the reload handler assets. + web_accessible_resources: + manifest.manifest_version === 3 + ? patchWebResourcesV3(manifest) + : patchWebResourcesV2(manifest) + } + + const source = JSON.stringify(patchedManifest, null, 2) + const rawSource = new sources.RawSource(source) + + if (compilation.getAsset('manifest.json')) { + compilation.updateAsset('manifest.json', rawSource) + } else { + // compilation.emitAsset('manifest.json', rawSource) + } + } + + apply(compiler: webpack.Compiler) { + compiler.hooks.thisCompilation.tap('ReloadPlugin', (compilation) => { + const Error = compiler.webpack.WebpackError + + // This plugin only works during development + if (compiler.options.mode === 'production') return + + compilation.hooks.processAssets.tap( + { + name: 'ReloadPlugin', + // Summarize the list of existing assets. + stage: Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE + }, + (_assets) => { + if (!this.manifestPath) { + const errorMessage = + 'No manifest.json found in your extension bundle. Unable to patch manifest.json.' + + if (!!compilation && !!Error) { + compilation.errors.push( + new Error(`[ReloadPlugin]: ${errorMessage}`) + ) + } + return + } + + // Most of the patching happens in the manifest.json file. + this.generateManifestPatches(compilation) + } + ) + }) + } +} + +export default ApplyManifestDevDefaultsPlugin diff --git a/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/injectScriptToPage.ts b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/injectScriptToPage.ts new file mode 100644 index 00000000..b18647b6 --- /dev/null +++ b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/injectScriptToPage.ts @@ -0,0 +1,36 @@ +import type webpack from 'webpack' +import {sources} from 'webpack' + +export default function injectScriptToPage( + compilation: webpack.Compilation, + Error: typeof webpack.WebpackError, + backgroundPage: string +) { + const backgroundPageSource = compilation + .getAsset(backgroundPage) + ?.source.source() + .toString() + + if (!backgroundPageSource || backgroundPageSource === '') return + + // Get the path to the background page + const fragment = + '' + + // Read the file and inject the fragment + if (!backgroundPageSource?.includes('')) { + const errorMessage = `Missing tag in ${backgroundPage}` + + if (!!compilation && !!Error) { + compilation.errors.push(new Error(`[ReloadPlugin]: ${errorMessage}`)) + } + + return + } + + const source = backgroundPageSource.replace('', fragment) + const rawSource = new sources.RawSource(source) + + // Update asset list + compilation.updateAsset(backgroundPage, rawSource) +} diff --git a/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchBackground.ts b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchBackground.ts new file mode 100644 index 00000000..183bc50a --- /dev/null +++ b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchBackground.ts @@ -0,0 +1,53 @@ +export default function patchBackground(manifest: any) { + if (!manifest.background) { + if (manifest.version === 2) { + return { + background: { + ...manifest.background, + scripts: ['extension-reloader.js'] + } + } + } + + return { + background: { + ...manifest.background, + service_worker: 'extension-reloader.js' + } + } + } + + if (manifest.background.scripts) { + return { + background: { + ...manifest.background, + scripts: manifest.background.scripts + } + } + } + + if (manifest.background.page) { + return { + background: { + ...manifest.background, + page: manifest.background.page + } + } + } + + if (manifest.background.service_worker) { + return { + background: { + ...manifest.background, + service_worker: manifest.background.service_worker + } + } + } + + return { + background: { + ...manifest.background, + scripts: ['extension-reloader.js'] + } + } +} diff --git a/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchCSP.ts b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchCSP.ts new file mode 100644 index 00000000..bcf14133 --- /dev/null +++ b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchCSP.ts @@ -0,0 +1,46 @@ +import parse from 'content-security-policy-parser' + +export function patchV2CSP(policy: string) { + if (!policy) { + return ( + "script-src 'self' 'unsafe-eval' blob: filesystem:;" + + "object-src 'self' blob: filesystem:;" + ) + } + + const csp = parse(policy) + policy = '' + + if (!csp['script-src']) { + csp['script-src'] = ["'self' 'unsafe-eval' blob: filesystem:"] + } + + if (!csp['script-src'].includes("'unsafe-eval'")) { + csp['script-src'].push("'unsafe-eval'") + } + + for (const k in csp) { + policy += `${k} ${csp[k].join(' ')};` + } + + return policy +} + +export function patchV3CSP(policy: string) { + if (!policy) { + return "script-src 'self'; " + "object-src 'self';" + } + + const csp = parse(policy) + policy = '' + + if (!csp['script-src']) { + csp['script-src'] = ["'self'"] + } + + for (const k in csp) { + policy += `${k} ${csp[k].join(' ')};` + } + + return policy +} diff --git a/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchContentScripts.ts b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchContentScripts.ts new file mode 100644 index 00000000..bc6b485c --- /dev/null +++ b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchContentScripts.ts @@ -0,0 +1,14 @@ +export default function patchContentScripts(manifest: any) { + // const contentScriptEntry = { + // matches: [''], + // js: ['extension-dispatch-reloader.js'] + // } + + // if (manifest.content_scripts) { + // manifest.content_scripts.push(contentScriptEntry) + // } else { + // manifest.content_scripts = [contentScriptEntry] + // } + + return manifest.content_scripts +} diff --git a/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchWebResources.ts b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchWebResources.ts new file mode 100644 index 00000000..200a629e --- /dev/null +++ b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/ApplyManifestDevDefaults/patchWebResources.ts @@ -0,0 +1,53 @@ +function patchWebResourcesV2(manifest: Record) { + const defaultResources = ['/*.json', '/*.js', '/*.css'] + const resources: string[] | null = manifest.web_accessible_resources + + if (!resources || resources.length === 0) { + return defaultResources + } + + const webResources = new Set(resources) + + for (const resource of defaultResources) { + webResources.add(resource) + } + + return Array.from(webResources) +} + +interface ResourceEntry { + resources: string[] + matches: string[] +} + +function patchWebResourcesV3(manifest: any) { + const defaultResources = ['/*.json', '/*.js', '/*.css'] + const resources: ResourceEntry[] | null = manifest.web_accessible_resources + + if (!resources || resources.length === 0) { + return [ + { + resources: defaultResources, + matches: [''] + } + ] + } + + const updatedResources = resources.map((entry) => { + const resourceSet = new Set(entry.resources) + + defaultResources.forEach((resource) => { + if (entry && entry.resources) { + if (!entry.resources.includes(resource)) { + resourceSet.add(resource) + } + } + }) + + return {...entry, resources: Array.from(resourceSet)} + }) + + return updatedResources +} + +export {patchWebResourcesV2, patchWebResourcesV3} diff --git a/packages/run-chrome-extension/src/steps/SetupReloadStrategy/TargetWebExtensionPlugin/index.ts b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/TargetWebExtensionPlugin/index.ts new file mode 100644 index 00000000..5dd5c6e5 --- /dev/null +++ b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/TargetWebExtensionPlugin/index.ts @@ -0,0 +1,42 @@ +import fs from 'fs' +import type webpack from 'webpack' +import WebExtension from 'webpack-target-webextension' +import {type RunChromeExtensionInterface} from '../../../types' +import {getFilepath} from '../../../helpers/getResourceName' + +class TargetWebExtensionPlugin { + private readonly manifestPath?: string + + constructor(options: RunChromeExtensionInterface) { + this.manifestPath = options.manifestPath + } + + private getEntryName(manifestPath: string) { + const manifest = require(manifestPath) + + if (manifest.background) { + if (manifest.manifest_version === 3) { + return {serviceWorkerEntry: getFilepath('service_worker')} + } + + if (manifest.manifest_version === 2) { + return {pageEntry: getFilepath('background')} + } + } + + return {pageEntry: getFilepath('background')} + } + + public apply(compiler: webpack.Compiler) { + if (!this.manifestPath || !fs.lstatSync(this.manifestPath).isFile()) { + return + } + + new WebExtension({ + background: this.getEntryName(this.manifestPath), + weakRuntimeCheck: true + }).apply(compiler) + } +} + +export default TargetWebExtensionPlugin diff --git a/packages/run-chrome-extension/src/steps/SetupReloadStrategy/index.ts b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/index.ts new file mode 100644 index 00000000..61a84b36 --- /dev/null +++ b/packages/run-chrome-extension/src/steps/SetupReloadStrategy/index.ts @@ -0,0 +1,33 @@ +import type webpack from 'webpack' +import {type RunChromeExtensionInterface} from '../../types' +import ApplyManifestDevDefaults from './ApplyManifestDevDefaults' +import TargetWebExtensionPlugin from './TargetWebExtensionPlugin' +import AddRuntimeListener from './AddRuntimeListener' + +class SetupReloadStrategy { + private readonly manifestPath?: string + + constructor(options: RunChromeExtensionInterface) { + this.manifestPath = options.manifestPath + } + + public apply(compiler: webpack.Compiler) { + // Ensure the background scripts (and service_worker) can + // receive messages from the extension reload plugin. + AddRuntimeListener(compiler, this.manifestPath) + + // Patch the manifest with useful transforms during development, + // such as bypassing CSP, adding useful defaults to web_accessible_resources, + // and adding a background script to inject the HMR reloader to all files. + new ApplyManifestDevDefaults({ + manifestPath: this.manifestPath + }).apply(compiler) + + // Add the HMR reloader to the entry point. + new TargetWebExtensionPlugin({ + manifestPath: this.manifestPath + }).apply(compiler) + } +} + +export default SetupReloadStrategy diff --git a/packages/run-chrome-extension/src/types.ts b/packages/run-chrome-extension/src/types.ts new file mode 100644 index 00000000..e1f84192 --- /dev/null +++ b/packages/run-chrome-extension/src/types.ts @@ -0,0 +1,12 @@ +export interface RunChromeExtensionInterface extends PluginOptions { + manifestPath?: string + extensionPath?: string +} + +export interface PluginOptions { + port?: number + browserFlags?: string[] + userDataDir?: string + startingUrl?: string + autoReload?: boolean | 'background' +} diff --git a/packages/scripts-plugin/.editorconfig b/packages/scripts-plugin/.editorconfig deleted file mode 100644 index c3dcfccd..00000000 --- a/packages/scripts-plugin/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -indent_style = space -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[{*.json,*.yml}] -indent_style = space -indent_size = 2 diff --git a/packages/scripts-plugin/.github/workflows/ci.yml b/packages/scripts-plugin/.github/workflows/ci.yml deleted file mode 100644 index 5dbc8665..00000000 --- a/packages/scripts-plugin/.github/workflows/ci.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: CI -on: push -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install modules - run: yarn - - name: Run tests - run: yarn test diff --git a/packages/scripts-plugin/.gitignore b/packages/scripts-plugin/.gitignore deleted file mode 100644 index 321d37c9..00000000 --- a/packages/scripts-plugin/.gitignore +++ /dev/null @@ -1,239 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.*# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -todo.md - -examples -todo.md -spec/ -.github -demo/ diff --git a/packages/scripts-plugin/LICENSE b/packages/scripts-plugin/LICENSE deleted file mode 100644 index 52420dc4..00000000 --- a/packages/scripts-plugin/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Cezar Augusto (https://cezaraugusto.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/packages/scripts-plugin/README.md b/packages/scripts-plugin/README.md index f1c553a0..ac3f2d27 100644 --- a/packages/scripts-plugin/README.md +++ b/packages/scripts-plugin/README.md @@ -5,7 +5,7 @@ # webpack-browser-extension-scripts-plugin [![workflow][action-image]][action-url] [![npm][npm-image]][npm-url] -> webpack plugin to handle script assets (background, content, service worker) from browser extensions +> webpack plugin to handle manifest script assets (content_scripts, background.scripts, service_worker, user_scripts) from browser extensions Properly output script files based on the manifest fields declared in the manifest file. @@ -35,7 +35,8 @@ module.exports = { // ...other webpack config, plugins: [ new ScriptsPlugin({ - manifestPath: '' + manifestPath: '', + exclude: [''] }) ] } @@ -45,15 +46,15 @@ module.exports = { Given a manifest file, grab all possible JavaScript fields and add them as [webpack entry points](https://webpack.js.org/concepts/entry-points/#root). -```json5 +```json // myproject/manifest.json { - manifest_version: 2, - version: '0.1', - name: 'myextension', - author: 'Cezar Augusto', - background: { - scripts: ['background1.js', 'background2.js'] + "manifest_version": 2, + "version": "0.1", + "name": "myextension", + "author": "Cezar Augusto", + "background": { + "scripts": ["background1.js", "background2.js"] } } ``` @@ -86,14 +87,9 @@ module.exports = { ``` - myproject/ - - background1.js - - background2.js + - background/index.js ``` -## Static dir - -Define a folder to handle static assets. Defaults to `/static/`. - ## License MIT (c) Cezar Augusto. diff --git a/packages/scripts-plugin/demo/content-scripts-mv2/webpack.config.js b/packages/scripts-plugin/demo/content-scripts-mv2/webpack.config.js index 61fa1d86..3f6b8ac8 100644 --- a/packages/scripts-plugin/demo/content-scripts-mv2/webpack.config.js +++ b/packages/scripts-plugin/demo/content-scripts-mv2/webpack.config.js @@ -25,7 +25,7 @@ const config = { { test: /\.css$/, use: ['css-loader'] - }, + } ] }, devServer: { diff --git a/packages/scripts-plugin/helpers/getResourceName.ts b/packages/scripts-plugin/helpers/getResourceName.ts deleted file mode 100644 index aebb755d..00000000 --- a/packages/scripts-plugin/helpers/getResourceName.ts +++ /dev/null @@ -1,39 +0,0 @@ -import path from 'path' - -function getOutputExtname(extname: string) { - switch (extname) { - case '.css': - return '.css' - case '.js': - case '.jsx': - case '.ts': - case '.tsx': - case '.mjs': - return '.js' - case '.html': - return extname - case 'empty': - return '' - case 'static': - case 'staticSrc': - case 'staticHref': - default: - return extname - } -} - -export function getFilePathWithinFolder(feature: string, filePath: string) { - const entryExt = path.extname(filePath) - const entryName = path.basename(filePath, entryExt) - const extname = getOutputExtname(entryExt) - - return `${feature}/${entryName}${extname}` -} - -export function getFilePathSplitByDots(feature: string, filePath: string) { - const entryExt = path.extname(filePath) - const entryName = path.basename(filePath, entryExt) - const extname = getOutputExtname(entryExt) - - return `${feature}.${entryName}${extname}` -} diff --git a/packages/scripts-plugin/loaders/InjectBackgroundAcceptLoader.ts b/packages/scripts-plugin/loaders/InjectBackgroundAcceptLoader.ts new file mode 100644 index 00000000..878eabc0 --- /dev/null +++ b/packages/scripts-plugin/loaders/InjectBackgroundAcceptLoader.ts @@ -0,0 +1,55 @@ +import path from 'path' +import {urlToRequest} from 'loader-utils' +import {validate} from 'schema-utils' +import {type LoaderContext} from 'webpack' +import {type Schema} from 'schema-utils/declarations/validate' + +const schema: Schema = { + type: 'object', + properties: { + test: { + type: 'string' + }, + manifestPath: { + type: 'string' + } + } +} + +interface InjectBackgroundAcceptContext extends LoaderContext { + getOptions: () => { + manifestPath: string + } +} + +export default function (this: InjectBackgroundAcceptContext, source: string) { + const options = this.getOptions() + const manifestPath = options.manifestPath + const projectPath = path.dirname(manifestPath) + const manifest = require(manifestPath) + + validate(schema, options, { + name: 'Inject HMR (background.scripts) Accept', + baseDataPath: 'options' + }) + + if (this._compilation?.options.mode === 'production') return source + + const url = urlToRequest(this.resourcePath) + const reloadCode = ` +if (import.meta.webpackHot) { import.meta.webpackHot.accept() }; + ` + + if (manifest.background) { + if (manifest.background.scripts) { + for (const bgScript of manifest.background.scripts) { + const absoluteUrl = path.resolve(projectPath, bgScript) + if (url.includes(absoluteUrl)) { + return `${reloadCode}${source}` + } + } + } + } + + return source +} diff --git a/packages/scripts-plugin/loaders/InjectContentAcceptLoader.ts b/packages/scripts-plugin/loaders/InjectContentAcceptLoader.ts new file mode 100644 index 00000000..3b5f27e4 --- /dev/null +++ b/packages/scripts-plugin/loaders/InjectContentAcceptLoader.ts @@ -0,0 +1,67 @@ +import path from 'path' +import {urlToRequest} from 'loader-utils' +import {validate} from 'schema-utils' +import {type LoaderContext} from 'webpack' +import {type Schema} from 'schema-utils/declarations/validate' +import {isUsingReact} from '../src/helpers/isUsingReact' + +const schema: Schema = { + type: 'object', + properties: { + test: { + type: 'string' + }, + manifestPath: { + type: 'string' + } + } +} + +interface InjectContentAcceptContext extends LoaderContext { + getOptions: () => { + manifestPath: string + } +} + +export default function (this: InjectContentAcceptContext, source: string) { + const options = this.getOptions() + const manifestPath = options.manifestPath + const projectPath = path.dirname(manifestPath) + const manifest = require(manifestPath) + + validate(schema, options, { + name: 'Inject HMR (content_script) Accept', + baseDataPath: 'options' + }) + + if (this._compilation?.options.mode === 'production') return source + + const url = urlToRequest(this.resourcePath) + const reloadCode = ` +if (import.meta.webpackHot) { import.meta.webpackHot.accept() }; + ` + + // Let the react reload plugin handle the reload. + // WARN: Removing this check will cause the content script to pile up + // in the browser. This is something related to the react reload plugin + // or the webpack-target-webextension plugin. + // TODO: cezaraugusto because of this, entry files of content_scripts + // written in JSX doesn't reload. This is a bug. + if (isUsingReact(projectPath)) return source + + if (manifest.content_scripts) { + for (const contentScript of manifest.content_scripts) { + if (!contentScript.js) continue + + for (const js of contentScript.js) { + const absoluteUrl = path.resolve(projectPath, js) + + if (url.includes(absoluteUrl)) { + return `${reloadCode}${source}` + } + } + } + } + + return source +} diff --git a/packages/scripts-plugin/loaders/InjectContentCssImportLoader.ts b/packages/scripts-plugin/loaders/InjectContentCssImportLoader.ts new file mode 100644 index 00000000..d58171b3 --- /dev/null +++ b/packages/scripts-plugin/loaders/InjectContentCssImportLoader.ts @@ -0,0 +1,134 @@ +import path from 'path' +import {urlToRequest} from 'loader-utils' +import {validate} from 'schema-utils' +import manifestFields from 'browser-extension-manifest-fields' +import {type LoaderContext} from 'webpack' +import {type Schema} from 'schema-utils/declarations/validate' +import {getFilepath} from '../src/helpers/getResourceName' + +const schema: Schema = { + type: 'object', + properties: { + test: { + type: 'string' + }, + manifestPath: { + type: 'string' + } + } +} + +interface InjectContentCssImportContext extends LoaderContext { + getOptions: () => { + manifestPath: string + } +} + +function getCssEntriesToImport(manifestPath: string, absoluteUrl: string) { + const scriptFields = manifestFields(manifestPath).scripts + + const cssEntries = [] + + for (const field of Object.entries(scriptFields)) { + const [feature, scriptFilePath] = field + + if (feature.startsWith('content_scripts')) { + const scripts = Array.isArray(scriptFilePath) + ? scriptFilePath + : [scriptFilePath] + + if (scripts.length) { + const contentScriptCssEntries = scripts.filter((scriptEntry) => { + return ( + scriptEntry?.endsWith('.css') || + scriptEntry?.endsWith('.scss') || + scriptEntry?.endsWith('.sass') || + scriptEntry?.endsWith('.less') + ) + }) + + const importEntries = contentScriptCssEntries.map((cssEntry) => { + const urlDir = path.dirname(absoluteUrl) + const relativePath = path.relative(urlDir, cssEntry!) + return `import("./${relativePath}");` + }) + + cssEntries.push(importEntries) + } + } + } + + return cssEntries +} + +export default function (this: InjectContentCssImportContext, source: string) { + const options = this.getOptions() + const manifestPath = options.manifestPath + const manifest = require(manifestPath) + const projectPath = path.dirname(manifestPath) + + validate(schema, options, { + name: 'Inject (dynamic) import() to CSS', + baseDataPath: 'options' + }) + + if (this._compilation?.options.mode === 'production') return source + + const url = urlToRequest(this.resourcePath) + + for (const [ + contentIndex, + contentScript + ] of manifest.content_scripts.entries()) { + if (contentScript.js) { + for (const [fileIndex, js] of contentScript.js.entries()) { + // All content_script JS files of each content_script.matches + // are bundled together, so we only need to add the + // dynamic import() to the first file. + if (fileIndex === 0) { + const absoluteUrl = path.resolve(projectPath, js) + + if (url.includes(absoluteUrl)) { + const cssEntriesToImport = getCssEntriesToImport( + manifestPath, + absoluteUrl + ) + + if (!cssEntriesToImport) return source + + const thisScriptImportEntries = + cssEntriesToImport[contentIndex].join('\n') + + const fakeContentScriptCssFileText = ` +/** + * During development, we extract all content_script CSS files + * and add them as dynamic imports to the content_script JS file, + * so that we can reload them on the fly. + * However, we need to add a fake CSS file to the manifest + * so that the extension can be loaded without missing CSS files. + * + * This is what this file does ;) + * + * During production, we don't need to do this because we + * actually add the CSS files to the content_script bundle. +*/ + ` + // This filename is a hack, but it works. + const fakeContentScriptCssFile = getFilepath( + `content_scripts-${contentIndex}` + ) + + this.emitFile( + `${fakeContentScriptCssFile}.css`, + fakeContentScriptCssFileText + ) + + return `${thisScriptImportEntries}${source}` + } + } + } + } + } + + return source +} diff --git a/packages/scripts-plugin/module.ts b/packages/scripts-plugin/module.ts index ca9f521e..39c44ead 100644 --- a/packages/scripts-plugin/module.ts +++ b/packages/scripts-plugin/module.ts @@ -1,206 +1,50 @@ -import path from 'path' -import fs from 'fs' -import webpack, {sources, Compilation, type Compiler} from 'webpack' +import webpack from 'webpack' import {type ScriptsPluginInterface} from './types' - -// Manifest fields -import manifestFields from 'browser-extension-manifest-fields' - -import {getFilePathSplitByDots} from './helpers/getResourceName' -import shouldExclude from './helpers/shouldExclude' +import AddScriptsAndStyles from './src/steps/AddScriptsAndStyles' +import AddHmrAcceptCode from './src/steps/AddHmrAcceptCode' +import AddDynamicCssImport from './src/steps/AddDynamicCssImport' export default class HtmlPlugin { public readonly manifestPath: string public readonly exclude?: string[] - public readonly experimentalHMREnabled?: boolean constructor(options: ScriptsPluginInterface) { this.manifestPath = options.manifestPath this.exclude = options.exclude || [] - this.experimentalHMREnabled = options.experimentalHMREnabled || false - } - - private entryNotFoundWarn( - compilation: webpack.Compilation, - feature: string, - htmlFilePath: string - ) { - const hintMessage = `Check the \`${feature}\` field in your \`manifest.json\` file.` - const errorMessage = `File path \`${htmlFilePath}\` not found. ${hintMessage}` - - compilation.warnings.push( - new webpack.WebpackError(`[manifest.json]: ${errorMessage}`) - ) - } - - private shouldEmitFile(context: string, file: string) { - if (!this.exclude) return false - - const contextFile = path.relative(context, file) - const shouldExcludeFile = shouldExclude(this.exclude, contextFile) - - if (shouldExcludeFile) return false - - return true - } - - private generateScripts(compiler: Compiler) { - const scriptFields = manifestFields(this.manifestPath).scripts - - for (const field of Object.entries(scriptFields)) { - const [feature, scriptFilePath] = field - - const scriptEntries = Array.isArray(scriptFilePath) - ? scriptFilePath - : [scriptFilePath] - - for (const entry of scriptEntries) { - // Resources from the manifest lib can come as undefined. - if (entry) { - if (!fs.existsSync(entry)) return - - const fileName = getFilePathSplitByDots(feature, entry) - const context = compiler.options.context || '' - const fileNameExt = path.extname(fileName) - const fileNameNoExt = fileName.replace(fileNameExt, '') - - // Specifically for JS entries, we don't warn users - // at first that the file is missing. Instead, we - // ignore it and let other plugins throw the error. - // During watchRun, we can check if the file exists - // and recompile if it does. - if (this.shouldEmitFile(context, entry)) { - compiler.options.entry = { - ...compiler.options.entry, - // https://webpack.js.org/configuration/entry-context/#entry-descriptor - [fileNameNoExt]: { - import: [entry] - } - } - } - } - } - } } + /** + * Scripts plugin is responsible for handiling all the JavaScript + * (and CSS, for content_scripts) possible fields in manifest.json. + * + * Features supported: + * - content_scripts.js - HMR enabled + * - content_scripts.css - HMR enabled + * - background.scripts - HMR enabled + * - service_worker - Reloaded by chrome.runtime.reload() + * - user_scripts.api_scripts - HMR enabled + * + * The background (and service_worker) scripts are also + * responsible for receiving messages from the extension + * reload plugin. They are responsible for reloading the + * extension runtime when a change is detected in the + * manifest.json file and in the service_worker. + */ public apply(compiler: webpack.Compiler): void { - // Add the manifest scripts to the compilation. - this.generateScripts(compiler) - - // Add the CSS from content scripts to the compilation. - compiler.hooks.thisCompilation.tap( - 'BrowserExtensionHtmlPlugin', - (compilation) => { - compilation.hooks.processAssets.tap( - { - name: 'BrowserExtensionScriptsPlugin', - // Derive new assets from the existing assets. - stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONS - }, - (assets) => { - if (compilation.errors.length > 0) return - - const manifestSource = assets['manifest.json'] != null - ? assets['manifest.json'].source() - : require(this.manifestPath) - - const manifest = manifestSource - const scriptFields = manifestFields( - this.manifestPath, - manifest - ).scripts - - for (const field of Object.entries(scriptFields)) { - const [, scriptFilePath] = field - - const cssEntries = Array.isArray(scriptFilePath) - ? scriptFilePath.filter((entry) => entry.endsWith('.css')) - : [scriptFilePath].filter((entry) => entry?.endsWith('.css')) - - for (const field of Object.entries(cssEntries)) { - const [feature, resource] = field - - // Resources from the manifest lib can come as undefined. - if (resource) { - if (!fs.existsSync(resource)) return - - if (!fs.existsSync(resource)) { - this.entryNotFoundWarn(compilation, feature, resource) - return - } - - if (!fs.existsSync(resource)) { - this.entryNotFoundWarn(compilation, feature, resource) - return - } - - const source = fs.readFileSync(resource) - const rawSource = new sources.RawSource(source) - const context = compiler.options.context || '' - - if (this.shouldEmitFile(context, resource)) { - compilation.emitAsset( - getFilePathSplitByDots(`content_scripts-${feature}`, resource), - rawSource - ) - } - } - } - } - } - ) - } - ) - - // Ensure the CSS file is stored as file - // dependency so webpack can watch and trigger changes. - compiler.hooks.thisCompilation.tap( - 'BrowserExtensionHtmlPlugin', - (compilation) => { - compilation.hooks.processAssets.tap( - { - name: 'BrowserExtensionScriptsPlugin', - stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONS - }, - (assets) => { - if (compilation.errors?.length) return - - const manifestSource = assets['manifest.json'] != null - ? assets['manifest.json'].source() - : require(this.manifestPath) - - const manifest = manifestSource - const scriptFields = manifestFields( - this.manifestPath, - manifest - ).scripts - - for (const field of Object.entries(scriptFields)) { - const [, scriptFilePath] = field - - const cssEntries = Array.isArray(scriptFilePath) - ? scriptFilePath.filter((entry) => entry.endsWith('.css')) - : [scriptFilePath].filter((entry) => entry?.endsWith('.css')) - - for (const field of Object.entries(cssEntries)) { - const [, resource] = field - - if (resource) { - const fileDependencies = new Set(compilation.fileDependencies) - - if (fs.existsSync(resource)) { - if (!fileDependencies.has(resource)) { - fileDependencies.add(resource) - compilation.fileDependencies.add(resource) - } - } - } - } - } - } - ) - } - ) + // 1 - Adds the scripts entries from the manifest file + // (and stylesheets for content_scripts) to the compilation. + new AddScriptsAndStyles({ + manifestPath: this.manifestPath, + exclude: this.exclude + }).apply(compiler) + + // 2 - Ensure scripts (content, background, service_worker) + // are HMR enabled by adding the reload code. + AddHmrAcceptCode(compiler, this.manifestPath) + + // 3 - Ensure css for content_scripts defined in manifest.json + // are HMR enabled by adding them as dynamic imports to the entry point. + AddDynamicCssImport(compiler, this.manifestPath) } } diff --git a/packages/scripts-plugin/package.json b/packages/scripts-plugin/package.json index f4900f6e..adfcd59e 100644 --- a/packages/scripts-plugin/package.json +++ b/packages/scripts-plugin/package.json @@ -22,7 +22,7 @@ }, "scripts": { "watch": "yarn compile --watch", - "compile": "tsup-node ./module.ts --format cjs --dts --target=node16 --minify", + "compile": "tsup-node ./module.ts ./loaders/* --format cjs --dts --target=node16 --minify", "lint": "eslint \"./**/*.ts*\"", "test": "echo \"Note: no test specified\" && exit 0" }, diff --git a/packages/scripts-plugin/src/helpers/getResourceName.ts b/packages/scripts-plugin/src/helpers/getResourceName.ts new file mode 100644 index 00000000..6eae4f76 --- /dev/null +++ b/packages/scripts-plugin/src/helpers/getResourceName.ts @@ -0,0 +1,32 @@ +import path from 'path' + +function getOutputExtname(extname: string) { + switch (extname) { + case '.css': + return '.css' + case '.js': + case '.jsx': + case '.ts': + case '.tsx': + case '.mjs': + return '.js' + case '.html': + return extname + case 'empty': + return '' + case 'static': + case 'staticSrc': + case 'staticHref': + default: + return extname + } +} + +export function getFilepath(feature: string) { + if (feature.startsWith('content_scripts')) { + const [featureName, index] = feature.split('-') + return `${featureName}/script-${index}` + } + + return `${feature}/script` +} diff --git a/programs/develop/webpack/loaders/htmlLoaders.ts b/packages/scripts-plugin/src/helpers/isUsingReact.ts similarity index 65% rename from programs/develop/webpack/loaders/htmlLoaders.ts rename to packages/scripts-plugin/src/helpers/isUsingReact.ts index 9835f527..8ad43026 100644 --- a/programs/develop/webpack/loaders/htmlLoaders.ts +++ b/packages/scripts-plugin/src/helpers/isUsingReact.ts @@ -5,30 +5,20 @@ // ██████╔╝███████╗ ╚████╔╝ ███████╗███████╗╚██████╔╝██║ // ╚═════╝ ╚══════╝ ╚═══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═╝ -// import RemarkHTML from 'remark-html' +import path from 'path' +import fs from 'fs' -const htmlLoaders = [ - { - test: /\.html$/i, - loader: 'html-loader' - }, - { - test: /\.md$/, - use: [ - { - loader: 'html-loader' - } - // TODO - // { - // loader: 'remark-loader', - // options: { - // remarkOptions: { - // plugins: [RemarkHTML] - // } - // } - // } - ] +export function isUsingReact(projectDir: string) { + const packageJsonPath = path.join(projectDir, 'package.json') + + if (!fs.existsSync(packageJsonPath)) { + return false } -] -export default htmlLoaders + const packageJson = require(packageJsonPath) + const reactAsDevDep = + packageJson.devDependencies && packageJson.devDependencies.react + const reactAsDep = packageJson.dependencies && packageJson.dependencies.react + + return reactAsDevDep || reactAsDep +} diff --git a/packages/scripts-plugin/helpers/shouldExclude.ts b/packages/scripts-plugin/src/helpers/shouldExclude.ts similarity index 100% rename from packages/scripts-plugin/helpers/shouldExclude.ts rename to packages/scripts-plugin/src/helpers/shouldExclude.ts diff --git a/packages/scripts-plugin/src/steps/AddDynamicCssImport.ts b/packages/scripts-plugin/src/steps/AddDynamicCssImport.ts new file mode 100644 index 00000000..2badf1d4 --- /dev/null +++ b/packages/scripts-plugin/src/steps/AddDynamicCssImport.ts @@ -0,0 +1,22 @@ +import path from 'path' +import {type Compiler} from 'webpack' + +export default function AddDynamicCssImport( + compiler: Compiler, + manifestPath: string +) { + compiler.options.module.rules.push({ + test: /\.(t|j)sx?$/, + use: [ + { + loader: path.resolve( + __dirname, + './loaders/InjectContentCssImportLoader' + ), + options: { + manifestPath + } + } + ] + }) +} diff --git a/packages/scripts-plugin/src/steps/AddHmrAcceptCode.ts b/packages/scripts-plugin/src/steps/AddHmrAcceptCode.ts new file mode 100644 index 00000000..0f9e6775 --- /dev/null +++ b/packages/scripts-plugin/src/steps/AddHmrAcceptCode.ts @@ -0,0 +1,28 @@ +import path from 'path' +import {type Compiler} from 'webpack' + +export default function AddHmrAcceptCode( + compiler: Compiler, + manifestPath: string +) { + compiler.options.module.rules.push({ + test: /\.(t|j)sx?$/, + use: [ + { + loader: path.resolve( + __dirname, + './loaders/InjectBackgroundAcceptLoader' + ), + options: { + manifestPath + } + }, + { + loader: path.resolve(__dirname, './loaders/InjectContentAcceptLoader'), + options: { + manifestPath + } + } + ] + }) +} diff --git a/packages/scripts-plugin/src/steps/AddScriptsAndStyles.ts b/packages/scripts-plugin/src/steps/AddScriptsAndStyles.ts new file mode 100644 index 00000000..e0650dd7 --- /dev/null +++ b/packages/scripts-plugin/src/steps/AddScriptsAndStyles.ts @@ -0,0 +1,118 @@ +import path from 'path' +import fs from 'fs' +import webpack from 'webpack' + +// Manifest fields +import manifestFields from 'browser-extension-manifest-fields' + +import {type ScriptsPluginInterface} from '../../types' +import {getFilepath} from '../helpers/getResourceName' +import shouldExclude from '../helpers/shouldExclude' + +export default class AddScriptsAndStyles { + public readonly manifestPath: string + public readonly exclude?: string[] + + constructor(options: ScriptsPluginInterface) { + this.manifestPath = options.manifestPath + this.exclude = options.exclude || [] + } + + public apply(compiler: webpack.Compiler): void { + const IS_DEV = compiler.options.mode === 'development' + const scriptFields = manifestFields(this.manifestPath).scripts + + for (const field of Object.entries(scriptFields)) { + const [feature, scriptFilePath] = field + + const scriptEntries = Array.isArray(scriptFilePath) + ? scriptFilePath || [] + : scriptFilePath + ? [scriptFilePath] + : [] + + const validJsExtensions = compiler.options.resolve.extensions + const fileAssets = scriptEntries.filter((asset) => { + return ( + // File exists + fs.existsSync(asset) && + // Not in some public/ folder + !shouldExclude(this.exclude || [], asset) && + // During development, accept only js-like files + // for content_scripts. This is to avoid adding + // the CSS files to the entry point bundle, + // which would cause the CSS to load but not be + // hot reloaded. During production, we accept + // all files as there is no HMR. + IS_DEV && + validJsExtensions?.some((ext) => asset.endsWith(ext)) + ) + }) + + if (fileAssets.length) { + compiler.options.entry = { + ...compiler.options.entry, + // https://webpack.js.org/configuration/entry-context/#entry-descriptor + [getFilepath(feature)]: { + import: fileAssets + } + } + } + + // if all scriptEntires are actually css files, add a js file + // for each of them to the entry point, so that we can + // hot reload them. + if (IS_DEV) { + const fileAssets = scriptEntries.filter((asset) => { + return ( + // File exists + fs.existsSync(asset) && + // Not in some public/ folder + !shouldExclude(this.exclude || [], asset) + ) + }) + + const hasOnlyCssLikeFiles = fileAssets.every((asset) => { + return ( + asset.endsWith('.css') || + asset.endsWith('.scss') || + asset.endsWith('.sass') || + asset.endsWith('.less') + ) + }) + + if (hasOnlyCssLikeFiles && fileAssets.length) { + const jsEntryPath = `${path.join(__dirname, getFilepath(feature))}.js` + const cssEntryPath = `${path.join( + __dirname, + getFilepath(feature) + )}.css` + + const dirPath = path.dirname(jsEntryPath) + if (!fs.existsSync(dirPath)) { + fs.mkdirSync(dirPath, {recursive: true}) + } + + fs.writeFileSync( + jsEntryPath, + fileAssets.map((css) => `import("${css}");`).join('\n'), + 'utf-8' + ) + fs.writeFileSync( + cssEntryPath, + '/** Nothing to see here... */', + 'utf-8' + ) + + compiler.options.entry = { + ...compiler.options.entry, + // https://webpack.js.org/configuration/entry-context/#entry-descriptor + [getFilepath(feature)]: { + import: [jsEntryPath, cssEntryPath] + } + } + } + } + } + } +} diff --git a/packages/scripts-plugin/types.ts b/packages/scripts-plugin/types.ts index 2f1e3f63..fea36c34 100644 --- a/packages/scripts-plugin/types.ts +++ b/packages/scripts-plugin/types.ts @@ -1,5 +1,4 @@ export interface ScriptsPluginInterface { manifestPath: string exclude?: string[] - experimentalHMREnabled?: boolean } diff --git a/programs/cli/README.md b/programs/cli/README.md index d5f6cc08..7bdb7ae0 100644 --- a/programs/cli/README.md +++ b/programs/cli/README.md @@ -9,6 +9,8 @@ [npm-downloads-image]: https://badgen.net/npm/dm/extension-create [npm-downloads-url]: https://npmjs.ccom/package/extension-create +> # THIS PROJECT IS UNDER ACTIVE DEVELOPMENT + # extension-create [![Maintenance][maintenance-image]][maintenance-url] [![workflow][action-image]][action-url] [![Npm package version][npm-version-image]][npm-version-url] [![Npm package dependents][npm-dependents-image]][npm-dependents-url] [![Npm package monthly downloads][npm-downloads-image]][npm-downloads-url] Logo diff --git a/programs/create/steps/generateExtensionTypes.ts b/programs/create/steps/generateExtensionTypes.ts index 0625052c..58fdb2b2 100644 --- a/programs/create/steps/generateExtensionTypes.ts +++ b/programs/create/steps/generateExtensionTypes.ts @@ -34,9 +34,12 @@ export default async function generateExtensionTypes( /// try { + await fs.mkdir(projectPath, {recursive: true}) + console.log('🔷 - Writing extension type definitions...') + await fs.writeFile(extensionEnvFile, fileContent) } catch (err) { - console.log('🔴 - Failed to write the extension type definition.') + console.log('🔴 - Failed to write the extension type definition.', err) } } diff --git a/programs/create/templates/typescript/template/background/background.ts b/programs/create/templates/typescript/template/background/background.ts index 8eee052d..f3158be5 100644 --- a/programs/create/templates/typescript/template/background/background.ts +++ b/programs/create/templates/typescript/template/background/background.ts @@ -1,3 +1,3 @@ import helloExtension from './lib' -console.log(helloExtension) +console.log(helloExtension()) diff --git a/programs/develop/extensionDev.ts b/programs/develop/extensionDev.ts index 6c097234..399d81ae 100644 --- a/programs/develop/extensionDev.ts +++ b/programs/develop/extensionDev.ts @@ -41,7 +41,11 @@ export default async function extensionDev( try { if (isUsingTypeScript(projectPath)) { - console.log('🔷 - Using TypeScript config file: `tsconfig.json`') + if (process.env.EXTENSION_ENV === 'development') { + console.log( + '[extension-create setup] 🔷 - Using TypeScript config file: `tsconfig.json`' + ) + } await generateExtensionTypes(projectPath) } diff --git a/programs/develop/extensionStart.ts b/programs/develop/extensionStart.ts index e7b2c33d..018ba007 100644 --- a/programs/develop/extensionStart.ts +++ b/programs/develop/extensionStart.ts @@ -27,7 +27,11 @@ export default async function extensionStart( try { if (isUsingTypeScript(projectPath)) { - console.log('🔷 - Using TypeScript config file: `tsconfig.json`') + if (process.env.EXTENSION_ENV === 'development') { + console.log( + '[extension-create setup] 🔷 - Using TypeScript config file: `tsconfig.json`' + ) + } await generateExtensionTypes(projectPath) } diff --git a/programs/develop/package.json b/programs/develop/package.json index fa7a24a8..4fb1e061 100644 --- a/programs/develop/package.json +++ b/programs/develop/package.json @@ -26,8 +26,7 @@ "watch": "yarn compile --watch", "compile": "tsup-node ./module.ts --format cjs --dts --target=node16 --minify", "lint": "eslint \"./**/*.ts*\"", - "test": "echo \"Note: no test specified\" && exit 0", - "program:dev": "webpack serve --config ./webpack/webpack.dev.js" + "test": "echo \"Note: no test specified\" && exit 0" }, "dependencies": { "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10", @@ -69,13 +68,16 @@ "ts-loader": "^9.4.2", "webextension-polyfill": "^0.10.0", "webpack": "^5.81.0", + "webpack-browser-extension-common-errors-plugin": "*", "webpack-browser-extension-html-plugin": "*", "webpack-browser-extension-icons-plugin": "*", "webpack-browser-extension-json-plugin": "*", "webpack-browser-extension-locales-plugin": "*", "webpack-browser-extension-manifest-plugin": "*", + "webpack-browser-extension-manifest-compat-plugin": "*", + "webpack-browser-extension-resources-plugin": "*", "webpack-browser-extension-scripts-plugin": "*", - "webpack-dev-server": "^4.13.3", + "webpack-dev-server": "^4.7.4", "webpack-merge": "^5.8.0", "webpack-run-chrome-extension": "*", "xml-loader": "^1.2.1" diff --git a/programs/develop/steps/generateExtensionTypes.ts b/programs/develop/steps/generateExtensionTypes.ts index 3488796d..34b0d458 100644 --- a/programs/develop/steps/generateExtensionTypes.ts +++ b/programs/develop/steps/generateExtensionTypes.ts @@ -18,7 +18,7 @@ export default async function generateExtensionTypes(projectDir: string) { const fileContent = `\ // Required extension-create types for TypeScript projects. -// This file auto-generated and should not be excluded. +// This file is auto-generated and should not be excluded. // If you need extra types, consider creating a new *.d.ts and // referencing it in the "include" array in your tsconfig.json file. // See https://www.typescriptlang.org/tsconfig#include for info. @@ -27,16 +27,22 @@ export default async function generateExtensionTypes(projectDir: string) { ` try { - // If there is a extension-env.d.ts file already, return early. - if ((await fs.stat(extensionEnvFile)).isFile()) { - return - } - + // Check if the file exists + await fs.access(extensionEnvFile) + console.log('🔵 - extension-env.d.ts already exists.') + return // File exists, return early + } catch (err) { + // File does not exist, continue to write it console.log( '🔷 - TypeScript install detected. Writing extension type definitions...' ) - await fs.writeFile(extensionEnvFile, fileContent) - } catch (err) { - console.log('🔴 - Failed to write the extension type definition.') + try { + await fs.writeFile(extensionEnvFile, fileContent) + } catch (writeErr) { + console.log( + '🔴 - Failed to write the extension type definition.', + writeErr + ) + } } } diff --git a/programs/develop/webpack/config/getDevtoolOption.ts b/programs/develop/webpack/config/getDevtoolOption.ts index 15e798c6..11e8a9cf 100644 --- a/programs/develop/webpack/config/getDevtoolOption.ts +++ b/programs/develop/webpack/config/getDevtoolOption.ts @@ -26,7 +26,6 @@ export default function getDevToolOption(projectPath: string) { if (manifest.manifest_version === 3) { return 'cheap-source-map' } - // TODO: cezaraugusto check implcations of this with HMR - // return 'eval-cheap-source-map' - return 'cheap-source-map' + + return 'eval-cheap-source-map' } diff --git a/programs/develop/webpack/config/getPath.ts b/programs/develop/webpack/config/getPath.ts index 1629124e..e8d03863 100644 --- a/programs/develop/webpack/config/getPath.ts +++ b/programs/develop/webpack/config/getPath.ts @@ -7,23 +7,33 @@ import path from 'path' -function getOutputPath(projectPath: string, browser: string | undefined) { - const distFolderName = `_extension/${browser || 'chrome'}` +function getManifestPath(projectPath: string) { + return path.resolve(projectPath, 'manifest.json') +} +function getOutputPath(projectPath: string, browser: string | undefined) { // Output path points to a top level folder within the extension bundle - return path.resolve(projectPath, distFolderName) + // named after the browser. This is to allow for multiple browser builds + // to be placed in the same folder. + const distFolderName = `dist/${browser || 'chrome'}` + + return path.join(projectPath, distFolderName) } -function getWebpackPublicPath(projectPath: string) { +function getWebpackPublicPath(_projectPath?: string) { return '/' } function getStaticFolderPath(projectPath: string) { - return path.join(projectPath, 'public') + return path.join(projectPath, 'public/') +} + +function getDynamicPagesPath(_projectPath: string) { + return './pages' } function getWebResourcesFolderPath(projectPath: string) { - return path.join(projectPath, 'webResources') + return path.join(projectPath, 'web_accessible_resources') } function getModulesToResolve(projectPath: string) { @@ -31,10 +41,11 @@ function getModulesToResolve(projectPath: string) { } export { + getManifestPath, getOutputPath, getWebpackPublicPath, getStaticFolderPath, - // getDynamicPagesPath, + getDynamicPagesPath, getWebResourcesFolderPath, getModulesToResolve } diff --git a/programs/develop/webpack/config/logging.ts b/programs/develop/webpack/config/logging.ts new file mode 100644 index 00000000..7c206ec2 --- /dev/null +++ b/programs/develop/webpack/config/logging.ts @@ -0,0 +1,53 @@ +// ██████╗ ███████╗██╗ ██╗███████╗██╗ ██████╗ ██████╗ +// ██╔══██╗██╔════╝██║ ██║██╔════╝██║ ██╔═══██╗██╔══██╗ +// ██║ ██║█████╗ ██║ ██║█████╗ ██║ ██║ ██║██████╔╝ +// ██║ ██║██╔══╝ ╚██╗ ██╔╝██╔══╝ ██║ ██║ ██║██╔═══╝ +// ██████╔╝███████╗ ╚████╔╝ ███████╗███████╗╚██████╔╝██║ +// ╚═════╝ ╚══════╝ ╚═══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═╝ + +import {ClientConfiguration} from 'webpack-dev-server' + +const authorMode = process.env.EXTENSION_ENV === 'development' + +export function getWebpackStats() { + if (!authorMode) { + return 'minimal' + } + + return { + children: true, + errorDetails: true, + entrypoints: true, + colors: true, + assets: true, + chunks: true, + modules: true + } +} + +export function getDevServerClientOptions(): ClientConfiguration { + if (!authorMode) { + return { + logging: 'none', + progress: false, + overlay: { + errors: true, + warnings: false + } + } + } + + return { + // Allows to set log level in the browser, e.g. before reloading, + // before an error or when Hot Module Replacement is enabled. + logging: 'error', + // Prints compilation progress in percentage in the browser. + progress: true, + // Shows a full-screen overlay in the browser + // when there are compiler errors or warnings. + overlay: { + errors: true, + warnings: false + } + } +} diff --git a/programs/develop/webpack/loaders/assetLoaders.ts b/programs/develop/webpack/loaders/assetLoaders.ts index acf5b274..28cb89e3 100644 --- a/programs/develop/webpack/loaders/assetLoaders.ts +++ b/programs/develop/webpack/loaders/assetLoaders.ts @@ -6,14 +6,34 @@ // ╚═════╝ ╚══════╝ ╚═══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═╝ const assetLoaders = [ + { + test: /\.html$/i, + use: ['html-loader'] + }, { test: /\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$/i, - type: 'asset/resource' + type: 'asset/resource', + parser: { + dataUrlCondition: { + // inline images < 2 KB + maxSize: 2 * 1024 + } + } }, { test: /\.(woff|woff2|eot|ttf|otf)$/i, type: 'asset/resource' }, + { + test: /\.(txt|md|csv|tsv|xml|pdf|docx|doc|xls|xlsx|ppt|pptx|zip|gz|gzip|tgz)$/i, + type: 'asset/resource', + parser: { + dataUrlCondition: { + // inline images < 2 KB + maxSize: 2 * 1024 + } + } + }, { test: /\.(csv|tsv)$/i, use: ['csv-loader'] diff --git a/programs/develop/webpack/loaders/commonStyleLoaders.ts b/programs/develop/webpack/loaders/commonStyleLoaders.ts index 42476cfc..d699bb12 100644 --- a/programs/develop/webpack/loaders/commonStyleLoaders.ts +++ b/programs/develop/webpack/loaders/commonStyleLoaders.ts @@ -15,36 +15,25 @@ export default function getCommonStyleLoaders( opts: any ): any { const styleLoaders: webpack.RuleSetUse = [ - opts.mode === 'development' - ? // For production builds it's recommended to extract the CSS from - // your bundle being able to use parallel loading of CSS/JS - // resources later on. This can be achieved by using the - // mini-css-extract-plugin, because it creates separate css files. - // For development mode (including webpack-dev-server) you can use - // style-loader, because it injects CSS into the DOM using multiple and works faster. - require.resolve('style-loader') - : // This plugin extracts CSS into separate files. - // It creates a CSS file per JS file which contains CSS. - // It supports On-Demand-Loading of CSS and SourceMaps - // See https://webpack.js.org/plugins/mini-css-extract-plugin/ - { - loader: MiniCssExtractPlugin.loader - // options: { - // // only enable hot in development - // hmr: opts.mode === 'development', - // // if hmr does not work, this is a forceful method. - // publicPath: '', - // reloadAll: true - // } - }, + // This plugin extracts CSS into separate files. + // It creates a CSS file per JS file which contains CSS. + // It supports On-Demand-Loading of CSS and SourceMaps + // See https://webpack.js.org/plugins/mini-css-extract-plugin/ { - // `css-loader` resolves paths in CSS and adds assets as dependencies. - loader: require.resolve('css-loader'), + loader: MiniCssExtractPlugin.loader, options: { - importLoaders: 1, - modules: true + // This is needed for allowing import() statements + // in CSS files imported from content_scripts. + // sourceMap: true, + // esModule: false, + // This breaks dynamic imports in content scripts + // modules: true } }, + { + // `css-loader` resolves paths in CSS and adds assets as dependencies. + loader: require.resolve('css-loader') + }, { // `postcss-loader` applies autoprefixer to our CSS. loader: require.resolve('postcss-loader'), diff --git a/programs/develop/webpack/loaders/jsLoaders.ts b/programs/develop/webpack/loaders/jsLoaders.ts index e3306816..100b56ad 100644 --- a/programs/develop/webpack/loaders/jsLoaders.ts +++ b/programs/develop/webpack/loaders/jsLoaders.ts @@ -16,6 +16,8 @@ export default function jsLoaders(projectDir: string, opts: any) { : /\.(js|mjs|jsx)$/ return [ + // https://webpack.js.org/loaders/babel-loader/ + // https://babeljs.io/docs/en/babel-loader { test: files, include: projectDir, @@ -26,6 +28,7 @@ export default function jsLoaders(projectDir: string, opts: any) { typescript: isUsingTypeScript(projectDir) }) }, + // https://webpack.js.org/loaders/ts-loader/ { test: /\.tsx?$/, use: { diff --git a/programs/develop/webpack/plugins/boring.ts b/programs/develop/webpack/plugins/boring.ts new file mode 100644 index 00000000..1a63b445 --- /dev/null +++ b/programs/develop/webpack/plugins/boring.ts @@ -0,0 +1,19 @@ +import type webpack from 'webpack' +import {type DevOptions} from '../../extensionDev' + +export default function boringPlugins(projectPath: string, {mode}: DevOptions) { + const project = require(`${projectPath}/manifest.json`) + const projectName = project.name + const projectVersion = project.version + + return { + name: 'boringPlugins', + apply: (compiler: webpack.Compiler) => { + compiler.hooks.done.tap('errorPlugins', (stats) => { + const divider = stats.hasErrors() ? '✖︎✖︎✖︎' : '►►►' + stats.compilation.name = `🧩 extension-create ${divider} ${projectName} (${projectVersion}) running in ${mode} mode` + // stats.compilation.name = `[extension-create 🧩] ${divider} ${projectName} running in ${mode} mode` + }) + } + } +} diff --git a/programs/develop/webpack/plugins/browser.ts b/programs/develop/webpack/plugins/browser.ts index 376595c5..fe1c7aed 100644 --- a/programs/develop/webpack/plugins/browser.ts +++ b/programs/develop/webpack/plugins/browser.ts @@ -7,7 +7,7 @@ // import path from 'path' import type webpack from 'webpack' -import {getOutputPath} from '../config/getPath' +import {getManifestPath, getOutputPath} from '../config/getPath' import {type DevOptions} from '../../extensionDev' import RunChromeExtension from 'webpack-run-chrome-extension' // import RunEdgeExtension from 'webpack-run-edge-extension' @@ -21,11 +21,11 @@ export default function browserPlugins( const chromeConfig = { port: 8082, + manifestPath: getManifestPath(projectPath), // The final folder where the extension manifest file is located. // This is used to load the extension into the browser. extensionPath: getOutputPath(projectPath, devOptions.browser), - autoReload: false, - // autoReload: 'background' as 'background', + autoReload: true, browserFlags: ['--enable-benchmarking'] } diff --git a/programs/develop/webpack/plugins/compilation.ts b/programs/develop/webpack/plugins/compilation.ts index f9456da5..b449e588 100644 --- a/programs/develop/webpack/plugins/compilation.ts +++ b/programs/develop/webpack/plugins/compilation.ts @@ -10,12 +10,12 @@ import fs from 'fs' import webpack from 'webpack' import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin' -// import ForkTsCheckerWarningWebpackPlugin from './fork-ts-checker-warning-webpack-plugin' +import ForkTsCheckerWarningWebpackPlugin from './fork-ts-checker-warning-webpack-plugin' import MiniCssExtractPlugin from 'mini-css-extract-plugin' import Dotenv from 'dotenv-webpack' // Checks -// import {isUsingTypeScript} from '../options/typescript' +import {isUsingTypeScript} from '../options/typescript' import {type DevOptions} from '../../extensionDev' export default function compilationPlugins( @@ -25,12 +25,10 @@ export default function compilationPlugins( return { name: 'compilationPlugins', apply: (compiler: webpack.Compiler) => { - // new ESLintPlugin().apply(compiler) - new CaseSensitivePathsPlugin().apply(compiler) - // Parse TypeScript files in a different process if needed - // TODO: cezaraugusto this makes the reload plugin to run twice + // WARN: this makes the reload plugin to run twice + // Parse TypeScript files in a different process if needed. // if (isUsingTypeScript(projectPath)) { // new ForkTsCheckerWarningWebpackPlugin().apply(compiler) // } diff --git a/programs/develop/webpack/plugins/error.ts b/programs/develop/webpack/plugins/error.ts index 85e63fb2..c7e8e176 100644 --- a/programs/develop/webpack/plugins/error.ts +++ b/programs/develop/webpack/plugins/error.ts @@ -5,22 +5,31 @@ // ██████╔╝███████╗ ╚████╔╝ ███████╗███████╗╚██████╔╝██║ // ╚═════╝ ╚══════╝ ╚═══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═╝ -import type webpack from 'webpack' -// import CommonErrorsPlugin from 'webpack-common-errors-plugin' +import path from 'path' +import webpack from 'webpack' +import ManifestCompatPlugin from 'webpack-browser-extension-manifest-compat-plugin' +import CommonErrorsPlugin from 'webpack-browser-extension-common-errors-plugin' import {type DevOptions} from '../../extensionDev' export default function errorPlugins(projectPath: string, {mode}: DevOptions) { return { name: 'errorPlugins', apply: (compiler: webpack.Compiler) => { + const manifestPath = path.resolve(projectPath, 'manifest.json') + // TODO: combine all extension context errors into one. // new CombinedErrorsPlugin().apply(compiler) - // TODO: Handle common config errors and output a nice error display. + // TODO: Combine common config errors and output a nice error display. // new ErrorLayerPlugin().apply(compiler) // TODO: Handle manifest compatibilities across browser vendors. - // new ManifestCompatPlugin().apply(compiler) - // TODO: Handle common webpack errors. - // new CommonErrorsPlugin().apply(compiler) + new ManifestCompatPlugin({ + manifestPath + }).apply(compiler) + + // Handle common user mistakes and webpack errors. + new CommonErrorsPlugin({ + manifestPath + }).apply(compiler) } } } diff --git a/programs/develop/webpack/plugins/extension.ts b/programs/develop/webpack/plugins/extension.ts index a8c9008c..75f97f74 100644 --- a/programs/develop/webpack/plugins/extension.ts +++ b/programs/develop/webpack/plugins/extension.ts @@ -10,15 +10,16 @@ import webpack from 'webpack' import type {DevOptions} from '../../extensionDev' // Plugins -import CopyStaticFolderPlugin from './copy-static-folder-plugin' +import ManifestPlugin from 'webpack-browser-extension-manifest-plugin' import HtmlPlugin from 'webpack-browser-extension-html-plugin' import ScriptsPlugin from 'webpack-browser-extension-scripts-plugin' import LocalesPlugin from 'webpack-browser-extension-locales-plugin' -import IconsPlugin from 'webpack-browser-extension-icons-plugin' -// import WebResourcesPlugin from 'webpack-browser-extension-web-resources-plugin' import JsonPlugin from 'webpack-browser-extension-json-plugin' -import ManifestPlugin from 'webpack-browser-extension-manifest-plugin' -import {getStaticFolderPath} from '../config/getPath' +import IconsPlugin from 'webpack-browser-extension-icons-plugin' +import ResourcesPlugin from 'webpack-browser-extension-resources-plugin' + +// Config +import {getDynamicPagesPath, getStaticFolderPath} from '../config/getPath' export default function extensionPlugins( projectPath: string, @@ -29,10 +30,6 @@ export default function extensionPlugins( return { name: 'extensionPlugins', apply: (compiler: webpack.Compiler) => { - new CopyStaticFolderPlugin({ - staticDir: getStaticFolderPath(projectPath) - }).apply(compiler) - // Generate a manifest file with all the assets we need new ManifestPlugin({ browser, @@ -51,42 +48,43 @@ export default function extensionPlugins( // Get every field in manifest that allows an .html file new HtmlPlugin({ manifestPath, - // Exclude paths that are in the /public/ folder exclude: [getStaticFolderPath(projectPath)], - experimentalHMREnabled: false + pages: getDynamicPagesPath(projectPath) }).apply(compiler) // Get all scripts (bg, content, sw) declared in manifest new ScriptsPlugin({ manifestPath, // Exclude paths that are in the /public/ folder - exclude: [getStaticFolderPath(projectPath)], - experimentalHMREnabled: false + exclude: [getStaticFolderPath(projectPath)] }).apply(compiler) // Get locales new LocalesPlugin({manifestPath}).apply(compiler) - // Grab all icon assets from manifest including popup icons - new IconsPlugin({ + // Grab all JSON assets from manifest except _locales + new JsonPlugin({ manifestPath, // Exclude paths that are in the /public/ folder exclude: [getStaticFolderPath(projectPath)] }).apply(compiler) - // TODO: cezaraugusto - // Grab all web resource assets from manifest - // new WebResourcesPlugin({ - // manifestPath - // }).apply(compiler) - - // Grab all JSON assets from manifest except _locales - new JsonPlugin({ + // Grab all icon assets from manifest including popup icons + new IconsPlugin({ manifestPath, // Exclude paths that are in the /public/ folder exclude: [getStaticFolderPath(projectPath)] }).apply(compiler) + // Grab all resources from script files + // (background, content_scripts, service_worker) + // and add them to the assets bundle. + new ResourcesPlugin({ + manifestPath + // Exclude paths that are in the /public/ folder + // exclude: [getStaticFolderPath(projectPath)] + }).apply(compiler) + // Allow browser polyfill as needed if (!noPolyfill) { if (browser !== 'firefox') { diff --git a/programs/develop/webpack/plugins/reload.ts b/programs/develop/webpack/plugins/reload.ts index 216b342e..8bfe132c 100644 --- a/programs/develop/webpack/plugins/reload.ts +++ b/programs/develop/webpack/plugins/reload.ts @@ -5,33 +5,20 @@ // ██████╔╝███████╗ ╚████╔╝ ███████╗███████╗╚██████╔╝██║ // ╚═════╝ ╚══════╝ ╚═══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═╝ -// import path from 'path' import type webpack from 'webpack' import {type DevOptions} from '../../extensionDev' -// TODO: @cezaraugusto enable HMR support -// import ReactRefreshPlugin from '@pmmmwh/react-refresh-webpack-plugin' -// TODO: @cezaraugusto enable HMR support -// import ReloadPlugin from 'webpack-browser-extension-reload-plugin' +import ReactRefreshPlugin from '@pmmmwh/react-refresh-webpack-plugin' +import {isUsingReact} from '../options/react' export default function reloadPlugins(projectPath: string, {mode}: DevOptions) { - // const manifestPath = path.resolve(projectPath, 'manifest.json') - return { name: 'reloadPlugins', apply: (compiler: webpack.Compiler) => { - // if (mode !== 'development') return - - // TODO: @cezaraugusto enable HMR support - // new webpack.HotModuleReplacementPlugin({}).apply(compiler) + if (mode !== 'development') return - // Reload the browser when the extension is updated. - // new ReloadPlugin({ - // manifestPath, - // port: 8082 - // }).apply(compiler) - // TODO: @cezaraugusto enable HMR support - // React lib for hot-reloading. - // new ReactRefreshPlugin().apply(compiler) + if (isUsingReact(projectPath)) { + new ReactRefreshPlugin().apply(compiler) + } } } } diff --git a/programs/develop/webpack/startDevServer.ts b/programs/develop/webpack/startDevServer.ts index d50a6696..0caaea76 100644 --- a/programs/develop/webpack/startDevServer.ts +++ b/programs/develop/webpack/startDevServer.ts @@ -23,7 +23,7 @@ export default async function startDevServer( {...devOptions}: DevOptions ) { const compilerConfig = webpackConfig(projectPath, 'development', devOptions) - const serverConfig = await devServerConfig(projectPath, devOptions) + const serverConfig = devServerConfig(projectPath, devOptions) const compiler = webpack(compilerConfig) const devServer = new WebpackDevServer(serverConfig, compiler) diff --git a/programs/develop/webpack/webpack-config.ts b/programs/develop/webpack/webpack-config.ts index fd18fd76..083130b8 100644 --- a/programs/develop/webpack/webpack-config.ts +++ b/programs/develop/webpack/webpack-config.ts @@ -19,7 +19,6 @@ import cssOptimizationOptions from './options/cssOptimization' // Loaders import assetLoaders from './loaders/assetLoaders' -import htmlLoaders from './loaders/htmlLoaders' import jsLoaders from './loaders/jsLoaders' import styleLoaders from './loaders/styleLoaders' @@ -36,6 +35,8 @@ import CssMinimizerPlugin from 'css-minimizer-webpack-plugin' import {isUsingTypeScript} from './options/typescript' import getDevToolOption from './config/getDevtoolOption' import browserPlugins from './plugins/browser' +import boringPlugins from './plugins/boring' +import {getWebpackStats} from './config/logging' export default function webpackConfig( projectPath: string, @@ -44,19 +45,22 @@ export default function webpackConfig( ): webpack.Configuration { return { mode, - // target: 'web', + entry: {}, + target: 'web', context: projectPath, devtool: getDevToolOption(projectPath), - entry: {}, + stats: getWebpackStats(), + infrastructureLogging: { + level: 'none' + }, + cache: false, output: { path: getOutputPath(projectPath, devOptions.browser), // See https://webpack.js.org/configuration/output/#outputpublicpath publicPath: getWebpackPublicPath(projectPath), - clean: true, environment: { bigIntLiteral: true, - dynamicImport: true, - module: true + dynamicImport: true } }, resolve: { @@ -78,7 +82,6 @@ export default function webpackConfig( rules: [ ...jsLoaders(projectPath, {mode}), ...styleLoaders(projectPath, {mode}), - ...htmlLoaders, ...assetLoaders ] }, @@ -87,27 +90,13 @@ export default function webpackConfig( extensionPlugins(projectPath, devOptions), reloadPlugins(projectPath, devOptions), browserPlugins(projectPath, devOptions), - errorPlugins(projectPath, devOptions) + errorPlugins(projectPath, devOptions), + boringPlugins(projectPath, devOptions) ], optimization: { - minimize: false, - // runtimeChunk: { - // name: (entrypoint: any) => { - // if (entrypoint.name.startsWith("background")) { - // return null; - // } - - // return `runtime-${entrypoint.name}` - // } - // }, - // splitChunks: { - // chunks(chunk) { - // return chunk.name !== "background"; - // }, - // }, - // TODO: cezaraugusto this can have side-effects. - // https://webpack.js.org/guides/code-splitting/#entry-dependencies - // runtimeChunk: 'single', + // WARN: This can have side-effects. + // See https://webpack.js.org/guides/code-splitting/#entry-dependencies + // runtimeChunk: true, minimizer: [ // Minify JSON new JsonMinimizerPlugin(), @@ -116,10 +105,6 @@ export default function webpackConfig( // Minify CSS new CssMinimizerPlugin(cssOptimizationOptions) ] - }, - stats: { - children: true, - errorDetails: true } } } diff --git a/programs/develop/webpack/webpack-dev-server.ts b/programs/develop/webpack/webpack-dev-server.ts index 2bbc945e..6c0a322f 100644 --- a/programs/develop/webpack/webpack-dev-server.ts +++ b/programs/develop/webpack/webpack-dev-server.ts @@ -7,28 +7,26 @@ import type WebpackDevServer from 'webpack-dev-server' import type {DevOptions} from '../extensionDev' -import getNextAvailablePort from './config/getNextAvailablePort' -// import {type getOutputPath} from './config/getPath' +import {getStaticFolderPath} from './config/getPath' +// import getNextAvailablePort from './config/getNextAvailablePort' -export default async function devServerConfig( +export default function devServerConfig( projectPath: string, - {port, browser}: DevOptions -): Promise { + {port}: DevOptions +): WebpackDevServer.Configuration { return { host: '127.0.0.1', - allowedHosts: 'all', // TODO: cezaraugusto check - // static: { - // directory: projectPath, // getOutputPath(projectPath, browser), - // watch: { - // // TODO: revert - // ignored: [/\bnode_modules\b/, - // // exclude all js files - // /\.js$/, - // // /^((?!content).)*$/, - - // ] - // } - // }, + allowedHosts: 'all', + static: getStaticFolderPath(projectPath), + compress: true, + devMiddleware: { + writeToDisk: true + }, + // WARN: for some reason, adding HTML as a watch file + // causes content_scripts to do a full reload instead of a hot reload. + // We work around this in the webpack-run extensions by + // adding the HTML file as an entry point. + // watchFiles: {}, client: { // Allows to set log level in the browser, e.g. before reloading, // before an error or when Hot Module Replacement is enabled. @@ -42,14 +40,14 @@ export default async function devServerConfig( warnings: true } }, - devMiddleware: { - writeToDisk: true - }, headers: { 'Access-Control-Allow-Origin': '*' }, - port: await getNextAvailablePort(port), - // Enable webpack's Hot Module Replacement feature + // TODO: cezaraugusto scan available ports + // port: getNextAvailablePort(port), + port: port || 8818, + // WARN: Setting TRUE here causes the content_script + // entry of a react extension to be reloaded infinitely. hot: 'only' } } diff --git a/yarn.lock b/yarn.lock index b03e6962..64571c73 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2097,29 +2097,6 @@ globby "^11.0.0" read-yaml-file "^1.1.0" -"@mapbox/node-pre-gyp@^1.0.11": - version "1.0.11" - resolved "https://registry.yarnpkg.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz#417db42b7f5323d79e93b34a6d7a2a12c0df43fa" - integrity sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ== - dependencies: - detect-libc "^2.0.0" - https-proxy-agent "^5.0.0" - make-dir "^3.1.0" - node-fetch "^2.6.7" - nopt "^5.0.0" - npmlog "^5.0.1" - rimraf "^3.0.2" - semver "^7.3.5" - tar "^6.1.11" - -"@mrmlnc/readdir-enhanced@^2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" - integrity sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g== - dependencies: - call-me-maybe "^1.0.1" - glob-to-regexp "^0.3.0" - "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -2133,11 +2110,6 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== -"@nodelib/fs.stat@^1.1.2": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" - integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== - "@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": version "1.2.8" resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" @@ -2203,7 +2175,7 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== -"@pmmmwh/react-refresh-webpack-plugin@^0.5.10", "@pmmmwh/react-refresh-webpack-plugin@^0.5.7": +"@pmmmwh/react-refresh-webpack-plugin@^0.5.10": version "0.5.10" resolved "https://registry.yarnpkg.com/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.10.tgz#2eba163b8e7dbabb4ce3609ab5e32ab63dda3ef8" integrity sha512-j0Ya0hCFZPd4x40qLzbhGsh9TMtdb+CJQiso+WxLOPNasohq9cc5SNUcwsZaRH6++Xh91Xkm/xHCkuIiIu0LUA== @@ -2448,12 +2420,12 @@ "@types/jsonfile" "*" "@types/node" "*" -"@types/glob@^7.1.1": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" - integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA== +"@types/glob@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-8.1.0.tgz#b63e70155391b0584dce44e7ea25190bbc38f2fc" + integrity sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w== dependencies: - "@types/minimatch" "*" + "@types/minimatch" "^5.1.2" "@types/node" "*" "@types/har-format@*": @@ -2544,6 +2516,14 @@ dependencies: "@types/node" "*" +"@types/loader-utils@^2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/loader-utils/-/loader-utils-2.0.6.tgz#cb1cf704c7eee4f01df8da3a90ba5929b77753df" + integrity sha512-cgu0Xefgq9O5FjFR78jgI6X31aPjDWCaJ6LCfRtlj6BtyVVWiXagysSYlPACwGKAzRwsFLjKXcj4iGfcVt6cLw== + dependencies: + "@types/node" "*" + "@types/webpack" "^4" + "@types/mdast@^3.0.0": version "3.0.12" resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.12.tgz#beeb511b977c875a5b0cc92eab6fcac2f0895514" @@ -2561,7 +2541,7 @@ resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== -"@types/minimatch@*": +"@types/minimatch@^5.1.2": version "5.1.2" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== @@ -2655,14 +2635,14 @@ resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== -"@types/react-dom@^18.0.5", "@types/react-dom@^18.2.1": +"@types/react-dom@^18.2.1": version "18.2.7" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.7.tgz#67222a08c0a6ae0a0da33c3532348277c70abb63" integrity sha512-GRaAEriuT4zp9N4p1i8BDBYmEyfo+xQ3yHjJU4eiK5NDa1RmUZG+unZABUTK4/Ox/M+GaHwb6Ow8rUITrtjszA== dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^18.0.9": +"@types/react@*": version "18.2.16" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.16.tgz#403dda0e933caccac9efde569923239ac426786c" integrity sha512-LLFWr12ZhBJ4YVw7neWLe6Pk7Ey5R9OCydfuMsz1L8bZxzaawJj2p06Q8/EFEHDeTBQNFLF62X+CG7B2zIyu0Q== @@ -2688,6 +2668,13 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.3.tgz#cef09e3ec9af1d63d2a6cc5b383a737e24e6dcf5" integrity sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ== +"@types/schema-utils@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@types/schema-utils/-/schema-utils-2.4.0.tgz#9983012045d541dcee053e685a27c9c87c840fcd" + integrity sha512-454hrj5gz/FXcUE20ygfEiN4DxZ1sprUo0V1gqIqkNZ/CzoEzAZEll2uxMsuyz6BYjiQan4Aa65xbTemfzW9hQ== + dependencies: + schema-utils "*" + "@types/semver@^7.3.12", "@types/semver@^7.3.13", "@types/semver@^7.5.0": version "7.5.0" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" @@ -3069,12 +3056,17 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== +a-sync-waterfall@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/a-sync-waterfall/-/a-sync-waterfall-1.0.1.tgz#75b6b6aa72598b497a125e7a2770f14f4c8a1fa7" + integrity sha512-RYTOHHdWipFUliRFMCS4X2Yn2X8M87V/OpSqWzKKOGhzqyUxzyVmhHDH9sAvG+ZuQf/TAOFsLCpMw09I1ufUnA== + abab@^2.0.0, abab@^2.0.5, abab@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== -abbrev@1, abbrev@^1.0.0: +abbrev@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== @@ -3148,15 +3140,6 @@ acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.10.0.tgz#8be5b3907a67221a81ab23c7889c4c5526b62ec5" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== -add-asset-html-webpack-plugin@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/add-asset-html-webpack-plugin/-/add-asset-html-webpack-plugin-3.2.2.tgz#0e4c379e250a9e54ab4315e5c8674dddbef4ec20" - integrity sha512-OM0SqCq7PpfRLlbZJzNxzNIqvjCVRsMjDZEkADF5bbKf8qyG53f132/QmAeryIqBEYRwKw3Y2nFChTGvzYJ30w== - dependencies: - globby "^9.0.0" - micromatch "^3.1.3" - p-each-series "^1.0.0" - address@^1.0.1, address@^1.1.2: version "1.2.2" resolved "https://registry.yarnpkg.com/address/-/address-1.2.2.tgz#2b5248dac5485a6390532c6a517fda2e3faac89e" @@ -3215,7 +3198,7 @@ ajv@^6.10.0, ajv@^6.12.2, ajv@^6.12.3, ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.0, ajv@^8.0.1, ajv@^8.9.0: +ajv@^8.0.0, ajv@^8.0.1, ajv@^8.12.0, ajv@^8.9.0: version "8.12.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.12.0.tgz#d1a0527323e22f53562c567c00991577dfbe19d1" integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== @@ -3341,14 +3324,6 @@ archiver@^5.3.1: tar-stream "^2.2.0" zip-stream "^4.1.0" -are-we-there-yet@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz#372e0e7bd279d8e94c653aaa1f67200884bf3e1c" - integrity sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw== - dependencies: - delegates "^1.0.0" - readable-stream "^3.6.0" - are-we-there-yet@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz#679df222b278c64f2cdba1175cdc00b0d96164bd" @@ -3428,13 +3403,6 @@ array-includes@^3.1.4, array-includes@^3.1.6: get-intrinsic "^1.1.3" is-string "^1.0.7" -array-union@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - integrity sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng== - dependencies: - array-uniq "^1.0.1" - array-union@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" @@ -3445,11 +3413,6 @@ array-union@^3.0.1: resolved "https://registry.yarnpkg.com/array-union/-/array-union-3.0.1.tgz#da52630d327f8b88cfbfb57728e2af5cd9b6b975" integrity sha512-1OvF9IbWwaeiM9VhzYXVQacMibxpXOMYVNIvMtKRyX9SImBXpKcFr8XvFDeEslCyuH/t6KRt7HEO94AlP8Iatw== -array-uniq@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - integrity sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q== - array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" @@ -3503,6 +3466,11 @@ arrify@^1.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA== +asap@^2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA== + asn1@~0.2.3: version "0.2.6" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.6.tgz#0d3a7bb6e64e02a90c0303b31f292868ea09a08d" @@ -3515,11 +3483,6 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw== -asset-list-webpack-plugin@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asset-list-webpack-plugin/-/asset-list-webpack-plugin-0.4.0.tgz#620c8fd68ecb3c1b8bdf2a801ac94ab6facf18c0" - integrity sha512-itT1iTKtv7GQHNX8JKBEqoTIH2cZBVF1INU0dGvEIq7xV/VBbY9eF5gPEhAlQzFYH2dZGpC05QBSt6Al4WaxAg== - assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" @@ -3970,11 +3933,6 @@ call-bind@^1.0.0, call-bind@^1.0.2: function-bind "^1.1.1" get-intrinsic "^1.0.2" -call-me-maybe@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.2.tgz#03f964f19522ba643b1b0693acb9152fe2074baa" - integrity sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ== - callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -4101,6 +4059,11 @@ chownr@^2.0.0: resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== +chrome-extension-manifest-json-schema@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/chrome-extension-manifest-json-schema/-/chrome-extension-manifest-json-schema-0.2.0.tgz#ad9316098393258f32c054f87e78207bb07221d2" + integrity sha512-OFYoKb4TEFJSxtVneT+gdbdJvja97tX1nUQmoTZh677LalWpO6Gzc94BJbzAFNWkdf2havaQSG4g6y8mSlTPuQ== + chrome-location@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/chrome-location/-/chrome-location-1.2.1.tgz#6911511a4eac55027625c73b937ca5ca7ab94995" @@ -4250,7 +4213,7 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-support@^1.1.2, color-support@^1.1.3: +color-support@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== @@ -4292,6 +4255,11 @@ commander@^4.0.0: resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== +commander@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" + integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== + commander@^7.0.0, commander@^7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" @@ -4357,7 +4325,7 @@ connect-history-api-fallback@^2.0.0: resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz#647264845251a0daf25b97ce87834cace0f5f1c8" integrity sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA== -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" integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== @@ -4926,11 +4894,6 @@ detect-indent@^6.0.0: resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6" integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA== -detect-libc@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.2.tgz#8ccf2ba9315350e1241b88d0ac3b0e1fbd99605d" - integrity sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw== - detect-newline@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" @@ -4964,13 +4927,6 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -dir-glob@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.2.2.tgz#fa09f0694153c8918b18ba0deafae94769fc50c4" - integrity sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw== - dependencies: - path-type "^3.0.0" - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -5175,11 +5131,6 @@ emoji-regex@^9.2.2: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - integrity sha512-knHEZMgs8BB+MInokmNTg/OyPlAddghe1YBgNwJBc5zsJi/uyIcXoSDsL/W9ymOsBoBGdPIHXYJ9+qKFwRwDng== - emojis-list@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" @@ -5961,18 +5912,6 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0" integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw== -fast-glob@^2.2.6: - version "2.2.7" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.7.tgz#6953857c3afa475fff92ee6015d52da70a4cd39d" - integrity sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw== - dependencies: - "@mrmlnc/readdir-enhanced" "^2.2.1" - "@nodelib/fs.stat" "^1.1.2" - glob-parent "^3.1.0" - is-glob "^4.0.0" - merge2 "^1.2.3" - micromatch "^3.1.10" - fast-glob@^3.2.12, fast-glob@^3.2.7, fast-glob@^3.2.9: version "3.3.1" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" @@ -6376,21 +6315,6 @@ functions-have-names@^1.2.2, functions-have-names@^1.2.3: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== -gauge@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-3.0.2.tgz#03bf4441c044383908bcfa0656ad91803259b395" - integrity sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q== - dependencies: - aproba "^1.0.3 || ^2.0.0" - color-support "^1.1.2" - console-control-strings "^1.0.0" - has-unicode "^2.0.1" - object-assign "^4.1.1" - signal-exit "^3.0.0" - string-width "^4.2.3" - strip-ansi "^6.0.1" - wide-align "^1.1.2" - gauge@^4.0.3: version "4.0.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-4.0.4.tgz#52ff0652f2bbf607a989793d53b751bef2328dce" @@ -6457,14 +6381,6 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha512-E8Ak/2+dZY6fnzlR7+ueWvhsH1SjHr4jjss4YS/h4py44jY9MhK/VFdaZJAWDz6BbL21KeteKxFSFpq8OS5gVA== - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -6479,11 +6395,6 @@ glob-parent@^6.0.1, glob-parent@^6.0.2: dependencies: is-glob "^4.0.3" -glob-to-regexp@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" - integrity sha512-Iozmtbqv0noj0uDDqoL0zNq0VBEfK2YFoMAZoxJe4cwphvLR+JskfF30QhXHOR4m3KrE6NLRYw+U9MRXvifyig== - glob-to-regexp@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" @@ -6523,7 +6434,7 @@ glob@^10.3.9: minipass "^5.0.0 || ^6.0.2 || ^7.0.0" path-scurry "^1.10.1" -glob@^7.0.0, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.2.0: +glob@^7.0.0, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -6594,20 +6505,6 @@ globby@^12.0.2: merge2 "^1.4.1" slash "^4.0.0" -globby@^9.0.0: - version "9.2.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-9.2.0.tgz#fd029a706c703d29bdd170f4b6db3a3f7a7cb63d" - integrity sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg== - dependencies: - "@types/glob" "^7.1.1" - array-union "^1.0.2" - dir-glob "^2.2.2" - fast-glob "^2.2.6" - glob "^7.1.3" - ignore "^4.0.3" - pify "^4.0.1" - slash "^2.0.0" - go-git-it@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/go-git-it/-/go-git-it-1.1.0.tgz#cc2e4f588d5573bb6136301003670ab460f5d531" @@ -6933,15 +6830,6 @@ html-void-elements@^2.0.0: resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-2.0.1.tgz#29459b8b05c200b6c5ee98743c41b979d577549f" integrity sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A== -html-webpack-inline-source-plugin@^0.0.10: - version "0.0.10" - resolved "https://registry.yarnpkg.com/html-webpack-inline-source-plugin/-/html-webpack-inline-source-plugin-0.0.10.tgz#89bd5f761e4f16902aa76a44476eb52831c9f7f0" - integrity sha512-0ZNU57u7283vrXSF5a4VDnVOMWiSwypKIp1z/XfXWoVHLA1r3Xmyxx5+Lz+mnthz/UvxL1OAf41w5UIF68Jngw== - dependencies: - escape-string-regexp "^1.0.5" - slash "^1.0.0" - source-map-url "^0.4.0" - html-webpack-plugin@^5.5.0: version "5.5.3" resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-5.5.3.tgz#72270f4a78e222b5825b296e5e3e1328ad525a3e" @@ -6953,15 +6841,6 @@ html-webpack-plugin@^5.5.0: pretty-error "^4.0.0" tapable "^2.0.0" -html-webpack-tags-plugin@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/html-webpack-tags-plugin/-/html-webpack-tags-plugin-3.0.2.tgz#eefc6600e45b36605e8f91bbd497fc7f4f6d2d8c" - integrity sha512-jZ4IHjT8AWyNa4RJ+8p0+AGkunLf1H5E/IjzW+9BOQbJ39Dy2jZULnxseXsEAiFxu6DX6z+sOZKV9rhbEDtpqA== - dependencies: - glob "^7.2.0" - minimatch "^3.0.4" - slash "^3.0.0" - htmlparser2@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-6.1.0.tgz#c4d762b6c3371a05dbe65e94ae43a9f845fb8fb7" @@ -7102,7 +6981,7 @@ ignore-walk@^6.0.0: dependencies: minimatch "^9.0.0" -ignore@^4.0.3, ignore@^4.0.6: +ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== @@ -7393,7 +7272,7 @@ is-extendable@^1.0.1: dependencies: is-plain-object "^2.0.4" -is-extglob@^2.1.0, is-extglob@^2.1.1: +is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== @@ -7413,13 +7292,6 @@ is-generator-fn@^2.0.0: resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha512-UFpDDrPgM6qpnFNI+rh/p3bUaq9hKLZN8bMUWzxmcnZVS3omf4IPK+BrewlnWjO1WmUsMYuSjKh4UJuV4+Lqmw== - dependencies: - is-extglob "^2.1.0" - is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -8288,11 +8160,6 @@ jsonparse@^1.3.1: resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== -jsonschema@^1.4.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.1.tgz#cc4c3f0077fb4542982973d8a083b6b34f482dab" - integrity sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ== - jsprim@^1.2.2: version "1.4.2" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" @@ -8468,20 +8335,11 @@ loader-utils@^2.0.0, loader-utils@^2.0.4: emojis-list "^3.0.0" json5 "^2.1.2" -loader-utils@^3.2.0: +loader-utils@^3.2.0, loader-utils@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-3.2.1.tgz#4fb104b599daafd82ef3e1a41fb9265f87e1f576" integrity sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw== -loader-utils@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" - integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== - dependencies: - big.js "^5.2.2" - emojis-list "^2.0.0" - json5 "^1.0.1" - locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" @@ -8584,7 +8442,7 @@ log-symbols@^4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" -loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: +loose-envify@^1.0.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -8638,13 +8496,6 @@ make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" -make-dir@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== - dependencies: - semver "^6.0.0" - make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" @@ -8772,7 +8623,7 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: +merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== @@ -8814,7 +8665,7 @@ micromark-util-types@^1.0.0: resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-1.1.0.tgz#e6676a8cae0bb86a2171c498167971886cb7e283" integrity sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg== -micromatch@^3.1.10, micromatch@^3.1.3, micromatch@^3.1.4: +micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== @@ -8868,7 +8719,7 @@ min-indent@^1.0.0: resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== -mini-css-extract-plugin@^2.5.3, mini-css-extract-plugin@^2.6.1, mini-css-extract-plugin@^2.7.5, mini-css-extract-plugin@^2.7.6: +mini-css-extract-plugin@^2.5.3, mini-css-extract-plugin@^2.7.5, mini-css-extract-plugin@^2.7.6: version "2.7.6" resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.6.tgz#282a3d38863fddcd2e0c220aaed5b90bc156564d" integrity sha512-Qk7HcgaPkGG6eD77mLvZS1nmxlao3j+9PkrT9Uc7HAE1id3F41+DdBRYRYkbyfNRGzm8/YWtzhw7nVPmwhqTQw== @@ -9128,18 +8979,6 @@ node-abort-controller@^3.0.1: resolved "https://registry.yarnpkg.com/node-abort-controller/-/node-abort-controller-3.1.1.tgz#a94377e964a9a37ac3976d848cb5c765833b8548" integrity sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ== -node-addon-api@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f" - integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ== - -node-fetch@^2.6.7: - version "2.7.0" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" - integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== - dependencies: - whatwg-url "^5.0.0" - node-forge@^1: version "1.3.1" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.1.tgz#be8da2af243b2417d5f646a770663a92b7e9ded3" @@ -9191,13 +9030,6 @@ noms@0.0.0: inherits "^2.0.1" readable-stream "~1.0.31" -nopt@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-5.0.0.tgz#530942bb58a512fccafe53fe210f13a25355dc88" - integrity sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ== - dependencies: - abbrev "1" - nopt@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/nopt/-/nopt-6.0.0.tgz#245801d8ebf409c6df22ab9d95b65e1309cdb16d" @@ -9315,16 +9147,6 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" -npmlog@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-5.0.1.tgz#f06678e80e29419ad67ab964e0fa69959c1eb8b0" - integrity sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw== - dependencies: - are-we-there-yet "^2.0.0" - console-control-strings "^1.1.0" - gauge "^3.0.0" - set-blocking "^2.0.0" - npmlog@^6.0.0: version "6.0.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-6.0.2.tgz#c8166017a42f2dea92d6453168dd865186a70830" @@ -9342,6 +9164,15 @@ nth-check@^2.0.1: dependencies: boolbase "^1.0.0" +nunjucks@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/nunjucks/-/nunjucks-3.2.4.tgz#f0878eef528ce7b0aa35d67cc6898635fd74649e" + integrity sha512-26XRV6BhkgK0VOxfbU5cQI+ICFUtMLixv1noZn1tGU38kQH5A5nmmbk/O45xdyBhD1esk47nKrY0mvQpZIhRjQ== + dependencies: + a-sync-waterfall "^1.0.0" + asap "^2.0.3" + commander "^5.1.0" + nwsapi@^2.0.7, nwsapi@^2.2.0: version "2.2.7" resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.7.tgz#738e0707d3128cb750dddcfe90e4610482df0f30" @@ -9717,7 +9548,7 @@ parse5@4.0.0: resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== -parse5@6.0.1, parse5@^6.0.0, parse5@^6.0.1: +parse5@6.0.1, parse5@^6.0.0: version "6.0.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== @@ -9752,11 +9583,6 @@ pascalcase@^0.1.1: resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw== -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha512-ALzNPpyNq9AqXMBjeymIjFDAkAFH06mHJH/cSBHAgU0s4vfpBn6b2nf8tiRLvagKD8RbTpq2FKTBg7cl9l3c7Q== - path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -10682,14 +10508,6 @@ react-dev-utils@^12.0.0: strip-ansi "^6.0.1" text-table "^0.2.0" -react-dom@^18.1.0: - version "18.2.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" - integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g== - dependencies: - loose-envify "^1.1.0" - scheduler "^0.23.0" - react-error-overlay@6.0.9: version "6.0.9" resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.9.tgz#3c743010c9359608c375ecd6bc76f35d93995b0a" @@ -10705,7 +10523,7 @@ react-is@^16.13.1, react-is@^16.8.4: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== -react-refresh-typescript@^2.0.5, react-refresh-typescript@^2.0.9: +react-refresh-typescript@^2.0.9: version "2.0.9" resolved "https://registry.yarnpkg.com/react-refresh-typescript/-/react-refresh-typescript-2.0.9.tgz#f8a86efcb34f8d717100230564b9b57477d74b10" integrity sha512-chAnOO4vpxm/3WkgOVmti+eN8yUtkJzeGkOigV6UA9eDFz12W34e/SsYe2H5+RwYJ3+sfSZkVbiXcG1chEBxlg== @@ -10715,13 +10533,6 @@ react-refresh@^0.14.0: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e" integrity sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ== -react@^18.1.0: - version "18.2.0" - resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" - integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== - dependencies: - loose-envify "^1.1.0" - read-cache@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/read-cache/-/read-cache-1.0.0.tgz#e664ef31161166c9751cdbe8dbcf86b5fb58f774" @@ -11278,17 +11089,15 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -scheduler@^0.23.0: - version "0.23.0" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" - integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw== +schema-utils@*, schema-utils@^4.0.0, schema-utils@^4.0.1, schema-utils@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.2.0.tgz#70d7c93e153a273a805801882ebd3bff20d89c8b" + integrity sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw== dependencies: - loose-envify "^1.1.0" - -schema-to-object@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/schema-to-object/-/schema-to-object-1.2.0.tgz#4a5228f3843212a67b7a55780651d1a6f967a951" - integrity sha512-0sP4XtxmpNM8hx6lvLSHWWyVk/7dEz//78GK45fDz8sBMvwgu9mNvIQqaFaX92h27HcHodsUQZ7hql2dyuGWcQ== + "@types/json-schema" "^7.0.9" + ajv "^8.9.0" + ajv-formats "^2.1.1" + ajv-keywords "^5.1.0" schema-utils@2.7.0: version "2.7.0" @@ -11308,16 +11117,6 @@ schema-utils@^3.0.0, schema-utils@^3.1.1, schema-utils@^3.2.0: ajv "^6.12.5" ajv-keywords "^3.5.2" -schema-utils@^4.0.0, schema-utils@^4.0.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.2.0.tgz#70d7c93e153a273a805801882ebd3bff20d89c8b" - integrity sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw== - dependencies: - "@types/json-schema" "^7.0.9" - ajv "^8.9.0" - ajv-formats "^2.1.1" - ajv-keywords "^5.1.0" - select-hose@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" @@ -11505,11 +11304,6 @@ sisteransi@^1.0.5: resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== -slash@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" - integrity sha512-3TYDR7xWt4dIqV2JauJr+EJeW356RXijHeUlO+8djJ+uBXPn8/2dpzBc8yQhh583sVvc9CvFAeQVgijsH+PNNg== - slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" @@ -12292,11 +12086,6 @@ tr46@^3.0.0: dependencies: punycode "^2.1.1" -tr46@~0.0.3: - version "0.0.3" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== - tree-kill@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" @@ -12580,11 +12369,6 @@ typed-array-length@^1.0.4: for-each "^0.3.3" is-typed-array "^1.1.9" -typescript@^4.7.2: - version "4.9.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" - integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== - typescript@^5.0.4, typescript@^5.1.3: version "5.1.6" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274" @@ -12810,14 +12594,6 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== -utimes@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/utimes/-/utimes-5.2.0.tgz#2b9e8066ef94d42f16829fda4b2c69e89b401514" - integrity sha512-UxNC3pST0xO2RQgkcVqQFO/R6B36gel71ZZZjLXJI0wqHBJdJawaox1BXXV4oEptlUIkOrlNUumLJM03VLb9mg== - dependencies: - "@mapbox/node-pre-gyp" "^1.0.11" - node-addon-api "^4.3.0" - uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" @@ -12976,16 +12752,6 @@ webextension-polyfill@^0.10.0: resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.10.0.tgz#ccb28101c910ba8cf955f7e6a263e662d744dbb8" integrity sha512-c5s35LgVa5tFaHhrZDnr3FpQpjj1BB+RXhLTYUxGqBVN460HkbM8TBtEqdXWbpTKfzwCcjAZVF7zXCYSKtcp9g== -webextension-polyfill@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/webextension-polyfill/-/webextension-polyfill-0.8.0.tgz#f80e9f4b7f81820c420abd6ffbebfa838c60e041" - integrity sha512-a19+DzlT6Kp9/UI+mF9XQopeZ+n2ussjhxHJ4/pmIGge9ijCDz7Gn93mNnjpZAk95T4Tae8iHZ6sSf869txqiQ== - -webidl-conversions@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== - webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" @@ -13044,7 +12810,7 @@ webpack-dev-middleware@^5.3.1: range-parser "^1.2.1" schema-utils "^4.0.0" -webpack-dev-server@^4.13.3: +webpack-dev-server@^4.7.4: version "4.15.1" resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.15.1.tgz#8944b29c12760b3a45bdaa70799b17cb91b03df7" integrity sha512-5hbAst3h3C3L8w6W4P96L5vaV0PxSmJhxZvWKYIdgxOQm8pNZ5dEOmmSLBVpP85ReeyRt6AS1QJNyo/oFFPeVA== @@ -13080,17 +12846,10 @@ webpack-dev-server@^4.13.3: webpack-dev-middleware "^5.3.1" ws "^8.13.0" -webpack-inject-plugin@^1.5.5: - version "1.5.5" - resolved "https://registry.yarnpkg.com/webpack-inject-plugin/-/webpack-inject-plugin-1.5.5.tgz#fbecdb5cbc48e460aa8bcbdbad409933db9adca9" - integrity sha512-cYhj/3X6m19zmIEb/Y09/VjCf9SeL+/7Wv6YrUi/wBGFQPFMINEfzHBJV0qokeqvUwE23h8NzrTIrkHALZ9PaA== - dependencies: - loader-utils "~1.2.3" - -webpack-manifest-plugin@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/webpack-manifest-plugin/-/webpack-manifest-plugin-4.1.1.tgz#10f8dbf4714ff93a215d5a45bcc416d80506f94f" - integrity sha512-YXUAwxtfKIJIKkhg03MKuiFAD72PlrqCiwdwO4VEXdRO5V0ORCNwaOwAZawPZalCbmH9kBDmXnNeQOw+BIEiow== +webpack-manifest-plugin@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/webpack-manifest-plugin/-/webpack-manifest-plugin-5.0.0.tgz#084246c1f295d1b3222d36e955546433ca8df803" + integrity sha512-8RQfMAdc5Uw3QbCQ/CBV/AXqOR8mt03B6GJmRbhWopE8GzRfEpn+k0ZuWywxW+5QZsffhmFDY1J6ohqJo+eMuw== dependencies: tapable "^2.0.0" webpack-sources "^2.2.0" @@ -13121,7 +12880,7 @@ webpack-target-webextension@*, webpack-target-webextension@^1.1.0: resolved "https://registry.yarnpkg.com/webpack-target-webextension/-/webpack-target-webextension-1.1.0.tgz#2f36b829dd64daee261507699c67d36e7e054d3f" integrity sha512-ip7ljKtjRmXKjuLZLo8jzcQjV3nuVPI1U+AUcx6PGJXC/+7apt20wbSVfOKnXDhHhijzP44qe/1qSgR8C+HgZg== -webpack@^5, webpack@^5.68.0, webpack@^5.73.0, webpack@^5.81.0, webpack@^5.9.0: +webpack@^5, webpack@^5.68.0, webpack@^5.81.0, webpack@^5.9.0: version "5.88.2" resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.88.2.tgz#f62b4b842f1c6ff580f3fcb2ed4f0b579f4c210e" integrity sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ== @@ -13205,14 +12964,6 @@ whatwg-url@^11.0.0: tr46 "^3.0.0" webidl-conversions "^7.0.0" -whatwg-url@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== - dependencies: - tr46 "~0.0.3" - webidl-conversions "^3.0.0" - whatwg-url@^6.4.1: version "6.5.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" @@ -13287,7 +13038,7 @@ which@^3.0.0: dependencies: isexe "^2.0.0" -wide-align@^1.1.2, wide-align@^1.1.5: +wide-align@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== @@ -13305,6 +13056,7 @@ word-wrap@~1.2.3: integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: + name wrap-ansi-cjs version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==