Skip to content

Commit 587b91b

Browse files
authored
Add npm run build-browser script (#5667)
* Add build-browser script * Add entry * Add build-browser test * Update entry
1 parent f5d74a3 commit 587b91b

5 files changed

Lines changed: 37 additions & 1 deletion

File tree

.github/workflows/pull-request-validation.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,23 @@ jobs:
8282
path: docker.zip
8383
retention-days: 1
8484

85+
build-browser:
86+
name: Build test harness
87+
runs-on: windows-latest
88+
89+
steps:
90+
- uses: actions/checkout@v4
91+
92+
- name: Use Node.js ${{ env.node-version }}
93+
uses: actions/setup-node@v4
94+
with:
95+
node-version: ${{ env.node-version }}
96+
cache: npm
97+
98+
- run: npm clean-install --ignore-scripts --strict-peer-deps
99+
100+
- run: npm run build-browser
101+
85102
build-samples:
86103
name: Build samples
87104
runs-on: ubuntu-latest

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Legends:
1515
- 🐛 are known issues
1616
- 🧪 are experimental changes
1717
- 🏫 are samples
18+
- 👷🏻 are development environment changes
1819

1920
## [Unreleased]
2021

@@ -147,6 +148,7 @@ Breaking changes in this release:
147148
- Debug into element: open <kbd>F12</kbd>, select the subject in Element pane, type `$0.webChat.debugger`
148149
- Breakpoint: open <kbd>F12</kbd>, select the subject in Element pane, type `$0.webChat.breakpoint.incomingActivity`
149150
- 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)
151+
- 👷🏻 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)
150152

151153
### Changed
152154

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"build": "npm run build:production && npm run build:html2-samples",
6262
"build:html2-samples": "cd __tests__/html2/samples/ && esbuild --bundle --format=esm --outbase=. --outdir=./dist/ --minify **/*.tsx --splitting",
6363
"build:production": "npm run build --if-present --workspaces",
64+
"build-browser": "npm run build:run --workspace ./packages/test/harness",
6465
"bump": "npm run bump:prod && npm run bump:dev && (npm audit fix || exit 0) && npm run bump:packages && npm run bump:samples",
6566
"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",
6667
"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",

packages/test/harness/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"build:pre": "npm run build:pre:local-dependencies && npm run build:pre:watch",
1717
"build:pre:local-dependencies": "../../../scripts/npm/build-local-dependencies.sh",
1818
"build:pre:watch": "../../../scripts/npm/build-watch.sh",
19-
"build:run": "concurrently --prefix-colors \"auto\" \"npm:build:run:esbuild:esm\" \"npm:build:run:esbuild:iife\" && touch ./package.json",
19+
"build:run": "concurrently --prefix-colors \"auto\" \"npm:build:run:esbuild:esm\" \"npm:build:run:esbuild:iife\" && node ../../../scripts/touch.mjs ./package.json",
2020
"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",
2121
"build:run:esbuild:esm": "npm run build:run:esbuild:base -- --format=esm --out-extension:.js=.mjs",
2222
"build:run:esbuild:iife": "npm run build:run:esbuild:base -- --format=iife",

scripts/touch.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Windows does not have "touch", and there are no common shell commands on Windows (cmd) and Linux that can do the job.
2+
3+
/// <reference types="node" />
4+
5+
import { closeSync, openSync, utimesSync } from 'fs';
6+
7+
// eslint-disable-next-line no-magic-numbers, no-undef, prefer-destructuring
8+
const filename = process.argv[2];
9+
10+
// eslint-disable-next-line security/detect-non-literal-fs-filename
11+
closeSync(openSync(filename, 'a'));
12+
13+
const now = new Date();
14+
15+
// eslint-disable-next-line security/detect-non-literal-fs-filename
16+
utimesSync(filename, now, now);

0 commit comments

Comments
 (0)