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
2 changes: 1 addition & 1 deletion .github/workflows/ci-change.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:

- uses: actions/setup-node@v6
with:
node-version: '20'
node-version: '22'

- run: npx beachball check --changehint "Run 'yarn change' to generate a change file"
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- uses: actions/setup-node@v6
with:
cache: 'yarn'
node-version: '20'
node-version: '22'

- run: yarn install --immutable

Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
- uses: actions/setup-node@v6
with:
cache: 'yarn'
node-version: '20'
node-version: '22'

- run: echo number of CPUs "$(getconf _NPROCESSORS_ONLN)"

Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
if: steps.affected_projects_test_count.outputs.value > 0
# need to run this outside nx runner context to avoid https://github.com/nrwl/nx/issues/30562
run: |
yarn jest -c apps/react-${{ matrix.react }}-tests/jest.config.ts
yarn jest -c apps/react-${{ matrix.react }}-tests/jest.config.mjs
continue-on-error: true

- name: Integration tests summary
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- uses: actions/setup-node@v6
with:
cache: 'yarn'
node-version: '20'
node-version: '22'

- run: yarn install --immutable
- run: npx playwright install --with-deps
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
// @ts-check
/* eslint-disable */

import { existsSync, readdirSync, readFileSync } from 'node:fs';
import { resolve, join } from 'node: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(join(__dirname, '.swcrc'), 'utf-8')
readFileSync(join(import.meta.dirname, '.swcrc'), 'utf-8')
);

// 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;

const rootNodeModulesPath = join(__dirname, '../..', 'node_modules');
const nohoistNodeModulesPath = join(__dirname, 'node_modules');
const rootNodeModulesPath = join(import.meta.dirname, '../..', 'node_modules');
const nohoistNodeModulesPath = join(import.meta.dirname, 'node_modules');
const usedNodeModulesPath = existsSync(join(nohoistNodeModulesPath, 'react'))
? nohoistNodeModulesPath
: rootNodeModulesPath;

export default {
displayName: 'react-17-tests',
preset: '../../jest.preset.js',
Expand All @@ -46,57 +40,49 @@ export default {
),
},
};

/**
* Creates an array of paths to packages that don't have specific tags
* @returns {string[]} An array of paths to test
*/
function createRoots() {
const rootDir = resolve(__dirname, '../../packages/');
const rootDir = resolve(import.meta.dirname, '../../packages/');
return findValidPackagePaths(rootDir);

/**
* Recursively finds valid package paths that don't have excluded tags
* @param {string} dirPath - Directory to scan
* @returns {string[]} Array of valid package paths
*/
function findValidPackagePaths(dirPath: string) {
function findValidPackagePaths(dirPath) {
const entries = readdirSync(dirPath, { withFileTypes: true });
let validPaths = [] as string[];

/* @type {string[]} */
let validPaths = [];
// Check if current directory is a valid package
if (isValidPackage(dirPath)) {
validPaths.push(dirPath);
}

// Recursively check subdirectories
for (const entry of entries) {
if (entry.isDirectory()) {
const fullPath = join(dirPath, entry.name);
validPaths = validPaths.concat(findValidPackagePaths(fullPath));
}
}

return validPaths;
}

/**
* Checks if a directory is a valid package based on its project.json
* @param {string} packagePath - Path to potential package
* @returns {boolean} Whether the package is valid
*/
function isValidPackage(packagePath: string) {
function isValidPackage(packagePath) {
try {
const projectJsonPath = join(packagePath, 'project.json');

if (existsSync(projectJsonPath)) {
const projectJson = JSON.parse(readFileSync(projectJsonPath, 'utf8'));

return !['nx-plugin', 'houdini-utils', 'stylelint-plugin'].some(
(projectName) => projectName === projectJson.name
);
}

return false; // Only include directories with project.json
} catch (error) {
console.warn(`Error reading project.json for ${packagePath}:`, error);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
// @ts-check
/* eslint-disable */

const { readFileSync } = require('node:fs');
const { join } = require('node:path');
import { existsSync, readdirSync } from 'node:fs';
import { resolve } from 'node:path';

import { readFileSync, existsSync, readdirSync } from 'node:fs';
import { join, resolve } from 'node: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(join(__dirname, '.swcrc'), 'utf-8')
readFileSync(join(import.meta.dirname, '.swcrc'), 'utf-8')
);

// 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;

const rootNodeModulesPath = join(__dirname, '../..', 'node_modules');
const nohoistNodeModulesPath = join(__dirname, 'node_modules');
const rootNodeModulesPath = join(import.meta.dirname, '../..', 'node_modules');
const nohoistNodeModulesPath = join(import.meta.dirname, 'node_modules');
const usedNodeModulesPath = existsSync(join(nohoistNodeModulesPath, 'react'))
? nohoistNodeModulesPath
: rootNodeModulesPath;

export default {
displayName: 'react-18-tests',
preset: '../../jest.preset.js',
Expand All @@ -48,57 +40,49 @@ export default {
),
},
};

/**
* Creates an array of paths to packages that don't have specific tags
* @returns {string[]} An array of paths to test
*/
function createRoots() {
const rootDir = resolve(__dirname, '../../packages/');
const rootDir = resolve(import.meta.dirname, '../../packages/');
return findValidPackagePaths(rootDir);

/**
* Recursively finds valid package paths that don't have excluded tags
* @param {string} dirPath - Directory to scan
* @returns {string[]} Array of valid package paths
*/
function findValidPackagePaths(dirPath: string) {
function findValidPackagePaths(dirPath) {
const entries = readdirSync(dirPath, { withFileTypes: true });
let validPaths = [] as string[];

/* @type {string[]} */
let validPaths = [];
// Check if current directory is a valid package
if (isValidPackage(dirPath)) {
validPaths.push(dirPath);
}

// Recursively check subdirectories
for (const entry of entries) {
if (entry.isDirectory()) {
const fullPath = join(dirPath, entry.name);
validPaths = validPaths.concat(findValidPackagePaths(fullPath));
}
}

return validPaths;
}

/**
* Checks if a directory is a valid package based on its project.json
* @param {string} packagePath - Path to potential package
* @returns {boolean} Whether the package is valid
*/
function isValidPackage(packagePath: string) {
function isValidPackage(packagePath) {
try {
const projectJsonPath = join(packagePath, 'project.json');

if (existsSync(projectJsonPath)) {
const projectJson = JSON.parse(readFileSync(projectJsonPath, 'utf8'));

return !['nx-plugin', 'houdini-utils', 'stylelint-plugin'].some(
(projectName) => projectName === projectJson.name
);
}

return false; // Only include directories with project.json
} catch (error) {
console.warn(`Error reading project.json for ${packagePath}:`, error);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,26 @@
// @ts-check
/* eslint-disable */

const { readFileSync } = require('node:fs');
const { join } = require('node:path');
import { existsSync, readdirSync } from 'node:fs';
import { resolve } from 'node:path';

import { readFileSync, existsSync, readdirSync } from 'node:fs';
import { join, resolve } from 'node: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(join(__dirname, '.swcrc'), 'utf-8')
readFileSync(join(import.meta.dirname, '.swcrc'), 'utf-8')
);

// 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;

const rootNodeModulesPath = join(__dirname, '../..', 'node_modules');
const nohoistNodeModulesPath = join(__dirname, 'node_modules');
const rootNodeModulesPath = join(import.meta.dirname, '../..', 'node_modules');
const nohoistNodeModulesPath = join(import.meta.dirname, 'node_modules');
const usedNodeModulesPath = existsSync(join(nohoistNodeModulesPath, 'react'))
? nohoistNodeModulesPath
: rootNodeModulesPath;

export default {
displayName: 'react-19-tests',
preset: '../../jest.preset.js',
Expand All @@ -50,57 +42,49 @@ export default {
),
},
};

/**
* Creates an array of paths to packages that don't have specific tags
* @returns {string[]} An array of paths to test
*/
function createRoots() {
const rootDir = resolve(__dirname, '../../packages/');
const rootDir = resolve(import.meta.dirname, '../../packages/');
return findValidPackagePaths(rootDir);

/**
* Recursively finds valid package paths that don't have excluded tags
* @param {string} dirPath - Directory to scan
* @returns {string[]} Array of valid package paths
*/
function findValidPackagePaths(dirPath: string) {
function findValidPackagePaths(dirPath) {
const entries = readdirSync(dirPath, { withFileTypes: true });
let validPaths = [] as string[];

/* @type {string[]} */
let validPaths = [];
// Check if current directory is a valid package
if (isValidPackage(dirPath)) {
validPaths.push(dirPath);
}

// Recursively check subdirectories
for (const entry of entries) {
if (entry.isDirectory()) {
const fullPath = join(dirPath, entry.name);
validPaths = validPaths.concat(findValidPackagePaths(fullPath));
}
}

return validPaths;
}

/**
* Checks if a directory is a valid package based on its project.json
* @param {string} packagePath - Path to potential package
* @returns {boolean} Whether the package is valid
*/
function isValidPackage(packagePath: string) {
function isValidPackage(packagePath) {
try {
const projectJsonPath = join(packagePath, 'project.json');

if (existsSync(projectJsonPath)) {
const projectJson = JSON.parse(readFileSync(projectJsonPath, 'utf8'));

return !['nx-plugin', 'houdini-utils', 'stylelint-plugin'].some(
(projectName) => projectName === projectJson.name
);
}

return false; // Only include directories with project.json
} catch (error) {
console.warn(`Error reading project.json for ${packagePath}:`, error);
Expand Down
5 changes: 3 additions & 2 deletions beachball.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ module.exports = {
'**/*.spec.ts',
'**/*.component-browser-spec.tsx',
'**/*.stories.tsx',
'**/eslint.config.js',
'**/jest.config.js',
'**/eslint.config.{js,mjs}',
'**/jest.config.{ts,mts,cts,js,mjs,cjs}',
'**/playwright.config.ts',
'**/project.json',
'**/tsconfig.spec.json',
'**/*.md',
'**/*.babelrc',
'**/playwright/**',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: remove jest config from excludes",
"packageName": "@fluentui-contrib/azure-theme",
"email": "hochelmartin@gmail.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: remove jest config from excludes",
"packageName": "@fluentui-contrib/houdini-utils",
"email": "hochelmartin@gmail.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: remove jest config from excludes",
"packageName": "@fluentui-contrib/pierce-dom",
"email": "hochelmartin@gmail.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: remove jest config from excludes",
"packageName": "@fluentui-contrib/react-cap-theme",
"email": "hochelmartin@gmail.com",
"dependentChangeType": "none"
}
Loading