uniweb 0.1.6 → 0.1.7
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/package.json +1 -1
- package/src/index.js +61 -7
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -243,8 +243,7 @@ async function createWorkspace(projectDir, projectName) {
|
|
|
243
243
|
scripts: {
|
|
244
244
|
dev: 'pnpm --filter site dev',
|
|
245
245
|
'dev:runtime': 'VITE_FOUNDATION_MODE=runtime pnpm --filter site dev',
|
|
246
|
-
|
|
247
|
-
build: 'pnpm build:foundation && pnpm --filter site build',
|
|
246
|
+
build: 'pnpm -r build',
|
|
248
247
|
},
|
|
249
248
|
pnpm: {
|
|
250
249
|
onlyBuiltDependencies: ['esbuild', 'sharp'],
|
|
@@ -318,13 +317,20 @@ Use this to debug issues that only appear in production.
|
|
|
318
317
|
## Building for Production
|
|
319
318
|
|
|
320
319
|
\`\`\`bash
|
|
321
|
-
# Build
|
|
320
|
+
# Build all packages (foundations and sites)
|
|
322
321
|
pnpm build
|
|
322
|
+
|
|
323
|
+
# Build a specific package
|
|
324
|
+
pnpm --filter foundation build
|
|
325
|
+
pnpm --filter site build
|
|
326
|
+
|
|
327
|
+
# Build only certain packages
|
|
328
|
+
pnpm --filter marketing-site --filter docs-site build
|
|
323
329
|
\`\`\`
|
|
324
330
|
|
|
325
|
-
Output
|
|
326
|
-
- \`packages/foundation/dist/\` — Bundled
|
|
327
|
-
- \`packages/site/dist/\` — Production-ready site
|
|
331
|
+
**Output:**
|
|
332
|
+
- \`packages/[foundation]/dist/\` — Bundled components, CSS, and schema.json
|
|
333
|
+
- \`packages/[site]/dist/\` — Production-ready static site
|
|
328
334
|
|
|
329
335
|
## Adding Components
|
|
330
336
|
|
|
@@ -361,7 +367,55 @@ defaultLanguage: en
|
|
|
361
367
|
foundation: foundation # References packages/foundation
|
|
362
368
|
\`\`\`
|
|
363
369
|
|
|
364
|
-
|
|
370
|
+
## Multiple Sites and Foundations
|
|
371
|
+
|
|
372
|
+
This workspace supports multiple sites and foundations. The \`packages/*\` pattern includes any package you add.
|
|
373
|
+
|
|
374
|
+
**Adding another foundation:**
|
|
375
|
+
|
|
376
|
+
\`\`\`bash
|
|
377
|
+
npx uniweb create packages/docs-foundation --template foundation
|
|
378
|
+
\`\`\`
|
|
379
|
+
|
|
380
|
+
**Adding another site:**
|
|
381
|
+
|
|
382
|
+
\`\`\`bash
|
|
383
|
+
npx uniweb create packages/docs-site --template site
|
|
384
|
+
\`\`\`
|
|
385
|
+
|
|
386
|
+
Then edit \`packages/docs-site/site.yml\` to use the new foundation:
|
|
387
|
+
|
|
388
|
+
\`\`\`yaml
|
|
389
|
+
foundation: docs-foundation
|
|
390
|
+
\`\`\`
|
|
391
|
+
|
|
392
|
+
**Running a specific site:**
|
|
393
|
+
|
|
394
|
+
\`\`\`bash
|
|
395
|
+
pnpm --filter docs-site dev
|
|
396
|
+
\`\`\`
|
|
397
|
+
|
|
398
|
+
## Sharing Components
|
|
399
|
+
|
|
400
|
+
For components shared across multiple foundations, create a shared package:
|
|
401
|
+
|
|
402
|
+
\`\`\`
|
|
403
|
+
packages/
|
|
404
|
+
├── shared/ # Shared React components
|
|
405
|
+
│ ├── package.json
|
|
406
|
+
│ └── src/
|
|
407
|
+
│ └── Button.jsx
|
|
408
|
+
├── marketing-foundation/
|
|
409
|
+
├── docs-foundation/
|
|
410
|
+
└── site/
|
|
411
|
+
\`\`\`
|
|
412
|
+
|
|
413
|
+
Foundations can import from the shared package:
|
|
414
|
+
|
|
415
|
+
\`\`\`js
|
|
416
|
+
// packages/marketing-foundation/src/components/Hero/index.jsx
|
|
417
|
+
import { Button } from 'shared'
|
|
418
|
+
\`\`\`
|
|
365
419
|
|
|
366
420
|
## What is Uniweb?
|
|
367
421
|
|