Skip to content
Closed
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
37 changes: 23 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,61 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# 15.1.1 - 2025-12-19

## Unreleased

### Fixed
- Port allocation no longer race condition. #TINY-12048

### Changed
- Migrated to ESM-only modules. #TINY-13539
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would've preferred this to be it's own PR, adding in codebase-wide chore tasks to a combined PR makes it harder to pick out the important things for a review. Also, the github UI has a limit on how many files can be expanded by default so it's much slower to review the important parts.

- Moved compiled content to scratch directory tied to run name. #TINY-12048

## 15.1.1 - 2025-12-19

### Fixed
- Fixed an issue where using bedrock-auto with rspack bundling resulted in an error. #TINY-13550

# 15.1.0 - 2025-12-17
## 15.1.0 - 2025-12-17

## Added
### Added
- Add rspack dev server support. #TINY-12824

## 15.0.4 - 2025-10-22

## Changed
### Changed
- Swapped out `msw` for `agar-sw`. #TINY-13085

## 15.0.3 - 2025-10-15

## Fixed
### Fixed
- Fixed an issue where `remapper` was still referenced in the webpack config. #TINY-12932

## 15.0.2 - 2025-02-03

## Improved
### Improved
- Remote webdriver session ID is now logged after connecting #TINY-10835

## Fixed
### Fixed
- Failing tests that retry and then pass could exceed the "tests crashed" server timeout #TINY-11177

## 15.0.1 - 2025-01-27

## Fixed
### Fixed
- AWS remote testing idle timeout was not set #TINY-11177

## 15.0.0 - 2025-01-27

## Added
### Added
- New server-side APIs to accept a batch of results instead of a single result #TINY-11177

## Changed
### Changed
- Reverted TINY-10708 which was a server-side fix
- Client no longer waits for log requests to complete between tests, which should speed up remote testing #TINY-11177
- Console HUD no longer updates for individual tests #TINY-11177
- Client now posts test status only in batches every 30 seconds, this is the only time the console HUD will update #TINY-11177
- Server now controls the remote webdriver idle timeout, and makes sure a keep-alive command is sent regularly

## Removed
### Removed
- Single result server-side API #TINY-11177
- Server-side monitoring of single test timeouts. This is still monitored client side. #TINY-11177
- The Promise polyfill is no longer allowed on modern NodeJS frameworks so it has been removed. #TINY-11177
Expand Down Expand Up @@ -103,7 +112,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## 13.6.0 - 2023-10-16

## Improved
### Improved

- Urls like `/project/node_modules` and `/project/<package name>/node_modules` are now using node package resolve to serve files. #TINY-10281

Expand Down Expand Up @@ -154,7 +163,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Images (svg, png, gif, jpg, etc...) can now be imported by tests, and will be available as data URIs using the `asset/inline` webpack loader.

## Improved
### Improved
- The mouse position reset logic now only runs when required, instead of for every test.

## 13.0.1 - 2022-02-01
Expand Down
55 changes: 23 additions & 32 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
standardProperties()

timestamps {
tinyPods.node(
tinyPods.nodeBrowser(
tag: '20',
resourceRequestMemory: '2Gi',
resourceLimitMemory: '2Gi'
resourceRequestMemory: '3Gi',
resourceLimitMemory: '3Gi',
) {
stage("clean") {
exec('yarn clean')
Expand All @@ -26,44 +26,35 @@ timestamps {
stage("test") {
exec('yarn test')
}
}

// Testing
stage("bedrock testing") {
bedrockRemoteBrowsers(
testContainer: [
resourceRequestMemory: '2Gi',
resourceLimitMemory: '2Gi',
],
platforms: [
[ browser: 'chrome', provider: 'aws', buckets: 2 ],
[ browser: 'firefox', provider: 'aws', buckets: 2 ],
[ browser: 'edge', provider: 'lambdatest', buckets: 1 ],
[ browser: 'chrome', provider: 'lambdatest', os: 'macOS Sonoma', buckets: 1 ],
[ browser: 'firefox', provider: 'lambdatest', os: 'macOS Sonoma', buckets: 1 ],
[ browser: 'safari', provider: 'lambdatest', os: 'macOS Sonoma', buckets: 1 ],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there no Safari anymore?

  • bring back Safari

],
prepareTests: {
yarnInstall()
sh 'yarn build'
},
def platforms = [
[ browser: 'chrome', provider: 'lambdatest', os: 'macOS Sonoma', buckets: 1],
[ browser: 'edge', provider: 'lambdatest', buckets: 1],
[ browser: 'chrome', provider: 'aws', buckets: 2 ],
[ browser: 'firefox', provider: 'aws', buckets: 2 ],
[ browser: 'chrome', provider: 'headless' ]
]

def cleanBranchName = (env.BRANCH_NAME ?: "").split('/').last()
def testPrefix = "Bedrock_${cleanBranchName}-b${env.BUILD_NUMBER}"

bedrockLocalBrowsers(
testDirs: [ 'modules/sample/src/test/ts/**/pass' ],
custom: '--config modules/sample/tsconfig.json --customRoutes modules/sample/routes.json'
custom: "--config modules/sample/tsconfig.json --customRoutes modules/sample/routes.json",
platforms: platforms,
prefix: testPrefix
)
}

// Publish
if (isReleaseBranch()) {
stage("publish") {
tinyPods.node() {
yarnInstall()
sh 'yarn build'
if (isReleaseBranch()) {
echo "Publish?"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

tinyNpm.withNpmPublishCredentials {
// We need to tell git to ignore the changes to .npmrc when publishing
exec('git update-index --assume-unchanged .npmrc')
// Re-evaluate whether we still need the `--no-verify-access` flag after upgrading Lerna (TINY-13539)
exec('yarn lerna publish from-package --yes --no-git-reset --ignore @ephox/bedrock-sample --no-verify-access')
exec('yarn lerna publish from-package --yes --no-git-reset --ignore @ephox/bedrock-sample')
}
} else {
echo "No release branch: nothing to publish"
}
}
}
Expand Down
77 changes: 77 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// eslint.config.js
import path from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";
import tsParser from '@typescript-eslint/parser'
import tsPlugin from '@typescript-eslint/eslint-plugin'

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname
})

// module.exports = [
export default [
...compat.extends('plugin:@typescript-eslint/recommended'),
{
files: ['**/*.{ts,tsx,js,jsx}'],

plugins: {
'@typescript-eslint': tsPlugin,
},

// Equivalent of env: { browser: true }
languageOptions: {
parser: tsParser,
parserOptions: {
sourceType: 'module',
},
globals: {
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
console: 'readonly',
},
},

rules: {
// Typescript-eslint rules
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_'
},
],
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/explicit-module-boundary-types': [
'error',
{ allowArgumentsExplicitlyTypedAsAny: true },
],

// Core stylistic rules
'arrow-spacing': 'error',
'no-multi-spaces': ['error', { ignoreEOLComments: true }],
'no-multiple-empty-lines': ['error', { max: 1 }],
'object-shorthand': 'error',
'quotes': ['error', 'single', { allowTemplateLiterals: true }],
'space-before-function-paren': [
'error',
{ anonymous: 'always', named: 'never' },
],
'semi': 'error',
'spaced-comment': 'error',
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'space-before-blocks': 'error',
},
},
];
10 changes: 6 additions & 4 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"version": "15.1.1",
"publish": {
"push": false
}
"command": {
"publish": {
"verifyAccess": false
}
},
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
3 changes: 2 additions & 1 deletion modules/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"prepublishOnly": "tsc -b",
"build": "yarn prepublishOnly",
"test": "mocha -r esm 'lib/test/ts/**/*Test.js'",
"test": "mocha 'lib/test/ts/**/*Test.js'",
"buildAndTest": "yarn prepublishOnly && yarn test"
},
"dependencies": {
Expand All @@ -16,6 +16,7 @@
"main": "./lib/main/ts/api/Main.js",
"module": "./lib/main/ts/api/Main.js",
"types": "./lib/main/ts/api/Main.d.ts",
"type": "module",
"files": [
"lib/**",
"src/**"
Expand Down
2 changes: 1 addition & 1 deletion modules/client/src/main/ts/api/Assert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const throwsError = (message: TestLabel, f: () => void, expected?: string): void
const succeeds = (message: TestLabel, f: () => void): void => {
try {
f();
} catch (e) {
} catch (_e) {
throw new Error('Expected function to not throw, but it did.\n' + TestLabel.asString(message));
}
};
Expand Down
6 changes: 3 additions & 3 deletions modules/client/src/main/ts/api/Main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LoggedError, TestError, TestLabel } from '@ephox/bedrock-common';
import { after, afterEach, before, beforeEach, context, describe, it, specify, xcontext, xdescribe, xspecify, xit } from './Bdd';
import * as Assert from './Assert';
import * as UnitTest from './UnitTest';
import { after, afterEach, before, beforeEach, context, describe, it, specify, xcontext, xdescribe, xspecify, xit } from './Bdd.js';
import * as Assert from './Assert.js';
import * as UnitTest from './UnitTest.js';

export {
before,
Expand Down
2 changes: 1 addition & 1 deletion modules/client/src/main/ts/api/UnitTest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Context, Failure, TestError, TestLabel, TestLogs } from '@ephox/bedrock-common';
import { describe, it } from './Bdd';
import { describe, it } from './Bdd.js';

type TestLogs = TestLogs.TestLogs;
type TestError = TestError.TestError;
Expand Down
2 changes: 1 addition & 1 deletion modules/client/src/test/ts/api/AssertTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Testable } from '@ephox/dispute';
import * as chai from 'chai';
import * as fc from 'fast-check';
import { describe, it } from 'mocha';
import { Assert } from '../../../main/ts/api/Main';
import { Assert } from '../../../main/ts/api/Main.js';

const { tArray, tString } = Testable;

Expand Down
6 changes: 3 additions & 3 deletions modules/client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"compilerOptions": {
"moduleResolution": "node",
"moduleResolution": "nodenext",
"strict": true,
"noUnusedLocals": true,
"useUnknownInCatchVariables": false,
"target": "es2019",
"module": "es2020",
"target": "es2020",
"module": "nodenext",
"lib": ["es2022", "dom"],
"declaration": true,
"sourceMap": true,
Expand Down
5 changes: 3 additions & 2 deletions modules/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
"scripts": {
"prepublishOnly": "tsc -b",
"build": "yarn prepublishOnly",
"test": "mocha -r esm 'lib/test/ts/**/*Test.js'",
"test": "mocha 'lib/test/ts/**/*Test.js'",
"buildAndTest": "yarn prepublishOnly && yarn test"
},
"main": "./lib/main/ts/api/Main.js",
"module": "./lib/main/ts/api/Main.js",
"types": "./lib/main/ts/api/Main.d.ts",
"type": "module",
"files": [
"lib/**",
"src/**"
Expand All @@ -21,6 +22,6 @@
"registry": "https://registry.npmjs.org"
},
"dependencies": {
"diff": "^5.0.0"
"diff": "^8.0.2"
}
}
7 changes: 3 additions & 4 deletions modules/common/src/main/ts/api/Differ.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import * as JsDiff from 'diff';
import { ArrayChange } from 'diff';
import { htmlentities } from './StringUtils';
import { htmlentities } from './StringUtils.js';

export const diffPrettyHtml = (text1: string, text2: string): string => {
const changes: ArrayChange<string>[] = JsDiff.diffArrays(text1.split('\n'), text2.split('\n'));
const changes: ReturnType<typeof JsDiff.diffArrays<string>> = JsDiff.diffArrays(text1.split('\n'), text2.split('\n'));
const lines = changes.map((c) => {
const prefix = (c.removed ? '<del style="background:#ffe6e6;">' : c.added ? '<ins style="background:#e6ffe6;">' : '<span>');
const suffix = (c.removed ? '</del>' : c.added ? '</ins>' : '</span>');
Expand All @@ -15,7 +14,7 @@ export const diffPrettyHtml = (text1: string, text2: string): string => {
};

export const diffPrettyText = (text1: string, text2: string): string => {
const changes: ArrayChange<string>[] = JsDiff.diffArrays(text1.split('\n'), text2.split('\n'));
const changes: ReturnType<typeof JsDiff.diffArrays<string>> = JsDiff.diffArrays(text1.split('\n'), text2.split('\n'));
const lines = changes.map((c) => {
const prefix = (c.removed ? '-' : c.added ? '+' : ' ') + ' | ';
const texts = c.value;
Expand Down
Loading
Loading