uniweb 0.13.16 → 0.14.0
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 +1 -1
- package/package.json +7 -7
- package/partials/agents.md +51 -0
- package/src/backend/client.js +173 -40
- package/src/backend/data-bundle.js +15 -3
- package/src/backend/foundation-bring-along.js +76 -21
- package/src/backend/payment-handoff.js +28 -9
- package/src/backend/site-media.js +147 -19
- package/src/backend/site-sync.js +362 -40
- package/src/commands/add.js +575 -273
- package/src/commands/build.js +160 -57
- package/src/commands/clone.js +79 -26
- package/src/commands/content.js +11 -7
- package/src/commands/deploy.js +80 -32
- package/src/commands/dev.js +39 -17
- package/src/commands/docs.js +44 -16
- package/src/commands/doctor.js +338 -82
- package/src/commands/export.js +15 -7
- package/src/commands/handoff.js +6 -2
- package/src/commands/i18n.js +248 -99
- package/src/commands/inspect.js +48 -19
- package/src/commands/invite.js +9 -3
- package/src/commands/org.js +19 -5
- package/src/commands/publish.js +229 -60
- package/src/commands/pull.js +157 -48
- package/src/commands/push.js +144 -42
- package/src/commands/refresh.js +37 -10
- package/src/commands/register.js +235 -64
- package/src/commands/rename.js +126 -46
- package/src/commands/runtime.js +74 -24
- package/src/commands/status.js +48 -15
- package/src/commands/sync.js +7 -2
- package/src/commands/template.js +12 -4
- package/src/commands/update.js +263 -87
- package/src/commands/validate.js +115 -32
- package/src/framework-index.json +16 -14
- package/src/index.js +298 -145
- package/src/templates/fetchers/github.js +7 -7
- package/src/templates/fetchers/npm.js +3 -3
- package/src/templates/fetchers/release.js +21 -18
- package/src/templates/index.js +34 -12
- package/src/templates/processor.js +44 -12
- package/src/templates/resolver.js +42 -15
- package/src/templates/validator.js +14 -7
- package/src/utils/asset-upload.js +90 -22
- package/src/utils/code-upload.js +62 -37
- package/src/utils/config.js +31 -10
- package/src/utils/dep-survey.js +33 -7
- package/src/utils/destination-prompt.js +27 -17
- package/src/utils/git.js +66 -22
- package/src/utils/host-prompt.js +4 -3
- package/src/utils/install-integrity.js +8 -4
- package/src/utils/interactive.js +3 -3
- package/src/utils/json-file.js +6 -2
- package/src/utils/names.js +15 -6
- package/src/utils/placement.js +16 -8
- package/src/utils/registry-auth.js +185 -57
- package/src/utils/registry-orgs.js +142 -53
- package/src/utils/runtime-upload.js +52 -14
- package/src/utils/scaffold.js +55 -14
- package/src/utils/site-content-refs.js +3 -1
- package/src/utils/update-check.js +43 -17
- package/src/utils/workspace.js +13 -7
- package/src/versions.js +18 -7
- package/templates/site/_gitignore +5 -0
package/src/commands/status.js
CHANGED
|
@@ -32,14 +32,18 @@ import { resolveLocalFoundation } from '../backend/foundation-bring-along.js'
|
|
|
32
32
|
import { computeFoundationDigest } from '../utils/code-upload.js'
|
|
33
33
|
|
|
34
34
|
const c = {
|
|
35
|
-
reset: '\x1b[0m',
|
|
36
|
-
|
|
35
|
+
reset: '\x1b[0m',
|
|
36
|
+
bold: '\x1b[1m',
|
|
37
|
+
dim: '\x1b[2m',
|
|
38
|
+
cyan: '\x1b[36m',
|
|
39
|
+
green: '\x1b[32m',
|
|
40
|
+
yellow: '\x1b[33m'
|
|
37
41
|
}
|
|
38
42
|
const say = {
|
|
39
43
|
ok: (m) => console.log(`${c.green}✓${c.reset} ${m}`),
|
|
40
44
|
info: (m) => console.log(`${c.cyan}→${c.reset} ${m}`),
|
|
41
45
|
warn: (m) => console.log(`${c.yellow}⚠${c.reset} ${m}`),
|
|
42
|
-
dim: (m) => console.log(` ${c.dim}${m}${c.reset}`)
|
|
46
|
+
dim: (m) => console.log(` ${c.dim}${m}${c.reset}`)
|
|
43
47
|
}
|
|
44
48
|
|
|
45
49
|
function readSiteYml(siteDir) {
|
|
@@ -63,7 +67,9 @@ function foundationRef(siteYml) {
|
|
|
63
67
|
function splitFoundationRef(fnd) {
|
|
64
68
|
if (!fnd || fnd[0] !== '@') return { scope: null, version: null }
|
|
65
69
|
const at = fnd.lastIndexOf('@')
|
|
66
|
-
return at > 0
|
|
70
|
+
return at > 0
|
|
71
|
+
? { scope: fnd.slice(0, at), version: fnd.slice(at + 1) }
|
|
72
|
+
: { scope: null, version: null }
|
|
67
73
|
}
|
|
68
74
|
|
|
69
75
|
export async function status(args = []) {
|
|
@@ -92,11 +98,12 @@ export async function status(args = []) {
|
|
|
92
98
|
if (remote) {
|
|
93
99
|
try {
|
|
94
100
|
const client = new BackendClient({
|
|
95
|
-
originFlag:
|
|
101
|
+
originFlag:
|
|
102
|
+
readFlagValue(args, '--backend') || readFlagValue(args, '--registry'),
|
|
96
103
|
siteBackend: await resolveSiteBackend(siteDir),
|
|
97
104
|
token: readFlagValue(args, '--token') || undefined,
|
|
98
105
|
args,
|
|
99
|
-
command: 'Status'
|
|
106
|
+
command: 'Status'
|
|
100
107
|
})
|
|
101
108
|
if (uuid) site = await client.siteStatus(uuid)
|
|
102
109
|
// Foundation freshness: prefer the LOCAL foundation's scoped name (so a
|
|
@@ -124,7 +131,15 @@ export async function status(args = []) {
|
|
|
124
131
|
changed: probe ? probe.changed : null,
|
|
125
132
|
unchanged: probe ? probe.unchanged : null,
|
|
126
133
|
...(probeErr ? { error: probeErr } : {}),
|
|
127
|
-
...(remote
|
|
134
|
+
...(remote
|
|
135
|
+
? {
|
|
136
|
+
remote: {
|
|
137
|
+
site,
|
|
138
|
+
foundation_latest: fdnLatest?.latest_version ?? null,
|
|
139
|
+
foundation_fresh: foundationFresh
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
: {})
|
|
128
143
|
})
|
|
129
144
|
)
|
|
130
145
|
return { exitCode: 0 }
|
|
@@ -137,13 +152,17 @@ export async function status(args = []) {
|
|
|
137
152
|
say.ok(`Synced — site-content ${c.bold}${uuid}${c.reset}`)
|
|
138
153
|
} else {
|
|
139
154
|
say.warn('Not synced — this site has never been pushed to a backend.')
|
|
140
|
-
say.dim(
|
|
155
|
+
say.dim(
|
|
156
|
+
'Run `uniweb push` to create it, or `uniweb publish` to sync and go live in one step.'
|
|
157
|
+
)
|
|
141
158
|
}
|
|
142
159
|
|
|
143
160
|
// Content
|
|
144
161
|
if (probeErr) {
|
|
145
162
|
say.warn(`Couldn't compute content changes: ${probeErr}`)
|
|
146
|
-
say.dim(
|
|
163
|
+
say.dim(
|
|
164
|
+
'A build error or an unresolved data Model can block the offline diff.'
|
|
165
|
+
)
|
|
147
166
|
} else if (!uuid) {
|
|
148
167
|
const n = probe.changed
|
|
149
168
|
say.info(`${n} content ${n === 1 ? 'entity' : 'entities'} ready to push.`)
|
|
@@ -156,7 +175,9 @@ export async function status(args = []) {
|
|
|
156
175
|
(probe.unchanged ? ` (${probe.unchanged} unchanged)` : '') +
|
|
157
176
|
'.'
|
|
158
177
|
)
|
|
159
|
-
say.dim(
|
|
178
|
+
say.dim(
|
|
179
|
+
'Run `uniweb publish` to sync and go live (or `uniweb push` to sync only).'
|
|
180
|
+
)
|
|
160
181
|
}
|
|
161
182
|
|
|
162
183
|
// Foundation
|
|
@@ -166,18 +187,30 @@ export async function status(args = []) {
|
|
|
166
187
|
if (remote) {
|
|
167
188
|
if (site) {
|
|
168
189
|
if (site.draft_dirty) {
|
|
169
|
-
say.info(
|
|
190
|
+
say.info(
|
|
191
|
+
'Synced draft has changes not yet live — run `uniweb publish` to go live.'
|
|
192
|
+
)
|
|
170
193
|
} else if (site.published) {
|
|
171
194
|
say.ok('Live with the latest synced content.')
|
|
172
195
|
} else {
|
|
173
|
-
say.info(
|
|
196
|
+
say.info(
|
|
197
|
+
'Synced but not published yet — run `uniweb publish` to go live.'
|
|
198
|
+
)
|
|
174
199
|
}
|
|
175
200
|
}
|
|
176
|
-
if (
|
|
177
|
-
|
|
201
|
+
if (
|
|
202
|
+
fdnLatest?.latest_version &&
|
|
203
|
+
fndVersion &&
|
|
204
|
+
fdnLatest.latest_version !== fndVersion
|
|
205
|
+
) {
|
|
206
|
+
say.info(
|
|
207
|
+
`A newer foundation version (${fdnLatest.latest_version}) is registered than the site pins (${fndVersion}).`
|
|
208
|
+
)
|
|
178
209
|
}
|
|
179
210
|
if (foundationFresh === false) {
|
|
180
|
-
say.info(
|
|
211
|
+
say.info(
|
|
212
|
+
'Local foundation differs from the registered version — `uniweb register` (or `uniweb publish`) to release the change.'
|
|
213
|
+
)
|
|
181
214
|
} else if (foundationFresh === true) {
|
|
182
215
|
say.ok('Local foundation matches the registered version.')
|
|
183
216
|
}
|
package/src/commands/sync.js
CHANGED
|
@@ -38,11 +38,16 @@
|
|
|
38
38
|
* uniweb sync --backend <url> override the backend origin
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
|
-
const c = {
|
|
41
|
+
const c = {
|
|
42
|
+
reset: '\x1b[0m',
|
|
43
|
+
dim: '\x1b[2m',
|
|
44
|
+
cyan: '\x1b[36m',
|
|
45
|
+
red: '\x1b[31m'
|
|
46
|
+
}
|
|
42
47
|
const say = {
|
|
43
48
|
info: (m) => console.log(`${c.cyan}→${c.reset} ${m}`),
|
|
44
49
|
err: (m) => console.error(`${c.red}✗${c.reset} ${m}`),
|
|
45
|
-
dim: (m) => console.log(` ${c.dim}${m}${c.reset}`)
|
|
50
|
+
dim: (m) => console.log(` ${c.dim}${m}${c.reset}`)
|
|
46
51
|
}
|
|
47
52
|
|
|
48
53
|
/**
|
package/src/commands/template.js
CHANGED
|
@@ -12,10 +12,18 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
export async function template() {
|
|
15
|
-
console.error(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
console.error(
|
|
15
|
+
console.error(
|
|
16
|
+
"\x1b[31m✗\x1b[0m `uniweb template register` isn't available on the new backend yet."
|
|
17
|
+
)
|
|
18
|
+
console.error(
|
|
19
|
+
' Submitting a site as a cloud template was retired with the PHP backend.'
|
|
20
|
+
)
|
|
21
|
+
console.error(
|
|
22
|
+
' A template is REGISTERED, like a foundation — `publish` is for sites only.'
|
|
23
|
+
)
|
|
24
|
+
console.error(
|
|
25
|
+
' (Scaffolding FROM a template still works: `uniweb create --template <name>`.)'
|
|
26
|
+
)
|
|
19
27
|
process.exit(1)
|
|
20
28
|
}
|
|
21
29
|
|