diff --git a/.eslintignore b/.eslintignore index 20a7623a43..264604a6e0 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,5 @@ /dist /compiled /theme-default -/runtime /suites/*/compiled /suites/preset-vue/lib diff --git a/bundler-utils.d.ts b/bundler-utils.d.ts deleted file mode 100644 index abf8d8501c..0000000000 --- a/bundler-utils.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type * as BabelCore from '@umijs/bundler-utils/compiled/@babel/core'; -export { BabelCore }; -export const babelCore: () => typeof import('@umijs/bundler-utils/compiled/@babel/core'); -export const babelPresetTypeScript: () => BabelCore.PluginItem; -export const babelPresetEnv: () => BabelCore.PluginItem; diff --git a/bundler-utils.js b/bundler-utils.js deleted file mode 100644 index 2a9e5e75d3..0000000000 --- a/bundler-utils.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - babelCore: () => require('@umijs/bundler-utils/compiled/babel/core'), - babelPresetTypeScript: () => - require('@umijs/bundler-utils/compiled/babel/preset-typescript'), - babelPresetEnv: () => - require('@umijs/bundler-utils/compiled/babel/preset-env'), -}; diff --git a/package.json b/package.json index 85617b10bd..e509a19934 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,6 @@ "index.d.ts", "plugin-utils.js", "plugin-utils.d.ts", - "bundler-utils.js", - "bundler-utils.d.ts", "tech-stack-utils.js", "tech-stack-utils.d.ts" ], diff --git a/src/assetParsers/BaseParser.ts b/src/assetParsers/BaseParser.ts index 1b4bc1f41b..06e1a465d1 100644 --- a/src/assetParsers/BaseParser.ts +++ b/src/assetParsers/BaseParser.ts @@ -1,23 +1,28 @@ -import type { AtomAssetsParser, AtomAssetsParserResult } from '@/types'; +import type { AtomComponentAsset, AtomFunctionAsset } from 'dumi-assets-types'; import path from 'path'; import { chokidar, lodash, logger } from 'umi/plugin-utils'; -export interface PatchFile { +export interface IPatchFile { event: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir'; fileName: string; } +export interface IAtomAssetsParserResult { + components: Record; + functions: Record; +} + /** * The parsing and extraction of language metadata should be implemented separately */ -export interface LanguageMetaParser { - patch(file: PatchFile): void; - parse(): Promise; +export interface ILanguageMetaParser { + patch(file: IPatchFile): void; + parse(): Promise; destroy(): Promise; } -export interface HandleWatcherArgs { - patch: LanguageMetaParser['patch']; +export interface IHandleWatcherArgs { + patch: ILanguageMetaParser['patch']; parse: () => void; watchArgs: { paths: string | string[]; @@ -25,35 +30,34 @@ export interface HandleWatcherArgs { }; } -export interface BaseAtomAssetsParserParams { +export interface IBaseAtomAssetsParserParams { entryFile: string; resolveDir: string; parser: T; handleWatcher?: ( watcher: chokidar.FSWatcher, - params: HandleWatcherArgs, + params: IHandleWatcherArgs, ) => chokidar.FSWatcher; watchOptions?: chokidar.WatchOptions; } export class BaseAtomAssetsParser< - T extends LanguageMetaParser = LanguageMetaParser, -> implements AtomAssetsParser -{ - private watchArgs!: HandleWatcherArgs['watchArgs']; + T extends ILanguageMetaParser = ILanguageMetaParser, +> { + private watchArgs!: IHandleWatcherArgs['watchArgs']; private watcher: chokidar.FSWatcher | null = null; - private handleWatcher?: BaseAtomAssetsParserParams['handleWatcher']; + private handleWatcher?: IBaseAtomAssetsParserParams['handleWatcher']; private entryDir!: string; private resolveDir!: string; private readonly parser!: T; private isParsing = false; - private parseDeferrer: Promise | null = null; - private cbs: Array<(data: AtomAssetsParserResult) => void> = []; + private parseDeferrer: Promise | null = null; + private cbs: Array<(data: IAtomAssetsParserResult) => void> = []; - constructor(opts: BaseAtomAssetsParserParams) { + constructor(opts: IBaseAtomAssetsParserParams) { const { entryFile, resolveDir, watchOptions, parser, handleWatcher } = opts; this.resolveDir = resolveDir; const absEntryFile = path.resolve(resolveDir, entryFile); @@ -88,7 +92,7 @@ export class BaseAtomAssetsParser< return this.parseDeferrer; } - public watch(cb: (data: AtomAssetsParserResult) => void): void { + public watch(cb: (data: IAtomAssetsParserResult) => void): void { // save watch callback this.cbs.push(cb); // initialize watcher @@ -119,7 +123,7 @@ export class BaseAtomAssetsParser< } }, watchArgs: this.watchArgs, - patch: (file: PatchFile) => { + patch: (file: IPatchFile) => { this.parser.patch(file); }, }); @@ -128,7 +132,7 @@ export class BaseAtomAssetsParser< } } - public unwatch(cb: (data: AtomAssetsParserResult) => void) { + public unwatch(cb: (data: IAtomAssetsParserResult) => void) { this.cbs.splice(this.cbs.indexOf(cb), 1); } @@ -153,3 +157,5 @@ export class BaseAtomAssetsParser< await this.parser.destroy(); } } + +export type IAtomAssetsParser = InstanceType; diff --git a/src/assetParsers/__tests__/FakeParser.d.ts b/src/assetParsers/__tests__/FakeParser.d.ts deleted file mode 100644 index 0a70266753..0000000000 --- a/src/assetParsers/__tests__/FakeParser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const FakeParser: () => import('../../../dist').BaseAtomAssetsParser< - import('../../../dist').LanguageMetaParser ->; diff --git a/src/assetParsers/__tests__/FakeParser.js b/src/assetParsers/__tests__/FakeParser.js index df2f7fb3d8..1b507b8f5e 100644 --- a/src/assetParsers/__tests__/FakeParser.js +++ b/src/assetParsers/__tests__/FakeParser.js @@ -1,8 +1,6 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.FakeParser = void 0; -const dist_1 = require('../../../dist'); -exports.FakeParser = (0, dist_1.createApiParser)({ +const { createApiParser } = require('../../../tech-stack-utils'); + +module.exports.FakeParser = createApiParser({ filename: __filename, worker: class { patch() {} diff --git a/src/assetParsers/__tests__/FakeParser.ts b/src/assetParsers/__tests__/FakeParser.ts deleted file mode 100644 index 47e8f6b604..0000000000 --- a/src/assetParsers/__tests__/FakeParser.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { AtomAssetsParserResult, createApiParser } from '../../../dist'; - -export const FakeParser = createApiParser({ - filename: __filename, - worker: class { - patch() {} - parse() { - return new Promise((resolve) => { - setTimeout(() => { - resolve({ - components: {}, - functions: {}, - }); - }, 1000); - }); - } - async destroy() {} - }, - // If the worker class has no parameters - // entryFile and resolveDir must be passed in manually. - parseOptions: { - entryFile: __filename, - resolveDir: __dirname, - }, -}); diff --git a/src/assetParsers/__tests__/parser.fork.test.ts b/src/assetParsers/__tests__/parser.fork.test.ts index 8d8e0728e2..d7c0e11c27 100644 --- a/src/assetParsers/__tests__/parser.fork.test.ts +++ b/src/assetParsers/__tests__/parser.fork.test.ts @@ -1,10 +1,11 @@ import { expect, test } from 'vitest'; -import { FakeParser } from './FakeParser.js'; +// @ts-ignore +import { FakeParser } from './FakeParser'; test('AtomAssetsParser: create worker mode', async () => { const parser = FakeParser(); const now = performance.now(); - parser.parse().then((result) => { + parser.parse().then((result: any) => { expect(result).toStrictEqual({ components: {}, functions: {}, diff --git a/src/assetParsers/__tests__/setup.js b/src/assetParsers/__tests__/setup.js deleted file mode 100644 index 67e97f4bf2..0000000000 --- a/src/assetParsers/__tests__/setup.js +++ /dev/null @@ -1,12 +0,0 @@ -import { exec } from 'node:child_process'; -import { promisify } from 'node:util'; -import path from 'path'; - -const execPromise = promisify(exec); - -export default async function () { - const tsconfigPath = path.join(__dirname, 'tsconfig.test.json'); - const files = path.resolve(__dirname, './FakeParser.{js,d.ts}'); - await execPromise(`tsc --project ${tsconfigPath}`); - await execPromise(`prettier ${files} --write`); -} diff --git a/src/assetParsers/__tests__/tsconfig.test.json b/src/assetParsers/__tests__/tsconfig.test.json deleted file mode 100644 index 34af9164e5..0000000000 --- a/src/assetParsers/__tests__/tsconfig.test.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "compilerOptions": { - "strict": true, - "target": "ESNext", - "module": "CommonJS", - "moduleResolution": "Node", - "declaration": true, - "skipLibCheck": true, - "esModuleInterop": true, - "baseUrl": "./", - "types": ["vitest/globals"] - }, - "include": ["FakeParser.ts"] -} diff --git a/src/assetParsers/atom.ts b/src/assetParsers/atom.ts index d8f65da3b5..f55baf38b5 100644 --- a/src/assetParsers/atom.ts +++ b/src/assetParsers/atom.ts @@ -2,11 +2,11 @@ import { getProjectRoot } from '@/utils'; import { SchemaParser, SchemaResolver } from 'dumi-afx-deps/compiled/parser'; import path from 'path'; import { logger } from 'umi/plugin-utils'; -import { AtomAssetsParserResult } from '../types'; import { BaseAtomAssetsParser, - LanguageMetaParser, - PatchFile, + IAtomAssetsParserResult, + ILanguageMetaParser, + IPatchFile, } from './BaseParser'; // maximum support 512kb for each atoms @@ -20,7 +20,7 @@ interface ParserParams { parseOptions?: object; } -class ReactMetaParser implements LanguageMetaParser { +class ReactMetaParser implements ILanguageMetaParser { private parser: SchemaParser; private resolveFilter: (args: { type: 'COMPONENT' | 'FUNCTION'; @@ -53,7 +53,7 @@ class ReactMetaParser implements LanguageMetaParser { }); // parse atoms from resolver - const result: AtomAssetsParserResult = { + const result: IAtomAssetsParserResult = { components: {}, functions: {}, }; @@ -121,7 +121,7 @@ class ReactMetaParser implements LanguageMetaParser { return this.parser.$$destroyWorker(); } - public patch(file: PatchFile): void { + public patch(file: IPatchFile): void { this.unresolvedFiles.push(file.fileName); } } diff --git a/src/assetParsers/utils.ts b/src/assetParsers/utils.ts index 033058a675..070343647c 100644 --- a/src/assetParsers/utils.ts +++ b/src/assetParsers/utils.ts @@ -4,8 +4,8 @@ import { lodash } from 'umi/plugin-utils'; import { Worker, isMainThread, parentPort } from 'worker_threads'; import { BaseAtomAssetsParser, - BaseAtomAssetsParserParams, - LanguageMetaParser, + IBaseAtomAssetsParserParams, + ILanguageMetaParser, } from './BaseParser'; /** @@ -94,7 +94,7 @@ export function createRemoteClass< } as unknown as T; } -export interface CreateApiParserOptions { +interface ICreateApiParserOptions { /** * The full file name (absolute path) of the file where `parseWorker` is located */ @@ -109,7 +109,7 @@ export interface CreateApiParserOptions { parseOptions?: C; } -export interface BaseApiParserOptions { +export interface IBaseApiParserOptions { entryFile: string; resolveDir: string; } @@ -150,8 +150,10 @@ export interface BaseApiParserOptions { */ export function createApiParser< P extends new (...args: ConstructorParameters

) => InstanceType

& - LanguageMetaParser, ->(options: CreateApiParserOptions>>) { + ILanguageMetaParser, +>( + options: ICreateApiParserOptions>>, +) { const { filename, worker, parseOptions } = options; const ParserClass = createRemoteClass(filename, worker); return (...args: ConstructorParameters

) => diff --git a/src/client/pages/Demo/index.ts b/src/client/pages/Demo/index.ts index 4c714e3b3a..c90b96f5c9 100644 --- a/src/client/pages/Demo/index.ts +++ b/src/client/pages/Demo/index.ts @@ -1,5 +1,6 @@ -import { useDemo, useLiveDemo, useParams, useRenderer } from 'dumi'; +import { useDemo, useLiveDemo, useParams } from 'dumi'; import { ComponentType, createElement, useEffect, type FC } from 'react'; +import { useRenderer } from '../../theme-api/useRenderer'; import './index.less'; const DemoRenderPage: FC = () => { diff --git a/src/client/theme-api/index.ts b/src/client/theme-api/index.ts index 0db8649e4b..a66497e3ce 100644 --- a/src/client/theme-api/index.ts +++ b/src/client/theme-api/index.ts @@ -31,7 +31,6 @@ export { useLiveDemo } from './useLiveDemo'; export { useLocale } from './useLocale'; export { useNavData } from './useNavData'; export { usePrefersColor } from './usePrefersColor'; -export { useRenderer } from './useRenderer'; export { useRouteMeta } from './useRouteMeta'; export { useFullSidebarData, useSidebarData } from './useSidebarData'; export { useSiteSearch } from './useSiteSearch'; diff --git a/src/features/parser.ts b/src/features/parser.ts index f7866d387f..fedd3b8974 100644 --- a/src/features/parser.ts +++ b/src/features/parser.ts @@ -1,10 +1,13 @@ -import type { AtomAssetsParser, IApi } from '@/types'; +import type { IApi } from '@/types'; import { lodash } from '@umijs/utils'; import assert from 'assert'; -import { BaseAtomAssetsParser } from '../assetParsers/BaseParser'; +import { + BaseAtomAssetsParser, + type IAtomAssetsParser, +} from '../assetParsers/BaseParser'; import { ATOMS_META_PATH } from './meta'; -type IParsedAtomAssets = Awaited>; +type IParsedAtomAssets = Awaited>; function filterIgnoredProps( props: IParsedAtomAssets['components'][string]['propsConfig']['properties'], @@ -88,7 +91,10 @@ export default (api: IApi) => { default: ReactAtomAssetsParser, }: typeof import('@/assetParsers/atom') = require('@/assetParsers/atom'); - const apiParser = api.config.apiParser || {}; + const apiParser = api.config.apiParser as Exclude< + IApi['config']['apiParser'], + false | undefined + >; api.service.atomParser = new ReactAtomAssetsParser({ entryFile: api.config.resolve.entryFile!, diff --git a/src/index.ts b/src/index.ts index 3870cf250b..23487f1d72 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,4 @@ import type { - AtomAssetsParser, - AtomAssetsParserResult, IDumiTechStack, IDumiTechStackRuntimeOpts, IDumiUserConfig, @@ -13,14 +11,6 @@ let unistUtilVisit: typeof import('unist-util-visit'); })(); export * from 'umi'; -export * from './assetParsers/BaseParser'; -export * from './assetParsers/utils'; export { getProjectRoot } from './utils'; -export { - unistUtilVisit, - IDumiTechStack, - IDumiTechStackRuntimeOpts, - AtomAssetsParser, - AtomAssetsParserResult, -}; +export { unistUtilVisit, IDumiTechStack, IDumiTechStackRuntimeOpts }; export const defineConfig = (config: IDumiUserConfig) => config; diff --git a/src/loaders/markdown/index.ts b/src/loaders/markdown/index.ts index db17845a54..d8a07dc532 100644 --- a/src/loaders/markdown/index.ts +++ b/src/loaders/markdown/index.ts @@ -124,11 +124,9 @@ function emitDemo( export const demos = { {{#demos}} '{{{id}}}': { - id: "{{{id}}}", {{#component}} component: {{{component}}}, {{/component}} - renderOpts: {{{renderRenderOpts}}}, asset: {{{renderAsset}}}, context: {{{renderContext}}}, renderOpts: {{{renderRenderOpts}}}, diff --git a/src/loaders/markdown/transformer/rehypeDemo.ts b/src/loaders/markdown/transformer/rehypeDemo.ts index a5b3d1f479..5a48e1bc72 100644 --- a/src/loaders/markdown/transformer/rehypeDemo.ts +++ b/src/loaders/markdown/transformer/rehypeDemo.ts @@ -247,7 +247,7 @@ export default function rehypeDemo( ? [vFile.data.frontmatter!.atomId] : [], fileAbsPath: '', - lang: (codeNode.data?.lang as string) || 'tsx', + lang: codeNode.data!.lang, entryPointCode: codeType === 'external' ? undefined : codeValue, resolver: opts.resolver, techStack, diff --git a/src/types.ts b/src/types.ts index 076df27786..2aba1dfa58 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/ban-types */ -// import type AtomAssetsParser from '@/assetParsers/atom'; +import type { BaseAtomAssetsParser as IAtomAssetsParser } from '@/assetParsers/BaseParser'; import type { IParsedBlockAsset } from '@/assetParsers/block'; import type { IDumiDemoProps } from '@/client/theme-api/DumiDemo'; import type { ILocalesConfig, IThemeConfig } from '@/client/theme-api/types'; @@ -10,12 +10,7 @@ import { OnLoadResult, } from '@umijs/bundler-utils/compiled/esbuild'; import type { IModify } from '@umijs/core'; -import type { - AssetsPackage, - AtomComponentAsset, - AtomFunctionAsset, - ExampleBlockAsset, -} from 'dumi-assets-types'; +import type { AssetsPackage, ExampleBlockAsset } from 'dumi-assets-types'; import type { Element } from 'hast'; import type { IApi as IUmiApi, defineConfig as defineUmiConfig } from 'umi'; @@ -161,39 +156,12 @@ export abstract class IDumiTechStack { ): IDumiTechStackOnBlockLoadResult | null; } -export interface AtomAssetsParserResult { - components: Record; - functions: Record; -} - -export abstract class AtomAssetsParser { - /** - * parse component metadata - */ - abstract parse(): Promise; - - /** - * monitor documents and codes, update component metadata at any time - */ - abstract watch(cb: (data: AtomAssetsParserResult) => void): void; - - /** - * cancel monitoring - */ - abstract unwatch(cb: (data: AtomAssetsParserResult) => void): void; - - /** - * cancel parsing - */ - abstract destroyWorker(): void; -} - export type IApi = IUmiApi & { config: IDumiConfig & { [key: string]: any }; userConfig: IDumiUserConfig; service: IUmiApi['service'] & { themeData: IThemeLoadResult; - atomParser: AtomAssetsParser; + atomParser: IAtomAssetsParser; }; /** * register a new tech stack diff --git a/suites/dumi-vue-meta/.fatherrc.ts b/suites/dumi-vue-meta/.fatherrc.ts index 7eee87086b..c45e1a9a84 100644 --- a/suites/dumi-vue-meta/.fatherrc.ts +++ b/suites/dumi-vue-meta/.fatherrc.ts @@ -2,8 +2,4 @@ import { defineConfig } from 'father'; export default defineConfig({ cjs: {}, - esm: {}, - prebundle: { - deps: {}, - }, }); diff --git a/suites/preset-vue/src/atomParser/index.ts b/suites/preset-vue/src/atomParser/index.ts index bfae9e4070..aa0a244378 100644 --- a/suites/preset-vue/src/atomParser/index.ts +++ b/suites/preset-vue/src/atomParser/index.ts @@ -1,20 +1,20 @@ import type { MetaCheckerOptions } from '@dumijs/vue-meta'; import { createProject, dumiTransfomer } from '@dumijs/vue-meta'; import { - BaseApiParserOptions, - LanguageMetaParser, - PatchFile, + IBaseApiParserOptions, + ILanguageMetaParser, + IPatchFile, createApiParser, -} from 'dumi'; +} from 'dumi/tech-stack-utils'; import path from 'path'; import { fsExtra } from 'umi/plugin-utils'; -export interface VueParserOptions extends BaseApiParserOptions { +export interface VueParserOptions extends IBaseApiParserOptions { tsconfigPath?: string; checkerOptions?: MetaCheckerOptions; } -class VueMetaParser implements LanguageMetaParser { +class VueMetaParser implements ILanguageMetaParser { protected entryFile: string; protected resolveDir: string; private checkerOptions!: MetaCheckerOptions; @@ -32,7 +32,7 @@ class VueMetaParser implements LanguageMetaParser { checkerOptions: this.checkerOptions, }); } - async patch(file: PatchFile) { + async patch(file: IPatchFile) { const { event, fileName } = file; switch (event) { case 'add': diff --git a/suites/preset-vue/src/compiler/index.ts b/suites/preset-vue/src/compiler/index.ts index c45526e6a2..3b6e6478dc 100644 --- a/suites/preset-vue/src/compiler/index.ts +++ b/suites/preset-vue/src/compiler/index.ts @@ -1,4 +1,4 @@ -import type { BabelCore, babelCore } from 'dumi/bundler-utils'; +import type { BabelCore, babelCore } from 'dumi/tech-stack-utils'; import { CompilerError, CompilerOptions, diff --git a/suites/preset-vue/src/compiler/node.ts b/suites/preset-vue/src/compiler/node.ts index 1529f1177a..9d28200286 100644 --- a/suites/preset-vue/src/compiler/node.ts +++ b/suites/preset-vue/src/compiler/node.ts @@ -2,7 +2,7 @@ import { babelCore, babelPresetEnv, babelPresetTypeScript, -} from 'dumi/bundler-utils'; +} from 'dumi/tech-stack-utils'; import { COMP_IDENTIFIER, createCompiler, type CompileOptions } from './index'; const babel = babelCore(); diff --git a/suites/preset-vue/src/vue/webpack/config.ts b/suites/preset-vue/src/vue/webpack/config.ts index 4c3fb22b03..207caf0c62 100644 --- a/suites/preset-vue/src/vue/webpack/config.ts +++ b/suites/preset-vue/src/vue/webpack/config.ts @@ -1,5 +1,5 @@ import type Config from '@umijs/bundler-webpack/compiled/webpack-5-chain'; -import { babelPresetTypeScript } from 'dumi/bundler-utils'; +import { babelPresetTypeScript } from 'dumi/tech-stack-utils'; import type { IApi } from 'umi'; import VueLoaderPlugin from 'vue-loader/dist/pluginWebpack5.js'; // Webpack configuration mainly refers to @umijs/preset-vue diff --git a/tech-stack-utils.d.ts b/tech-stack-utils.d.ts index 54396916d1..4a4822cba9 100644 --- a/tech-stack-utils.d.ts +++ b/tech-stack-utils.d.ts @@ -1 +1,12 @@ +import type * as BabelCore from '@umijs/bundler-utils/compiled/@babel/core'; +export { + IBaseApiParserOptions, + ILanguageMetaParser, + IPatchFile, +} from './dist/assetParsers/BaseParser'; +export { createApiParser } from './dist/assetParsers/utils'; export * from './dist/techStacks/utils'; +export { BabelCore }; +export const babelCore: () => typeof import('@umijs/bundler-utils/compiled/@babel/core'); +export const babelPresetTypeScript: () => BabelCore.PluginItem; +export const babelPresetEnv: () => BabelCore.PluginItem; diff --git a/tech-stack-utils.js b/tech-stack-utils.js index 414f7e74bb..c21c1810e4 100644 --- a/tech-stack-utils.js +++ b/tech-stack-utils.js @@ -1 +1,9 @@ -module.exports = require('./dist/techStacks/utils'); +module.exports = { + ...require('./dist/techStacks/utils'), + createApiParser: require('./dist/assetParsers/utils').createApiParser, + babelCore: () => require('@umijs/bundler-utils/compiled/babel/core'), + babelPresetTypeScript: () => + require('@umijs/bundler-utils/compiled/babel/preset-typescript'), + babelPresetEnv: () => + require('@umijs/bundler-utils/compiled/babel/preset-env'), +}; diff --git a/vitest.config.ts b/vitest.config.ts index 90f860455b..df4363e4e2 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -7,7 +7,6 @@ export default defineConfig({ alias: { '@': path.join(__dirname, 'src'), }, - globalSetup: [path.join(__dirname, 'src/assetParsers/__tests__/setup.js')], poolMatchGlobs: [['**/__tests__/**/*.fork.test.*', 'child_process']], }, });