diff --git a/.github/actions/setup-project/action.yml b/.github/actions/setup-project/action.yml index f47422f31c7..e26474ebeb6 100644 --- a/.github/actions/setup-project/action.yml +++ b/.github/actions/setup-project/action.yml @@ -62,7 +62,7 @@ runs: - name: Run build if: inputs.skip-build != 'true' && steps.cache-build.outputs.cache-hit != 'true' shell: bash - run: yarn build && yarn build:umd + run: yarn build && yarn build:umd && yarn clean:exports env: # Disable V8 compile cache to hard crashes in Node.js. This can likely be removed once upgraded to the next LTS version (version 22). # See: https://github.com/nodejs/node/issues/51555 diff --git a/.github/split.js b/.github/split.mjs similarity index 65% rename from .github/split.js rename to .github/split.mjs index 40ed8a0bd66..46e12072955 100644 --- a/.github/split.js +++ b/.github/split.mjs @@ -1,8 +1,8 @@ /* eslint-disable no-console */ -const fs = require('fs'); -const path = require('path'); +import fs from 'node:fs'; +import path from 'node:path'; -const BASE_DIR = path.join(__dirname, '../packages/react-integration/cypress/integration'); +const BASE_DIR = path.resolve(import.meta.dirname, '../packages/react-integration/cypress/integration'); const WORKER_NUM = +process.env.WORKER_NUM; const WORKER_COUNT = +process.env.WORKER_COUNT; diff --git a/.github/upload-preview.js b/.github/upload-preview.mjs similarity index 95% rename from .github/upload-preview.js rename to .github/upload-preview.mjs index bf24050b859..056f705cf1c 100644 --- a/.github/upload-preview.js +++ b/.github/upload-preview.mjs @@ -1,8 +1,9 @@ /* eslint-disable no-console, camelcase */ -const path = require('path'); -const { Octokit } = require('@octokit/rest'); +import { Octokit } from '@octokit/rest'; +import path from 'node:path'; +import surge from 'surge'; + const octokit = new Octokit({ auth: process.env.GH_PR_TOKEN }); -const surge = require('surge'); const publishFn = surge().publish(); // From github actions diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index c013ccb662f..ba9dbe11555 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -39,11 +39,11 @@ jobs: - name: Upload documentation if: always() - run: node .github/upload-preview.js packages/react-docs/public + run: node .github/upload-preview.mjs packages/react-docs/public - name: Run accessibility tests run: yarn serve:docs & yarn test:a11y - name: Upload accessibility results if: always() - run: node .github/upload-preview.js packages/react-docs/coverage + run: node .github/upload-preview.mjs packages/react-docs/coverage diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 64ccb220488..f0e9552023e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -93,7 +93,7 @@ jobs: run: printenv - name: Run Cypress tests - run: yarn serve:integration & yarn test:integration -s $(node .github/split.js) + run: yarn serve:integration & yarn test:integration -s $(node .github/split.mjs) env: WORKER_NUM: ${{ matrix.worker }} WORKER_COUNT: 5 diff --git a/packages/react-charts/package.json b/packages/react-charts/package.json index a0bfec30447..86972b19270 100644 --- a/packages/react-charts/package.json +++ b/packages/react-charts/package.json @@ -58,7 +58,7 @@ }, "scripts": { "clean": "rimraf dist", - "build:single:packages": "node ../../scripts/build-single-packages.js --config single-packages.config.json" + "build:single:packages": "node ../../scripts/build-single-packages.mjs --config single-packages.config.json" }, "devDependencies": { "@types/lodash": "^4.17.5", diff --git a/packages/react-core/package.json b/packages/react-core/package.json index f201e0deb74..84396e17fb8 100644 --- a/packages/react-core/package.json +++ b/packages/react-core/package.json @@ -40,11 +40,11 @@ "homepage": "https://github.com/patternfly/patternfly-react#readme", "scripts": { "build:umd": "rollup -c --environment IS_PRODUCTION", - "build:single:packages": "node ../../scripts/build-single-packages.js --config single-packages.config.json", + "build:single:packages": "node ../../scripts/build-single-packages.mjs --config single-packages.config.json", "clean": "rimraf dist components layouts helpers next deprecated", - "generate": "node scripts/copyStyles.js", - "subpaths": "node ../../scripts/exportSubpaths.js --config subpaths.config.json", - "clean:exports": "node scripts/cleanDistExports.js" + "generate": "node scripts/copyStyles.mjs", + "subpaths": "node ../../scripts/exportSubpaths.mjs --config subpaths.config.json", + "clean:exports": "node scripts/cleanDistExports.mjs" }, "dependencies": { "@patternfly/react-icons": "workspace:^", diff --git a/packages/react-core/scripts/cleanDistExports.js b/packages/react-core/scripts/cleanDistExports.mjs similarity index 90% rename from packages/react-core/scripts/cleanDistExports.js rename to packages/react-core/scripts/cleanDistExports.mjs index 58e4dcd07f2..0b0c5c1b69a 100644 --- a/packages/react-core/scripts/cleanDistExports.js +++ b/packages/react-core/scripts/cleanDistExports.mjs @@ -1,5 +1,5 @@ -const fs = require('fs'); -const path = require('path'); +import fs from 'node:fs'; +import path from 'node:path'; const distIndexFiles = ['esm', 'js'].map((dir) => path.join(process.cwd(), 'dist', dir, 'index.js')); const distIndexDeclarationFiles = ['esm', 'js'].map((dir) => path.join(process.cwd(), 'dist', dir, 'index.d.ts')); diff --git a/packages/react-core/scripts/copyStyles.js b/packages/react-core/scripts/copyStyles.mjs similarity index 81% rename from packages/react-core/scripts/copyStyles.js rename to packages/react-core/scripts/copyStyles.mjs index 1024251dc65..191045303c9 100644 --- a/packages/react-core/scripts/copyStyles.js +++ b/packages/react-core/scripts/copyStyles.mjs @@ -1,8 +1,11 @@ -const { copySync, readFileSync, writeFileSync } = require('fs-extra'); -const { resolve, dirname, join } = require('path'); -const { parse: parseCSS, stringify: stringifyCSS } = require('css'); +import { copySync } from 'fs-extra/esm'; +import { readFileSync, writeFileSync } from 'node:fs'; +import { createRequire } from 'node:module'; +import { resolve, dirname, join } from 'node:path'; +import { parse as parseCSS, stringify as stringifyCSS } from 'css'; -const stylesDir = resolve(__dirname, '../dist/styles'); +const require = createRequire(import.meta.url); +const stylesDir = resolve(import.meta.dirname, '../dist/styles'); const pfDir = dirname(require.resolve('@patternfly/patternfly/patternfly.css')); const unusedSelectorRegEx = /(\.fas?|\.sr-only)/; diff --git a/packages/react-core/src/helpers/safeHTMLElement.js b/packages/react-core/src/helpers/safeHTMLElement.js deleted file mode 100644 index 1c26646dbba..00000000000 --- a/packages/react-core/src/helpers/safeHTMLElement.js +++ /dev/null @@ -1,4 +0,0 @@ -// https://github.com/reactjs/react-modal/blob/master/src/helpers/safeHTMLElement.js -import { canUseDOM } from './util'; - -export default canUseDOM ? window.HTMLElement : {}; diff --git a/packages/react-icons/package.json b/packages/react-icons/package.json index 90eb4c1b61e..3e48cd36460 100644 --- a/packages/react-icons/package.json +++ b/packages/react-icons/package.json @@ -25,7 +25,7 @@ }, "homepage": "https://github.com/patternfly/patternfly-react#readme", "scripts": { - "build:single:packages": "node ../../scripts/build-single-packages.js --config single-packages.config.json", + "build:single:packages": "node ../../scripts/build-single-packages.mjs --config single-packages.config.json", "clean": "rimraf dist src/icons src/index.js src/index.d.ts", "generate": "rimraf dist/esm/icons dist/js/icons && node scripts/writeIcons.mjs" }, diff --git a/packages/react-icons/scripts/generateIcons.mjs b/packages/react-icons/scripts/generateIcons.mjs index b7324e5e4bd..77344821170 100644 --- a/packages/react-icons/scripts/generateIcons.mjs +++ b/packages/react-icons/scripts/generateIcons.mjs @@ -1,6 +1,6 @@ -import faIcons from './icons/fontawesomeIcons.js'; +import faIcons from './icons/fontawesomeIcons.mjs'; import patternflyIcons from './icons/patternflyIcons.mjs'; -import customIcons from './icons/customIcons.js'; +import customIcons from './icons/customIcons.mjs'; /** * Generates icons from FontAwesome, PatternFly CSS, and custom icons in this repo. diff --git a/packages/react-icons/scripts/icons/customIcons.js b/packages/react-icons/scripts/icons/customIcons.mjs similarity index 99% rename from packages/react-icons/scripts/icons/customIcons.js rename to packages/react-icons/scripts/icons/customIcons.mjs index 7bb6b9b5112..ddef7baf89d 100644 --- a/packages/react-icons/scripts/icons/customIcons.js +++ b/packages/react-icons/scripts/icons/customIcons.mjs @@ -1,4 +1,4 @@ -module.exports = { +export default { openshift: { xOffset: 116, yOffset: 0, diff --git a/packages/react-icons/scripts/icons/fontawesomeIcons.js b/packages/react-icons/scripts/icons/fontawesomeIcons.mjs similarity index 82% rename from packages/react-icons/scripts/icons/fontawesomeIcons.js rename to packages/react-icons/scripts/icons/fontawesomeIcons.mjs index a05a3c7470b..77cb7d8366d 100644 --- a/packages/react-icons/scripts/icons/fontawesomeIcons.js +++ b/packages/react-icons/scripts/icons/fontawesomeIcons.mjs @@ -1,6 +1,6 @@ -const { fas } = require('@fortawesome/free-solid-svg-icons'); -const { far } = require('@fortawesome/free-regular-svg-icons'); -const { fab } = require('@fortawesome/free-brands-svg-icons'); +import { fas } from '@fortawesome/free-solid-svg-icons'; +import { far } from '@fortawesome/free-regular-svg-icons'; +import { fab } from '@fortawesome/free-brands-svg-icons'; /** * @param {object} icon FontAwesome icon to convert @@ -50,8 +50,10 @@ function convertIcons(icons) { }, {}); } -module.exports = { +const faIcons = { ...convertIcons(fas), ...convertIcons(fab), ...convertIcons(far) }; + +export default faIcons; diff --git a/packages/react-table/package.json b/packages/react-table/package.json index d79b9b450a7..9f605bc5e5b 100644 --- a/packages/react-table/package.json +++ b/packages/react-table/package.json @@ -35,9 +35,9 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/main/packages/react-table#readme", "scripts": { "build:umd": "rollup -c --environment IS_PRODUCTION", - "build:single:packages": "node ../../scripts/build-single-packages.js --config single-packages.config.json", + "build:single:packages": "node ../../scripts/build-single-packages.mjs --config single-packages.config.json", "clean": "rimraf dist components deprecated", - "subpaths": "node ../../scripts/exportSubpaths.js --config subpaths.config.json" + "subpaths": "node ../../scripts/exportSubpaths.mjs --config subpaths.config.json" }, "dependencies": { "@patternfly/react-core": "workspace:^", diff --git a/packages/react-templates/package.json b/packages/react-templates/package.json index 3bcc07ae8a2..f8c1da3c7d7 100644 --- a/packages/react-templates/package.json +++ b/packages/react-templates/package.json @@ -28,9 +28,9 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/main/packages/react-templates#readme", "scripts": { "build:umd": "rollup -c --environment IS_PRODUCTION", - "build:single:packages": "node ../../scripts/build-single-packages.js --config single-packages.config.json", + "build:single:packages": "node ../../scripts/build-single-packages.mjs --config single-packages.config.json", "clean": "rimraf dist components deprecated", - "subpaths": "node ../../scripts/exportSubpaths.js --config subpaths.config.json" + "subpaths": "node ../../scripts/exportSubpaths.mjs --config subpaths.config.json" }, "dependencies": { "@patternfly/react-core": "workspace:^", diff --git a/packages/react-templates/rollup.config.js b/packages/react-templates/rollup.config.js deleted file mode 100644 index aad9805a088..00000000000 --- a/packages/react-templates/rollup.config.js +++ /dev/null @@ -1,7 +0,0 @@ -const { name } = require('./package.json'); -const baseConfig = require('../rollup.base'); - -module.exports = baseConfig({ - packageName: name.replace('@patternfly/', ''), - name: 'PatternFlyTemplates' -}); diff --git a/packages/react-tokens/package.json b/packages/react-tokens/package.json index 6471c519153..488403cfc68 100644 --- a/packages/react-tokens/package.json +++ b/packages/react-tokens/package.json @@ -25,7 +25,7 @@ }, "homepage": "https://github.com/patternfly/patternfly-react#readme", "scripts": { - "generate": "yarn clean && node scripts/writeTokens.js", + "generate": "yarn clean && node scripts/writeTokens.mjs", "clean": "rimraf dist" }, "devDependencies": { diff --git a/packages/react-tokens/scripts/generateTokens.js b/packages/react-tokens/scripts/generateTokens.mjs similarity index 96% rename from packages/react-tokens/scripts/generateTokens.js rename to packages/react-tokens/scripts/generateTokens.mjs index afe495d3c5c..2e0dad8751a 100644 --- a/packages/react-tokens/scripts/generateTokens.js +++ b/packages/react-tokens/scripts/generateTokens.mjs @@ -1,8 +1,10 @@ -const { glob } = require('glob'); -const { dirname, basename, sep } = require('path'); -const { parse, stringify } = require('css'); -const { readFileSync } = require('fs'); +import { glob } from 'glob'; +import { createRequire } from 'node:module'; +import { dirname, basename, sep } from 'node:path'; +import { parse, stringify } from 'css'; +import { readFileSync } from 'node:fs'; +const require = createRequire(import.meta.url); const pfStylesDir = dirname(require.resolve('@patternfly/patternfly/patternfly.css')); const version = 'v6'; @@ -91,7 +93,7 @@ const getLocalVarsMap = (cssFiles) => { * } * } */ -function generateTokens() { +export function generateTokens() { const cssFiles = glob .sync(['{**/{components,layouts}/**/*.css', '**/patternfly-charts.css', '**/patternfly-variables.css}'].join(','), { cwd: pfStylesDir, @@ -249,7 +251,3 @@ function generateTokens() { return fileTokens; } - -module.exports = { - generateTokens -}; diff --git a/packages/react-tokens/scripts/writeTokens.js b/packages/react-tokens/scripts/writeTokens.mjs similarity index 93% rename from packages/react-tokens/scripts/writeTokens.js rename to packages/react-tokens/scripts/writeTokens.mjs index 3f8b7eebe1f..cc2aa0b749d 100644 --- a/packages/react-tokens/scripts/writeTokens.js +++ b/packages/react-tokens/scripts/writeTokens.mjs @@ -1,8 +1,8 @@ -const { outputFileSync } = require('fs-extra'); -const { resolve, join } = require('path'); -const { generateTokens } = require('./generateTokens'); +import { outputFileSync } from 'fs-extra/esm'; +import { resolve, join } from 'node:path'; +import { generateTokens } from './generateTokens.mjs'; -const outDir = resolve(__dirname, '../dist'); +const outDir = resolve(import.meta.dirname, '../dist'); const writeESMExport = (tokenName, tokenString) => outputFileSync( diff --git a/plopfile.js b/plopfile.js deleted file mode 100644 index 86f4e0f5468..00000000000 --- a/plopfile.js +++ /dev/null @@ -1,12 +0,0 @@ -const { setActionTypes } = require('./scripts/generators/actionTypes'); -const { setHelpers } = require('./scripts/generators/helpers'); -const setPFGenerators = require('./scripts/generators/patternfly-component'); -const setPackageGenerators = require('./scripts/generators/package'); - -module.exports = (plop) => { - setHelpers(plop); - setActionTypes(plop); - - setPFGenerators(plop); - setPackageGenerators(plop); -}; diff --git a/plopfile.mjs b/plopfile.mjs new file mode 100644 index 00000000000..7daed77cabe --- /dev/null +++ b/plopfile.mjs @@ -0,0 +1,12 @@ +import { setActionTypes } from './scripts/generators/actionTypes.mjs'; +import { setHelpers } from './scripts/generators/helpers.mjs'; +import setPFGenerators from './scripts/generators/patternfly-component/index.mjs'; +import setPackageGenerators from './scripts/generators/package/index.mjs'; + +export default function (plop) { + setHelpers(plop); + setActionTypes(plop); + + setPFGenerators(plop); + setPackageGenerators(plop); +} diff --git a/scripts/build-single-packages.js b/scripts/build-single-packages.mjs similarity index 93% rename from scripts/build-single-packages.js rename to scripts/build-single-packages.mjs index 27bf244b520..afa1bfd3c13 100644 --- a/scripts/build-single-packages.js +++ b/scripts/build-single-packages.mjs @@ -1,9 +1,11 @@ /* eslint-disable no-console */ -const fse = require('fs-extra'); -const path = require('path'); -const { glob } = require('glob'); -const getDynamicModuleMap = require('./parse-dynamic-modules'); +import fse from 'fs-extra'; +import { createRequire } from 'node:module'; +import path from 'node:path'; +import { glob } from 'glob'; +import getDynamicModuleMap from './parse-dynamic-modules.mjs'; +const require = createRequire(import.meta.url); const root = process.cwd(); const packageJson = require(`${root}/package.json`); diff --git a/scripts/exportSubpaths.js b/scripts/exportSubpaths.mjs similarity index 90% rename from scripts/exportSubpaths.js rename to scripts/exportSubpaths.mjs index aa7e39ab25e..beac3af5e9c 100644 --- a/scripts/exportSubpaths.js +++ b/scripts/exportSubpaths.mjs @@ -1,7 +1,9 @@ /* eslint-disable no-console */ -const fse = require('fs-extra'); -const path = require('path'); +import fse from 'fs-extra'; +import { createRequire } from 'node:module'; +import path from 'node:path'; +const require = createRequire(import.meta.url); const root = process.cwd(); const packageJson = require(`${root}/package.json`); diff --git a/scripts/generators/actionTypes.js b/scripts/generators/actionTypes.mjs similarity index 79% rename from scripts/generators/actionTypes.js rename to scripts/generators/actionTypes.mjs index db3bc96659d..3576ae50052 100644 --- a/scripts/generators/actionTypes.js +++ b/scripts/generators/actionTypes.mjs @@ -1,9 +1,9 @@ -const path = require('path'); -const fs = require('fs-extra'); +import path from 'node:path'; +import fs from 'fs-extra'; -const ADD_TO_BARREL_FILE = 'addToBarrelFile'; +export const ADD_TO_BARREL_FILE = 'addToBarrelFile'; -function setActionTypes(plop) { +export function setActionTypes(plop) { plop.setActionType(ADD_TO_BARREL_FILE, addToBarrelFile); } @@ -29,8 +29,3 @@ async function addToBarrelFile(answers, config, plop) { await fs.outputFile(pathToFile, updatedLines.join('\n')); return `-> ${pathToFile}`; } - -module.exports = { - setActionTypes, - ADD_TO_BARREL_FILE -}; diff --git a/scripts/generators/helpers.js b/scripts/generators/helpers.js deleted file mode 100644 index ce320befff7..00000000000 --- a/scripts/generators/helpers.js +++ /dev/null @@ -1,10 +0,0 @@ -const REMOVE_NPM_SCOPE = 'removeNPMScope'; - -function setHelpers(plop) { - plop.setHelper(REMOVE_NPM_SCOPE, (text) => text.replace(/^@patternfly\//i, '')); -} - -module.exports = { - REMOVE_NPM_SCOPE, - setHelpers -}; diff --git a/scripts/generators/helpers.mjs b/scripts/generators/helpers.mjs new file mode 100644 index 00000000000..5db80307597 --- /dev/null +++ b/scripts/generators/helpers.mjs @@ -0,0 +1,5 @@ +export const REMOVE_NPM_SCOPE = 'removeNPMScope'; + +export function setHelpers(plop) { + plop.setHelper(REMOVE_NPM_SCOPE, (text) => text.replace(/^@patternfly\//i, '')); +} diff --git a/scripts/generators/package/index.js b/scripts/generators/package/index.mjs similarity index 74% rename from scripts/generators/package/index.js rename to scripts/generators/package/index.mjs index a31360391c6..3be3a0c1170 100644 --- a/scripts/generators/package/index.js +++ b/scripts/generators/package/index.mjs @@ -1,9 +1,9 @@ -const { join, resolve } = require('path'); -const { REMOVE_NPM_SCOPE } = require('../helpers'); +import { join, resolve } from 'node:path'; +import { REMOVE_NPM_SCOPE } from '../helpers.mjs'; -const packagesRoot = resolve(__dirname, '../../../packages'); +const packagesRoot = resolve(import.meta.dirname, '../../../packages'); -function setPackageGenerators(plop) { +export default function setPackageGenerators(plop) { plop.setGenerator('Package', { description: 'A new package for the monorepo', prompts: [ @@ -30,7 +30,7 @@ function setPackageGenerators(plop) { { type: 'add', path: join(packageBaseTemplate, `package.json`), - templateFile: resolve(__dirname, './package.json.hbs') + templateFile: resolve(import.meta.dirname, './package.json.hbs') }, { type: 'add', @@ -42,17 +42,17 @@ function setPackageGenerators(plop) { answers.buildsWithTypescript && { type: 'add', path: join(packageBaseTemplate, `.npmignore`), - templateFile: resolve(__dirname, './.npmignore') + templateFile: resolve(import.meta.dirname, './.npmignore') }, answers.buildsWithTypescript && { type: 'add', path: join(packageBaseTemplate, `tsconfig.json`), - templateFile: resolve(__dirname, './tsconfig.json') + templateFile: resolve(import.meta.dirname, './tsconfig.json') }, answers.buildsWithTypescript && { type: 'add', path: join(packageBaseTemplate, `tsconfig.cjs.json`), - templateFile: resolve(__dirname, './tsconfig.cjs.json') + templateFile: resolve(import.meta.dirname, './tsconfig.cjs.json') }, { type: 'add', @@ -63,5 +63,3 @@ function setPackageGenerators(plop) { } }); } - -module.exports = setPackageGenerators; diff --git a/scripts/generators/patternfly-component/index.js b/scripts/generators/patternfly-component/index.mjs similarity index 84% rename from scripts/generators/patternfly-component/index.js rename to scripts/generators/patternfly-component/index.mjs index 03231fed4fa..7d0978873cc 100644 --- a/scripts/generators/patternfly-component/index.js +++ b/scripts/generators/patternfly-component/index.mjs @@ -1,8 +1,8 @@ -const { join, resolve } = require('path'); -const { ADD_TO_BARREL_FILE } = require('../actionTypes'); +import { join, resolve } from 'node:path'; +import { ADD_TO_BARREL_FILE } from '../actionTypes.mjs'; -const templatesDir = resolve(__dirname, './templates'); -const reactCoreRoot = resolve(__dirname, '../../../packages/react-core'); +const templatesDir = resolve(import.meta.dirname, './templates'); +const reactCoreRoot = resolve(import.meta.dirname, '../../../packages/react-core'); const componentTypes = new Map([ ['component', 'components'], @@ -10,7 +10,7 @@ const componentTypes = new Map([ ['internal', 'internal'] ]); -function setPFGenerators(plop) { +export default function setPFGenerators(plop) { plop.setGenerator('PatternFly Component', { description: 'Component or Layout for PatternFly react-core package', prompts: [ @@ -62,5 +62,3 @@ function setPFGenerators(plop) { } }); } - -module.exports = setPFGenerators; diff --git a/scripts/parse-dynamic-modules.js b/scripts/parse-dynamic-modules.mjs similarity index 93% rename from scripts/parse-dynamic-modules.js rename to scripts/parse-dynamic-modules.mjs index 96f04e7b090..ce20459993f 100644 --- a/scripts/parse-dynamic-modules.js +++ b/scripts/parse-dynamic-modules.mjs @@ -1,11 +1,14 @@ /* eslint-disable no-console */ -const fs = require('fs-extra'); -const path = require('path'); -const { glob } = require('glob'); -const ts = require('typescript'); +import fs from 'fs-extra'; +import { createRequire } from 'node:module'; +import path from 'node:path'; +import { glob } from 'glob'; +import ts from 'typescript'; + +const require = createRequire(import.meta.url); /** @type {ts.CompilerOptions} */ -const tsConfigBase = require(path.resolve(__dirname, '../packages/tsconfig.base.json')); +const tsConfigBase = require(path.resolve(import.meta.dirname, '../packages/tsconfig.base.json')); /** @type {ts.CompilerOptions} */ const defaultCompilerOptions = { @@ -156,4 +159,4 @@ const getDynamicModuleMap = ( }, {}); }; -module.exports = getDynamicModuleMap; +export default getDynamicModuleMap;