uniweb 0.13.17 → 0.14.1

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 +15 -13
  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
@@ -23,13 +23,21 @@
23
23
  import { existsSync } from 'node:fs'
24
24
  import { readFile } from 'node:fs/promises'
25
25
  import { resolve, join, dirname } from 'node:path'
26
- import { generateDocs, resolveFoundationSrcPath, classifyPackage } from '@uniweb/build'
26
+ import {
27
+ generateDocs,
28
+ resolveFoundationSrcPath,
29
+ classifyPackage
30
+ } from '@uniweb/build'
27
31
  import {
28
32
  isWorkspaceRoot,
29
33
  findFoundations,
30
- promptSelect,
34
+ promptSelect
31
35
  } from '../utils/workspace.js'
32
- import { isNonInteractive, getCliPrefix, formatOptions } from '../utils/interactive.js'
36
+ import {
37
+ isNonInteractive,
38
+ getCliPrefix,
39
+ formatOptions
40
+ } from '../utils/interactive.js'
33
41
 
34
42
  // Colors for terminal output
35
43
  const colors = {
@@ -39,7 +47,7 @@ const colors = {
39
47
  cyan: '\x1b[36m',
40
48
  green: '\x1b[32m',
41
49
  yellow: '\x1b[33m',
42
- red: '\x1b[31m',
50
+ red: '\x1b[31m'
43
51
  }
44
52
 
45
53
  function log(message) {
@@ -258,7 +266,7 @@ function parseArgs(args) {
258
266
  const options = {
259
267
  output: 'COMPONENTS.md',
260
268
  fromSource: false,
261
- target: null,
269
+ target: null
262
270
  }
263
271
 
264
272
  for (let i = 0; i < args.length; i++) {
@@ -376,8 +384,12 @@ async function generateComponentDocs(args) {
376
384
  foundationDir = resolve(projectDir, options.target)
377
385
  outputDir = foundationDir
378
386
  if (!isFoundation(foundationDir)) {
379
- error(`Target directory does not appear to be a foundation: ${options.target}`)
380
- log(`${colors.dim}Foundations have a src/components/ directory.${colors.reset}`)
387
+ error(
388
+ `Target directory does not appear to be a foundation: ${options.target}`
389
+ )
390
+ log(
391
+ `${colors.dim}Foundations have a src/components/ directory.${colors.reset}`
392
+ )
381
393
  process.exit(1)
382
394
  }
383
395
  info(`Using foundation: ${options.target}`)
@@ -388,7 +400,9 @@ async function generateComponentDocs(args) {
388
400
 
389
401
  if (foundations.length === 0) {
390
402
  error('No foundations found in this workspace.')
391
- log(`${colors.dim}Foundations have @uniweb/build in devDependencies.${colors.reset}`)
403
+ log(
404
+ `${colors.dim}Foundations have @uniweb/build in devDependencies.${colors.reset}`
405
+ )
392
406
  process.exit(1)
393
407
  }
394
408
 
@@ -398,12 +412,16 @@ async function generateComponentDocs(args) {
398
412
  info(`Found foundation: ${targetFoundation}`)
399
413
  } else if (isNonInteractive(process.argv)) {
400
414
  error(`Multiple foundations found. Specify which to target:\n`)
401
- log(formatOptions(foundations.map(f => ({ label: f, description: '' }))))
415
+ log(
416
+ formatOptions(foundations.map((f) => ({ label: f, description: '' })))
417
+ )
402
418
  log('')
403
419
  log(`Usage: ${getCliPrefix()} docs --target <path>`)
404
420
  process.exit(1)
405
421
  } else {
406
- log(`${colors.dim}Multiple foundations found in workspace.${colors.reset}\n`)
422
+ log(
423
+ `${colors.dim}Multiple foundations found in workspace.${colors.reset}\n`
424
+ )
407
425
  targetFoundation = await promptSelect('Select foundation:', foundations)
408
426
  if (!targetFoundation) {
409
427
  log('Cancelled.')
@@ -419,7 +437,9 @@ async function generateComponentDocs(args) {
419
437
  const foundation = await resolveFoundationFromSite(projectDir)
420
438
  if (!foundation) {
421
439
  error('Could not find a linked foundation in this site.')
422
- log(`${colors.dim}Make sure package.json has a foundation dependency like:${colors.reset}`)
440
+ log(
441
+ `${colors.dim}Make sure package.json has a foundation dependency like:${colors.reset}`
442
+ )
423
443
  log(`${colors.dim} "foundation": "file:../foundation"${colors.reset}`)
424
444
  process.exit(1)
425
445
  }
@@ -429,7 +449,9 @@ async function generateComponentDocs(args) {
429
449
  info(`Found foundation: ${foundation.name} (${foundation.path})`)
430
450
  } else if (!isFoundation(projectDir)) {
431
451
  error('This directory does not appear to be a foundation or site.')
432
- log(`${colors.dim}Foundations have a src/components/ directory.${colors.reset}`)
452
+ log(
453
+ `${colors.dim}Foundations have a src/components/ directory.${colors.reset}`
454
+ )
433
455
  log(`${colors.dim}Sites have a site.yml file.${colors.reset}`)
434
456
  process.exit(1)
435
457
  }
@@ -437,8 +459,12 @@ async function generateComponentDocs(args) {
437
459
  // Check if schema.json exists (if not using --from-source)
438
460
  const schemaPath = join(foundationDir, 'dist', 'schema.json')
439
461
  if (!options.fromSource && !existsSync(schemaPath)) {
440
- log(`${colors.yellow}⚠${colors.reset} No dist/schema.json found in foundation.`)
441
- log(`${colors.dim}Run 'uniweb build' in the foundation first, or use '--from-source'.${colors.reset}`)
462
+ log(
463
+ `${colors.yellow}⚠${colors.reset} No dist/schema.json found in foundation.`
464
+ )
465
+ log(
466
+ `${colors.dim}Run 'uniweb build' in the foundation first, or use '--from-source'.${colors.reset}`
467
+ )
442
468
  log('')
443
469
  info('Falling back to --from-source mode')
444
470
  options.fromSource = true
@@ -449,11 +475,13 @@ async function generateComponentDocs(args) {
449
475
 
450
476
  const result = await generateDocs(foundationDir, {
451
477
  output: join(outputDir, options.output),
452
- fromSource: options.fromSource,
478
+ fromSource: options.fromSource
453
479
  })
454
480
 
455
481
  success(`Generated ${result.outputPath}`)
456
- log(`${colors.dim}Documented ${result.componentCount} components${colors.reset}`)
482
+ log(
483
+ `${colors.dim}Documented ${result.componentCount} components${colors.reset}`
484
+ )
457
485
  } catch (err) {
458
486
  error(`Failed to generate docs: ${err.message}`)
459
487
  process.exit(1)