Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 31 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,29 +106,29 @@
"@commitlint/cz-commitlint": "19.5.0",
"@fontsource/roboto": "5.1.0",
"@fontsource/roboto-mono": "5.1.0",
"@nx/cypress": "21.2.3",
"@nx/devkit": "21.2.3",
"@nx/esbuild": "21.2.3",
"@nx/eslint": "21.2.3",
"@nx/eslint-plugin": "21.2.3",
"@nx/express": "21.2.3",
"@nx/jest": "21.2.3",
"@nx/js": "21.2.3",
"@nx/module-federation": "21.2.3",
"@nx/node": "21.2.3",
"@nx/react": "21.2.3",
"@nx/rollup": "21.2.3",
"@nx/rspack": "21.2.3",
"@nx/storybook": "21.2.3",
"@nx/vite": "21.2.3",
"@nx/web": "21.2.3",
"@nx/webpack": "21.2.3",
"@nx/cypress": "21.5.3",
"@nx/devkit": "21.5.3",
"@nx/esbuild": "21.5.3",
"@nx/eslint": "21.5.3",
"@nx/eslint-plugin": "21.5.3",
"@nx/express": "21.5.3",
"@nx/jest": "21.5.3",
"@nx/js": "21.5.3",
"@nx/module-federation": "21.5.3",
"@nx/node": "21.5.3",
"@nx/react": "21.5.3",
"@nx/rollup": "21.5.3",
"@nx/rspack": "21.5.3",
"@nx/storybook": "21.5.3",
"@nx/vite": "21.5.3",
"@nx/web": "21.5.3",
"@nx/webpack": "21.5.3",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.15",
"@rollup/plugin-alias": "5.1.1",
"@rollup/plugin-replace": "6.0.1",
"@rslib/core": "^0.10.4",
"@rspack/core": "1.3.9",
"@rspack/dev-server": "1.1.1",
"@rspack/core": "1.5.7",
"@rspack/dev-server": "1.1.4",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
Expand All @@ -141,7 +141,7 @@
"@swc/cli": "0.6.0",
"@swc/core": "1.7.26",
"@swc/helpers": "0.5.13",
"@swc/jest": "0.2.36",
"@swc/jest": "0.2.39",
"@tailwindcss/forms": "0.5.9",
"@testing-library/react": "16.1.0",
"@types/adm-zip": "0.5.5",
Expand All @@ -150,7 +150,7 @@
"@types/eslint": "~8.37.0",
"@types/express": "4.17.21",
"@types/fs-extra": "9.0.13",
"@types/jest": "29.5.13",
"@types/jest": "30.0.0",
"@types/lodash.clonedeepwith": "^4.5.9",
"@types/lodash.get": "4.4.9",
"@types/node": "18.16.9",
Expand All @@ -163,7 +163,7 @@
"@vitest/coverage-v8": "1.6.0",
"@vitest/ui": "1.6.0",
"autoprefixer": "10.4.20",
"babel-jest": "29.7.0",
"babel-jest": "30.0.5",
"babel-loader": "9.2.1",
"classnames": "2.5.1",
"commitizen": "^4.3.0",
Expand All @@ -187,17 +187,17 @@
"highlight.js": "11.10.0",
"html-webpack-plugin": "5.6.2",
"husky": "8.0.3",
"jest": "29.7.0",
"jest": "30.0.5",
"jest-cli": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"jest-environment-jsdom": "30.0.5",
"jest-environment-node": "29.7.0",
"jiti": "2.4.2",
"js-yaml": "4.1.0",
"kill-port": "^2.0.1",
"mime-types": "2.1.35",
"msw": "^1.2.1",
"node-fetch": "~3.3.2",
"nx": "21.2.3",
"nx": "21.5.3",
"open": "^10.1.0",
"postcss-calc": "9.0.1",
"postcss-custom-properties": "13.3.12",
Expand All @@ -214,24 +214,25 @@
"swc-loader": "0.2.6",
"tailwindcss": "3.4.13",
"terser-webpack-plugin": "^5.3.10",
"ts-jest": "29.1.5",
"ts-jest": "29.4.4",
"ts-node": "10.9.1",
"tslib": "2.8.1",
"tsup": "7.3.0",
"typescript": "5.8.3",
"typescript": "5.9.2",
"url-loader": "4.1.1",
"verdaccio": "6.1.2",
"vite": "6.3.5",
"vite": "7.1.7",
"vite-tsconfig-paths": "4.2.3",
"vitest": "1.6.0",
"vitest-fetch-mock": "^0.2.2",
"vue-tsc": "^2.2.10",
"wait-on": "^7.2.0",
"webpack": "5.98.0",
"webpack": "5.101.3",
"webpack-cli": "^5.1.4",
"webpack-virtual-modules": "0.6.2",
"whatwg-fetch": "^3.6.20",
"yargs": "^17.7.2"
"yargs": "^17.7.2",
"jest-util": "30.0.5"
},
"config": {
"commitizen": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
module.exports = {
displayName: 'bridge-react',
preset: '../../../jest.preset.js',
transform: {
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge/bridge-react/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "packages/bridge/bridge-react/jest.config.ts",
"jestConfig": "packages/bridge/bridge-react/jest.config.cjs",
"passWithNoTests": true
}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/cli/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
"assets": [],
"project": "packages/cli/package.json",
"rollupConfig": "packages/cli/rollup.config.js",
"compiler": "swc",
"compiler": "tsc",
"format": ["cjs"],
"generatePackageJson": false,
"useLegacyTypescriptPlugin": false
"useLegacyTypescriptPlugin": false,
"sourceMap": true
}
},
"lint": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable */
export default {
module.exports = {
displayName: 'core',
preset: '../../jest.preset.js',
globals: {},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/packages/core"],
"options": {
"jestConfig": "packages/core/jest.config.ts",
"jestConfig": "packages/core/jest.config.cjs",
"passWithNoTests": true
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utils/common.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ describe('Common utils', () => {
extractUrlAndGlobal('test');
};

expect(extract).toThrowError('Invalid request "test"');
expect(extract).toThrow('Invalid request "test"');
});
});
5 changes: 3 additions & 2 deletions packages/data-prefetch/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
"assets": [],
"project": "packages/data-prefetch/package.json",
"rollupConfig": "packages/data-prefetch/rollup.config.cjs",
"compiler": "swc",
"compiler": "tsc",
"format": ["cjs", "esm"],
"generatePackageJson": false,
"useLegacyTypescriptPlugin": false
"useLegacyTypescriptPlugin": false,
"sourceMap": true
}
},
"test": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
/* eslint-disable */
import { readFileSync, rmdirSync, existsSync } from 'fs';
import path from 'path';
import os from 'os';
const rimraf = require('rimraf');
const { readFileSync, rmSync } = require('fs');
const path = require('path');
const os = require('os');

// Reading the SWC compilation config and remove the "exclude"
// for the test files to be compiled by SWC
const { exclude: _, ...swcJestConfig } = JSON.parse(
readFileSync(`${__dirname}/.swcrc`, 'utf-8'),
);
const swcrcRaw = readFileSync(path.join(__dirname, '.swcrc'), 'utf-8');
const swcrcJson = swcrcRaw.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, '');
const { exclude: _, ...swcJestConfig } = JSON.parse(swcrcJson);

rimraf.sync(__dirname + '/test/js');
rmSync(path.join(__dirname, 'test/js'), { recursive: true, force: true });

// disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves.
// If we do not disable this, SWC Core will read .swcrc and won't transform our test files due to "exclude"
if (swcJestConfig.swcrc === undefined) {
swcJestConfig.swcrc = false;
}

// Uncomment if using global setup/teardown files being transformed via swc
// https://nx.dev/packages/jest/documents/overview#global-setup/teardown-with-nx-libraries
// jest needs EsModule Interop to find the default exported setup/teardown functions
// swcJestConfig.module.noInterop = false;

export default {
module.exports = {
displayName: 'enhanced',
preset: '../../jest.preset.js',
cacheDirectory: path.join(os.tmpdir(), 'enhanced'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ const { mkdirpSync } = require(
normalizeWebpackPath('webpack/lib/util/fs'),
) as typeof import('webpack/lib/util/fs');

type WebpackFileSystem = Parameters<typeof mkdirpSync>[0];
type CompatibleFileSystem = {
mkdirSync?: (path: string) => void;
readFileSync?: (path: string) => Buffer | string;
writeFileSync?: (path: string, data: string | Buffer) => void;
writeFile?: (
path: string,
data: string | Buffer,
callback: (err?: NodeJS.ErrnoException | null) => void,
) => void;
};

const RuntimeToolsPath = require.resolve(
'@module-federation/runtime-tools/dist/index.esm.js',
);
Expand Down Expand Up @@ -196,19 +208,41 @@ class FederationRuntimePlugin {
return;
}
const filePath = this.entryFilePath;
const outputFs = compiler.outputFileSystem as
| CompatibleFileSystem
| undefined;

try {
fs.readFileSync(filePath);
if (outputFs?.readFileSync) {
outputFs.readFileSync(filePath);
} else {
fs.readFileSync(filePath);
}
} catch (err) {
mkdirpSync(fs, TEMP_DIR);
fs.writeFileSync(
filePath,
FederationRuntimePlugin.getTemplate(
compiler,
this.options,
this.bundlerRuntimePath,
this.options.experiments,
),
const content = FederationRuntimePlugin.getTemplate(
compiler,
this.options,
this.bundlerRuntimePath,
this.options.experiments,
);

if (outputFs?.mkdirSync) {
mkdirpSync(outputFs as unknown as WebpackFileSystem, TEMP_DIR);
} else {
fs.mkdirSync(TEMP_DIR, { recursive: true });
}

if (outputFs?.writeFileSync) {
outputFs.writeFileSync(filePath, content);
} else if (outputFs?.writeFile) {
outputFs.writeFile(filePath, content, (error) => {
if (error) {
throw error;
}
});
} else {
fs.writeFileSync(filePath, content);
}
}
}

Expand Down
5 changes: 3 additions & 2 deletions packages/error-codes/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
"rollupConfig": "packages/error-codes/rollup.config.js",
"assets": [],
"project": "packages/error-codes/package.json",
"compiler": "swc",
"compiler": "tsc",
"format": ["cjs", "esm"],
"generatePackageJson": false,
"useLegacyTypescriptPlugin": false
"useLegacyTypescriptPlugin": false,
"sourceMap": true
},
"dependsOn": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
/* eslint-disable */
import { readFileSync } from 'fs';
const { readFileSync } = require('fs');
const path = require('path');

// Reading the SWC compilation config and remove the "exclude"
// for the test files to be compiled by SWC
const { exclude: _, ...swcJestConfig } = JSON.parse(
readFileSync(`${__dirname}/.swcrc`, 'utf-8'),
);
const swcrcRaw = readFileSync(path.join(__dirname, '.swcrc'), 'utf-8');
const swcrcJson = swcrcRaw.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, '');
const { exclude: _, ...swcJestConfig } = JSON.parse(swcrcJson);

// disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves.
// If we do not disable this, SWC Core will read .swcrc and won't transform our test files due to "exclude"
if (swcJestConfig.swcrc === undefined) {
swcJestConfig.swcrc = false;
}

// Uncomment if using global setup/teardown files being transformed via swc
// https://nx.dev/packages/jest/documents/overview#global-setup/teardown-with-nx-libraries
// jest needs EsModule Interop to find the default exported setup/teardown functions
// swcJestConfig.module.noInterop = false;

export default {
module.exports = {
displayName: 'runtime',
preset: '../../jest.preset.js',
transform: {
Expand Down
5 changes: 3 additions & 2 deletions packages/esbuild/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"tsConfig": "packages/esbuild/tsconfig.lib.json",
"assets": ["packages/esbuild/src/resolve"],
"project": "packages/esbuild/package.json",
"compiler": "swc",
"compiler": "tsc",
"rollupConfig": "packages/esbuild/rollup.config.js",
"format": ["cjs", "esm"],
"external": [
Expand All @@ -38,7 +38,8 @@
"../../resolve/esm-resolver.mjs"
],
"generatePackageJson": false,
"useLegacyTypescriptPlugin": false
"useLegacyTypescriptPlugin": false,
"sourceMap": true
},
"dependsOn": [
{
Expand Down
5 changes: 3 additions & 2 deletions packages/managers/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
"external": ["@module-federation/*"],
"project": "packages/managers/package.json",
"rollupConfig": "packages/managers/rollup.config.js",
"compiler": "swc",
"compiler": "tsc",
"format": ["cjs", "esm"],
"generatePackageJson": false,
"useLegacyTypescriptPlugin": false
"useLegacyTypescriptPlugin": false,
"sourceMap": true
}
},
"lint": {
Expand Down
5 changes: 3 additions & 2 deletions packages/manifest/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
"external": ["@module-federation/*"],
"project": "packages/manifest/package.json",
"rollupConfig": "packages/manifest/rollup.config.js",
"compiler": "swc",
"compiler": "tsc",
"format": ["cjs", "esm"],
"generatePackageJson": false,
"useLegacyTypescriptPlugin": false
"useLegacyTypescriptPlugin": false,
"sourceMap": true
}
},
"lint": {
Expand Down
Loading
Loading