From 1eba6bf0d006a90ad0feb1cde7222ce1aa0548d4 Mon Sep 17 00:00:00 2001 From: William Wong Date: Tue, 30 Dec 2025 13:47:53 -0800 Subject: [PATCH 1/4] Add build-browser script --- CHANGELOG.md | 1 + package.json | 1 + packages/test/harness/package.json | 2 +- scripts/touch.mjs | 16 ++++++++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 scripts/touch.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d6701dd0e..c90e51481f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Legends: - ๐Ÿ› are known issues - ๐Ÿงช are experimental changes - ๐Ÿซ are samples +- ๐Ÿ‘ท๐Ÿป are development environment changes ## [Unreleased] diff --git a/package.json b/package.json index 5595bd19e4..c454508bc5 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "build": "npm run build:production && npm run build:html2-samples", "build:html2-samples": "cd __tests__/html2/samples/ && esbuild --bundle --format=esm --outbase=. --outdir=./dist/ --minify **/*.tsx --splitting", "build:production": "npm run build --if-present --workspaces", + "build-browser": "npm run build:run --workspace ./packages/test/harness", "bump": "npm run bump:prod && npm run bump:dev && (npm audit fix || exit 0) && npm run bump:packages && npm run bump:samples", "bump:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // []) as $L | (.devDependencies // {}) | to_entries | map(select(.key as $K | $L | contains([$K]) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install $PACKAGES_TO_BUMP || true", "bump:prod": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localPeerDependencies // []) as $L | (.dependencies // {}) | to_entries | map(select(.key as $K | $L | contains([$K]) | not)) | map(.key + \"@\" + ($P[.key] // [\"latest\"])[0]) | join(\" \")') && [ ! -z \"$PACKAGES_TO_BUMP\" ] && npm install --save-exact $PACKAGES_TO_BUMP || true", diff --git a/packages/test/harness/package.json b/packages/test/harness/package.json index 05b42cc6a4..5a5bd19238 100644 --- a/packages/test/harness/package.json +++ b/packages/test/harness/package.json @@ -16,7 +16,7 @@ "build:pre": "npm run build:pre:local-dependencies && npm run build:pre:watch", "build:pre:local-dependencies": "../../../scripts/npm/build-local-dependencies.sh", "build:pre:watch": "../../../scripts/npm/build-watch.sh", - "build:run": "concurrently --prefix-colors \"auto\" \"npm:build:run:esbuild:esm\" \"npm:build:run:esbuild:iife\" && touch ./package.json", + "build:run": "concurrently --prefix-colors \"auto\" \"npm:build:run:esbuild:esm\" \"npm:build:run:esbuild:iife\" && node ../../../scripts/touch.mjs ./package.json", "build:run:esbuild:base": "esbuild test-harness=./src/browser/index.js --bundle --define:define=undefined --define:process.env.CI=undefined --minify --outdir=dist --sourcemap --target=chrome100", "build:run:esbuild:esm": "npm run build:run:esbuild:base -- --format=esm --out-extension:.js=.mjs", "build:run:esbuild:iife": "npm run build:run:esbuild:base -- --format=iife", diff --git a/scripts/touch.mjs b/scripts/touch.mjs new file mode 100644 index 0000000000..59a773c154 --- /dev/null +++ b/scripts/touch.mjs @@ -0,0 +1,16 @@ +// Windows does not have "touch", and there are no common shell commands on Windows (cmd) and Linux that can do the job. + +/// + +import { closeSync, openSync, utimesSync } from 'fs'; + +// eslint-disable-next-line no-magic-numbers, no-undef, prefer-destructuring +const filename = process.argv[2]; + +// eslint-disable-next-line security/detect-non-literal-fs-filename +closeSync(openSync(filename, 'a')); + +const now = new Date(); + +// eslint-disable-next-line security/detect-non-literal-fs-filename +utimesSync(filename, now, now); From c2981748338a4b083fa5adb1b45735e2c0d83adb Mon Sep 17 00:00:00 2001 From: William Wong Date: Tue, 30 Dec 2025 13:49:39 -0800 Subject: [PATCH 2/4] Add entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c90e51481f..97cfd5db95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -148,6 +148,7 @@ Breaking changes in this release: - Debug into element: open F12, select the subject in Element pane, type `$0.webChat.debugger` - Breakpoint: open F12, select the subject in Element pane, type `$0.webChat.breakpoint.incomingActivity` - The `botframework-webchat` package now uses CSS modules for styling purposes, in PR [#5666](https://github.com/microsoft/BotFramework-WebChat/pull/5666), by [@OEvgeny](https://github.com/OEvgeny) +- ๐Ÿ‘ท๐Ÿป Added `npm run build-browser` script for building test browser-related packages only, in PR [#5667](https://github.com/microsoft/BotFramework-WebChat/pull/5667), by [@compulim](https://github.com/compulim) ### Changed From c6975a873f11583d230edcb63634d35e57dc9e53 Mon Sep 17 00:00:00 2001 From: William Wong Date: Tue, 30 Dec 2025 13:53:12 -0800 Subject: [PATCH 3/4] Add build-browser test --- .github/workflows/pull-request-validation.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/pull-request-validation.yml b/.github/workflows/pull-request-validation.yml index f28b6ecd8b..1971e4aee2 100644 --- a/.github/workflows/pull-request-validation.yml +++ b/.github/workflows/pull-request-validation.yml @@ -82,6 +82,23 @@ jobs: path: docker.zip retention-days: 1 + build-browser: + name: Build test harness + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ env.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ env.node-version }} + cache: npm + + - run: npm clean-install --ignore-scripts --strict-peer-deps + + - run: npm run build-browser + build-samples: name: Build samples runs-on: ubuntu-latest From 140c977d6586f56a0bed067eed2f096b8a0e6306 Mon Sep 17 00:00:00 2001 From: William Wong Date: Tue, 30 Dec 2025 13:54:16 -0800 Subject: [PATCH 4/4] Update entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97cfd5db95..b0bacf65d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -148,7 +148,7 @@ Breaking changes in this release: - Debug into element: open F12, select the subject in Element pane, type `$0.webChat.debugger` - Breakpoint: open F12, select the subject in Element pane, type `$0.webChat.breakpoint.incomingActivity` - The `botframework-webchat` package now uses CSS modules for styling purposes, in PR [#5666](https://github.com/microsoft/BotFramework-WebChat/pull/5666), by [@OEvgeny](https://github.com/OEvgeny) -- ๐Ÿ‘ท๐Ÿป Added `npm run build-browser` script for building test browser-related packages only, in PR [#5667](https://github.com/microsoft/BotFramework-WebChat/pull/5667), by [@compulim](https://github.com/compulim) +- ๐Ÿ‘ท๐Ÿป Added `npm run build-browser` script for building test harness package only, in PR [#5667](https://github.com/microsoft/BotFramework-WebChat/pull/5667), by [@compulim](https://github.com/compulim) ### Changed