@vyriy/create 0.9.2 → 0.9.3

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vyriy/create",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "description": "Vyriy project creation CLI.",
5
5
  "homepage": "https://vyriy.dev/docs/create/",
6
6
  "type": "module",
@@ -13,8 +13,8 @@
13
13
  "vyriy-create": "./bin/index.js"
14
14
  },
15
15
  "dependencies": {
16
- "@vyriy/check": "0.9.2",
17
- "@vyriy/tooling": "0.9.2"
16
+ "@vyriy/check": "0.9.3",
17
+ "@vyriy/tooling": "0.9.3"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@modelcontextprotocol/sdk": "^1.29.0",
package/preset/ssg.js CHANGED
@@ -9,6 +9,7 @@ const agentsPath = [
9
9
  resolve(presetDir, '../../../../AGENTS.md'),
10
10
  ].find(existsSync) ?? '';
11
11
  const agentsContent = agentsPath ? readFileSync(agentsPath, 'utf8') : '';
12
+ const readSsgPublicAsset = (file) => readFileSync(resolve(presetDir, '../assets/ssg-public', file));
12
13
  export const ssg = (options) => ({
13
14
  'package.json': JSON.stringify({
14
15
  name: options.name,
@@ -32,6 +33,7 @@ export const ssg = (options) => ({
32
33
  lint: "run-s 'lint:*'",
33
34
  build: "run-s 'build:*'",
34
35
  test: "run-s 'test:*'",
36
+ start: "run-p 'start:*'",
35
37
  'fix:prettier': 'prettier . --write',
36
38
  'fix:eslint': 'eslint . --fix',
37
39
  'fix:stylelint': 'stylelint "**/*.{css,scss}" --fix',
@@ -41,6 +43,7 @@ export const ssg = (options) => ({
41
43
  'lint:stylelint': 'stylelint "**/*.{css,scss}"',
42
44
  'build:ssg': 'rimraf dist && sh workspaces/ssg/bin/build.sh',
43
45
  'build:storybook': 'cross-env STORYBOOK_DISABLE_TELEMETRY=1 storybook build --quiet --disable-telemetry',
46
+ 'start:ssg': 'npx vs -p 3000 dist --cache static',
44
47
  'test:jest': 'jest',
45
48
  postinstall: 'husky',
46
49
  },
@@ -61,12 +64,14 @@ export const ssg = (options) => ({
61
64
  'cross-env': packageJson.peerDependencies['cross-env'],
62
65
  rimraf: packageJson.peerDependencies.rimraf,
63
66
  '@vyriy/webpack-config': `^${packageJson.version}`,
67
+ webpack: packageJson.peerDependencies.webpack,
64
68
  tsx: packageJson.peerDependencies.tsx,
65
69
  'webpack-cli': packageJson.peerDependencies['webpack-cli'],
66
70
  '@vyriy/stylelint-config': `^${packageJson.version}`,
67
71
  stylelint: packageJson.peerDependencies.stylelint,
68
72
  sass: packageJson.peerDependencies.sass,
69
73
  '@vyriy/ssg': `^${packageJson.version}`,
74
+ '@vyriy/static': `^${packageJson.version}`,
70
75
  },
71
76
  }, null, 2) + '\n',
72
77
  'README.md': `# SSG
@@ -114,6 +119,12 @@ Build the static site:
114
119
  yarn build:ssg
115
120
  \`\`\`
116
121
 
122
+ Preview the built site with the Vyriy static server:
123
+
124
+ \`\`\`bash
125
+ yarn start:ssg
126
+ \`\`\`
127
+
117
128
  Run all checks:
118
129
 
119
130
  \`\`\`bash
@@ -267,25 +278,508 @@ yarn lint:stylelint
267
278
  private: true,
268
279
  type: 'module',
269
280
  }, null, 2) + '\n',
270
- 'packages/components/styles.scss': `:root {
281
+ 'packages/components/styles.scss': `*,
282
+ *::before,
283
+ *::after {
284
+ box-sizing: border-box;
285
+ }
286
+
287
+ :root {
271
288
  --color-bg: #ffffff;
289
+ --color-surface: #f6f7f7;
290
+ --color-surface-muted: #eef1f2;
272
291
  --color-text: #28323c;
292
+ --color-muted: #687580;
273
293
  --color-heading: #3d5165;
274
- --color-link: #365f8c;
294
+ --color-primary: #3d5165;
295
+ --color-primary-hover: #334557;
296
+ --color-accent: #365f8c;
297
+ --color-chrome-bg: var(--color-primary);
298
+ --color-chrome-text: #ffffff;
275
299
  --color-border: #dbe1e5;
300
+ --color-border-strong: #c6d0d8;
301
+ --color-link: var(--color-primary);
302
+ --color-link-hover: #263848;
303
+ --color-focus: #6f8293;
276
304
  --font-sans: system-ui, -apple-system, blinkmacsystemfont, 'Segoe UI', sans-serif;
305
+ --font-mono: 'SFMono-Regular', consolas, 'Liberation Mono', monospace;
306
+ }
307
+
308
+ html {
309
+ background: var(--color-bg);
310
+ color: var(--color-text);
311
+ font-family: var(--font-sans);
312
+ text-size-adjust: none;
277
313
  }
278
314
 
279
315
  body {
316
+ min-width: 20rem;
317
+ min-height: 100vh;
318
+ margin: 0;
280
319
  background: var(--color-bg);
281
320
  color: var(--color-text);
282
321
  font-family: var(--font-sans);
283
322
  }
284
323
 
324
+ img,
325
+ picture,
326
+ svg,
327
+ video,
328
+ canvas {
329
+ display: block;
330
+ max-width: 100%;
331
+ }
332
+
333
+ button,
334
+ input,
335
+ textarea,
336
+ select {
337
+ font: inherit;
338
+ }
339
+
285
340
  a {
286
341
  color: var(--color-link);
287
342
  }
343
+
344
+ a:hover {
345
+ color: var(--color-link-hover);
346
+ }
347
+
348
+ .vyriy-layout {
349
+ display: flex;
350
+ flex-direction: column;
351
+ min-height: 100vh;
352
+ min-height: 100dvh;
353
+ background: var(--color-bg);
354
+ color: var(--color-text);
355
+ }
356
+
357
+ .vyriy-layout__main {
358
+ flex: 1;
359
+ padding-block: 2rem 3rem;
360
+ }
361
+
362
+ .vyriy-header,
363
+ .vyriy-footer {
364
+ background: var(--color-chrome-bg);
365
+ color: var(--color-chrome-text);
366
+ }
367
+
368
+ .vyriy-header {
369
+ position: relative;
370
+ border-block-end: 1px solid rgb(255 255 255 / 14%);
371
+ }
372
+
373
+ .vyriy-header__inner,
374
+ .vyriy-footer__inner {
375
+ box-sizing: border-box;
376
+ width: min(100% - 2rem, 76rem);
377
+ margin-inline: auto;
378
+ }
379
+
380
+ .vyriy-header__inner {
381
+ display: grid;
382
+ grid-template-columns: minmax(0, 1fr) auto;
383
+ gap: 1rem;
384
+ align-items: center;
385
+ padding-block: 1rem;
386
+ }
387
+
388
+ .vyriy-header__brand {
389
+ display: inline-flex;
390
+ gap: 0.6rem;
391
+ align-items: center;
392
+ color: #ffffff;
393
+ font-size: 2rem;
394
+ font-weight: 700;
395
+ text-decoration: none;
396
+ }
397
+
398
+ .vyriy-header__logo {
399
+ width: 4.5rem;
400
+ height: auto;
401
+ object-fit: contain;
402
+ }
403
+
404
+ .vyriy-header__actions {
405
+ display: flex;
406
+ gap: 0.35rem;
407
+ align-items: center;
408
+ justify-content: flex-end;
409
+ }
410
+
411
+ .vyriy-header__search-checkbox,
412
+ .vyriy-header__search-label,
413
+ .vyriy-navigation__checkbox,
414
+ .vyriy-navigation__toggle-text,
415
+ .vyriy-search-form__label {
416
+ position: absolute;
417
+ width: 1px;
418
+ height: 1px;
419
+ overflow: hidden;
420
+ clip-path: inset(50%);
421
+ white-space: nowrap;
422
+ }
423
+
424
+ .vyriy-header__search-toggle,
425
+ .vyriy-navigation__toggle {
426
+ display: inline-flex;
427
+ align-items: center;
428
+ justify-content: center;
429
+ width: 3.25rem;
430
+ min-height: 3.25rem;
431
+ color: #dedbd8;
432
+ cursor: pointer;
433
+ }
434
+
435
+ .vyriy-header__search-icon {
436
+ position: relative;
437
+ display: block;
438
+ width: 1.35rem;
439
+ height: 1.35rem;
440
+ border: 0.18rem solid currentcolor;
441
+ border-radius: 999rem;
442
+ }
443
+
444
+ .vyriy-header__search-icon::after {
445
+ position: absolute;
446
+ inset-block-start: 0.95rem;
447
+ inset-inline-start: 0.95rem;
448
+ display: block;
449
+ width: 0.65rem;
450
+ height: 0.18rem;
451
+ background: currentcolor;
452
+ border-radius: 999rem;
453
+ content: '';
454
+ transform: rotate(45deg);
455
+ transform-origin: 0 50%;
456
+ }
457
+
458
+ .vyriy-search-form {
459
+ display: flex;
460
+ gap: 0.5rem;
461
+ align-items: center;
462
+ width: 100%;
463
+ }
464
+
465
+ .vyriy-search-form__input {
466
+ box-sizing: border-box;
467
+ min-width: 0;
468
+ flex: 1 1 auto;
469
+ width: 100%;
470
+ min-height: 2.5rem;
471
+ padding: 0.45rem 0.75rem;
472
+ border: 1px solid var(--color-border);
473
+ border-radius: 0.25rem;
474
+ background: #ffffff;
475
+ color: var(--color-text);
476
+ }
477
+
478
+ .vyriy-header__search.vyriy-search-form {
479
+ position: absolute;
480
+ inset-block-start: 100%;
481
+ inset-inline: 0;
482
+ z-index: 2;
483
+ max-height: 0;
484
+ padding: 0 1rem;
485
+ overflow: hidden;
486
+ background: var(--color-chrome-bg);
487
+ opacity: 0;
488
+ pointer-events: none;
489
+ visibility: hidden;
490
+ }
491
+
492
+ .vyriy-header__search-checkbox:checked ~ .vyriy-header__search {
493
+ max-height: 5rem;
494
+ padding-block: 0.75rem;
495
+ opacity: 1;
496
+ pointer-events: auto;
497
+ visibility: visible;
498
+ }
499
+
500
+ .vyriy-navigation__toggle-icon {
501
+ display: inline-flex;
502
+ flex-direction: column;
503
+ gap: 0.35rem;
504
+ width: 2rem;
505
+ }
506
+
507
+ .vyriy-navigation__toggle-line {
508
+ display: block;
509
+ height: 0.18rem;
510
+ border-radius: 999rem;
511
+ background: currentcolor;
512
+ }
513
+
514
+ .vyriy-navigation__list {
515
+ display: none;
516
+ flex-direction: column;
517
+ gap: 0.25rem;
518
+ padding: 0;
519
+ margin: 0;
520
+ list-style: none;
521
+ }
522
+
523
+ .vyriy-navigation__checkbox:checked ~ .vyriy-navigation__list {
524
+ display: flex;
525
+ }
526
+
527
+ .vyriy-navigation__link {
528
+ display: block;
529
+ padding-block: 0.35rem;
530
+ color: #dedbd8;
531
+ font-size: 1.2rem;
532
+ text-decoration: none;
533
+ }
534
+
535
+ .vyriy-navigation__link:hover,
536
+ .vyriy-header__brand:hover,
537
+ .vyriy-header__search-toggle:hover,
538
+ .vyriy-navigation__toggle:hover {
539
+ color: #ffffff;
540
+ }
541
+
542
+ .vyriy-page,
543
+ .vyriy-catalog {
544
+ width: min(100% - 2rem, 56rem);
545
+ margin-inline: auto;
546
+ }
547
+
548
+ .vyriy-page__content,
549
+ .vyriy-catalog__content {
550
+ max-width: 56rem;
551
+ color: var(--color-text);
552
+ line-height: 1.7;
553
+ }
554
+
555
+ .vyriy-page__content > :first-child {
556
+ margin-block-start: 0;
557
+ }
558
+
559
+ .vyriy-page__content h1 {
560
+ margin: 0;
561
+ color: var(--color-text);
562
+ font-size: 2rem;
563
+ line-height: 1.08;
564
+ }
565
+
566
+ .vyriy-page__content h2,
567
+ .vyriy-page__content h3 {
568
+ padding-block-start: 1.5rem;
569
+ border-block-start: 1px solid var(--color-border);
570
+ margin: 2rem 0 1rem;
571
+ color: var(--color-heading);
572
+ line-height: 1.25;
573
+ }
574
+
575
+ .vyriy-page__content p,
576
+ .vyriy-page__content ul,
577
+ .vyriy-page__content pre {
578
+ margin: 1rem 0 0;
579
+ }
580
+
581
+ .vyriy-page__content code {
582
+ padding: 0.1rem 0.25rem;
583
+ border: 1px solid var(--color-border);
584
+ border-radius: 4px;
585
+ background: var(--color-surface);
586
+ font-family: var(--font-mono);
587
+ font-size: 0.9em;
588
+ }
589
+
590
+ .vyriy-page__content pre {
591
+ overflow-x: auto;
592
+ padding: 1rem;
593
+ border: 1px solid var(--color-border);
594
+ border-radius: 6px;
595
+ background: var(--color-surface);
596
+ line-height: 1.55;
597
+ }
598
+
599
+ .vyriy-page__content pre code {
600
+ display: block;
601
+ min-width: max-content;
602
+ padding: 0;
603
+ border: 0;
604
+ background: transparent;
605
+ }
606
+
607
+ .vyriy-card,
608
+ .vyriy-search-page__result {
609
+ border-block-end: 1px solid var(--color-border);
610
+ }
611
+
612
+ .vyriy-card__link,
613
+ .vyriy-search-page__result-link {
614
+ display: block;
615
+ padding-block: 1.25rem;
616
+ color: inherit;
617
+ text-decoration: none;
618
+ }
619
+
620
+ .vyriy-card__title,
621
+ .vyriy-search-page__result-title {
622
+ margin: 0;
623
+ color: var(--color-heading);
624
+ font-size: 1.25rem;
625
+ line-height: 1.35;
626
+ }
627
+
628
+ .vyriy-card__description,
629
+ .vyriy-search-page__result-description {
630
+ max-width: 42rem;
631
+ margin: 0.5rem 0 0.75rem;
632
+ color: var(--color-muted);
633
+ line-height: 1.65;
634
+ }
635
+
636
+ .vyriy-card__tags,
637
+ .vyriy-search-page__tags {
638
+ display: flex;
639
+ flex-wrap: wrap;
640
+ gap: 0.4rem;
641
+ padding: 0;
642
+ margin: 0;
643
+ list-style: none;
644
+ }
645
+
646
+ .vyriy-card__tag,
647
+ .vyriy-page__tag,
648
+ .vyriy-search-page__tag {
649
+ max-width: 100%;
650
+ padding: 0.15rem 0.5rem;
651
+ border: 1px solid var(--color-border);
652
+ border-radius: 999px;
653
+ background: var(--color-surface);
654
+ color: var(--color-link);
655
+ font-size: 0.875rem;
656
+ line-height: 1.35;
657
+ overflow-wrap: anywhere;
658
+ text-decoration: none;
659
+ }
660
+
661
+ .vyriy-page__featured,
662
+ .vyriy-page__related {
663
+ padding-block-start: 1.5rem;
664
+ border-block-start: 1px solid var(--color-border);
665
+ margin-block-start: 2rem;
666
+ }
667
+
668
+ .vyriy-page__featured-list,
669
+ .vyriy-page__related-list {
670
+ display: grid;
671
+ gap: 1rem;
672
+ }
673
+
674
+ .vyriy-pagination {
675
+ display: flex;
676
+ flex-wrap: wrap;
677
+ gap: 0.5rem;
678
+ align-items: center;
679
+ justify-content: center;
680
+ margin-block-start: 2rem;
681
+ }
682
+
683
+ .vyriy-pagination__pages {
684
+ display: flex;
685
+ gap: 0.25rem;
686
+ padding: 0;
687
+ margin: 0;
688
+ list-style: none;
689
+ }
690
+
691
+ .vyriy-pagination__control,
692
+ .vyriy-pagination__page,
693
+ .vyriy-search-form__button,
694
+ .vyriy-search-page__more {
695
+ display: inline-flex;
696
+ align-items: center;
697
+ justify-content: center;
698
+ min-height: 2.5rem;
699
+ padding: 0.45rem 0.85rem;
700
+ border: 1px solid var(--color-primary);
701
+ border-radius: 0.25rem;
702
+ background: var(--color-primary);
703
+ color: #ffffff;
704
+ cursor: pointer;
705
+ font: inherit;
706
+ font-weight: 600;
707
+ text-decoration: none;
708
+ }
709
+
710
+ .vyriy-pagination__page[aria-current='page'] {
711
+ background: var(--color-primary-hover);
712
+ }
713
+
714
+ .vyriy-footer {
715
+ border-block-start: 1px solid rgb(255 255 255 / 14%);
716
+ }
717
+
718
+ .vyriy-footer__inner {
719
+ padding-block: 1rem;
720
+ text-align: center;
721
+ }
722
+
723
+ .vyriy-footer__text {
724
+ margin: 0;
725
+ color: #ffffff;
726
+ font-size: 1.125rem;
727
+ }
728
+
729
+ @media (min-width: 48rem) {
730
+ .vyriy-header__inner {
731
+ display: flex;
732
+ min-height: 4rem;
733
+ padding-block: 0;
734
+ justify-content: space-between;
735
+ }
736
+
737
+ .vyriy-header__search-shell {
738
+ position: relative;
739
+ }
740
+
741
+ .vyriy-header__search.vyriy-search-form {
742
+ inset-block-start: 50%;
743
+ inset-inline: auto calc(100% + 0.35rem);
744
+ width: min(21rem, 36vw);
745
+ max-height: none;
746
+ padding: 0;
747
+ background: transparent;
748
+ transform: translateY(-50%);
749
+ }
750
+
751
+ .vyriy-header__search-checkbox:checked ~ .vyriy-header__search {
752
+ max-height: none;
753
+ padding-block: 0;
754
+ }
755
+
756
+ .vyriy-navigation__toggle {
757
+ display: none;
758
+ }
759
+
760
+ .vyriy-navigation__list {
761
+ display: flex;
762
+ flex-flow: row wrap;
763
+ gap: 0.5rem 1rem;
764
+ align-items: center;
765
+ }
766
+
767
+ .vyriy-navigation__link {
768
+ padding-block: 0;
769
+ }
770
+
771
+ .vyriy-page__featured-list,
772
+ .vyriy-page__related-list {
773
+ grid-template-columns: repeat(2, minmax(0, 1fr));
774
+ }
775
+ }
288
776
  `,
777
+ 'site/public/favicon.ico': readSsgPublicAsset('favicon.ico'),
778
+ 'site/public/favicon-16x16.png': readSsgPublicAsset('favicon-16x16.png'),
779
+ 'site/public/favicon-32x32.png': readSsgPublicAsset('favicon-32x32.png'),
780
+ 'site/public/apple-touch-icon.png': readSsgPublicAsset('apple-touch-icon.png'),
781
+ 'site/public/assets/vyriy-v-wings.png': readSsgPublicAsset('assets/vyriy-v-wings.png'),
782
+ 'site/public/assets/vyriy-calm-architecture.png': readSsgPublicAsset('assets/vyriy-calm-architecture.png'),
289
783
  'workspaces/ssg/bin/build.sh': `#!/usr/bin/env sh
290
784
 
291
785
  set -eu
@@ -329,6 +823,14 @@ yarn build:ssg
329
823
  \`\`\`
330
824
 
331
825
  The build writes output into \`dist\`.
826
+
827
+ ## Preview
828
+
829
+ \`\`\`bash
830
+ yarn start:ssg
831
+ \`\`\`
832
+
833
+ This serves \`dist\` with \`vs\`, the CLI provided by \`@vyriy/static\`.
332
834
  `,
333
835
  'workspaces/ssg/webpack.config.ts': `import 'webpack';
334
836
 
package/preset/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { PlanResult } from '../plan/types.js';
2
- export type FileMap = Record<string, string>;
2
+ export type FileContent = string | Uint8Array;
3
+ export type FileMap = Record<string, FileContent>;
3
4
  export type Preset = (options: PlanResult) => FileMap;
4
5
  export type PresetKey = 'base' | 'library' | 'api' | 'mcp' | 'ssr' | 'rest' | 'gql' | 'ssg' | 'spa' | 'mfe' | 'fullstack';
5
6
  export type Presets = Partial<Record<PresetKey, {