@linktr.ee/linkapp 0.0.34 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +417 -0
- package/dev-server/preview/preview.css +0 -11
- package/dev-server/shared/theme-presets.ts +0 -225
- package/dist/cli.js +1 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/build.d.ts +1 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +43 -2
- package/dist/commands/build.js.map +1 -1
- package/dist/lib/rsbuild/config-factory.d.ts +1 -0
- package/dist/lib/rsbuild/config-factory.d.ts.map +1 -1
- package/dist/lib/rsbuild/config-factory.js +28 -1
- package/dist/lib/rsbuild/config-factory.js.map +1 -1
- package/dist/lib/rsbuild/plugins/brotli-compression.d.ts +21 -0
- package/dist/lib/rsbuild/plugins/brotli-compression.d.ts.map +1 -0
- package/dist/lib/rsbuild/plugins/brotli-compression.js +68 -0
- package/dist/lib/rsbuild/plugins/brotli-compression.js.map +1 -0
- package/dist/lib/utils/setup-runtime.d.ts.map +1 -1
- package/dist/lib/utils/setup-runtime.js +1 -2
- package/dist/lib/utils/setup-runtime.js.map +1 -1
- package/package.json +1 -1
- package/runtime/index.html +0 -42
package/README.md
ADDED
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
# @linktr.ee/linkapp
|
|
2
|
+
|
|
3
|
+
Development, build, and deployment tooling for LinkApps - custom interactive link experiences for Linktree profiles.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @linktr.ee/linkapp
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or create a new LinkApp project:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm create @linktr.ee/linkapp@latest
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Commands
|
|
18
|
+
|
|
19
|
+
### Development
|
|
20
|
+
|
|
21
|
+
Start the development server with hot reloading and theme preview UI:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
linkapp dev [--port 3000]
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The dev server provides:
|
|
28
|
+
- Live preview of all layouts (sheet, featured, carousel)
|
|
29
|
+
- Theme switcher with Linktree presets
|
|
30
|
+
- Settings editor for testing configurations
|
|
31
|
+
- Hot module replacement
|
|
32
|
+
|
|
33
|
+
### Building
|
|
34
|
+
|
|
35
|
+
Build your LinkApp for production:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
linkapp build [options]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Options:**
|
|
42
|
+
- `--sourcemap` - Generate source maps for debugging
|
|
43
|
+
- `--profile` - Enable bundle profiling
|
|
44
|
+
- `--compress` - Generate Brotli-compressed files (30-40% smaller)
|
|
45
|
+
|
|
46
|
+
Outputs to `dist/` directory with:
|
|
47
|
+
- Content-hashed filenames for cache busting
|
|
48
|
+
- `build-manifest.json` with asset versions
|
|
49
|
+
- Optimized React vendor chunks for better caching
|
|
50
|
+
|
|
51
|
+
### Deployment
|
|
52
|
+
|
|
53
|
+
Deploy your LinkApp to Linktree:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
linkapp deploy [--qa] [--skip-confirm]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Options:**
|
|
60
|
+
- `--qa` - Deploy to QA environment instead of production
|
|
61
|
+
- `--skip-confirm` - Skip confirmation prompt
|
|
62
|
+
|
|
63
|
+
The deployment process:
|
|
64
|
+
1. Validates project structure and configuration
|
|
65
|
+
2. Builds if needed (runs `linkapp build`)
|
|
66
|
+
3. Generates manifest files from `linkapp.config.ts`
|
|
67
|
+
4. Packs project into tarball
|
|
68
|
+
5. Uploads to Linktree API
|
|
69
|
+
6. Returns build ID and admin URL
|
|
70
|
+
|
|
71
|
+
### Authentication
|
|
72
|
+
|
|
73
|
+
Authenticate with Linktree using OAuth device flow:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
linkapp login [--qa] # Login
|
|
77
|
+
linkapp logout [--qa] # Logout
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Tokens are stored in `~/.config/linkapp/auth-token.json`.
|
|
81
|
+
|
|
82
|
+
### Components
|
|
83
|
+
|
|
84
|
+
Add UI components from the registry:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
linkapp add <component>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Example: `linkapp add button`
|
|
91
|
+
|
|
92
|
+
### URL Testing
|
|
93
|
+
|
|
94
|
+
Test URL matching rules from your config:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
linkapp test-url-match-rules <url>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Example: `linkapp test-url-match-rules https://google.com/search`
|
|
101
|
+
|
|
102
|
+
## Exports
|
|
103
|
+
|
|
104
|
+
### CLI
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"bin": {
|
|
109
|
+
"linkapp": "bin/cli.js"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Types
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
import type { AppProps, LinkAppConfig, SettingsElement } from '@linktr.ee/linkapp/types'
|
|
118
|
+
|
|
119
|
+
// Layout component props
|
|
120
|
+
interface MySettings {
|
|
121
|
+
title: string
|
|
122
|
+
color: string
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export default function SheetLayout({ settings, theme }: AppProps<MySettings>) {
|
|
126
|
+
return <div>{settings.title}</div>
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### SDK
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
import { useExpandLinkApp } from '@linktr.ee/linkapp/sdk'
|
|
134
|
+
|
|
135
|
+
// In featured layout, trigger popup/modal
|
|
136
|
+
function FeaturedLayout() {
|
|
137
|
+
const expandLinkApp = useExpandLinkApp()
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<button onClick={() => expandLinkApp({ itemId: '123' })}>
|
|
141
|
+
Expand
|
|
142
|
+
</button>
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Project Structure
|
|
148
|
+
|
|
149
|
+
A LinkApp project has this structure:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
my-linkapp/
|
|
153
|
+
├── app/
|
|
154
|
+
│ ├── sheet.tsx # Required: default layout
|
|
155
|
+
│ ├── featured.tsx # Optional: featured layout
|
|
156
|
+
│ ├── featured-carousel.tsx # Optional: carousel variant
|
|
157
|
+
│ ├── layout.tsx # Optional: wrapper component
|
|
158
|
+
│ ├── globals.css # Global styles
|
|
159
|
+
│ └── icon.svg # LinkApp icon
|
|
160
|
+
├── components/ # Your components
|
|
161
|
+
├── public/ # Static assets (copied to dist/)
|
|
162
|
+
├── linkapp.config.ts # Configuration
|
|
163
|
+
├── postcss.config.mjs # PostCSS config (Tailwind v4)
|
|
164
|
+
├── components.json # Component registry config
|
|
165
|
+
└── package.json
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Configuration
|
|
169
|
+
|
|
170
|
+
The `linkapp.config.ts` file defines your LinkApp:
|
|
171
|
+
|
|
172
|
+
```typescript
|
|
173
|
+
import { defineConfig } from '@linktr.ee/linkapp/types'
|
|
174
|
+
|
|
175
|
+
export default defineConfig({
|
|
176
|
+
manifest: {
|
|
177
|
+
name: 'My LinkApp',
|
|
178
|
+
tagline: 'A custom link experience',
|
|
179
|
+
category: 'share',
|
|
180
|
+
author: {
|
|
181
|
+
name: 'Your Name',
|
|
182
|
+
website: 'https://example.com'
|
|
183
|
+
},
|
|
184
|
+
supporting_links: {
|
|
185
|
+
terms_of_service: 'https://example.com/terms',
|
|
186
|
+
privacy_policy: 'https://example.com/privacy'
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
settings: {
|
|
190
|
+
title: 'My LinkApp Settings',
|
|
191
|
+
uses_url: true,
|
|
192
|
+
featured_chin_position: 'below',
|
|
193
|
+
elements: [
|
|
194
|
+
{
|
|
195
|
+
type: 'text',
|
|
196
|
+
id: 'title',
|
|
197
|
+
label: 'Title',
|
|
198
|
+
defaultValue: 'Hello World'
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
url_match_rules: {
|
|
203
|
+
hostnames: ['{*.}?example.com']
|
|
204
|
+
},
|
|
205
|
+
preview_props: {
|
|
206
|
+
settings: {
|
|
207
|
+
title: 'Preview Title'
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
})
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**Important:** The `manifest.name` becomes your LinkApp ID (kebab-cased) and cannot be changed after first deployment.
|
|
214
|
+
|
|
215
|
+
## Build System
|
|
216
|
+
|
|
217
|
+
Uses Rsbuild (Rspack) for fast, optimized builds:
|
|
218
|
+
|
|
219
|
+
- **Entry Point**: `.linkapp/main.tsx` (auto-generated)
|
|
220
|
+
- **Alias**: `@/` points to project root
|
|
221
|
+
- **PostCSS**: Supports Tailwind CSS v4
|
|
222
|
+
- **Asset Prefix**: `./` for S3 subdirectory deployment
|
|
223
|
+
- **Code Splitting**: React vendor chunks separated for caching
|
|
224
|
+
- **Compression**: Optional Brotli compression with `--compress` flag
|
|
225
|
+
|
|
226
|
+
## Layout Components
|
|
227
|
+
|
|
228
|
+
### Sheet Layout (Required)
|
|
229
|
+
|
|
230
|
+
Compact layout for profile pages:
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
import type { AppProps } from '@linktr.ee/linkapp/types'
|
|
234
|
+
|
|
235
|
+
interface Settings {
|
|
236
|
+
title: string
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export default function Sheet({ settings, theme, __linkUrl }: AppProps<Settings>) {
|
|
240
|
+
return (
|
|
241
|
+
<div style={{ color: theme.textColor }}>
|
|
242
|
+
<h1>{settings.title}</h1>
|
|
243
|
+
<a href={__linkUrl}>Visit Link</a>
|
|
244
|
+
</div>
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Featured Layout (Optional)
|
|
250
|
+
|
|
251
|
+
Hero-style layout for featured content:
|
|
252
|
+
|
|
253
|
+
```typescript
|
|
254
|
+
import { useExpandLinkApp } from '@linktr.ee/linkapp/sdk'
|
|
255
|
+
import type { AppProps } from '@linktr.ee/linkapp/types'
|
|
256
|
+
|
|
257
|
+
export default function Featured({ settings }: AppProps<Settings>) {
|
|
258
|
+
const expand = useExpandLinkApp()
|
|
259
|
+
|
|
260
|
+
return (
|
|
261
|
+
<div onClick={() => expand()}>
|
|
262
|
+
<h1>{settings.title}</h1>
|
|
263
|
+
</div>
|
|
264
|
+
)
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
The featured layout can trigger a modal that displays the sheet layout.
|
|
269
|
+
|
|
270
|
+
## Theme System
|
|
271
|
+
|
|
272
|
+
LinkApps receive theme data via props:
|
|
273
|
+
|
|
274
|
+
```typescript
|
|
275
|
+
interface Theme {
|
|
276
|
+
// Legacy properties (maintained for compatibility)
|
|
277
|
+
textColor: string
|
|
278
|
+
backgroundColor: string
|
|
279
|
+
borderRadius: number
|
|
280
|
+
|
|
281
|
+
// Modern CSS variables (preferred)
|
|
282
|
+
cssVariables: Record<string, string>
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
Apply CSS variables for theming:
|
|
287
|
+
|
|
288
|
+
```css
|
|
289
|
+
/* app/globals.css */
|
|
290
|
+
:root {
|
|
291
|
+
--color-primary: var(--theme-primary, #000);
|
|
292
|
+
--color-background: var(--theme-background, #fff);
|
|
293
|
+
}
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
## PostMessage API
|
|
297
|
+
|
|
298
|
+
LinkApps run in iframes and communicate with the parent window:
|
|
299
|
+
|
|
300
|
+
### From LinkApp to Parent
|
|
301
|
+
|
|
302
|
+
```typescript
|
|
303
|
+
import { useExpandLinkApp } from '@linktr.ee/linkapp/sdk'
|
|
304
|
+
|
|
305
|
+
// Opens modal in parent window
|
|
306
|
+
const expand = useExpandLinkApp()
|
|
307
|
+
expand({ itemId: '123' })
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### From Parent to LinkApp
|
|
311
|
+
|
|
312
|
+
```typescript
|
|
313
|
+
// Parent sends theme updates
|
|
314
|
+
window.postMessage({
|
|
315
|
+
type: 'THEME_UPDATE',
|
|
316
|
+
payload: {
|
|
317
|
+
name: 'dark',
|
|
318
|
+
variables: { '--theme-primary': '#fff' }
|
|
319
|
+
}
|
|
320
|
+
}, '*')
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
## Development
|
|
324
|
+
|
|
325
|
+
### Local Development
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
npm run build # Compile TypeScript
|
|
329
|
+
npm run dev # Watch mode
|
|
330
|
+
npm run test # Run tests
|
|
331
|
+
npm run lint # Lint with Biome
|
|
332
|
+
npm run format # Format with Biome
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Testing Locally
|
|
336
|
+
|
|
337
|
+
Link the package globally to test CLI changes:
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
cd packages/linkapp
|
|
341
|
+
npm run build
|
|
342
|
+
npm link
|
|
343
|
+
|
|
344
|
+
cd ../../apps/my-test-app
|
|
345
|
+
linkapp dev
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### Package Scripts
|
|
349
|
+
|
|
350
|
+
- `build` - Compile TypeScript to `dist/`
|
|
351
|
+
- `dev` - Watch mode compilation
|
|
352
|
+
- `test` - Run Vitest tests
|
|
353
|
+
- `test:watch` - Watch mode for tests
|
|
354
|
+
- `lint` - Lint with Biome
|
|
355
|
+
- `format` - Format with Biome
|
|
356
|
+
- `clean` - Remove build artifacts
|
|
357
|
+
|
|
358
|
+
## Key Concepts
|
|
359
|
+
|
|
360
|
+
### LinkApp ID
|
|
361
|
+
|
|
362
|
+
The LinkApp ID is derived from `manifest.name` using kebab-case:
|
|
363
|
+
- `"My Cool App"` → `"my-cool-app"`
|
|
364
|
+
- This ID is permanent and identifies your LinkApp across deployments
|
|
365
|
+
- Cannot be changed after first deployment
|
|
366
|
+
|
|
367
|
+
### Layout Detection
|
|
368
|
+
|
|
369
|
+
The `supports_featured_layout` setting is auto-detected based on the presence of `app/featured.tsx`. You don't need to manually configure it.
|
|
370
|
+
|
|
371
|
+
### Settings Schema
|
|
372
|
+
|
|
373
|
+
Settings are defined as an array of elements:
|
|
374
|
+
|
|
375
|
+
```typescript
|
|
376
|
+
elements: [
|
|
377
|
+
{
|
|
378
|
+
type: 'text',
|
|
379
|
+
id: 'title',
|
|
380
|
+
label: 'Title',
|
|
381
|
+
defaultValue: 'Hello'
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
type: 'select',
|
|
385
|
+
id: 'style',
|
|
386
|
+
label: 'Style',
|
|
387
|
+
options: ['minimal', 'bold'],
|
|
388
|
+
defaultValue: 'minimal'
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
type: 'array',
|
|
392
|
+
id: 'items',
|
|
393
|
+
label: 'Items',
|
|
394
|
+
element: {
|
|
395
|
+
type: 'text',
|
|
396
|
+
id: 'name',
|
|
397
|
+
label: 'Name'
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
]
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
Supported types: `text`, `select`, `file`, `switch`, `array`, `number`, `date`, `color`
|
|
404
|
+
|
|
405
|
+
## Requirements
|
|
406
|
+
|
|
407
|
+
- Node.js >= 18.0.0
|
|
408
|
+
- npm >= 10.0.0
|
|
409
|
+
|
|
410
|
+
## Related Packages
|
|
411
|
+
|
|
412
|
+
- `@linktr.ee/create-linkapp` - Scaffolding tool for new projects
|
|
413
|
+
- `@linktr.ee/registry` - Component registry
|
|
414
|
+
|
|
415
|
+
## License
|
|
416
|
+
|
|
417
|
+
See LICENSE file in repository root.
|
|
@@ -48,19 +48,8 @@
|
|
|
48
48
|
--color-linktree-button-text: var(--button-style-text);
|
|
49
49
|
--color-linktree-button-border: var(--button-style-border-color);
|
|
50
50
|
--color-linktree-button-contrast: var(--button-style-contrast-color);
|
|
51
|
-
--color-linktree-profile-bg: var(--profileBackground);
|
|
52
|
-
--color-linktree-body-text: var(--bodyText);
|
|
53
|
-
--color-linktree-link-bg: var(--linkBackground);
|
|
54
|
-
--color-linktree-link-text: var(--linkText);
|
|
55
|
-
--color-linktree-link-bg-hover: var(--linkHoverBackground);
|
|
56
|
-
--color-linktree-link-hover-text: var(--linkHoverText);
|
|
57
|
-
--color-linktree-frame: var(--desktop-frame-color);
|
|
58
51
|
--radius-linktree-button: var(--button-style-radius);
|
|
59
52
|
--radius-linktree-button-inner: var(--button-style-inner-radius);
|
|
60
|
-
--spacing-linktree-link-gap: var(--link-gap);
|
|
61
|
-
--spacing-linktree-inner-padding: var(--link-inner-padding);
|
|
62
|
-
--font-linktree-primary: var(--profileFontFamilyPrimary);
|
|
63
|
-
--font-linktree-secondary: var(--profileFontFamilySecondary);
|
|
64
53
|
--shadow-linktree-button: var(--button-style-shadow);
|
|
65
54
|
}
|
|
66
55
|
|
|
@@ -18,51 +18,6 @@ export const THEME_PRESETS = {
|
|
|
18
18
|
"--button-style-radius": "8px",
|
|
19
19
|
"--button-style-inner-radius": "min(8px, max(4px, calc(8px - 8px)))",
|
|
20
20
|
"--button-style-skeleton-color": "rgba(0, 0, 0, 0.05)",
|
|
21
|
-
"--link-gap": "14px",
|
|
22
|
-
"--link-inner-padding": "7px",
|
|
23
|
-
"--link-preview-thumbnail-width": "160px",
|
|
24
|
-
"--linkRadius": "8px",
|
|
25
|
-
"--profile-container-desktop-width": "580px",
|
|
26
|
-
"--profileBackground": "#eceef1",
|
|
27
|
-
"--background-contrast-color": "#000000",
|
|
28
|
-
"--bodyText": "#000000",
|
|
29
|
-
"--profileTitleText": "#000000",
|
|
30
|
-
"--profileDescriptionText": "#000000",
|
|
31
|
-
"--defaultAvatarBackground": "#000000",
|
|
32
|
-
"--defaultAvatarText": "#ffffff",
|
|
33
|
-
"--socialLinkFill": "#000000",
|
|
34
|
-
"--linkBackground": "#ffffff",
|
|
35
|
-
"--linkText": "#000000",
|
|
36
|
-
"--linkHoverBackground": "color-mix(in srgb, #ffffff 93%, #000000 7%)",
|
|
37
|
-
"--linkHoverText": "#000000",
|
|
38
|
-
"--linkShadow": "#000000",
|
|
39
|
-
"--bannerBackground": "#ffffff",
|
|
40
|
-
"--bannerText": "#000000",
|
|
41
|
-
"--desktop-frame-color": "color-mix(in srgb, #eceef1 88%, black 12%)",
|
|
42
|
-
"--profileFontFamilyPrimary":
|
|
43
|
-
'Link Sans Product, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
44
|
-
"--profileFontFamilySecondary":
|
|
45
|
-
'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
46
|
-
"--header-font-family":
|
|
47
|
-
'Link Sans Product, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
48
|
-
"--profileFontWeightNormal": "500",
|
|
49
|
-
"--profileFontWeightBold": "700",
|
|
50
|
-
"--profileDescriptionFontWeight": "500",
|
|
51
|
-
"--linkTextFontWeight": "500",
|
|
52
|
-
"--headerFontWeight": "700",
|
|
53
|
-
"--header-font-weight": "600",
|
|
54
|
-
"--embedLinkTextFontWeight": "500",
|
|
55
|
-
"--signupSubmitTextFontWeight": "700",
|
|
56
|
-
"--bannerFontWeight": "700",
|
|
57
|
-
"--headerFontSize": "normal",
|
|
58
|
-
"--header-bio-font-size": "16px",
|
|
59
|
-
"--embedLinkTextFontSize": "14px",
|
|
60
|
-
"--signupSubmitTextFontSize": "14px",
|
|
61
|
-
"--linkHeaderFontSize": "14px",
|
|
62
|
-
"--bannerFontSize": "14px",
|
|
63
|
-
"--profileDescriptionLineHeight": "1.5",
|
|
64
|
-
"--headerLineHeight": "1.5",
|
|
65
|
-
"--header-text-color": "#000000",
|
|
66
21
|
},
|
|
67
22
|
},
|
|
68
23
|
dark: {
|
|
@@ -80,51 +35,6 @@ export const THEME_PRESETS = {
|
|
|
80
35
|
"--button-style-radius": "8px",
|
|
81
36
|
"--button-style-inner-radius": "min(8px, max(4px, calc(8px - 8px)))",
|
|
82
37
|
"--button-style-skeleton-color": "rgba(255, 255, 255, 0.1)",
|
|
83
|
-
"--link-gap": "14px",
|
|
84
|
-
"--link-inner-padding": "7px",
|
|
85
|
-
"--link-preview-thumbnail-width": "160px",
|
|
86
|
-
"--linkRadius": "8px",
|
|
87
|
-
"--profile-container-desktop-width": "580px",
|
|
88
|
-
"--profileBackground": "#111827",
|
|
89
|
-
"--background-contrast-color": "#ffffff",
|
|
90
|
-
"--bodyText": "#ffffff",
|
|
91
|
-
"--profileTitleText": "#ffffff",
|
|
92
|
-
"--profileDescriptionText": "#ffffff",
|
|
93
|
-
"--defaultAvatarBackground": "#ffffff",
|
|
94
|
-
"--defaultAvatarText": "#000000",
|
|
95
|
-
"--socialLinkFill": "#ffffff",
|
|
96
|
-
"--linkBackground": "#1f2937",
|
|
97
|
-
"--linkText": "#ffffff",
|
|
98
|
-
"--linkHoverBackground": "color-mix(in srgb, #1f2937 93%, #ffffff 7%)",
|
|
99
|
-
"--linkHoverText": "#ffffff",
|
|
100
|
-
"--linkShadow": "#000000",
|
|
101
|
-
"--bannerBackground": "#1f2937",
|
|
102
|
-
"--bannerText": "#ffffff",
|
|
103
|
-
"--desktop-frame-color": "color-mix(in srgb, #111827 88%, white 12%)",
|
|
104
|
-
"--profileFontFamilyPrimary":
|
|
105
|
-
'Link Sans Product, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
106
|
-
"--profileFontFamilySecondary":
|
|
107
|
-
'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
108
|
-
"--header-font-family":
|
|
109
|
-
'Link Sans Product, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
110
|
-
"--profileFontWeightNormal": "500",
|
|
111
|
-
"--profileFontWeightBold": "700",
|
|
112
|
-
"--profileDescriptionFontWeight": "500",
|
|
113
|
-
"--linkTextFontWeight": "500",
|
|
114
|
-
"--headerFontWeight": "700",
|
|
115
|
-
"--header-font-weight": "600",
|
|
116
|
-
"--embedLinkTextFontWeight": "500",
|
|
117
|
-
"--signupSubmitTextFontWeight": "700",
|
|
118
|
-
"--bannerFontWeight": "700",
|
|
119
|
-
"--headerFontSize": "normal",
|
|
120
|
-
"--header-bio-font-size": "16px",
|
|
121
|
-
"--embedLinkTextFontSize": "14px",
|
|
122
|
-
"--signupSubmitTextFontSize": "14px",
|
|
123
|
-
"--linkHeaderFontSize": "14px",
|
|
124
|
-
"--bannerFontSize": "14px",
|
|
125
|
-
"--profileDescriptionLineHeight": "1.5",
|
|
126
|
-
"--headerLineHeight": "1.5",
|
|
127
|
-
"--header-text-color": "#ffffff",
|
|
128
38
|
},
|
|
129
39
|
},
|
|
130
40
|
purple: {
|
|
@@ -142,51 +52,6 @@ export const THEME_PRESETS = {
|
|
|
142
52
|
"--button-style-radius": "16px",
|
|
143
53
|
"--button-style-inner-radius": "min(16px, max(4px, calc(16px - 8px)))",
|
|
144
54
|
"--button-style-skeleton-color": "rgba(124, 58, 237, 0.1)",
|
|
145
|
-
"--link-gap": "14px",
|
|
146
|
-
"--link-inner-padding": "7px",
|
|
147
|
-
"--link-preview-thumbnail-width": "160px",
|
|
148
|
-
"--linkRadius": "16px",
|
|
149
|
-
"--profile-container-desktop-width": "580px",
|
|
150
|
-
"--profileBackground": "#faf5ff",
|
|
151
|
-
"--background-contrast-color": "#1f2937",
|
|
152
|
-
"--bodyText": "#1f2937",
|
|
153
|
-
"--profileTitleText": "#1f2937",
|
|
154
|
-
"--profileDescriptionText": "#1f2937",
|
|
155
|
-
"--defaultAvatarBackground": "#7c3aed",
|
|
156
|
-
"--defaultAvatarText": "#ffffff",
|
|
157
|
-
"--socialLinkFill": "#1f2937",
|
|
158
|
-
"--linkBackground": "#7c3aed",
|
|
159
|
-
"--linkText": "#ffffff",
|
|
160
|
-
"--linkHoverBackground": "color-mix(in srgb, #7c3aed 93%, #ffffff 7%)",
|
|
161
|
-
"--linkHoverText": "#ffffff",
|
|
162
|
-
"--linkShadow": "#7c3aed",
|
|
163
|
-
"--bannerBackground": "#7c3aed",
|
|
164
|
-
"--bannerText": "#ffffff",
|
|
165
|
-
"--desktop-frame-color": "color-mix(in srgb, #faf5ff 88%, black 12%)",
|
|
166
|
-
"--profileFontFamilyPrimary":
|
|
167
|
-
'Link Sans Product, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
168
|
-
"--profileFontFamilySecondary":
|
|
169
|
-
'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
170
|
-
"--header-font-family":
|
|
171
|
-
'Link Sans Product, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
172
|
-
"--profileFontWeightNormal": "500",
|
|
173
|
-
"--profileFontWeightBold": "700",
|
|
174
|
-
"--profileDescriptionFontWeight": "500",
|
|
175
|
-
"--linkTextFontWeight": "500",
|
|
176
|
-
"--headerFontWeight": "700",
|
|
177
|
-
"--header-font-weight": "600",
|
|
178
|
-
"--embedLinkTextFontWeight": "500",
|
|
179
|
-
"--signupSubmitTextFontWeight": "700",
|
|
180
|
-
"--bannerFontWeight": "700",
|
|
181
|
-
"--headerFontSize": "normal",
|
|
182
|
-
"--header-bio-font-size": "16px",
|
|
183
|
-
"--embedLinkTextFontSize": "14px",
|
|
184
|
-
"--signupSubmitTextFontSize": "14px",
|
|
185
|
-
"--linkHeaderFontSize": "14px",
|
|
186
|
-
"--bannerFontSize": "14px",
|
|
187
|
-
"--profileDescriptionLineHeight": "1.5",
|
|
188
|
-
"--headerLineHeight": "1.5",
|
|
189
|
-
"--header-text-color": "#1f2937",
|
|
190
55
|
},
|
|
191
56
|
},
|
|
192
57
|
outline: {
|
|
@@ -203,51 +68,6 @@ export const THEME_PRESETS = {
|
|
|
203
68
|
"--button-style-radius": "24px",
|
|
204
69
|
"--button-style-inner-radius": "min(24px, max(4px, calc(24px - 8px)))",
|
|
205
70
|
"--button-style-skeleton-color": "rgba(0, 0, 0, 0.05)",
|
|
206
|
-
"--link-gap": "14px",
|
|
207
|
-
"--link-inner-padding": "7px",
|
|
208
|
-
"--link-preview-thumbnail-width": "160px",
|
|
209
|
-
"--linkRadius": "24px",
|
|
210
|
-
"--profile-container-desktop-width": "580px",
|
|
211
|
-
"--profileBackground": "#ffffff",
|
|
212
|
-
"--background-contrast-color": "#000000",
|
|
213
|
-
"--bodyText": "#000000",
|
|
214
|
-
"--profileTitleText": "#000000",
|
|
215
|
-
"--profileDescriptionText": "#000000",
|
|
216
|
-
"--defaultAvatarBackground": "#000000",
|
|
217
|
-
"--defaultAvatarText": "#ffffff",
|
|
218
|
-
"--socialLinkFill": "#000000",
|
|
219
|
-
"--linkBackground": "transparent",
|
|
220
|
-
"--linkText": "#000000",
|
|
221
|
-
"--linkHoverBackground": "rgba(0, 0, 0, 0.05)",
|
|
222
|
-
"--linkHoverText": "#000000",
|
|
223
|
-
"--linkShadow": "#000000",
|
|
224
|
-
"--bannerBackground": "#ffffff",
|
|
225
|
-
"--bannerText": "#000000",
|
|
226
|
-
"--desktop-frame-color": "color-mix(in srgb, #ffffff 88%, black 12%)",
|
|
227
|
-
"--profileFontFamilyPrimary":
|
|
228
|
-
'Link Sans Product, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
229
|
-
"--profileFontFamilySecondary":
|
|
230
|
-
'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
231
|
-
"--header-font-family":
|
|
232
|
-
'Link Sans Product, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
233
|
-
"--profileFontWeightNormal": "500",
|
|
234
|
-
"--profileFontWeightBold": "700",
|
|
235
|
-
"--profileDescriptionFontWeight": "500",
|
|
236
|
-
"--linkTextFontWeight": "500",
|
|
237
|
-
"--headerFontWeight": "700",
|
|
238
|
-
"--header-font-weight": "600",
|
|
239
|
-
"--embedLinkTextFontWeight": "500",
|
|
240
|
-
"--signupSubmitTextFontWeight": "700",
|
|
241
|
-
"--bannerFontWeight": "700",
|
|
242
|
-
"--headerFontSize": "normal",
|
|
243
|
-
"--header-bio-font-size": "16px",
|
|
244
|
-
"--embedLinkTextFontSize": "14px",
|
|
245
|
-
"--signupSubmitTextFontSize": "14px",
|
|
246
|
-
"--linkHeaderFontSize": "14px",
|
|
247
|
-
"--bannerFontSize": "14px",
|
|
248
|
-
"--profileDescriptionLineHeight": "1.5",
|
|
249
|
-
"--headerLineHeight": "1.5",
|
|
250
|
-
"--header-text-color": "#000000",
|
|
251
71
|
},
|
|
252
72
|
},
|
|
253
73
|
rounded: {
|
|
@@ -265,51 +85,6 @@ export const THEME_PRESETS = {
|
|
|
265
85
|
"--button-style-radius": "28px",
|
|
266
86
|
"--button-style-inner-radius": "28px",
|
|
267
87
|
"--button-style-skeleton-color": "rgba(5, 150, 105, 0.1)",
|
|
268
|
-
"--link-gap": "14px",
|
|
269
|
-
"--link-inner-padding": "7px",
|
|
270
|
-
"--link-preview-thumbnail-width": "160px",
|
|
271
|
-
"--linkRadius": "28px",
|
|
272
|
-
"--profile-container-desktop-width": "580px",
|
|
273
|
-
"--profileBackground": "#ecfdf5",
|
|
274
|
-
"--background-contrast-color": "#1f2937",
|
|
275
|
-
"--bodyText": "#1f2937",
|
|
276
|
-
"--profileTitleText": "#1f2937",
|
|
277
|
-
"--profileDescriptionText": "#1f2937",
|
|
278
|
-
"--defaultAvatarBackground": "#059669",
|
|
279
|
-
"--defaultAvatarText": "#ffffff",
|
|
280
|
-
"--socialLinkFill": "#1f2937",
|
|
281
|
-
"--linkBackground": "#059669",
|
|
282
|
-
"--linkText": "#ffffff",
|
|
283
|
-
"--linkHoverBackground": "color-mix(in srgb, #059669 93%, #ffffff 7%)",
|
|
284
|
-
"--linkHoverText": "#ffffff",
|
|
285
|
-
"--linkShadow": "#059669",
|
|
286
|
-
"--bannerBackground": "#059669",
|
|
287
|
-
"--bannerText": "#ffffff",
|
|
288
|
-
"--desktop-frame-color": "color-mix(in srgb, #ecfdf5 88%, black 12%)",
|
|
289
|
-
"--profileFontFamilyPrimary":
|
|
290
|
-
'Link Sans Product, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
291
|
-
"--profileFontFamilySecondary":
|
|
292
|
-
'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
293
|
-
"--header-font-family":
|
|
294
|
-
'Link Sans Product, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
295
|
-
"--profileFontWeightNormal": "500",
|
|
296
|
-
"--profileFontWeightBold": "700",
|
|
297
|
-
"--profileDescriptionFontWeight": "500",
|
|
298
|
-
"--linkTextFontWeight": "500",
|
|
299
|
-
"--headerFontWeight": "700",
|
|
300
|
-
"--header-font-weight": "600",
|
|
301
|
-
"--embedLinkTextFontWeight": "500",
|
|
302
|
-
"--signupSubmitTextFontWeight": "700",
|
|
303
|
-
"--bannerFontWeight": "700",
|
|
304
|
-
"--headerFontSize": "normal",
|
|
305
|
-
"--header-bio-font-size": "16px",
|
|
306
|
-
"--embedLinkTextFontSize": "14px",
|
|
307
|
-
"--signupSubmitTextFontSize": "14px",
|
|
308
|
-
"--linkHeaderFontSize": "14px",
|
|
309
|
-
"--bannerFontSize": "14px",
|
|
310
|
-
"--profileDescriptionLineHeight": "1.5",
|
|
311
|
-
"--headerLineHeight": "1.5",
|
|
312
|
-
"--header-text-color": "#1f2937",
|
|
313
88
|
},
|
|
314
89
|
},
|
|
315
90
|
};
|
package/dist/cli.js
CHANGED
|
@@ -22,6 +22,7 @@ cli
|
|
|
22
22
|
.option('--analyze', 'Generate bundle analysis report (deprecated, use --profile)')
|
|
23
23
|
.option('--profile', 'Enable build profiling and bundle analysis')
|
|
24
24
|
.option('--sourcemap', 'Generate sourcemaps for production build')
|
|
25
|
+
.option('--compress', 'Generate Brotli-compressed (.br) files for optimal CDN delivery')
|
|
25
26
|
.action(buildCommand);
|
|
26
27
|
// Deploy command
|
|
27
28
|
cli
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAA;AAE7E,MAAM,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,CAAA;AAE1B,eAAe;AACf,MAAM,OAAO,GAAG,OAAO,CAAA;AAEvB,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;AAE3B,cAAc;AACd,GAAG;KACA,OAAO,CAAC,KAAK,EAAE,uCAAuC,CAAC;KACvD,MAAM,CAAC,eAAe,EAAE,qCAAqC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;KACjF,MAAM,CAAC,UAAU,CAAC,CAAA;AAErB,gBAAgB;AAChB,GAAG;KACA,OAAO,CAAC,OAAO,EAAE,8BAA8B,CAAC;KAChD,MAAM,CAAC,WAAW,EAAE,6DAA6D,CAAC;KAClF,MAAM,CAAC,WAAW,EAAE,4CAA4C,CAAC;KAC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B,CAAC;KACjD,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC;KACjD,MAAM,CAAC,UAAU,CAAC,CAAA;AAErB,gBAAgB;AAChB,GAAG;KACA,OAAO,CAAC,OAAO,EAAE,4BAA4B,CAAC;KAC9C,MAAM,CAAC,MAAM,EAAE,+CAA+C,CAAC;KAC/D,MAAM,CAAC,YAAY,CAAC,CAAA;AAEvB,iBAAiB;AACjB,GAAG;KACA,OAAO,CAAC,QAAQ,EAAE,sBAAsB,CAAC;KACzC,MAAM,CAAC,MAAM,EAAE,kDAAkD,CAAC;KAClE,MAAM,CAAC,aAAa,CAAC,CAAA;AAExB,uBAAuB;AACvB,GAAG,CAAC,OAAO,CAAC,4BAA4B,EAAE,oCAAoC,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAA;AAEhH,gBAAgB;AAChB,GAAG,CAAC,KAAK,EAAE,CAAA"}
|
package/dist/commands/build.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAWA,UAAU,YAAY;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,iBAqGvD"}
|
package/dist/commands/build.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import pc from 'picocolors';
|
|
2
2
|
import { createRsbuild } from '@rsbuild/core';
|
|
3
3
|
import { createRsbuildConfig } from '../lib/rsbuild/config-factory.js';
|
|
4
|
-
import { existsSync, statSync, readdirSync } from 'node:fs';
|
|
4
|
+
import { existsSync, statSync, readdirSync, readFileSync } from 'node:fs';
|
|
5
5
|
import { join } from 'node:path';
|
|
6
|
+
import { gzipSync, brotliCompressSync, constants } from 'node:zlib';
|
|
6
7
|
const writeLine = (message = '') => {
|
|
7
8
|
process.stdout.write(`${message}\n`);
|
|
8
9
|
};
|
|
@@ -17,6 +18,7 @@ export async function buildCommand(options) {
|
|
|
17
18
|
mode: 'production',
|
|
18
19
|
sourcemap: options.sourcemap || false,
|
|
19
20
|
profile: enableProfiling,
|
|
21
|
+
compress: options.compress || false,
|
|
20
22
|
});
|
|
21
23
|
// Run Rsbuild build
|
|
22
24
|
const rsbuild = await createRsbuild({ rsbuildConfig: config });
|
|
@@ -29,11 +31,50 @@ export async function buildCommand(options) {
|
|
|
29
31
|
const assetDetails = collectAssetDetails(buildResult?.stats);
|
|
30
32
|
if (assetDetails.length > 0) {
|
|
31
33
|
writeLine(pc.bold('Build output:'));
|
|
34
|
+
// Calculate compression estimates for main assets
|
|
35
|
+
const distPath = join(process.cwd(), 'dist');
|
|
36
|
+
const jsAssets = assetDetails.filter(a => a.name.endsWith('.js'));
|
|
37
|
+
const cssAssets = assetDetails.filter(a => a.name.endsWith('.css'));
|
|
32
38
|
for (const asset of assetDetails) {
|
|
33
39
|
const sizeKB = (asset.size / 1024).toFixed(1);
|
|
34
|
-
|
|
40
|
+
const assetPath = join(distPath, asset.name);
|
|
41
|
+
// Show compression estimates for JS and CSS files
|
|
42
|
+
if ((asset.name.endsWith('.js') || asset.name.endsWith('.css')) && existsSync(assetPath)) {
|
|
43
|
+
try {
|
|
44
|
+
const content = readFileSync(assetPath);
|
|
45
|
+
const gzipped = gzipSync(content);
|
|
46
|
+
const brotli = brotliCompressSync(content, {
|
|
47
|
+
params: {
|
|
48
|
+
[constants.BROTLI_PARAM_QUALITY]: 11,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
const gzipKB = (gzipped.length / 1024).toFixed(1);
|
|
52
|
+
const brotliKB = (brotli.length / 1024).toFixed(1);
|
|
53
|
+
writeLine(pc.dim(` ${asset.name}`));
|
|
54
|
+
writeLine(pc.dim(` ${sizeKB} KB (raw) → ${gzipKB} KB (gzip) → ${brotliKB} KB (brotli)`));
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
writeLine(pc.dim(` ${asset.name} ${sizeKB} KB`));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
writeLine(pc.dim(` ${asset.name} ${sizeKB} KB`));
|
|
62
|
+
}
|
|
35
63
|
}
|
|
36
64
|
writeLine();
|
|
65
|
+
// Show totals
|
|
66
|
+
const totalJS = jsAssets.reduce((sum, a) => sum + a.size, 0);
|
|
67
|
+
const totalCSS = cssAssets.reduce((sum, a) => sum + a.size, 0);
|
|
68
|
+
if (totalJS > 0 || totalCSS > 0) {
|
|
69
|
+
writeLine(pc.bold('Bundle size summary:'));
|
|
70
|
+
if (totalJS > 0) {
|
|
71
|
+
writeLine(pc.dim(` JavaScript: ${(totalJS / 1024).toFixed(1)} KB`));
|
|
72
|
+
}
|
|
73
|
+
if (totalCSS > 0) {
|
|
74
|
+
writeLine(pc.dim(` CSS: ${(totalCSS / 1024).toFixed(1)} KB`));
|
|
75
|
+
}
|
|
76
|
+
writeLine();
|
|
77
|
+
}
|
|
37
78
|
}
|
|
38
79
|
// Show dist directory size
|
|
39
80
|
const distPath = join(process.cwd(), 'dist');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAe,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"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AAI,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;IAC3F,CAAC;IAED,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAA;AAChC,CAAC;AAED,SAAS,YAAY,CAAC,KAAuC;IAC3D,OAAO,OAAO,IAAI,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AACvD,CAAC;AAED,SAAS,UAAU,CAAC,OAAe;IACjC,IAAI,SAAS,GAAG,CAAC,CAAA;IAEjB,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;IAElC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAEhC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,SAAS,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAA;QACnC,CAAC;aAAM,CAAC;YACN,SAAS,IAAI,KAAK,CAAC,IAAI,CAAA;QACzB,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-factory.d.ts","sourceRoot":"","sources":["../../../src/lib/rsbuild/config-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"config-factory.d.ts","sourceRoot":"","sources":["../../../src/lib/rsbuild/config-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAQlD;;;;;;;;;;;GAWG;AAEH,UAAU,oBAAoB;IAC5B,IAAI,EAAE,aAAa,GAAG,YAAY,CAAA;IAClC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAwKhF"}
|
|
@@ -3,8 +3,9 @@ import { resolve, join } from 'node:path';
|
|
|
3
3
|
import { assetVersioning } from './plugins/asset-versioning.js';
|
|
4
4
|
import { setupRuntime } from '../utils/setup-runtime.js';
|
|
5
5
|
import { copyPublicDirectory } from './plugins/copy-public.js';
|
|
6
|
+
import { brotliCompression } from './plugins/brotli-compression.js';
|
|
6
7
|
export function createRsbuildConfig(options) {
|
|
7
|
-
const { mode, port = 3000, host = 'localhost', open = false, sourcemap = false, profile = false } = options;
|
|
8
|
+
const { mode, port = 3000, host = 'localhost', open = false, sourcemap = false, profile = false, compress = false } = options;
|
|
8
9
|
const isDev = mode === 'development';
|
|
9
10
|
const projectRoot = process.cwd();
|
|
10
11
|
const runtimeRoot = join(projectRoot, '.linkapp');
|
|
@@ -113,6 +114,25 @@ export function createRsbuildConfig(options) {
|
|
|
113
114
|
printFileSize: !isDev,
|
|
114
115
|
chunkSplit: {
|
|
115
116
|
strategy: 'split-by-experience',
|
|
117
|
+
override: {
|
|
118
|
+
cacheGroups: {
|
|
119
|
+
// Separate React vendor bundle for better caching
|
|
120
|
+
react: {
|
|
121
|
+
test: /[\\/]node_modules[\\/](react|react-dom|scheduler)[\\/]/,
|
|
122
|
+
name: 'react-vendor',
|
|
123
|
+
priority: 20,
|
|
124
|
+
chunks: 'all',
|
|
125
|
+
},
|
|
126
|
+
// Group other node_modules into vendor bundle
|
|
127
|
+
vendor: {
|
|
128
|
+
test: /[\\/]node_modules[\\/]/,
|
|
129
|
+
name: 'vendor',
|
|
130
|
+
priority: 10,
|
|
131
|
+
chunks: 'all',
|
|
132
|
+
minSize: 10000, // Only create vendor chunk if > 10KB
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
116
136
|
},
|
|
117
137
|
},
|
|
118
138
|
};
|
|
@@ -125,6 +145,13 @@ export function createRsbuildConfig(options) {
|
|
|
125
145
|
}), assetVersioning({
|
|
126
146
|
manifestPath: 'build-manifest.json',
|
|
127
147
|
}));
|
|
148
|
+
// Add Brotli compression if requested
|
|
149
|
+
if (compress) {
|
|
150
|
+
config.plugins.push(brotliCompression({
|
|
151
|
+
quality: 11,
|
|
152
|
+
threshold: 1024,
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
128
155
|
// Add bundle analyzer if requested
|
|
129
156
|
if (profile) {
|
|
130
157
|
console.warn('⚠️ Bundle profiling is not available yet in Rsbuild config. Use --sourcemap flag and analyze with external tools.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-factory.js","sourceRoot":"","sources":["../../../src/lib/rsbuild/config-factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"config-factory.js","sourceRoot":"","sources":["../../../src/lib/rsbuild/config-factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,I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Q,EAAE,EAAE;4BACZ,MAAM,EAAE,KAAK;4BACb,OAAO,EAAE,KAAK,EAAE,qCAAqC;yBACtD;qBACF;iBACF;aACF;SACF;KACF,CAAA;IAED,8BAA8B;IAC9B,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAA;QACrC,MAAM,CAAC,OAAO,CAAC,IAAI,CACjB,mBAAmB,CAAC;YAClB,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC;YACtC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;SAClC,CAAC,EACF,eAAe,CAAC;YACd,YAAY,EAAE,qBAAqB;SACpC,CAAC,CACH,CAAA;QAED,sCAAsC;QACtC,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,CAAC,OAAO,CAAC,IAAI,CACjB,iBAAiB,CAAC;gBAChB,OAAO,EAAE,EAAE;gBACX,SAAS,EAAE,IAAI;aAChB,CAAC,CACH,CAAA;QACH,CAAC;QAED,mCAAmC;QACnC,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,CACV,oHAAoH,CACrH,CAAA;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { RsbuildPlugin } from '@rsbuild/core';
|
|
2
|
+
interface BrotliCompressionOptions {
|
|
3
|
+
/**
|
|
4
|
+
* File extensions to compress
|
|
5
|
+
* @default ['.js', '.css', '.html', '.svg', '.json']
|
|
6
|
+
*/
|
|
7
|
+
test?: string[];
|
|
8
|
+
/**
|
|
9
|
+
* Minimum file size to compress (in bytes)
|
|
10
|
+
* @default 1024 (1KB)
|
|
11
|
+
*/
|
|
12
|
+
threshold?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Brotli compression quality (0-11)
|
|
15
|
+
* @default 11 (maximum compression)
|
|
16
|
+
*/
|
|
17
|
+
quality?: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function brotliCompression(options?: BrotliCompressionOptions): RsbuildPlugin;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=brotli-compression.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brotli-compression.d.ts","sourceRoot":"","sources":["../../../../src/lib/rsbuild/plugins/brotli-compression.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAMlD,UAAU,wBAAwB;IAChC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,wBAA6B,GAAG,aAAa,CAoFvF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { brotliCompressSync, constants } from 'node:zlib';
|
|
2
|
+
import { readFileSync, writeFileSync, readdirSync, statSync } from 'node:fs';
|
|
3
|
+
import { join, extname } from 'node:path';
|
|
4
|
+
import pc from 'picocolors';
|
|
5
|
+
export function brotliCompression(options = {}) {
|
|
6
|
+
const { test = ['.js', '.css', '.html', '.svg', '.json'], threshold = 1024, quality = 11, } = options;
|
|
7
|
+
return {
|
|
8
|
+
name: 'brotli-compression',
|
|
9
|
+
setup(api) {
|
|
10
|
+
api.onAfterBuild(async () => {
|
|
11
|
+
const config = api.getNormalizedConfig();
|
|
12
|
+
const distPath = config.output.distPath.root;
|
|
13
|
+
if (!distPath) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
console.log(pc.cyan('\n🗜️ Compressing assets with Brotli...'));
|
|
17
|
+
const compressedFiles = [];
|
|
18
|
+
function compressDirectory(dirPath) {
|
|
19
|
+
const files = readdirSync(dirPath);
|
|
20
|
+
for (const file of files) {
|
|
21
|
+
const filePath = join(dirPath, file);
|
|
22
|
+
const stat = statSync(filePath);
|
|
23
|
+
if (stat.isDirectory()) {
|
|
24
|
+
compressDirectory(filePath);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const ext = extname(file);
|
|
28
|
+
if (test.includes(ext) && stat.size >= threshold) {
|
|
29
|
+
try {
|
|
30
|
+
const content = readFileSync(filePath);
|
|
31
|
+
const compressed = brotliCompressSync(content, {
|
|
32
|
+
params: {
|
|
33
|
+
[constants.BROTLI_PARAM_QUALITY]: quality,
|
|
34
|
+
[constants.BROTLI_PARAM_MODE]: constants.BROTLI_MODE_TEXT,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
const outputPath = `${filePath}.br`;
|
|
38
|
+
writeFileSync(outputPath, compressed);
|
|
39
|
+
const compressionRatio = ((1 - compressed.length / content.length) * 100).toFixed(1);
|
|
40
|
+
compressedFiles.push({
|
|
41
|
+
name: file,
|
|
42
|
+
original: content.length,
|
|
43
|
+
compressed: compressed.length,
|
|
44
|
+
});
|
|
45
|
+
console.log(pc.dim(` ✓ ${file} ${(content.length / 1024).toFixed(1)} KB → ${(compressed.length / 1024).toFixed(1)} KB (${compressionRatio}% smaller)`));
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
console.warn(pc.yellow(` ⚠ Failed to compress ${file}:`), error);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
compressDirectory(distPath);
|
|
55
|
+
if (compressedFiles.length > 0) {
|
|
56
|
+
const totalOriginal = compressedFiles.reduce((sum, f) => sum + f.original, 0);
|
|
57
|
+
const totalCompressed = compressedFiles.reduce((sum, f) => sum + f.compressed, 0);
|
|
58
|
+
const totalSavings = ((1 - totalCompressed / totalOriginal) * 100).toFixed(1);
|
|
59
|
+
console.log(pc.green(`\n✓ Compressed ${compressedFiles.length} files: ${(totalOriginal / 1024).toFixed(1)} KB → ${(totalCompressed / 1024).toFixed(1)} KB (${totalSavings}% smaller)`));
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
console.log(pc.dim(' No files met compression criteria'));
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=brotli-compression.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brotli-compression.js","sourceRoot":"","sources":["../../../../src/lib/rsbuild/plugins/brotli-compression.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC5E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,MAAM,YAAY,CAAA;AAoB3B,MAAM,UAAU,iBAAiB,CAAC,UAAoC,EAAE;IACtE,MAAM,EACJ,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAChD,SAAS,GAAG,IAAI,EAChB,OAAO,GAAG,EAAE,GACb,GAAG,OAAO,CAAA;IAEX,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,KAAK,CAAC,GAAG;YACP,GAAG,CAAC,YAAY,CAAC,KAAK,IAAI,EAAE;gBAC1B,MAAM,MAAM,GAAG,GAAG,CAAC,mBAAmB,EAAE,CAAA;gBACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAA;gBAE5C,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACd,OAAM;gBACR,CAAC;gBAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC,CAAA;gBAEhE,MAAM,eAAe,GAAkE,EAAE,CAA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ACF,CAAA;gBACH,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC,CAAA;gBAC5D,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-runtime.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/setup-runtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup-runtime.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/setup-runtime.ts"],"names":[],"mappings":"AA2OA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAyBtD"}
|
|
@@ -23,7 +23,7 @@ function generateMainTsx(projectPath) {
|
|
|
23
23
|
const layoutsObj = layouts
|
|
24
24
|
.map((layout) => {
|
|
25
25
|
// Quote keys that contain hyphens
|
|
26
|
-
const key = layout.name.includes(
|
|
26
|
+
const key = layout.name.includes("-") ? `'${layout.name}'` : layout.name;
|
|
27
27
|
return ` ${key}: ${layout.displayName},`;
|
|
28
28
|
})
|
|
29
29
|
.join("\n");
|
|
@@ -82,7 +82,6 @@ const mockThemeVars = {
|
|
|
82
82
|
'--button-style-border-color': '#e5e7eb',
|
|
83
83
|
'--button-style-background-hover': '#f3f4f6',
|
|
84
84
|
'--button-style-contrast-color': '#ffffff',
|
|
85
|
-
'--profileBackground': '#ffffff',
|
|
86
85
|
}
|
|
87
86
|
|
|
88
87
|
const mockContext: ExtensionData = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-runtime.js","sourceRoot":"","sources":["../../../src/lib/utils/setup-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MA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CAAC,CAAC;QACvD,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAElE,oEAAoE;QACpE,MAAM,OAAO,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;QAC7C,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;QACvD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
package/runtime/index.html
CHANGED
|
@@ -23,48 +23,6 @@
|
|
|
23
23
|
--button-style-radius: 8px;
|
|
24
24
|
--button-style-inner-radius: min(8px, max(4px, calc(8px - 8px)));
|
|
25
25
|
--button-style-skeleton-color: rgba(0, 0, 0, 0.05);
|
|
26
|
-
--link-gap: 14px;
|
|
27
|
-
--link-inner-padding: 7px;
|
|
28
|
-
--link-preview-thumbnail-width: 160px;
|
|
29
|
-
--linkRadius: 8px;
|
|
30
|
-
--profile-container-desktop-width: 580px;
|
|
31
|
-
--profileBackground: #eceef1;
|
|
32
|
-
--background-contrast-color: #000000;
|
|
33
|
-
--bodyText: #000000;
|
|
34
|
-
--profileTitleText: #000000;
|
|
35
|
-
--profileDescriptionText: #000000;
|
|
36
|
-
--defaultAvatarBackground: #000000;
|
|
37
|
-
--defaultAvatarText: #ffffff;
|
|
38
|
-
--socialLinkFill: #000000;
|
|
39
|
-
--linkBackground: #ffffff;
|
|
40
|
-
--linkText: #000000;
|
|
41
|
-
--linkHoverBackground: color-mix(in srgb, #ffffff 93%, #000000 7%);
|
|
42
|
-
--linkHoverText: #000000;
|
|
43
|
-
--linkShadow: #000000;
|
|
44
|
-
--bannerBackground: #ffffff;
|
|
45
|
-
--bannerText: #000000;
|
|
46
|
-
--desktop-frame-color: color-mix(in srgb, #eceef1 88%, black 12%);
|
|
47
|
-
--profileFontFamilyPrimary: Link Sans Product, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
48
|
-
--profileFontFamilySecondary: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
49
|
-
--header-font-family: Link Sans Product, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
50
|
-
--profileFontWeightNormal: 500;
|
|
51
|
-
--profileFontWeightBold: 700;
|
|
52
|
-
--profileDescriptionFontWeight: 500;
|
|
53
|
-
--linkTextFontWeight: 500;
|
|
54
|
-
--headerFontWeight: 700;
|
|
55
|
-
--header-font-weight: 600;
|
|
56
|
-
--embedLinkTextFontWeight: 500;
|
|
57
|
-
--signupSubmitTextFontWeight: 700;
|
|
58
|
-
--bannerFontWeight: 700;
|
|
59
|
-
--headerFontSize: normal;
|
|
60
|
-
--header-bio-font-size: 16px;
|
|
61
|
-
--embedLinkTextFontSize: 14px;
|
|
62
|
-
--signupSubmitTextFontSize: 14px;
|
|
63
|
-
--linkHeaderFontSize: 14px;
|
|
64
|
-
--bannerFontSize: 14px;
|
|
65
|
-
--profileDescriptionLineHeight: 1.5;
|
|
66
|
-
--headerLineHeight: 1.5;
|
|
67
|
-
--header-text-color: #000000;
|
|
68
26
|
}
|
|
69
27
|
</style>
|
|
70
28
|
|