uniweb 1.0.0 → 1.0.2
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/LICENSE +201 -0
- package/README.md +532 -3
- package/package.json +60 -11
- package/partials/adding-pages.hbs +77 -0
- package/partials/agents.md +3000 -0
- package/partials/ai-assistance.hbs +28 -0
- package/partials/components-docs.hbs +13 -0
- package/partials/config-reference.hbs +66 -0
- package/partials/deployment.hbs +13 -0
- package/partials/learn-more.hbs +6 -0
- package/partials/quick-start.hbs +8 -0
- package/partials/search-docs.hbs +110 -0
- package/src/backend/asset-download.js +222 -0
- package/src/backend/client.js +986 -0
- package/src/backend/foundation-bring-along.js +692 -0
- package/src/backend/payment-handoff.js +362 -0
- package/src/backend/service-request.js +210 -0
- package/src/backend/site-media.js +255 -0
- package/src/backend/site-preview.js +77 -0
- package/src/backend/site-sync.js +2515 -0
- package/src/backend/workspace.js +234 -0
- package/src/commands/add.js +1900 -0
- package/src/commands/build.js +1214 -0
- package/src/commands/clone.js +466 -0
- package/src/commands/content.js +202 -0
- package/src/commands/deploy.js +537 -0
- package/src/commands/dev.js +202 -0
- package/src/commands/docs.js +530 -0
- package/src/commands/doctor.js +1982 -0
- package/src/commands/export.js +116 -0
- package/src/commands/families.js +82 -0
- package/src/commands/forget.js +197 -0
- package/src/commands/handoff.js +21 -0
- package/src/commands/i18n.js +1707 -0
- package/src/commands/inspect.js +375 -0
- package/src/commands/invite.js +24 -0
- package/src/commands/org.js +96 -0
- package/src/commands/publish.js +1087 -0
- package/src/commands/pull.js +1257 -0
- package/src/commands/push.js +663 -0
- package/src/commands/refresh.js +212 -0
- package/src/commands/register.js +1092 -0
- package/src/commands/rename.js +647 -0
- package/src/commands/site.js +358 -0
- package/src/commands/snapshot.js +461 -0
- package/src/commands/starter.js +206 -0
- package/src/commands/status.js +302 -0
- package/src/commands/sync.js +93 -0
- package/src/commands/template.js +107 -0
- package/src/commands/update.js +887 -0
- package/src/commands/validate.js +376 -0
- package/src/framework-index.json +248 -0
- package/src/index.js +2241 -0
- package/src/templates/fetchers/github.js +113 -0
- package/src/templates/fetchers/npm.js +85 -0
- package/src/templates/fetchers/release.js +92 -0
- package/src/templates/index.js +190 -0
- package/src/templates/processor.js +333 -0
- package/src/templates/resolver.js +232 -0
- package/src/templates/validator.js +155 -0
- package/src/utils/agents-stamp.js +110 -0
- package/src/utils/args.js +126 -0
- package/src/utils/asset-upload.js +270 -0
- package/src/utils/bytes.js +30 -0
- package/src/utils/code-upload.js +394 -0
- package/src/utils/config.js +417 -0
- package/src/utils/conformance.js +274 -0
- package/src/utils/dep-survey.js +176 -0
- package/src/utils/destination-prompt.js +146 -0
- package/src/utils/discover.js +75 -0
- package/src/utils/env.js +22 -0
- package/src/utils/exit.js +30 -0
- package/src/utils/fetch-retry.js +109 -0
- package/src/utils/flag-guard.js +246 -0
- package/src/utils/foundation-name.js +179 -0
- package/src/utils/git.js +342 -0
- package/src/utils/host-prompt.js +51 -0
- package/src/utils/install-integrity.js +210 -0
- package/src/utils/interactive.js +118 -0
- package/src/utils/json-file.js +72 -0
- package/src/utils/names.js +91 -0
- package/src/utils/placement.js +151 -0
- package/src/utils/pm.js +165 -0
- package/src/utils/preview.js +20 -0
- package/src/utils/pull-written.js +132 -0
- package/src/utils/records-guard.js +88 -0
- package/src/utils/registry-auth.js +994 -0
- package/src/utils/registry-orgs.js +290 -0
- package/src/utils/scaffold.js +483 -0
- package/src/utils/schemaless-report.js +30 -0
- package/src/utils/semver-precedence.js +80 -0
- package/src/utils/session-file.js +95 -0
- package/src/utils/site-content-refs.js +23 -0
- package/src/utils/site-copies.js +123 -0
- package/src/utils/site-data-upload.js +302 -0
- package/src/utils/site-identity.js +137 -0
- package/src/utils/snapshot-settings.js +112 -0
- package/src/utils/update-check.js +302 -0
- package/src/utils/uwx-read.js +157 -0
- package/src/utils/workspace.js +223 -0
- package/src/versions.js +467 -0
- package/starter/foundation/main.js +50 -0
- package/starter/foundation/sections/Section/index.jsx +95 -0
- package/starter/foundation/sections/Section/meta.js +44 -0
- package/starter/site/pages/about/1-about.md.hbs +13 -0
- package/starter/site/pages/about/page.yml +3 -0
- package/starter/site/pages/home/1-welcome.md.hbs +14 -0
- package/starter/site/pages/home/page.yml +3 -0
- package/templates/foundation/_gitignore +5 -0
- package/templates/foundation/components/.gitkeep +0 -0
- package/templates/foundation/main.js.hbs +33 -0
- package/templates/foundation/package.json.hbs +51 -0
- package/templates/foundation/sections/.gitkeep +0 -0
- package/templates/foundation/styles.css +6 -0
- package/templates/foundation/vite.config.js +3 -0
- package/templates/site/_gitignore +12 -0
- package/templates/site/entry.js +7 -0
- package/templates/site/index.html.hbs +13 -0
- package/templates/site/package.json.hbs +27 -0
- package/templates/site/public/favicon.svg +7 -0
- package/templates/site/site.yml.hbs +91 -0
- package/templates/site/theme.yml +99 -0
- package/templates/site/vite.config.js +7 -0
- package/templates/workspace/AGENTS.md.hbs +2 -0
- package/templates/workspace/README.md.hbs +87 -0
- package/templates/workspace/_gitignore +29 -0
- package/templates/workspace/_vscode/settings.json +6 -0
- package/templates/workspace/package.json.hbs +20 -0
- package/templates/workspace/pnpm-workspace.yaml.hbs +26 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# {{projectName}}
|
|
2
|
+
|
|
3
|
+
A website built with [Uniweb](https://github.com/uniweb/cli) — a component web platform that separates content from code.
|
|
4
|
+
|
|
5
|
+
{{> quick-start}}
|
|
6
|
+
|
|
7
|
+
## Project Structure
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
{{projectName}}/
|
|
11
|
+
├── src/ # Foundation package (the site's source code; pkg name: src)
|
|
12
|
+
│ ├── sections/ # Section types (selectable by content authors)
|
|
13
|
+
│ ├── styles.css # Tailwind CSS v4 theme
|
|
14
|
+
│ ├── main.js # Foundation declarations (name, vars, defaultLayout)
|
|
15
|
+
│ └── vite.config.js # defineFoundationConfig()
|
|
16
|
+
│
|
|
17
|
+
├── site/ # Content (markdown)
|
|
18
|
+
│ ├── pages/ # Content pages
|
|
19
|
+
│ │ └── home/
|
|
20
|
+
│ │ ├── page.yml
|
|
21
|
+
│ │ └── 1-welcome.md
|
|
22
|
+
│ ├── site.yml # Site configuration (foundation: src)
|
|
23
|
+
│ └── vite.config.js # defineSiteConfig()
|
|
24
|
+
│
|
|
25
|
+
└── AGENTS.md # Developer guide (human + AI)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
A site is pure content. A foundation is the site's source code — that's why it lives in `src/`.
|
|
29
|
+
|
|
30
|
+
## Content Authoring
|
|
31
|
+
|
|
32
|
+
Content lives in markdown files under `site/pages/`:
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
---
|
|
36
|
+
type: Section
|
|
37
|
+
theme: light
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
# Welcome
|
|
41
|
+
|
|
42
|
+
Your content here.
|
|
43
|
+
|
|
44
|
+
[Call to Action](#)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
{{> adding-pages}}
|
|
48
|
+
|
|
49
|
+
## Component Development
|
|
50
|
+
|
|
51
|
+
Section types live in `src/sections/`. Each is a folder with an `index.jsx` and a `meta.js`:
|
|
52
|
+
|
|
53
|
+
```jsx
|
|
54
|
+
// src/sections/Hero/index.jsx
|
|
55
|
+
import { H1, P } from '@uniweb/kit'
|
|
56
|
+
|
|
57
|
+
export default function Hero({ content }) {
|
|
58
|
+
const { title, paragraphs = [] } = content || {}
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div className="max-w-4xl mx-auto px-6">
|
|
62
|
+
<H1 text={title} className="text-heading text-4xl font-bold" />
|
|
63
|
+
<P text={paragraphs} className="text-body mt-4" />
|
|
64
|
+
</div>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Components receive parsed content from markdown. Classes like `text-heading` and `text-body` are semantic tokens — the site controls their actual colors through theming, so the same component adapts to any context automatically.
|
|
70
|
+
|
|
71
|
+
{{> components-docs}}
|
|
72
|
+
|
|
73
|
+
## Building
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Build foundation (generates dist/foundation.js)
|
|
77
|
+
cd foundation && pnpm build
|
|
78
|
+
|
|
79
|
+
# Build site for production
|
|
80
|
+
cd site && pnpm build
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Deploy `site/dist/` to any static host (Vercel, Netlify, Cloudflare Pages, etc.)
|
|
84
|
+
|
|
85
|
+
{{> ai-assistance}}
|
|
86
|
+
|
|
87
|
+
{{> learn-more}}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
|
|
4
|
+
# Build outputs
|
|
5
|
+
dist/
|
|
6
|
+
.uniweb/
|
|
7
|
+
|
|
8
|
+
# Generated entry (regenerated by `uniweb build`; never committed)
|
|
9
|
+
_entry.generated.js
|
|
10
|
+
|
|
11
|
+
# Environment
|
|
12
|
+
.env
|
|
13
|
+
.env.local
|
|
14
|
+
.env.*.local
|
|
15
|
+
|
|
16
|
+
# IDE
|
|
17
|
+
.vscode/
|
|
18
|
+
.idea/
|
|
19
|
+
*.swp
|
|
20
|
+
*.swo
|
|
21
|
+
|
|
22
|
+
# OS
|
|
23
|
+
.DS_Store
|
|
24
|
+
Thumbs.db
|
|
25
|
+
|
|
26
|
+
# Logs
|
|
27
|
+
*.log
|
|
28
|
+
npm-debug.log*
|
|
29
|
+
pnpm-debug.log*
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
{{#each scripts}}
|
|
8
|
+
"{{@key}}": "{{this}}"{{#unless @last}},{{/unless}}
|
|
9
|
+
{{/each}}
|
|
10
|
+
},
|
|
11
|
+
"workspaces": [{{#if workspaceGlobs.length}}
|
|
12
|
+
{{#each workspaceGlobs}}
|
|
13
|
+
"{{this}}"{{#unless @last}},{{/unless}}
|
|
14
|
+
{{/each}}
|
|
15
|
+
{{/if}}],
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@types/node": "^22.0.0",
|
|
18
|
+
"uniweb": "{{version "uniweb"}}"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
packages:
|
|
2
|
+
{{#each workspaceGlobs}}
|
|
3
|
+
- "{{this}}"
|
|
4
|
+
{{/each}}
|
|
5
|
+
|
|
6
|
+
# Permit install scripts for these native deps (esbuild compiles, sharp
|
|
7
|
+
# resolves its platform binary). Both spellings are listed on purpose:
|
|
8
|
+
#
|
|
9
|
+
# onlyBuiltDependencies — pnpm 10's name for this setting (a list)
|
|
10
|
+
# allowBuilds — pnpm 11 renamed it (a map)
|
|
11
|
+
#
|
|
12
|
+
# pnpm 11 ignores the old name entirely, so with only the list a fresh
|
|
13
|
+
# install fails with ERR_PNPM_IGNORED_BUILDS and exits 1 — before anything
|
|
14
|
+
# is built. pnpm 10 understands both, so keeping the pair means the project
|
|
15
|
+
# installs on either major. Drop `onlyBuiltDependencies` once pnpm 10 is no
|
|
16
|
+
# longer in use.
|
|
17
|
+
#
|
|
18
|
+
# Neither applies to npm or yarn, which run install scripts by default;
|
|
19
|
+
# they read `workspaces` in package.json and ignore this file.
|
|
20
|
+
onlyBuiltDependencies:
|
|
21
|
+
- esbuild
|
|
22
|
+
- sharp
|
|
23
|
+
|
|
24
|
+
allowBuilds:
|
|
25
|
+
esbuild: true
|
|
26
|
+
sharp: true
|