diff --git a/.changeset/spotty-zoos-film.md b/.changeset/spotty-zoos-film.md new file mode 100644 index 0000000000..432bbbddfd --- /dev/null +++ b/.changeset/spotty-zoos-film.md @@ -0,0 +1,5 @@ +--- +"blitz": patch +--- + +Add `blitz console` CLI command back to toolkit diff --git a/packages/blitz/package.json b/packages/blitz/package.json index b167c39065..173dd25e03 100644 --- a/packages/blitz/package.json +++ b/packages/blitz/package.json @@ -27,6 +27,7 @@ "arg": "5.0.1", "boxen": "7.0.0", "chalk": "^4.1.0", + "chokidar": "3.5.3", "console-table-printer": "2.10.0", "cross-spawn": "7.0.3", "debug": "4.3.3", @@ -35,8 +36,10 @@ "dotenv-expand": "8.0.3", "envinfo": "7.8.1", "esbuild": "0.14.34", + "esbuild-register": "3.3.3", "find-up": "4.1.0", "fs-extra": "10.0.1", + "globby": "13.1.2", "hasbin": "1.2.3", "node-fetch": "3.2.3", "npm-which": "3.0.1", @@ -44,6 +47,7 @@ "os-name": "5.0.1", "p-event": "4.2.0", "pkg-dir": "5.0.0", + "progress": "2.0.3", "prompts": "2.4.2", "resolve-cwd": "3.0.0", "resolve-from": "5.0.0", @@ -66,6 +70,7 @@ "@types/hasbin": "1.2.0", "@types/node-fetch": "2.6.1", "@types/npm-which": "3.0.1", + "@types/progress": "2.0.5", "@types/prompts": "2.0.14", "@types/react": "18.0.17", "@types/react-dom": "17.0.14", diff --git a/packages/blitz/src/cli/commands/console.ts b/packages/blitz/src/cli/commands/console.ts new file mode 100644 index 0000000000..3907d16562 --- /dev/null +++ b/packages/blitz/src/cli/commands/console.ts @@ -0,0 +1,49 @@ +import {CliCommand} from "../index" +import arg from "arg" +import chalk from "chalk" +import {log} from "../../logging" +import {runRepl, getDbFolder} from "../utils/next-console" + +const args = arg( + { + // Types + "--only-db": Boolean, + + // Aliases + "-d": "--only-db", + }, + { + permissive: true, + }, +) + +const replOptions = { + prompt: "⚡️ > ", + useColors: true, +} + +const consoleREPL: CliCommand = async () => { + process.env.CLI_COMMAND_CONSOLE = "true" + log.branded("You have entered the Blitz console") + console.log(chalk.yellow("Tips: - Exit by typing .exit or pressing Ctrl-D")) + console.log( + chalk.yellow(` - Use your db like this: ${getDbFolder()}.project.findMany()`), + ) + console.log(chalk.yellow(" - Use your queries/mutations like this: getProjects({})")) + + const {register} = require("esbuild-register/dist/node") + + const {unregister} = register({ + target: "es6", + }) + + const onlyDb = args["--only-db"] as boolean + if (onlyDb) { + console.log(chalk.green(`Loading only ${getDbFolder()} module`)) + } + await runRepl(replOptions, onlyDb) + + unregister() +} + +export {consoleREPL} diff --git a/packages/blitz/src/cli/index.ts b/packages/blitz/src/cli/index.ts index 0bb508cb56..053bab91a7 100644 --- a/packages/blitz/src/cli/index.ts +++ b/packages/blitz/src/cli/index.ts @@ -34,6 +34,7 @@ const commands = { generate: () => import("./commands/generate").then((i) => i.generate), codegen: () => import("./commands/codegen").then((i) => i.codegen), db: () => import("./commands/db").then((i) => i.db), + console: () => import("./commands/console").then((i) => i.consoleREPL), } const aliases: Record = { @@ -42,6 +43,7 @@ const aliases: Record = { s: "start", n: "new", g: "generate", + c: "console", } type Command = keyof typeof commands diff --git a/packages/blitz/src/cli/utils/next-console.ts b/packages/blitz/src/cli/utils/next-console.ts new file mode 100644 index 0000000000..4ff091b5b7 --- /dev/null +++ b/packages/blitz/src/cli/utils/next-console.ts @@ -0,0 +1,266 @@ +import {watch} from "chokidar" +import fs from "fs" +import os from "os" +import path from "path" +import * as REPL from "repl" +import {REPLCommand, REPLServer} from "repl" +const debug = require("debug")("blitz:repl") +import ProgressBar from "progress" +import {log} from "../../logging" + +export function getDbFolder() { + if (fs.existsSync(path.join(process.cwd(), "db"))) { + return "db" + } + try { + const packageJsonPath = path.join(process.cwd(), "package.json") + const packageJson = fs.readFileSync(packageJsonPath, "utf8") + const packageJsonObj = JSON.parse(packageJson) + if (!packageJsonObj.prisma || !packageJsonObj.prisma.schema) { + throw new Error( + "db folder does not exist and Prisma schema not found in package.json. Please either create the db folder or add the prisma schema path to the package.json", + ) + } + const prismaSchemaPath = path.join(process.cwd(), packageJsonObj.prisma.schema) + if (!fs.existsSync(prismaSchemaPath)) { + throw new Error( + "prisma.schema file not found. Please either create the db folder or add the prisma schema path to the package.json", + ) + } + const folder = packageJsonObj.prisma.schema.split("/")[0] as string + return folder + } catch (e) { + throw new Error(e) + } +} + +export function getProjectRootSync() { + return path.dirname(getConfigSrcPath()) +} + +export function getConfigSrcPath() { + const tsPath = path.resolve(path.join(process.cwd(), "next.config.ts")) + if (fs.existsSync(tsPath)) { + return tsPath + } else { + const jsPath = path.resolve(path.join(process.cwd(), "next.config.js")) + return jsPath + } +} + +const projectRoot = getProjectRootSync() +const isTypeScript = fs.existsSync(path.join(projectRoot, "tsconfig.json")) + +const invalidateCache = (module: string) => { + delete require.cache[require.resolve(module)] +} + +export const forceRequire = (modulePath: string) => { + invalidateCache(modulePath) + const {register} = require("esbuild-register/dist/node") + const {unregister} = register({ + target: "es6", + }) + + if (isTypeScript) { + const module = require(modulePath) + unregister() + return module + } else { + const esmRequire = require("esm")(module) + const moduleEsm = esmRequire(modulePath) + unregister() + return moduleEsm + } +} + +export async function getBlitzModulePaths() { + const projectRoot = getProjectRootSync() + const {globby} = await import("globby") + const paths = await globby( + [ + "app/**/{queries,mutations}/**/*.{js,ts,tsx}", + "utils/*.{js,ts,tsx}", + "jobs/**/*.{js,ts,tsx}", + "integrations/**/*.{js,ts,tsx}", + "!**/*.test.*", + "!**/*.spec.*", + ], + {cwd: projectRoot, gitignore: true}, + ) + paths.push(getDbFolder()) + debug("Paths", paths) + + return [...paths.map((p: string) => path.join(projectRoot, p))] +} + +export const loadBlitz = async (onlyDb: boolean, module = "") => { + let paths = await getBlitzModulePaths() + + if (onlyDb) { + paths = paths.filter((p) => p.includes(getDbFolder())) + } + + if (module) { + paths = paths.filter((p) => module.includes(p) || p.includes(module)) + } + + const percentage = new ProgressBar("Loading Modules :current/:total", { + total: paths.length, + }) + + const modules: Record[] = Object.assign( + {}, + ...paths.map((modulePath) => { + let name = path.parse(modulePath).name + if (name === "index") { + const dirs = path.dirname(modulePath).split(path.sep) + name = dirs[dirs.length - 1] as string + } + + try { + debug("Loading", modulePath) + const module = forceRequire(modulePath) + const contextObj = module.default || module + // debug("ContextObj", contextObj) + + percentage.tick() + //TODO: include all exports here, not just default + return { + [name]: contextObj, + } + } catch (error) { + log.error(`Failed to load ${modulePath}: ${error}`) + debug("Failed to load module", error) + return {} + } + }), + ) + + percentage.terminate() + + return modules +} + +const loadBlitzModules = (repl: REPLServer, modules: any) => { + Object.assign(repl.context, modules) +} + +const loadModules = async (repl: REPLServer, onlyDb: boolean, module = "") => { + loadBlitzModules(repl, await loadBlitz(onlyDb, module)) +} + +const commands = { + reload: { + help: "Reload all modules", + async action(this: REPLServer) { + this.clearBufferedCommand() + console.log("Reloading all modules...") + await loadModules(this, false) + this.displayPrompt() + }, + }, +} + +const defineCommands = ( + repl: REPLServer, + // eslint-disable-next-line no-shadow + commands: Record, +) => { + Object.entries(commands).forEach(([keyword, cmd]) => repl.defineCommand(keyword, cmd)) +} + +// eslint-disable-next-line no-shadow +const setupSelfRolledHistory = (repl: any, path: string) => { + function init() { + try { + const history = fs.readFileSync(path, {encoding: "utf8"}) + const nonEmptyLines = history.split(os.EOL).filter((line) => line.trim()) + repl.history.push(...nonEmptyLines.reverse()) + } catch (err: any) { + if (err.code !== "ENOENT") { + throw err + } + } + } + + function onExit() { + const addedHistory = repl.lines.join(os.EOL) + fs.appendFileSync(path, addedHistory) + } + + init() + repl.on("exit", onExit) +} + +const setupHistory = (repl: any) => { + const blitzConsoleHistoryPath = path.join(projectRoot, ".blitz-console-history") + if (repl.setupHistory) { + repl.setupHistory(blitzConsoleHistoryPath, () => {}) + } else { + setupSelfRolledHistory(repl, blitzConsoleHistoryPath) + } +} + +const initializeRepl = async (replOptions: REPL.ReplOptions, onlyDb: boolean) => { + debug("initializeRepl") + const modules = await loadBlitz(onlyDb) + + debug("Starting REPL...") + const repl = REPL.start(replOptions) + + // always await promises. + // source: https://github.com/nodejs/node/issues/13209#issuecomment-619526317 + // using @ts-ignore because the types do not allow to override the eval function + const defaultEval = repl.eval + //@ts-ignore + repl.eval = (cmd, context, filename, callback) => { + //@ts-ignore + defaultEval(cmd, context, filename, async (err, result) => { + if (err) { + // propagate errors from the eval + callback(err) + } else { + // awaits the promise and either return result or error + try { + callback(null, await Promise.resolve(result)) + } catch (err) { + callback(err) + } + } + }) + } + + loadBlitzModules(repl, modules) + defineCommands(repl, commands) + setupHistory(repl) + + return repl +} + +const setupFileWatchers = async (repl: REPLServer) => { + debug("Setting up file watchers...") + const watchers = [ + watch(await getBlitzModulePaths(), { + ignoreInitial: true, + }).on("all", async (event: string, path: string) => { + const modulePath = path + const modules = await loadBlitz(false, modulePath) + loadBlitzModules(repl, modules) + }), + ] + + repl.on("reset", async () => { + debug("Reset, so reloading modules...") + await loadModules(repl, false) + }) + repl.on("exit", () => watchers.forEach((watcher) => watcher.close())) +} + +const runRepl = async (replOptions: REPL.ReplOptions, onlyDb: boolean) => { + const repl = await initializeRepl(replOptions, onlyDb) + repl.on("exit", () => process.exit()) + await setupFileWatchers(repl) +} + +export {runRepl} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8ba3a07368..016b89d011 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: 5.4 +lockfileVersion: 5.3 importers: .: @@ -662,6 +662,7 @@ importers: "@types/hasbin": 1.2.0 "@types/node-fetch": 2.6.1 "@types/npm-which": 3.0.1 + "@types/progress": 2.0.5 "@types/prompts": 2.0.14 "@types/react": 18.0.17 "@types/react-dom": 17.0.14 @@ -670,6 +671,7 @@ importers: arg: 5.0.1 boxen: 7.0.0 chalk: ^4.1.0 + chokidar: 3.5.3 console-table-printer: 2.10.0 cross-spawn: 7.0.3 debug: 4.3.3 @@ -678,9 +680,11 @@ importers: dotenv-expand: 8.0.3 envinfo: 7.8.1 esbuild: 0.14.34 + esbuild-register: 3.3.3 express: 4.17.3 find-up: 4.1.0 fs-extra: 10.0.1 + globby: 13.1.2 hasbin: 1.2.3 node-fetch: 3.2.3 npm-which: 3.0.1 @@ -688,6 +692,7 @@ importers: os-name: 5.0.1 p-event: 4.2.0 pkg-dir: 5.0.0 + progress: 2.0.3 prompts: 2.4.2 react: 18.2.0 resolve-cwd: 3.0.0 @@ -708,16 +713,19 @@ importers: arg: 5.0.1 boxen: 7.0.0 chalk: 4.1.2 + chokidar: 3.5.3 console-table-printer: 2.10.0 cross-spawn: 7.0.3 debug: 4.3.3_supports-color@8.1.1 - detect-port: 1.3.0_supports-color@8.1.1 + detect-port: 1.3.0 dotenv: 16.0.0 dotenv-expand: 8.0.3 envinfo: 7.8.1 esbuild: 0.14.34 + esbuild-register: 3.3.3_esbuild@0.14.34 find-up: 4.1.0 fs-extra: 10.0.1 + globby: 13.1.2 hasbin: 1.2.3 node-fetch: 3.2.3 npm-which: 3.0.1 @@ -725,6 +733,7 @@ importers: os-name: 5.0.1 p-event: 4.2.0 pkg-dir: 5.0.0 + progress: 2.0.3 prompts: 2.4.2 resolve-cwd: 3.0.0 resolve-from: 5.0.0 @@ -746,12 +755,13 @@ importers: "@types/hasbin": 1.2.0 "@types/node-fetch": 2.6.1 "@types/npm-which": 3.0.1 + "@types/progress": 2.0.5 "@types/prompts": 2.0.14 "@types/react": 18.0.17 "@types/react-dom": 17.0.14 "@types/test-listen": 1.1.0 "@types/watchpack": 1.1.1 - express: 4.17.3_supports-color@8.1.1 + express: 4.17.3 react: 18.2.0 test-listen: 1.1.0 typescript: 4.6.3 @@ -1176,6 +1186,7 @@ packages: source-map: 0.5.7 transitivePeerDependencies: - supports-color + dev: false /@babel/core/7.12.10_supports-color@8.1.1: resolution: @@ -1201,6 +1212,7 @@ packages: source-map: 0.5.7 transitivePeerDependencies: - supports-color + dev: false /@babel/core/7.18.2: resolution: @@ -1590,6 +1602,7 @@ packages: "@babel/types": 7.18.4 transitivePeerDependencies: - supports-color + dev: true /@babel/helper-remap-async-to-generator/7.16.8_supports-color@8.1.1: resolution: @@ -1690,6 +1703,7 @@ packages: "@babel/types": 7.18.4 transitivePeerDependencies: - supports-color + dev: true /@babel/helper-wrap-function/7.16.8_supports-color@8.1.1: resolution: @@ -1768,6 +1782,7 @@ packages: "@babel/plugin-syntax-async-generators": 7.8.4_@babel+core@7.12.10 transitivePeerDependencies: - supports-color + dev: true /@babel/plugin-proposal-async-generator-functions/7.17.12_ps3yxa7qdojvlda5ukda3zlwie: resolution: @@ -2013,6 +2028,7 @@ packages: "@babel/helper-plugin-utils": 7.17.12 transitivePeerDependencies: - supports-color + dev: true /@babel/plugin-proposal-private-methods/7.17.12_ps3yxa7qdojvlda5ukda3zlwie: resolution: @@ -2400,6 +2416,7 @@ packages: "@babel/helper-remap-async-to-generator": 7.16.8 transitivePeerDependencies: - supports-color + dev: true /@babel/plugin-transform-async-to-generator/7.17.12_ps3yxa7qdojvlda5ukda3zlwie: resolution: @@ -2462,6 +2479,7 @@ packages: globals: 11.12.0 transitivePeerDependencies: - supports-color + dev: true /@babel/plugin-transform-classes/7.18.4_ps3yxa7qdojvlda5ukda3zlwie: resolution: @@ -2626,6 +2644,7 @@ packages: babel-plugin-dynamic-import-node: 2.3.3 transitivePeerDependencies: - supports-color + dev: true /@babel/plugin-transform-modules-amd/7.18.0_ps3yxa7qdojvlda5ukda3zlwie: resolution: @@ -2660,6 +2679,7 @@ packages: babel-plugin-dynamic-import-node: 2.3.3 transitivePeerDependencies: - supports-color + dev: true /@babel/plugin-transform-modules-commonjs/7.18.2_@babel+core@7.18.2: resolution: @@ -2732,6 +2752,7 @@ packages: babel-plugin-dynamic-import-node: 2.3.3 transitivePeerDependencies: - supports-color + dev: true /@babel/plugin-transform-modules-systemjs/7.18.4_ps3yxa7qdojvlda5ukda3zlwie: resolution: @@ -2766,6 +2787,7 @@ packages: "@babel/helper-plugin-utils": 7.17.12 transitivePeerDependencies: - supports-color + dev: true /@babel/plugin-transform-modules-umd/7.18.0_ps3yxa7qdojvlda5ukda3zlwie: resolution: @@ -2822,6 +2844,7 @@ packages: "@babel/helper-replace-supers": 7.18.2 transitivePeerDependencies: - supports-color + dev: true /@babel/plugin-transform-object-super/7.16.7_ps3yxa7qdojvlda5ukda3zlwie: resolution: @@ -3157,6 +3180,7 @@ packages: semver: 5.7.1 transitivePeerDependencies: - supports-color + dev: true /@babel/preset-env/7.12.10_ps3yxa7qdojvlda5ukda3zlwie: resolution: @@ -3455,8 +3479,6 @@ packages: semver: 6.3.0 spawndamnit: 2.0.0 validate-npm-package-name: 3.0.0 - transitivePeerDependencies: - - supports-color dev: false /@changesets/apply-release-plan/6.0.0: @@ -3719,6 +3741,7 @@ packages: integrity: sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==, } engines: {node: ">= 12"} + dev: false /@cspotcode/source-map-support/0.7.0: resolution: @@ -3728,6 +3751,7 @@ packages: engines: {node: ">=12"} dependencies: "@cspotcode/source-map-consumer": 0.8.0 + dev: false /@cspotcode/source-map-support/0.8.1: resolution: @@ -5291,6 +5315,7 @@ packages: { integrity: sha512-ydLaGVfQOQ6hI1xK2A5nVh8bl0OGoIfYMxPWHqqYe9bTkWCfqiVvZoh2I/QF2sNSkZzZyROBoTefIEI+PB6iIA==, } + dev: true /@types/node/17.0.24: resolution: @@ -5387,6 +5412,15 @@ packages: "@types/nodemailer": 6.4.4 dev: true + /@types/progress/2.0.5: + resolution: + { + integrity: sha512-ZYYVc/kSMkhH9W/4dNK/sLNra3cnkfT2nJyOAIDY+C2u6w72wa0s1aXAezVtbTsnN8HID1uhXCrLwDE2ZXpplg==, + } + dependencies: + "@types/node": 18.7.13 + dev: true + /@types/prompts/2.0.14: resolution: { @@ -5889,6 +5923,7 @@ packages: typescript: 4.6.3 transitivePeerDependencies: - supports-color + dev: false /@typescript-eslint/parser/5.9.1_ep4k34urm5hxazyxrevmf7goie: resolution: @@ -6900,7 +6935,6 @@ packages: integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==, } engines: {node: ">=8"} - dev: true /bl/4.1.0: resolution: @@ -6930,29 +6964,6 @@ packages: qs: 6.9.7 raw-body: 2.4.3 type-is: 1.6.18 - transitivePeerDependencies: - - supports-color - dev: true - - /body-parser/1.19.2_supports-color@8.1.1: - resolution: - { - integrity: sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==, - } - engines: {node: ">= 0.8"} - dependencies: - bytes: 3.1.2 - content-type: 1.0.4 - debug: 2.6.9_supports-color@8.1.1 - depd: 1.1.2 - http-errors: 1.8.1 - iconv-lite: 0.4.24 - on-finished: 2.3.0 - qs: 6.9.7 - raw-body: 2.4.3 - type-is: 1.6.18 - transitivePeerDependencies: - - supports-color dev: true /boxen/4.2.0: @@ -7024,8 +7035,6 @@ packages: snapdragon-node: 2.1.1 split-string: 3.1.0 to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color dev: false /braces/2.3.2_supports-color@8.1.1: @@ -7387,7 +7396,6 @@ packages: readdirp: 3.6.0 optionalDependencies: fsevents: 2.3.2 - dev: true /chromedriver/100.0.0: resolution: @@ -8026,11 +8034,6 @@ packages: { integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==, } - peerDependencies: - supports-color: "*" - peerDependenciesMeta: - supports-color: - optional: true dependencies: ms: 2.0.0 @@ -8047,6 +8050,7 @@ packages: dependencies: ms: 2.0.0 supports-color: 8.1.1 + dev: false /debug/3.2.7: resolution: @@ -8403,7 +8407,7 @@ packages: } engines: {node: ">=8"} - /detect-port/1.3.0_supports-color@8.1.1: + /detect-port/1.3.0: resolution: { integrity: sha512-E+B1gzkl2gqxt1IhUzwjrxBKRqx1UzC3WLONHinn8S3T6lwV/agVCyitiFOsGJ/eYuEUBvD71MZHy3Pv1G9doQ==, @@ -8412,9 +8416,7 @@ packages: hasBin: true dependencies: address: 1.2.0 - debug: 2.6.9_supports-color@8.1.1 - transitivePeerDependencies: - - supports-color + debug: 2.6.9 dev: false /diff-sequences/27.5.1: @@ -9333,6 +9335,17 @@ packages: dev: true optional: true + /esbuild-register/3.3.3_esbuild@0.14.34: + resolution: + { + integrity: sha512-eFHOkutgIMJY5gc8LUp/7c+LLlDqzNi9T6AwCZ2WKKl3HmT+5ef3ZRyPPxDOynInML0fgaC50yszPKfPnjC0NQ==, + } + peerDependencies: + esbuild: ">=0.12 <1" + dependencies: + esbuild: 0.14.34 + dev: false + /esbuild-sunos-64/0.14.34: resolution: { @@ -9782,6 +9795,7 @@ packages: tsconfig-paths: 3.14.1 transitivePeerDependencies: - supports-color + dev: false /eslint-import-resolver-typescript/2.7.1_hpmu7kn6tcn2vnxpfzvv33bxmy: resolution: @@ -9864,6 +9878,7 @@ packages: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color + dev: false /eslint-plugin-import/2.26.0_zhtk6rij7obli3ams3sxis7j7e: resolution: @@ -10389,8 +10404,6 @@ packages: regex-not: 1.0.2 snapdragon: 0.8.2 to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color dev: false /expand-brackets/2.1.4_supports-color@8.1.1: @@ -10460,49 +10473,6 @@ packages: type-is: 1.6.18 utils-merge: 1.0.1 vary: 1.1.2 - transitivePeerDependencies: - - supports-color - dev: true - - /express/4.17.3_supports-color@8.1.1: - resolution: - { - integrity: sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg==, - } - engines: {node: ">= 0.10.0"} - dependencies: - accepts: 1.3.8 - array-flatten: 1.1.1 - body-parser: 1.19.2_supports-color@8.1.1 - content-disposition: 0.5.4 - content-type: 1.0.4 - cookie: 0.4.2 - cookie-signature: 1.0.6 - debug: 2.6.9_supports-color@8.1.1 - depd: 1.1.2 - encodeurl: 1.0.2 - escape-html: 1.0.3 - etag: 1.8.1 - finalhandler: 1.1.2_supports-color@8.1.1 - 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.7 - range-parser: 1.2.1 - safe-buffer: 5.2.1 - send: 0.17.2_supports-color@8.1.1 - serve-static: 1.14.2_supports-color@8.1.1 - setprototypeof: 1.2.0 - statuses: 1.5.0 - type-is: 1.6.18 - utils-merge: 1.0.1 - vary: 1.1.2 - transitivePeerDependencies: - - supports-color dev: true /extend-shallow/2.0.1: @@ -10560,8 +10530,6 @@ packages: regex-not: 1.0.2 snapdragon: 0.8.2 to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color dev: false /extglob/2.0.4_supports-color@8.1.1: @@ -10619,8 +10587,6 @@ packages: is-glob: 4.0.3 merge2: 1.4.1 micromatch: 3.1.10 - transitivePeerDependencies: - - supports-color dev: false /fast-glob/3.2.11: @@ -10737,26 +10703,6 @@ packages: parseurl: 1.3.3 statuses: 1.5.0 unpipe: 1.0.0 - transitivePeerDependencies: - - supports-color - dev: true - - /finalhandler/1.1.2_supports-color@8.1.1: - resolution: - { - integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==, - } - engines: {node: ">= 0.8"} - dependencies: - debug: 2.6.9_supports-color@8.1.1 - 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 - transitivePeerDependencies: - - supports-color dev: true /find-cache-dir/2.1.0: @@ -11129,8 +11075,6 @@ packages: fs-extra: 7.0.1 globby: 9.2.0 read-yaml-file: 1.1.0 - transitivePeerDependencies: - - supports-color dev: false /glob-parent/3.1.0: @@ -11229,6 +11173,20 @@ packages: merge2: 1.4.1 slash: 3.0.0 + /globby/13.1.2: + resolution: + { + integrity: sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==, + } + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + dir-glob: 3.0.1 + fast-glob: 3.2.11 + ignore: 5.2.0 + merge2: 1.4.1 + slash: 4.0.0 + dev: false + /globby/9.2.0: resolution: { @@ -11244,8 +11202,6 @@ packages: ignore: 4.0.6 pify: 4.0.1 slash: 2.0.0 - transitivePeerDependencies: - - supports-color dev: false /got/11.8.1: @@ -11792,7 +11748,6 @@ packages: engines: {node: ">=8"} dependencies: binary-extensions: 2.2.0 - dev: true /is-boolean-object/1.1.2: resolution: @@ -13938,8 +13893,6 @@ packages: regex-not: 1.0.2 snapdragon: 0.8.2 to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color dev: false /micromatch/3.1.10_supports-color@8.1.1: @@ -14252,8 +14205,6 @@ packages: regex-not: 1.0.2 snapdragon: 0.8.2 to-regex: 3.0.2 - transitivePeerDependencies: - - supports-color dev: false /nanomatch/1.2.13_supports-color@8.1.1: @@ -16014,7 +15965,6 @@ packages: engines: {node: ">=8.10.0"} dependencies: picomatch: 2.3.1 - dev: true /recast/0.20.5: resolution: @@ -16361,6 +16311,44 @@ packages: "@babel/code-frame": 7.16.7 dev: true + /rollup-plugin-dts/4.2.2_rollup@2.77.2+typescript@4.7.4: + resolution: + { + integrity: sha512-A3g6Rogyko/PXeKoUlkjxkP++8UDVpgA7C+Tdl77Xj4fgEaIjPSnxRmR53EzvoYy97VMVwLAOcWJudaVAuxneQ==, + } + engines: {node: ">=v12.22.11"} + peerDependencies: + rollup: ^2.55 + typescript: ^4.1 + dependencies: + magic-string: 0.26.2 + rollup: 2.77.2 + typescript: 4.7.4 + optionalDependencies: + "@babel/code-frame": 7.16.7 + dev: true + + /rollup-plugin-esbuild/4.9.1_732fc8c30ba0be4bf7546580b6b6ccfb: + resolution: + { + integrity: sha512-qn/x7Wz9p3Xnva99qcb+nopH0d2VJwVnsxJTGEg+Sh2Z3tqQl33MhOwzekVo1YTKgv+yAmosjcBRJygMfGrtLw==, + } + engines: {node: ">=12"} + peerDependencies: + esbuild: ">=0.10.1" + rollup: ^1.20.0 || ^2.0.0 + dependencies: + "@rollup/pluginutils": 4.2.1 + debug: 4.3.4_supports-color@8.1.1 + es-module-lexer: 0.9.3 + esbuild: 0.14.51 + joycon: 3.1.1 + jsonc-parser: 3.0.0 + rollup: 2.77.2 + transitivePeerDependencies: + - supports-color + dev: true + /rollup-plugin-esbuild/4.9.1_ecpsl2p7zl5puhr4xxlpah6uzm: resolution: { @@ -16587,32 +16575,6 @@ packages: on-finished: 2.3.0 range-parser: 1.2.1 statuses: 1.5.0 - transitivePeerDependencies: - - supports-color - dev: true - - /send/0.17.2_supports-color@8.1.1: - resolution: - { - integrity: sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==, - } - engines: {node: ">= 0.8.0"} - dependencies: - debug: 2.6.9_supports-color@8.1.1 - 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 - transitivePeerDependencies: - - supports-color dev: true /serve-static/1.14.2: @@ -16626,23 +16588,6 @@ packages: escape-html: 1.0.3 parseurl: 1.3.3 send: 0.17.2 - transitivePeerDependencies: - - supports-color - dev: true - - /serve-static/1.14.2_supports-color@8.1.1: - resolution: - { - integrity: sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==, - } - engines: {node: ">= 0.8.0"} - dependencies: - encodeurl: 1.0.2 - escape-html: 1.0.3 - parseurl: 1.3.3 - send: 0.17.2_supports-color@8.1.1 - transitivePeerDependencies: - - supports-color dev: true /set-blocking/2.0.0: @@ -16786,6 +16731,14 @@ packages: } engines: {node: ">=8"} + /slash/4.0.0: + resolution: + { + integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==, + } + engines: {node: ">=12"} + dev: false + /slice-ansi/3.0.0: resolution: { @@ -16870,8 +16823,6 @@ packages: source-map: 0.5.7 source-map-resolve: 0.5.3 use: 3.1.1 - transitivePeerDependencies: - - supports-color dev: false /snapdragon/0.8.2_supports-color@8.1.1: @@ -16958,6 +16909,7 @@ packages: integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==, } engines: {node: ">=0.10.0"} + dev: false /source-map/0.6.1: resolution: @@ -18208,6 +18160,7 @@ packages: } engines: {node: ">=4.2.0"} hasBin: true + dev: true /typescript/4.7.4: resolution: @@ -18216,6 +18169,7 @@ packages: } engines: {node: ">=4.2.0"} hasBin: true + dev: true /uc.micro/1.0.6: resolution: @@ -18340,8 +18294,8 @@ packages: pretty-bytes: 6.0.0 rimraf: 3.0.2 rollup: 2.77.2 - rollup-plugin-dts: 4.2.2_oo3i3f3qmqiztdz5qgxrrjmd5e - rollup-plugin-esbuild: 4.9.1_omx4rqyluc7ex52umwalnnwm7m + rollup-plugin-dts: 4.2.2_rollup@2.77.2+typescript@4.7.4 + rollup-plugin-esbuild: 4.9.1_732fc8c30ba0be4bf7546580b6b6ccfb scule: 0.2.1 typescript: 4.7.4 untyped: 0.4.4_supports-color@8.1.1