Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
- Fixed published package types containing internal package references, in PR [#5610](https://github.com/microsoft/BotFramework-WebChat/pull/5610), by [@OEvgeny](https://github.com/OEvgeny)
- Fixed citation links are not properly matched against markdown links, in PR [#5614](https://github.com/microsoft/BotFramework-WebChat/pull/5614), by [@OEvgeny](https://github.com/OEvgeny)
- Fixed `botframework-webchat/decorator` import in legacy CommonJS environments, in [#5616](https://github.com/microsoft/BotFramework-WebChat/pull/5616), by [@OEvgeny](https://github.com/OEvgeny)
- Fixed `npm start` for efficiency and reliability, in PR [#5621](https://github.com/microsoft/BotFramework-WebChat/pull/5621), by [@compulim](https://github.com/compulim)

### Removed

Expand Down
47 changes: 45 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@
"minimatch": "^10.0.3",
"node-dev": "^8.0.0",
"prettier": "^3.6.2",
"read-package-up": "^11.0.0",
"read-pkg": "^9.0.1",
"selenium-webdriver": "^4.34.0",
"serve": "^14.2.4",
"serve-handler": "^6.1.6",
Expand Down
1 change: 0 additions & 1 deletion packages/api-middleware/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*.tgz
/dist/
/dist.tmp/
/node_modules/
/tsup.config.bundled_*.mjs
30 changes: 18 additions & 12 deletions packages/api-middleware/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,30 @@
"./src/**/*",
"*.js"
],
"localDependencies": {
"@msinternal/botframework-webchat-base": "development",
"@msinternal/botframework-webchat-react-hooks": "development",
"@msinternal/botframework-webchat-react-valibot": "development"
},
"homepage": "https://github.com/microsoft/BotFramework-WebChat/tree/main/packages/api-middleware#readme",
"scripts": {
"build": "tsup --config ./tsup.config.ts",
"bump": "npm run bump:prod && npm run bump:dev && (npm audit fix || exit 0)",
"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",
"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",
"build": "npm run --if-present build:pre && npm run build:run && npm run --if-present build:post",
"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": "tsup",
"bump": "npm run bump:prod && npm run bump:dev && npm run bump:peer && (npm audit fix || exit 0)",
"bump:dev": "../../scripts/npm/bump-dev.sh",
"bump:peer": "../../scripts/npm/bump-peer.sh",
"bump:prod": "../../scripts/npm/bump-prod.sh",
"eslint": "npm run precommit",
"postversion": "cat package.json | jq '.version as $V | (.localDependencies // {} | with_entries(select(.value == \"production\") | { key: .key, value: $V })) as $L1 | (.localDependencies // {} | with_entries(select(.value == \"development\") | { key: .key, value: $V })) as $L2 | ((.dependencies // {}) + $L1 | to_entries | sort_by(.key) | from_entries) as $D1 | ((.devDependencies // {}) + $L2 | to_entries | sort_by(.key) | from_entries) as $D2 | . + { dependencies: $D1, devDependencies: $D2 }' > package-temp.json && mv package-temp.json package.json",
"postversion": "node ../../scripts/npm/postversion.sh",
"precommit": "npm run precommit:eslint -- src && npm run precommit:typecheck",
"precommit:eslint": "../../node_modules/.bin/eslint --report-unused-disable-directives --max-warnings 0",
"precommit:typecheck": "tsc --project ./src --emitDeclarationOnly false --esModuleInterop true --noEmit --pretty false",
"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",
"start": "npm run build -- --watch"
"preversion": "node ../../scripts/npm/preversion.sh",
"start": "../../scripts/npm/notify-build.sh \"src\" \"../..\" \"../base/package.json\" \"../react-hooks/package.json\" \"../react-valibot/package.json\""
},
"pinDependencies": {},
"localDependencies": {
"@msinternal/botframework-webchat-base": "development",
"@msinternal/botframework-webchat-react-hooks": "development",
"@msinternal/botframework-webchat-react-valibot": "development"
},
"devDependencies": {
"@jridgewell/sourcemap-codec": "^1.5.0",
Expand Down
9 changes: 3 additions & 6 deletions packages/api-middleware/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@ import { defineConfig } from 'tsup';

import { applyConfig } from '../../tsup.base.config';

// TODO: [P1] Compute this automatically.
const DEPENDENT_PATHS = ['api/src/index.ts'];

const commonConfig = applyConfig(config => ({
...config,
entry: {
'botframework-webchat-api-middleware': './src/index.ts',
'botframework-webchat-api-middleware.legacy': './src/legacy.ts'
},
onSuccess: `touch ${DEPENDENT_PATHS.map(path => `../${path}`).join(' ')}`
}
}));

export default defineConfig([
{
...commonConfig,
format: 'esm'
format: 'esm',
onSuccess: 'touch ./package.json'
Comment thread
compulim marked this conversation as resolved.
},
{
...commonConfig,
Expand Down
1 change: 0 additions & 1 deletion packages/api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*.tgz
/dist/
/dist.tmp/
/node_modules/
/tsup.config.bundled_*.mjs

Expand Down
37 changes: 20 additions & 17 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,15 @@
],
"homepage": "https://github.com/microsoft/BotFramework-WebChat/tree/main/packages/component#readme",
"scripts": {
"build": "npm run build:globalize && npm run build:tsup && npm run build:dtsroll && npm run build:validate",
"build:globalize": "node scripts/createPrecompiledGlobalize.mjs",
"build:tsup": "tsup",
"build:dtsroll": "dtsroll ./dist/*.d.*",
"build:validate": "npm run build:validate:dts",
"build:validate:dts": "if grep -q -P '@msinternal\\/' dist/*.d.* 2>/dev/null; then echo \"Error: dist/*.d.* is not compiled by dtsroll\" >&2; exit 1; fi",
"build": "npm run --if-present build:pre && npm run build:run && npm run --if-present build:post",
"build:post": "npm run build:post:dtsroll && npm run build:post:validate:dts",
"build:post:dtsroll": "dtsroll ./dist/*.d.*",
"build:post:validate:dts": "if grep -q -P '@msinternal\\/' dist/*.d.* 2>/dev/null; then echo \"Error: dist/*.d.* is not compiled by dtsroll\" >&2; exit 1; fi",
"build:pre": "npm run build:pre:local-dependencies && npm run build:pre:watch && npm run build:pre:globalize",
"build:pre:globalize": "node scripts/createPrecompiledGlobalize.mjs",
"build:pre:local-dependencies": "../../scripts/npm/build-local-dependencies.sh",
"build:pre:watch": "../../scripts/npm/build-watch.sh",
"build:run": "tsup",
"bump": "npm run bump:prod && npm run bump:dev && (npm audit fix || exit 0)",
"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",
"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",
Expand All @@ -90,17 +93,7 @@
"precommit:eslint": "../../node_modules/.bin/eslint --report-unused-disable-directives --max-warnings 0",
"precommit:typecheck": "tsc --project ./src --emitDeclarationOnly false --esModuleInterop true --noEmit --pretty false",
"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",
"start": "npm run build:tsup -- --watch"
},
"localDependencies": {
"@msinternal/botframework-webchat-api-middleware": "development",
"@msinternal/botframework-webchat-base": "development",
"@msinternal/botframework-webchat-cldr-data": "development",
"@msinternal/botframework-webchat-react-hooks": "development",
"@msinternal/botframework-webchat-react-valibot": "development",
"@msinternal/botframework-webchat-redux-store": "development",
"@msinternal/botframework-webchat-tsconfig": "development",
"botframework-webchat-core": "production"
"start": "../../scripts/npm/notify-build.sh \"src\" \"../..\" \"../api-middleware/package.json\" \"../base/package.json\" \"../support/cldr-data/package.json\" \"../react-hooks/package.json\" \"../react-valibot/package.json\" \"../redux-store/package.json\" \"../tsconfig/package.json\" \"../core/package.json\""
},
"pinDependencies": {
"@types/react": [
Expand All @@ -116,6 +109,16 @@
"@typescript-eslint/parser@8.38.0 does not support typescript@5.9.2 yet"
]
},
"localDependencies": {
"@msinternal/botframework-webchat-api-middleware": "development",
"@msinternal/botframework-webchat-base": "development",
"@msinternal/botframework-webchat-cldr-data": "development",
"@msinternal/botframework-webchat-react-hooks": "development",
"@msinternal/botframework-webchat-react-valibot": "development",
"@msinternal/botframework-webchat-redux-store": "development",
"@msinternal/botframework-webchat-tsconfig": "development",
"botframework-webchat-core": "production"
},
"devDependencies": {
"@babel/core": "^7.28.0",
"@babel/preset-env": "^7.28.0",
Expand Down
9 changes: 3 additions & 6 deletions packages/api/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import { defineConfig } from 'tsup';

import { applyConfig } from '../../tsup.base.config';

// TODO: [P1] Compute this automatically.
const DEPENDENT_PATHS = ['component/src/index.ts'];

const commonConfig = applyConfig(config => ({
...config,
entry: {
Expand All @@ -13,8 +10,7 @@ const commonConfig = applyConfig(config => ({
'botframework-webchat-api.hook': './src/boot/hook.ts',
'botframework-webchat-api.internal': './src/boot/internal.ts',
'botframework-webchat-api.middleware': './src/boot/middleware.ts'
},
onSuccess: `touch ${DEPENDENT_PATHS.map(path => `../${path}`).join(' ')}`
}
}));

export default defineConfig([
Expand All @@ -25,7 +21,8 @@ export default defineConfig([
'globalThis.WEB_CHAT_BUILD_INFO_MODULE_FORMAT': '"esmodules"'
},
format: 'esm',
noExternal: [...(commonConfig.noExternal ?? []), 'globalize']
noExternal: [...(commonConfig.noExternal ?? []), 'globalize'],
onSuccess: 'touch ./package.json'
},
{
...commonConfig,
Expand Down
1 change: 0 additions & 1 deletion packages/base/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*.tgz
/dist/
/dist.tmp/
/node_modules/
/tsup.config.bundled_*.mjs
8 changes: 6 additions & 2 deletions packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@
"homepage": "https://github.com/microsoft/BotFramework-WebChat/tree/main/packages/component#readme",
"private": true,
"scripts": {
"build": "tsup",
"build": "npm run --if-present build:pre && npm run build:run && npm run --if-present build:post",
"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": "tsup",
"bump": "npm run bump:prod && npm run bump:dev && (npm audit fix || exit 0)",
"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",
"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",
Expand All @@ -53,7 +57,7 @@
"precommit:eslint": "../../node_modules/.bin/eslint --report-unused-disable-directives --max-warnings 0",
"precommit:typecheck": "tsc --project ./src --emitDeclarationOnly false --esModuleInterop true --noEmit --pretty false",
"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",
"start": "npm run build -- --watch"
"start": "../../scripts/npm/notify-build.sh \"src\" \"../..\" \"../tsconfig/package.json\""
},
"localDependencies": {
"@msinternal/botframework-webchat-tsconfig": "development"
Expand Down
17 changes: 3 additions & 14 deletions packages/base/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,19 @@ import { defineConfig } from 'tsup';

import { applyConfig } from '../../tsup.base.config';

// TODO: [P1] Compute this automatically.
const DEPENDENT_PATHS = [
'api/src/index.ts',
'api-middleware/src/index.ts',
'bundle/src/boot/exports/index.ts',
'component/src/index.ts',
'core/src/index.ts',
'debug-theme/src/index.ts',
'fluent-theme/src/index.ts'
];

const commonConfig = applyConfig(config => ({
...config,
entry: {
'botframework-webchat-base': './src/index.ts',
'botframework-webchat-base.utils': './src/utils/index.ts'
},
onSuccess: `touch ${DEPENDENT_PATHS.map(path => `../${path}`).join(' ')}`
}
}));

export default defineConfig([
{
...commonConfig,
format: 'esm'
format: 'esm',
onSuccess: 'touch ./package.json'
},
{
...commonConfig,
Expand Down
1 change: 0 additions & 1 deletion packages/bundle/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/*.tgz
/dist/
/dist.tmp/
/node_modules/
/static/
/tsup.config.bundled_*.mjs
Loading
Loading