From e5868afccd29e1a24ea5fd31d5f9e37c8bcac6bb Mon Sep 17 00:00:00 2001 From: ADNY <66500121+ErKeLost@users.noreply.github.com> Date: Sun, 5 May 2024 08:53:11 +0800 Subject: [PATCH] feat: add biome (#1281) * feat: biome * chore: test biome * chore: update code * chore: update code * chore: update changeset * chore: update biome rules * chore: enable biome lint * chore: remove eslint and prettier * chore: remove eslint and prettier * chore: test lint-staged * chore: test lint-staged * chore: test lint-staged * chore: test lint-staged * chore: test lint-staged * chore: test lint-staged * chore: test lint-staged * chore: update test lint-staged * chore: update test lint-staged * chore: update test lint-staged * chore: update test lint-staged * chore: update husky * chore: update husky * chore: update husky * chore: update husky * chore: update husky * chore: update husky --- .changeset/sweet-stingrays-crash.md | 2 + .eslintignore | 6 - .eslintrc.base.json | 20 - .github/workflows/lint.yaml | 6 +- .husky/pre-commit | 1 + .pnpmfile.cjs | 12 +- .prettierrc | 5 - biome.json | 138 +++ commitlint.config.js | 2 +- cspell.json | 4 +- e2e/.eslintrc.json | 8 - js-plugins/dts/farm.config.mjs | 22 +- js-plugins/dts/package.json | 7 +- js-plugins/dts/src/context.ts | 16 +- js-plugins/dts/src/index.ts | 2 +- js-plugins/dts/src/types.ts | 2 +- js-plugins/dts/src/utils.ts | 56 +- js-plugins/less/farm.config.mjs | 1 - js-plugins/less/package.json | 6 +- js-plugins/less/src/index.ts | 6 +- js-plugins/less/src/utils.ts | 2 +- js-plugins/postcss/package.json | 6 +- js-plugins/postcss/src/index.ts | 11 +- js-plugins/sass/farm.config.mjs | 1 - js-plugins/sass/package.json | 6 +- js-plugins/sass/src/index.ts | 14 +- js-plugins/sass/src/utils.ts | 2 +- js-plugins/solid/farm.config.mjs | 13 +- js-plugins/solid/package.json | 6 +- js-plugins/solid/src/index.ts | 8 +- js-plugins/svgr/package.json | 6 +- js-plugins/svgr/src/index.ts | 2 +- js-plugins/visualizer/package.json | 6 +- .../visualizer/src/client/farm.config.ts | 10 +- js-plugins/visualizer/src/client/src/App.vue | 2 +- .../visualizer/src/client/src/api/index.ts | 8 +- .../src/components/AnalyzeDepsRecord.vue | 8 +- .../src/client/src/components/CodeDiff.vue | 18 +- .../src/client/src/components/CodeViewer.vue | 18 +- .../src/client/src/components/FileTree.vue | 20 +- .../src/client/src/components/ModuleList.vue | 23 +- .../client/src/components/ModuleRecords.vue | 24 +- .../src/client/src/components/NavBar.vue | 18 +- .../client/src/components/ProcessRecord.vue | 8 +- .../client/src/components/ResolveRecord.vue | 10 +- .../client/src/components/ResourcePots.vue | 36 +- .../client/src/components/TransformRecord.vue | 14 +- js-plugins/visualizer/src/client/src/index.ts | 4 +- .../visualizer/src/client/src/pages/Home.vue | 30 +- .../src/client/src/pages/analysis/Bundle.vue | 38 +- .../src/client/src/pages/analysis/Module.vue | 30 +- .../src/client/src/pages/analysis/Plugin.vue | 56 +- .../src/client/src/stores/resourcePot.ts | 4 +- .../visualizer/src/client/tailwind.config.js | 16 +- js-plugins/visualizer/src/index.ts | 8 +- js-plugins/vue/farm.config.mjs | 2 +- js-plugins/vue/package.json | 7 +- js-plugins/vue/src/farm-vue-hmr.ts | 4 +- js-plugins/vue/src/farm-vue-plugin.ts | 15 +- js-plugins/vue/src/farm-vue-types.ts | 18 +- js-plugins/vue/src/generatorCode.ts | 38 +- js-plugins/vue/src/utils.ts | 8 +- package.json | 52 +- packages/cli/.eslintrc.json | 10 - packages/cli/package.json | 15 +- packages/cli/src/index.ts | 8 +- packages/cli/src/utils.ts | 6 +- packages/core/.eslintignore | 1 - packages/core/.eslintrc.json | 8 - packages/core/binding/binding.cjs | 195 ++-- packages/core/binding/index.js | 2 +- packages/core/binding/resolve-binding.cjs | 190 ++-- packages/core/farm.config.ts | 4 +- packages/core/npm/darwin-arm64/package.json | 12 +- packages/core/npm/darwin-x64/package.json | 12 +- .../core/npm/linux-arm64-gnu/package.json | 12 +- .../core/npm/linux-arm64-musl/package.json | 12 +- packages/core/npm/linux-x64-gnu/package.json | 16 +- packages/core/npm/linux-x64-musl/package.json | 16 +- .../core/npm/win32-arm64-msvc/package.json | 12 +- .../core/npm/win32-ia32-msvc/package.json | 12 +- packages/core/npm/win32-x64-msvc/package.json | 12 +- packages/core/src/compiler/index.ts | 4 +- packages/core/src/config/index.ts | 48 +- .../normalize-config/normalize-external.ts | 2 +- .../normalize-persistent-cache.ts | 17 +- packages/core/src/config/schema.ts | 2 +- packages/core/src/config/types.ts | 14 +- packages/core/src/index.ts | 20 +- packages/core/src/plugin/index.ts | 2 +- .../core/src/plugin/js/farm-to-vite-config.ts | 6 +- .../src/plugin/js/farm-to-vite-context.ts | 2 +- packages/core/src/plugin/js/index.ts | 18 +- packages/core/src/plugin/js/utils.ts | 6 +- .../core/src/plugin/js/vite-plugin-adapter.ts | 97 +- .../src/plugin/rust/rustPluginResolver.ts | 2 +- packages/core/src/plugin/type.ts | 2 +- packages/core/src/server/hmr-engine.ts | 16 +- packages/core/src/server/index.ts | 26 +- packages/core/src/server/middlewares/cors.ts | 2 +- .../server/middlewares/lazy-compilation.ts | 4 +- packages/core/src/server/middlewares/proxy.ts | 8 +- .../core/src/server/middlewares/resources.ts | 6 +- .../core/src/server/middlewares/static.ts | 8 +- packages/core/src/server/open.ts | 10 +- packages/core/src/server/ws.ts | 4 +- packages/core/src/utils/build.ts | 2 +- packages/core/src/utils/file.ts | 2 +- packages/core/src/utils/logger.ts | 4 +- packages/core/src/utils/merge.spec.ts | 2 +- packages/core/src/utils/merge.ts | 2 +- packages/core/src/utils/plugin-utils.ts | 2 +- packages/core/src/utils/publicDir.ts | 4 +- packages/core/src/utils/share.ts | 4 +- packages/core/src/watcher/config-watcher.ts | 2 +- packages/core/src/watcher/index.ts | 6 +- packages/core/tests/common.ts | 4 +- packages/core/tests/compile/json.spec.ts | 6 +- packages/core/tests/config.spec.ts | 2 +- packages/core/tests/config/index.spec.ts | 2 +- packages/core/tests/js-plugin-hooks/common.ts | 2 +- .../render-resource-pot.spec.ts | 5 +- packages/core/tests/js-plugins.spec.ts | 4 +- packages/core/tsconfig.test.json | 2 +- packages/create-farm-plugin/.eslintrc.json | 8 - packages/create-farm-plugin/farm.config.ts | 2 +- packages/create-farm-plugin/index.ts | 15 +- packages/create-farm-plugin/package.json | 6 +- packages/create-farm/.eslintrc.json | 8 - packages/create-farm/farm.config.ts | 2 +- packages/create-farm/index.ts | 10 +- packages/create-farm/package.json | 5 +- packages/create-farm/utils/packageManager.ts | 4 +- packages/plugin-tools/.eslintrc.json | 8 - packages/plugin-tools/package.json | 4 +- packages/plugin-tools/src/copy-artifacts.ts | 2 +- packages/plugin-tools/src/index.ts | 4 +- packages/plugin-tools/src/prepublish.ts | 2 +- packages/runtime-plugin-hmr/.eslintrc.json | 8 - packages/runtime-plugin-hmr/src/hmr-client.ts | 2 +- packages/runtime-plugin-hmr/src/index.ts | 6 +- .../runtime-plugin-import-meta/.eslintrc.json | 8 - .../runtime-plugin-import-meta/src/index.ts | 14 +- packages/runtime/.eslintrc.json | 7 - packages/utils/.eslintrc.json | 8 - packages/utils/package.json | 4 +- packages/utils/src/spawn.ts | 2 +- pnpm-lock.yaml | 848 +++--------------- scripts/build.mjs | 8 +- scripts/bump.mjs | 4 +- scripts/clear-cache.mjs | 2 +- scripts/github-matrix.mjs | 28 +- scripts/logger.mjs | 2 +- scripts/ready.mjs | 6 +- scripts/release.mjs | 6 +- scripts/test-examples.mjs | 7 +- vitest.config.ts | 10 +- 157 files changed, 1156 insertions(+), 1794 deletions(-) create mode 100644 .changeset/sweet-stingrays-crash.md delete mode 100644 .eslintignore delete mode 100644 .eslintrc.base.json create mode 100644 .husky/pre-commit delete mode 100644 .prettierrc create mode 100644 biome.json delete mode 100644 e2e/.eslintrc.json delete mode 100644 packages/cli/.eslintrc.json delete mode 100644 packages/core/.eslintignore delete mode 100644 packages/core/.eslintrc.json delete mode 100644 packages/create-farm-plugin/.eslintrc.json delete mode 100644 packages/create-farm/.eslintrc.json delete mode 100644 packages/plugin-tools/.eslintrc.json delete mode 100644 packages/runtime-plugin-hmr/.eslintrc.json delete mode 100644 packages/runtime-plugin-import-meta/.eslintrc.json delete mode 100644 packages/runtime/.eslintrc.json delete mode 100644 packages/utils/.eslintrc.json diff --git a/.changeset/sweet-stingrays-crash.md b/.changeset/sweet-stingrays-crash.md new file mode 100644 index 000000000..a845151cc --- /dev/null +++ b/.changeset/sweet-stingrays-crash.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index acfa5727f..000000000 --- a/.eslintignore +++ /dev/null @@ -1,6 +0,0 @@ -**/binding/** -**/templates/** -**/dist/** -**/node_modules/** -**/*.config.js -**/*.config.ts \ No newline at end of file diff --git a/.eslintrc.base.json b/.eslintrc.base.json deleted file mode 100644 index 37ce35fb2..000000000 --- a/.eslintrc.base.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "prettier" - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module" - }, - "plugins": ["@typescript-eslint"], - "env": { - "node": true, - "es6": true - }, - "rules": { - "semi": ["error", "always"] - } -} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 57b519048..3407c74ac 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -22,7 +22,7 @@ jobs: run: cargo fmt - name: Run cargo clippy run: cargo clippy - eslint: + lint: name: TS Code Lint runs-on: ubuntu-latest steps: @@ -32,5 +32,5 @@ jobs: node-version: 18 - name: Install Dependencies run: npm install -g pnpm@8.15.1 && pnpm i --frozen-lockfile - - name: Run eslint - run: npx eslint packages + - name: Run lint + run: npx biome check --no-errors-on-unmatched --files-ignore-unknown=true diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 000000000..d0a778429 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged \ No newline at end of file diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index b01c8a340..1c08a16b0 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -4,15 +4,17 @@ function readPackage(pkg, context) { // Replace bar@x.x.x with bar@2.0.0 pkg.peerDependencies = { vue: pkg.version - } - context.log(`${pkg.name}@${pkg.version} => vue@${pkg.version} in peerDependencies`) + }; + context.log( + `${pkg.name}@${pkg.version} => vue@${pkg.version} in peerDependencies` + ); } - - return pkg + + return pkg; } module.exports = { hooks: { readPackage } -} \ No newline at end of file +}; diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 8478ca9bd..000000000 --- a/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "singleQuote": true, - "trailingComma": "none" -} - diff --git a/biome.json b/biome.json new file mode 100644 index 000000000..d9be44cac --- /dev/null +++ b/biome.json @@ -0,0 +1,138 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.7.2/schema.json", + "vcs": { + "clientKind": "git", + "enabled": true, + "useIgnoreFile": true, + "defaultBranch": "main" + }, + "files": { + "ignore": [ + "crates/**", + "*.vue", + "examples/**", + "tsconfig.base.json", + "tsconfig.json", + "cspell.json", + "e2e/**", + "*.e2e.ts", + "*.d.ts", + "packages/runtime/**", + "packages/runtime-plugin-import-meta/**", + "packages/create-farm/templates/**", + "packages/create-farm-plugin/templates/**", + "rust-plugins/**", + "js-plugins/vue", + "js-plugins/less", + "js-plugins/sass" + ], + "ignoreUnknown": true + }, + "formatter": { + "enabled": true, + "formatWithErrors": false, + "indentStyle": "space", + "indentWidth": 2, + "lineEnding": "lf", + "lineWidth": 80, + "attributePosition": "auto" + }, + "organizeImports": { + "enabled": true, + "include": ["./**/*.js", "./**/*.ts", "./**/*.mjs"] + }, + "linter": { + "enabled": true, + "rules": { + "recommended": false, + "complexity": { + "noBannedTypes": "error", + "noExtraBooleanCast": "error", + "noMultipleSpacesInRegularExpressionLiterals": "error", + "noUselessCatch": "error", + "noUselessTypeConstraint": "error", + "noWith": "error" + }, + "correctness": { + "noConstAssign": "error", + "noConstantCondition": "error", + "noEmptyCharacterClassInRegex": "error", + "noEmptyPattern": "error", + "noGlobalObjectCalls": "error", + "noInnerDeclarations": "error", + "noInvalidConstructorSuper": "error", + "noNewSymbol": "error", + "noNonoctalDecimalEscape": "error", + "noPrecisionLoss": "error", + "noSelfAssign": "error", + "noSetterReturn": "error", + "noSwitchDeclarations": "error", + "noUndeclaredVariables": "warn", + "noUnreachable": "error", + "noUnreachableSuper": "error", + "noUnsafeFinally": "error", + "noUnsafeOptionalChaining": "error", + "noUnusedLabels": "error", + "noUnusedVariables": "warn", + "useIsNan": "error", + "useValidForDirection": "error", + "useYield": "error" + }, + "style": { + "noInferrableTypes": "error", + "noNamespace": "error", + "noNonNullAssertion": "warn", + "useAsConstAssertion": "error" + }, + "suspicious": { + "noAsyncPromiseExecutor": "error", + "noCatchAssign": "error", + "noClassAssign": "error", + "noCompareNegZero": "error", + "noControlCharactersInRegex": "off", + "noDebugger": "error", + "noDuplicateCase": "error", + "noDuplicateClassMembers": "error", + "noDuplicateObjectKeys": "error", + "noDuplicateParameters": "error", + "noEmptyBlockStatements": "off", + "noExplicitAny": "off", + "noExtraNonNullAssertion": "error", + "noFallthroughSwitchClause": "error", + "noFunctionAssign": "error", + "noGlobalAssign": "error", + "noImportAssign": "error", + "noMisleadingCharacterClass": "error", + "noMisleadingInstantiator": "error", + "noPrototypeBuiltins": "warn", + "noRedeclare": "error", + "noShadowRestrictedNames": "error", + "noUnsafeNegation": "error", + "useGetterReturn": "error", + "useNamespaceKeyword": "error", + "useValidTypeof": "error" + } + }, + "ignore": [ + "**/binding/**", + "**/templates/**", + "**/dist/**", + "**/node_modules/**", + "**/*.config.js", + "**/*.config.ts" + ] + }, + "javascript": { + "formatter": { + "jsxQuoteStyle": "single", + "quoteProperties": "asNeeded", + "trailingComma": "none", + "semicolons": "always", + "arrowParentheses": "always", + "bracketSpacing": true, + "bracketSameLine": false, + "quoteStyle": "single", + "attributePosition": "auto" + } + } +} diff --git a/commitlint.config.js b/commitlint.config.js index bf4c4d7c6..c34aa79d0 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,3 +1,3 @@ module.exports = { extends: ['@commitlint/config-conventional'] -} \ No newline at end of file +}; diff --git a/cspell.json b/cspell.json index 3a43f745e..79f6657c1 100644 --- a/cspell.json +++ b/cspell.json @@ -65,10 +65,11 @@ "icns", "idents", "IHDR", - "JIDA", "importee", "indicatif", + "Instantiator", "jfif", + "JIDA", "jridgewell", "jsnext", "kolorist", @@ -92,6 +93,7 @@ "nanospinner", "napi", "NAPI", + "Nonoctal", "normpath", "npmlog", "onwarn", diff --git a/e2e/.eslintrc.json b/e2e/.eslintrc.json deleted file mode 100644 index 62994a79f..000000000 --- a/e2e/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../.eslintrc.base.json", - "parserOptions": { - "project": ["./e2e/tsconfig.json"] - }, - "rules": {} -} diff --git a/js-plugins/dts/farm.config.mjs b/js-plugins/dts/farm.config.mjs index 939472c04..a1eb23cb1 100644 --- a/js-plugins/dts/farm.config.mjs +++ b/js-plugins/dts/farm.config.mjs @@ -1,4 +1,4 @@ -import { builtinModules } from "module"; +import { builtinModules } from 'module'; /** * @type {import('@farmfe/core').UserConfig} @@ -6,25 +6,25 @@ import { builtinModules } from "module"; export default { compilation: { input: { - index: "./src/index.ts", + index: './src/index.ts' }, output: { - path: "build", - entryFilename: "[entryName].cjs", - targetEnv: "node", - format: "cjs", + path: 'build', + entryFilename: '[entryName].cjs', + targetEnv: 'node', + format: 'cjs' }, partialBundling: { enforceResources: [ { - name: "index.js", - test: [".+"], - }, - ], + name: 'index.js', + test: ['.+'] + } + ] }, minify: false, sourcemap: false, persistentCache: false, - presetEnv: false, + presetEnv: false } }; diff --git a/js-plugins/dts/package.json b/js-plugins/dts/package.json index ba3f7362f..75a901c5b 100644 --- a/js-plugins/dts/package.json +++ b/js-plugins/dts/package.json @@ -35,8 +35,5 @@ "@farmfe/core": "workspace:*", "@types/fs-extra": "^11.0.1" }, - "files": [ - "dist", - "build" - ] -} \ No newline at end of file + "files": ["dist", "build"] +} diff --git a/js-plugins/dts/src/context.ts b/js-plugins/dts/src/context.ts index 4ade11e17..5e9b7c926 100644 --- a/js-plugins/dts/src/context.ts +++ b/js-plugins/dts/src/context.ts @@ -1,10 +1,10 @@ +import os from 'node:os'; +import { relative, resolve } from 'node:path'; import type { UserConfig } from '@farmfe/core'; -import { DefaultLogger } from './logger.js'; import chalk from 'chalk'; import glob from 'fast-glob'; -import os from 'node:os'; -import { relative, resolve } from 'node:path'; import { CompilerOptions, Project, SourceFile } from 'ts-morph'; +import { DefaultLogger } from './logger.js'; import { ensureAbsolute, ensureArray, @@ -40,7 +40,7 @@ export default class Context { noEmitOnError: false, skipDiagnostics: true, copyDtsFiles: false, - afterDiagnostic: () => {} + afterDiagnostic: () => ({}) }; const userOptions = mergeObjects(defaultOption, options); @@ -58,7 +58,7 @@ export default class Context { : this.config.output?.path; const aliasesExclude = userOptions?.aliasesExclude ?? []; const tsConfigPath = resolveAbsolutePath(userOptions.tsconfigPath, root); - libFolderPath = libFolderPath && ensureAbsolute(libFolderPath, root); + const folderPath = libFolderPath && ensureAbsolute(libFolderPath, root); const compilerOptions = userOptions.compilerOptions ?? {}; const mergeCompilerOptions = { @@ -75,7 +75,7 @@ export default class Context { } as CompilerOptions), tsConfigFilePath: tsConfigPath, skipAddingFilesFromTsConfig: true, - libFolderPath + libFolderPath: folderPath }; this.project = new Project(mergeCompilerOptions); const tsConfigOptions = getTsConfig( @@ -108,8 +108,8 @@ export default class Context { (isRegExp(find) ? find.toString() === alias.toString() : isRegExp(alias) - ? find.match(alias)?.[0] - : find === alias) + ? find.match(alias)?.[0] + : find === alias) ) ); } diff --git a/js-plugins/dts/src/index.ts b/js-plugins/dts/src/index.ts index e1e0c76c1..407359f78 100644 --- a/js-plugins/dts/src/index.ts +++ b/js-plugins/dts/src/index.ts @@ -1,8 +1,8 @@ import type { JsPlugin } from '@farmfe/core'; import Context from './context.js'; -import { tryToReadFileSync } from './utils.js'; import { pluginName } from './options.js'; +import { tryToReadFileSync } from './utils.js'; import type { DtsPluginOptions } from './types.js'; diff --git a/js-plugins/dts/src/types.ts b/js-plugins/dts/src/types.ts index db2988582..535849ec0 100644 --- a/js-plugins/dts/src/types.ts +++ b/js-plugins/dts/src/types.ts @@ -1,4 +1,4 @@ -import type { ts, Diagnostic } from 'ts-morph'; +import type { Diagnostic, ts } from 'ts-morph'; export interface DtsPluginOptions { /** diff --git a/js-plugins/dts/src/utils.ts b/js-plugins/dts/src/utils.ts index a84238c90..92ed6f7b4 100644 --- a/js-plugins/dts/src/utils.ts +++ b/js-plugins/dts/src/utils.ts @@ -7,8 +7,8 @@ import path, { resolve } from 'node:path'; -import typescript from 'typescript'; import extra from 'fs-extra'; +import typescript from 'typescript'; import crypto from 'crypto'; import fs from 'node:fs'; @@ -61,7 +61,7 @@ export function normalizePath(id: string): string { return posix.normalize(slash(id)); } -export function getHash(text: string, start: number = 0, end: number = 8) { +export function getHash(text: string, start = 0, end = 8) { return crypto .createHash('sha256') .update(text) @@ -105,34 +105,50 @@ export function isRegExp(reg: unknown): reg is RegExp { return Object.prototype.toString.call(reg) === '[object RegExp]'; } -export function getResolvedOptions(defaultVueOptions: any) { - const resolvedOptions: any = { +interface ResolvedOptions { + include: (string | RegExp)[]; + exclude: (string | RegExp)[]; + isProduction: boolean; + sourceMap: boolean; + script?: any; + template?: any; + style?: any; +} + +export function getResolvedOptions(defaultVueOptions: ResolvedOptions) { + const resolvedOptions: ResolvedOptions = { include: [], exclude: [], isProduction: false, // default: 'development' sourceMap: false }; for (const key in defaultVueOptions) { - const val = defaultVueOptions[key as keyof any]; + const val = defaultVueOptions[key as keyof ResolvedOptions]; switch (key) { case 'include': - resolvedOptions.include = ( - isArray(val) ? val : [val] - ) as any['include']; + resolvedOptions.include = (isArray(val) ? val : [val]) as string[]; + break; case 'exclude': - resolvedOptions.exclude = ( - isArray(val) ? val : [val] - ) as any['exclude']; + resolvedOptions.exclude = (isArray(val) ? val : [val]) as ( + | string + | RegExp + )[]; + break; case 'isProduction': if (val === true) resolvedOptions.isProduction = true; + break; case 'sourceMap': if (val === true) resolvedOptions.sourceMap = true; + break; case 'script': - resolvedOptions.script = (val ? val : {}) as any['script']; + resolvedOptions.script = val ? val : {}; + break; case 'template': - resolvedOptions.template = (val ? val : {}) as any['template']; + resolvedOptions.template = val ? val : {}; + break; case 'style': - resolvedOptions.style = (val ? val : {}) as any['style']; + resolvedOptions.style = val ? val : {}; + break; } } resolvedOptions.sourceMap = @@ -365,17 +381,13 @@ export function normalizeGlob(path: string) { } export async function writeFileWithCheck(filePath: string, content: string) { - // 获取文件夹路径 const folderPath = path.dirname(filePath); try { - // 检查文件夹是否存在 await extra.access(folderPath); - } catch (error) { - // 如果文件夹不存在,则创建它 + } catch { await extra.mkdir(folderPath, { recursive: true }); } - // 写文件 await extra.writeFile(filePath, content, 'utf-8'); } @@ -398,15 +410,15 @@ export function transformAliasImport( if (matchResult?.[1]) { const matchedAlias = aliases.find((alias) => - isAliasMatch(alias, matchResult![1]) + isAliasMatch(alias, matchResult?.[1]) ); if (matchedAlias) { if ( exclude.some((e) => isRegExp(e) - ? e.test(matchResult![1]) - : String(e) === matchResult![1] + ? e.test(matchResult?.[1]) + : String(e) === matchResult?.[1] ) ) { return str; diff --git a/js-plugins/less/farm.config.mjs b/js-plugins/less/farm.config.mjs index b80160c9d..f5e5cb18d 100644 --- a/js-plugins/less/farm.config.mjs +++ b/js-plugins/less/farm.config.mjs @@ -1,4 +1,3 @@ - import farmDtsPlugin from '@farmfe/js-plugin-dts'; import { createFarmJsPluginBuildConfig } from '../../configs/farm-js-plugin.base.config.mjs'; diff --git a/js-plugins/less/package.json b/js-plugins/less/package.json index f9620b5c7..531b755eb 100644 --- a/js-plugins/less/package.json +++ b/js-plugins/less/package.json @@ -33,9 +33,7 @@ "clean": "rimraf dist build tsconfig.build.tsbuildinfo", "type-check": "tsc -p ./tsconfig.build.json --noEmit" }, - "files": [ - "build" - ], + "files": ["build"], "keywords": [], "license": "MIT", "devDependencies": { @@ -49,4 +47,4 @@ "@farmfe/core": "workspace:^1.1.0", "less": "^3.5.0 || ^4.0.0" } -} \ No newline at end of file +} diff --git a/js-plugins/less/src/index.ts b/js-plugins/less/src/index.ts index d9374d4b0..9a041cc8c 100644 --- a/js-plugins/less/src/index.ts +++ b/js-plugins/less/src/index.ts @@ -1,18 +1,18 @@ +import { existsSync } from 'fs'; +import path from 'path'; import { Compiler, JsPlugin, UserConfig, getAdditionContext } from '@farmfe/core'; +import { createLessResolvePlugin } from './plugin-resolve.js'; import { getLessImplementation, pluginName, throwError, tryRead } from './utils.js'; -import path from 'path'; -import { existsSync } from 'fs'; -import { createLessResolvePlugin } from './plugin-resolve.js'; export type LessPluginOptions = { lessOptions?: Less.Options; diff --git a/js-plugins/less/src/utils.ts b/js-plugins/less/src/utils.ts index 362f51bbf..07bc81abd 100644 --- a/js-plugins/less/src/utils.ts +++ b/js-plugins/less/src/utils.ts @@ -1,6 +1,6 @@ -import { throwError as t } from '@farmfe/core'; import fs from 'fs'; import { createRequire } from 'module'; +import { throwError as t } from '@farmfe/core'; const __require = createRequire(import.meta.url); diff --git a/js-plugins/postcss/package.json b/js-plugins/postcss/package.json index f9934c5cc..aa14efe06 100644 --- a/js-plugins/postcss/package.json +++ b/js-plugins/postcss/package.json @@ -33,9 +33,7 @@ "prepublishOnly": "npm run build", "type-check": "tsc -p ./tsconfig.build.json --noEmit" }, - "files": [ - "build" - ], + "files": ["build"], "keywords": [], "license": "MIT", "devDependencies": { @@ -54,4 +52,4 @@ "@farmfe/core": "workspace:^1.1.0", "postcss": ">=8.0.0" } -} \ No newline at end of file +} diff --git a/js-plugins/postcss/src/index.ts b/js-plugins/postcss/src/index.ts index 428a47504..8d32bd1e1 100644 --- a/js-plugins/postcss/src/index.ts +++ b/js-plugins/postcss/src/index.ts @@ -1,8 +1,8 @@ -import { JsPlugin, ResolvedUserConfig, checkPublicFile } from '@farmfe/core'; -import postcssLoadConfig from 'postcss-load-config'; -import { ProcessOptions, Processor } from 'postcss'; import path from 'path'; +import { JsPlugin, ResolvedUserConfig, checkPublicFile } from '@farmfe/core'; import glob from 'fast-glob'; +import { ProcessOptions, Processor } from 'postcss'; +import postcssLoadConfig from 'postcss-load-config'; import { getPostcssImplementation, pluginName, tryRead } from './utils.js'; export type PostcssPluginOptions = { @@ -115,7 +115,10 @@ export default function farmPostcssPlugin( ]); const { css } = await urlRebasePostcssProcessor.process( content, - { from: id, to: param.resolvedPath } + { + from: id, + to: param.resolvedPath + } ); return css; } diff --git a/js-plugins/sass/farm.config.mjs b/js-plugins/sass/farm.config.mjs index 7d94bbdf6..97fed8bc6 100644 --- a/js-plugins/sass/farm.config.mjs +++ b/js-plugins/sass/farm.config.mjs @@ -1,4 +1,3 @@ - import farmDtsPlugin from '@farmfe/js-plugin-dts'; import { createFarmJsPluginBuildConfig } from '../../configs/farm-js-plugin.base.config.mjs'; diff --git a/js-plugins/sass/package.json b/js-plugins/sass/package.json index d5ee3fd77..85c63b84f 100644 --- a/js-plugins/sass/package.json +++ b/js-plugins/sass/package.json @@ -39,9 +39,7 @@ "prepublishOnly": "npm run build", "type-check": "tsc -p ./tsconfig.build.json --noEmit" }, - "files": [ - "build" - ], + "files": ["build"], "keywords": [], "license": "MIT", "devDependencies": { @@ -56,4 +54,4 @@ "sass": "^1.3.0", "sass-embedded": "*" } -} \ No newline at end of file +} diff --git a/js-plugins/sass/src/index.ts b/js-plugins/sass/src/index.ts index e3963c920..dd1c7b6bb 100644 --- a/js-plugins/sass/src/index.ts +++ b/js-plugins/sass/src/index.ts @@ -1,18 +1,18 @@ +import { existsSync } from 'fs'; +import path, { isAbsolute } from 'path'; +import { fileURLToPath, pathToFileURL } from 'url'; import type { + CompilationContext, JsPlugin, - UserConfig, PluginTransformHookParam, - CompilationContext + UserConfig } from '@farmfe/core'; import { getAdditionContext, rebaseUrls } from '@farmfe/core'; -import type { StringOptions, CompileResult, LegacyOptions } from 'sass'; +import { readFile } from 'fs/promises'; +import type { CompileResult, LegacyOptions, StringOptions } from 'sass'; import * as Sass from 'sass'; import { pluginName, throwError, tryRead } from './options.js'; -import { fileURLToPath, pathToFileURL } from 'url'; import { getSassImplementation } from './utils.js'; -import path, { isAbsolute } from 'path'; -import { existsSync } from 'fs'; -import { readFile } from 'fs/promises'; export type SassPluginOptions = { sassOptions?: Partial< diff --git a/js-plugins/sass/src/utils.ts b/js-plugins/sass/src/utils.ts index d49b60652..e83c3afde 100644 --- a/js-plugins/sass/src/utils.ts +++ b/js-plugins/sass/src/utils.ts @@ -1,5 +1,5 @@ -import { throwError } from './options.js'; import { createRequire } from 'module'; +import { throwError } from './options.js'; const __require = createRequire(import.meta.url); /** diff --git a/js-plugins/solid/farm.config.mjs b/js-plugins/solid/farm.config.mjs index d04a460ec..7e6ad0b8a 100644 --- a/js-plugins/solid/farm.config.mjs +++ b/js-plugins/solid/farm.config.mjs @@ -1,14 +1,13 @@ - import farmDtsPlugin from '@farmfe/js-plugin-dts'; import { createFarmJsPluginBuildConfig } from '../../configs/farm-js-plugin.base.config.mjs'; export default createFarmJsPluginBuildConfig([farmDtsPlugin()], { external: [ - "@babel/core", - "@babel/preset-typescript", - "@rollup/pluginutils", - "babel-preset-solid", - "merge-anything", - "solid-refresh" + '@babel/core', + '@babel/preset-typescript', + '@rollup/pluginutils', + 'babel-preset-solid', + 'merge-anything', + 'solid-refresh' ] }); diff --git a/js-plugins/solid/package.json b/js-plugins/solid/package.json index a841ecb02..4c8b39b1b 100644 --- a/js-plugins/solid/package.json +++ b/js-plugins/solid/package.json @@ -43,7 +43,5 @@ "peerDependencies": { "@farmfe/core": "workspace:^1.1.2" }, - "files": [ - "build" - ] -} \ No newline at end of file + "files": ["build"] +} diff --git a/js-plugins/solid/src/index.ts b/js-plugins/solid/src/index.ts index 2398aa3f0..e13007e1a 100644 --- a/js-plugins/solid/src/index.ts +++ b/js-plugins/solid/src/index.ts @@ -1,15 +1,15 @@ -import { createRequire } from 'node:module'; import { readFileSync } from 'node:fs'; +import { createRequire } from 'node:module'; import { extname } from 'node:path'; import { transformSync } from '@babel/core'; -import { mergeAndConcat } from 'merge-anything'; -import { createFilter } from '@rollup/pluginutils'; import ts from '@babel/preset-typescript'; +import { createFilter } from '@rollup/pluginutils'; import solid from 'babel-preset-solid'; +import { mergeAndConcat } from 'merge-anything'; import solidRefresh from 'solid-refresh/babel'; -import type { JsPlugin } from '@farmfe/core'; import type { TransformOptions } from '@babel/core'; +import type { JsPlugin } from '@farmfe/core'; import type { Options } from './types.js'; // TODO: HMR diff --git a/js-plugins/svgr/package.json b/js-plugins/svgr/package.json index 81684357f..aa91af735 100644 --- a/js-plugins/svgr/package.json +++ b/js-plugins/svgr/package.json @@ -33,9 +33,7 @@ "clean": "rimraf dist build tsconfig.build.tsbuildinfo", "type-check": "tsc -p ./tsconfig.build.json --noEmit" }, - "files": [ - "build" - ], + "files": ["build"], "keywords": [], "license": "MIT", "devDependencies": { @@ -50,4 +48,4 @@ "peerDependencies": { "@farmfe/core": "workspace:^1.1.0" } -} \ No newline at end of file +} diff --git a/js-plugins/svgr/src/index.ts b/js-plugins/svgr/src/index.ts index ec687c37a..f63b9a0a9 100644 --- a/js-plugins/svgr/src/index.ts +++ b/js-plugins/svgr/src/index.ts @@ -1,5 +1,5 @@ -import type { JsPlugin } from '@farmfe/core'; import fs from 'fs'; +import type { JsPlugin } from '@farmfe/core'; import type { ConfigPlugin, Config as SvgrOptions } from '@svgr/core'; export interface FarmSvgrPluginOptions { diff --git a/js-plugins/visualizer/package.json b/js-plugins/visualizer/package.json index 332140a08..a348a4c1a 100644 --- a/js-plugins/visualizer/package.json +++ b/js-plugins/visualizer/package.json @@ -53,7 +53,5 @@ "preview": "cd src/client && farm preview", "prepublishOnly": "npm run build" }, - "files": [ - "build" - ] -} \ No newline at end of file + "files": ["build"] +} diff --git a/js-plugins/visualizer/src/client/farm.config.ts b/js-plugins/visualizer/src/client/farm.config.ts index 36ec46b2a..33f8acc6d 100644 --- a/js-plugins/visualizer/src/client/farm.config.ts +++ b/js-plugins/visualizer/src/client/farm.config.ts @@ -1,17 +1,17 @@ -import farmPostcssPlugin from '@farmfe/js-plugin-postcss'; -import vitejsPluginVue from '@vitejs/plugin-vue' import { defineConfig } from '@farmfe/core'; +import farmPostcssPlugin from '@farmfe/js-plugin-postcss'; +import vitejsPluginVue from '@vitejs/plugin-vue'; import record from '../dev'; export default defineConfig({ plugins: [ - farmPostcssPlugin(), + farmPostcssPlugin(), ...(process.env.NODE_ENV === 'development' ? [record()] : []) ], vitePlugins: [vitejsPluginVue()], compilation: { output: { path: '../../build/client' - }, - }, + } + } }); diff --git a/js-plugins/visualizer/src/client/src/App.vue b/js-plugins/visualizer/src/client/src/App.vue index 05aa83c2b..9e20dda42 100644 --- a/js-plugins/visualizer/src/client/src/App.vue +++ b/js-plugins/visualizer/src/client/src/App.vue @@ -8,7 +8,7 @@ diff --git a/js-plugins/visualizer/src/client/src/api/index.ts b/js-plugins/visualizer/src/client/src/api/index.ts index b78caca1b..d2e4a257a 100644 --- a/js-plugins/visualizer/src/client/src/api/index.ts +++ b/js-plugins/visualizer/src/client/src/api/index.ts @@ -1,14 +1,14 @@ +import { PluginStats, Resource } from '@farmfe/core'; import { AnalyzeDepsRecord, Module, ModuleRecord, + ResolveRecord, ResourcePotRecord, - TransformRecord, - ResolveRecord + TransformRecord } from '@farmfe/core/binding'; -import { http } from '../http'; import { FarmEnvInfo } from '../../../node/utils/envinfo'; -import { Resource, PluginStats } from '@farmfe/core'; +import { http } from '../http'; export function getModules(): Promise { return http.get('/__record/modules'); diff --git a/js-plugins/visualizer/src/client/src/components/AnalyzeDepsRecord.vue b/js-plugins/visualizer/src/client/src/components/AnalyzeDepsRecord.vue index 073230081..0592826ed 100644 --- a/js-plugins/visualizer/src/client/src/components/AnalyzeDepsRecord.vue +++ b/js-plugins/visualizer/src/client/src/components/AnalyzeDepsRecord.vue @@ -48,11 +48,11 @@ diff --git a/js-plugins/visualizer/src/client/src/components/CodeViewer.vue b/js-plugins/visualizer/src/client/src/components/CodeViewer.vue index 381392dfd..1ce2f9cc7 100644 --- a/js-plugins/visualizer/src/client/src/components/CodeViewer.vue +++ b/js-plugins/visualizer/src/client/src/components/CodeViewer.vue @@ -11,19 +11,19 @@ diff --git a/js-plugins/visualizer/src/client/src/components/FileTree.vue b/js-plugins/visualizer/src/client/src/components/FileTree.vue index 0f7d74a96..f4001591b 100644 --- a/js-plugins/visualizer/src/client/src/components/FileTree.vue +++ b/js-plugins/visualizer/src/client/src/components/FileTree.vue @@ -26,15 +26,15 @@ diff --git a/js-plugins/visualizer/src/client/src/components/ModuleList.vue b/js-plugins/visualizer/src/client/src/components/ModuleList.vue index 5802d06e2..d066145cd 100644 --- a/js-plugins/visualizer/src/client/src/components/ModuleList.vue +++ b/js-plugins/visualizer/src/client/src/components/ModuleList.vue @@ -24,39 +24,38 @@ diff --git a/js-plugins/visualizer/src/client/src/components/ModuleRecords.vue b/js-plugins/visualizer/src/client/src/components/ModuleRecords.vue index b0ac43969..58e1197f7 100644 --- a/js-plugins/visualizer/src/client/src/components/ModuleRecords.vue +++ b/js-plugins/visualizer/src/client/src/components/ModuleRecords.vue @@ -25,16 +25,16 @@ diff --git a/js-plugins/visualizer/src/client/src/components/NavBar.vue b/js-plugins/visualizer/src/client/src/components/NavBar.vue index a3c1f0979..ab8a97cad 100644 --- a/js-plugins/visualizer/src/client/src/components/NavBar.vue +++ b/js-plugins/visualizer/src/client/src/components/NavBar.vue @@ -86,22 +86,22 @@ diff --git a/js-plugins/visualizer/src/client/src/components/ProcessRecord.vue b/js-plugins/visualizer/src/client/src/components/ProcessRecord.vue index fda9ee0a1..34efe780e 100644 --- a/js-plugins/visualizer/src/client/src/components/ProcessRecord.vue +++ b/js-plugins/visualizer/src/client/src/components/ProcessRecord.vue @@ -30,11 +30,11 @@ diff --git a/js-plugins/visualizer/src/client/src/components/TransformRecord.vue b/js-plugins/visualizer/src/client/src/components/TransformRecord.vue index 01810b9f2..7a8c6efce 100644 --- a/js-plugins/visualizer/src/client/src/components/TransformRecord.vue +++ b/js-plugins/visualizer/src/client/src/components/TransformRecord.vue @@ -37,13 +37,13 @@ \ No newline at end of file diff --git a/js-plugins/visualizer/src/client/src/pages/analysis/Bundle.vue b/js-plugins/visualizer/src/client/src/pages/analysis/Bundle.vue index aedec11d5..230367770 100644 --- a/js-plugins/visualizer/src/client/src/pages/analysis/Bundle.vue +++ b/js-plugins/visualizer/src/client/src/pages/analysis/Bundle.vue @@ -36,27 +36,27 @@ diff --git a/js-plugins/visualizer/src/client/src/pages/analysis/Module.vue b/js-plugins/visualizer/src/client/src/pages/analysis/Module.vue index 82e580ace..7abd54784 100644 --- a/js-plugins/visualizer/src/client/src/pages/analysis/Module.vue +++ b/js-plugins/visualizer/src/client/src/pages/analysis/Module.vue @@ -12,19 +12,27 @@ diff --git a/js-plugins/visualizer/src/client/src/pages/analysis/Plugin.vue b/js-plugins/visualizer/src/client/src/pages/analysis/Plugin.vue index f05f2c905..5f4ff7f3b 100644 --- a/js-plugins/visualizer/src/client/src/pages/analysis/Plugin.vue +++ b/js-plugins/visualizer/src/client/src/pages/analysis/Plugin.vue @@ -5,10 +5,10 @@ diff --git a/js-plugins/visualizer/src/client/src/stores/resourcePot.ts b/js-plugins/visualizer/src/client/src/stores/resourcePot.ts index a13531123..e7bb6417c 100644 --- a/js-plugins/visualizer/src/client/src/stores/resourcePot.ts +++ b/js-plugins/visualizer/src/client/src/stores/resourcePot.ts @@ -1,7 +1,7 @@ +import { RenderedModule, Resource } from '@farmfe/core'; import { defineStore } from 'pinia'; +import { computed, ref } from 'vue'; import { getResourcesMap } from '../api'; -import { ref, computed } from 'vue'; -import { RenderedModule, Resource } from '@farmfe/core'; export const useResourcePotStore = defineStore('resourcePot', () => { const resourcePots = ref([]); diff --git a/js-plugins/visualizer/src/client/tailwind.config.js b/js-plugins/visualizer/src/client/tailwind.config.js index b9a09d490..e691e7c2c 100644 --- a/js-plugins/visualizer/src/client/tailwind.config.js +++ b/js-plugins/visualizer/src/client/tailwind.config.js @@ -1,14 +1,8 @@ - /** @type {import('tailwindcss').Config} */ -export default { - content: [ - "./index.html", - "./src/**/*.{vue,js,ts,jsx,tsx}", - ], +export default { + content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'], theme: { - extend: {}, - + extend: {} }, - plugins: [], -} - + plugins: [] +}; diff --git a/js-plugins/visualizer/src/index.ts b/js-plugins/visualizer/src/index.ts index 5f4b52692..af61c4428 100644 --- a/js-plugins/visualizer/src/index.ts +++ b/js-plugins/visualizer/src/index.ts @@ -1,9 +1,9 @@ -import { JsPlugin, UserConfig } from '@farmfe/core'; -import { resolve, dirname } from 'node:path'; +import { dirname, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; -import { RecordViewerOptions } from './types'; -import { createRecordViewerServer } from './node/server'; +import { JsPlugin, UserConfig } from '@farmfe/core'; import { createDateSourceMiddleware } from './node/dataSource'; +import { createRecordViewerServer } from './node/server'; +import { RecordViewerOptions } from './types'; const PLUGIN_DIR = dirname(fileURLToPath(import.meta.url)); diff --git a/js-plugins/vue/farm.config.mjs b/js-plugins/vue/farm.config.mjs index f6dabb9b3..35c3187e9 100644 --- a/js-plugins/vue/farm.config.mjs +++ b/js-plugins/vue/farm.config.mjs @@ -29,7 +29,7 @@ export default { }, minify: false, sourcemap: false, - presetEnv: false, + presetEnv: false }, server: { hmr: false diff --git a/js-plugins/vue/package.json b/js-plugins/vue/package.json index 2f645ed1e..ffd760b9a 100644 --- a/js-plugins/vue/package.json +++ b/js-plugins/vue/package.json @@ -13,10 +13,7 @@ "prepublishOnly": "npm run build", "test": "echo \"Error: no test specified\" && exit 1" }, - "files": [ - "dist", - "build" - ], + "files": ["dist", "build"], "exports": { ".": { "require": "./build/index.cjs", @@ -68,4 +65,4 @@ "optional": true } } -} \ No newline at end of file +} diff --git a/js-plugins/vue/src/farm-vue-hmr.ts b/js-plugins/vue/src/farm-vue-hmr.ts index 39a35ec1e..78b3289d6 100644 --- a/js-plugins/vue/src/farm-vue-hmr.ts +++ b/js-plugins/vue/src/farm-vue-hmr.ts @@ -1,8 +1,8 @@ import { SFCDescriptor, SFCScriptBlock, - SFCTemplateBlock, - SFCStyleBlock + SFCStyleBlock, + SFCTemplateBlock } from '@vue/compiler-sfc'; import { CacheDescriptor, diff --git a/js-plugins/vue/src/farm-vue-plugin.ts b/js-plugins/vue/src/farm-vue-plugin.ts index 45f71dbaa..8b8c6e4b9 100644 --- a/js-plugins/vue/src/farm-vue-plugin.ts +++ b/js-plugins/vue/src/farm-vue-plugin.ts @@ -1,7 +1,8 @@ import fs from 'fs'; import path from 'path'; -import { parse } from '@vue/compiler-sfc'; import { JsPlugin, UserConfig } from '@farmfe/core'; +import { parse } from '@vue/compiler-sfc'; +import { compileStyle } from '@vue/compiler-sfc'; import { handleHmr } from './farm-vue-hmr.js'; import { CacheDescriptor, @@ -25,18 +26,20 @@ import { isStyl, loadPreProcessor } from './utils.js'; -import { compileStyle } from '@vue/compiler-sfc'; const stylesCodeCache: StylesCodeCache = {}; const applyStyleLangs = ['less', 'sass', 'scss', 'stylus']; const cacheDescriptor: CacheDescriptor = {}; const parseQuery = (query: [string, string][]) => - query.reduce((pre, [key, value]) => { - pre[key] = value; + query.reduce( + (pre, [key, value]) => { + pre[key] = value; - return pre; - }, {} as Record); + return pre; + }, + {} as Record + ); export default function farmVuePlugin( farmVuePluginOptions: FarmVuePluginOptions = {} diff --git a/js-plugins/vue/src/farm-vue-types.ts b/js-plugins/vue/src/farm-vue-types.ts index 1bff96f95..bc3d1724e 100644 --- a/js-plugins/vue/src/farm-vue-types.ts +++ b/js-plugins/vue/src/farm-vue-types.ts @@ -1,12 +1,12 @@ -import Less from 'less'; -import Sass from 'sass'; -import Stylus from 'stylus'; import { SFCDescriptor, SFCScriptCompileOptions, - SFCTemplateCompileOptions, - SFCStyleCompileOptions + SFCStyleCompileOptions, + SFCTemplateCompileOptions } from '@vue/compiler-sfc'; +import Less from 'less'; +import Sass from 'sass'; +import Stylus from 'stylus'; export interface outputData { id: string; @@ -40,10 +40,10 @@ export enum PreProcessorsType { export type PreProcessorsOptions = T extends typeof Less ? Less.Options : T extends typeof Sass - ? Sass.Options<'async'> - : T extends typeof Stylus - ? Stylus.RenderOptions - : never; + ? Sass.Options<'async'> + : T extends typeof Stylus + ? Stylus.RenderOptions + : never; export interface FarmVuePluginOptions { include?: string | RegExp | (string | RegExp)[]; diff --git a/js-plugins/vue/src/generatorCode.ts b/js-plugins/vue/src/generatorCode.ts index 746e8b5ef..ba52b2ec9 100644 --- a/js-plugins/vue/src/generatorCode.ts +++ b/js-plugins/vue/src/generatorCode.ts @@ -1,33 +1,33 @@ import path from 'path'; import { - compileScript, - compileTemplate, + EncodedSourceMap, + addMapping, + fromMap, + toEncodedMap +} from '@jridgewell/gen-mapping'; +import { TraceMap, eachMapping } from '@jridgewell/trace-mapping'; +import { + BindingMetadata, + CompilerOptions, SFCDescriptor, SFCScriptBlock, - SFCTemplateBlock, - BindingMetadata, - rewriteDefault, + SFCScriptCompileOptions, SFCStyleBlock, + SFCTemplateBlock, SFCTemplateCompileResults, - SFCScriptCompileOptions, - CompilerOptions + compileScript, + compileTemplate, + rewriteDefault } from '@vue/compiler-sfc'; -import { error, warn, getHash, parsePath } from './utils.js'; +import { RawSourceMap } from 'source-map'; +import { cacheScript, isEqualBlock } from './farm-vue-hmr.js'; import { QueryObj, + ResolvedOptions, StylesCodeCache, - Union, - ResolvedOptions + Union } from './farm-vue-types.js'; -import { cacheScript, isEqualBlock } from './farm-vue-hmr.js'; -import { - fromMap, - toEncodedMap, - addMapping, - EncodedSourceMap -} from '@jridgewell/gen-mapping'; -import { eachMapping, TraceMap } from '@jridgewell/trace-mapping'; -import { RawSourceMap } from 'source-map'; +import { error, getHash, parsePath, warn } from './utils.js'; type SourceMap = Omit & { version: 3 }; diff --git a/js-plugins/vue/src/utils.ts b/js-plugins/vue/src/utils.ts index e02592a7b..9328f9267 100644 --- a/js-plugins/vue/src/utils.ts +++ b/js-plugins/vue/src/utils.ts @@ -1,12 +1,12 @@ -import path from 'path'; import crypto from 'crypto'; import { createRequire } from 'module'; +import path from 'path'; import { + FarmVuePluginOptions, PreProcessors, PreProcessorsType, - outputData, - FarmVuePluginOptions, - ResolvedOptions + ResolvedOptions, + outputData } from './farm-vue-types.js'; export function warn({ id, message }: outputData) { diff --git a/package.json b/package.json index 668da6401..c9fa12e1a 100644 --- a/package.json +++ b/package.json @@ -6,59 +6,49 @@ "node": ">=16", "pnpm": ">=8" }, + "scripts": { + "preinstall": "npx only-allow pnpm", + "bootstrap": "pnpm install && node scripts/clean.mjs && node scripts/bootstrap.mjs && pnpm start", + "test": "cross-env NODE_OPTIONS=--trace-exit vitest run", + "start:rs": "cargo watch -w crates -w rust-plugins -s 'scripts/watch.sh'", + "start": "pnpm --filter @farmfe/cli start", + "release": "node scripts/release.mjs", + "check": "biome check . --diagnostic-level=warn --apply", + "clean": "node scripts/clean.mjs && rimraf node_modules **/*/node_modules", + "bump": "node scripts/bump.mjs", + "test:rs:update": "cross-env FARM_UPDATE_SNAPSHOTS=1 cargo test -p farmfe_compiler", + "ready": "node scripts/ready.mjs", + "test-e2e": "vitest run -c vitest.config.e2e.ts", + "prepare": "husky" + }, "devDependencies": { + "@biomejs/biome": "1.7.2", "@changesets/cli": "^2.26.0", "@commitlint/cli": "^17.0.3", "@commitlint/config-conventional": "^17.0.3", "@types/node": "^18.0.1", - "@typescript-eslint/eslint-plugin": "^5.30.5", - "@typescript-eslint/parser": "^5.30.5", "@vitest/coverage-v8": "^0.33.0", "cross-env": "^7.0.3", "cspell": "^6.2.2", - "eslint": "^8.19.0", - "eslint-config-prettier": "^8.5.0", "execa": "^7.1.1", + "husky": "^9.0.11", "lint-staged": "^13.0.3", "nanospinner": "^1.1.0", - "prettier": "^2.7.1", - "prettier-eslint": "^15.0.1", - "prettier-eslint-cli": "^7.1.0", + "playwright-chromium": "^1.42.1", "rimraf": "^3.0.2", "rollup": "^3.29.4", - "simple-git-hooks": "^2.10.0", "typescript": "^4.9.4", "vite": "^5.2.6", - "vitest": "^1.4.0", - "playwright-chromium": "^1.42.1" - }, - "scripts": { - "postinstall": "simple-git-hooks", - "preinstall": "npx only-allow pnpm", - "bootstrap": "pnpm install && node scripts/clean.mjs && node scripts/bootstrap.mjs && pnpm start", - "test": "cross-env NODE_OPTIONS=--trace-exit vitest run", - "start:rs": "cargo watch -w crates -w rust-plugins -s 'scripts/watch.sh'", - "start": "pnpm --filter @farmfe/cli start", - "release": "node scripts/release.mjs", - "clean": "node scripts/clean.mjs && rimraf node_modules **/*/node_modules", - "bump": "node scripts/bump.mjs", - "test:rs:update": "cross-env FARM_UPDATE_SNAPSHOTS=1 cargo test -p farmfe_compiler", - "ready": "node scripts/ready.mjs", - "test-e2e": "vitest run -c vitest.config.e2e.ts" + "vitest": "^1.4.0" }, "lint-staged": { "packages/**/*.ts": [ - "prettier-eslint --write" + "npx biome check --no-errors-on-unmatched --files-ignore-unknown=true --apply" ], "js-plugins/**/*.ts": [ - "prettier-eslint --write" + "npx biome check --no-errors-on-unmatched --files-ignore-unknown=true --apply" ] }, - "simple-git-hooks": { - "pre-commit": "pnpm lint-staged", - "pre-push": "", - "preserveUnused": true - }, "pnpm": { "overrides": { "@farmfe/core": "workspace:*" diff --git a/packages/cli/.eslintrc.json b/packages/cli/.eslintrc.json deleted file mode 100644 index 1528a3f6f..000000000 --- a/packages/cli/.eslintrc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./packages/cli/tsconfig.json"] - }, - "rules": { - "semi": ["error", "always"] - } -} diff --git a/packages/cli/package.json b/packages/cli/package.json index 5194eb6cc..3a5618e99 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -7,14 +7,7 @@ "name": "bright wu", "email": "1521488775@qq.com" }, - "keywords": [ - "farm", - "cli", - "farmfe", - "bundler", - "compiler", - "build tool" - ], + "keywords": ["farm", "cli", "farmfe", "bundler", "compiler", "build tool"], "license": "MIT", "repository": { "type": "git", @@ -26,11 +19,7 @@ "exports": { "./package.json": "./package.json" }, - "files": [ - "dist", - "bin", - "templates" - ], + "files": ["dist", "bin", "templates"], "scripts": { "start": "rimraf dist && tsc -b -w", "build": "tsc -b", diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index a20cdaa1f..e8409c5c3 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1,14 +1,14 @@ import { readFileSync } from 'node:fs'; import { cac } from 'cac'; +import { getOptionFromBuildOption } from './config.js'; import { - resolveCore, - resolveCommandOptions, handleAsyncOperationErrors, preventExperimentalWarning, - resolveCliConfig + resolveCliConfig, + resolveCommandOptions, + resolveCore } from './utils.js'; -import { getOptionFromBuildOption } from './config.js'; import type { FarmCLIBuildOptions, diff --git a/packages/cli/src/utils.ts b/packages/cli/src/utils.ts index e4d186842..18717f8cb 100644 --- a/packages/cli/src/utils.ts +++ b/packages/cli/src/utils.ts @@ -2,10 +2,10 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; import path from 'node:path'; import readline from 'node:readline'; import { fileURLToPath } from 'node:url'; -import walkdir from 'walkdir'; -import spawn from 'cross-spawn'; -import type { build, preview, start, watch, clean } from '@farmfe/core'; +import type { build, clean, preview, start, watch } from '@farmfe/core'; import { Logger } from '@farmfe/core'; +import spawn from 'cross-spawn'; +import walkdir from 'walkdir'; import type { GlobalFarmCLIOptions, ICleanOptions } from './types.js'; diff --git a/packages/core/.eslintignore b/packages/core/.eslintignore deleted file mode 100644 index 9334c123d..000000000 --- a/packages/core/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -**/binding/** \ No newline at end of file diff --git a/packages/core/.eslintrc.json b/packages/core/.eslintrc.json deleted file mode 100644 index e8cecf1b0..000000000 --- a/packages/core/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./packages/core/tsconfig.json"] - }, - "rules": {} -} diff --git a/packages/core/binding/binding.cjs b/packages/core/binding/binding.cjs index 681f9acdb..a24eba719 100644 --- a/packages/core/binding/binding.cjs +++ b/packages/core/binding/binding.cjs @@ -4,27 +4,30 @@ /* auto-generated by NAPI-RS */ -const { existsSync, readFileSync } = require('fs') -const { join } = require('path') +const { existsSync, readFileSync } = require('fs'); +const { join } = require('path'); -const { platform, arch } = process +const { platform, arch } = process; -let nativeBinding = null -let localFileExisted = false -let loadError = null +let nativeBinding = null; +let localFileExisted = false; +let loadError = null; function isMusl() { // For Node 10 if (!process.report || typeof process.report.getReport !== 'function') { try { - const lddPath = require('child_process').execSync('which ldd').toString().trim() - return readFileSync(lddPath, 'utf8').includes('musl') + const lddPath = require('child_process') + .execSync('which ldd') + .toString() + .trim(); + return readFileSync(lddPath, 'utf8').includes('musl'); } catch (e) { - return true + return true; } } else { - const { glibcVersionRuntime } = process.report.getReport().header - return !glibcVersionRuntime + const { glibcVersionRuntime } = process.report.getReport().header; + return !glibcVersionRuntime; } } @@ -32,227 +35,233 @@ switch (platform) { case 'android': switch (arch) { case 'arm64': - localFileExisted = existsSync(join(__dirname, 'farm.android-arm64.node')) + localFileExisted = existsSync( + join(__dirname, 'farm.android-arm64.node') + ); try { if (localFileExisted) { - nativeBinding = require('./farm.android-arm64.node') + nativeBinding = require('./farm.android-arm64.node'); } else { - nativeBinding = require('@farmfe/core-android-arm64') + nativeBinding = require('@farmfe/core-android-arm64'); } } catch (e) { - loadError = e + loadError = e; } - break + break; case 'arm': - localFileExisted = existsSync(join(__dirname, 'farm.android-arm-eabi.node')) + localFileExisted = existsSync( + join(__dirname, 'farm.android-arm-eabi.node') + ); try { if (localFileExisted) { - nativeBinding = require('./farm.android-arm-eabi.node') + nativeBinding = require('./farm.android-arm-eabi.node'); } else { - nativeBinding = require('@farmfe/core-android-arm-eabi') + nativeBinding = require('@farmfe/core-android-arm-eabi'); } } catch (e) { - loadError = e + loadError = e; } - break + break; default: - throw new Error(`Unsupported architecture on Android ${arch}`) + throw new Error(`Unsupported architecture on Android ${arch}`); } - break + break; case 'win32': switch (arch) { case 'x64': localFileExisted = existsSync( join(__dirname, 'farm.win32-x64-msvc.node') - ) + ); try { if (localFileExisted) { - nativeBinding = require('./farm.win32-x64-msvc.node') + nativeBinding = require('./farm.win32-x64-msvc.node'); } else { - nativeBinding = require('@farmfe/core-win32-x64-msvc') + nativeBinding = require('@farmfe/core-win32-x64-msvc'); } } catch (e) { - loadError = e + loadError = e; } - break + break; case 'ia32': localFileExisted = existsSync( join(__dirname, 'farm.win32-ia32-msvc.node') - ) + ); try { if (localFileExisted) { - nativeBinding = require('./farm.win32-ia32-msvc.node') + nativeBinding = require('./farm.win32-ia32-msvc.node'); } else { - nativeBinding = require('@farmfe/core-win32-ia32-msvc') + nativeBinding = require('@farmfe/core-win32-ia32-msvc'); } } catch (e) { - loadError = e + loadError = e; } - break + break; case 'arm64': localFileExisted = existsSync( join(__dirname, 'farm.win32-arm64-msvc.node') - ) + ); try { if (localFileExisted) { - nativeBinding = require('./farm.win32-arm64-msvc.node') + nativeBinding = require('./farm.win32-arm64-msvc.node'); } else { - nativeBinding = require('@farmfe/core-win32-arm64-msvc') + nativeBinding = require('@farmfe/core-win32-arm64-msvc'); } } catch (e) { - loadError = e + loadError = e; } - break + break; default: - throw new Error(`Unsupported architecture on Windows: ${arch}`) + throw new Error(`Unsupported architecture on Windows: ${arch}`); } - break + break; case 'darwin': - localFileExisted = existsSync(join(__dirname, 'farm.darwin-universal.node')) + localFileExisted = existsSync( + join(__dirname, 'farm.darwin-universal.node') + ); try { if (localFileExisted) { - nativeBinding = require('./farm.darwin-universal.node') + nativeBinding = require('./farm.darwin-universal.node'); } else { - nativeBinding = require('@farmfe/core-darwin-universal') + nativeBinding = require('@farmfe/core-darwin-universal'); } - break + break; } catch {} switch (arch) { case 'x64': - localFileExisted = existsSync(join(__dirname, 'farm.darwin-x64.node')) + localFileExisted = existsSync(join(__dirname, 'farm.darwin-x64.node')); try { if (localFileExisted) { - nativeBinding = require('./farm.darwin-x64.node') + nativeBinding = require('./farm.darwin-x64.node'); } else { - nativeBinding = require('@farmfe/core-darwin-x64') + nativeBinding = require('@farmfe/core-darwin-x64'); } } catch (e) { - loadError = e + loadError = e; } - break + break; case 'arm64': localFileExisted = existsSync( join(__dirname, 'farm.darwin-arm64.node') - ) + ); try { if (localFileExisted) { - nativeBinding = require('./farm.darwin-arm64.node') + nativeBinding = require('./farm.darwin-arm64.node'); } else { - nativeBinding = require('@farmfe/core-darwin-arm64') + nativeBinding = require('@farmfe/core-darwin-arm64'); } } catch (e) { - loadError = e + loadError = e; } - break + break; default: - throw new Error(`Unsupported architecture on macOS: ${arch}`) + throw new Error(`Unsupported architecture on macOS: ${arch}`); } - break + break; case 'freebsd': if (arch !== 'x64') { - throw new Error(`Unsupported architecture on FreeBSD: ${arch}`) + throw new Error(`Unsupported architecture on FreeBSD: ${arch}`); } - localFileExisted = existsSync(join(__dirname, 'farm.freebsd-x64.node')) + localFileExisted = existsSync(join(__dirname, 'farm.freebsd-x64.node')); try { if (localFileExisted) { - nativeBinding = require('./farm.freebsd-x64.node') + nativeBinding = require('./farm.freebsd-x64.node'); } else { - nativeBinding = require('@farmfe/core-freebsd-x64') + nativeBinding = require('@farmfe/core-freebsd-x64'); } } catch (e) { - loadError = e + loadError = e; } - break + break; case 'linux': switch (arch) { case 'x64': if (isMusl()) { localFileExisted = existsSync( join(__dirname, 'farm.linux-x64-musl.node') - ) + ); try { if (localFileExisted) { - nativeBinding = require('./farm.linux-x64-musl.node') + nativeBinding = require('./farm.linux-x64-musl.node'); } else { - nativeBinding = require('@farmfe/core-linux-x64-musl') + nativeBinding = require('@farmfe/core-linux-x64-musl'); } } catch (e) { - loadError = e + loadError = e; } } else { localFileExisted = existsSync( join(__dirname, 'farm.linux-x64-gnu.node') - ) + ); try { if (localFileExisted) { - nativeBinding = require('./farm.linux-x64-gnu.node') + nativeBinding = require('./farm.linux-x64-gnu.node'); } else { - nativeBinding = require('@farmfe/core-linux-x64-gnu') + nativeBinding = require('@farmfe/core-linux-x64-gnu'); } } catch (e) { - loadError = e + loadError = e; } } - break + break; case 'arm64': if (isMusl()) { localFileExisted = existsSync( join(__dirname, 'farm.linux-arm64-musl.node') - ) + ); try { if (localFileExisted) { - nativeBinding = require('./farm.linux-arm64-musl.node') + nativeBinding = require('./farm.linux-arm64-musl.node'); } else { - nativeBinding = require('@farmfe/core-linux-arm64-musl') + nativeBinding = require('@farmfe/core-linux-arm64-musl'); } } catch (e) { - loadError = e + loadError = e; } } else { localFileExisted = existsSync( join(__dirname, 'farm.linux-arm64-gnu.node') - ) + ); try { if (localFileExisted) { - nativeBinding = require('./farm.linux-arm64-gnu.node') + nativeBinding = require('./farm.linux-arm64-gnu.node'); } else { - nativeBinding = require('@farmfe/core-linux-arm64-gnu') + nativeBinding = require('@farmfe/core-linux-arm64-gnu'); } } catch (e) { - loadError = e + loadError = e; } } - break + break; case 'arm': localFileExisted = existsSync( join(__dirname, 'farm.linux-arm-gnueabihf.node') - ) + ); try { if (localFileExisted) { - nativeBinding = require('./farm.linux-arm-gnueabihf.node') + nativeBinding = require('./farm.linux-arm-gnueabihf.node'); } else { - nativeBinding = require('@farmfe/core-linux-arm-gnueabihf') + nativeBinding = require('@farmfe/core-linux-arm-gnueabihf'); } } catch (e) { - loadError = e + loadError = e; } - break + break; default: - throw new Error(`Unsupported architecture on Linux: ${arch}`) + throw new Error(`Unsupported architecture on Linux: ${arch}`); } - break + break; default: - throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`) + throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`); } if (!nativeBinding) { if (loadError) { - throw loadError + throw loadError; } - throw new Error(`Failed to load native binding`) + throw new Error(`Failed to load native binding`); } -const { JsPluginTransformHtmlHookOrder, Compiler } = nativeBinding +const { JsPluginTransformHtmlHookOrder, Compiler } = nativeBinding; -module.exports.JsPluginTransformHtmlHookOrder = JsPluginTransformHtmlHookOrder -module.exports.Compiler = Compiler +module.exports.JsPluginTransformHtmlHookOrder = JsPluginTransformHtmlHookOrder; +module.exports.Compiler = Compiler; diff --git a/packages/core/binding/index.js b/packages/core/binding/index.js index 03ffdffbe..6457b5683 100644 --- a/packages/core/binding/index.js +++ b/packages/core/binding/index.js @@ -8,4 +8,4 @@ process.env.FARM_LIB_CORE_PATH = bindingPath; const Compiler = binding.Compiler; const JsFileWatcher = binding.JsFileWatcher; -export { Compiler, bindingPath, JsFileWatcher }; \ No newline at end of file +export { Compiler, bindingPath, JsFileWatcher }; diff --git a/packages/core/binding/resolve-binding.cjs b/packages/core/binding/resolve-binding.cjs index f78339819..3155c91f4 100644 --- a/packages/core/binding/resolve-binding.cjs +++ b/packages/core/binding/resolve-binding.cjs @@ -1,23 +1,23 @@ -const { existsSync, readFileSync } = require('fs') -const { join } = require('path') +const { existsSync, readFileSync } = require('fs'); +const { join } = require('path'); -const { platform, arch } = process +const { platform, arch } = process; -let nativeBindingPath = null -let localFileExisted = false -let loadError = null +let nativeBindingPath = null; +let localFileExisted = false; +let loadError = null; function isMusl() { // For Node 10 if (!process.report || typeof process.report.getReport !== 'function') { try { - return readFileSync('/usr/bin/ldd', 'utf8').includes('musl') + return readFileSync('/usr/bin/ldd', 'utf8').includes('musl'); } catch (e) { - return true + return true; } } else { - const { glibcVersionRuntime } = process.report.getReport().header - return !glibcVersionRuntime + const { glibcVersionRuntime } = process.report.getReport().header; + return !glibcVersionRuntime; } } @@ -25,212 +25,234 @@ switch (platform) { case 'android': switch (arch) { case 'arm64': - localFileExisted = existsSync(join(__dirname, 'farm.android-arm64.node')) + localFileExisted = existsSync( + join(__dirname, 'farm.android-arm64.node') + ); try { if (localFileExisted) { - nativeBindingPath = require.resolve('./farm.android-arm64.node') + nativeBindingPath = require.resolve('./farm.android-arm64.node'); } else { - nativeBindingPath = require.resolve('@farmfe/core-android-arm64') + nativeBindingPath = require.resolve('@farmfe/core-android-arm64'); } } catch (e) { - loadError = e + loadError = e; } - break + break; case 'arm': - localFileExisted = existsSync(join(__dirname, 'farm.android-arm-eabi.node')) + localFileExisted = existsSync( + join(__dirname, 'farm.android-arm-eabi.node') + ); try { if (localFileExisted) { - nativeBindingPath = require.resolve('./farm.android-arm-eabi.node') + nativeBindingPath = require.resolve('./farm.android-arm-eabi.node'); } else { - nativeBindingPath = require.resolve('@farmfe/core-android-arm-eabi') + nativeBindingPath = require.resolve( + '@farmfe/core-android-arm-eabi' + ); } } catch (e) { - loadError = e + loadError = e; } - break + break; default: - throw new Error(`Unsupported architecture on Android ${arch}`) + throw new Error(`Unsupported architecture on Android ${arch}`); } - break + break; case 'win32': switch (arch) { case 'x64': localFileExisted = existsSync( join(__dirname, 'farm.win32-x64-msvc.node') - ) + ); try { if (localFileExisted) { - nativeBindingPath = require.resolve('./farm.win32-x64-msvc.node') + nativeBindingPath = require.resolve('./farm.win32-x64-msvc.node'); } else { - nativeBindingPath = require.resolve('@farmfe/core-win32-x64-msvc') + nativeBindingPath = require.resolve('@farmfe/core-win32-x64-msvc'); } } catch (e) { - loadError = e + loadError = e; } - break + break; case 'ia32': localFileExisted = existsSync( join(__dirname, 'farm.win32-ia32-msvc.node') - ) + ); try { if (localFileExisted) { - nativeBindingPath = require.resolve('./farm.win32-ia32-msvc.node') + nativeBindingPath = require.resolve('./farm.win32-ia32-msvc.node'); } else { - nativeBindingPath = require.resolve('@farmfe/core-win32-ia32-msvc') + nativeBindingPath = require.resolve('@farmfe/core-win32-ia32-msvc'); } } catch (e) { - loadError = e + loadError = e; } - break + break; case 'arm64': localFileExisted = existsSync( join(__dirname, 'farm.win32-arm64-msvc.node') - ) + ); try { if (localFileExisted) { - nativeBindingPath = require.resolve('./farm.win32-arm64-msvc.node') + nativeBindingPath = require.resolve('./farm.win32-arm64-msvc.node'); } else { - nativeBindingPath = require.resolve('@farmfe/core-win32-arm64-msvc') + nativeBindingPath = require.resolve( + '@farmfe/core-win32-arm64-msvc' + ); } } catch (e) { - loadError = e + loadError = e; } - break + break; default: - throw new Error(`Unsupported architecture on Windows: ${arch}`) + throw new Error(`Unsupported architecture on Windows: ${arch}`); } - break + break; case 'darwin': switch (arch) { case 'x64': - localFileExisted = existsSync(join(__dirname, 'farm.darwin-x64.node')) + localFileExisted = existsSync(join(__dirname, 'farm.darwin-x64.node')); try { if (localFileExisted) { - nativeBindingPath = require.resolve('./farm.darwin-x64.node') + nativeBindingPath = require.resolve('./farm.darwin-x64.node'); } else { - nativeBindingPath = require.resolve('@farmfe/core-darwin-x64') + nativeBindingPath = require.resolve('@farmfe/core-darwin-x64'); } } catch (e) { - loadError = e + loadError = e; } - break + break; case 'arm64': localFileExisted = existsSync( join(__dirname, 'farm.darwin-arm64.node') - ) + ); try { if (localFileExisted) { - nativeBindingPath = require.resolve('./farm.darwin-arm64.node') + nativeBindingPath = require.resolve('./farm.darwin-arm64.node'); } else { - nativeBindingPath = require.resolve('@farmfe/core-darwin-arm64') + nativeBindingPath = require.resolve('@farmfe/core-darwin-arm64'); } } catch (e) { - loadError = e + loadError = e; } - break + break; default: - throw new Error(`Unsupported architecture on macOS: ${arch}`) + throw new Error(`Unsupported architecture on macOS: ${arch}`); } - break + break; case 'freebsd': if (arch !== 'x64') { - throw new Error(`Unsupported architecture on FreeBSD: ${arch}`) + throw new Error(`Unsupported architecture on FreeBSD: ${arch}`); } - localFileExisted = existsSync(join(__dirname, 'farm.freebsd-x64.node')) + localFileExisted = existsSync(join(__dirname, 'farm.freebsd-x64.node')); try { if (localFileExisted) { - nativeBindingPath = require.resolve('./farm.freebsd-x64.node') + nativeBindingPath = require.resolve('./farm.freebsd-x64.node'); } else { - nativeBindingPath = require.resolve('@farmfe/core-freebsd-x64') + nativeBindingPath = require.resolve('@farmfe/core-freebsd-x64'); } } catch (e) { - loadError = e + loadError = e; } - break + break; case 'linux': switch (arch) { case 'x64': if (isMusl()) { localFileExisted = existsSync( join(__dirname, 'farm.linux-x64-musl.node') - ) + ); try { if (localFileExisted) { - nativeBindingPath = require.resolve('./farm.linux-x64-musl.node') + nativeBindingPath = require.resolve('./farm.linux-x64-musl.node'); } else { - nativeBindingPath = require.resolve('@farmfe/core-linux-x64-musl') + nativeBindingPath = require.resolve( + '@farmfe/core-linux-x64-musl' + ); } } catch (e) { - loadError = e + loadError = e; } } else { localFileExisted = existsSync( join(__dirname, 'farm.linux-x64-gnu.node') - ) + ); try { if (localFileExisted) { - nativeBindingPath = require.resolve('./farm.linux-x64-gnu.node') + nativeBindingPath = require.resolve('./farm.linux-x64-gnu.node'); } else { - nativeBindingPath = require.resolve('@farmfe/core-linux-x64-gnu') + nativeBindingPath = require.resolve('@farmfe/core-linux-x64-gnu'); } } catch (e) { - loadError = e + loadError = e; } } - break + break; case 'arm64': if (isMusl()) { localFileExisted = existsSync( join(__dirname, 'farm.linux-arm64-musl.node') - ) + ); try { if (localFileExisted) { - nativeBindingPath = require.resolve('./farm.linux-arm64-musl.node') + nativeBindingPath = require.resolve( + './farm.linux-arm64-musl.node' + ); } else { - nativeBindingPath = require.resolve('@farmfe/core-linux-arm64-musl') + nativeBindingPath = require.resolve( + '@farmfe/core-linux-arm64-musl' + ); } } catch (e) { - loadError = e + loadError = e; } } else { localFileExisted = existsSync( join(__dirname, 'farm.linux-arm64-gnu.node') - ) + ); try { if (localFileExisted) { - nativeBindingPath = require.resolve('./farm.linux-arm64-gnu.node') + nativeBindingPath = require.resolve( + './farm.linux-arm64-gnu.node' + ); } else { - nativeBindingPath = require.resolve('@farmfe/core-linux-arm64-gnu') + nativeBindingPath = require.resolve( + '@farmfe/core-linux-arm64-gnu' + ); } } catch (e) { - loadError = e + loadError = e; } } - break + break; case 'arm': localFileExisted = existsSync( join(__dirname, 'farm.linux-arm-gnueabihf.node') - ) + ); try { if (localFileExisted) { - nativeBindingPath = require.resolve('./farm.linux-arm-gnueabihf.node') + nativeBindingPath = require.resolve( + './farm.linux-arm-gnueabihf.node' + ); } else { - nativeBindingPath = require.resolve('@farmfe/core-linux-arm-gnueabihf') + nativeBindingPath = require.resolve( + '@farmfe/core-linux-arm-gnueabihf' + ); } } catch (e) { - loadError = e + loadError = e; } - break + break; default: - throw new Error(`Unsupported architecture on Linux: ${arch}`) + throw new Error(`Unsupported architecture on Linux: ${arch}`); } - break + break; default: - throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`) + throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`); } if (loadError) { - throw loadError + throw loadError; } module.exports = nativeBindingPath; diff --git a/packages/core/farm.config.ts b/packages/core/farm.config.ts index 833357a2d..8f87881cb 100644 --- a/packages/core/farm.config.ts +++ b/packages/core/farm.config.ts @@ -3,7 +3,7 @@ import type { UserConfig } from './src/index.js'; const VIRTUAL_SUFFIX = '.virtual.farm'; -export default { +export default ({ compilation: { input: { index: 'src/index.ts' @@ -116,4 +116,4 @@ export default { } } ] -}; +}); diff --git a/packages/core/npm/darwin-arm64/package.json b/packages/core/npm/darwin-arm64/package.json index bc0e8a5d6..8f8b3c68f 100644 --- a/packages/core/npm/darwin-arm64/package.json +++ b/packages/core/npm/darwin-arm64/package.json @@ -1,16 +1,10 @@ { "name": "@farmfe/core-darwin-arm64", "version": "0.0.0", - "os": [ - "darwin" - ], - "cpu": [ - "arm64" - ], + "os": ["darwin"], + "cpu": ["arm64"], "main": "farm.darwin-arm64.node", - "files": [ - "farm.darwin-arm64.node" - ], + "files": ["farm.darwin-arm64.node"], "license": "MIT", "engines": { "node": ">= 10" diff --git a/packages/core/npm/darwin-x64/package.json b/packages/core/npm/darwin-x64/package.json index 28c2be67e..eb2e8f458 100644 --- a/packages/core/npm/darwin-x64/package.json +++ b/packages/core/npm/darwin-x64/package.json @@ -1,16 +1,10 @@ { "name": "@farmfe/core-darwin-x64", "version": "0.0.0", - "os": [ - "darwin" - ], - "cpu": [ - "x64" - ], + "os": ["darwin"], + "cpu": ["x64"], "main": "farm.darwin-x64.node", - "files": [ - "farm.darwin-x64.node" - ], + "files": ["farm.darwin-x64.node"], "license": "MIT", "engines": { "node": ">= 10" diff --git a/packages/core/npm/linux-arm64-gnu/package.json b/packages/core/npm/linux-arm64-gnu/package.json index 676662967..4569828e7 100644 --- a/packages/core/npm/linux-arm64-gnu/package.json +++ b/packages/core/npm/linux-arm64-gnu/package.json @@ -1,16 +1,10 @@ { "name": "@farmfe/core-linux-arm64-gnu", "version": "0.0.0", - "os": [ - "linux" - ], - "cpu": [ - "arm64" - ], + "os": ["linux"], + "cpu": ["arm64"], "main": "farm.linux-arm64-gnu.node", - "files": [ - "farm.linux-arm64-gnu.node" - ], + "files": ["farm.linux-arm64-gnu.node"], "license": "MIT", "engines": { "node": ">= 10" diff --git a/packages/core/npm/linux-arm64-musl/package.json b/packages/core/npm/linux-arm64-musl/package.json index 2b4f34784..e6dbf4237 100644 --- a/packages/core/npm/linux-arm64-musl/package.json +++ b/packages/core/npm/linux-arm64-musl/package.json @@ -1,16 +1,10 @@ { "name": "@farmfe/core-linux-arm64-musl", "version": "0.0.0", - "os": [ - "linux" - ], - "cpu": [ - "arm64" - ], + "os": ["linux"], + "cpu": ["arm64"], "main": "farm.linux-arm64-musl.node", - "files": [ - "farm.linux-arm64-musl.node" - ], + "files": ["farm.linux-arm64-musl.node"], "license": "MIT", "engines": { "node": ">= 10" diff --git a/packages/core/npm/linux-x64-gnu/package.json b/packages/core/npm/linux-x64-gnu/package.json index d3327d2b8..d34f96c85 100644 --- a/packages/core/npm/linux-x64-gnu/package.json +++ b/packages/core/npm/linux-x64-gnu/package.json @@ -1,21 +1,13 @@ { "name": "@farmfe/core-linux-x64-gnu", "version": "0.0.0", - "os": [ - "linux" - ], - "cpu": [ - "x64" - ], + "os": ["linux"], + "cpu": ["x64"], "main": "farm.linux-x64-gnu.node", - "files": [ - "farm.linux-x64-gnu.node" - ], + "files": ["farm.linux-x64-gnu.node"], "license": "MIT", "engines": { "node": ">= 10" }, - "libc": [ - "glibc" - ] + "libc": ["glibc"] } diff --git a/packages/core/npm/linux-x64-musl/package.json b/packages/core/npm/linux-x64-musl/package.json index 06ce6d9f2..45fdcfee8 100644 --- a/packages/core/npm/linux-x64-musl/package.json +++ b/packages/core/npm/linux-x64-musl/package.json @@ -1,21 +1,13 @@ { "name": "@farmfe/core-linux-x64-musl", "version": "0.0.0", - "os": [ - "linux" - ], - "cpu": [ - "x64" - ], + "os": ["linux"], + "cpu": ["x64"], "main": "farm.linux-x64-musl.node", - "files": [ - "farm.linux-x64-musl.node" - ], + "files": ["farm.linux-x64-musl.node"], "license": "MIT", "engines": { "node": ">= 10" }, - "libc": [ - "glibc" - ] + "libc": ["glibc"] } diff --git a/packages/core/npm/win32-arm64-msvc/package.json b/packages/core/npm/win32-arm64-msvc/package.json index 8aa3f39fc..6fad2cca6 100644 --- a/packages/core/npm/win32-arm64-msvc/package.json +++ b/packages/core/npm/win32-arm64-msvc/package.json @@ -1,16 +1,10 @@ { "name": "@farmfe/core-win32-arm64-msvc", "version": "0.0.0", - "os": [ - "win32" - ], - "cpu": [ - "arm64" - ], + "os": ["win32"], + "cpu": ["arm64"], "main": "farm.win32-arm64-msvc.node", - "files": [ - "farm.win32-arm64-msvc.node" - ], + "files": ["farm.win32-arm64-msvc.node"], "license": "MIT", "engines": { "node": ">= 10" diff --git a/packages/core/npm/win32-ia32-msvc/package.json b/packages/core/npm/win32-ia32-msvc/package.json index dcdbbf598..438092d11 100644 --- a/packages/core/npm/win32-ia32-msvc/package.json +++ b/packages/core/npm/win32-ia32-msvc/package.json @@ -1,16 +1,10 @@ { "name": "@farmfe/core-win32-ia32-msvc", "version": "0.0.0", - "os": [ - "win32" - ], - "cpu": [ - "ia32" - ], + "os": ["win32"], + "cpu": ["ia32"], "main": "farm.win32-ia32-msvc.node", - "files": [ - "farm.win32-ia32-msvc.node" - ], + "files": ["farm.win32-ia32-msvc.node"], "license": "MIT", "engines": { "node": ">= 10" diff --git a/packages/core/npm/win32-x64-msvc/package.json b/packages/core/npm/win32-x64-msvc/package.json index 2bfbb6a78..232617548 100644 --- a/packages/core/npm/win32-x64-msvc/package.json +++ b/packages/core/npm/win32-x64-msvc/package.json @@ -1,16 +1,10 @@ { "name": "@farmfe/core-win32-x64-msvc", "version": "0.0.0", - "os": [ - "win32" - ], - "cpu": [ - "x64" - ], + "os": ["win32"], + "cpu": ["x64"], "main": "farm.win32-x64-msvc.node", - "files": [ - "farm.win32-x64-msvc.node" - ], + "files": ["farm.win32-x64-msvc.node"], "license": "MIT", "engines": { "node": ">= 10" diff --git a/packages/core/src/compiler/index.ts b/packages/core/src/compiler/index.ts index b97c482b5..312bfa298 100644 --- a/packages/core/src/compiler/index.ts +++ b/packages/core/src/compiler/index.ts @@ -1,11 +1,11 @@ import { existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs'; import path from 'node:path'; -import { Logger } from '../utils/logger.js'; import { Compiler as BindingCompiler } from '../../binding/index.js'; +import { Logger } from '../utils/logger.js'; -import type { ILogger } from '../utils/logger.js'; import type { Config, JsUpdateResult } from '../../binding/index.js'; import { JsPlugin, Resource } from '../index.js'; +import type { ILogger } from '../utils/logger.js'; export const VIRTUAL_FARM_DYNAMIC_IMPORT_SUFFIX = '.farm_dynamic_import_virtual_module'; diff --git a/packages/core/src/config/index.ts b/packages/core/src/config/index.ts index 2f99f2e50..afbd370d9 100644 --- a/packages/core/src/config/index.ts +++ b/packages/core/src/config/index.ts @@ -1,9 +1,15 @@ -import module from 'node:module'; +import crypto from 'node:crypto'; import fs from 'node:fs'; +import module from 'node:module'; import path, { isAbsolute, join } from 'node:path'; -import crypto from 'node:crypto'; import { pathToFileURL } from 'node:url'; +import { + Config, + PluginTransformHookParam, + bindingPath +} from '../../binding/index.js'; +import { JsPlugin } from '../index.js'; import { getSortedPlugins, handleVitePlugins, @@ -12,36 +18,34 @@ import { resolveConfigResolvedHook, resolveFarmPlugins } from '../plugin/index.js'; -import { - bindingPath, - Config, - PluginTransformHookParam -} from '../../binding/index.js'; import { Server } from '../server/index.js'; -import { parseUserConfig } from './schema.js'; -import { CompilationMode, loadEnv, setProcessEnv } from './env.js'; -import { __FARM_GLOBAL__ } from './_global.js'; +import { urlRegex } from '../utils/http.js'; import { + Logger, bold, clearScreen, - Logger, + colors, + getAliasEntries, green, isArray, isEmptyObject, isObject, isWindows, - normalizePath, normalizeBasePath, - getAliasEntries, - transformAliasWithVite, - colors + normalizePath, + transformAliasWithVite } from '../utils/index.js'; -import { urlRegex } from '../utils/http.js'; -import { JsPlugin } from '../index.js'; -import { normalizePersistentCache } from './normalize-config/normalize-persistent-cache.js'; -import { normalizeOutput } from './normalize-config/normalize-output.js'; import { traceDependencies } from '../utils/trace-dependencies.js'; +import { __FARM_GLOBAL__ } from './_global.js'; +import { CompilationMode, loadEnv, setProcessEnv } from './env.js'; +import { normalizeOutput } from './normalize-config/normalize-output.js'; +import { normalizePersistentCache } from './normalize-config/normalize-persistent-cache.js'; +import { parseUserConfig } from './schema.js'; +import merge from '../utils/merge.js'; +import { DEFAULT_CONFIG_NAMES, FARM_DEFAULT_NAMESPACE } from './constants.js'; +import { mergeConfig, mergeFarmCliConfig } from './mergeConfig.js'; +import { normalizeExternal } from './normalize-config/normalize-external.js'; import type { Alias, FarmCLIOptions, @@ -53,10 +57,6 @@ import type { UserHmrConfig, UserServerConfig } from './types.js'; -import { normalizeExternal } from './normalize-config/normalize-external.js'; -import { DEFAULT_CONFIG_NAMES, FARM_DEFAULT_NAMESPACE } from './constants.js'; -import merge from '../utils/merge.js'; -import { mergeConfig, mergeFarmCliConfig } from './mergeConfig.js'; export * from './types.js'; @@ -847,7 +847,7 @@ export async function loadConfigFile( try { errorMessage = JSON.parse(error.message).join('\n'); - } catch (e) { + } catch { errorMessage = error.message; } diff --git a/packages/core/src/config/normalize-config/normalize-external.ts b/packages/core/src/config/normalize-config/normalize-external.ts index fc4e9efc1..7d14d3735 100644 --- a/packages/core/src/config/normalize-config/normalize-external.ts +++ b/packages/core/src/config/normalize-config/normalize-external.ts @@ -1,8 +1,8 @@ import module from 'node:module'; -import { Config } from '../../../binding/index.js'; import { existsSync, readFileSync } from 'node:fs'; import path from 'node:path'; +import { Config } from '../../../binding/index.js'; export function normalizeExternal(config: Config['config']) { const defaultExternals: string[] = []; diff --git a/packages/core/src/config/normalize-config/normalize-persistent-cache.ts b/packages/core/src/config/normalize-config/normalize-persistent-cache.ts index a75ee3d2b..b200bd8d9 100644 --- a/packages/core/src/config/normalize-config/normalize-persistent-cache.ts +++ b/packages/core/src/config/normalize-config/normalize-persistent-cache.ts @@ -1,11 +1,11 @@ +import { existsSync, readFileSync } from 'node:fs'; import { createRequire } from 'node:module'; import path from 'node:path'; -import { existsSync, readFileSync } from 'node:fs'; import { Config } from '../../../binding/index.js'; -import { ResolvedUserConfig } from '../index.js'; import { RustPlugin } from '../../plugin/index.js'; import { traceDependencies } from '../../utils/trace-dependencies.js'; +import { ResolvedUserConfig } from '../index.js'; const defaultGlobalBuiltinCacheKeyStrategy = { define: true, @@ -59,10 +59,13 @@ export async function normalizePersistentCache( .map(([k, v]) => typeof v !== 'string' ? [k, JSON.stringify(v)] : [k, v] ) - .reduce((acc, [k, v]) => { - acc[k] = v; - return acc; - }, {} as Record), + .reduce( + (acc, [k, v]) => { + acc[k] = v; + return acc; + }, + {} as Record + ), ...config.persistentCache.envs }; } @@ -161,7 +164,7 @@ export async function normalizePersistentCache( const packageJson = require(packageJsonPath); const key = `${packageJson.name}@${packageJson.version}`; config.persistentCache.buildDependencies.push(key); - } catch (e) { + } catch { if (typeof p === 'string') { config.persistentCache.buildDependencies.push(p); } else if (Array.isArray(p) && typeof p[0] === 'string') { diff --git a/packages/core/src/config/schema.ts b/packages/core/src/config/schema.ts index 7556ed413..abf392d53 100644 --- a/packages/core/src/config/schema.ts +++ b/packages/core/src/config/schema.ts @@ -1,6 +1,6 @@ +import { SecureServerOptions } from 'node:http2'; import { z } from 'zod'; import { fromZodError } from 'zod-validation-error'; -import { SecureServerOptions } from 'node:http2'; import type { UserConfig } from './types.js'; diff --git a/packages/core/src/config/types.ts b/packages/core/src/config/types.ts index a03b443f0..37a1fcdda 100644 --- a/packages/core/src/config/types.ts +++ b/packages/core/src/config/types.ts @@ -1,15 +1,15 @@ import { SecureServerOptions } from 'node:http2'; import { Server } from '../index.js'; -import type cors from '@koa/cors'; import type { OutgoingHttpHeaders } from 'http'; -import type { Logger } from '../utils/index.js'; -import type { ProxiesOptions } from '../server/middlewares/proxy.js'; -import type { JsPlugin } from '../plugin/type.js'; -import type { RustPlugin } from '../plugin/rust/index.js'; -import type { Config } from '../../binding/index.js'; -import { Middleware } from 'koa'; +import type cors from '@koa/cors'; import { WatchOptions } from 'chokidar'; +import { Middleware } from 'koa'; +import type { Config } from '../../binding/index.js'; +import type { RustPlugin } from '../plugin/rust/index.js'; +import type { JsPlugin } from '../plugin/type.js'; +import type { ProxiesOptions } from '../server/middlewares/proxy.js'; +import type { Logger } from '../utils/index.js'; export interface ConfigEnv { mode: string; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index d17e0befd..ce029cda4 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -4,37 +4,37 @@ export * from './server/index.js'; export * from './plugin/type.js'; export * from './utils/index.js'; -import path from 'node:path'; -import fs from 'node:fs/promises'; import { statSync } from 'node:fs'; +import fs from 'node:fs/promises'; +import path from 'node:path'; import fse from 'fs-extra'; import { Compiler } from './compiler/index.js'; +import { loadEnv, setProcessEnv } from './config/env.js'; import { + UserConfig, getConfigFilePath, normalizePublicDir, - resolveConfig, - UserConfig + resolveConfig } from './config/index.js'; -import { Logger } from './utils/logger.js'; import { Server } from './server/index.js'; -import { FileWatcher } from './watcher/index.js'; import { compilerHandler } from './utils/build.js'; -import { loadEnv, setProcessEnv } from './config/env.js'; import { colors } from './utils/color.js'; +import { Logger } from './utils/logger.js'; +import { FileWatcher } from './watcher/index.js'; +import { __FARM_GLOBAL__ } from './config/_global.js'; import type { FarmCLIOptions, ResolvedUserConfig, UserPreviewServerConfig } from './config/types.js'; import { JsPlugin } from './plugin/type.js'; -import { __FARM_GLOBAL__ } from './config/_global.js'; -import { ConfigWatcher } from './watcher/config-watcher.js'; -import { clearScreen } from './utils/share.js'; import { logError } from './server/error.js'; import { lazyCompilation } from './server/middlewares/lazy-compilation.js'; import { resolveHostname } from './utils/http.js'; +import { clearScreen } from './utils/share.js'; +import { ConfigWatcher } from './watcher/config-watcher.js'; export async function start( inlineConfig?: FarmCLIOptions & UserConfig diff --git a/packages/core/src/plugin/index.ts b/packages/core/src/plugin/index.ts index 6595bba17..73c010f6e 100644 --- a/packages/core/src/plugin/index.ts +++ b/packages/core/src/plugin/index.ts @@ -2,9 +2,9 @@ import { isArray, isObject } from '../utils/index.js'; import { convertPlugin } from './js/index.js'; import { rustPluginResolver } from './rust/index.js'; -import type { JsPlugin } from './type.js'; import { ResolvedUserConfig, type UserConfig } from '../config/index.js'; import merge from '../utils/merge.js'; +import type { JsPlugin } from './type.js'; export * from './js/index.js'; export * from './rust/index.js'; diff --git a/packages/core/src/plugin/js/farm-to-vite-config.ts b/packages/core/src/plugin/js/farm-to-vite-config.ts index 46406ff9f..243643f62 100644 --- a/packages/core/src/plugin/js/farm-to-vite-config.ts +++ b/packages/core/src/plugin/js/farm-to-vite-config.ts @@ -1,12 +1,12 @@ import type { UserConfig as ViteUserConfig } from 'vite'; import type { UserConfig } from '../../config/types.js'; +import { Logger } from '../../index.js'; +import merge from '../../utils/merge.js'; +import { VITE_DEFAULT_ASSETS } from './constants.js'; import { deleteUndefinedPropertyDeeply, throwIncompatibleError } from './utils.js'; -import merge from '../../utils/merge.js'; -import { Logger } from '../../index.js'; -import { VITE_DEFAULT_ASSETS } from './constants.js'; export function farmUserConfigToViteConfig(config: UserConfig): ViteUserConfig { const vitePlugins = config.vitePlugins.filter(Boolean).map((plugin) => { diff --git a/packages/core/src/plugin/js/farm-to-vite-context.ts b/packages/core/src/plugin/js/farm-to-vite-context.ts index e99b681f5..89a0cbf39 100644 --- a/packages/core/src/plugin/js/farm-to-vite-context.ts +++ b/packages/core/src/plugin/js/farm-to-vite-context.ts @@ -1,7 +1,7 @@ import type { PluginContext } from 'rollup'; import type { UserConfig } from '../../config/types.js'; -import type { CompilationContext } from '../type.js'; import { Logger } from '../../utils/logger.js'; +import type { CompilationContext } from '../type.js'; import { normalizePath, revertNormalizePath } from './utils.js'; const contextCache = new Map(); diff --git a/packages/core/src/plugin/js/index.ts b/packages/core/src/plugin/js/index.ts index 5cc81c8e3..ffa2c63e0 100644 --- a/packages/core/src/plugin/js/index.ts +++ b/packages/core/src/plugin/js/index.ts @@ -1,20 +1,20 @@ +import { existsSync, readFileSync } from 'node:fs'; +import { isAbsolute } from 'node:path'; +import { CompilationMode } from '../../config/env.js'; import { type JsPlugin, - normalizeDevServerOptions, + Logger, type UserConfig, - Logger + normalizeDevServerOptions } from '../../index.js'; +import merge from '../../utils/merge.js'; +import { resolveAsyncPlugins } from '../index.js'; import { DEFAULT_FILTERS, - getCssModuleType, - VITE_PLUGIN_DEFAULT_MODULE_TYPE + VITE_PLUGIN_DEFAULT_MODULE_TYPE, + getCssModuleType } from './utils.js'; import { VitePluginAdapter } from './vite-plugin-adapter.js'; -import { existsSync, readFileSync } from 'node:fs'; -import { resolveAsyncPlugins } from '../index.js'; -import merge from '../../utils/merge.js'; -import { CompilationMode } from '../../config/env.js'; -import { isAbsolute } from 'node:path'; // export * from './jsPluginAdapter.js'; export { VitePluginAdapter } from './vite-plugin-adapter.js'; diff --git a/packages/core/src/plugin/js/utils.ts b/packages/core/src/plugin/js/utils.ts index 81722234d..e39a3e973 100644 --- a/packages/core/src/plugin/js/utils.ts +++ b/packages/core/src/plugin/js/utils.ts @@ -1,6 +1,7 @@ +import path from 'node:path'; // import path from 'node:path'; import * as querystring from 'node:querystring'; -import { JsResourcePotInfoData, Resource, ResourcePotInfo } from '../type.js'; +import fse from 'fs-extra'; import { InternalModuleFormat, NormalizedInputOptions, @@ -11,8 +12,7 @@ import { RenderedModule } from 'rollup'; import { Config } from '../../../binding/index.js'; -import path from 'node:path'; -import fse from 'fs-extra'; +import { JsResourcePotInfoData, Resource, ResourcePotInfo } from '../type.js'; import { VITE_ADAPTER_VIRTUAL_MODULE } from './constants.js'; export type WatchChangeEvents = 'create' | 'update' | 'delete'; diff --git a/packages/core/src/plugin/js/vite-plugin-adapter.ts b/packages/core/src/plugin/js/vite-plugin-adapter.ts index aa689cce5..8fa978b60 100644 --- a/packages/core/src/plugin/js/vite-plugin-adapter.ts +++ b/packages/core/src/plugin/js/vite-plugin-adapter.ts @@ -1,54 +1,55 @@ +import type { ResolvedUserConfig, UserConfig } from '../../config/types.js'; +import type { Server } from '../../server/index.js'; import { - JsPlugin, CompilationContext, - PluginRenderResourcePotParams, + JsPlugin, PluginFinalizeResourcesHookParams, - ResourcePotInfo, - Resource + PluginRenderResourcePotParams, + Resource, + ResourcePotInfo } from '../type.js'; import { + FARM_CSS_MODULES_SUFFIX, + VITE_PLUGIN_DEFAULT_MODULE_TYPE, convertEnforceToPriority, customParseQueryString, + decodeStr, + encodeStr, formatId, formatLoadModuleType, formatTransformModuleType, getContentValue, isObject, + isStartsWithSlash, isString, - encodeStr, - decodeStr, - FARM_CSS_MODULES_SUFFIX, - transformFarmConfigToRollupNormalizedOutputOptions, - transformResourceInfo2RollupRenderedChunk, - transformRollupResource2FarmResource, - VITE_PLUGIN_DEFAULT_MODULE_TYPE, + normalizeAdapterVirtualModule, normalizePath, + removeQuery, revertNormalizePath, - normalizeAdapterVirtualModule, - isStartsWithSlash, - removeQuery + transformFarmConfigToRollupNormalizedOutputOptions, + transformResourceInfo2RollupRenderedChunk, + transformRollupResource2FarmResource } from './utils.js'; -import type { ResolvedUserConfig, UserConfig } from '../../config/types.js'; -import type { Server } from '../../server/index.js'; // only use types from vite and we do not install vite as a dependency import type { - Plugin, - UserConfig as ViteUserConfig, + ConfigEnv, HmrContext, - ViteDevServer, ModuleNode, - ConfigEnv + Plugin, + ViteDevServer, + UserConfig as ViteUserConfig } from 'vite'; +import path from 'path'; +import fse from 'fs-extra'; +import { readFile } from 'fs/promises'; import type { - ResolveIdResult, - RenderChunkHook, + FunctionPluginHooks, OutputBundle, - FunctionPluginHooks + RenderChunkHook, + ResolveIdResult } from 'rollup'; -import path from 'path'; -import fse from 'fs-extra'; import { Config, PluginLoadHookParam, @@ -58,27 +59,26 @@ import { PluginTransformHookParam, PluginTransformHookResult } from '../../../binding/index.js'; -import { readFile } from 'fs/promises'; -import { - ViteDevServerAdapter, - ViteModuleGraphAdapter, - createViteDevServerAdapter -} from './vite-server-adapter.js'; -import { farmContextToViteContext } from './farm-to-vite-context.js'; +import { VIRTUAL_FARM_DYNAMIC_IMPORT_SUFFIX } from '../../compiler/index.js'; +import { CompilationMode } from '../../config/env.js'; +import { Logger } from '../../index.js'; +import merge from '../../utils/merge.js'; +import { applyHtmlTransform } from './apply-html-transform.js'; import { farmUserConfigToViteConfig, proxyViteConfig, viteConfigToFarmConfig } from './farm-to-vite-config.js'; -import { VIRTUAL_FARM_DYNAMIC_IMPORT_SUFFIX } from '../../compiler/index.js'; +import { farmContextToViteContext } from './farm-to-vite-context.js'; import { - transformResourceInfo2RollupResource, - transformFarmConfigToRollupNormalizedInputOptions + transformFarmConfigToRollupNormalizedInputOptions, + transformResourceInfo2RollupResource } from './utils.js'; -import { Logger } from '../../index.js'; -import { applyHtmlTransform } from './apply-html-transform.js'; -import merge from '../../utils/merge.js'; -import { CompilationMode } from '../../config/env.js'; +import { + ViteDevServerAdapter, + ViteModuleGraphAdapter, + createViteDevServerAdapter +} from './vite-server-adapter.js'; type OmitThis any> = T extends ( this: any, @@ -644,7 +644,7 @@ export class VitePluginAdapter implements JsPlugin { ...m, id: normalizePath(m.id), file: normalizePath(m.file) - } as ModuleNode) + }) as ModuleNode ), read: function (): string | Promise { return readFile(file, 'utf-8'); @@ -769,13 +769,16 @@ export class VitePluginAdapter implements JsPlugin { bundles ); - const result = Object.entries(bundles).reduce((res, [key, val]) => { - res[key] = transformRollupResource2FarmResource( - val, - param.resourcesMap[key] - ); - return res; - }, {} as PluginFinalizeResourcesHookParams['resourcesMap']); + const result = Object.entries(bundles).reduce( + (res, [key, val]) => { + res[key] = transformRollupResource2FarmResource( + val, + param.resourcesMap[key] + ); + return res; + }, + {} as PluginFinalizeResourcesHookParams['resourcesMap'] + ); return result; } diff --git a/packages/core/src/plugin/rust/rustPluginResolver.ts b/packages/core/src/plugin/rust/rustPluginResolver.ts index 37f39ccf9..afeae9fbf 100644 --- a/packages/core/src/plugin/rust/rustPluginResolver.ts +++ b/packages/core/src/plugin/rust/rustPluginResolver.ts @@ -1,6 +1,6 @@ import { createRequire } from 'node:module'; -import { pathToFileURL } from 'node:url'; import path from 'node:path'; +import { pathToFileURL } from 'node:url'; export type RustPlugin = | string diff --git a/packages/core/src/plugin/type.ts b/packages/core/src/plugin/type.ts index 92fb5a860..507738b18 100644 --- a/packages/core/src/plugin/type.ts +++ b/packages/core/src/plugin/type.ts @@ -7,7 +7,7 @@ import { PluginTransformHookParam, PluginTransformHookResult } from '../../binding/index.js'; -import { Compiler, Server, ResolvedUserConfig, UserConfig } from '../index.js'; +import { Compiler, ResolvedUserConfig, Server, UserConfig } from '../index.js'; // https://stackoverflow.com/questions/61047551/typescript-union-of-string-and-string-literals // eslint-disable-next-line @typescript-eslint/ban-types diff --git a/packages/core/src/server/hmr-engine.ts b/packages/core/src/server/hmr-engine.ts index 2851d2cd6..38e013b9d 100644 --- a/packages/core/src/server/hmr-engine.ts +++ b/packages/core/src/server/hmr-engine.ts @@ -1,16 +1,16 @@ import fse from 'fs-extra'; // queue all updates and compile them one by one -import { isAbsolute, relative } from 'node:path'; import { stat } from 'node:fs/promises'; +import { isAbsolute, relative } from 'node:path'; +import type { Resource } from '@farmfe/runtime/src/resource-loader.js'; +import { JsUpdateResult } from '../../binding/binding.js'; import { Compiler } from '../compiler/index.js'; -import { Server } from './index.js'; import { Logger, bold, clearScreen, cyan, green } from '../utils/index.js'; -import { JsUpdateResult } from '../../binding/binding.js'; -import type { Resource } from '@farmfe/runtime/src/resource-loader.js'; -import { WebSocketClient } from './ws.js'; import { logError } from './error.js'; +import { Server } from './index.js'; +import { WebSocketClient } from './ws.js'; export class HmrEngine { private _updateQueue: string[] = []; @@ -22,7 +22,11 @@ export class HmrEngine { private _lastModifiedTimestamp: Map; - constructor(compiler: Compiler, devServer: Server, private _logger: Logger) { + constructor( + compiler: Compiler, + devServer: Server, + private _logger: Logger + ) { this._compiler = compiler; this._devServer = devServer; // this._lastAttemptWasError = false; diff --git a/packages/core/src/server/index.ts b/packages/core/src/server/index.ts index ba04dd3e7..1876be431 100644 --- a/packages/core/src/server/index.ts +++ b/packages/core/src/server/index.ts @@ -3,25 +3,30 @@ import http2 from 'node:http2'; import Koa from 'koa'; import compression from 'koa-compress'; +import path from 'node:path'; +import { promisify } from 'node:util'; import { Compiler } from '../compiler/index.js'; +import { __FARM_GLOBAL__ } from '../config/_global.js'; import { DEFAULT_HMR_OPTIONS, DevServerMiddleware, NormalizedServerConfig, - normalizePublicDir, - normalizePublicPath, UserPreviewServerConfig, - UserServerConfig + UserServerConfig, + normalizePublicDir, + normalizePublicPath } from '../config/index.js'; -import { HmrEngine } from './hmr-engine.js'; -import { openBrowser } from './open.js'; +import { resolveHostname, resolveServerUrls } from '../utils/http.js'; import { + Logger, bootstrap, clearScreen, - Logger, normalizeBasePath, printServerUrls } from '../utils/index.js'; +import { FileWatcher } from '../watcher/index.js'; +import { logError } from './error.js'; +import { HmrEngine } from './hmr-engine.js'; import { cors, headers, @@ -31,14 +36,9 @@ import { resources, staticMiddleware } from './middlewares/index.js'; -import { __FARM_GLOBAL__ } from '../config/_global.js'; -import { resolveHostname, resolveServerUrls } from '../utils/http.js'; -import WsServer from './ws.js'; +import { openBrowser } from './open.js'; import { Server as httpServer } from './type.js'; -import { promisify } from 'node:util'; -import { FileWatcher } from '../watcher/index.js'; -import { logError } from './error.js'; -import path from 'node:path'; +import WsServer from './ws.js'; /** * Farm Dev Server, responsible for: diff --git a/packages/core/src/server/middlewares/cors.ts b/packages/core/src/server/middlewares/cors.ts index 01513972a..d3c26bf2c 100644 --- a/packages/core/src/server/middlewares/cors.ts +++ b/packages/core/src/server/middlewares/cors.ts @@ -1,6 +1,6 @@ +import { default as koaCors } from '@koa/cors'; import { Middleware } from 'koa'; import { Server } from '../index.js'; -import { default as koaCors } from '@koa/cors'; export function cors(devSeverContext: Server): Middleware { const { config } = devSeverContext; diff --git a/packages/core/src/server/middlewares/lazy-compilation.ts b/packages/core/src/server/middlewares/lazy-compilation.ts index 1749d4599..9922f6dda 100644 --- a/packages/core/src/server/middlewares/lazy-compilation.ts +++ b/packages/core/src/server/middlewares/lazy-compilation.ts @@ -5,7 +5,6 @@ import { relative } from 'node:path'; import { Context, Middleware, Next } from 'koa'; -import { Server } from '../index.js'; import { VIRTUAL_FARM_DYNAMIC_IMPORT_SUFFIX, bold, @@ -13,9 +12,10 @@ import { cyan, green } from '../../index.js'; +import { Server } from '../index.js'; -import type { Resource } from '@farmfe/runtime/src/resource-loader.js'; import { existsSync } from 'node:fs'; +import type { Resource } from '@farmfe/runtime/src/resource-loader.js'; import { logError } from '../error.js'; export function lazyCompilation(devSeverContext: Server): Middleware { diff --git a/packages/core/src/server/middlewares/proxy.ts b/packages/core/src/server/middlewares/proxy.ts index d025a7d72..2fa596e89 100644 --- a/packages/core/src/server/middlewares/proxy.ts +++ b/packages/core/src/server/middlewares/proxy.ts @@ -1,12 +1,12 @@ +import Application, { Middleware, Context, Next } from 'koa'; import { - default as koaProxy, + IBaseKoaProxiesOptions, IKoaProxiesOptions, - IBaseKoaProxiesOptions + default as koaProxy } from 'koa-proxies'; -import type { Server } from '../index.js'; import { UserConfig } from '../../config/types.js'; -import Application, { Middleware, Context, Next } from 'koa'; import { Logger } from '../../utils/logger.js'; +import type { Server } from '../index.js'; export type ProxiesOptions = IKoaProxiesOptions; diff --git a/packages/core/src/server/middlewares/resources.ts b/packages/core/src/server/middlewares/resources.ts index ebd2127ce..19fd2e7d9 100644 --- a/packages/core/src/server/middlewares/resources.ts +++ b/packages/core/src/server/middlewares/resources.ts @@ -2,14 +2,14 @@ * Serve resources that stored in memory. This middleware will be enabled when server.writeToDisk is false. */ +import { existsSync, readFileSync, statSync } from 'node:fs'; import path, { extname } from 'node:path'; import { Context, Middleware, Next } from 'koa'; -import { Compiler } from '../../compiler/index.js'; -import { Server } from '../index.js'; import koaStatic from 'koa-static'; +import { Compiler } from '../../compiler/index.js'; import { NormalizedServerConfig } from '../../config/types.js'; import { generateFileTree, generateFileTreeHtml } from '../../utils/index.js'; -import { existsSync, readFileSync, statSync } from 'node:fs'; +import { Server } from '../index.js'; export function resourcesMiddleware( compiler: Compiler, diff --git a/packages/core/src/server/middlewares/static.ts b/packages/core/src/server/middlewares/static.ts index 18bf751ff..35d4e6795 100644 --- a/packages/core/src/server/middlewares/static.ts +++ b/packages/core/src/server/middlewares/static.ts @@ -1,8 +1,8 @@ -import { Middleware, Context, Next } from 'koa'; -import { Server } from '../index.js'; -import serve from 'koa-static'; -import path from 'path'; import fs from 'fs'; +import path from 'path'; +import { Context, Middleware, Next } from 'koa'; +import serve from 'koa-static'; +import { Server } from '../index.js'; export function staticMiddleware(devServerContext: Server): Middleware { const { config } = devServerContext; diff --git a/packages/core/src/server/open.ts b/packages/core/src/server/open.ts index 0faa27e15..fb31ff9b2 100644 --- a/packages/core/src/server/open.ts +++ b/packages/core/src/server/open.ts @@ -10,10 +10,10 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import open from 'open'; -import { execa } from 'execa'; import { execSync } from 'child_process'; -import { cyan, Logger, red } from '../utils/index.js'; +import { execa } from 'execa'; +import open from 'open'; +import { Logger, cyan, red } from '../utils/index.js'; // https://github.com/sindresorhus/open#app const OSX_CHROME = 'google chrome'; @@ -82,7 +82,7 @@ function startBrowserProcess(browser: string | undefined, url: string) { stdio: 'ignore' }); return true; - } catch (err) { + } catch { // Ignore errors } } @@ -104,7 +104,7 @@ function startBrowserProcess(browser: string | undefined, url: string) { logger.error(e); }); // Prevent `unhandledRejection` error. return true; - } catch (err) { + } catch { return false; } } diff --git a/packages/core/src/server/ws.ts b/packages/core/src/server/ws.ts index 18243c76c..3d81bf077 100644 --- a/packages/core/src/server/ws.ts +++ b/packages/core/src/server/ws.ts @@ -2,10 +2,10 @@ import type { IncomingMessage } from 'node:http'; import type { Duplex } from 'node:stream'; import type { WebSocket as WebSocketRawType } from 'ws'; -import { WebSocketServer as WebSocketServerRaw, WebSocket } from 'ws'; +import { WebSocket, WebSocketServer as WebSocketServerRaw } from 'ws'; import { Logger, NormalizedServerConfig, red } from '../index.js'; -import { Server } from './type.js'; import { HmrEngine } from './hmr-engine.js'; +import { Server } from './type.js'; import type { ILogger } from '../index.js'; diff --git a/packages/core/src/utils/build.ts b/packages/core/src/utils/build.ts index a89d854e7..65273929b 100644 --- a/packages/core/src/utils/build.ts +++ b/packages/core/src/utils/build.ts @@ -1,13 +1,13 @@ import { performance } from 'node:perf_hooks'; import { Logger } from './logger.js'; -import { PersistentCacheBrand, bold, green } from './color.js'; import { FARM_TARGET_NODE_ENVS, ResolvedUserConfig, clearScreen } from '../index.js'; import { logError } from '../server/error.js'; +import { PersistentCacheBrand, bold, green } from './color.js'; interface CompilerHandlerOptions { clear?: boolean; diff --git a/packages/core/src/utils/file.ts b/packages/core/src/utils/file.ts index 22555326c..b897dbf21 100644 --- a/packages/core/src/utils/file.ts +++ b/packages/core/src/utils/file.ts @@ -1,7 +1,7 @@ import fs from 'fs'; import fsp from 'node:fs/promises'; -import { normalizePath } from './share.js'; import path from 'path'; +import { normalizePath } from './share.js'; interface FileNode { isLeaf: boolean; diff --git a/packages/core/src/utils/logger.ts b/packages/core/src/utils/logger.ts index d23806885..925854e84 100644 --- a/packages/core/src/utils/logger.ts +++ b/packages/core/src/utils/logger.ts @@ -1,7 +1,7 @@ +import { Config } from '../../binding/index.js'; +import { ColorFunction, PersistentCacheBrand, colors } from './color.js'; /* eslint-disable @typescript-eslint/no-explicit-any */ import { pad, version } from './share.js'; -import { ColorFunction, PersistentCacheBrand, colors } from './color.js'; -import { Config } from '../../binding/index.js'; type LogLevelNames = 'trace' | 'debug' | 'info' | 'warn' | 'error'; diff --git a/packages/core/src/utils/merge.spec.ts b/packages/core/src/utils/merge.spec.ts index d87e9fd6a..07f8f9070 100644 --- a/packages/core/src/utils/merge.spec.ts +++ b/packages/core/src/utils/merge.spec.ts @@ -1,9 +1,9 @@ import { expect, test } from 'vitest'; -import merge from './merge.js'; import { DEFAULT_DEV_SERVER_OPTIONS, DEFAULT_HMR_OPTIONS } from '../config/index.js'; +import merge from './merge.js'; test('merge - base', () => { const target = { a: 1, b: 2 }; diff --git a/packages/core/src/utils/merge.ts b/packages/core/src/utils/merge.ts index 993efa7cd..eed37a3f0 100644 --- a/packages/core/src/utils/merge.ts +++ b/packages/core/src/utils/merge.ts @@ -1,7 +1,7 @@ +import deepmerge, { Options } from 'deepmerge'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore ignore type check import { isPlainObject } from 'is-plain-object'; -import deepmerge, { Options } from 'deepmerge'; function isValueSameDeep(target: any, source: any): boolean { if (target === source) { diff --git a/packages/core/src/utils/plugin-utils.ts b/packages/core/src/utils/plugin-utils.ts index b2d84cd20..9c4fa8393 100644 --- a/packages/core/src/utils/plugin-utils.ts +++ b/packages/core/src/utils/plugin-utils.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import { isAbsolute, join } from 'node:path'; -import { CompilationContext } from '../plugin/type.js'; import { Alias } from '../config/types.js'; +import { CompilationContext } from '../plugin/type.js'; export const getAdditionContext = async ( cwd: string, diff --git a/packages/core/src/utils/publicDir.ts b/packages/core/src/utils/publicDir.ts index fa43836e8..443896bbe 100644 --- a/packages/core/src/utils/publicDir.ts +++ b/packages/core/src/utils/publicDir.ts @@ -1,9 +1,9 @@ -import path from 'path'; import fs from 'fs'; +import path from 'path'; import { UserConfig } from '../config/types.js'; +import { ERR_SYMLINK_IN_RECURSIVE_READDIR, recursiveReaddir } from './file.js'; import { withTrailingSlash } from './path.js'; import { normalizePath } from './share.js'; -import { ERR_SYMLINK_IN_RECURSIVE_READDIR, recursiveReaddir } from './file.js'; import { cleanUrl } from './url.js'; const publicFilesMap = new WeakMap>(); diff --git a/packages/core/src/utils/share.ts b/packages/core/src/utils/share.ts index fc54211ae..f57a23e00 100644 --- a/packages/core/src/utils/share.ts +++ b/packages/core/src/utils/share.ts @@ -1,8 +1,8 @@ +import fs from 'node:fs'; /* eslint-disable no-prototype-builtins */ import os from 'node:os'; -import fs from 'node:fs'; -import readline from 'node:readline'; import path, { dirname } from 'node:path'; +import readline from 'node:readline'; import { fileURLToPath } from 'node:url'; import { Config } from '../../binding/index.js'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment diff --git a/packages/core/src/watcher/config-watcher.ts b/packages/core/src/watcher/config-watcher.ts index 50cb75d63..de1cd661e 100644 --- a/packages/core/src/watcher/config-watcher.ts +++ b/packages/core/src/watcher/config-watcher.ts @@ -1,7 +1,7 @@ +import { existsSync } from 'fs'; import { FSWatcher } from 'chokidar'; import { ResolvedUserConfig } from '../config/index.js'; import { createWatcher } from './create-watcher.js'; -import { existsSync } from 'fs'; export class ConfigWatcher { private watcher: FSWatcher; diff --git a/packages/core/src/watcher/index.ts b/packages/core/src/watcher/index.ts index 50dea1d0a..fd07295bf 100644 --- a/packages/core/src/watcher/index.ts +++ b/packages/core/src/watcher/index.ts @@ -4,12 +4,12 @@ import { FSWatcher } from 'chokidar'; import { Compiler } from '../compiler/index.js'; import { Server } from '../server/index.js'; -import { compilerHandler, Logger } from '../utils/index.js'; +import { Logger, compilerHandler } from '../utils/index.js'; -import type { ResolvedUserConfig } from '../config/index.js'; -import { createWatcher } from './create-watcher.js'; import { existsSync } from 'node:fs'; import { JsUpdateResult } from '../../binding/binding.js'; +import type { ResolvedUserConfig } from '../config/index.js'; +import { createWatcher } from './create-watcher.js'; interface ImplFileWatcher { watch(): Promise; diff --git a/packages/core/tests/common.ts b/packages/core/tests/common.ts index 48e748d58..344b33d73 100644 --- a/packages/core/tests/common.ts +++ b/packages/core/tests/common.ts @@ -1,9 +1,9 @@ +import { fileURLToPath } from 'node:url'; import path from 'path'; import { Compiler } from '../src/compiler/index.js'; -import { JsPlugin } from '../src/plugin/type.js'; import { normalizeUserCompilationConfig } from '../src/config/index.js'; -import { fileURLToPath } from 'node:url'; import { Logger } from '../src/index.js'; +import { JsPlugin } from '../src/plugin/type.js'; export async function getCompiler( root: string, diff --git a/packages/core/tests/compile/json.spec.ts b/packages/core/tests/compile/json.spec.ts index c358a6e6f..c57f30b7a 100644 --- a/packages/core/tests/compile/json.spec.ts +++ b/packages/core/tests/compile/json.spec.ts @@ -1,7 +1,7 @@ -import { test, expect } from 'vitest'; -import { getCompiler, getFixturesDir, getOutputFilePath } from '../common.js'; -import path from 'path'; import { pathToFileURL } from 'node:url'; +import path from 'path'; +import { expect, test } from 'vitest'; +import { getCompiler, getFixturesDir, getOutputFilePath } from '../common.js'; test('Json compilation', async () => { const root = path.join(getFixturesDir(), 'json'); diff --git a/packages/core/tests/config.spec.ts b/packages/core/tests/config.spec.ts index 2def6950a..f1fb3652f 100644 --- a/packages/core/tests/config.spec.ts +++ b/packages/core/tests/config.spec.ts @@ -2,12 +2,12 @@ import path from 'path'; import { fileURLToPath } from 'url'; import { describe, expect, test } from 'vitest'; +import { parseUserConfig } from '../src/config/schema.js'; import { DEFAULT_DEV_SERVER_OPTIONS, normalizeDevServerOptions, resolveConfig } from '../src/index.js'; -import { parseUserConfig } from '../src/config/schema.js'; import { Logger } from '../src/utils/logger.js'; test('resolveUserConfig', async () => { diff --git a/packages/core/tests/config/index.spec.ts b/packages/core/tests/config/index.spec.ts index 1eb452f95..e0104ff9d 100644 --- a/packages/core/tests/config/index.spec.ts +++ b/packages/core/tests/config/index.spec.ts @@ -1,6 +1,6 @@ +import path from 'path'; import { describe, expect, test } from 'vitest'; import { mergeFarmCliConfig } from '../../src/config/mergeConfig.js'; -import path from 'path'; describe('mergeFarmCliConfig', () => { test('inlineOption.root not empty', () => { diff --git a/packages/core/tests/js-plugin-hooks/common.ts b/packages/core/tests/js-plugin-hooks/common.ts index 206294517..647f2c1f5 100644 --- a/packages/core/tests/js-plugin-hooks/common.ts +++ b/packages/core/tests/js-plugin-hooks/common.ts @@ -1,9 +1,9 @@ import path from 'node:path'; +import { JsPlugin } from '../../src/index.js'; import { getFixturesDir, getCompiler as getInternalCompiler } from '../common.js'; -import { JsPlugin } from '../../src/index.js'; export function getJsPluginsFixturesDir(hookName: string) { return path.resolve(getFixturesDir(), 'js-plugins-hooks', hookName); diff --git a/packages/core/tests/js-plugin-hooks/render-resource-pot.spec.ts b/packages/core/tests/js-plugin-hooks/render-resource-pot.spec.ts index e2c5d1658..a9c72a1bc 100644 --- a/packages/core/tests/js-plugin-hooks/render-resource-pot.spec.ts +++ b/packages/core/tests/js-plugin-hooks/render-resource-pot.spec.ts @@ -24,9 +24,8 @@ test('Js Plugin Execution - renderResourcePot', async () => { param.resourcePotInfo.modules['index.ts?foo=bar'] .originalLength == 52 ) { - param.resourcePotInfo.modules[ - 'index.ts?foo=bar' - ].originalLength = 51; + param.resourcePotInfo.modules['index.ts?foo=bar'].originalLength = + 51; } expect(param.resourcePotInfo).matchSnapshot(); calledHooks.push('renderResourcePot'); diff --git a/packages/core/tests/js-plugins.spec.ts b/packages/core/tests/js-plugins.spec.ts index 2f0cdbb36..64f4f49ff 100644 --- a/packages/core/tests/js-plugins.spec.ts +++ b/packages/core/tests/js-plugins.spec.ts @@ -1,11 +1,11 @@ import path from 'path'; import { pathToFileURL } from 'url'; import { expect, test } from 'vitest'; +import { JsPlugin } from '../src/index.js'; import { getFixturesDir, getCompiler as getInternalCompiler } from './common.js'; -import { JsPlugin } from '../src/index.js'; function getJsPluginsFixturesDir() { return path.resolve(getFixturesDir(), 'js-plugins'); @@ -182,7 +182,7 @@ test('Js Plugin Execution - full', async () => { filters: { resolvedPaths: [path.join(root, 'index.ts').replaceAll('\\', '\\\\')] }, - executor: async (param) => { + executor: async () => { return { content: 'import "./resolved?lang=ts&index=1"; export default 2;', moduleType: 'ts' diff --git a/packages/core/tsconfig.test.json b/packages/core/tsconfig.test.json index 360d3a638..ee182de01 100644 --- a/packages/core/tsconfig.test.json +++ b/packages/core/tsconfig.test.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig.json", "include": ["test/**"] -} \ No newline at end of file +} diff --git a/packages/create-farm-plugin/.eslintrc.json b/packages/create-farm-plugin/.eslintrc.json deleted file mode 100644 index bab954bfe..000000000 --- a/packages/create-farm-plugin/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./packages/create-farm-plugin/tsconfig.json"] - }, - "rules": {} -} diff --git a/packages/create-farm-plugin/farm.config.ts b/packages/create-farm-plugin/farm.config.ts index 38c0c27e5..95dea8a3d 100644 --- a/packages/create-farm-plugin/farm.config.ts +++ b/packages/create-farm-plugin/farm.config.ts @@ -7,6 +7,6 @@ export default defineConfig({ targetEnv: 'node' }, sourcemap: false, - presetEnv: false, + presetEnv: false } }); diff --git a/packages/create-farm-plugin/index.ts b/packages/create-farm-plugin/index.ts index e49a185c9..3af76e12c 100644 --- a/packages/create-farm-plugin/index.ts +++ b/packages/create-farm-plugin/index.ts @@ -1,8 +1,8 @@ #!/usr/bin/env node -import prompts from 'prompts'; -import minimist from 'minimist'; -import path from 'node:path'; import fs from 'node:fs'; +import path from 'node:path'; +import minimist from 'minimist'; +import prompts from 'prompts'; import { fileURLToPath } from 'node:url'; import { colors } from '@farmfe/utils/colors'; @@ -127,10 +127,15 @@ async function copyTemplate(targetDir: string, options: IResultType) { // Modify package.json to add dependencies const packageJsonPath = path.join(`${dest}/playground`, 'package.json'); if (fs.existsSync(packageJsonPath)) { - const packageJsonContent = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')); + const packageJsonContent = JSON.parse( + fs.readFileSync(packageJsonPath, 'utf-8') + ); // Modify the dependencies object as needed packageJsonContent.dependencies[options.pluginName] = 'workspace:*'; // Modify this line with your dependency and version - fs.writeFileSync(packageJsonPath, JSON.stringify(packageJsonContent, null, 2)); + fs.writeFileSync( + packageJsonPath, + JSON.stringify(packageJsonContent, null, 2) + ); } const runText = options.type === 'js' ? 'pnpm dev' : 'pnpm build'; diff --git a/packages/create-farm-plugin/package.json b/packages/create-farm-plugin/package.json index 13c303e31..b692d31ca 100644 --- a/packages/create-farm-plugin/package.json +++ b/packages/create-farm-plugin/package.json @@ -28,11 +28,7 @@ "build tool", "bundler" ], - "files": [ - "bin", - "dist", - "templates" - ], + "files": ["bin", "dist", "templates"], "repository": { "type": "git", "url": "https://github.com/farm-fe/farm" diff --git a/packages/create-farm/.eslintrc.json b/packages/create-farm/.eslintrc.json deleted file mode 100644 index 7b0717f90..000000000 --- a/packages/create-farm/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./packages/create-farm/tsconfig.json"] - }, - "rules": {} -} diff --git a/packages/create-farm/farm.config.ts b/packages/create-farm/farm.config.ts index 38c0c27e5..95dea8a3d 100644 --- a/packages/create-farm/farm.config.ts +++ b/packages/create-farm/farm.config.ts @@ -7,6 +7,6 @@ export default defineConfig({ targetEnv: 'node' }, sourcemap: false, - presetEnv: false, + presetEnv: false } }); diff --git a/packages/create-farm/index.ts b/packages/create-farm/index.ts index 0216b4afa..f59f857c1 100644 --- a/packages/create-farm/index.ts +++ b/packages/create-farm/index.ts @@ -1,16 +1,16 @@ #!/usr/bin/env node -import prompts from 'prompts'; -import minimist from 'minimist'; -import path from 'node:path'; import fs from 'node:fs'; +import path from 'node:path'; import spawn from 'cross-spawn'; +import minimist from 'minimist'; +import prompts from 'prompts'; import { fileURLToPath } from 'node:url'; import { colors } from './utils/color.js'; -import { loadWithRocketGradient } from './utils/gradient.js'; import createSpawnCmd from './utils/createSpawnCmd.js'; -import { shouldUseYarn, shouldUsePnpm } from './utils/packageManager.js'; +import { loadWithRocketGradient } from './utils/gradient.js'; +import { shouldUsePnpm, shouldUseYarn } from './utils/packageManager.js'; interface IResultType { packageName?: string; diff --git a/packages/create-farm/package.json b/packages/create-farm/package.json index 1a6b13db5..013eabb0d 100644 --- a/packages/create-farm/package.json +++ b/packages/create-farm/package.json @@ -25,10 +25,7 @@ "build tool", "web bundler" ], - "files": [ - "dist", - "templates" - ], + "files": ["dist", "templates"], "repository": { "type": "git", "url": "https://github.com/farm-fe/farm" diff --git a/packages/create-farm/utils/packageManager.ts b/packages/create-farm/utils/packageManager.ts index a2ae94943..591dc99af 100644 --- a/packages/create-farm/utils/packageManager.ts +++ b/packages/create-farm/utils/packageManager.ts @@ -8,7 +8,7 @@ export function shouldUsePnpm(): boolean { } execSync('pnpm --version', { stdio: 'ignore' }); return true; - } catch (e) { + } catch { return false; } } @@ -21,7 +21,7 @@ export function shouldUseYarn(): boolean { } execSync('yarnpkg --version', { stdio: 'ignore' }); return true; - } catch (e) { + } catch { return false; } } diff --git a/packages/plugin-tools/.eslintrc.json b/packages/plugin-tools/.eslintrc.json deleted file mode 100644 index 71eb58c83..000000000 --- a/packages/plugin-tools/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./packages/plugin-tools/tsconfig.json"] - }, - "rules": {} -} diff --git a/packages/plugin-tools/package.json b/packages/plugin-tools/package.json index 9189bf560..c4ed508c0 100644 --- a/packages/plugin-tools/package.json +++ b/packages/plugin-tools/package.json @@ -28,9 +28,7 @@ "build tool", "bundler" ], - "files": [ - "dist" - ], + "files": ["dist"], "repository": { "type": "git", "url": "https://github.com/farm-fe/farm" diff --git a/packages/plugin-tools/src/copy-artifacts.ts b/packages/plugin-tools/src/copy-artifacts.ts index 88664f85c..d0e359c73 100644 --- a/packages/plugin-tools/src/copy-artifacts.ts +++ b/packages/plugin-tools/src/copy-artifacts.ts @@ -1,5 +1,5 @@ -import { copyFile } from 'fs/promises'; import path from 'path'; +import { copyFile } from 'fs/promises'; export const copyArtifacts = async (abi?: string) => { if (!abi) { diff --git a/packages/plugin-tools/src/index.ts b/packages/plugin-tools/src/index.ts index 463aa80b6..88899a431 100644 --- a/packages/plugin-tools/src/index.ts +++ b/packages/plugin-tools/src/index.ts @@ -1,5 +1,5 @@ -import { cac } from 'cac'; import { createSpawnCmd } from '@farmfe/utils'; +import { cac } from 'cac'; import { resolveNapiRsCli } from './resolve-napi-rs-cli.js'; @@ -39,7 +39,7 @@ cli try { const spawn = createSpawnCmd(process.cwd(), 'inherit'); await spawn('node', [cliPath, 'build', ...args]); - } catch (e) { + } catch { process.exit(1); } diff --git a/packages/plugin-tools/src/prepublish.ts b/packages/plugin-tools/src/prepublish.ts index b0108fe5d..3a41d734c 100644 --- a/packages/plugin-tools/src/prepublish.ts +++ b/packages/plugin-tools/src/prepublish.ts @@ -1,6 +1,6 @@ import { execSync } from 'child_process'; -import path from 'node:path'; import fs from 'node:fs/promises'; +import path from 'node:path'; /** * Farm plugin prepublish command, publish all packages under npm directory diff --git a/packages/runtime-plugin-hmr/.eslintrc.json b/packages/runtime-plugin-hmr/.eslintrc.json deleted file mode 100644 index 4965d6f1f..000000000 --- a/packages/runtime-plugin-hmr/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./packages/runtime-plugin-hmr/tsconfig.json"] - }, - "rules": {} -} diff --git a/packages/runtime-plugin-hmr/src/hmr-client.ts b/packages/runtime-plugin-hmr/src/hmr-client.ts index 01dec31fb..53bbd228a 100644 --- a/packages/runtime-plugin-hmr/src/hmr-client.ts +++ b/packages/runtime-plugin-hmr/src/hmr-client.ts @@ -1,8 +1,8 @@ import type { ModuleSystem } from '@farmfe/runtime'; -import { HMRPayload, HmrUpdateResult, RawHmrUpdateResult } from './types'; import { HotModuleState } from './hot-module-state'; import { logger } from './logger'; import { ErrorOverlay, overlayId } from './overlay'; +import { HMRPayload, HmrUpdateResult, RawHmrUpdateResult } from './types'; // Inject during compile time const hmrPort = Number(FARM_HMR_PORT); diff --git a/packages/runtime-plugin-hmr/src/index.ts b/packages/runtime-plugin-hmr/src/index.ts index dc8db5d3f..dade75959 100644 --- a/packages/runtime-plugin-hmr/src/index.ts +++ b/packages/runtime-plugin-hmr/src/index.ts @@ -2,12 +2,12 @@ * HMR client as a Farm Runtime Plugin */ import type { Plugin } from '@farmfe/runtime'; -import { createHotContext } from './hot-module-state'; import { HmrClient } from './hmr-client'; +import { createHotContext } from './hot-module-state'; let hmrClient: HmrClient; -export default { +export default ({ name: 'farm-runtime-hmr-client-plugin', bootstrap(moduleSystem) { hmrClient = new HmrClient(moduleSystem); @@ -17,4 +17,4 @@ export default { // create a hot context for each module module.meta.hot = createHotContext(module.id, hmrClient); } -}; +}); diff --git a/packages/runtime-plugin-import-meta/.eslintrc.json b/packages/runtime-plugin-import-meta/.eslintrc.json deleted file mode 100644 index 257380f8a..000000000 --- a/packages/runtime-plugin-import-meta/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./packages/runtime-plugin-import-meta/tsconfig.json"] - }, - "rules": {} -} diff --git a/packages/runtime-plugin-import-meta/src/index.ts b/packages/runtime-plugin-import-meta/src/index.ts index 402201365..a52fd766c 100644 --- a/packages/runtime-plugin-import-meta/src/index.ts +++ b/packages/runtime-plugin-import-meta/src/index.ts @@ -1,8 +1,8 @@ -import type { Plugin, ModuleSystem } from '@farmfe/runtime'; +import type { ModuleSystem, Plugin } from '@farmfe/runtime'; const __global_this__ = typeof globalThis !== 'undefined' ? globalThis : window; -export default { +export default ({ name: 'farm-runtime-import-meta', _moduleSystem: {} as ModuleSystem, bootstrap(system: ModuleSystem) { @@ -10,7 +10,7 @@ export default { }, moduleCreated(module) { module.meta.env = { - ...(FARM_PROCESS_ENV ?? {}), + ...((FARM_PROCESS_ENV) ?? {}), mode: process.env.NODE_ENV, dev: process.env.NODE_ENV === 'development', prod: process.env.NODE_ENV === 'production' @@ -20,10 +20,10 @@ export default { const { location } = __global_this__; const url = location ? `${location.protocol}//${location.host}${publicPath.replace( - /\/$/, - '' - )}/${module.id}?t=${Date.now()}` + /\/$/, + '' + )}/${module.id}?t=${Date.now()}` : module.resource_pot; module.meta.url = url; } -}; +}); diff --git a/packages/runtime/.eslintrc.json b/packages/runtime/.eslintrc.json deleted file mode 100644 index de0d60273..000000000 --- a/packages/runtime/.eslintrc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./packages/runtime/tsconfig.json"] - } -} diff --git a/packages/utils/.eslintrc.json b/packages/utils/.eslintrc.json deleted file mode 100644 index 0bd8de397..000000000 --- a/packages/utils/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./packages/utils/tsconfig.json"] - }, - "rules": {} -} diff --git a/packages/utils/package.json b/packages/utils/package.json index 30dc89bb6..2cf312330 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -36,7 +36,5 @@ "dev-server", "hmr" ], - "files": [ - "dist" - ] + "files": ["dist"] } diff --git a/packages/utils/src/spawn.ts b/packages/utils/src/spawn.ts index 2adcd94d0..b6cbc296e 100644 --- a/packages/utils/src/spawn.ts +++ b/packages/utils/src/spawn.ts @@ -1,4 +1,4 @@ -import { spawn, StdioOptions } from 'child_process'; +import { StdioOptions, spawn } from 'child_process'; export function createSpawnCmd(dest: string, stdio: StdioOptions = 'inherit') { return function (cmd: string, args?: string[]): Promise { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 626534362..8184d59b8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,6 +16,9 @@ importers: .: devDependencies: + '@biomejs/biome': + specifier: 1.7.2 + version: 1.7.2 '@changesets/cli': specifier: ^2.26.0 version: 2.26.2 @@ -28,12 +31,6 @@ importers: '@types/node': specifier: ^18.0.1 version: 18.18.8 - '@typescript-eslint/eslint-plugin': - specifier: ^5.30.5 - version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.53.0)(typescript@4.9.5) - '@typescript-eslint/parser': - specifier: ^5.30.5 - version: 5.62.0(eslint@8.53.0)(typescript@4.9.5) '@vitest/coverage-v8': specifier: ^0.33.0 version: 0.33.0(vitest@1.4.0) @@ -43,15 +40,12 @@ importers: cspell: specifier: ^6.2.2 version: 6.31.3 - eslint: - specifier: ^8.19.0 - version: 8.53.0 - eslint-config-prettier: - specifier: ^8.5.0 - version: 8.10.0(eslint@8.53.0) execa: specifier: ^7.1.1 version: 7.2.0 + husky: + specifier: ^9.0.11 + version: 9.0.11 lint-staged: specifier: ^13.0.3 version: 13.3.0 @@ -61,24 +55,12 @@ importers: playwright-chromium: specifier: ^1.42.1 version: 1.42.1 - prettier: - specifier: ^2.7.1 - version: 2.8.8 - prettier-eslint: - specifier: ^15.0.1 - version: 15.0.1 - prettier-eslint-cli: - specifier: ^7.1.0 - version: 7.1.0(prettier-eslint@15.0.1) rimraf: specifier: ^3.0.2 version: 3.0.2 rollup: specifier: ^3.29.4 version: 3.29.4 - simple-git-hooks: - specifier: ^2.10.0 - version: 2.10.0 typescript: specifier: ^4.9.4 version: 4.9.5 @@ -89,15 +71,6 @@ importers: specifier: ^1.4.0 version: 1.4.0(@types/node@18.18.8) - examples/api: - devDependencies: - '@farmfe/cli': - specifier: workspace:^ - version: link:../../packages/cli - '@farmfe/core': - specifier: workspace:* - version: link:../../packages/core - examples/arco-pro: dependencies: '@antv/data-set': @@ -2120,11 +2093,6 @@ importers: packages: - /@aashutoshrathi/word-wrap@1.2.6: - resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} - engines: {node: '>=0.10.0'} - dev: true - /@alloc/quick-lru@5.2.0: resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} @@ -3169,6 +3137,94 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true + /@biomejs/biome@1.7.2: + resolution: {integrity: sha512-6Skx9N47inLQzYi9RKgJ7PBnUnaHnMe/imqX43cOcJjZtfMnQLxEvfM2Eyo7gChkwrZlwc+VbA4huFRjw2fsYA==} + engines: {node: '>=14.21.3'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@biomejs/cli-darwin-arm64': 1.7.2 + '@biomejs/cli-darwin-x64': 1.7.2 + '@biomejs/cli-linux-arm64': 1.7.2 + '@biomejs/cli-linux-arm64-musl': 1.7.2 + '@biomejs/cli-linux-x64': 1.7.2 + '@biomejs/cli-linux-x64-musl': 1.7.2 + '@biomejs/cli-win32-arm64': 1.7.2 + '@biomejs/cli-win32-x64': 1.7.2 + dev: true + + /@biomejs/cli-darwin-arm64@1.7.2: + resolution: {integrity: sha512-CrldIueHivWEWmeTkK8bTXajeX53F8i2Rrkkt8cPZyMtzkrwxf8Riq4a/jz3SQBHkxHFT4TqGbSTNMXe3X1ogA==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-darwin-x64@1.7.2: + resolution: {integrity: sha512-UELnLJuJOsTL9meArvn8BtiXDURyPil2Ej9me2uVpEvee8UQdqd/bssP5we400OWShlL1AAML4fn6d2WX5332g==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-arm64-musl@1.7.2: + resolution: {integrity: sha512-kKYZiem7Sj7wI0dpVxJlK7C+TFQwzO/ctufIGXGJAyEmUe9vEKSzV8CXpv+JIRiTWyqaZJ4K+eHz4SPdPCv05w==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-arm64@1.7.2: + resolution: {integrity: sha512-Z1CSGQE6fHz55gkiFHv9E8wEAaSUd7dHSRaxSCBa7utonHqpIeMbvj3Evm1w0WfGLFDtRXLV1fTfEdM0FMTOhA==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-x64-musl@1.7.2: + resolution: {integrity: sha512-x10LpGMepDrLS+h2TZ6/T7egpHjGKtiI4GuShNylmBQJWfTotbFf9eseHggrqJ4WZf9yrGoVYrtbxXftuB95sQ==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-x64@1.7.2: + resolution: {integrity: sha512-vXXyox8/CQijBxAu0+r8FfSO7JlC4tob3PbaFda8gPJFRz2uFJw39HtxVUwbTV1EcU6wSPh4SiRu5sZfP1VHrQ==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-win32-arm64@1.7.2: + resolution: {integrity: sha512-kRXdlKzcU7INf6/ldu0nVmkOgt7bKqmyXRRCUqqaJfA32+9InTbkD8tGrHZEVYIWr+eTuKcg16qZVDsPSDFZ8g==} + engines: {node: '>=14.21.3'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-win32-x64@1.7.2: + resolution: {integrity: sha512-qHTtpAs+CNglAAuaTy09htoqUhrQyd3nd0aGTuLNqD10h1llMVi8WFZfoa+e5MuDSfYtMK6nW2Tbf6WgzzR1Qw==} + engines: {node: '>=14.21.3'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@bufbuild/protobuf@1.4.1: resolution: {integrity: sha512-4dthhwBGD9nlpY35ic8dMQC5R0dsND2b2xyeVO3qf+hBk8m7Y9dUs+SmMh6rqO2pGLUTKHefGXLDW+z19hBPdQ==} dev: true @@ -4119,43 +4175,6 @@ packages: requiresBuild: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.53.0): - resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - dependencies: - eslint: 8.53.0 - eslint-visitor-keys: 3.4.3 - dev: true - - /@eslint-community/regexpp@4.10.0: - resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} - engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - dev: true - - /@eslint/eslintrc@2.1.3: - resolution: {integrity: sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - ajv: 6.12.6 - debug: 4.3.4 - espree: 9.6.1 - globals: 13.23.0 - ignore: 5.2.4 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - dev: true - - /@eslint/js@8.53.0: - resolution: {integrity: sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - /@floating-ui/core@1.5.0: resolution: {integrity: sha512-kK1h4m36DQ0UHGj5Ah4db7R0rHemTqqO0QLvUqi1/mUUp3LuAWbWxdxSIf/XsnH9VS6rRVPLJCncjRzUvyCLXg==} dependencies: @@ -4188,26 +4207,6 @@ packages: vue-demi: 0.14.7(vue@3.4.15) dev: false - /@humanwhocodes/config-array@0.11.13: - resolution: {integrity: sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==} - engines: {node: '>=10.10.0'} - dependencies: - '@humanwhocodes/object-schema': 2.0.1 - debug: 4.3.4 - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - dev: true - - /@humanwhocodes/module-importer@1.0.1: - resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} - engines: {node: '>=12.22'} - dev: true - - /@humanwhocodes/object-schema@2.0.1: - resolution: {integrity: sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==} - dev: true - /@icons/material@0.2.4(react@17.0.2): resolution: {integrity: sha512-QPcGmICAPbGLGb6F/yNf/KzKqvFx8z5qx3D1yFqVAjoFmXK35EgyW+cJ57Te3CNsmzblwtzakLGFqHPqrfb4Tw==} peerDependencies: @@ -4342,37 +4341,6 @@ packages: resolution: {integrity: sha512-DoHTZ/TjtNfUu9eiqJd+x3IcCQrhS+yOYU436TKUnlE36jZwNbK535D1CmTsSYdi/UcdCWNm5KRQZ9g1tlZCPw==} dev: false - /@messageformat/core@3.2.0: - resolution: {integrity: sha512-ppbb/7OYqg/t4WdFk8VAfZEV2sNUq3+7VeBAo5sKFhmF786sh6gB7fUeXa2qLTDIcTHS49HivTBN7QNOU5OFTg==} - dependencies: - '@messageformat/date-skeleton': 1.0.1 - '@messageformat/number-skeleton': 1.2.0 - '@messageformat/parser': 5.1.0 - '@messageformat/runtime': 3.0.1 - make-plural: 7.3.0 - safe-identifier: 0.4.2 - dev: true - - /@messageformat/date-skeleton@1.0.1: - resolution: {integrity: sha512-jPXy8fg+WMPIgmGjxSlnGJn68h/2InfT0TNSkVx0IGXgp4ynnvYkbZ51dGWmGySEK+pBiYUttbQdu5XEqX5CRg==} - dev: true - - /@messageformat/number-skeleton@1.2.0: - resolution: {integrity: sha512-xsgwcL7J7WhlHJ3RNbaVgssaIwcEyFkBqxHdcdaiJzwTZAWEOD8BuUFxnxV9k5S0qHN3v/KzUpq0IUpjH1seRg==} - dev: true - - /@messageformat/parser@5.1.0: - resolution: {integrity: sha512-jKlkls3Gewgw6qMjKZ9SFfHUpdzEVdovKFtW1qRhJ3WI4FW5R/NnGDqr8SDGz+krWDO3ki94boMmQvGke1HwUQ==} - dependencies: - moo: 0.5.2 - dev: true - - /@messageformat/runtime@3.0.1: - resolution: {integrity: sha512-6RU5ol2lDtO8bD9Yxe6CZkl0DArdv0qkuoZC+ZwowU+cdRlVE1157wjCmlA5Rsf1Xc/brACnsZa5PZpEDfTFFg==} - dependencies: - make-plural: 7.3.0 - dev: true - /@monaco-editor/loader@1.4.0: resolution: {integrity: sha512-00ioBig0x642hytVspPl7DbQyaSWRaolYie/UFNjoTdvoKPzo6xrXLhTk9ixgIKcLH5b5vDOjVNiGyY+uDCUlg==} peerDependencies: @@ -6041,13 +6009,6 @@ packages: resolution: {integrity: sha512-qzV1XMjmzgmndci6L5HlzExf4w9A5jQPNpW/t4sSljErKbS8y6231ToHO9ir2Xjf+2zG1C540+Wmh0zpUsGu0A==} dev: true - /@types/eslint@8.44.6: - resolution: {integrity: sha512-P6bY56TVmX8y9J87jHNgQh43h6VVU+6H7oN7hgvivV81K2XY8qJZ5vqPy/HdUoVIelii2kChYVzQanlswPWVFw==} - dependencies: - '@types/estree': 1.0.5 - '@types/json-schema': 7.0.14 - dev: true - /@types/estree@1.0.4: resolution: {integrity: sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==} @@ -6118,10 +6079,6 @@ packages: resolution: {integrity: sha512-zONci81DZYCZjiLe0r6equvZut0b+dBRPBN5kBDjsONnutYNtJMoWQ9uR2RkL1gLG9NMTzvf+29e5RFfPbeKhQ==} dev: true - /@types/json-schema@7.0.14: - resolution: {integrity: sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==} - dev: true - /@types/jsonfile@6.1.3: resolution: {integrity: sha512-/yqTk2SZ1wIezK0hiRZD7RuSf4B3whFxFamB1kGStv+8zlWScTMcHanzfc0XKWs5vA1TkHeckBlOyM8jxU8nHA==} dependencies: @@ -6262,10 +6219,6 @@ packages: postcss: 8.4.38 dev: true - /@types/prettier@2.7.3: - resolution: {integrity: sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==} - dev: true - /@types/prompts@2.4.7: resolution: {integrity: sha512-5zTamE+QQM4nR6Ab3yHK+ovWuhLJXaa2ZLt3mT1en8U3ubWtjVT1vXDaVFC2+cL89uVn7Y+gIq5B3IcVvBl5xQ==} dependencies: @@ -6376,140 +6329,6 @@ packages: dependencies: '@types/node': 18.18.8 - /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.53.0)(typescript@4.9.5): - resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 5.62.0(eslint@8.53.0)(typescript@4.9.5) - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.53.0)(typescript@4.9.5) - '@typescript-eslint/utils': 5.62.0(eslint@8.53.0)(typescript@4.9.5) - debug: 4.3.4 - eslint: 8.53.0 - graphemer: 1.4.0 - ignore: 5.2.4 - natural-compare-lite: 1.4.0 - semver: 7.5.4 - tsutils: 3.21.0(typescript@4.9.5) - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/parser@5.62.0(eslint@8.53.0)(typescript@4.9.5): - resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) - debug: 4.3.4 - eslint: 8.53.0 - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/scope-manager@5.62.0: - resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 - dev: true - - /@typescript-eslint/type-utils@5.62.0(eslint@8.53.0)(typescript@4.9.5): - resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: '*' - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) - '@typescript-eslint/utils': 5.62.0(eslint@8.53.0)(typescript@4.9.5) - debug: 4.3.4 - eslint: 8.53.0 - tsutils: 3.21.0(typescript@4.9.5) - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/types@5.62.0: - resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /@typescript-eslint/typescript-estree@5.62.0(typescript@4.9.5): - resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/visitor-keys': 5.62.0 - debug: 4.3.4 - globby: 11.1.0 - is-glob: 4.0.3 - semver: 7.5.4 - tsutils: 3.21.0(typescript@4.9.5) - typescript: 4.9.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/utils@5.62.0(eslint@8.53.0)(typescript@4.9.5): - resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.53.0) - '@types/json-schema': 7.0.14 - '@types/semver': 7.5.4 - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) - eslint: 8.53.0 - eslint-scope: 5.1.1 - semver: 7.5.4 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/visitor-keys@5.62.0: - resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - '@typescript-eslint/types': 5.62.0 - eslint-visitor-keys: 3.4.3 - dev: true - - /@ungap/structured-clone@1.2.0: - resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - dev: true - /@vitejs/plugin-vue-jsx@3.1.0(vite@5.2.8)(vue@3.3.7): resolution: {integrity: sha512-w9M6F3LSEU5kszVb9An2/MmXNxocAnUb3WhRr8bHlimhDrXNt6n6D2nJQR3UXpGlZHh/EsgouOHCsM8V3Ln+WA==} engines: {node: ^14.18.0 || >=16.0.0} @@ -7167,14 +6986,6 @@ packages: mime-types: 2.1.35 negotiator: 0.6.3 - /acorn-jsx@5.3.2(acorn@8.11.2): - resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} - peerDependencies: - acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - acorn: 8.11.2 - dev: true - /acorn-walk@8.3.2: resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} engines: {node: '>=0.4.0'} @@ -7199,15 +7010,6 @@ packages: resolution: {integrity: sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==} engines: {node: '>=0.8'} - /ajv@6.12.6: - resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - dependencies: - fast-deep-equal: 3.1.3 - fast-json-stable-stringify: 2.1.0 - json-schema-traverse: 0.4.1 - uri-js: 4.4.1 - dev: true - /ajv@8.11.0: resolution: {integrity: sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==} dependencies: @@ -7277,11 +7079,7 @@ packages: /ansi-regex@3.0.1: resolution: {integrity: sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==} engines: {node: '>=4'} - - /ansi-regex@4.1.1: - resolution: {integrity: sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==} - engines: {node: '>=6'} - dev: true + dev: false /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} @@ -7560,11 +7358,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /arrify@2.0.1: - resolution: {integrity: sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==} - engines: {node: '>=8'} - dev: true - /assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true @@ -7886,10 +7679,6 @@ packages: /boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} - /boolify@1.0.1: - resolution: {integrity: sha512-ma2q0Tc760dW54CdOyJjhrg/a54317o1zYADQJFgperNGKIKgAUGIcKnuMiff8z57+yGlrGNEt4lPgZfCgTJgA==} - dev: true - /boxen@7.0.0: resolution: {integrity: sha512-j//dBVuyacJbvW+tvZ9HuH03fZ46QcaKvvhZickZqtB271DxJ7SNRSNxrV/dZX0085m7hISRZWbzWlJvx/rHSg==} engines: {node: '>=14.16'} @@ -8095,16 +7884,6 @@ packages: quick-lru: 4.0.1 dev: true - /camelcase-keys@7.0.2: - resolution: {integrity: sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==} - engines: {node: '>=12'} - dependencies: - camelcase: 6.3.0 - map-obj: 4.3.0 - quick-lru: 5.1.1 - type-fest: 1.4.0 - dev: true - /camelcase@1.2.1: resolution: {integrity: sha512-wzLkDa4K/mzI1OSITC+DUyjgIl/ETNHE9QvYgy6J6Jvqyyz4C0Xfd+lQhb19sX2jMpZV4IssUn0VDVmglV+s4g==} engines: {node: '>=0.10.0'} @@ -8324,14 +8103,6 @@ packages: wordwrap: 0.0.2 dev: false - /cliui@5.0.0: - resolution: {integrity: sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==} - dependencies: - string-width: 3.1.0 - strip-ansi: 5.2.0 - wrap-ansi: 5.1.0 - dev: true - /cliui@6.0.0: resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} dependencies: @@ -8489,11 +8260,6 @@ packages: repeat-string: 1.6.1 dev: true - /common-tags@1.8.2: - resolution: {integrity: sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==} - engines: {node: '>=4.0.0'} - dev: true - /compare-func@2.0.0: resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==} dependencies: @@ -9574,10 +9340,6 @@ packages: engines: {node: '>=4.0.0'} dev: true - /deep-is@0.1.4: - resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} - dev: true - /deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} @@ -9726,13 +9488,6 @@ packages: resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} dev: true - /doctrine@3.0.0: - resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} - engines: {node: '>=6.0.0'} - dependencies: - esutils: 2.0.3 - dev: true - /dom-align@1.12.4: resolution: {integrity: sha512-R8LUSEay/68zE5c8/3BDxiTEvgb4xZTF0RKmAHfiEVN3klfIpXfi2/QCoiWPccVQ0J/ZGdz9OjzL4uJEP/MRAw==} dev: false @@ -9869,10 +9624,6 @@ packages: - '@vue/composition-api' dev: false - /emoji-regex@7.0.3: - resolution: {integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==} - dev: true - /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -10077,97 +9828,12 @@ packages: /escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} + dev: false /escape-string-regexp@5.0.0: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} - /eslint-config-prettier@8.10.0(eslint@8.53.0): - resolution: {integrity: sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==} - hasBin: true - peerDependencies: - eslint: '>=7.0.0' - dependencies: - eslint: 8.53.0 - dev: true - - /eslint-scope@5.1.1: - resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} - engines: {node: '>=8.0.0'} - dependencies: - esrecurse: 4.3.0 - estraverse: 4.3.0 - dev: true - - /eslint-scope@7.2.2: - resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - esrecurse: 4.3.0 - estraverse: 5.3.0 - dev: true - - /eslint-visitor-keys@3.4.3: - resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dev: true - - /eslint@8.53.0: - resolution: {integrity: sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - hasBin: true - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.53.0) - '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 2.1.3 - '@eslint/js': 8.53.0 - '@humanwhocodes/config-array': 0.11.13 - '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.2.0 - ajv: 6.12.6 - chalk: 4.1.2 - cross-spawn: 7.0.3 - debug: 4.3.4 - doctrine: 3.0.0 - escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 - esquery: 1.5.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 - find-up: 5.0.0 - glob-parent: 6.0.2 - globals: 13.23.0 - graphemer: 1.4.0 - ignore: 5.2.4 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - is-path-inside: 3.0.3 - js-yaml: 4.1.0 - json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 - natural-compare: 1.4.0 - optionator: 0.9.3 - strip-ansi: 6.0.1 - text-table: 0.2.0 - transitivePeerDependencies: - - supports-color - dev: true - - /espree@9.6.1: - resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - dependencies: - acorn: 8.11.2 - acorn-jsx: 5.3.2(acorn@8.11.2) - eslint-visitor-keys: 3.4.3 - dev: true - /esprima-extract-comments@1.1.0: resolution: {integrity: sha512-sBQUnvJwpeE9QnPrxh7dpI/dp67erYG4WXEAreAMoelPRpMR7NWb4YtwRPn9b+H1uLQKl/qS8WYmyaljTpjIsw==} engines: {node: '>=4'} @@ -10181,30 +9847,6 @@ packages: hasBin: true dev: true - /esquery@1.5.0: - resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} - engines: {node: '>=0.10'} - dependencies: - estraverse: 5.3.0 - dev: true - - /esrecurse@4.3.0: - resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} - engines: {node: '>=4.0'} - dependencies: - estraverse: 5.3.0 - dev: true - - /estraverse@4.3.0: - resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} - engines: {node: '>=4.0'} - dev: true - - /estraverse@5.3.0: - resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} - engines: {node: '>=4.0'} - dev: true - /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} @@ -10214,11 +9856,6 @@ packages: '@types/estree': 1.0.5 dev: true - /esutils@2.0.3: - resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} - engines: {node: '>=0.10.0'} - dev: true - /etag@1.8.1: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} engines: {node: '>= 0.6'} @@ -10424,10 +10061,6 @@ packages: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} dev: true - /fast-levenshtein@2.0.6: - resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - dev: true - /fast-url-parser@1.1.3: resolution: {integrity: sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ==} dependencies: @@ -10508,13 +10141,6 @@ packages: resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==} dev: false - /find-up@3.0.0: - resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} - engines: {node: '>=6'} - dependencies: - locate-path: 3.0.0 - dev: true - /find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -10825,13 +10451,6 @@ packages: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} - /globals@13.23.0: - resolution: {integrity: sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==} - engines: {node: '>=8'} - dependencies: - type-fest: 0.20.2 - dev: true - /globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} engines: {node: '>= 0.4'} @@ -10881,10 +10500,6 @@ packages: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} dev: true - /graphemer@1.4.0: - resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} - dev: true - /graphlib@2.1.8: resolution: {integrity: sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==} dependencies: @@ -11123,6 +10738,12 @@ packages: engines: {node: '>=16.17.0'} dev: true + /husky@9.0.11: + resolution: {integrity: sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==} + engines: {node: '>=18'} + hasBin: true + dev: true + /iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} @@ -11384,6 +11005,7 @@ packages: /is-fullwidth-code-point@2.0.0: resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==} engines: {node: '>=4'} + dev: false /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} @@ -11455,11 +11077,6 @@ packages: engines: {node: '>=8'} dev: true - /is-path-inside@3.0.3: - resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} - engines: {node: '>=8'} - dev: true - /is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} @@ -11710,18 +11327,10 @@ packages: /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - /json-schema-traverse@0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} - dev: true - /json-schema-traverse@1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} dev: true - /json-stable-stringify-without-jsonify@1.0.1: - resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} - dev: true - /json2module@0.0.3: resolution: {integrity: sha512-qYGxqrRrt4GbB8IEOy1jJGypkNsjWoIMlZt4bAsmUScCA507Hbc2p1JOhBzqn45u3PWafUgH2OnzyNU7udO/GA==} hasBin: true @@ -11936,14 +11545,6 @@ packages: - supports-color dev: true - /levn@0.4.1: - resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} - engines: {node: '>= 0.8.0'} - dependencies: - prelude-ls: 1.2.1 - type-check: 0.4.0 - dev: true - /lie@3.3.0: resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==} dependencies: @@ -12031,14 +11632,6 @@ packages: resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} dev: true - /locate-path@3.0.0: - resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} - engines: {node: '>=6'} - dependencies: - p-locate: 3.0.0 - path-exists: 3.0.0 - dev: true - /locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -12088,10 +11681,6 @@ packages: resolution: {integrity: sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==} dev: true - /lodash.memoize@4.1.2: - resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} - dev: true - /lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} dev: true @@ -12146,16 +11735,10 @@ packages: wrap-ansi: 8.1.0 dev: true - /loglevel-colored-level-prefix@1.0.0: - resolution: {integrity: sha512-u45Wcxxc+SdAlh4yeF/uKlC1SPUPCy0gullSNKXod5I4bmifzk+Q4lSLExNEVn19tGaJipbZ4V4jbFn79/6mVA==} - dependencies: - chalk: 1.1.3 - loglevel: 1.8.1 - dev: true - /loglevel@1.8.1: resolution: {integrity: sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg==} engines: {node: '>= 0.6.0'} + dev: false /longest@1.0.1: resolution: {integrity: sha512-k+yt5n3l48JU4k8ftnKG6V7u32wyH2NfKzeMto9F/QRE0amxy/LayxwlvjjkZEIzqR+19IrtFO8p5kB9QaYUFg==} @@ -12245,10 +11828,6 @@ packages: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: true - /make-plural@7.3.0: - resolution: {integrity: sha512-/K3BC0KIsO+WK2i94LkMPv3wslMrazrQhfi5We9fMbLlLjzoOSJWr7TAdupLlDWaJcWxwoNosBkhFDejiu5VDw==} - dev: true - /map-cache@0.2.2: resolution: {integrity: sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==} engines: {node: '>=0.10.0'} @@ -12532,10 +12111,6 @@ packages: commander: 11.1.0 dev: false - /moo@0.5.2: - resolution: {integrity: sha512-iSAJLHYKnX41mKcJKjqvnAN9sf0LMDTXDEvFv+ffuRR9a1MIuXLjMNL6EsnDHSkKLTWNqQQ5uo61P4EbU4NU+Q==} - dev: true - /mri@1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -12613,14 +12188,6 @@ packages: picocolors: 1.0.0 dev: true - /natural-compare-lite@1.4.0: - resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} - dev: true - - /natural-compare@1.4.0: - resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} - dev: true - /needle@3.2.0: resolution: {integrity: sha512-oUvzXnyLiVyVGoianLijF9O/RecZUf7TkBfimjGrLM4eQhXyeJwM6GeAWccwfQ9aa4gMCZKqhAOuLaMIcQxajQ==} engines: {node: '>= 4.4.x'} @@ -12874,18 +12441,6 @@ packages: pinkie-promise: 2.0.1 dev: false - /optionator@0.9.3: - resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} - engines: {node: '>= 0.8.0'} - dependencies: - '@aashutoshrathi/word-wrap': 1.2.6 - deep-is: 0.1.4 - fast-levenshtein: 2.0.6 - levn: 0.4.1 - prelude-ls: 1.2.1 - type-check: 0.4.0 - dev: true - /ora@5.4.1: resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} engines: {node: '>=10'} @@ -12951,13 +12506,6 @@ packages: yocto-queue: 1.0.0 dev: true - /p-locate@3.0.0: - resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} - engines: {node: '>=6'} - dependencies: - p-limit: 2.3.0 - dev: true - /p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} @@ -13032,11 +12580,6 @@ packages: /path-browserify@1.0.1: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} - /path-exists@3.0.0: - resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} - engines: {node: '>=4'} - dev: true - /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -13451,66 +12994,6 @@ packages: which-pm: 2.0.0 dev: true - /prelude-ls@1.2.1: - resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} - engines: {node: '>= 0.8.0'} - dev: true - - /prettier-eslint-cli@7.1.0(prettier-eslint@15.0.1): - resolution: {integrity: sha512-kMMvV7Mt6VqdJSb25aCkOA7HTIxy5mii2tzBb1vCSmzlIECOzTP2wRPIeAtBky6WdpfN0n1Zxa4E37Atp1IksA==} - engines: {node: '>=12.22'} - hasBin: true - peerDependencies: - prettier-eslint: '*' - peerDependenciesMeta: - prettier-eslint: - optional: true - dependencies: - '@messageformat/core': 3.2.0 - '@prettier/eslint': /prettier-eslint@15.0.1 - arrify: 2.0.1 - boolify: 1.0.1 - camelcase-keys: 7.0.2 - chalk: 4.1.2 - common-tags: 1.8.2 - core-js: 3.36.1 - eslint: 8.53.0 - find-up: 5.0.0 - get-stdin: 8.0.0 - glob: 7.2.3 - ignore: 5.2.4 - indent-string: 4.0.0 - lodash.memoize: 4.1.2 - loglevel-colored-level-prefix: 1.0.0 - prettier-eslint: 15.0.1 - rxjs: 7.8.1 - yargs: 13.3.2 - transitivePeerDependencies: - - supports-color - dev: true - - /prettier-eslint@15.0.1: - resolution: {integrity: sha512-mGOWVHixSvpZWARqSDXbdtTL54mMBxc5oQYQ6RAqy8jecuNJBgN3t9E5a81G66F8x8fsKNiR1HWaBV66MJDOpg==} - engines: {node: '>=10.0.0'} - dependencies: - '@types/eslint': 8.44.6 - '@types/prettier': 2.7.3 - '@typescript-eslint/parser': 5.62.0(eslint@8.53.0)(typescript@4.9.5) - common-tags: 1.8.2 - dlv: 1.1.3 - eslint: 8.53.0 - indent-string: 4.0.0 - lodash.merge: 4.6.2 - loglevel-colored-level-prefix: 1.0.0 - prettier: 2.8.8 - pretty-format: 23.6.0 - require-relative: 0.8.7 - typescript: 4.9.5 - vue-eslint-parser: 8.3.0(eslint@8.53.0) - transitivePeerDependencies: - - supports-color - dev: true - /prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} @@ -13522,13 +13005,6 @@ packages: hasBin: true dev: false - /pretty-format@23.6.0: - resolution: {integrity: sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw==} - dependencies: - ansi-regex: 3.0.1 - ansi-styles: 3.2.1 - dev: true - /pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -13649,11 +13125,6 @@ packages: engines: {node: '>=8'} dev: true - /quick-lru@5.1.1: - resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} - engines: {node: '>=10'} - dev: true - /quickselect@1.1.1: resolution: {integrity: sha512-qN0Gqdw4c4KGPsBOQafj6yj/PA6c/L63f6CaZ/DCF/xF4Esu3jVmKLUDYxghFx8Kb/O7y9tI7x2RjTSXwdK1iQ==} dev: false @@ -14637,10 +14108,6 @@ packages: /require-main-filename@2.0.0: resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} - /require-relative@0.8.7: - resolution: {integrity: sha512-AKGr4qvHiryxRb19m3PsLRGuKVAbJLUD7E6eOaHkfKhwc+vSgVOCY5xNvm9EkolBKTOf0GrQAZKLimOCz81Khg==} - dev: true - /requires-port@1.0.0: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} dev: false @@ -14861,10 +14328,6 @@ packages: /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - /safe-identifier@0.4.2: - resolution: {integrity: sha512-6pNbSMW6OhAi9j+N8V+U715yBQsaWJ7eyEUaOrawX+isg5ZxhUlV1NipNtgaKHmFGiABwt+ZF04Ii+3Xjkg+8w==} - dev: true - /safe-regex-test@1.0.0: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} dependencies: @@ -15399,12 +14862,6 @@ packages: engines: {node: '>=14'} dev: true - /simple-git-hooks@2.10.0: - resolution: {integrity: sha512-TtCytVYfV77pILCkzVxpOSgYKHQyaO7fBI/iwG5bLGb0dIo/v/K1Y1IZ5DN40RQu6WNNJiN0gkuRvSYjxOhFog==} - hasBin: true - requiresBuild: true - dev: true - /simple-statistics@6.1.1: resolution: {integrity: sha512-zGwn0DDRa9Zel4H4n2pjTFIyGoAGpnpjrGIctreCxj5XWrcx9v7Xy7270FkC967WMmcvuc8ZU7m0ZG+hGN7gAA==} dev: false @@ -15740,15 +15197,6 @@ packages: strip-ansi: 4.0.0 dev: false - /string-width@3.1.0: - resolution: {integrity: sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==} - engines: {node: '>=6'} - dependencies: - emoji-regex: 7.0.3 - is-fullwidth-code-point: 2.0.0 - strip-ansi: 5.2.0 - dev: true - /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -15812,13 +15260,6 @@ packages: ansi-regex: 3.0.1 dev: false - /strip-ansi@5.2.0: - resolution: {integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==} - engines: {node: '>=6'} - dependencies: - ansi-regex: 4.1.1 - dev: true - /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -15857,11 +15298,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /strip-json-comments@3.1.1: - resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} - engines: {node: '>=8'} - dev: true - /strip-literal@1.3.0: resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==} dependencies: @@ -16217,10 +15653,6 @@ packages: engines: {node: '>=0.10'} dev: true - /text-table@0.2.0: - resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} - dev: true - /thenify-all@1.6.0: resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} engines: {node: '>=0.8'} @@ -16438,6 +15870,7 @@ packages: /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + dev: false /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} @@ -16446,16 +15879,6 @@ packages: resolution: {integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==} engines: {node: '>=0.6.x'} - /tsutils@3.21.0(typescript@4.9.5): - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' - dependencies: - tslib: 1.14.1 - typescript: 4.9.5 - dev: true - /tty-table@4.2.3: resolution: {integrity: sha512-Fs15mu0vGzCrj8fmJNP7Ynxt5J7praPXqFN0leZeZBXJwkMxv9cb2D454k1ltrtUSJbZ4yH4e0CynsHLxmUfFA==} engines: {node: '>=8.0.0'} @@ -16474,13 +15897,6 @@ packages: resolution: {integrity: sha512-Ja03QIJlPuHt4IQ2FfGex4F4JAr8m3jpaHbFbQrgwr7s7L6U8ocrHiF3J1+wf9jzhGKxvDeaCAnGDot8OjGFyA==} dev: false - /type-check@0.4.0: - resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} - engines: {node: '>= 0.8.0'} - dependencies: - prelude-ls: 1.2.1 - dev: true - /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} @@ -16496,11 +15912,6 @@ packages: engines: {node: '>=10'} dev: true - /type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - dev: true - /type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} @@ -17306,24 +16717,6 @@ packages: vue: 3.4.15(typescript@4.9.5) dev: false - /vue-eslint-parser@8.3.0(eslint@8.53.0): - resolution: {integrity: sha512-dzHGG3+sYwSf6zFBa0Gi9ZDshD7+ad14DGOdTLjruRVgZXe2J+DcZ9iUhyR48z5g1PqRa20yt3Njna/veLJL/g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: '>=6.0.0' - dependencies: - debug: 4.3.4 - eslint: 8.53.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 - esquery: 1.5.0 - lodash: 4.17.21 - semver: 7.5.4 - transitivePeerDependencies: - - supports-color - dev: true - /vue-router@4.2.5(vue@3.3.12): resolution: {integrity: sha512-DIUpKcyg4+PTQKfFPX88UWhlagBEBEfJ5A8XDXRJLUnZOvcpMF8o/dnL90vpVkGaPbjvXazV/rC1qBKrZlFugw==} peerDependencies: @@ -17603,15 +16996,6 @@ packages: engines: {node: '>=0.4.0'} dev: false - /wrap-ansi@5.1.0: - resolution: {integrity: sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==} - engines: {node: '>=6'} - dependencies: - ansi-styles: 3.2.1 - string-width: 3.1.0 - strip-ansi: 5.2.0 - dev: true - /wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -17748,13 +17132,6 @@ packages: engines: {node: '>= 14'} dev: true - /yargs-parser@13.1.2: - resolution: {integrity: sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==} - dependencies: - camelcase: 5.3.1 - decamelize: 1.2.0 - dev: true - /yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} engines: {node: '>=6'} @@ -17772,21 +17149,6 @@ packages: engines: {node: '>=12'} dev: true - /yargs@13.3.2: - resolution: {integrity: sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==} - dependencies: - cliui: 5.0.0 - find-up: 3.0.0 - get-caller-file: 2.0.5 - require-directory: 2.1.1 - require-main-filename: 2.0.0 - set-blocking: 2.0.0 - string-width: 3.1.0 - which-module: 2.0.1 - y18n: 4.0.3 - yargs-parser: 13.1.2 - dev: true - /yargs@15.4.1: resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} engines: {node: '>=8'} diff --git a/scripts/build.mjs b/scripts/build.mjs index b7bbf5d09..a2fa914fb 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -1,8 +1,8 @@ +import fs, { existsSync } from 'node:fs'; +import os from 'node:os'; +import { join, resolve } from 'node:path'; import { execa } from 'execa'; import { createSpinner } from 'nanospinner'; -import { resolve, join } from 'node:path'; -import os from 'node:os'; -import fs, { existsSync } from 'node:fs'; import { logger } from './logger.mjs'; @@ -203,7 +203,7 @@ export async function checkProtobuf() { await execa('which', ['protoc']); } return true; - } catch (error) { + } catch { return false; } } diff --git a/scripts/bump.mjs b/scripts/bump.mjs index b9d7179d2..3d096b3a9 100644 --- a/scripts/bump.mjs +++ b/scripts/bump.mjs @@ -1,4 +1,4 @@ -import { execSync } from "child_process"; +import { execSync } from 'child_process'; execSync('npx changeset version', { stdio: 'inherit' }); -execSync('pnpm install --no-frozen-lockfile', { stdio: 'inherit' }); \ No newline at end of file +execSync('pnpm install --no-frozen-lockfile', { stdio: 'inherit' }); diff --git a/scripts/clear-cache.mjs b/scripts/clear-cache.mjs index 0b42a44ab..71ec09bb8 100644 --- a/scripts/clear-cache.mjs +++ b/scripts/clear-cache.mjs @@ -1,7 +1,7 @@ import fs from 'fs'; import path from 'path'; -import { JS_PLUGINs_DIR, EXAMPLES_DIR } from './build.mjs'; +import { EXAMPLES_DIR, JS_PLUGINs_DIR } from './build.mjs'; [JS_PLUGINs_DIR, EXAMPLES_DIR].forEach((dir) => { if (fs.existsSync(dir)) { diff --git a/scripts/github-matrix.mjs b/scripts/github-matrix.mjs index 32d8c02d4..50eabeaaa 100644 --- a/scripts/github-matrix.mjs +++ b/scripts/github-matrix.mjs @@ -1,6 +1,8 @@ -import { execSync } from "child_process"; +import { execSync } from 'child_process'; -const result = execSync('cargo metadata --format-version 1 --no-deps --manifest-path Cargo.toml'); +const result = execSync( + 'cargo metadata --format-version 1 --no-deps --manifest-path Cargo.toml' +); const data = JSON.parse(result.toString()); const crates = data.packages.map((pkg) => { @@ -9,18 +11,20 @@ const crates = data.packages.map((pkg) => { return { name, version }; }); -const matrixSettings = crates.map((crate) => { - const os = ["windows-latest", "macos-latest", "ubuntu-latest"]; +const matrixSettings = crates + .map((crate) => { + const os = ['windows-latest', 'macos-latest', 'ubuntu-latest']; - const settings = os.map((os) => { - return { - os, - crate: crate.name, - }; - }); + const settings = os.map((os) => { + return { + os, + crate: crate.name + }; + }); - return settings; -}).flat(); + return settings; + }) + .flat(); for (const setting of matrixSettings) { console.log(`- crate: ${setting.os} diff --git a/scripts/logger.mjs b/scripts/logger.mjs index e3f6b47a2..335b0882e 100644 --- a/scripts/logger.mjs +++ b/scripts/logger.mjs @@ -7,7 +7,7 @@ export function logger(msg, { title = 'FARM INFO', color = 'green' } = {}) { 'blue', 'magenta', 'cyan', - 'white', + 'white' ].indexOf(color); if (COLOR_CODE >= 0) { const TITLE_STR = title ? `\x1b[4${COLOR_CODE};30m ${title} \x1b[0m ` : ''; diff --git a/scripts/ready.mjs b/scripts/ready.mjs index f983e726d..fc2adae2f 100644 --- a/scripts/ready.mjs +++ b/scripts/ready.mjs @@ -1,10 +1,10 @@ -import { execa } from 'execa'; import os from 'node:os'; +import { execa } from 'execa'; import { DEFAULT_PACKAGE_MANAGER, + buildCoreCjs, buildExamples, - runTaskQueue, - buildCoreCjs + runTaskQueue } from './build.mjs'; const cwd = process.cwd(); diff --git a/scripts/release.mjs b/scripts/release.mjs index 0156d7f8a..eb4ff0b70 100644 --- a/scripts/release.mjs +++ b/scripts/release.mjs @@ -1,4 +1,4 @@ -import { execSync } from "child_process"; +import { execSync } from 'child_process'; import { buildCli, buildCoreCjs, buildJsPlugins } from './build.mjs'; // build node packages @@ -6,6 +6,6 @@ await buildCli(); await buildCoreCjs(); await buildJsPlugins(); -execSync("npm config set access public", { stdio: "inherit" }); +execSync('npm config set access public', { stdio: 'inherit' }); // publish node packages -execSync("npx changeset publish", { stdio: "inherit" }); \ No newline at end of file +execSync('npx changeset publish', { stdio: 'inherit' }); diff --git a/scripts/test-examples.mjs b/scripts/test-examples.mjs index 23c26875a..9e97ff4c4 100644 --- a/scripts/test-examples.mjs +++ b/scripts/test-examples.mjs @@ -1,4 +1,9 @@ -import { buildCli, buildCoreCjs, buildJsPlugins, buildExamples } from './build.mjs'; +import { + buildCli, + buildCoreCjs, + buildExamples, + buildJsPlugins +} from './build.mjs'; console.log('Building CLI...'); await buildCli(); diff --git a/vitest.config.ts b/vitest.config.ts index 1ae85ab9f..795774721 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -2,14 +2,14 @@ import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { - include: ['packages/**/*.spec.ts', "js-plugins/**/*.spec.ts"], + include: ['packages/**/*.spec.ts', 'js-plugins/**/*.spec.ts'], coverage: { - reporter: ['json'], + reporter: ['json'] }, pool: 'forks', environment: 'node', deps: { - interopDefault: false, - }, - }, + interopDefault: false + } + } });