Skip to content

Commit 262c1b7

Browse files
authored
add banner for use client directive (#4281)
* feat(build): add banner * feat(core): add changeset
1 parent 2d356d8 commit 262c1b7

File tree

3 files changed

+131
-0
lines changed

3 files changed

+131
-0
lines changed

.changeset/shaggy-eggs-own.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
"@twilio-paste/icons": patch
3+
"@twilio-paste/account-switcher": patch
4+
"@twilio-paste/ai-chat-log": patch
5+
"@twilio-paste/alert": patch
6+
"@twilio-paste/alert-dialog": patch
7+
"@twilio-paste/anchor": patch
8+
"@twilio-paste/avatar": patch
9+
"@twilio-paste/badge": patch
10+
"@twilio-paste/base-radio-checkbox": patch
11+
"@twilio-paste/blockquote": patch
12+
"@twilio-paste/breadcrumb": patch
13+
"@twilio-paste/button": patch
14+
"@twilio-paste/button-group": patch
15+
"@twilio-paste/callout": patch
16+
"@twilio-paste/card": patch
17+
"@twilio-paste/chart-provider": patch
18+
"@twilio-paste/chat-composer": patch
19+
"@twilio-paste/chat-log": patch
20+
"@twilio-paste/checkbox": patch
21+
"@twilio-paste/code-block": patch
22+
"@twilio-paste/combobox": patch
23+
"@twilio-paste/corner-ornament": patch
24+
"@twilio-paste/data-grid": patch
25+
"@twilio-paste/date-picker": patch
26+
"@twilio-paste/description-list": patch
27+
"@twilio-paste/detail-text": patch
28+
"@twilio-paste/disclosure": patch
29+
"@twilio-paste/display-heading": patch
30+
"@twilio-paste/display-pill-group": patch
31+
"@twilio-paste/editable-code-block": patch
32+
"@twilio-paste/example-text": patch
33+
"@twilio-paste/file-picker": patch
34+
"@twilio-paste/file-uploader": patch
35+
"@twilio-paste/form": patch
36+
"@twilio-paste/form-pill-group": patch
37+
"@twilio-paste/heading": patch
38+
"@twilio-paste/help-text": patch
39+
"@twilio-paste/in-page-navigation": patch
40+
"@twilio-paste/inline-code": patch
41+
"@twilio-paste/inline-control-group": patch
42+
"@twilio-paste/input": patch
43+
"@twilio-paste/input-box": patch
44+
"@twilio-paste/keyboard-key": patch
45+
"@twilio-paste/label": patch
46+
"@twilio-paste/list": patch
47+
"@twilio-paste/menu": patch
48+
"@twilio-paste/meter": patch
49+
"@twilio-paste/minimizable-dialog": patch
50+
"@twilio-paste/modal": patch
51+
"@twilio-paste/page-header": patch
52+
"@twilio-paste/pagination": patch
53+
"@twilio-paste/paragraph": patch
54+
"@twilio-paste/popover": patch
55+
"@twilio-paste/product-switcher": patch
56+
"@twilio-paste/progress-bar": patch
57+
"@twilio-paste/progress-steps": patch
58+
"@twilio-paste/radio-button-group": patch
59+
"@twilio-paste/radio-group": patch
60+
"@twilio-paste/screen-reader-only": patch
61+
"@twilio-paste/select": patch
62+
"@twilio-paste/separator": patch
63+
"@twilio-paste/side-modal": patch
64+
"@twilio-paste/side-panel": patch
65+
"@twilio-paste/sidebar": patch
66+
"@twilio-paste/skeleton-loader": patch
67+
"@twilio-paste/slider": patch
68+
"@twilio-paste/spinner": patch
69+
"@twilio-paste/status": patch
70+
"@twilio-paste/summary-detail": patch
71+
"@twilio-paste/switch": patch
72+
"@twilio-paste/table": patch
73+
"@twilio-paste/tabs": patch
74+
"@twilio-paste/textarea": patch
75+
"@twilio-paste/time-picker": patch
76+
"@twilio-paste/timeline": patch
77+
"@twilio-paste/toast": patch
78+
"@twilio-paste/tooltip": patch
79+
"@twilio-paste/topbar": patch
80+
"@twilio-paste/truncate": patch
81+
"@twilio-paste/user-dialog": patch
82+
"@twilio-paste/visual-picker": patch
83+
"@twilio-paste/core": patch
84+
"@twilio-paste/aspect-ratio": patch
85+
"@twilio-paste/flex": patch
86+
"@twilio-paste/grid": patch
87+
"@twilio-paste/media-object": patch
88+
"@twilio-paste/stack": patch
89+
"@twilio-paste/box": patch
90+
"@twilio-paste/combobox-primitive": patch
91+
"@twilio-paste/disclosure-primitive": patch
92+
"@twilio-paste/listbox-primitive": patch
93+
"@twilio-paste/menu-primitive": patch
94+
"@twilio-paste/modal-dialog-primitive": patch
95+
"@twilio-paste/non-modal-dialog-primitive": patch
96+
"@twilio-paste/sibling-box": patch
97+
"@twilio-paste/tabs-primitive": patch
98+
"@twilio-paste/text": patch
99+
"@twilio-paste/tooltip-primitive": patch
100+
"@twilio-paste/customization": patch
101+
"@twilio-paste/animation-library": patch
102+
"@twilio-paste/clipboard-copy-library": patch
103+
"@twilio-paste/code-editor-library": patch
104+
"@twilio-paste/data-visualization-library": patch
105+
"@twilio-paste/dropdown-library": patch
106+
"@twilio-paste/lexical-library": patch
107+
"@twilio-paste/react-spectrum-library": patch
108+
"@twilio-paste/react-textarea-autosize-library": patch
109+
"@twilio-paste/reakit-library": patch
110+
"@twilio-paste/styling-library": patch
111+
"@twilio-paste/syntax-highlighter-library": patch
112+
"@twilio-paste/uid-library": patch
113+
"@twilio-paste/style-props": patch
114+
"@twilio-paste/theme": patch
115+
"@twilio-paste/types": patch
116+
"@twilio-paste/utils": patch
117+
---
118+
119+
[all packages]: add use client directive to the components and icons. This will make paste library compatible with server components

packages/paste-icons/build.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ esbuild
1919
...config,
2020
format: "cjs",
2121
outdir: "cjs",
22+
banner: {
23+
js: `"use client";`,
24+
},
2225
})
2326
.catch(() => process.exit(1));
2427

@@ -27,5 +30,8 @@ esbuild
2730
...config,
2831
format: "esm",
2932
outdir: "esm",
33+
banner: {
34+
js: `"use client";`,
35+
},
3036
})
3137
.catch(() => process.exit(1));

tools/build/esbuild.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ async function build(packageJson) {
7777
minifySyntax: true,
7878
format: "cjs",
7979
outfile: outFileCJS,
80+
banner: {
81+
js: `"use client";`,
82+
},
8083
// Needed to fix ES6 module import paths for CJS builds
8184
plugins: [PasteCJSResolverPlugin, esbuildPluginVersionInjector(versionInjectorConfig)],
8285
})
@@ -94,6 +97,9 @@ async function build(packageJson) {
9497
minifySyntax: true,
9598
format: "esm",
9699
outfile: outFileESM,
100+
banner: {
101+
js: `"use client";`,
102+
},
97103
// Needed to fix a bug with replacing require with import statements https://github.com/evanw/esbuild/issues/566
98104
plugins: [EsmExternalsPlugin({ externals: external }), esbuildPluginVersionInjector(versionInjectorConfig)],
99105
})

0 commit comments

Comments
 (0)