rizzo-css 0.0.19 → 0.0.21

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 (48) hide show
  1. package/README.md +1 -1
  2. package/bin/rizzo-css.js +128 -40
  3. package/dist/fonts/.gitkeep +0 -0
  4. package/dist/fonts/GeistMono/GeistMonoVF.ttf +0 -0
  5. package/dist/fonts/GeistMono/GeistMonoVF.woff +0 -0
  6. package/dist/fonts/GeistMono/GeistMonoVF.woff2 +0 -0
  7. package/dist/fonts/GeistMono/LICENSE.TXT +92 -0
  8. package/dist/fonts/GeistSans/GeistVF.ttf +0 -0
  9. package/dist/fonts/GeistSans/GeistVF.woff +0 -0
  10. package/dist/fonts/GeistSans/GeistVF.woff2 +0 -0
  11. package/dist/fonts/GeistSans/LICENSE.TXT +92 -0
  12. package/dist/rizzo.min.css +1 -1
  13. package/package.json +1 -1
  14. package/scaffold/astro/Navbar.astro +17 -0
  15. package/scaffold/astro/Search.astro +16 -0
  16. package/scaffold/astro/Settings.astro +13 -0
  17. package/scaffold/astro-minimal/README.md +1 -0
  18. package/scaffold/astro-minimal/src/layouts/Layout.astro +3 -4
  19. package/scaffold/svelte/Navbar.svelte +27 -0
  20. package/scaffold/svelte/Search.svelte +41 -0
  21. package/scaffold/svelte/Settings.svelte +25 -0
  22. package/scaffold/vanilla/README.md +1 -1
  23. package/scaffold/vanilla/components/accordion.html +14 -0
  24. package/scaffold/vanilla/components/alert.html +14 -0
  25. package/scaffold/vanilla/components/avatar.html +14 -0
  26. package/scaffold/vanilla/components/badge.html +14 -0
  27. package/scaffold/vanilla/components/breadcrumb.html +14 -0
  28. package/scaffold/vanilla/components/button.html +14 -0
  29. package/scaffold/vanilla/components/cards.html +14 -0
  30. package/scaffold/vanilla/components/copy-to-clipboard.html +14 -0
  31. package/scaffold/vanilla/components/divider.html +14 -0
  32. package/scaffold/vanilla/components/dropdown.html +14 -0
  33. package/scaffold/vanilla/components/forms.html +14 -0
  34. package/scaffold/vanilla/components/icons.html +14 -0
  35. package/scaffold/vanilla/components/index.html +14 -0
  36. package/scaffold/vanilla/components/modal.html +14 -0
  37. package/scaffold/vanilla/components/navbar.html +14 -0
  38. package/scaffold/vanilla/components/pagination.html +14 -0
  39. package/scaffold/vanilla/components/progress-bar.html +14 -0
  40. package/scaffold/vanilla/components/search.html +14 -0
  41. package/scaffold/vanilla/components/settings.html +14 -0
  42. package/scaffold/vanilla/components/spinner.html +14 -0
  43. package/scaffold/vanilla/components/table.html +14 -0
  44. package/scaffold/vanilla/components/tabs.html +14 -0
  45. package/scaffold/vanilla/components/theme-switcher.html +14 -0
  46. package/scaffold/vanilla/components/toast.html +14 -0
  47. package/scaffold/vanilla/components/tooltip.html +14 -0
  48. package/scaffold/vanilla/index.html +14 -0
package/README.md CHANGED
@@ -56,7 +56,7 @@ import 'rizzo-css';
56
56
  **Without a bundler (plain HTML):** Use a CDN. Both unpkg and jsDelivr resolve the package root to the built CSS (via the `unpkg` / `jsdelivr` fields in this package). For reliability or to pin a version, use the explicit path:
57
57
 
58
58
  ```html
59
- <!-- unpkg (pin version: replace @latest with @0.0.19 or any version) -->
59
+ <!-- unpkg (pin version: replace @latest with @0.0.21 or any version) -->
60
60
  <link rel="stylesheet" href="https://unpkg.com/rizzo-css@latest/dist/rizzo.min.css" />
61
61
 
62
62
  <!-- or jsDelivr -->
package/bin/rizzo-css.js CHANGED
@@ -9,6 +9,8 @@ const RIZZO_CONFIG_FILE = 'rizzo-css.json';
9
9
 
10
10
  const COMMANDS = ['init', 'add', 'theme', 'help'];
11
11
  const FRAMEWORKS = ['vanilla', 'astro', 'svelte'];
12
+ /** Supported package managers: detection, install/add commands, and --package-manager override. */
13
+ const VALID_PACKAGE_MANAGERS = ['npm', 'pnpm', 'yarn', 'bun'];
12
14
 
13
15
  /** Full = everything we ship. Minimal = recommended starting set. Manual = you choose. */
14
16
  const TEMPLATES = {
@@ -91,12 +93,14 @@ const SVELTE_COMPONENTS = [
91
93
  'Breadcrumb', 'FormGroup', 'Input', 'Checkbox', 'Textarea', 'Select', 'Radio',
92
94
  'CopyToClipboard', 'Tooltip', 'Pagination', 'Tabs', 'Accordion', 'Dropdown',
93
95
  'Modal', 'Toast', 'Table', 'ThemeSwitcher',
96
+ 'Navbar', 'Settings', 'Search', 'Icons',
94
97
  ];
95
98
  const ASTRO_COMPONENTS = [
96
99
  'Button', 'Badge', 'Card', 'Divider', 'Spinner', 'ProgressBar', 'Avatar', 'Alert',
97
100
  'Breadcrumb', 'FormGroup', 'Input', 'Checkbox', 'Textarea', 'Select', 'Radio',
98
101
  'CopyToClipboard', 'Tooltip', 'Pagination', 'Tabs', 'Accordion', 'Dropdown',
99
102
  'Modal', 'Toast', 'Table', 'ThemeSwitcher',
103
+ 'Navbar', 'Settings', 'Search', 'Icons',
100
104
  ];
101
105
 
102
106
  // Recommended subset for Full/Minimal (same for Astro, Svelte, Vanilla)
@@ -104,13 +108,14 @@ const RECOMMENDED_COMPONENTS = [
104
108
  'Button', 'Badge', 'Card', 'Modal', 'Tabs', 'ThemeSwitcher', 'FormGroup', 'Alert', 'Toast', 'Dropdown',
105
109
  ];
106
110
 
107
- // Vanilla scaffold: component name (same as ASTRO_COMPONENTS) -> components/*.html slug
111
+ // Vanilla scaffold: component name (same as ASTRO_COMPONENTS) -> components/*.html slug. Navbar, Settings, Search, Icons are vanilla-only.
108
112
  const VANILLA_COMPONENT_SLUGS = {
109
113
  Button: 'button', Badge: 'badge', Card: 'cards', Divider: 'divider', Spinner: 'spinner', ProgressBar: 'progress-bar',
110
114
  Avatar: 'avatar', Alert: 'alert', Breadcrumb: 'breadcrumb', FormGroup: 'forms', Input: 'forms', Checkbox: 'forms',
111
115
  Textarea: 'forms', Select: 'forms', Radio: 'forms', CopyToClipboard: 'copy-to-clipboard', Tooltip: 'tooltip',
112
116
  Pagination: 'pagination', Tabs: 'tabs', Accordion: 'accordion', Dropdown: 'dropdown', Modal: 'modal',
113
117
  Toast: 'toast', Table: 'table', ThemeSwitcher: 'theme-switcher',
118
+ Navbar: 'navbar', Settings: 'settings', Search: 'search', Icons: 'icons',
114
119
  };
115
120
 
116
121
  // ANSI colors for CLI (framework logo colors)
@@ -135,6 +140,24 @@ function getCssPath() {
135
140
  return join(getPackageRoot(), 'dist', 'rizzo.min.css');
136
141
  }
137
142
 
143
+ /** Copy package dist/fonts into <cssTargetDir>/fonts so CSS url(./fonts/...) resolves. cssTargetDir is framework-specific (public/css | static/css | css). */
144
+ function copyRizzoFonts(cssTargetDir) {
145
+ const fontsSrc = join(getPackageRoot(), 'dist', 'fonts');
146
+ if (!existsSync(fontsSrc)) return;
147
+ const dest = join(cssTargetDir, 'fonts');
148
+ mkdirSync(dest, { recursive: true });
149
+ const entries = readdirSync(fontsSrc, { withFileTypes: true });
150
+ for (const e of entries) {
151
+ const srcPath = join(fontsSrc, e.name);
152
+ const destPath = join(dest, e.name);
153
+ if (e.isDirectory()) {
154
+ copyDirRecursive(srcPath, destPath);
155
+ } else {
156
+ copyFileSync(srcPath, destPath);
157
+ }
158
+ }
159
+ }
160
+
138
161
  /** Copy the package LICENSE into the project dir. Call after every scaffold so every install includes a license. */
139
162
  function copyPackageLicense(projectDir) {
140
163
  const licensePath = join(getPackageRoot(), 'LICENSE');
@@ -184,6 +207,13 @@ function getFlagValue(argv, flag) {
184
207
  return i !== -1 && argv[i + 1] != null ? argv[i + 1] : null;
185
208
  }
186
209
 
210
+ /** Parse --package-manager value; returns npm|pnpm|yarn|bun or null if invalid/absent. */
211
+ function parsePackageManager(value) {
212
+ if (!value || typeof value !== 'string') return null;
213
+ const v = value.toLowerCase().trim();
214
+ return VALID_PACKAGE_MANAGERS.includes(v) ? v : null;
215
+ }
216
+
187
217
  /** Get positional args for a command (excludes --flag and --flag value). Used for e.g. add Button ThemeSwitcher. */
188
218
  function getPositionalArgs(argv) {
189
219
  const positionals = [];
@@ -248,13 +278,16 @@ function getCreateProjectExample(pm, framework) {
248
278
  return 'npm create ' + framework + '@latest my-app';
249
279
  }
250
280
 
251
- /** Prompt user to select package manager (npm, pnpm, yarn, bun). Puts detected first with "(detected)" label. Returns agent string. */
281
+ /** Prompt user to select package manager (npm, pnpm, yarn, bun). Shows "(detected)" only when we actually found a lockfile or packageManager; for new projects with no detection, user chooses. Returns agent string. */
252
282
  async function promptPackageManager(projectDir) {
253
- const detected = resolvePackageManager(projectDir, process.cwd());
283
+ const actuallyDetected = detectPackageManager(projectDir) || detectPackageManager(process.cwd());
284
+ const resolved = actuallyDetected
285
+ ? getPackageManagerCommands(actuallyDetected)
286
+ : null;
254
287
  const agents = ['npm', 'pnpm', 'yarn', 'bun'];
255
288
  const options = agents.map((a) => ({
256
289
  value: a,
257
- label: a === detected.agent ? a + ' (detected)' : a,
290
+ label: (resolved && a === resolved.agent) ? a + ' (detected)' : a,
258
291
  }));
259
292
  return selectMenu(options, '? Package manager (for install and run commands)');
260
293
  }
@@ -275,6 +308,12 @@ function question(prompt) {
275
308
  });
276
309
  }
277
310
 
311
+ /** Prompt yes/no; default yes. Returns true to run, false to skip. */
312
+ async function confirmRunInstall(pm) {
313
+ const answer = await question('\nRun ' + pm.install + ' now? (Y/n) ');
314
+ return answer === '' || /^y(es)?$/i.test(answer);
315
+ }
316
+
278
317
  /** Format label with optional ANSI color (item.color). */
279
318
  function formatLabel(item) {
280
319
  const text = item.label || item.value;
@@ -555,16 +594,21 @@ Options (init):
555
594
  --yes Non-interactive: scaffold new in cwd with defaults (framework: astro, template: full)
556
595
  --framework <fw> vanilla | astro | svelte (with --yes; otherwise first prompt)
557
596
  --template <t> full | minimal | manual (all frameworks); with --yes defaults to full
558
- --install After scaffolding, run package manager install (new project)
559
- --no-install Do not run install
560
- --write-config Write rizzo-css.json (targetDir, framework, packageManager) in the project
597
+ --package-manager <pm> npm | pnpm | yarn | bun (with --yes, or skip PM prompt when interactive)
598
+ --install After scaffolding, run package manager install (no prompt)
599
+ --no-install Do not run install and do not prompt
600
+ (rizzo-css.json is always written for new and existing projects; interactive run prompts "Run install now? (Y/n)" for Astro/Svelte.)
561
601
 
562
602
  Options (add):
563
603
  --path <dir> Target directory for rizzo.min.css (overrides config and framework default)
564
604
  --framework <fw> vanilla | astro | svelte (overrides config and detection)
605
+ --package-manager <pm> npm | pnpm | yarn | bun (override detection for install/print commands)
565
606
  --install-package After copying CSS, run package manager add rizzo-css
566
607
  --no-install Do not run install or add (overrides --install-package)
567
608
 
609
+ Package managers:
610
+ Supported: npm, pnpm, yarn, bun. Detection: lockfiles (pnpm-lock.yaml, yarn.lock, bun.lockb, package-lock.json) or package.json "packageManager"/"devEngines.packageManager". Use --package-manager to override.
611
+
568
612
  Config:
569
613
  Optional rizzo-css.json in project root: { "targetDir", "framework", "packageManager" }.
570
614
  Used by add and init when present. Detection: lockfiles and packageManager field in package.json.
@@ -582,9 +626,11 @@ Use framework CLI first, then add Rizzo CSS (match your package manager):
582
626
 
583
627
  Examples:
584
628
  npx rizzo-css init
585
- npx rizzo-css init --yes --framework astro --install --write-config
629
+ npx rizzo-css init --yes --framework astro --install
630
+ npx rizzo-css init --yes --framework astro --package-manager pnpm --install
586
631
  npx rizzo-css init --yes --framework vanilla
587
632
  npx rizzo-css init --yes --framework svelte --template full
633
+ npx rizzo-css add --package-manager yarn --install-package
588
634
  npx rizzo-css add
589
635
  npx rizzo-css add Button
590
636
  npx rizzo-css add Button ThemeSwitcher --path public/css --framework svelte
@@ -664,11 +710,20 @@ function detectFramework(cwd) {
664
710
  return null;
665
711
  }
666
712
 
667
- /** Default CSS directory and link href for a framework (for add command). */
713
+ /**
714
+ * Framework-specific paths for CSS and static assets. Use these so fonts, sounds, images
715
+ * go in the right place per framework (Astro: public/, SvelteKit: static/, Vanilla: project root).
716
+ * - targetDir: where rizzo.min.css is copied (fonts go in targetDir/fonts so CSS ./fonts/ resolves).
717
+ * - assetsRoot: root for other static assets (sounds, images); use assetsRoot + '/sounds' etc. when we ship them.
718
+ */
668
719
  function getFrameworkCssPaths(framework) {
669
- if (framework === 'svelte') return { targetDir: 'static/css', linkHref: '/css/rizzo.min.css' };
670
- if (framework === 'astro') return { targetDir: 'public/css', linkHref: '/css/rizzo.min.css' };
671
- return { targetDir: 'css', linkHref: 'css/rizzo.min.css' };
720
+ if (framework === 'svelte') {
721
+ return { targetDir: 'static/css', linkHref: '/css/rizzo.min.css', fontsDir: 'static/css/fonts', assetsRoot: 'static' };
722
+ }
723
+ if (framework === 'astro') {
724
+ return { targetDir: 'public/css', linkHref: '/css/rizzo.min.css', fontsDir: 'public/css/fonts', assetsRoot: 'public' };
725
+ }
726
+ return { targetDir: 'css', linkHref: 'css/rizzo.min.css', fontsDir: 'css/fonts', assetsRoot: '' };
672
727
  }
673
728
 
674
729
  /**
@@ -699,16 +754,20 @@ async function cmdAdd(argv) {
699
754
 
700
755
  const cwd = process.cwd();
701
756
  const config = readRizzoConfig(cwd);
757
+ const pmOverride = parsePackageManager(getFlagValue(argv, '--package-manager'));
702
758
  const options = {
703
759
  config,
704
760
  targetDir: customPath || (config && config.targetDir) || undefined,
761
+ packageManager: pmOverride || undefined,
705
762
  preselectedComponents: positionals.length > 0 ? positionals : undefined,
706
763
  };
707
764
  await runAddToExisting(explicitFramework, options);
708
765
  if (installPackage && !noInstall) {
709
- const pm = (config && config.packageManager)
710
- ? getPackageManagerCommands({ agent: config.packageManager, command: config.packageManager })
711
- : resolvePackageManager(cwd);
766
+ const pm = (pmOverride
767
+ ? getPackageManagerCommands({ agent: pmOverride, command: pmOverride })
768
+ : (config && config.packageManager)
769
+ ? getPackageManagerCommands({ agent: config.packageManager, command: config.packageManager })
770
+ : resolvePackageManager(cwd));
712
771
  const addPkg = pm.add('rizzo-css');
713
772
  console.log('\nRunning: ' + addPkg);
714
773
  const code = runInDir(cwd, addPkg);
@@ -867,8 +926,9 @@ function copySvelteComponents(projectDir, selectedNames) {
867
926
  }
868
927
  const files = readdirSync(scaffoldDir);
869
928
  const available = files.filter((f) => f.endsWith('.svelte')).map((f) => f.replace('.svelte', ''));
870
- const toCopy = selectedNames.filter((n) => available.includes(n));
871
- if (toCopy.length === 0) {
929
+ const toCopy = selectedNames.filter((n) => n !== 'Icons' && available.includes(n));
930
+ const copyIconsOnly = selectedNames.includes('Icons') && toCopy.length === 0;
931
+ if (toCopy.length === 0 && !copyIconsOnly) {
872
932
  console.log('\n No matching component files in scaffold; use CSS only or copy from repo.');
873
933
  return;
874
934
  }
@@ -883,7 +943,7 @@ function copySvelteComponents(projectDir, selectedNames) {
883
943
  }
884
944
  }
885
945
  const iconsSrc = join(scaffoldDir, 'icons');
886
- if (existsSync(iconsSrc)) {
946
+ if (existsSync(iconsSrc) && (toCopy.length > 0 || copyIconsOnly)) {
887
947
  copyDirRecursive(iconsSrc, join(targetDir, 'icons'));
888
948
  }
889
949
  if (toCopy.includes('ThemeSwitcher')) {
@@ -892,10 +952,13 @@ function copySvelteComponents(projectDir, selectedNames) {
892
952
  if (existsSync(themesSrc)) copyFileSync(themesSrc, join(targetDir, 'themes.ts'));
893
953
  if (existsSync(themeSrc)) copyFileSync(themeSrc, join(targetDir, 'theme.ts'));
894
954
  }
895
- if (exports.length > 0) {
896
- const indexContent = `/** Rizzo CSS Svelte components — selected via npx rizzo-css init */\n${exports.join('\n')}\n`;
897
- writeFileSync(join(targetDir, 'index.ts'), indexContent, 'utf8');
898
- console.log('\n ✓ ' + exports.length + ' Svelte components copied to ' + targetDir + (existsSync(iconsSrc) ? ' + icons' : ''));
955
+ if (exports.length > 0 || copyIconsOnly) {
956
+ if (exports.length > 0) {
957
+ const indexContent = `/** Rizzo CSS Svelte components — selected via npx rizzo-css init */\n${exports.join('\n')}\n`;
958
+ writeFileSync(join(targetDir, 'index.ts'), indexContent, 'utf8');
959
+ }
960
+ const msg = copyIconsOnly ? 'Icons' : exports.length + ' Svelte components' + (existsSync(iconsSrc) ? ' + icons' : '');
961
+ console.log('\n ✓ ' + msg + ' copied to ' + targetDir);
899
962
  console.log(' Import in your app: import { Button, Badge, ... } from \'$lib/rizzo\';\n');
900
963
  }
901
964
  }
@@ -908,8 +971,9 @@ function copyAstroComponents(projectDir, selectedNames) {
908
971
  }
909
972
  const files = readdirSync(scaffoldDir).filter((f) => f.endsWith('.astro'));
910
973
  const available = files.map((f) => f.replace('.astro', ''));
911
- const toCopy = selectedNames.filter((n) => available.includes(n));
912
- if (toCopy.length === 0) {
974
+ const toCopy = selectedNames.filter((n) => n !== 'Icons' && available.includes(n));
975
+ const copyIconsOnly = selectedNames.includes('Icons') && toCopy.length === 0;
976
+ if (toCopy.length === 0 && !copyIconsOnly) {
913
977
  console.log('\n No matching Astro components in scaffold; use CSS only or copy from repo.');
914
978
  return;
915
979
  }
@@ -924,7 +988,7 @@ function copyAstroComponents(projectDir, selectedNames) {
924
988
  }
925
989
  }
926
990
  const iconsSrc = join(scaffoldDir, 'icons');
927
- if (existsSync(iconsSrc)) {
991
+ if (existsSync(iconsSrc) && (toCopy.length > 0 || copyIconsOnly)) {
928
992
  copyDirRecursive(iconsSrc, join(targetDir, 'icons'));
929
993
  }
930
994
  if (toCopy.includes('ThemeSwitcher')) {
@@ -933,8 +997,9 @@ function copyAstroComponents(projectDir, selectedNames) {
933
997
  copyFileSync(themesSrc, join(targetDir, 'themes.ts'));
934
998
  }
935
999
  }
936
- if (count > 0) {
937
- console.log('\n ✓ ' + count + ' Astro components + icons copied to ' + targetDir);
1000
+ if (count > 0 || copyIconsOnly) {
1001
+ const msg = copyIconsOnly ? 'Icons' : count + ' Astro components + icons';
1002
+ console.log('\n ✓ ' + msg + ' copied to ' + targetDir);
938
1003
  console.log(' Import in your pages: import Button from \'../components/rizzo/Button.astro\';\n');
939
1004
  }
940
1005
  }
@@ -1018,6 +1083,7 @@ async function runAddToExisting(frameworkOverride, options) {
1018
1083
  const cssTarget = join(targetDir, 'rizzo.min.css');
1019
1084
  mkdirSync(targetDir, { recursive: true });
1020
1085
  copyFileSync(cssSource, cssTarget);
1086
+ copyRizzoFonts(targetDir);
1021
1087
 
1022
1088
  copyRizzoIcons(cwd, framework);
1023
1089
  if (framework === 'svelte' && selectedComponents.length > 0) {
@@ -1031,12 +1097,17 @@ async function runAddToExisting(frameworkOverride, options) {
1031
1097
  }
1032
1098
 
1033
1099
  const linkHref = (options && options.targetDir) ? getLinkHrefForTargetDir(framework, options.targetDir) : paths.linkHref;
1034
- const pm = (config && config.packageManager)
1035
- ? getPackageManagerCommands({ agent: config.packageManager, command: config.packageManager })
1036
- : resolvePackageManager(cwd);
1100
+ const pmFromOption = options && options.packageManager && VALID_PACKAGE_MANAGERS.includes(options.packageManager);
1101
+ const pm = pmFromOption
1102
+ ? getPackageManagerCommands({ agent: options.packageManager, command: options.packageManager })
1103
+ : (config && config.packageManager)
1104
+ ? getPackageManagerCommands({ agent: config.packageManager, command: config.packageManager })
1105
+ : resolvePackageManager(cwd);
1037
1106
  const cliExample = pm.dlx('rizzo-css theme');
1107
+ writeRizzoConfig(cwd, { targetDir: targetDirRaw, framework, packageManager: pm.agent });
1038
1108
  console.log('\n✓ Rizzo CSS added to your existing project');
1039
1109
  console.log(' - ' + cssTarget);
1110
+ console.log(' - Wrote ' + RIZZO_CONFIG_FILE);
1040
1111
  console.log('\nYou must add the stylesheet link yourself — it is not added automatically.');
1041
1112
  if (framework === 'svelte') {
1042
1113
  console.log('\nIn your root layout (e.g. src/app.html), add:');
@@ -1072,7 +1143,6 @@ async function cmdInit(argv) {
1072
1143
  const yes = hasFlag(argv, '--yes');
1073
1144
  const runInstallAfterScaffold = hasFlag(argv, '--install');
1074
1145
  const noInstall = hasFlag(argv, '--no-install');
1075
- const writeConfig = hasFlag(argv, '--write-config');
1076
1146
  const cwd = process.cwd();
1077
1147
  const config = readRizzoConfig(cwd);
1078
1148
 
@@ -1098,7 +1168,8 @@ async function cmdInit(argv) {
1098
1168
  }
1099
1169
  const projectDir = cwd;
1100
1170
  const resolved = resolvePackageManager(projectDir, cwd);
1101
- selectedPm = (config && config.packageManager) || resolved.agent || 'npm';
1171
+ const pmArg = getFlagValue(argv, '--package-manager');
1172
+ selectedPm = parsePackageManager(pmArg) || (config && config.packageManager) || resolved.agent || 'npm';
1102
1173
  theme = 'system';
1103
1174
  defaultDark = DARK_THEMES[0];
1104
1175
  defaultLight = LIGHT_THEMES[0];
@@ -1159,7 +1230,8 @@ async function cmdInit(argv) {
1159
1230
  }
1160
1231
 
1161
1232
  const projectDirForPm = name ? join(cwd, name) : cwd;
1162
- selectedPm = await promptPackageManager(projectDirForPm);
1233
+ const pmArg = getFlagValue(argv, '--package-manager');
1234
+ selectedPm = parsePackageManager(pmArg) || await promptPackageManager(projectDirForPm);
1163
1235
  }
1164
1236
 
1165
1237
  const projectDir = name ? join(cwd, name) : cwd;
@@ -1217,6 +1289,7 @@ async function cmdInit(argv) {
1217
1289
  mkdirSync(join(projectDir, 'public', 'css'), { recursive: true });
1218
1290
  cssTarget = join(projectDir, 'public', 'css', 'rizzo.min.css');
1219
1291
  copyFileSync(cssSource, cssTarget);
1292
+ copyRizzoFonts(dirname(cssTarget));
1220
1293
  if (statSync(cssTarget).size < 5000) {
1221
1294
  console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
1222
1295
  }
@@ -1231,6 +1304,7 @@ async function cmdInit(argv) {
1231
1304
  mkdirSync(join(projectDir, 'public', 'css'), { recursive: true });
1232
1305
  cssTarget = join(projectDir, 'public', 'css', 'rizzo.min.css');
1233
1306
  copyFileSync(cssSource, cssTarget);
1307
+ copyRizzoFonts(dirname(cssTarget));
1234
1308
  if (statSync(cssTarget).size < 5000) {
1235
1309
  console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
1236
1310
  }
@@ -1245,6 +1319,7 @@ async function cmdInit(argv) {
1245
1319
  mkdirSync(join(projectDir, 'static', 'css'), { recursive: true });
1246
1320
  cssTarget = join(projectDir, 'static', 'css', 'rizzo.min.css');
1247
1321
  copyFileSync(cssSource, cssTarget);
1322
+ copyRizzoFonts(dirname(cssTarget));
1248
1323
  if (statSync(cssTarget).size < 5000) {
1249
1324
  console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
1250
1325
  }
@@ -1259,6 +1334,7 @@ async function cmdInit(argv) {
1259
1334
  mkdirSync(join(projectDir, 'static', 'css'), { recursive: true });
1260
1335
  cssTarget = join(projectDir, 'static', 'css', 'rizzo.min.css');
1261
1336
  copyFileSync(cssSource, cssTarget);
1337
+ copyRizzoFonts(dirname(cssTarget));
1262
1338
  if (statSync(cssTarget).size < 5000) {
1263
1339
  console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
1264
1340
  }
@@ -1273,6 +1349,7 @@ async function cmdInit(argv) {
1273
1349
  const linkHref = 'css/rizzo.min.css';
1274
1350
  mkdirSync(cssDir, { recursive: true });
1275
1351
  copyFileSync(cssSource, cssTarget);
1352
+ copyRizzoFonts(dirname(cssTarget));
1276
1353
  if (statSync(cssTarget).size < 5000) {
1277
1354
  console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
1278
1355
  }
@@ -1305,6 +1382,7 @@ async function cmdInit(argv) {
1305
1382
  cssTarget = join(cssDir, 'rizzo.min.css');
1306
1383
  mkdirSync(cssDir, { recursive: true });
1307
1384
  copyFileSync(cssSource, cssTarget);
1385
+ copyRizzoFonts(dirname(cssTarget));
1308
1386
  if (statSync(cssTarget).size < 5000) {
1309
1387
  console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
1310
1388
  }
@@ -1328,6 +1406,7 @@ async function cmdInit(argv) {
1328
1406
  cssTarget = join(cssDir, 'rizzo.min.css');
1329
1407
  mkdirSync(cssDir, { recursive: true });
1330
1408
  copyFileSync(cssSource, cssTarget);
1409
+ copyRizzoFonts(dirname(cssTarget));
1331
1410
  if (statSync(cssTarget).size < 5000) {
1332
1411
  console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
1333
1412
  }
@@ -1378,19 +1457,28 @@ async function cmdInit(argv) {
1378
1457
  const pm = getPackageManagerCommands({ agent: selectedPm, command: selectedPm });
1379
1458
  const nextStep = pm.install + ' && ' + pm.run('dev');
1380
1459
  const runPrefix = name ? 'cd ' + name + ' && ' : '';
1460
+ const hasPackageJson = useHandpickAstro || useHandpickSvelte || useAstroBase || useSvelteBase;
1461
+
1462
+ // Always write rizzo-css.json for new projects (targetDir, framework, packageManager).
1463
+ const pathsForConfig = getFrameworkCssPaths(framework);
1464
+ writeRizzoConfig(projectDir, { targetDir: pathsForConfig.targetDir, framework, packageManager: selectedPm });
1465
+ console.log(' - Wrote ' + RIZZO_CONFIG_FILE);
1381
1466
 
1382
- if (runInstallAfterScaffold && !noInstall && (useHandpickAstro || useHandpickSvelte || useAstroBase || useSvelteBase)) {
1467
+ if (runInstallAfterScaffold && !noInstall && hasPackageJson) {
1383
1468
  console.log('\nRunning: ' + pm.install);
1384
1469
  const code = runInDir(projectDir, pm.install);
1385
1470
  if (code !== 0) {
1386
1471
  console.error('\nInstall failed (exit ' + code + '). Run manually: ' + runPrefix + pm.install);
1387
1472
  }
1388
- }
1389
-
1390
- if (writeConfig) {
1391
- const pathsForConfig = getFrameworkCssPaths(framework);
1392
- writeRizzoConfig(projectDir, { targetDir: pathsForConfig.targetDir, framework, packageManager: selectedPm });
1393
- console.log('\n - Wrote ' + RIZZO_CONFIG_FILE);
1473
+ } else if (!yes && !noInstall && hasPackageJson) {
1474
+ const shouldRun = await confirmRunInstall(pm);
1475
+ if (shouldRun) {
1476
+ console.log('\nRunning: ' + pm.install);
1477
+ const code = runInDir(projectDir, pm.install);
1478
+ if (code !== 0) {
1479
+ console.error('\nInstall failed (exit ' + code + '). Run manually: ' + runPrefix + pm.install);
1480
+ }
1481
+ }
1394
1482
  }
1395
1483
 
1396
1484
  if (useHandpickAstro || useHandpickSvelte) {
File without changes
@@ -0,0 +1,92 @@
1
+ Geist Sans and Geist Mono Font
2
+ (C) 2023 Vercel, made in collaboration with basement.studio
3
+
4
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
5
+ This license is available with a FAQ at: http://scripts.sil.org/OFL and copied below
6
+
7
+ -----------------------------------------------------------
8
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9
+ -----------------------------------------------------------
10
+
11
+ PREAMBLE
12
+ The goals of the Open Font License (OFL) are to stimulate worldwide
13
+ development of collaborative font projects, to support the font creation
14
+ efforts of academic and linguistic communities, and to provide a free and
15
+ open framework in which fonts may be shared and improved in partnership
16
+ with others.
17
+
18
+ The OFL allows the licensed fonts to be used, studied, modified and
19
+ redistributed freely as long as they are not sold by themselves. The
20
+ fonts, including any derivative works, can be bundled, embedded,
21
+ redistributed and/or sold with any software provided that any reserved
22
+ names are not used by derivative works. The fonts and derivatives,
23
+ however, cannot be released under any other type of license. The
24
+ requirement for fonts to remain under this license does not apply
25
+ to any document created using the fonts or their derivatives.
26
+
27
+ DEFINITIONS
28
+ "Font Software" refers to the set of files released by the Copyright
29
+ Holder(s) under this license and clearly marked as such. This may
30
+ include source files, build scripts and documentation.
31
+
32
+ "Reserved Font Name" refers to any names specified as such after the
33
+ copyright statement(s).
34
+
35
+ "Original Version" refers to the collection of Font Software components as
36
+ distributed by the Copyright Holder(s).
37
+
38
+ "Modified Version" refers to any derivative made by adding to, deleting,
39
+ or substituting -- in part or in whole -- any of the components of the
40
+ Original Version, by changing formats or by porting the Font Software to a
41
+ new environment.
42
+
43
+ "Author" refers to any designer, engineer, programmer, technical
44
+ writer or other person who contributed to the Font Software.
45
+
46
+ PERMISSION AND CONDITIONS
47
+ Permission is hereby granted, free of charge, to any person obtaining
48
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
49
+ redistribute, and sell modified and unmodified copies of the Font
50
+ Software, subject to the following conditions:
51
+
52
+ 1) Neither the Font Software nor any of its individual components,
53
+ in Original or Modified Versions, may be sold by itself.
54
+
55
+ 2) Original or Modified Versions of the Font Software may be bundled,
56
+ redistributed and/or sold with any software, provided that each copy
57
+ contains the above copyright notice and this license. These can be
58
+ included either as stand-alone text files, human-readable headers or
59
+ in the appropriate machine-readable metadata fields within text or
60
+ binary files as long as those fields can be easily viewed by the user.
61
+
62
+ 3) No Modified Version of the Font Software may use the Reserved Font
63
+ Name(s) unless explicit written permission is granted by the corresponding
64
+ Copyright Holder. This restriction only applies to the primary font name as
65
+ presented to the users.
66
+
67
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
68
+ Software shall not be used to promote, endorse or advertise any
69
+ Modified Version, except to acknowledge the contribution(s) of the
70
+ Copyright Holder(s) and the Author(s) or with their explicit written
71
+ permission.
72
+
73
+ 5) The Font Software, modified or unmodified, in part or in whole,
74
+ must be distributed entirely under this license, and must not be
75
+ distributed under any other license. The requirement for fonts to
76
+ remain under this license does not apply to any document created
77
+ using the Font Software.
78
+
79
+ TERMINATION
80
+ This license becomes null and void if any of the above conditions are
81
+ not met.
82
+
83
+ DISCLAIMER
84
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
85
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
86
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
87
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
88
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
89
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
90
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
92
+ OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file
@@ -0,0 +1,92 @@
1
+ Geist Sans and Geist Mono Font
2
+ (C) 2023 Vercel, made in collaboration with basement.studio
3
+
4
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
5
+ This license is available with a FAQ at: http://scripts.sil.org/OFL and copied below
6
+
7
+ -----------------------------------------------------------
8
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9
+ -----------------------------------------------------------
10
+
11
+ PREAMBLE
12
+ The goals of the Open Font License (OFL) are to stimulate worldwide
13
+ development of collaborative font projects, to support the font creation
14
+ efforts of academic and linguistic communities, and to provide a free and
15
+ open framework in which fonts may be shared and improved in partnership
16
+ with others.
17
+
18
+ The OFL allows the licensed fonts to be used, studied, modified and
19
+ redistributed freely as long as they are not sold by themselves. The
20
+ fonts, including any derivative works, can be bundled, embedded,
21
+ redistributed and/or sold with any software provided that any reserved
22
+ names are not used by derivative works. The fonts and derivatives,
23
+ however, cannot be released under any other type of license. The
24
+ requirement for fonts to remain under this license does not apply
25
+ to any document created using the fonts or their derivatives.
26
+
27
+ DEFINITIONS
28
+ "Font Software" refers to the set of files released by the Copyright
29
+ Holder(s) under this license and clearly marked as such. This may
30
+ include source files, build scripts and documentation.
31
+
32
+ "Reserved Font Name" refers to any names specified as such after the
33
+ copyright statement(s).
34
+
35
+ "Original Version" refers to the collection of Font Software components as
36
+ distributed by the Copyright Holder(s).
37
+
38
+ "Modified Version" refers to any derivative made by adding to, deleting,
39
+ or substituting -- in part or in whole -- any of the components of the
40
+ Original Version, by changing formats or by porting the Font Software to a
41
+ new environment.
42
+
43
+ "Author" refers to any designer, engineer, programmer, technical
44
+ writer or other person who contributed to the Font Software.
45
+
46
+ PERMISSION AND CONDITIONS
47
+ Permission is hereby granted, free of charge, to any person obtaining
48
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
49
+ redistribute, and sell modified and unmodified copies of the Font
50
+ Software, subject to the following conditions:
51
+
52
+ 1) Neither the Font Software nor any of its individual components,
53
+ in Original or Modified Versions, may be sold by itself.
54
+
55
+ 2) Original or Modified Versions of the Font Software may be bundled,
56
+ redistributed and/or sold with any software, provided that each copy
57
+ contains the above copyright notice and this license. These can be
58
+ included either as stand-alone text files, human-readable headers or
59
+ in the appropriate machine-readable metadata fields within text or
60
+ binary files as long as those fields can be easily viewed by the user.
61
+
62
+ 3) No Modified Version of the Font Software may use the Reserved Font
63
+ Name(s) unless explicit written permission is granted by the corresponding
64
+ Copyright Holder. This restriction only applies to the primary font name as
65
+ presented to the users.
66
+
67
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
68
+ Software shall not be used to promote, endorse or advertise any
69
+ Modified Version, except to acknowledge the contribution(s) of the
70
+ Copyright Holder(s) and the Author(s) or with their explicit written
71
+ permission.
72
+
73
+ 5) The Font Software, modified or unmodified, in part or in whole,
74
+ must be distributed entirely under this license, and must not be
75
+ distributed under any other license. The requirement for fonts to
76
+ remain under this license does not apply to any document created
77
+ using the Font Software.
78
+
79
+ TERMINATION
80
+ This license becomes null and void if any of the above conditions are
81
+ not met.
82
+
83
+ DISCLAIMER
84
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
85
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
86
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
87
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
88
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
89
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
90
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
92
+ OTHER DEALINGS IN THE FONT SOFTWARE.