From eb788bfed5ecb8cec3f9709a3fa31898b28408d4 Mon Sep 17 00:00:00 2001 From: Ian Bouchard Date: Sun, 11 Aug 2024 18:21:19 -0400 Subject: [PATCH] Initial commit --- .gitignore | 3 + .markdownlint.json | 5 + LICENSE | 121 +++++ README.md | 33 ++ manifest.json | 30 ++ package.json | 17 + packages/backend/package.json | 15 + packages/backend/src/index.ts | 17 + packages/backend/tsconfig.json | 7 + packages/backend/vite.config.ts | 21 + packages/frontend/package.json | 18 + packages/frontend/src/index.ts | 120 +++++ packages/frontend/src/styles/style.css | 9 + packages/frontend/src/types.ts | 3 + packages/frontend/tsconfig.json | 8 + packages/frontend/vite.config.ts | 19 + pnpm-lock.yaml | 660 +++++++++++++++++++++++++ pnpm-workspace.yaml | 2 + scripts/clean.js | 8 + scripts/pack.js | 55 +++ tsconfig.json | 24 + 21 files changed, 1195 insertions(+) create mode 100644 .gitignore create mode 100644 .markdownlint.json create mode 100644 LICENSE create mode 100644 README.md create mode 100644 manifest.json create mode 100644 package.json create mode 100644 packages/backend/package.json create mode 100644 packages/backend/src/index.ts create mode 100644 packages/backend/tsconfig.json create mode 100644 packages/backend/vite.config.ts create mode 100644 packages/frontend/package.json create mode 100644 packages/frontend/src/index.ts create mode 100644 packages/frontend/src/styles/style.css create mode 100644 packages/frontend/src/types.ts create mode 100644 packages/frontend/tsconfig.json create mode 100644 packages/frontend/vite.config.ts create mode 100644 pnpm-lock.yaml create mode 100644 pnpm-workspace.yaml create mode 100644 scripts/clean.js create mode 100644 scripts/pack.js create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0ca39c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules +dist +.DS_Store diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..9fe78b0 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,5 @@ +{ + "no-inline-html": false, + "line-length": false, + "first-line-h1": false +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0e259d4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b568ffc --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +
+ image + +
+
+ Website +   •   + Dashboard +   •   + Docs +   •   + Roadmap +   •   + Branding +   •   + Discord +
+
+
+ +# 🔰 StarterKit Plugin + +This is the starter kit for the Caido plugin system. + +This template is full-stack, with both a backend and frontend plugin. +For frontend only use the [frontend](https://github.com/caido/starterkit-plugin-frontend) starterkit. + +## 🏎️ Usage + +1. `pnpm install` +1. Make some modifications in `src` +1. `pnpm build` +1. Upload the plugin.zip in the `dist` folder to your Caido instance diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..b9d9969 --- /dev/null +++ b/manifest.json @@ -0,0 +1,30 @@ +{ + "id": "starterkit-plugin", + "name": "StarterKit Plugin", + "version": "0.1.0", + "description": "This is a starterkit plugin", + "author": { + "name": "Caido Labs Inc.", + "email": "dev@caido.io", + "url": "https://github.com/caido/starterkit-plugin" + }, + "plugins": [ + { + "kind": "frontend", + "id": "caido-extra-commands", + "name": "Extra Commands", + "entrypoint": "frontend/script.js", + "style": "frontend/style.css", + "backend": { + "id": "caido-extra-commands-backend" + } + }, + { + "kind": "backend", + "id": "caido-extra-commands-backend", + "name": "Extra Commands Backend", + "runtime": "javascript", + "entrypoint": "backend/script.js" + } + ] +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..2433461 --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "starterkit-plugin", + "version": "0.1.0", + "description": "StarterKit plugin for Caido", + "author": "Caido Labs Inc. ", + "license": "CC0-1.0", + "type": "module", + "scripts": { + "build": "node scripts/clean.js && pnpm -r build && node scripts/pack.js" + }, + "devDependencies": { + "@caido/plugin-manifest": "0.1.3", + "jszip": "3.10.1", + "typescript": "5.4.3", + "vite": "5.2.7" + } +} diff --git a/packages/backend/package.json b/packages/backend/package.json new file mode 100644 index 0000000..87b8878 --- /dev/null +++ b/packages/backend/package.json @@ -0,0 +1,15 @@ +{ + "name": "starterkit-plugin-backend", + "version": "0.1.0", + "description": "StarterKit plugin for Caido", + "author": "Caido Labs Inc. ", + "license": "CC0-1.0", + "type": "module", + "types": "src/index.ts", + "scripts": { + "build": "vite build" + }, + "devDependencies": { + "@caido/sdk-backend": "0.39.0" + } +} diff --git a/packages/backend/src/index.ts b/packages/backend/src/index.ts new file mode 100644 index 0000000..235e0d9 --- /dev/null +++ b/packages/backend/src/index.ts @@ -0,0 +1,17 @@ +import { Body } from "caido:utils"; +import { SDK, DefineAPI } from "caido:plugin"; + +function generateNumber(sdk: SDK, min: number, max: number): number { + sdk.console.log(new Body("test")); // Example from utils + + // Generate random number between min and max + return Math.floor(Math.random() * (max - min + 1) + min); +} + +export type API = DefineAPI<{ + generateNumber: typeof generateNumber; +}>; + +export function init(sdk: SDK) { + sdk.api.register("generateNumber", generateNumber); +} diff --git a/packages/backend/tsconfig.json b/packages/backend/tsconfig.json new file mode 100644 index 0000000..9dec401 --- /dev/null +++ b/packages/backend/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "types": ["@caido/sdk-backend"] + }, + "include": ["./src/**/*.ts"] +} diff --git a/packages/backend/vite.config.ts b/packages/backend/vite.config.ts new file mode 100644 index 0000000..1631618 --- /dev/null +++ b/packages/backend/vite.config.ts @@ -0,0 +1,21 @@ +import { defineConfig } from "vite"; +import { resolve } from "path"; +import { builtinModules } from "module"; + +export default defineConfig({ + build: { + lib: { + entry: resolve(__dirname, "src/index.ts"), + name: "plugin-template-backend", + fileName: (format) => "script.js", + formats: ["es"], + }, + outDir: "../../dist/backend", + rollupOptions: { + external: [/caido:.+/, ...builtinModules], + output: { + manualChunks: undefined, + }, + }, + }, +}); diff --git a/packages/frontend/package.json b/packages/frontend/package.json new file mode 100644 index 0000000..cd3c862 --- /dev/null +++ b/packages/frontend/package.json @@ -0,0 +1,18 @@ +{ + "name": "starterkit-plugin-frontend", + "version": "0.1.0", + "description": "StarterKit plugin for Caido", + "author": "Caido Labs Inc. ", + "license": "CC0-1.0", + "type": "module", + "scripts": { + "build": "vite build" + }, + "dependencies": { + "@caido/sdk-frontend": "0.39.0" + }, + "devDependencies": { + "@caido/sdk-backend": "0.39.0", + "starterkit-plugin-backend": "workspace:*" + } +} diff --git a/packages/frontend/src/index.ts b/packages/frontend/src/index.ts new file mode 100644 index 0000000..49f7686 --- /dev/null +++ b/packages/frontend/src/index.ts @@ -0,0 +1,120 @@ +import type { Caido } from "@caido/sdk-frontend"; +import type { API } from "starterkit-plugin-backend"; + +import type { PluginStorage } from "./types"; + +import "./styles/style.css"; + +type CaidoSDK = Caido; + +const Page = "/my-plugin" as const; +const Commands = { + increment: "my-plugin.increment", + decrement: "my-plugin.decrement", + randomize: "my-plugin.randomize", +} as const; + +const getCount = (sdk: CaidoSDK) => { + const storage = sdk.storage.get() as PluginStorage | undefined; + + if (storage) { + return storage.count; + } + + return 0; +} + +const increment = (sdk: CaidoSDK) => { + const count = getCount(sdk); + sdk.storage.set({ count: count + 1 }); +} + +const decrement = async (sdk: CaidoSDK) => { + const count = getCount(sdk); + sdk.storage.set({ count: count - 1 }); +} + +const randomize = async (sdk: CaidoSDK) => { + const newNumber = await sdk.backend.generateNumber(0, 1000); + sdk.storage.set({ count: newNumber }); +} + +const addPage = (sdk: CaidoSDK) => { + + const count = getCount(sdk); + + const body = document.createElement("div"); + body.className = "my-plugin"; + body.innerHTML = ` +
+ Count: + ${count} +
+
+ + + +
+ `; + + const countElement = body.querySelector(".my-plugin__value") as HTMLElement; + const incrementButton = body.querySelector(`[data-command="${Commands.increment}"]`) as HTMLElement; + const decrementButton = body.querySelector(`[data-command="${Commands.decrement}"]`) as HTMLElement; + const randomizeButton = body.querySelector(`[data-command="${Commands.randomize}"]`) as HTMLElement; + + sdk.storage.onChange((newStorage) => { + const storage = newStorage as PluginStorage | undefined; + + if (storage) { + countElement.innerHTML = `${storage.count}`; + return; + } + }); + + incrementButton.addEventListener("click", () => { + increment(sdk); + }); + + decrementButton.addEventListener("click", () => { + decrement(sdk); + }); + + randomizeButton.addEventListener("click", () => { + randomize(sdk); + }); + + sdk.navigation.addPage(Page, { + body, + }); +} + + +export const init = (sdk: CaidoSDK) => { + + // Register commands + // Commands are registered with a unique identifier and a handler function + // The run function is called when the command is executed + // These commands can be registered in various places like command palette, context menu, etc. + sdk.commands.register(Commands.increment, { + name: "Increment", + run: () => increment(sdk), + }); + + sdk.commands.register(Commands.decrement, { + name: "Decrement", + run: () => decrement(sdk), + }); + + // Register command palette items + sdk.commandPalette.register(Commands.increment); + sdk.commandPalette.register(Commands.decrement); + + // Register page + addPage(sdk); + + // Register sidebar + sdk.sidebar.registerItem("My plugin", Page, { + icon: "fas fa-rocket", + }); +} + diff --git a/packages/frontend/src/styles/style.css b/packages/frontend/src/styles/style.css new file mode 100644 index 0000000..822e129 --- /dev/null +++ b/packages/frontend/src/styles/style.css @@ -0,0 +1,9 @@ +.my-plugin { + width: 100%; + height: 100%; + + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; +} diff --git a/packages/frontend/src/types.ts b/packages/frontend/src/types.ts new file mode 100644 index 0000000..f790db2 --- /dev/null +++ b/packages/frontend/src/types.ts @@ -0,0 +1,3 @@ +export type PluginStorage = { + count: number; +} diff --git a/packages/frontend/tsconfig.json b/packages/frontend/tsconfig.json new file mode 100644 index 0000000..4e9360d --- /dev/null +++ b/packages/frontend/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "lib": ["DOM", "ESNext"], + "types": ["@caido/sdk-backend"] + }, + "include": ["./src/**/*.ts"] +} diff --git a/packages/frontend/vite.config.ts b/packages/frontend/vite.config.ts new file mode 100644 index 0000000..a3ce4fe --- /dev/null +++ b/packages/frontend/vite.config.ts @@ -0,0 +1,19 @@ +import { defineConfig } from "vite"; +import { resolve } from "path"; + +export default defineConfig({ + build: { + lib: { + entry: resolve(__dirname, "src/index.ts"), + name: "plugin-template-frontend", + fileName: (format) => "script.js", + formats: ["es"], + }, + outDir: "../../dist/frontend", + rollupOptions: { + output: { + manualChunks: undefined, + }, + }, + }, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..d8c3782 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,660 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + devDependencies: + '@caido/plugin-manifest': + specifier: 0.1.3 + version: 0.1.3 + jszip: + specifier: 3.10.1 + version: 3.10.1 + typescript: + specifier: 5.4.3 + version: 5.4.3 + vite: + specifier: 5.2.7 + version: 5.2.7 + + packages/backend: + devDependencies: + '@caido/sdk-backend': + specifier: 0.39.0 + version: 0.39.0 + + packages/frontend: + dependencies: + '@caido/sdk-frontend': + specifier: 0.39.0 + version: 0.39.0 + devDependencies: + '@caido/sdk-backend': + specifier: 0.39.0 + version: 0.39.0 + starterkit-plugin-backend: + specifier: workspace:* + version: link:../backend + +packages: + + '@caido/plugin-manifest@0.1.3': + resolution: {integrity: sha512-6PK/mIz2vIImgNFmc34Smiz86ifE+B962xz7uR4MPMxRaRlMlgfL8IvPkbpJyRaXb0mDDVqGzMB82HddpyGQSw==} + + '@caido/sdk-backend@0.39.0': + resolution: {integrity: sha512-SIoC7TBfXhRgU6i1n3OWWMoJUL8IoprB4KMp+Bgq0gPczn8nYioofXLUpYht8W9pHBiMvY6jlcEqYS7ZLimxVg==} + + '@caido/sdk-frontend@0.39.0': + resolution: {integrity: sha512-XIY24OLh6hcefMdltgfvae2E4t8EhPpikYCihthYlSLJ+LaabRTPePVcdPS4avlMkQPIWm+S19cHCn+lNuNx6Q==} + + '@esbuild/aix-ppc64@0.20.2': + resolution: {integrity: sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.20.2': + resolution: {integrity: sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.20.2': + resolution: {integrity: sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.20.2': + resolution: {integrity: sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.20.2': + resolution: {integrity: sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.20.2': + resolution: {integrity: sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.20.2': + resolution: {integrity: sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.20.2': + resolution: {integrity: sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.20.2': + resolution: {integrity: sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.20.2': + resolution: {integrity: sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.20.2': + resolution: {integrity: sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.20.2': + resolution: {integrity: sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.20.2': + resolution: {integrity: sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.20.2': + resolution: {integrity: sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.20.2': + resolution: {integrity: sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.20.2': + resolution: {integrity: sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.20.2': + resolution: {integrity: sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-x64@0.20.2': + resolution: {integrity: sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-x64@0.20.2': + resolution: {integrity: sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + + '@esbuild/sunos-x64@0.20.2': + resolution: {integrity: sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.20.2': + resolution: {integrity: sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.20.2': + resolution: {integrity: sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.20.2': + resolution: {integrity: sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + + '@rollup/rollup-android-arm-eabi@4.16.4': + resolution: {integrity: sha512-GkhjAaQ8oUTOKE4g4gsZ0u8K/IHU1+2WQSgS1TwTcYvL+sjbaQjNHFXbOJ6kgqGHIO1DfUhI/Sphi9GkRT9K+Q==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.16.4': + resolution: {integrity: sha512-Bvm6D+NPbGMQOcxvS1zUl8H7DWlywSXsphAeOnVeiZLQ+0J6Is8T7SrjGTH29KtYkiY9vld8ZnpV3G2EPbom+w==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.16.4': + resolution: {integrity: sha512-i5d64MlnYBO9EkCOGe5vPR/EeDwjnKOGGdd7zKFhU5y8haKhQZTN2DgVtpODDMxUr4t2K90wTUJg7ilgND6bXw==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.16.4': + resolution: {integrity: sha512-WZupV1+CdUYehaZqjaFTClJI72fjJEgTXdf4NbW69I9XyvdmztUExBtcI2yIIU6hJtYvtwS6pkTkHJz+k08mAQ==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-linux-arm-gnueabihf@4.16.4': + resolution: {integrity: sha512-ADm/xt86JUnmAfA9mBqFcRp//RVRt1ohGOYF6yL+IFCYqOBNwy5lbEK05xTsEoJq+/tJzg8ICUtS82WinJRuIw==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm-musleabihf@4.16.4': + resolution: {integrity: sha512-tJfJaXPiFAG+Jn3cutp7mCs1ePltuAgRqdDZrzb1aeE3TktWWJ+g7xK9SNlaSUFw6IU4QgOxAY4rA+wZUT5Wfg==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.16.4': + resolution: {integrity: sha512-7dy1BzQkgYlUTapDTvK997cgi0Orh5Iu7JlZVBy1MBURk7/HSbHkzRnXZa19ozy+wwD8/SlpJnOOckuNZtJR9w==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-arm64-musl@4.16.4': + resolution: {integrity: sha512-zsFwdUw5XLD1gQe0aoU2HVceI6NEW7q7m05wA46eUAyrkeNYExObfRFQcvA6zw8lfRc5BHtan3tBpo+kqEOxmg==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-powerpc64le-gnu@4.16.4': + resolution: {integrity: sha512-p8C3NnxXooRdNrdv6dBmRTddEapfESEUflpICDNKXpHvTjRRq1J82CbU5G3XfebIZyI3B0s074JHMWD36qOW6w==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.16.4': + resolution: {integrity: sha512-Lh/8ckoar4s4Id2foY7jNgitTOUQczwMWNYi+Mjt0eQ9LKhr6sK477REqQkmy8YHY3Ca3A2JJVdXnfb3Rrwkng==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-s390x-gnu@4.16.4': + resolution: {integrity: sha512-1xwwn9ZCQYuqGmulGsTZoKrrn0z2fAur2ujE60QgyDpHmBbXbxLaQiEvzJWDrscRq43c8DnuHx3QorhMTZgisQ==} + cpu: [s390x] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.16.4': + resolution: {integrity: sha512-LuOGGKAJ7dfRtxVnO1i3qWc6N9sh0Em/8aZ3CezixSTM+E9Oq3OvTsvC4sm6wWjzpsIlOCnZjdluINKESflJLA==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-linux-x64-musl@4.16.4': + resolution: {integrity: sha512-ch86i7KkJKkLybDP2AtySFTRi5fM3KXp0PnHocHuJMdZwu7BuyIKi35BE9guMlmTpwwBTB3ljHj9IQXnTCD0vA==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-win32-arm64-msvc@4.16.4': + resolution: {integrity: sha512-Ma4PwyLfOWZWayfEsNQzTDBVW8PZ6TUUN1uFTBQbF2Chv/+sjenE86lpiEwj2FiviSmSZ4Ap4MaAfl1ciF4aSA==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.16.4': + resolution: {integrity: sha512-9m/ZDrQsdo/c06uOlP3W9G2ENRVzgzbSXmXHT4hwVaDQhYcRpi9bgBT0FTG9OhESxwK0WjQxYOSfv40cU+T69w==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.16.4': + resolution: {integrity: sha512-YunpoOAyGLDseanENHmbFvQSfVL5BxW3k7hhy0eN4rb3gS/ct75dVD0EXOWIqFT/nE8XYW6LP6vz6ctKRi0k9A==} + cpu: [x64] + os: [win32] + + '@types/estree@1.0.5': + resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + + ajv@8.16.0: + resolution: {integrity: sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==} + + core-util-is@1.0.3: + resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + + esbuild@0.20.2: + resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==} + engines: {node: '>=12'} + hasBin: true + + fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + immediate@3.0.6: + resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + isarray@1.0.0: + resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} + + json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + jszip@3.10.1: + resolution: {integrity: sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==} + + lie@3.3.0: + resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==} + + nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + pako@1.0.11: + resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} + + picocolors@1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + + postcss@8.4.38: + resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} + engines: {node: ^10 || ^12 || >=14} + + process-nextick-args@2.0.1: + resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + + punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} + engines: {node: '>=6'} + + readable-stream@2.3.8: + resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} + + require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + rollup@4.16.4: + resolution: {integrity: sha512-kuaTJSUbz+Wsb2ATGvEknkI12XV40vIiHmLuFlejoo7HtDok/O5eDDD0UpCVY5bBX5U5RYo8wWP83H7ZsqVEnA==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + safe-buffer@5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + + setimmediate@1.0.5: + resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} + + source-map-js@1.2.0: + resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} + engines: {node: '>=0.10.0'} + + string_decoder@1.1.1: + resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} + + typescript@5.4.3: + resolution: {integrity: sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==} + engines: {node: '>=14.17'} + hasBin: true + + uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + + util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + + vite@5.2.7: + resolution: {integrity: sha512-k14PWOKLI6pMaSzAuGtT+Cf0YmIx12z9YGon39onaJNy8DLBfBJrzg9FQEmkAM5lpHBZs9wksWAsyF/HkpEwJA==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || >=20.0.0 + less: '*' + lightningcss: ^1.21.0 + sass: '*' + stylus: '*' + sugarss: '*' + terser: ^5.4.0 + peerDependenciesMeta: + '@types/node': + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + +snapshots: + + '@caido/plugin-manifest@0.1.3': + dependencies: + ajv: 8.16.0 + + '@caido/sdk-backend@0.39.0': {} + + '@caido/sdk-frontend@0.39.0': {} + + '@esbuild/aix-ppc64@0.20.2': + optional: true + + '@esbuild/android-arm64@0.20.2': + optional: true + + '@esbuild/android-arm@0.20.2': + optional: true + + '@esbuild/android-x64@0.20.2': + optional: true + + '@esbuild/darwin-arm64@0.20.2': + optional: true + + '@esbuild/darwin-x64@0.20.2': + optional: true + + '@esbuild/freebsd-arm64@0.20.2': + optional: true + + '@esbuild/freebsd-x64@0.20.2': + optional: true + + '@esbuild/linux-arm64@0.20.2': + optional: true + + '@esbuild/linux-arm@0.20.2': + optional: true + + '@esbuild/linux-ia32@0.20.2': + optional: true + + '@esbuild/linux-loong64@0.20.2': + optional: true + + '@esbuild/linux-mips64el@0.20.2': + optional: true + + '@esbuild/linux-ppc64@0.20.2': + optional: true + + '@esbuild/linux-riscv64@0.20.2': + optional: true + + '@esbuild/linux-s390x@0.20.2': + optional: true + + '@esbuild/linux-x64@0.20.2': + optional: true + + '@esbuild/netbsd-x64@0.20.2': + optional: true + + '@esbuild/openbsd-x64@0.20.2': + optional: true + + '@esbuild/sunos-x64@0.20.2': + optional: true + + '@esbuild/win32-arm64@0.20.2': + optional: true + + '@esbuild/win32-ia32@0.20.2': + optional: true + + '@esbuild/win32-x64@0.20.2': + optional: true + + '@rollup/rollup-android-arm-eabi@4.16.4': + optional: true + + '@rollup/rollup-android-arm64@4.16.4': + optional: true + + '@rollup/rollup-darwin-arm64@4.16.4': + optional: true + + '@rollup/rollup-darwin-x64@4.16.4': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.16.4': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.16.4': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.16.4': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.16.4': + optional: true + + '@rollup/rollup-linux-powerpc64le-gnu@4.16.4': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.16.4': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.16.4': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.16.4': + optional: true + + '@rollup/rollup-linux-x64-musl@4.16.4': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.16.4': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.16.4': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.16.4': + optional: true + + '@types/estree@1.0.5': {} + + ajv@8.16.0: + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + + core-util-is@1.0.3: {} + + esbuild@0.20.2: + optionalDependencies: + '@esbuild/aix-ppc64': 0.20.2 + '@esbuild/android-arm': 0.20.2 + '@esbuild/android-arm64': 0.20.2 + '@esbuild/android-x64': 0.20.2 + '@esbuild/darwin-arm64': 0.20.2 + '@esbuild/darwin-x64': 0.20.2 + '@esbuild/freebsd-arm64': 0.20.2 + '@esbuild/freebsd-x64': 0.20.2 + '@esbuild/linux-arm': 0.20.2 + '@esbuild/linux-arm64': 0.20.2 + '@esbuild/linux-ia32': 0.20.2 + '@esbuild/linux-loong64': 0.20.2 + '@esbuild/linux-mips64el': 0.20.2 + '@esbuild/linux-ppc64': 0.20.2 + '@esbuild/linux-riscv64': 0.20.2 + '@esbuild/linux-s390x': 0.20.2 + '@esbuild/linux-x64': 0.20.2 + '@esbuild/netbsd-x64': 0.20.2 + '@esbuild/openbsd-x64': 0.20.2 + '@esbuild/sunos-x64': 0.20.2 + '@esbuild/win32-arm64': 0.20.2 + '@esbuild/win32-ia32': 0.20.2 + '@esbuild/win32-x64': 0.20.2 + + fast-deep-equal@3.1.3: {} + + fsevents@2.3.3: + optional: true + + immediate@3.0.6: {} + + inherits@2.0.4: {} + + isarray@1.0.0: {} + + json-schema-traverse@1.0.0: {} + + jszip@3.10.1: + dependencies: + lie: 3.3.0 + pako: 1.0.11 + readable-stream: 2.3.8 + setimmediate: 1.0.5 + + lie@3.3.0: + dependencies: + immediate: 3.0.6 + + nanoid@3.3.7: {} + + pako@1.0.11: {} + + picocolors@1.0.0: {} + + postcss@8.4.38: + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.0 + source-map-js: 1.2.0 + + process-nextick-args@2.0.1: {} + + punycode@2.3.1: {} + + readable-stream@2.3.8: + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 2.0.1 + safe-buffer: 5.1.2 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + + require-from-string@2.0.2: {} + + rollup@4.16.4: + dependencies: + '@types/estree': 1.0.5 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.16.4 + '@rollup/rollup-android-arm64': 4.16.4 + '@rollup/rollup-darwin-arm64': 4.16.4 + '@rollup/rollup-darwin-x64': 4.16.4 + '@rollup/rollup-linux-arm-gnueabihf': 4.16.4 + '@rollup/rollup-linux-arm-musleabihf': 4.16.4 + '@rollup/rollup-linux-arm64-gnu': 4.16.4 + '@rollup/rollup-linux-arm64-musl': 4.16.4 + '@rollup/rollup-linux-powerpc64le-gnu': 4.16.4 + '@rollup/rollup-linux-riscv64-gnu': 4.16.4 + '@rollup/rollup-linux-s390x-gnu': 4.16.4 + '@rollup/rollup-linux-x64-gnu': 4.16.4 + '@rollup/rollup-linux-x64-musl': 4.16.4 + '@rollup/rollup-win32-arm64-msvc': 4.16.4 + '@rollup/rollup-win32-ia32-msvc': 4.16.4 + '@rollup/rollup-win32-x64-msvc': 4.16.4 + fsevents: 2.3.3 + + safe-buffer@5.1.2: {} + + setimmediate@1.0.5: {} + + source-map-js@1.2.0: {} + + string_decoder@1.1.1: + dependencies: + safe-buffer: 5.1.2 + + typescript@5.4.3: {} + + uri-js@4.4.1: + dependencies: + punycode: 2.3.1 + + util-deprecate@1.0.2: {} + + vite@5.2.7: + dependencies: + esbuild: 0.20.2 + postcss: 8.4.38 + rollup: 4.16.4 + optionalDependencies: + fsevents: 2.3.3 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000..18ec407 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - 'packages/*' diff --git a/scripts/clean.js b/scripts/clean.js new file mode 100644 index 0000000..37a581c --- /dev/null +++ b/scripts/clean.js @@ -0,0 +1,8 @@ +import fs from "fs"; +import path from "path"; +import { fileURLToPath } from "url"; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const DIST = path.join(__dirname, "../dist"); + +fs.rmSync(DIST, { recursive: true, force: true }); diff --git a/scripts/pack.js b/scripts/pack.js new file mode 100644 index 0000000..6d7a624 --- /dev/null +++ b/scripts/pack.js @@ -0,0 +1,55 @@ +import JSZip from "jszip"; +import fs from "fs"; +import path from "path"; +import { fileURLToPath } from "url"; +import { validateManifest } from "@caido/plugin-manifest"; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const DIST = path.resolve(__dirname, "../dist"); + +/** + * @param {string} dirPath + * @param {JSZip} zipFolder + */ +function addDirToZip(dirPath, zipFolder) { + const files = fs.readdirSync(dirPath); + files.forEach((file) => { + const filePath = path.join(dirPath, file); + const fileStat = fs.statSync(filePath); + if (fileStat.isDirectory()) { + const newZipFolder = zipFolder.folder(file); + addDirToZip(filePath, newZipFolder); + } else { + const fileContents = fs.readFileSync(filePath); + zipFolder.file(file, fileContents); + } + }); +} + +console.log("[*] Copying manifest file"); +const srcManifestPath = path.resolve(__dirname, "../manifest.json"); +const destManifestPath = path.join(DIST, "manifest.json"); +const data = JSON.parse(fs.readFileSync(srcManifestPath, "utf-8")); +if (!validateManifest(data)) { + process.exit(1); +} +fs.copyFileSync(srcManifestPath, destManifestPath); + +console.log("[*] Creating zip"); +const zip = new JSZip(); + +addDirToZip(DIST, zip); + +const zipPath = path.join(DIST, "plugin.zip"); +zip + .generateAsync({ + type: "nodebuffer", + compression: "DEFLATE", + compressionOptions: { + level: 9, + }, + }) + .then((content) => { + fs.writeFileSync(zipPath, content); + }) + .catch((err) => console.error("[-] Error creating zip:", err)); diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..f986f70 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "esnext", + "lib": ["ESNext"], + + "jsx": "preserve", + "noImplicitAny": true, + "noUncheckedIndexedAccess": true, + "strict": true, + "skipLibCheck": true, + "resolveJsonModule": true, + + "moduleResolution": "bundler", + "esModuleInterop": true, + "sourceMap": true, + "noUnusedLocals": true, + + "useDefineForClassFields": true, + "isolatedModules": true, + + "baseUrl": "." + } +}