Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8d31e53
Centralize build info
compulim Sep 8, 2025
5f203b3
Remove dom-utils
compulim Sep 8, 2025
fa85336
Clean up
compulim Sep 8, 2025
6eeea68
Rename readonlyObject to object
compulim Sep 8, 2025
346b86c
Touch buildInfo.ts
compulim Sep 8, 2025
2f5fb48
Update touch paths
compulim Sep 8, 2025
ca3ea07
Clean up
compulim Sep 8, 2025
76939b6
Clean up
compulim Sep 8, 2025
83b1cae
Clean up
compulim Sep 8, 2025
c899448
Wait for *.d.ts
compulim Sep 8, 2025
ea26e98
Use find
compulim Sep 8, 2025
300202b
Add retry
compulim Sep 8, 2025
28e76de
Add comments
compulim Sep 8, 2025
d1e0753
Update tests
compulim Sep 8, 2025
e22a217
Remove obsoleted tests
compulim Sep 8, 2025
ce088ba
Move to globalThis.WEB_CHAT_BUILD_INFO_*
compulim Sep 8, 2025
5c784c1
Move to globalThis.WEB_CHAT_BUILD_INFO_*
compulim Sep 8, 2025
17b9893
Bundle change-case
compulim Sep 8, 2025
64ab627
Add comment
compulim Sep 8, 2025
a019695
Rename to commonConfig
compulim Sep 8, 2025
b792414
Update tests
compulim Sep 8, 2025
cf312d6
Wait for both *.d.ts and *.d.t.mts
compulim Sep 8, 2025
8d65f49
Add entry
compulim Sep 8, 2025
3a5cb93
Use custom kebab case
compulim Sep 9, 2025
c6882ac
Move to applyConfig
compulim Sep 9, 2025
989afa2
Remove unnecessary code
compulim Sep 9, 2025
12f27fc
Merge branch 'main' into feat-build-info
compulim Sep 9, 2025
3d88862
Update packages/base/src/utils/setMetaTag.ts
compulim Sep 9, 2025
3d0b6e4
Clean up
compulim Sep 10, 2025
2cd62f3
Clean up
compulim Sep 10, 2025
e157c74
Remove existing ESBuild plugins
compulim Sep 10, 2025
1eddcd9
Simplify kebab case
compulim Sep 10, 2025
aaf67a7
Add u flag
compulim Sep 10, 2025
7ba69c3
Add back build_tool
compulim Sep 10, 2025
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 @@ -129,6 +129,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
- `'published'` - show checkmark aside from the message
- Added a `position` property support for the `Message` entity
- The `position` property takes precedence over existing sequence ID
- Unified build info and injection of `<meta>` tag, in PR [#5571](https://github.com/microsoft/BotFramework-WebChat/pull/5571), by [@compulim](https://github.com/compulim)

### Changed

Expand Down
35 changes: 0 additions & 35 deletions __tests__/html/metaTag.webChat.es5.html

This file was deleted.

5 changes: 0 additions & 5 deletions __tests__/html/metaTag.webChat.es5.js

This file was deleted.

35 changes: 0 additions & 35 deletions __tests__/html/metaTag.webChat.full.html

This file was deleted.

5 changes: 0 additions & 5 deletions __tests__/html/metaTag.webChat.full.js

This file was deleted.

35 changes: 0 additions & 35 deletions __tests__/html/metaTag.webChat.minimal.html

This file was deleted.

5 changes: 0 additions & 5 deletions __tests__/html/metaTag.webChat.minimal.js

This file was deleted.

60 changes: 0 additions & 60 deletions __tests__/html2/basic/bundle/es5.html

This file was deleted.

Binary file removed __tests__/html2/basic/bundle/es5.html.snap-1.png
Binary file not shown.
60 changes: 0 additions & 60 deletions __tests__/html2/basic/bundle/full.html

This file was deleted.

Binary file removed __tests__/html2/basic/bundle/full.html.snap-1.png
Binary file not shown.
60 changes: 0 additions & 60 deletions __tests__/html2/basic/bundle/minimal.html

This file was deleted.

Binary file not shown.
38 changes: 38 additions & 0 deletions __tests__/html2/boot/bundle.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,41 @@

const { WebChat } = window;

const metaMap = new Map(
Array.from(document.querySelectorAll('meta'))
.filter(element => element.name.startsWith('botframework-webchat'))
.map(element => [element.name, element.getAttribute('content')])
);

// THEN: It should have `<meta name="botframework-webchat:api">`.
expect(metaMap.has('botframework-webchat:api')).toBe(true);
expect(metaMap.get('botframework-webchat:api')).toEqual(expect.stringContaining('build-tool=tsup'));
expect(metaMap.get('botframework-webchat:api')).toEqual(expect.stringContaining('module-format='));
expect(metaMap.get('botframework-webchat:api')).toEqual(expect.stringContaining('version='));
expect(metaMap.get('botframework-webchat:api:version')).toEqual(expect.stringMatching(/^\d+\.\d+\.\d+($|-)/u));

// THEN: It should have `<meta name="botframework-webchat">`.
expect(metaMap.has('botframework-webchat')).toBe(true);
expect(metaMap.get('botframework-webchat')).toEqual(expect.stringContaining('build-tool=tsup'));
expect(metaMap.get('botframework-webchat')).toEqual(expect.stringContaining('module-format=global'));
expect(metaMap.get('botframework-webchat')).toEqual(expect.stringContaining(`variant=${variant}`));
expect(metaMap.get('botframework-webchat')).toEqual(expect.stringContaining('version='));
expect(metaMap.get('botframework-webchat:version')).toEqual(expect.stringMatching(/^\d+\.\d+\.\d+($|-)/u));

// THEN: It should have `<meta name="botframework-webchat:component">`.
expect(metaMap.has('botframework-webchat:component')).toBe(true);
expect(metaMap.get('botframework-webchat:component')).toEqual(expect.stringContaining('build-tool=tsup'));
expect(metaMap.get('botframework-webchat:component')).toEqual(expect.stringContaining('module-format='));
expect(metaMap.get('botframework-webchat:component')).toEqual(expect.stringContaining('version='));
expect(metaMap.get('botframework-webchat:component:version')).toEqual(expect.stringMatching(/^\d+\.\d+\.\d+($|-)/u));

// THEN: It should have `<meta name="botframework-webchat:core">`.
expect(metaMap.has('botframework-webchat:core')).toBe(true);
expect(metaMap.get('botframework-webchat:core')).toEqual(expect.stringContaining('build-tool=tsup'));
expect(metaMap.get('botframework-webchat:core')).toEqual(expect.stringContaining('module-format='));
expect(metaMap.get('botframework-webchat:core')).toEqual(expect.stringContaining('version='));
expect(metaMap.get('botframework-webchat:core:version')).toEqual(expect.stringMatching(/^\d+\.\d+\.\d+($|-)/u));

// THEN: `window.WebChat` should be a plain object.
expect(typeof WebChat).toBe('object');

Expand Down Expand Up @@ -71,6 +106,9 @@
expect(WebChat.Components.AdaptiveCardContent).toBeUndefined();
}

// THEN: `buildInfo.buildTool` should be "tsup".
expect(WebChat).toHaveProperty('buildInfo.buildTool', 'tsup');

// THEN: `buildInfo.moduleFromat` should be "global".
expect(WebChat).toHaveProperty('buildInfo.moduleFormat', 'global'); // Bundle

Expand Down
9 changes: 9 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,26 @@ module.exports = {
'**/*.md': prettierMarkdown,
'packages/**/*.css': ['npm run precommit:biome'],
'packages/api/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:api'],
'packages/api-middleware/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:api-middleware'],
'packages/base/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:base'],
'packages/bundle/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:bundle'],
'packages/component/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:component'],
'packages/core/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:core'],
'packages/debug-theme/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:debug-theme'],
'packages/directlinespeech/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:directlinespeech'],
'packages/fluent-theme/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:fluent-theme'],
'packages/isomorphic-react/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:isomorphic-react'],
'packages/isomorphic-react-dom/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:isomorphic-react-dom'],
'packages/react-hooks/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:react-hooks'],
'packages/react-valibot/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:react-valibot'],
'packages/redux-store/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:redux-store'],
'packages/styles/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:styles'],
'packages/support/cldr-data/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:support-cldr-data'],
'packages/support/cldr-data-downloader/src/**/*.{mjs,js,ts,tsx}': [
'npm run precommit:eslint:support-cldr-data-downloader'
],
'packages/test/harness/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:test-harness'],
'packages/test/page-object/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:test-page-object'],
'packages/test/web-server/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:test-web-server'],
'packages/*/src/**/*.{ts,tsx}': [() => 'npm run precommit:typecheck']
};
Loading
Loading