rizzo-css 0.0.16 → 0.0.18
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 +4 -4
- package/bin/rizzo-css.js +473 -164
- package/dist/rizzo.min.css +4 -1
- package/package.json +9 -4
- package/scaffold/astro-minimal/.env.example +3 -0
- package/scaffold/astro-minimal/README.md +36 -0
- package/scaffold/astro-minimal/package.json +13 -0
- package/scaffold/astro-minimal/src/layouts/Layout.astro +28 -0
- package/scaffold/astro-minimal/src/pages/index.astro +10 -0
- package/scaffold/svelte-minimal/.env.example +3 -0
- package/scaffold/svelte-minimal/README.md +37 -0
- package/scaffold/svelte-minimal/package.json +20 -0
- package/scaffold/svelte-minimal/src/app.d.ts +11 -0
- package/scaffold/svelte-minimal/src/app.html +15 -0
- package/scaffold/svelte-minimal/src/routes/+layout.svelte +1 -0
- package/scaffold/svelte-minimal/src/routes/+page.svelte +5 -0
- package/scaffold/svelte-minimal/svelte.config.js +10 -0
- package/scaffold/svelte-minimal/tsconfig.json +11 -0
- package/scaffold/vanilla/README.md +4 -4
- package/scaffold/vanilla/components/accordion.html +18 -0
- package/scaffold/vanilla/components/alert.html +18 -0
- package/scaffold/vanilla/components/avatar.html +18 -0
- package/scaffold/vanilla/components/badge.html +18 -0
- package/scaffold/vanilla/components/breadcrumb.html +18 -0
- package/scaffold/vanilla/components/button.html +18 -0
- package/scaffold/vanilla/components/cards.html +18 -0
- package/scaffold/vanilla/components/copy-to-clipboard.html +18 -0
- package/scaffold/vanilla/components/divider.html +18 -0
- package/scaffold/vanilla/components/dropdown.html +18 -0
- package/scaffold/vanilla/components/forms.html +18 -0
- package/scaffold/vanilla/components/icons.html +18 -0
- package/scaffold/vanilla/components/index.html +18 -0
- package/scaffold/vanilla/components/modal.html +18 -0
- package/scaffold/vanilla/components/navbar.html +18 -0
- package/scaffold/vanilla/components/pagination.html +18 -0
- package/scaffold/vanilla/components/progress-bar.html +18 -0
- package/scaffold/vanilla/components/search.html +18 -0
- package/scaffold/vanilla/components/settings.html +18 -0
- package/scaffold/vanilla/components/spinner.html +18 -0
- package/scaffold/vanilla/components/table.html +18 -0
- package/scaffold/vanilla/components/tabs.html +18 -0
- package/scaffold/vanilla/components/theme-switcher.html +18 -0
- package/scaffold/vanilla/components/toast.html +18 -0
- package/scaffold/vanilla/components/tooltip.html +18 -0
- package/scaffold/vanilla/index.html +18 -0
- package/scaffold/astro-app/README.md +0 -43
- package/scaffold/astro-app/package.json +0 -1
- package/scaffold/astro-app/src/components/Accordion.astro +0 -178
- package/scaffold/astro-app/src/components/Alert.astro +0 -131
- package/scaffold/astro-app/src/components/Avatar.astro +0 -59
- package/scaffold/astro-app/src/components/Badge.astro +0 -24
- package/scaffold/astro-app/src/components/Breadcrumb.astro +0 -61
- package/scaffold/astro-app/src/components/Button.astro +0 -3
- package/scaffold/astro-app/src/components/Card.astro +0 -18
- package/scaffold/astro-app/src/components/Checkbox.astro +0 -38
- package/scaffold/astro-app/src/components/CodeBlock.astro +0 -393
- package/scaffold/astro-app/src/components/CopyToClipboard.astro +0 -219
- package/scaffold/astro-app/src/components/Divider.astro +0 -37
- package/scaffold/astro-app/src/components/DocsSidebar.astro +0 -51
- package/scaffold/astro-app/src/components/Dropdown.astro +0 -807
- package/scaffold/astro-app/src/components/FormGroup.astro +0 -59
- package/scaffold/astro-app/src/components/FrameworkSwitcher.astro +0 -72
- package/scaffold/astro-app/src/components/Input.astro +0 -59
- package/scaffold/astro-app/src/components/Modal.astro +0 -212
- package/scaffold/astro-app/src/components/Navbar.astro +0 -623
- package/scaffold/astro-app/src/components/Pagination.astro +0 -240
- package/scaffold/astro-app/src/components/ProgressBar.astro +0 -65
- package/scaffold/astro-app/src/components/Radio.astro +0 -38
- package/scaffold/astro-app/src/components/Search.astro +0 -1259
- package/scaffold/astro-app/src/components/Select.astro +0 -49
- package/scaffold/astro-app/src/components/Settings.astro +0 -382
- package/scaffold/astro-app/src/components/Spinner.astro +0 -30
- package/scaffold/astro-app/src/components/Table.astro +0 -181
- package/scaffold/astro-app/src/components/Tabs.astro +0 -223
- package/scaffold/astro-app/src/components/Textarea.astro +0 -58
- package/scaffold/astro-app/src/components/ThemeIcon.astro +0 -50
- package/scaffold/astro-app/src/components/ThemeSwitcher.astro +0 -504
- package/scaffold/astro-app/src/components/Toast.astro +0 -30
- package/scaffold/astro-app/src/components/Tooltip.astro +0 -32
- package/scaffold/astro-app/src/components/icons/Brush.astro +0 -10
- package/scaffold/astro-app/src/components/icons/Cake.astro +0 -11
- package/scaffold/astro-app/src/components/icons/Check.astro +0 -29
- package/scaffold/astro-app/src/components/icons/Cherry.astro +0 -11
- package/scaffold/astro-app/src/components/icons/ChevronDown.astro +0 -29
- package/scaffold/astro-app/src/components/icons/Circle.astro +0 -29
- package/scaffold/astro-app/src/components/icons/Close.astro +0 -30
- package/scaffold/astro-app/src/components/icons/Cmd.astro +0 -26
- package/scaffold/astro-app/src/components/icons/Copy.astro +0 -30
- package/scaffold/astro-app/src/components/icons/Eye.astro +0 -30
- package/scaffold/astro-app/src/components/icons/Filter.astro +0 -29
- package/scaffold/astro-app/src/components/icons/Flame.astro +0 -28
- package/scaffold/astro-app/src/components/icons/Flower.astro +0 -11
- package/scaffold/astro-app/src/components/icons/Gear.astro +0 -30
- package/scaffold/astro-app/src/components/icons/Heart.astro +0 -28
- package/scaffold/astro-app/src/components/icons/IceCream.astro +0 -31
- package/scaffold/astro-app/src/components/icons/Leaf.astro +0 -29
- package/scaffold/astro-app/src/components/icons/Lemon.astro +0 -11
- package/scaffold/astro-app/src/components/icons/Moon.astro +0 -29
- package/scaffold/astro-app/src/components/icons/Owl.astro +0 -34
- package/scaffold/astro-app/src/components/icons/Palette.astro +0 -33
- package/scaffold/astro-app/src/components/icons/Rainbow.astro +0 -31
- package/scaffold/astro-app/src/components/icons/Search.astro +0 -30
- package/scaffold/astro-app/src/components/icons/Shield.astro +0 -28
- package/scaffold/astro-app/src/components/icons/Snowflake.astro +0 -34
- package/scaffold/astro-app/src/components/icons/Sort.astro +0 -30
- package/scaffold/astro-app/src/components/icons/Sun.astro +0 -29
- package/scaffold/astro-app/src/components/icons/Sunset.astro +0 -10
- package/scaffold/astro-app/src/components/icons/Zap.astro +0 -9
- package/scaffold/astro-app/src/components/icons/devicons/Astro.astro +0 -53
- package/scaffold/astro-app/src/components/icons/devicons/Bash.astro +0 -34
- package/scaffold/astro-app/src/components/icons/devicons/Css3.astro +0 -29
- package/scaffold/astro-app/src/components/icons/devicons/Git.astro +0 -24
- package/scaffold/astro-app/src/components/icons/devicons/Html5.astro +0 -27
- package/scaffold/astro-app/src/components/icons/devicons/Javascript.astro +0 -25
- package/scaffold/astro-app/src/components/icons/devicons/Nodejs.astro +0 -47
- package/scaffold/astro-app/src/components/icons/devicons/Plaintext.astro +0 -33
- package/scaffold/astro-app/src/components/icons/devicons/React.astro +0 -27
- package/scaffold/astro-app/src/components/icons/devicons/Svelte.astro +0 -25
- package/scaffold/astro-app/src/components/icons/devicons/Vue.astro +0 -26
- package/scaffold/astro-app/src/config/frameworks.ts +0 -26
- package/scaffold/astro-app/src/config/themes.ts +0 -54
- package/scaffold/astro-app/src/layouts/DocsLayout.astro +0 -263
- package/scaffold/astro-app/src/layouts/Layout.astro +0 -41
- package/scaffold/astro-app/src/pages/components/accordion.astro +0 -172
- package/scaffold/astro-app/src/pages/components/alert.astro +0 -250
- package/scaffold/astro-app/src/pages/components/avatar.astro +0 -102
- package/scaffold/astro-app/src/pages/components/badge.astro +0 -119
- package/scaffold/astro-app/src/pages/components/breadcrumb.astro +0 -124
- package/scaffold/astro-app/src/pages/components/button.astro +0 -74
- package/scaffold/astro-app/src/pages/components/cards.astro +0 -247
- package/scaffold/astro-app/src/pages/components/copy-to-clipboard.astro +0 -49
- package/scaffold/astro-app/src/pages/components/divider.astro +0 -74
- package/scaffold/astro-app/src/pages/components/dropdown.astro +0 -394
- package/scaffold/astro-app/src/pages/components/forms.astro +0 -367
- package/scaffold/astro-app/src/pages/components/icons.astro +0 -246
- package/scaffold/astro-app/src/pages/components/modal.astro +0 -152
- package/scaffold/astro-app/src/pages/components/navbar.astro +0 -80
- package/scaffold/astro-app/src/pages/components/pagination.astro +0 -126
- package/scaffold/astro-app/src/pages/components/progress-bar.astro +0 -94
- package/scaffold/astro-app/src/pages/components/search.astro +0 -155
- package/scaffold/astro-app/src/pages/components/settings.astro +0 -78
- package/scaffold/astro-app/src/pages/components/spinner.astro +0 -81
- package/scaffold/astro-app/src/pages/components/table.astro +0 -144
- package/scaffold/astro-app/src/pages/components/tabs.astro +0 -220
- package/scaffold/astro-app/src/pages/components/theme-switcher.astro +0 -69
- package/scaffold/astro-app/src/pages/components/toast.astro +0 -157
- package/scaffold/astro-app/src/pages/components/tooltip.astro +0 -209
- package/scaffold/astro-app/src/pages/components.astro +0 -290
- package/scaffold/astro-app/src/pages/docs/accessibility.astro +0 -9
- package/scaffold/astro-app/src/pages/docs/colors.astro +0 -9
- package/scaffold/astro-app/src/pages/docs/design-system.astro +0 -9
- package/scaffold/astro-app/src/pages/docs/getting-started.astro +0 -9
- package/scaffold/astro-app/src/pages/docs/index.astro +0 -15
- package/scaffold/astro-app/src/pages/docs/themes/[theme].astro +0 -14
- package/scaffold/astro-app/src/pages/docs/theming.astro +0 -10
- package/scaffold/astro-app/src/pages/index.astro +0 -24
- package/scaffold/svelte-app/README.md +0 -39
- package/scaffold/svelte-app/package.json +0 -22
- package/scaffold/svelte-app/src/app.d.ts +0 -28
- package/scaffold/svelte-app/src/app.html +0 -21
- package/scaffold/svelte-app/src/lib/assets/favicon.svg +0 -1
- package/scaffold/svelte-app/src/lib/rizzo/Accordion.svelte +0 -128
- package/scaffold/svelte-app/src/lib/rizzo/Alert.svelte +0 -85
- package/scaffold/svelte-app/src/lib/rizzo/Avatar.svelte +0 -39
- package/scaffold/svelte-app/src/lib/rizzo/Badge.svelte +0 -31
- package/scaffold/svelte-app/src/lib/rizzo/Breadcrumb.svelte +0 -49
- package/scaffold/svelte-app/src/lib/rizzo/Button.svelte +0 -27
- package/scaffold/svelte-app/src/lib/rizzo/Card.svelte +0 -17
- package/scaffold/svelte-app/src/lib/rizzo/Checkbox.svelte +0 -37
- package/scaffold/svelte-app/src/lib/rizzo/CopyToClipboard.svelte +0 -79
- package/scaffold/svelte-app/src/lib/rizzo/Divider.svelte +0 -28
- package/scaffold/svelte-app/src/lib/rizzo/Dropdown.svelte +0 -254
- package/scaffold/svelte-app/src/lib/rizzo/FormGroup.svelte +0 -51
- package/scaffold/svelte-app/src/lib/rizzo/Input.svelte +0 -59
- package/scaffold/svelte-app/src/lib/rizzo/Modal.svelte +0 -157
- package/scaffold/svelte-app/src/lib/rizzo/Pagination.svelte +0 -93
- package/scaffold/svelte-app/src/lib/rizzo/ProgressBar.svelte +0 -58
- package/scaffold/svelte-app/src/lib/rizzo/Radio.svelte +0 -38
- package/scaffold/svelte-app/src/lib/rizzo/Select.svelte +0 -51
- package/scaffold/svelte-app/src/lib/rizzo/Spinner.svelte +0 -14
- package/scaffold/svelte-app/src/lib/rizzo/Table.svelte +0 -158
- package/scaffold/svelte-app/src/lib/rizzo/Tabs.svelte +0 -117
- package/scaffold/svelte-app/src/lib/rizzo/Textarea.svelte +0 -59
- package/scaffold/svelte-app/src/lib/rizzo/ThemeIcon.svelte +0 -54
- package/scaffold/svelte-app/src/lib/rizzo/ThemeSwitcher.svelte +0 -315
- package/scaffold/svelte-app/src/lib/rizzo/Toast.svelte +0 -33
- package/scaffold/svelte-app/src/lib/rizzo/Tooltip.svelte +0 -19
- package/scaffold/svelte-app/src/lib/rizzo/icons/Check.svelte +0 -29
- package/scaffold/svelte-app/src/lib/rizzo/icons/ChevronDown.svelte +0 -29
- package/scaffold/svelte-app/src/lib/rizzo/icons/Circle.svelte +0 -29
- package/scaffold/svelte-app/src/lib/rizzo/icons/Close.svelte +0 -30
- package/scaffold/svelte-app/src/lib/rizzo/icons/Cmd.svelte +0 -27
- package/scaffold/svelte-app/src/lib/rizzo/icons/Copy.svelte +0 -30
- package/scaffold/svelte-app/src/lib/rizzo/icons/Eye.svelte +0 -30
- package/scaffold/svelte-app/src/lib/rizzo/icons/Filter.svelte +0 -29
- package/scaffold/svelte-app/src/lib/rizzo/icons/Gear.svelte +0 -30
- package/scaffold/svelte-app/src/lib/rizzo/icons/IceCream.svelte +0 -31
- package/scaffold/svelte-app/src/lib/rizzo/icons/Moon.svelte +0 -29
- package/scaffold/svelte-app/src/lib/rizzo/icons/Owl.svelte +0 -34
- package/scaffold/svelte-app/src/lib/rizzo/icons/Palette.svelte +0 -33
- package/scaffold/svelte-app/src/lib/rizzo/icons/Rainbow.svelte +0 -31
- package/scaffold/svelte-app/src/lib/rizzo/icons/Search.svelte +0 -30
- package/scaffold/svelte-app/src/lib/rizzo/icons/Snowflake.svelte +0 -34
- package/scaffold/svelte-app/src/lib/rizzo/icons/Sort.svelte +0 -30
- package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Astro.svelte +0 -45
- package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Bash.svelte +0 -28
- package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Css3.svelte +0 -23
- package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Git.svelte +0 -18
- package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Html5.svelte +0 -21
- package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Javascript.svelte +0 -19
- package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Nodejs.svelte +0 -44
- package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Plaintext.svelte +0 -24
- package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/React.svelte +0 -21
- package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/SvelteIcon.svelte +0 -19
- package/scaffold/svelte-app/src/lib/rizzo/icons/devicons/Vue.svelte +0 -20
- package/scaffold/svelte-app/src/lib/rizzo/index.ts +0 -35
- package/scaffold/svelte-app/src/lib/rizzo-docs/CodeBlock.svelte +0 -239
- package/scaffold/svelte-app/src/lib/rizzo-docs/SvelteDocPage.svelte +0 -99
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/AccordionDoc.svelte +0 -53
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/AlertDoc.svelte +0 -114
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/AvatarDoc.svelte +0 -92
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/BadgeDoc.svelte +0 -60
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/BreadcrumbDoc.svelte +0 -55
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/ButtonDoc.svelte +0 -55
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/CardsDoc.svelte +0 -173
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/ComingSoon.svelte +0 -12
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/ComponentsOverview.svelte +0 -92
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/CopyToClipboardDoc.svelte +0 -26
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/DividerDoc.svelte +0 -105
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/DropdownDoc.svelte +0 -161
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/FormsDoc.svelte +0 -375
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/IconsDoc.svelte +0 -246
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/Index.svelte +0 -8
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/ModalDoc.svelte +0 -50
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/NavbarDoc.svelte +0 -79
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/PaginationDoc.svelte +0 -44
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/ProgressBarDoc.svelte +0 -95
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/SearchDoc.svelte +0 -147
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/SettingsDoc.svelte +0 -158
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/SpinnerDoc.svelte +0 -41
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/TableDoc.svelte +0 -116
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/TabsDoc.svelte +0 -152
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/ThemeSwitcherDoc.svelte +0 -189
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/Theming.svelte +0 -6
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/ToastDoc.svelte +0 -136
- package/scaffold/svelte-app/src/lib/rizzo-docs/pages/TooltipDoc.svelte +0 -57
- package/scaffold/svelte-app/src/routes/+layout.svelte +0 -10
- package/scaffold/svelte-app/src/routes/+page.svelte +0 -31
- package/scaffold/svelte-app/src/routes/components/+page.svelte +0 -4
- package/scaffold/svelte-app/src/routes/components/[slug]/+page.svelte +0 -7
- package/scaffold/svelte-app/static/robots.txt +0 -3
- package/scaffold/svelte-app/svelte.config.js +0 -13
- package/scaffold/svelte-app/tsconfig.json +0 -21
- package/scaffold/svelte-app/vite.config.ts +0 -6
- /package/scaffold/{astro-app → astro-minimal}/astro.config.mjs +0 -0
- /package/scaffold/{astro-app → astro-minimal}/public/.gitkeep +0 -0
- /package/scaffold/{astro-app → astro-minimal}/public/favicon.svg +0 -0
- /package/scaffold/{astro-app → astro-minimal}/tsconfig.json +0 -0
- /package/scaffold/{svelte-app → svelte-minimal}/static/.gitkeep +0 -0
package/bin/rizzo-css.js
CHANGED
|
@@ -2,10 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
const { copyFileSync, mkdirSync, writeFileSync, existsSync, readFileSync, readdirSync, statSync } = require('fs');
|
|
4
4
|
const { join, dirname } = require('path');
|
|
5
|
+
const { spawnSync } = require('child_process');
|
|
5
6
|
const readline = require('readline');
|
|
6
7
|
|
|
8
|
+
const RIZZO_CONFIG_FILE = 'rizzo-css.json';
|
|
9
|
+
|
|
7
10
|
const COMMANDS = ['init', 'add', 'theme', 'help'];
|
|
8
11
|
const FRAMEWORKS = ['vanilla', 'astro', 'svelte'];
|
|
12
|
+
|
|
13
|
+
/** Template options for "create new" when user chooses "Use a template". When they choose "No template" they get minimal base + hand-pick components. */
|
|
14
|
+
const TEMPLATES = {
|
|
15
|
+
vanilla: [
|
|
16
|
+
{ value: 'full', label: 'Full — index.html + theme switcher, js/main.js, icons, README' },
|
|
17
|
+
{ value: 'minimal', label: 'Minimal — index.html + CSS link only' },
|
|
18
|
+
],
|
|
19
|
+
astro: [
|
|
20
|
+
{ value: 'minimal', label: 'Minimal — Astro with config, one page, README, LICENSE, .env.example' },
|
|
21
|
+
],
|
|
22
|
+
svelte: [
|
|
23
|
+
{ value: 'minimal', label: 'Minimal — SvelteKit with config, one page, README, LICENSE, .env.example' },
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const VANILLA_MINIMAL_README = `# Vanilla + Rizzo CSS (minimal)
|
|
28
|
+
|
|
29
|
+
Minimal HTML + Rizzo CSS. Scaffolded with \`npx rizzo-css init --framework vanilla --template minimal\`.
|
|
30
|
+
|
|
31
|
+
- Open \`index.html\` in a browser or serve the folder with any static server.
|
|
32
|
+
- Edit \`index.html\` and add your content. CSS: \`css/rizzo.min.css\`.
|
|
33
|
+
- Set a theme: \`<html data-theme="github-dark-classic">\` (see \`npx rizzo-css theme\` for all themes).
|
|
34
|
+
|
|
35
|
+
Docs: [rizzo-css.vercel.app](https://rizzo-css.vercel.app)
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
const FALLBACK_MINIMAL_README = `# Rizzo CSS (minimal)
|
|
39
|
+
|
|
40
|
+
Minimal project with Rizzo CSS. Add a proper framework (e.g. \`npm create astro@latest\` or \`npm create svelte@latest\`), then run \`npx rizzo-css add\` in the project.
|
|
41
|
+
|
|
42
|
+
- This folder has a single HTML file and \`css/rizzo.min.css\`.
|
|
43
|
+
- For a full app with config and tooling, use the framework's create command and \`rizzo-css add\`.
|
|
44
|
+
|
|
45
|
+
Docs: [rizzo-css.vercel.app](https://rizzo-css.vercel.app)
|
|
46
|
+
`;
|
|
47
|
+
|
|
9
48
|
// Dark and light themes (order matches scaffold optgroups and config/themes.ts)
|
|
10
49
|
const DARK_THEMES = [
|
|
11
50
|
'github-dark-classic',
|
|
@@ -67,6 +106,123 @@ function getCssPath() {
|
|
|
67
106
|
return join(getPackageRoot(), 'dist', 'rizzo.min.css');
|
|
68
107
|
}
|
|
69
108
|
|
|
109
|
+
/** Copy the package LICENSE into the project dir. Call after every scaffold so every install includes a license. */
|
|
110
|
+
function copyPackageLicense(projectDir) {
|
|
111
|
+
const licensePath = join(getPackageRoot(), 'LICENSE');
|
|
112
|
+
if (existsSync(licensePath)) {
|
|
113
|
+
copyFileSync(licensePath, join(projectDir, 'LICENSE'));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** Read rizzo-css.json from cwd. Returns { targetDir?, framework?, packageManager? } or null. */
|
|
118
|
+
function readRizzoConfig(cwd) {
|
|
119
|
+
if (!cwd || !existsSync(cwd)) return null;
|
|
120
|
+
const configPath = join(cwd, RIZZO_CONFIG_FILE);
|
|
121
|
+
if (!existsSync(configPath)) return null;
|
|
122
|
+
try {
|
|
123
|
+
const raw = JSON.parse(readFileSync(configPath, 'utf8'));
|
|
124
|
+
const out = {};
|
|
125
|
+
if (typeof raw.targetDir === 'string') out.targetDir = raw.targetDir;
|
|
126
|
+
if (typeof raw.framework === 'string' && FRAMEWORKS.includes(raw.framework)) out.framework = raw.framework;
|
|
127
|
+
if (typeof raw.packageManager === 'string' && ['npm', 'pnpm', 'yarn', 'bun'].includes(raw.packageManager)) out.packageManager = raw.packageManager;
|
|
128
|
+
return Object.keys(out).length ? out : null;
|
|
129
|
+
} catch (_) { return null; }
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** Write rizzo-css.json to cwd. config: { targetDir?, framework?, packageManager? }. */
|
|
133
|
+
function writeRizzoConfig(cwd, config) {
|
|
134
|
+
if (!cwd || !existsSync(cwd)) return;
|
|
135
|
+
const configPath = join(cwd, RIZZO_CONFIG_FILE);
|
|
136
|
+
const obj = {};
|
|
137
|
+
if (config.targetDir != null) obj.targetDir = config.targetDir;
|
|
138
|
+
if (config.framework != null) obj.framework = config.framework;
|
|
139
|
+
if (config.packageManager != null) obj.packageManager = config.packageManager;
|
|
140
|
+
writeFileSync(configPath, JSON.stringify(obj, null, 2) + '\n', 'utf8');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Run a command in cwd. command is the full string (e.g. "pnpm add rizzo-css"). Returns exit code. */
|
|
144
|
+
function runInDir(cwd, command) {
|
|
145
|
+
const result = spawnSync(command, { cwd, shell: true, stdio: 'inherit' });
|
|
146
|
+
return result.status != null ? result.status : result.signal ? 1 : 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function hasFlag(argv, flag) {
|
|
150
|
+
return argv.indexOf(flag) !== -1;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function getFlagValue(argv, flag) {
|
|
154
|
+
const i = argv.indexOf(flag);
|
|
155
|
+
return i !== -1 && argv[i + 1] != null ? argv[i + 1] : null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Package manager detection (manual: lockfiles + packageManager field). Returns { agent, command } or null if none found. */
|
|
159
|
+
function detectPackageManager(cwd) {
|
|
160
|
+
if (!cwd || !existsSync(cwd)) return null;
|
|
161
|
+
if (existsSync(join(cwd, 'pnpm-lock.yaml'))) return { agent: 'pnpm', command: 'pnpm' };
|
|
162
|
+
if (existsSync(join(cwd, 'yarn.lock'))) return { agent: 'yarn', command: 'yarn' };
|
|
163
|
+
if (existsSync(join(cwd, 'bun.lockb'))) return { agent: 'bun', command: 'bun' };
|
|
164
|
+
if (existsSync(join(cwd, 'package-lock.json')) || existsSync(join(cwd, 'npm-shrinkwrap.json'))) return { agent: 'npm', command: 'npm' };
|
|
165
|
+
const pkgPath = join(cwd, 'package.json');
|
|
166
|
+
if (existsSync(pkgPath)) {
|
|
167
|
+
try {
|
|
168
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
169
|
+
const pm = pkg.packageManager || (pkg.devEngines && pkg.devEngines.packageManager);
|
|
170
|
+
if (typeof pm === 'string') {
|
|
171
|
+
const name = (pm.split('@')[0] || '').toLowerCase();
|
|
172
|
+
if (['npm', 'pnpm', 'yarn', 'bun'].includes(name)) return { agent: name, command: name };
|
|
173
|
+
}
|
|
174
|
+
} catch (_) { /* ignore */ }
|
|
175
|
+
}
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** Get install and run commands for a package manager. pm: { agent, command } from detectPackageManager. */
|
|
180
|
+
function getPackageManagerCommands(pm) {
|
|
181
|
+
if (!pm) pm = { agent: 'npm', command: 'npm' };
|
|
182
|
+
const c = pm.command;
|
|
183
|
+
return {
|
|
184
|
+
agent: pm.agent,
|
|
185
|
+
install: c + ' install',
|
|
186
|
+
run: (script) => (pm.agent === 'npm' ? c + ' run ' + script : c + ' run ' + script),
|
|
187
|
+
add: (pkg) => (pm.agent === 'npm' ? c + ' install ' + pkg : c + ' add ' + pkg),
|
|
188
|
+
addDev: (pkg) => (pm.agent === 'npm' ? c + ' install -D ' + pkg : pm.agent === 'bun' ? c + ' add -d ' + pkg : c + ' add -D ' + pkg),
|
|
189
|
+
dlx: (pkgAndArgs) => (pm.agent === 'npm' ? 'npx ' + pkgAndArgs : pm.agent === 'pnpm' ? 'pnpm dlx ' + pkgAndArgs : pm.agent === 'yarn' ? 'yarn dlx ' + pkgAndArgs : 'bunx ' + pkgAndArgs),
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** Detect package manager for a project dir, falling back to cwd then default npm. */
|
|
194
|
+
function resolvePackageManager(projectDir, fallbackCwd) {
|
|
195
|
+
const pm = detectPackageManager(projectDir) || detectPackageManager(fallbackCwd || process.cwd());
|
|
196
|
+
return getPackageManagerCommands(pm || { agent: 'npm', command: 'npm' });
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** Example command to create a new framework project (e.g. create-astro, create-svelte). */
|
|
200
|
+
function getCreateProjectExample(pm, framework) {
|
|
201
|
+
const createPkg = 'create-' + framework + '@latest';
|
|
202
|
+
if (pm.agent === 'npm') return 'npm create ' + framework + '@latest my-app';
|
|
203
|
+
if (pm.agent === 'pnpm') return 'pnpm dlx ' + createPkg + ' my-app';
|
|
204
|
+
if (pm.agent === 'yarn') return 'yarn create ' + framework + ' my-app';
|
|
205
|
+
if (pm.agent === 'bun') return 'bun create ' + framework + ' my-app';
|
|
206
|
+
return 'npm create ' + framework + '@latest my-app';
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** Prompt user to select package manager (npm, pnpm, yarn, bun). Puts detected first with "(detected)" label. Returns agent string. */
|
|
210
|
+
async function promptPackageManager(projectDir) {
|
|
211
|
+
const detected = resolvePackageManager(projectDir, process.cwd());
|
|
212
|
+
const agents = ['npm', 'pnpm', 'yarn', 'bun'];
|
|
213
|
+
const options = agents.map((a) => ({
|
|
214
|
+
value: a,
|
|
215
|
+
label: a === detected.agent ? a + ' (detected)' : a,
|
|
216
|
+
}));
|
|
217
|
+
return selectMenu(options, '? Package manager (for install and run commands)');
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Prompt user to select template for the chosen framework. Returns template value (full or minimal for Vanilla; minimal for Astro/Svelte). */
|
|
221
|
+
async function promptTemplate(framework) {
|
|
222
|
+
const options = TEMPLATES[framework] || TEMPLATES.vanilla;
|
|
223
|
+
return selectMenu(options, '? Template');
|
|
224
|
+
}
|
|
225
|
+
|
|
70
226
|
function question(prompt) {
|
|
71
227
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
72
228
|
return new Promise((resolve) => {
|
|
@@ -339,29 +495,57 @@ function multiSelectMenu(options, title) {
|
|
|
339
495
|
|
|
340
496
|
function printHelp() {
|
|
341
497
|
console.log(`
|
|
342
|
-
rizzo-css CLI — Add Rizzo CSS to your project
|
|
498
|
+
rizzo-css CLI — Add Rizzo CSS to your project (Vanilla, Astro, Svelte)
|
|
343
499
|
|
|
344
|
-
Usage:
|
|
500
|
+
Usage (use your package manager):
|
|
345
501
|
npx rizzo-css <command> [options]
|
|
502
|
+
pnpm dlx rizzo-css <command> [options]
|
|
503
|
+
yarn dlx rizzo-css <command> [options]
|
|
504
|
+
bunx rizzo-css <command> [options]
|
|
346
505
|
|
|
347
506
|
Commands:
|
|
348
|
-
init
|
|
349
|
-
add
|
|
507
|
+
init New project = template (or no template → hand-pick components). Existing = drop in CSS + hand-pick. First: framework, then existing vs new.
|
|
508
|
+
add Same as init → existing: drop in CSS + hand-pick components (framework detected or from rizzo-css.json)
|
|
350
509
|
theme List all available themes (use in init or set data-theme on <html>)
|
|
351
510
|
help Show this help
|
|
352
511
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
512
|
+
Options (init):
|
|
513
|
+
--yes Non-interactive: scaffold new in cwd with defaults (framework: astro, template: minimal)
|
|
514
|
+
--framework <fw> vanilla | astro | svelte (with --yes; otherwise first prompt)
|
|
515
|
+
--template <t> full | minimal (Vanilla); minimal only (Astro/Svelte); with --yes defaults to full or minimal
|
|
516
|
+
--install After scaffolding, run package manager install (new project)
|
|
517
|
+
--no-install Do not run install
|
|
518
|
+
--write-config Write rizzo-css.json (targetDir, framework, packageManager) in the project
|
|
519
|
+
|
|
520
|
+
Options (add):
|
|
521
|
+
--path <dir> Target directory for rizzo.min.css (overrides config and framework default)
|
|
522
|
+
--framework <fw> vanilla | astro | svelte (overrides config and detection)
|
|
523
|
+
--install-package After copying CSS, run package manager add rizzo-css
|
|
524
|
+
--no-install Do not run install or add (overrides --install-package)
|
|
525
|
+
|
|
526
|
+
Config:
|
|
527
|
+
Optional rizzo-css.json in project root: { "targetDir", "framework", "packageManager" }.
|
|
528
|
+
Used by add and init when present. Detection: lockfiles and packageManager field in package.json.
|
|
529
|
+
|
|
530
|
+
Use framework CLI first, then add Rizzo CSS (match your package manager):
|
|
531
|
+
For Vanilla: npx rizzo-css init --yes --framework vanilla
|
|
532
|
+
npm create svelte@latest my-app && cd my-app && npx rizzo-css add
|
|
533
|
+
pnpm dlx create-svelte@latest my-app && cd my-app && pnpm dlx rizzo-css add
|
|
534
|
+
yarn create svelte my-app && cd my-app && yarn dlx rizzo-css add
|
|
535
|
+
bun create svelte my-app && cd my-app && bunx rizzo-css add
|
|
536
|
+
npm create astro@latest my-app && cd my-app && npx rizzo-css add
|
|
537
|
+
pnpm dlx create-astro@latest my-app && cd my-app && pnpm dlx rizzo-css add
|
|
538
|
+
yarn create astro my-app && cd my-app && yarn dlx rizzo-css add
|
|
539
|
+
bun create astro my-app && cd my-app && bunx rizzo-css add
|
|
359
540
|
|
|
360
541
|
Examples:
|
|
361
542
|
npx rizzo-css init
|
|
543
|
+
npx rizzo-css init --yes --framework astro --install --write-config
|
|
544
|
+
npx rizzo-css init --yes --framework vanilla
|
|
545
|
+
npx rizzo-css init --yes --framework svelte --template minimal
|
|
362
546
|
npx rizzo-css add
|
|
363
|
-
npx rizzo-css add --
|
|
364
|
-
npx rizzo-css add --framework svelte
|
|
547
|
+
npx rizzo-css add --install-package
|
|
548
|
+
npx rizzo-css add --path public/css --framework svelte
|
|
365
549
|
npx rizzo-css theme
|
|
366
550
|
|
|
367
551
|
Docs: https://rizzo-css.vercel.app
|
|
@@ -462,45 +646,27 @@ function getLinkHrefForTargetDir(framework, targetDir) {
|
|
|
462
646
|
return base ? base + '/' + file : file;
|
|
463
647
|
}
|
|
464
648
|
|
|
465
|
-
function cmdAdd(argv) {
|
|
466
|
-
const
|
|
467
|
-
const
|
|
468
|
-
const
|
|
469
|
-
const
|
|
470
|
-
const
|
|
471
|
-
const framework = explicitFramework && FRAMEWORKS.includes(explicitFramework)
|
|
472
|
-
? explicitFramework
|
|
473
|
-
: (explicitFramework === null ? detectFramework(cwd) : null);
|
|
474
|
-
const paths = getFrameworkCssPaths(framework);
|
|
475
|
-
const targetDir = customPath || paths.targetDir;
|
|
476
|
-
const targetFile = join(cwd, targetDir, 'rizzo.min.css');
|
|
477
|
-
const cssSource = getCssPath();
|
|
649
|
+
async function cmdAdd(argv) {
|
|
650
|
+
const customPath = getFlagValue(argv, '--path');
|
|
651
|
+
const explicitFrameworkRaw = getFlagValue(argv, '--framework');
|
|
652
|
+
const explicitFramework = explicitFrameworkRaw && FRAMEWORKS.includes(explicitFrameworkRaw.toLowerCase()) ? explicitFrameworkRaw.toLowerCase() : null;
|
|
653
|
+
const installPackage = hasFlag(argv, '--install-package');
|
|
654
|
+
const noInstall = hasFlag(argv, '--no-install');
|
|
478
655
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
console.log('\nTo add Rizzo Svelte components later: copy from this package\'s scaffold or run npx rizzo-css init and pick Svelte + components in an empty folder, then copy the generated files.\n');
|
|
493
|
-
} else if (framework === 'astro') {
|
|
494
|
-
console.log('\nDetected Astro. Add to your layout (e.g. src/layouts/Layout.astro):\n');
|
|
495
|
-
console.log(' <link rel="stylesheet" href="' + linkHref + '" />');
|
|
496
|
-
console.log('\nSet a theme on <html>: data-theme="github-dark-classic" (see: npx rizzo-css theme)\n');
|
|
497
|
-
} else {
|
|
498
|
-
console.log('\nAdd to your HTML or layout:\n');
|
|
499
|
-
console.log(' <link rel="stylesheet" href="' + linkHref + '" />');
|
|
500
|
-
if (framework === 'vanilla') {
|
|
501
|
-
console.log('\nVanilla JS: same CSS and component classes as Astro/Svelte. Use the same BEM markup from the docs.');
|
|
656
|
+
const cwd = process.cwd();
|
|
657
|
+
const config = readRizzoConfig(cwd);
|
|
658
|
+
const options = { config, targetDir: customPath || (config && config.targetDir) || undefined };
|
|
659
|
+
await runAddToExisting(explicitFramework, options);
|
|
660
|
+
if (installPackage && !noInstall) {
|
|
661
|
+
const pm = (config && config.packageManager)
|
|
662
|
+
? getPackageManagerCommands({ agent: config.packageManager, command: config.packageManager })
|
|
663
|
+
: resolvePackageManager(cwd);
|
|
664
|
+
const addPkg = pm.add('rizzo-css');
|
|
665
|
+
console.log('\nRunning: ' + addPkg);
|
|
666
|
+
const code = runInDir(cwd, addPkg);
|
|
667
|
+
if (code !== 0) {
|
|
668
|
+
console.error('\nInstall failed (exit ' + code + '). You can run manually: ' + addPkg);
|
|
502
669
|
}
|
|
503
|
-
console.log('\nSet a theme on <html>: data-theme="github-dark-classic" (see: npx rizzo-css theme)\n');
|
|
504
670
|
}
|
|
505
671
|
}
|
|
506
672
|
|
|
@@ -543,12 +709,12 @@ function copyRizzoIcons(projectDir, framework) {
|
|
|
543
709
|
}
|
|
544
710
|
}
|
|
545
711
|
|
|
546
|
-
function
|
|
547
|
-
return join(getPackageRoot(), 'scaffold', 'astro-
|
|
712
|
+
function getScaffoldAstroMinimalDir() {
|
|
713
|
+
return join(getPackageRoot(), 'scaffold', 'astro-minimal');
|
|
548
714
|
}
|
|
549
715
|
|
|
550
|
-
function
|
|
551
|
-
return join(getPackageRoot(), 'scaffold', 'svelte-
|
|
716
|
+
function getScaffoldSvelteMinimalDir() {
|
|
717
|
+
return join(getPackageRoot(), 'scaffold', 'svelte-minimal');
|
|
552
718
|
}
|
|
553
719
|
|
|
554
720
|
function copyDirRecursive(src, dest) {
|
|
@@ -670,10 +836,11 @@ function copyAstroComponents(projectDir, selectedNames) {
|
|
|
670
836
|
}
|
|
671
837
|
}
|
|
672
838
|
|
|
673
|
-
/** Add Rizzo CSS
|
|
674
|
-
async function runAddToExisting(frameworkOverride) {
|
|
839
|
+
/** Add Rizzo CSS and hand-picked components to an existing project in cwd. frameworkOverride: when set (from init), skip framework prompt. options: { config?, targetDir? }. */
|
|
840
|
+
async function runAddToExisting(frameworkOverride, options) {
|
|
675
841
|
const cwd = process.cwd();
|
|
676
|
-
|
|
842
|
+
const config = (options && options.config) || readRizzoConfig(cwd);
|
|
843
|
+
let framework = frameworkOverride || (config && config.framework);
|
|
677
844
|
if (framework == null) {
|
|
678
845
|
const detected = detectFramework(cwd);
|
|
679
846
|
const frameworkOptions = [
|
|
@@ -726,7 +893,8 @@ async function runAddToExisting(frameworkOverride) {
|
|
|
726
893
|
}
|
|
727
894
|
|
|
728
895
|
const paths = getFrameworkCssPaths(framework);
|
|
729
|
-
const
|
|
896
|
+
const targetDirRaw = (options && options.targetDir) || (config && config.targetDir) || paths.targetDir;
|
|
897
|
+
const targetDir = join(cwd, targetDirRaw);
|
|
730
898
|
const cssTarget = join(targetDir, 'rizzo.min.css');
|
|
731
899
|
mkdirSync(targetDir, { recursive: true });
|
|
732
900
|
copyFileSync(cssSource, cssTarget);
|
|
@@ -738,14 +906,18 @@ async function runAddToExisting(frameworkOverride) {
|
|
|
738
906
|
copyAstroComponents(cwd, selectedComponents);
|
|
739
907
|
}
|
|
740
908
|
|
|
741
|
-
const linkHref = paths.linkHref;
|
|
909
|
+
const linkHref = (options && options.targetDir) ? getLinkHrefForTargetDir(framework, options.targetDir) : paths.linkHref;
|
|
910
|
+
const pm = (config && config.packageManager)
|
|
911
|
+
? getPackageManagerCommands({ agent: config.packageManager, command: config.packageManager })
|
|
912
|
+
: resolvePackageManager(cwd);
|
|
913
|
+
const cliExample = pm.dlx('rizzo-css theme');
|
|
742
914
|
console.log('\n✓ Rizzo CSS added to your existing project');
|
|
743
915
|
console.log(' - ' + cssTarget);
|
|
744
916
|
console.log('\nYou must add the stylesheet link yourself — it is not added automatically.');
|
|
745
917
|
if (framework === 'svelte') {
|
|
746
918
|
console.log('\nIn your root layout (e.g. src/app.html), add:');
|
|
747
919
|
console.log(' <link rel="stylesheet" href="' + linkHref + '" />');
|
|
748
|
-
console.log('\nSet a theme on <html>: data-theme="' + theme + '" (see:
|
|
920
|
+
console.log('\nSet a theme on <html>: data-theme="' + theme + '" (see: ' + cliExample + ')');
|
|
749
921
|
console.log(' For theme "system": default dark ' + defaultDark + ', default light ' + defaultLight);
|
|
750
922
|
if (selectedComponents.length > 0) {
|
|
751
923
|
console.log(' Components are in src/lib/rizzo — import from \'$lib/rizzo\'.');
|
|
@@ -753,7 +925,7 @@ async function runAddToExisting(frameworkOverride) {
|
|
|
753
925
|
} else if (framework === 'astro') {
|
|
754
926
|
console.log('\nIn your layout (e.g. src/layouts/Layout.astro), add:');
|
|
755
927
|
console.log(' <link rel="stylesheet" href="' + linkHref + '" />');
|
|
756
|
-
console.log('\nSet a theme on <html>: data-theme="' + theme + '" (see:
|
|
928
|
+
console.log('\nSet a theme on <html>: data-theme="' + theme + '" (see: ' + cliExample + ')');
|
|
757
929
|
console.log(' For theme "system": default dark ' + defaultDark + ', default light ' + defaultLight);
|
|
758
930
|
if (selectedComponents.length > 0) {
|
|
759
931
|
console.log(' Components are in src/components/rizzo — import from there.');
|
|
@@ -761,52 +933,120 @@ async function runAddToExisting(frameworkOverride) {
|
|
|
761
933
|
} else {
|
|
762
934
|
console.log('\nIn your HTML or layout, add:');
|
|
763
935
|
console.log(' <link rel="stylesheet" href="' + linkHref + '" />');
|
|
764
|
-
console.log('\nSet a theme on <html>: data-theme="' + theme + '" (see:
|
|
936
|
+
console.log('\nSet a theme on <html>: data-theme="' + theme + '" (see: ' + cliExample + ')');
|
|
765
937
|
console.log(' For theme "system": default dark ' + defaultDark + ', default light ' + defaultLight);
|
|
766
938
|
}
|
|
939
|
+
console.log('\nTo install the package (CLI + components): ' + pm.add('rizzo-css'));
|
|
767
940
|
console.log('\nDocs: https://rizzo-css.vercel.app\n');
|
|
768
941
|
}
|
|
769
942
|
|
|
770
|
-
async function cmdInit() {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
);
|
|
943
|
+
async function cmdInit(argv) {
|
|
944
|
+
argv = argv || [];
|
|
945
|
+
const yes = hasFlag(argv, '--yes');
|
|
946
|
+
const runInstallAfterScaffold = hasFlag(argv, '--install');
|
|
947
|
+
const noInstall = hasFlag(argv, '--no-install');
|
|
948
|
+
const writeConfig = hasFlag(argv, '--write-config');
|
|
949
|
+
const cwd = process.cwd();
|
|
950
|
+
const config = readRizzoConfig(cwd);
|
|
779
951
|
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
952
|
+
let framework;
|
|
953
|
+
let initMode;
|
|
954
|
+
let name = '';
|
|
955
|
+
let theme, defaultDark, defaultLight;
|
|
956
|
+
let selectedPm;
|
|
957
|
+
let selectedTemplate;
|
|
958
|
+
let selectedComponents = [];
|
|
959
|
+
|
|
960
|
+
if (yes) {
|
|
961
|
+
const frameworkArg = getFlagValue(argv, '--framework');
|
|
962
|
+
framework = (frameworkArg && FRAMEWORKS.includes(frameworkArg.toLowerCase())) ? frameworkArg.toLowerCase() : (config && config.framework) || 'astro';
|
|
963
|
+
initMode = 'new';
|
|
964
|
+
const templateArg = getFlagValue(argv, '--template');
|
|
965
|
+
const rawTemplate = (templateArg && (templateArg === 'full' || templateArg === 'minimal')) ? templateArg : (framework === 'vanilla' ? 'full' : 'minimal');
|
|
966
|
+
selectedTemplate = rawTemplate;
|
|
967
|
+
const projectDir = cwd;
|
|
968
|
+
const resolved = resolvePackageManager(projectDir, cwd);
|
|
969
|
+
selectedPm = (config && config.packageManager) || resolved.agent || 'npm';
|
|
970
|
+
theme = 'system';
|
|
971
|
+
defaultDark = DARK_THEMES[0];
|
|
972
|
+
defaultLight = LIGHT_THEMES[0];
|
|
973
|
+
} else {
|
|
974
|
+
framework = await selectMenu(
|
|
975
|
+
[
|
|
976
|
+
{ value: 'vanilla', label: 'Vanilla JS (HTML + CSS + same styles & components)', color: C.vanilla },
|
|
977
|
+
{ value: 'astro', label: 'Astro', color: C.astro },
|
|
978
|
+
{ value: 'svelte', label: 'Svelte', color: C.svelte },
|
|
979
|
+
],
|
|
980
|
+
'? Framework — all get the same CSS and component styles'
|
|
981
|
+
);
|
|
787
982
|
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
983
|
+
initMode = await selectMenu(
|
|
984
|
+
[
|
|
985
|
+
{ value: 'existing', label: 'Add to existing project (current directory)' },
|
|
986
|
+
{ value: 'new', label: 'Create new project (scaffold)' },
|
|
987
|
+
],
|
|
988
|
+
'? Add to existing project or create a new one?'
|
|
989
|
+
);
|
|
792
990
|
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
991
|
+
if (initMode === 'existing') {
|
|
992
|
+
await runAddToExisting(framework, { config });
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
const projectChoice = await selectMenu(
|
|
997
|
+
[
|
|
998
|
+
{ value: 'cwd', label: 'Current directory' },
|
|
999
|
+
{ value: 'name', label: 'Enter project name (new folder)' },
|
|
1000
|
+
],
|
|
1001
|
+
'? Project location'
|
|
1002
|
+
);
|
|
1003
|
+
name = projectChoice === 'name' ? await question('Project name (folder name): ') : '';
|
|
801
1004
|
|
|
802
|
-
|
|
1005
|
+
const templateOrHandpick = await selectMenu(
|
|
1006
|
+
[
|
|
1007
|
+
{ value: 'template', label: 'Use a template (Full or Minimal — ready-made scaffold)' },
|
|
1008
|
+
{ value: 'handpick', label: 'No template — minimal base + hand-pick components' },
|
|
1009
|
+
],
|
|
1010
|
+
'? Template or hand-pick components?'
|
|
1011
|
+
);
|
|
803
1012
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
1013
|
+
if (templateOrHandpick === 'template') {
|
|
1014
|
+
selectedTemplate = await promptTemplate(framework);
|
|
1015
|
+
const templateHasThemeSwitcher = framework === 'vanilla' && selectedTemplate === 'full';
|
|
1016
|
+
if (templateHasThemeSwitcher) {
|
|
1017
|
+
const themeOut = await promptThemes();
|
|
1018
|
+
theme = themeOut.theme;
|
|
1019
|
+
defaultDark = themeOut.defaultDark;
|
|
1020
|
+
defaultLight = themeOut.defaultLight;
|
|
1021
|
+
} else {
|
|
1022
|
+
theme = 'system';
|
|
1023
|
+
defaultDark = DARK_THEMES[0];
|
|
1024
|
+
defaultLight = LIGHT_THEMES[0];
|
|
1025
|
+
}
|
|
1026
|
+
} else {
|
|
1027
|
+
selectedTemplate = 'handpick';
|
|
1028
|
+
const componentList = framework === 'svelte' ? SVELTE_COMPONENTS : framework === 'astro' ? ASTRO_COMPONENTS : [];
|
|
1029
|
+
selectedComponents = componentList.length > 0
|
|
1030
|
+
? await promptComponentChoice(componentList, framework)
|
|
1031
|
+
: [];
|
|
1032
|
+
const wantsThemeSwitcher = selectedComponents.includes('ThemeSwitcher');
|
|
1033
|
+
if (wantsThemeSwitcher) {
|
|
1034
|
+
const themeOut = await promptThemes();
|
|
1035
|
+
theme = themeOut.theme;
|
|
1036
|
+
defaultDark = themeOut.defaultDark;
|
|
1037
|
+
defaultLight = themeOut.defaultLight;
|
|
1038
|
+
} else {
|
|
1039
|
+
theme = 'system';
|
|
1040
|
+
defaultDark = DARK_THEMES[0];
|
|
1041
|
+
defaultLight = LIGHT_THEMES[0];
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
808
1044
|
|
|
809
|
-
|
|
1045
|
+
const projectDirForPm = name ? join(cwd, name) : cwd;
|
|
1046
|
+
selectedPm = await promptPackageManager(projectDirForPm);
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
const projectDir = name ? join(cwd, name) : cwd;
|
|
810
1050
|
const cssSource = getCssPath();
|
|
811
1051
|
|
|
812
1052
|
if (!existsSync(cssSource)) {
|
|
@@ -827,119 +1067,185 @@ async function cmdInit() {
|
|
|
827
1067
|
'{{PROJECT_NAME}}': projectNamePkg,
|
|
828
1068
|
};
|
|
829
1069
|
|
|
830
|
-
const
|
|
831
|
-
const
|
|
1070
|
+
const astroMinimalDir = getScaffoldAstroMinimalDir();
|
|
1071
|
+
const svelteMinimalDir = getScaffoldSvelteMinimalDir();
|
|
1072
|
+
const pathsForScaffold = getFrameworkCssPaths(framework);
|
|
1073
|
+
const useHandpickAstro = selectedTemplate === 'handpick' && framework === 'astro' && existsSync(astroMinimalDir);
|
|
1074
|
+
const useHandpickSvelte = selectedTemplate === 'handpick' && framework === 'svelte' && existsSync(svelteMinimalDir);
|
|
1075
|
+
const useAstroMinimal = framework === 'astro' && selectedTemplate === 'minimal' && existsSync(astroMinimalDir);
|
|
1076
|
+
const useSvelteMinimal = framework === 'svelte' && selectedTemplate === 'minimal' && existsSync(svelteMinimalDir);
|
|
1077
|
+
const useVanillaFull = framework === 'vanilla' && selectedTemplate === 'full' && existsSync(getScaffoldVanillaIndex());
|
|
832
1078
|
|
|
833
1079
|
let cssTarget;
|
|
834
1080
|
let indexPath;
|
|
835
1081
|
|
|
836
|
-
|
|
1082
|
+
const minimalHtml = `<!DOCTYPE html>
|
|
1083
|
+
<html lang="en" data-theme="${theme}">${themeComment}
|
|
1084
|
+
<head>
|
|
1085
|
+
<meta charset="UTF-8" />
|
|
1086
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
1087
|
+
<title>${name || 'App'}</title>
|
|
1088
|
+
<link rel="stylesheet" href="${framework === 'vanilla' ? 'css/rizzo.min.css' : '/css/rizzo.min.css'}" />
|
|
1089
|
+
</head>
|
|
1090
|
+
<body>
|
|
1091
|
+
<h1>Hello, Rizzo CSS</h1>
|
|
1092
|
+
<p>Edit this file and add components. Docs: <a href="https://rizzo-css.vercel.app">rizzo-css.vercel.app</a></p>
|
|
1093
|
+
</body>
|
|
1094
|
+
</html>
|
|
1095
|
+
`;
|
|
1096
|
+
|
|
1097
|
+
if (useHandpickAstro) {
|
|
837
1098
|
mkdirSync(projectDir, { recursive: true });
|
|
838
|
-
copyDirRecursiveWithReplacements(
|
|
1099
|
+
copyDirRecursiveWithReplacements(astroMinimalDir, projectDir, replacements);
|
|
839
1100
|
mkdirSync(join(projectDir, 'public', 'css'), { recursive: true });
|
|
840
1101
|
cssTarget = join(projectDir, 'public', 'css', 'rizzo.min.css');
|
|
841
1102
|
copyFileSync(cssSource, cssTarget);
|
|
842
1103
|
if (statSync(cssTarget).size < 5000) {
|
|
843
1104
|
console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
|
|
844
1105
|
}
|
|
845
|
-
|
|
1106
|
+
copyPackageLicense(projectDir);
|
|
846
1107
|
if (selectedComponents.length > 0) {
|
|
1108
|
+
copyRizzoIcons(projectDir, 'astro');
|
|
847
1109
|
copyAstroComponents(projectDir, selectedComponents);
|
|
848
1110
|
}
|
|
849
|
-
} else if (
|
|
1111
|
+
} else if (useHandpickSvelte) {
|
|
850
1112
|
mkdirSync(projectDir, { recursive: true });
|
|
851
|
-
copyDirRecursiveWithReplacements(
|
|
1113
|
+
copyDirRecursiveWithReplacements(svelteMinimalDir, projectDir, replacements);
|
|
852
1114
|
mkdirSync(join(projectDir, 'static', 'css'), { recursive: true });
|
|
853
1115
|
cssTarget = join(projectDir, 'static', 'css', 'rizzo.min.css');
|
|
854
1116
|
copyFileSync(cssSource, cssTarget);
|
|
855
1117
|
if (statSync(cssTarget).size < 5000) {
|
|
856
1118
|
console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
|
|
857
1119
|
}
|
|
858
|
-
|
|
1120
|
+
copyPackageLicense(projectDir);
|
|
859
1121
|
if (selectedComponents.length > 0) {
|
|
1122
|
+
copyRizzoIcons(projectDir, 'svelte');
|
|
860
1123
|
copySvelteComponents(projectDir, selectedComponents);
|
|
861
1124
|
}
|
|
862
|
-
} else {
|
|
863
|
-
|
|
1125
|
+
} else if (useAstroMinimal) {
|
|
1126
|
+
mkdirSync(projectDir, { recursive: true });
|
|
1127
|
+
copyDirRecursiveWithReplacements(astroMinimalDir, projectDir, replacements);
|
|
1128
|
+
mkdirSync(join(projectDir, 'public', 'css'), { recursive: true });
|
|
1129
|
+
cssTarget = join(projectDir, 'public', 'css', 'rizzo.min.css');
|
|
1130
|
+
copyFileSync(cssSource, cssTarget);
|
|
1131
|
+
if (statSync(cssTarget).size < 5000) {
|
|
1132
|
+
console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
|
|
1133
|
+
}
|
|
1134
|
+
copyPackageLicense(projectDir);
|
|
1135
|
+
} else if (useSvelteMinimal) {
|
|
1136
|
+
mkdirSync(projectDir, { recursive: true });
|
|
1137
|
+
copyDirRecursiveWithReplacements(svelteMinimalDir, projectDir, replacements);
|
|
1138
|
+
mkdirSync(join(projectDir, 'static', 'css'), { recursive: true });
|
|
1139
|
+
cssTarget = join(projectDir, 'static', 'css', 'rizzo.min.css');
|
|
1140
|
+
copyFileSync(cssSource, cssTarget);
|
|
1141
|
+
if (statSync(cssTarget).size < 5000) {
|
|
1142
|
+
console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
|
|
1143
|
+
}
|
|
1144
|
+
copyPackageLicense(projectDir);
|
|
1145
|
+
} else if (useVanillaFull) {
|
|
1146
|
+
const cssDir = join(projectDir, pathsForScaffold.targetDir);
|
|
864
1147
|
cssTarget = join(cssDir, 'rizzo.min.css');
|
|
865
|
-
const linkHref =
|
|
1148
|
+
const linkHref = 'css/rizzo.min.css';
|
|
866
1149
|
mkdirSync(cssDir, { recursive: true });
|
|
867
1150
|
copyFileSync(cssSource, cssTarget);
|
|
868
1151
|
if (statSync(cssTarget).size < 5000) {
|
|
869
1152
|
console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
|
|
870
1153
|
}
|
|
871
|
-
|
|
872
1154
|
const vanillaScaffoldPath = getScaffoldVanillaIndex();
|
|
873
1155
|
indexPath = join(projectDir, 'index.html');
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
<head>
|
|
888
|
-
<meta charset="UTF-8" />
|
|
889
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
890
|
-
<title>${name || 'App'}</title>
|
|
891
|
-
<link rel="stylesheet" href="${linkHref}" />
|
|
892
|
-
</head>
|
|
893
|
-
<body>
|
|
894
|
-
<h1>Hello, Rizzo CSS</h1>
|
|
895
|
-
<p>Edit this file and add components. Docs: <a href="https://rizzo-css.vercel.app">rizzo-css.vercel.app</a></p>
|
|
896
|
-
</body>
|
|
897
|
-
</html>
|
|
898
|
-
`;
|
|
899
|
-
writeFileSync(indexPath, indexHtml, 'utf8');
|
|
1156
|
+
let indexHtml = readFileSync(vanillaScaffoldPath, 'utf8');
|
|
1157
|
+
indexHtml = indexHtml
|
|
1158
|
+
.replace(/\{\{DATA_THEME\}\}/g, theme)
|
|
1159
|
+
.replace(/\{\{DEFAULT_DARK\}\}/g, defaultDark)
|
|
1160
|
+
.replace(/\{\{DEFAULT_LIGHT\}\}/g, defaultLight)
|
|
1161
|
+
.replace(/\{\{THEME_LIST_COMMENT\}\}/g, themeComment)
|
|
1162
|
+
.replace(/\{\{TITLE\}\}/g, name || 'App')
|
|
1163
|
+
.replace(/\{\{LINK_HREF\}\}/g, linkHref);
|
|
1164
|
+
writeFileSync(indexPath, indexHtml, 'utf8');
|
|
1165
|
+
copyRizzoIcons(projectDir, 'vanilla');
|
|
1166
|
+
const vanillaReadme = join(getPackageRoot(), 'scaffold', 'vanilla', 'README.md');
|
|
1167
|
+
if (existsSync(vanillaReadme)) {
|
|
1168
|
+
copyFileSync(vanillaReadme, join(projectDir, 'README.md'));
|
|
900
1169
|
}
|
|
901
|
-
|
|
902
|
-
if (
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
const vanillaJs = join(getPackageRoot(), 'scaffold', 'vanilla', 'js', 'main.js');
|
|
908
|
-
if (existsSync(vanillaJs)) {
|
|
909
|
-
mkdirSync(join(projectDir, 'js'), { recursive: true });
|
|
910
|
-
let mainJs = readFileSync(vanillaJs, 'utf8');
|
|
911
|
-
mainJs = mainJs.replace(/\{\{DEFAULT_DARK\}\}/g, defaultDark).replace(/\{\{DEFAULT_LIGHT\}\}/g, defaultLight);
|
|
912
|
-
writeFileSync(join(projectDir, 'js', 'main.js'), mainJs, 'utf8');
|
|
913
|
-
}
|
|
1170
|
+
const vanillaJs = join(getPackageRoot(), 'scaffold', 'vanilla', 'js', 'main.js');
|
|
1171
|
+
if (existsSync(vanillaJs)) {
|
|
1172
|
+
mkdirSync(join(projectDir, 'js'), { recursive: true });
|
|
1173
|
+
let mainJs = readFileSync(vanillaJs, 'utf8');
|
|
1174
|
+
mainJs = mainJs.replace(/\{\{DEFAULT_DARK\}\}/g, defaultDark).replace(/\{\{DEFAULT_LIGHT\}\}/g, defaultLight);
|
|
1175
|
+
writeFileSync(join(projectDir, 'js', 'main.js'), mainJs, 'utf8');
|
|
914
1176
|
}
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
1177
|
+
copyPackageLicense(projectDir);
|
|
1178
|
+
} else {
|
|
1179
|
+
const cssDir = join(projectDir, pathsForScaffold.targetDir);
|
|
1180
|
+
cssTarget = join(cssDir, 'rizzo.min.css');
|
|
1181
|
+
mkdirSync(cssDir, { recursive: true });
|
|
1182
|
+
copyFileSync(cssSource, cssTarget);
|
|
1183
|
+
if (statSync(cssTarget).size < 5000) {
|
|
1184
|
+
console.warn('\nWarning: rizzo.min.css is very small. From repo root run: pnpm build:css');
|
|
919
1185
|
}
|
|
1186
|
+
if (framework === 'vanilla') {
|
|
1187
|
+
indexPath = join(projectDir, 'index.html');
|
|
1188
|
+
writeFileSync(indexPath, minimalHtml, 'utf8');
|
|
1189
|
+
writeFileSync(join(projectDir, 'README.md'), VANILLA_MINIMAL_README, 'utf8');
|
|
1190
|
+
} else if (framework === 'astro') {
|
|
1191
|
+
indexPath = join(projectDir, 'public', 'index.html');
|
|
1192
|
+
mkdirSync(join(projectDir, 'public'), { recursive: true });
|
|
1193
|
+
writeFileSync(indexPath, minimalHtml, 'utf8');
|
|
1194
|
+
writeFileSync(join(projectDir, 'README.md'), FALLBACK_MINIMAL_README, 'utf8');
|
|
1195
|
+
} else {
|
|
1196
|
+
indexPath = join(projectDir, 'static', 'index.html');
|
|
1197
|
+
mkdirSync(join(projectDir, 'static'), { recursive: true });
|
|
1198
|
+
writeFileSync(indexPath, minimalHtml, 'utf8');
|
|
1199
|
+
writeFileSync(join(projectDir, 'README.md'), FALLBACK_MINIMAL_README, 'utf8');
|
|
1200
|
+
}
|
|
1201
|
+
copyPackageLicense(projectDir);
|
|
920
1202
|
}
|
|
921
1203
|
|
|
922
1204
|
console.log('\n✓ Project ready at ' + projectDir);
|
|
923
1205
|
console.log(' - ' + cssTarget);
|
|
924
1206
|
if (indexPath) console.log(' - ' + indexPath);
|
|
925
1207
|
if (framework === 'vanilla') {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
1208
|
+
if (useVanillaFull) {
|
|
1209
|
+
console.log(' - Vanilla JS (full): theme switcher, js/main.js, icons, README.');
|
|
1210
|
+
} else {
|
|
1211
|
+
console.log(' - Vanilla JS (minimal): index.html + CSS link. Open index.html in a browser or add your own app.');
|
|
1212
|
+
}
|
|
930
1213
|
}
|
|
1214
|
+
const pm = getPackageManagerCommands({ agent: selectedPm, command: selectedPm });
|
|
1215
|
+
const nextStep = pm.install + ' && ' + pm.run('dev');
|
|
931
1216
|
const runPrefix = name ? 'cd ' + name + ' && ' : '';
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
console.log('
|
|
1217
|
+
|
|
1218
|
+
if (runInstallAfterScaffold && !noInstall && (useHandpickAstro || useHandpickSvelte || useAstroMinimal || useSvelteMinimal)) {
|
|
1219
|
+
console.log('\nRunning: ' + pm.install);
|
|
1220
|
+
const code = runInDir(projectDir, pm.install);
|
|
1221
|
+
if (code !== 0) {
|
|
1222
|
+
console.error('\nInstall failed (exit ' + code + '). Run manually: ' + runPrefix + pm.install);
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
if (writeConfig) {
|
|
1227
|
+
const pathsForConfig = getFrameworkCssPaths(framework);
|
|
1228
|
+
writeRizzoConfig(projectDir, { targetDir: pathsForConfig.targetDir, framework, packageManager: selectedPm });
|
|
1229
|
+
console.log('\n - Wrote ' + RIZZO_CONFIG_FILE);
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
if (useHandpickAstro || useHandpickSvelte) {
|
|
1233
|
+
const fw = useHandpickAstro ? 'Astro' : 'SvelteKit';
|
|
1234
|
+
console.log(' - Minimal ' + fw + ' base + ' + selectedComponents.length + ' hand-picked component(s). Run: ' + runPrefix + nextStep);
|
|
935
1235
|
}
|
|
936
|
-
if (
|
|
937
|
-
console.log(' -
|
|
938
|
-
console.log(' - Install dependencies first (required before dev). Icons: src/lib/rizzo/icons/ (Svelte components)');
|
|
1236
|
+
if (useAstroMinimal) {
|
|
1237
|
+
console.log(' - Minimal Astro project (config, README, LICENSE, .env.example). Run: ' + runPrefix + nextStep);
|
|
939
1238
|
}
|
|
940
|
-
if (
|
|
1239
|
+
if (useSvelteMinimal) {
|
|
1240
|
+
console.log(' - Minimal SvelteKit project (config, README, LICENSE, .env.example). Run: ' + runPrefix + nextStep);
|
|
1241
|
+
}
|
|
1242
|
+
if (selectedTemplate === 'handpick' && framework === 'vanilla') {
|
|
1243
|
+
console.log(' - Vanilla minimal base (index.html + CSS, README, LICENSE). No component files for Vanilla; use BEM markup from docs.');
|
|
1244
|
+
}
|
|
1245
|
+
if ((framework === 'astro' || framework === 'svelte') && !useAstroMinimal && !useSvelteMinimal && !useHandpickAstro && !useHandpickSvelte) {
|
|
941
1246
|
const fw = framework === 'svelte' ? 'Svelte' : 'Astro';
|
|
942
|
-
|
|
1247
|
+
const createExample = getCreateProjectExample(pm, framework);
|
|
1248
|
+
console.log('\n - Minimal template (CSS + index). To get a full app: ' + createExample + ', then cd into the project and run ' + pm.dlx('rizzo-css add') + '.');
|
|
943
1249
|
}
|
|
944
1250
|
console.log('\nDocs: https://rizzo-css.vercel.app\n');
|
|
945
1251
|
}
|
|
@@ -962,12 +1268,15 @@ function main() {
|
|
|
962
1268
|
}
|
|
963
1269
|
|
|
964
1270
|
if (command === 'add') {
|
|
965
|
-
cmdAdd(argv)
|
|
1271
|
+
cmdAdd(argv).catch((err) => {
|
|
1272
|
+
console.error(err);
|
|
1273
|
+
process.exit(1);
|
|
1274
|
+
});
|
|
966
1275
|
return;
|
|
967
1276
|
}
|
|
968
1277
|
|
|
969
1278
|
if (command === 'init') {
|
|
970
|
-
cmdInit().catch((err) => {
|
|
1279
|
+
cmdInit(argv).catch((err) => {
|
|
971
1280
|
console.error(err);
|
|
972
1281
|
process.exit(1);
|
|
973
1282
|
});
|