@emberkit/cli 0.2.5 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -574,7 +574,8 @@ export async function create(options) {
574
574
  packageName: getNpmPackageName(name),
575
575
  kebabName: toKebabCase(name),
576
576
  };
577
- for (const [filePath, content] of Object.entries(starterFiles)) {
577
+ const templateFiles = templateId === "with-ui" ? withUiTemplate : starterFiles;
578
+ for (const [filePath, content] of Object.entries(templateFiles)) {
578
579
  const fullPath = join(targetDir, filePath);
579
580
  const dir = join(targetDir, filePath.split("/").slice(0, -1).join("/"));
580
581
  if (!existsSync(dir)) {
@@ -612,3 +613,318 @@ export async function create(options) {
612
613
  console.log(` ${DIM}To preview the build:${RESET}`);
613
614
  console.log(` ${BRIGHT_CYAN}emberkit preview${RESET}\n`);
614
615
  }
616
+ const withUiTemplate = {
617
+ "package.json": `{
618
+ "name": "{{name}}",
619
+ "version": "0.1.0",
620
+ "private": true,
621
+ "type": "module",
622
+ "scripts": {
623
+ "dev": "emberkit dev",
624
+ "build": "emberkit build",
625
+ "preview": "emberkit preview",
626
+ "lint": "eslint src --ext .ts,.tsx",
627
+ "format": "prettier --write \\"src/**/*.{ts,tsx}\\"",
628
+ "build:css": "tailwindcss -i ./src/styles.css -o ./dist/styles.css"
629
+ },
630
+ "dependencies": {
631
+ "@emberkit/core": "^0.2.4",
632
+ "@emberkit/ui": "^0.2.3"
633
+ },
634
+ "devDependencies": {
635
+ "@emberkit/cli": "^0.2.4",
636
+ "typescript": "^5.7.0",
637
+ "vite": "^6.0.0",
638
+ "tailwindcss": "^3.4.0",
639
+ "postcss": "^8.4.0",
640
+ "autoprefixer": "^10.4.0"
641
+ }
642
+ }`,
643
+ "tsconfig.json": `{
644
+ "compilerOptions": {
645
+ "target": "ES2022",
646
+ "module": "ESNext",
647
+ "moduleResolution": "bundler",
648
+ "jsx": "react-jsx",
649
+ "jsxImportSource": "@emberkit/core",
650
+ "strict": true,
651
+ "esModuleInterop": true,
652
+ "skipLibCheck": true,
653
+ "forceConsistentCasingInFileNames": true,
654
+ "resolveJsonModule": true,
655
+ "isolatedModules": true,
656
+ "noEmit": true,
657
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
658
+ "paths": {
659
+ "@/*": ["./src/*"]
660
+ }
661
+ },
662
+ "include": ["src"],
663
+ "exclude": ["node_modules", "dist"]
664
+ }`,
665
+ "tailwind.config.js": `/** @type {import('tailwindcss').Config} */
666
+ export default {
667
+ content: ['./src/**/*.{js,ts,jsx,tsx}', './index.html'],
668
+ theme: {
669
+ extend: {
670
+ colors: {
671
+ ember: {
672
+ 50: '#fff7ed',
673
+ 100: '#ffedd5',
674
+ 200: '#fed7aa',
675
+ 300: '#fdba74',
676
+ 400: '#fb923c',
677
+ 500: '#f97316',
678
+ 600: '#ea580c',
679
+ 700: '#c2410c',
680
+ 800: '#9a3412',
681
+ 900: '#7c2d12',
682
+ },
683
+ },
684
+ fontFamily: {
685
+ sans: ['Inter', 'system-ui', 'sans-serif'],
686
+ },
687
+ },
688
+ },
689
+ plugins: [],
690
+ };`,
691
+ "postcss.config.js": `export default {
692
+ plugins: {
693
+ tailwindcss: {},
694
+ autoprefixer: {},
695
+ },
696
+ };`,
697
+ "emberkit.config.ts": `import { defineConfig } from '@emberkit/core';
698
+
699
+ export default defineConfig({
700
+ mode: 'spa',
701
+ build: {
702
+ outDir: 'dist',
703
+ target: 'esnext',
704
+ },
705
+ });`,
706
+ "vite.config.ts": `import { defineConfig } from 'vite';
707
+ import { emberkitVitePlugin } from '@emberkit/core/vite-plugin';
708
+ import tailwindcss from '@tailwindcss/vite';
709
+
710
+ export default defineConfig({
711
+ plugins: [emberkitVitePlugin(), tailwindcss()],
712
+ server: {
713
+ port: 3000,
714
+ host: 'localhost',
715
+ },
716
+ esbuild: {
717
+ jsxImportSource: '@emberkit/core',
718
+ },
719
+ });`,
720
+ "index.html": `<!DOCTYPE html>
721
+ <html lang="en">
722
+ <head>
723
+ <meta charset="UTF-8">
724
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
725
+ <title>{{name}}</title>
726
+ <link rel="preconnect" href="https://fonts.googleapis.com">
727
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
728
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
729
+ <link href="/styles.css" rel="stylesheet">
730
+ </head>
731
+ <body>
732
+ <div id="app"></div>
733
+ <script type="module" src="/src/index.tsx"></script>
734
+ </body>
735
+ </html>`,
736
+ "src/index.tsx": `import { render } from '@emberkit/core';
737
+ import App from './routes/_layout';
738
+
739
+ const root = document.getElementById('app');
740
+
741
+ if (root) {
742
+ render(App, root);
743
+ }`,
744
+ "src/styles.css": `@import "tailwindcss";
745
+
746
+ :root {
747
+ --color-bg: #0f172a;
748
+ --color-bg-secondary: #1e293b;
749
+ --color-text: #e2e8f0;
750
+ --color-text-muted: #94a3b8;
751
+ --color-primary: #f97316;
752
+ --color-primary-hover: #ea580c;
753
+ --color-border: #334155;
754
+ }
755
+
756
+ body {
757
+ background-color: var(--color-bg);
758
+ color: var(--color-text);
759
+ font-family: 'Inter', system-ui, sans-serif;
760
+ }
761
+
762
+ a {
763
+ color: inherit;
764
+ text-decoration: none;
765
+ }`,
766
+ "src/routes/_layout.tsx": `import type { RouteComponent } from '@emberkit/core';
767
+ import { Head } from '@emberkit/core';
768
+ import { DefaultLayout } from '@emberkit/ui';
769
+
770
+ const Layout: RouteComponent = ({ children }) => {
771
+ return (
772
+ <>
773
+ <Head>
774
+ <title>{{name}}</title>
775
+ <meta name="description" content="Built with EmberKit UI" />
776
+ </Head>
777
+ <DefaultLayout
778
+ logo={<span className="text-ember-500 font-bold text-xl">🔥 {{name}}</span>}
779
+ navItems={[
780
+ { label: 'Home', href: '/' },
781
+ { label: 'About', href: '/about' },
782
+ { label: 'Docs', href: 'https://emberkit.dev/docs', external: true },
783
+ ]}
784
+ >
785
+ {children}
786
+ </DefaultLayout>
787
+ </>
788
+ );
789
+ };
790
+
791
+ export default Layout;`,
792
+ "src/routes/index.tsx": `import type { RouteComponent } from '@emberkit/core';
793
+ import { Button, Card, Heading, Text, Badge, Input } from '@emberkit/ui';
794
+ import { signal } from '@emberkit/core';
795
+
796
+ const HomePage: RouteComponent = () => {
797
+ const email = signal('');
798
+
799
+ return (
800
+ <div className="space-y-16">
801
+ <section className="text-center py-16">
802
+ <Heading level="h1" size="4xl" weight="bold" className="mb-4">
803
+ Welcome to <span className="text-ember-500">{{name}}</span>
804
+ </Heading>
805
+ <Text size="xl" color="muted" className="max-w-2xl mx-auto mb-8">
806
+ A modern starter template with EmberKit UI components and Tailwind CSS.
807
+ Build beautiful interfaces with our pre-built component library.
808
+ </Text>
809
+ <div className="flex gap-4 justify-center">
810
+ <Button variant="primary" size="lg">
811
+ Get Started
812
+ </Button>
813
+ <Button variant="secondary" size="lg">
814
+ View Docs
815
+ </Button>
816
+ </div>
817
+ </section>
818
+
819
+ <section>
820
+ <Heading level="h2" size="2xl" weight="semibold" className="mb-8 text-center">
821
+ UI Components
822
+ </Heading>
823
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-6">
824
+ <Card padding="lg">
825
+ <Badge variant="primary" size="sm" className="mb-2">Button</Badge>
826
+ <Heading level="h3" size="lg" weight="semibold" className="mb-2">
827
+ Button Variants
828
+ </Heading>
829
+ <Text color="muted" className="mb-4">
830
+ Primary, secondary, ghost, and more button styles.
831
+ </Text>
832
+ <div className="flex gap-2 flex-wrap">
833
+ <Button variant="primary">Primary</Button>
834
+ <Button variant="secondary">Secondary</Button>
835
+ <Button variant="ghost">Ghost</Button>
836
+ </div>
837
+ </Card>
838
+
839
+ <Card padding="lg">
840
+ <Badge variant="success" size="sm" className="mb-2">Cards</Badge>
841
+ <Heading level="h3" size="lg" weight="semibold" className="mb-2">
842
+ Card Component
843
+ </Heading>
844
+ <Text color="muted" className="mb-4">
845
+ Flexible card layout with padding variants.
846
+ </Text>
847
+ <Card padding="md" className="bg-slate-800">
848
+ <Text>Card content here</Text>
849
+ </Card>
850
+ </Card>
851
+
852
+ <Card padding="lg">
853
+ <Badge variant="info" size="sm" className="mb-2">Forms</Badge>
854
+ <Heading level="h3" size="lg" weight="semibold" className="mb-2">
855
+ Form Inputs
856
+ </Heading>
857
+ <Text color="muted" className="mb-4">
858
+ Styled input with label support.
859
+ </Text>
860
+ <Input
861
+ label="Email"
862
+ placeholder="Enter your email"
863
+ value={email.value}
864
+ onChange={(e) => { email.value = e.currentTarget.value; }}
865
+ />
866
+ </Card>
867
+ </div>
868
+ </section>
869
+
870
+ <section className="text-center py-16 bg-slate-800/50 rounded-xl">
871
+ <Heading level="h2" size="2xl" weight="semibold" className="mb-4">
872
+ Ready to get started?
873
+ </Heading>
874
+ <Text color="muted" className="max-w-xl mx-auto mb-6">
875
+ Install dependencies and start building your next project with EmberKit.
876
+ </Text>
877
+ <Button variant="primary" size="lg">
878
+ Create Project →
879
+ </Button>
880
+ </section>
881
+ </div>
882
+ );
883
+ };
884
+
885
+ export default HomePage;`,
886
+ "src/routes/about.tsx": `import type { RouteComponent } from '@emberkit/core';
887
+ import { Head } from '@emberkit/core';
888
+ import { Heading, Text, Button } from '@emberkit/ui';
889
+
890
+ const AboutPage: RouteComponent = () => {
891
+ return (
892
+ <div className="max-w-2xl mx-auto py-12">
893
+ <Head>
894
+ <title>About - {{name}}</title>
895
+ </Head>
896
+ <Heading level="h1" size="3xl" weight="bold" className="mb-6">
897
+ About {{name}}
898
+ </Heading>
899
+ <Text size="lg" color="muted" className="mb-8">
900
+ This project was created with EmberKit and the UI component library.
901
+ It demonstrates how to build modern, beautiful interfaces with our
902
+ pre-built components and Tailwind CSS.
903
+ </Text>
904
+ <div className="space-y-4">
905
+ <div className="flex items-center gap-3 p-4 bg-slate-800 rounded-lg">
906
+ <span className="text-ember-500 text-2xl">✓</span>
907
+ <Text>TypeScript-first development</Text>
908
+ </div>
909
+ <div className="flex items-center gap-3 p-4 bg-slate-800 rounded-lg">
910
+ <span className="text-ember-500 text-2xl">✓</span>
911
+ <Text>Pre-built UI components</Text>
912
+ </div>
913
+ <div className="flex items-center gap-3 p-4 bg-slate-800 rounded-lg">
914
+ <span className="text-ember-500 text-2xl">✓</span>
915
+ <Text>Tailwind CSS integration</Text>
916
+ </div>
917
+ <div className="flex items-center gap-3 p-4 bg-slate-800 rounded-lg">
918
+ <span className="text-ember-500 text-2xl">✓</span>
919
+ <Text>File-based routing</Text>
920
+ </div>
921
+ </div>
922
+ <div className="mt-8">
923
+ <Button variant="secondary">← Back to Home</Button>
924
+ </div>
925
+ </div>
926
+ );
927
+ };
928
+
929
+ export default AboutPage;`,
930
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emberkit/cli",
3
- "version": "0.2.5",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "CLI tool for EmberKit projects",