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.
Files changed (65) hide show
  1. package/README.md +1 -1
  2. package/package.json +7 -7
  3. package/partials/agents.md +51 -0
  4. package/src/backend/client.js +173 -40
  5. package/src/backend/data-bundle.js +15 -3
  6. package/src/backend/foundation-bring-along.js +76 -21
  7. package/src/backend/payment-handoff.js +28 -9
  8. package/src/backend/site-media.js +147 -19
  9. package/src/backend/site-sync.js +362 -40
  10. package/src/commands/add.js +575 -273
  11. package/src/commands/build.js +160 -57
  12. package/src/commands/clone.js +79 -26
  13. package/src/commands/content.js +11 -7
  14. package/src/commands/deploy.js +80 -32
  15. package/src/commands/dev.js +39 -17
  16. package/src/commands/docs.js +44 -16
  17. package/src/commands/doctor.js +338 -82
  18. package/src/commands/export.js +15 -7
  19. package/src/commands/handoff.js +6 -2
  20. package/src/commands/i18n.js +248 -99
  21. package/src/commands/inspect.js +48 -19
  22. package/src/commands/invite.js +9 -3
  23. package/src/commands/org.js +19 -5
  24. package/src/commands/publish.js +229 -60
  25. package/src/commands/pull.js +157 -48
  26. package/src/commands/push.js +144 -42
  27. package/src/commands/refresh.js +37 -10
  28. package/src/commands/register.js +235 -64
  29. package/src/commands/rename.js +126 -46
  30. package/src/commands/runtime.js +74 -24
  31. package/src/commands/status.js +48 -15
  32. package/src/commands/sync.js +7 -2
  33. package/src/commands/template.js +12 -4
  34. package/src/commands/update.js +263 -87
  35. package/src/commands/validate.js +115 -32
  36. package/src/framework-index.json +16 -14
  37. package/src/index.js +298 -145
  38. package/src/templates/fetchers/github.js +7 -7
  39. package/src/templates/fetchers/npm.js +3 -3
  40. package/src/templates/fetchers/release.js +21 -18
  41. package/src/templates/index.js +34 -12
  42. package/src/templates/processor.js +44 -12
  43. package/src/templates/resolver.js +42 -15
  44. package/src/templates/validator.js +14 -7
  45. package/src/utils/asset-upload.js +90 -22
  46. package/src/utils/code-upload.js +62 -37
  47. package/src/utils/config.js +31 -10
  48. package/src/utils/dep-survey.js +33 -7
  49. package/src/utils/destination-prompt.js +27 -17
  50. package/src/utils/git.js +66 -22
  51. package/src/utils/host-prompt.js +4 -3
  52. package/src/utils/install-integrity.js +8 -4
  53. package/src/utils/interactive.js +3 -3
  54. package/src/utils/json-file.js +6 -2
  55. package/src/utils/names.js +15 -6
  56. package/src/utils/placement.js +16 -8
  57. package/src/utils/registry-auth.js +185 -57
  58. package/src/utils/registry-orgs.js +142 -53
  59. package/src/utils/runtime-upload.js +52 -14
  60. package/src/utils/scaffold.js +55 -14
  61. package/src/utils/site-content-refs.js +3 -1
  62. package/src/utils/update-check.js +43 -17
  63. package/src/utils/workspace.js +13 -7
  64. package/src/versions.js +18 -7
  65. package/templates/site/_gitignore +5 -0
@@ -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', bold: '\x1b[1m', dim: '\x1b[2m',
36
- cyan: '\x1b[36m', green: '\x1b[32m', yellow: '\x1b[33m',
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 ? { scope: fnd.slice(0, at), version: fnd.slice(at + 1) } : { scope: null, version: null }
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: readFlagValue(args, '--backend') || readFlagValue(args, '--registry'),
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 ? { remote: { site, foundation_latest: fdnLatest?.latest_version ?? null, foundation_fresh: foundationFresh } } : {}),
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('Run `uniweb push` to create it, or `uniweb publish` to sync and go live in one step.')
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('A build error or an unresolved data Model can block the offline diff.')
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('Run `uniweb publish` to sync and go live (or `uniweb push` to sync only).')
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('Synced draft has changes not yet live — run `uniweb publish` to go live.')
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('Synced but not published yet — run `uniweb publish` to go live.')
196
+ say.info(
197
+ 'Synced but not published yet — run `uniweb publish` to go live.'
198
+ )
174
199
  }
175
200
  }
176
- if (fdnLatest?.latest_version && fndVersion && fdnLatest.latest_version !== fndVersion) {
177
- say.info(`A newer foundation version (${fdnLatest.latest_version}) is registered than the site pins (${fndVersion}).`)
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('Local foundation differs from the registered version — `uniweb register` (or `uniweb publish`) to release the change.')
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
  }
@@ -38,11 +38,16 @@
38
38
  * uniweb sync --backend <url> override the backend origin
39
39
  */
40
40
 
41
- const c = { reset: '\x1b[0m', dim: '\x1b[2m', cyan: '\x1b[36m', red: '\x1b[31m' }
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
  /**
@@ -12,10 +12,18 @@
12
12
  */
13
13
 
14
14
  export async function template() {
15
- console.error("\x1b[31m✗\x1b[0m `uniweb template register` isn't available on the new backend yet.")
16
- console.error(' Submitting a site as a cloud template was retired with the PHP backend.')
17
- console.error(' A template is REGISTERED, like a foundation — `publish` is for sites only.')
18
- console.error(' (Scaffolding FROM a template still works: `uniweb create --template <name>`.)')
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