Skip to content

Commit fa3f1e1

Browse files
authored
Add delay to --watch and better build validation (#5599)
* Add delay to --watch * Add entry
1 parent 73332a3 commit fa3f1e1

File tree

35 files changed

+40
-38
lines changed

35 files changed

+40
-38
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,8 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
312312
- Fixed placing focus on the code block content, so it is possible to scroll code via keyboard, in PR [#5575](https://github.com/microsoft/BotFramework-WebChat/pull/5575), by [@OEvgeny](https://github.com/OEvgeny)
313313
- Fixed [#5581](https://github.com/microsoft/BotFramework-WebChat/issues/5581). Activities should be displayed after upgrading via `npm install`, in PR [#5582](https://github.com/microsoft/BotFramework-WebChat/pull/5582), by [@compulim](https://github.com/compulim)
314314
- Fixed Composer props types not resolving correctly in React 16 in PR [#5580](https://github.com/microsoft/BotFramework-WebChat/pull/5580),
315-
by [@lexi-taylor](https://github.com/lexi-taylor)
315+
by [@lexi-taylor](https://github.com/lexi-taylor)
316+
- Fixed `npm start` may fail subsequently as builds are not fully flushed to `/dist/`, in PR [#5599](https://github.com/microsoft/BotFramework-WebChat/pull/5599), by [@compulim](https://github.com/compulim)
316317

317318
### Removed
318319

packages/api-middleware/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"precommit:eslint": "../../node_modules/.bin/eslint --report-unused-disable-directives --max-warnings 0",
7373
"precommit:typecheck": "tsc --project ./src --emitDeclarationOnly false --esModuleInterop true --noEmit --pretty false",
7474
"preversion": "cat package.json | jq '(.localDependencies // {} | to_entries | map([if .value == \"production\" then \"dependencies\" else \"devDependencies\" end, .key])) as $P | delpaths($P)' > package-temp.json && mv package-temp.json package.json",
75-
"start": "npm run build -- --watch"
75+
"start": "npm run build -- --watch 200"
7676
},
7777
"devDependencies": {
7878
"@jridgewell/sourcemap-codec": "^1.5.0",

packages/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"precommit:eslint": "../../node_modules/.bin/eslint --report-unused-disable-directives --max-warnings 0",
8888
"precommit:typecheck": "tsc --project ./src --emitDeclarationOnly false --esModuleInterop true --noEmit --pretty false",
8989
"preversion": "cat package.json | jq '(.localDependencies // {} | to_entries | map([if .value == \"production\" then \"dependencies\" else \"devDependencies\" end, .key])) as $P | delpaths($P)' > package-temp.json && mv package-temp.json package.json",
90-
"start": "npm run build:tsup -- --watch"
90+
"start": "npm run build:tsup -- --watch 200"
9191
},
9292
"localDependencies": {
9393
"@msinternal/botframework-webchat-api-middleware": "development",

packages/base/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"precommit:eslint": "../../node_modules/.bin/eslint --report-unused-disable-directives --max-warnings 0",
5454
"precommit:typecheck": "tsc --project ./src --emitDeclarationOnly false --esModuleInterop true --noEmit --pretty false",
5555
"preversion": "cat package.json | jq '(.localDependencies // {} | to_entries | map([if .value == \"production\" then \"dependencies\" else \"devDependencies\" end, .key])) as $P | delpaths($P)' > package-temp.json && mv package-temp.json package.json",
56-
"start": "npm run build -- --watch"
56+
"start": "npm run build -- --watch 200"
5757
},
5858
"localDependencies": {
5959
"@msinternal/botframework-webchat-tsconfig": "development"

packages/bundle/esbuild.static.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,6 @@ const IGNORED_OWN_PACKAGES = [
217217
}
218218
}
219219

220-
await Promise.all(ourConfigs.map(async config => (await context(config)).watch()));
220+
await Promise.all(ourConfigs.map(async config => (await context(config)).watch({ delay: 200 })));
221221
}
222222
})();

packages/bundle/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
"preversion": "cat package.json | jq '(.localDependencies // {} | to_entries | map([if .value == \"production\" then \"dependencies\" else \"devDependencies\" end, .key])) as $P | delpaths($P)' > package-temp.json && mv package-temp.json package.json",
112112
"start": "cross-env NODE_OPTIONS=--no-deprecation concurrently --kill-others --prefix-colors \"auto\" \"npm:start:*\"",
113113
"start:static": "npm run build:static -- --watch",
114-
"start:tsup": "npm run build:tsup -- --watch",
114+
"start:tsup": "npm run build:tsup -- --watch 200",
115115
"test:tsd": "tsd"
116116
},
117117
"localDependencies": {

packages/component/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"scripts": {
7878
"build": "npm run build:tsup && npm run build:validate",
7979
"build:tsup": "tsup",
80-
"build:validate": "grep -L '.webchat .w' dist/*.css 2>/dev/null || { echo \"Error: dist/*.css is not compiled by Lightning CSS\" >&2; exit 1; }",
80+
"build:validate": "grep -q -P '\\.webchat \\.w([a-zA-Z-]){6}_' dist/*.css 2>/dev/null || { echo \"Error: dist/*.css is not compiled by Lightning CSS\" >&2; exit 1; }",
8181
"bump": "npm run bump:prod && npm run bump:dev && (npm audit fix || exit 0)",
8282
"bump:dev": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localDependencies // {} | keys) 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",
8383
"bump:prod": "PACKAGES_TO_BUMP=$(cat package.json | jq -r '(.pinDependencies // {}) as $P | (.localDependencies // {} | keys) 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",
@@ -87,7 +87,7 @@
8787
"precommit:eslint": "../../node_modules/.bin/eslint --report-unused-disable-directives --max-warnings 0",
8888
"precommit:typecheck": "tsc --project ./src --emitDeclarationOnly false --esModuleInterop true --noEmit --pretty false",
8989
"preversion": "cat package.json | jq '(.localDependencies // {} | to_entries | map([if .value == \"production\" then \"dependencies\" else \"devDependencies\" end, .key])) as $P | delpaths($P)' > package-temp.json && mv package-temp.json package.json",
90-
"start": "npm run build:tsup -- --watch"
90+
"start": "npm run build:tsup -- --watch 200"
9191
},
9292
"localDependencies": {
9393
"@msinternal/botframework-webchat-base": "development",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"precommit:eslint": "../../node_modules/.bin/eslint --report-unused-disable-directives --max-warnings 0",
6767
"precommit:typecheck": "tsc --project ./src --emitDeclarationOnly false --esModuleInterop true --noEmit --pretty false",
6868
"preversion": "cat package.json | jq '(.localDependencies // {} | to_entries | map([if .value == \"production\" then \"dependencies\" else \"devDependencies\" end, .key])) as $P | delpaths($P)' > package-temp.json && mv package-temp.json package.json",
69-
"start": "npm run build -- --watch"
69+
"start": "npm run build -- --watch 200"
7070
},
7171
"engines": {
7272
"node": ">=12.0.0"

packages/debug-theme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"precommit:eslint": "../../node_modules/.bin/eslint --report-unused-disable-directives --max-warnings 0",
4949
"precommit:typecheck": "tsc --project ./src --emitDeclarationOnly false --esModuleInterop true --noEmit --pretty false",
5050
"preversion": "cat package.json | jq '(.localDependencies // {} | to_entries | map([if .value == \"production\" then \"dependencies\" else \"devDependencies\" end, .key])) as $P | delpaths($P)' > package-temp.json && mv package-temp.json package.json",
51-
"start": "npm run build -- --watch"
51+
"start": "npm run build -- --watch 200"
5252
},
5353
"peerDependencies": {
5454
"react": ">= 16.8.6"

packages/directlinespeech/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"start": "concurrently --kill-others --prefix-colors \"auto\" \"npm:start:*\"",
4040
"start:babel": "npm run build:babel -- --skip-initial-build --watch",
4141
"start:serve": "serve",
42-
"start:tsup": "npm run build:tsup -- --watch",
42+
"start:tsup": "npm run build:tsup -- --watch 200",
4343
"start:webpack": "npm run build:webpack:development -- --watch",
4444
"test": "jest --watch"
4545
},

0 commit comments

Comments
 (0)