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
4,897 changes: 1,173 additions & 3,724 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,10 @@
"serve": "^14.2.4",
"serve-handler": "^6.1.6",
"strip-ansi": "^6.0.1",
"tsup": "^8.3.6",
"tsdown": "^0.11.12",
"typescript": "^5.7.3",
"typescript-plugin-css-modules": "^5.1.0",
"unplugin-lightningcss": "^0.4.1",
"xmlbuilder": "^15.1.1"
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
],
"homepage": "https://github.com/microsoft/BotFramework-WebChat/tree/main/packages/component#readme",
"scripts": {
"build": "npm run build:globalize && npm run build:tsup",
"build": "npm run build:globalize && npm run build:tsdown",
"build:globalize": "node scripts/createPrecompiledGlobalize.mjs",
"build:tsup": "tsup --config ./tsup.config.ts",
"build:tsdown": "NODE_OPTIONS=--max-old-space-size=4096 tsdown --config ./tsdown.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",
Expand All @@ -67,7 +67,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 -- --onSuccess=\"touch ../component/src/index.ts\" --watch"
"start": "npm run build:tsdown -- --onSuccess=\"touch ../component/src/index.ts\" --watch"
},
"localDependencies": {
"botframework-webchat-cldr-data": "development",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'tsup';
import baseConfig from '../../tsup.base.config';
import { defineConfig } from 'tsdown';
import baseConfig from '../../tsdown.base.config';

const config: typeof baseConfig = {
...baseConfig,
Expand Down
6 changes: 3 additions & 3 deletions packages/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"homepage": "https://github.com/microsoft/BotFramework-WebChat/tree/main/packages/component#readme",
"private": true,
"scripts": {
"build": "npm run build:tsup",
"build:tsup": "tsup --config ./tsup.config.ts",
"build": "npm run build:tsdown",
"build:tsdown": "tsdown --config ./tsdown.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",
Expand All @@ -55,7 +55,7 @@
"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": "concurrently --kill-others --prefix-colors \"auto\" \"npm:start:*\"",
"start:tsup": "npm run build:tsup -- --watch"
"start:tsdown": "npm run build:tsdown -- --watch"
},
"devDependencies": {
"@tsconfig/strictest": "^2.0.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'tsup';
import baseConfig from '../../tsup.base.config';
import { defineConfig } from 'tsdown';
import baseConfig from '../../tsdown.base.config';

const config: typeof baseConfig = {
...baseConfig,
Expand Down
6 changes: 3 additions & 3 deletions packages/bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
}
},
"scripts": {
"build": "npm run build:tsup",
"build:tsup": "tsup --config ./tsup.config.ts",
"build": "npm run build:tsdown",
"build:tsdown": "RUST_BACKTRACE=full NODE_OPTIONS=--max-old-space-size=8192 tsdown --config ./tsdown.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",
Expand All @@ -56,7 +56,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"
"start": "npm run build:tsdown -- --watch"
},
"localDependencies": {
"botframework-directlinespeech-sdk": "production",
Expand Down
118 changes: 118 additions & 0 deletions packages/bundle/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
import path from 'path';
import { defineConfig } from 'tsdown';
import baseConfig from '../../tsdown.base.config';
import type { Plugin as RollupPlugin } from 'rollup';

import pkg from './package.json';

const iifeDeps = Object.keys(pkg.dependencies);

// Redirect import paths for "microsoft-cognitiveservices-speech-sdk(...)"
// to point to es2015 distribution for all importing modules
const resolveCognitiveServicesToES2015: RollupPlugin = {
name: 'microsoft-cognitiveservices-speech-sdk',
resolveId(source) {
if (/^microsoft-cognitiveservices-speech-sdk.*$/u.test(source)) {
let p = path.join(process.cwd(), '../../node_modules', source.replace('distrib/lib', 'distrib/es2015') + '.js');
p.endsWith('node_modules/microsoft-cognitiveservices-speech-sdk.js') &&
(p = path.join(
p,
'../microsoft-cognitiveservices-speech-sdk/distrib/es2015/microsoft.cognitiveservices.speech.sdk.js'
));
return p;
}
return null;
}
};

// Redirect import paths for "react" and "react-dom"
const resolveReact: RollupPlugin = {
name: 'isomorphic-react',
resolveId(source) {
if (source === 'react' || source === 'react-dom') {
const p = path.join(process.cwd(), '../../node_modules', `isomorphic-${source}/dist/${source}.js`);
return p;
}
return null;
}
};

const config: typeof baseConfig = {
...baseConfig,
entry: {
'botframework-webchat': './src/module/exports.ts',
'botframework-webchat.es5': './src/module/exports-es5.ts',
'botframework-webchat.minimal': './src/module/exports-minimal.ts'
},
env: {
...baseConfig.env,

// Followings are required by microsoft-cognitiveservices-speech-sdk:
NODE_TLS_REJECT_UNAUTHORIZED: '',
SPEECH_CONDUCT_OCSP_CHECK: '',
SPEECH_OCSP_CACHE_ROOT: ''
},
plugins: [resolveCognitiveServicesToES2015],
noExternal: [
'@babel/runtime',
'memoize-one',
'microsoft-cognitiveservices-speech-sdk',
'web-speech-cognitive-services',
// Belows are the dependency chain related to "regex" where it is named export-only and does not work on Webpack 4/PPUX (CJS cannot import named export).
// Webpack 4: "Can't import the named export 'rewrite' from non EcmaScript module (only default export is available)"
'shiki', // shiki -> @shikijs/core -> @shikijs/engine-javascript -> regex
// Issues related to Webpack 4 when it tries to statically analyze dependencies.
// The way `microsoft-cognitiveservices-speech-sdk` imported the `uuid` package (in their `Guid.js`) is causing esbuild/tsdown to proxy require() into __require() for dynamic loading.
// Webpack 4 cannot statically analyze the code and failed with error "Critical dependency: require function is used in a way in which dependencies cannot be statically extracted".
'uuid'
]
};

const iifeConfig = {
...config,
dts: false,
env: {
...config.env,
module_format: 'global'
},
plugins: [...config.plugins, resolveReact],
format: 'iife',
platform: 'browser',
target: [...config.target, 'es2019'],
noExternal: [...iifeDeps, ...config.noExternal],
outputOptions(outputOptions) {
outputOptions.entryFileNames = '[name].js';
return outputOptions;
}
};

export default defineConfig([
// Build IIFE before CJS/ESM to make npm start faster.
{
...iifeConfig,
entry: {
'webchat-minimal': './src/bundle/index-minimal.ts'
}
},
{
...iifeConfig,
entry: {
webchat: './src/bundle/index.ts'
}
},
{
...iifeConfig,
entry: {
'webchat-es5': './src/bundle/index-es5.ts'
}
},
{
...config,
format: 'esm'
}
// {
// ...config,
// format: 'cjs',
// target: [...config.target, 'es2019']
// }
]);
88 changes: 0 additions & 88 deletions packages/bundle/tsup.config.ts

This file was deleted.

6 changes: 3 additions & 3 deletions packages/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
],
"homepage": "https://github.com/microsoft/BotFramework-WebChat/tree/main/packages/component#readme",
"scripts": {
"build": "npm run build:tsup",
"build:tsup": "tsup --config ./tsup.config.ts",
"build": "npm run build:tsdown",
"build:tsdown": "NODE_OPTIONS=--max-old-space-size=8192 tsdown --config ./tsdown.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",
Expand All @@ -66,7 +66,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 -- --onSuccess=\"touch ../bundle/src/FullComposer.tsx\" --watch"
"start": "npm run build:tsdown -- --onSuccess=\"touch ../bundle/src/FullComposer.tsx\" --watch"
},
"localDependencies": {
"botframework-webchat-api": "production",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { injectCSSPlugin } from 'botframework-webchat-styles/build';
import { defineConfig } from 'tsup';
import baseConfig from '../../tsup.base.config';
import { defineConfig } from 'tsdown';
import baseConfig from '../../tsdown.base.config';
import { componentStyleContent as componentStyleContentPlaceholder } from './src/Styles/createStyles';
import { decoratorStyleContent as decoratorStyleContentPlaceholder } from './src/decorator/private/createStyles';
import LightningCSS from 'unplugin-lightningcss';

const config: typeof baseConfig = {
...baseConfig,
Expand All @@ -11,14 +12,13 @@ const config: typeof baseConfig = {
'botframework-webchat-component.internal': './src/internal.ts',
'botframework-webchat-component.decorator': './src/decorator/index.ts'
},
plugins: [
LightningCSS.rolldown()
],
esbuildPlugins: [
injectCSSPlugin({ stylesPlaceholder: componentStyleContentPlaceholder }),
injectCSSPlugin({ stylesPlaceholder: decoratorStyleContentPlaceholder })
],
loader: {
...baseConfig.loader,
'.css': 'local-css'
}
};

export default defineConfig([
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
}
},
"scripts": {
"build": "npm run build:tsup",
"build:tsup": "tsup --config ./tsup.config.ts",
"build": "npm run build:tsdown",
"build:tsdown": "tsdown --config ./tsdown.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",
Expand All @@ -56,7 +56,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 -- --onSuccess=\"touch ../api/src/index.ts\" --watch"
"start": "npm run build:tsdown -- --onSuccess=\"touch ../api/src/index.ts\" --watch"
},
"engines": {
"node": ">=12.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'tsup';
import baseConfig from '../../tsup.base.config';
import { defineConfig } from 'tsdown';
import baseConfig from '../../tsdown.base.config';

const config: typeof baseConfig = {
...baseConfig,
Expand Down
6 changes: 3 additions & 3 deletions packages/directlinespeech/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
}
},
"scripts": {
"build": "npm run build:tsup && npm run build:babel && npm run build:webpack",
"build": "npm run build:tsdown && npm run build:babel && npm run build:webpack",
"build:babel": "cross-env build_tool=babel module_format=commonjs babel src --ignore **/*.spec.js,**/*.test.js,__tests__/**/*.js --out-dir lib --verbose",
"build:tsup": "tsup --config ./tsup.config.ts",
"build:tsdown": "tsdown --config ./tsdown.config.ts",
"build:webpack": "npm run build:webpack:development && npm run build:webpack:production",
"build:webpack:development": "cross-env node_env=development webpack-cli",
"build:webpack:production": "cross-env node_env=production webpack-cli",
Expand All @@ -39,7 +39,7 @@
"start": "concurrently --kill-others --prefix-colors \"auto\" \"npm:start:*\"",
"start:babel": "npm run build:babel -- --skip-initial-build --watch",
"start:serve": "serve",
"start:tsup": "npm run build:tsup -- --watch",
"start:tsdown": "npm run build:tsdown -- --watch",
"start:webpack": "npm run build:webpack:development -- --watch",
"test": "jest --watch"
},
Expand Down
Loading
Loading