@thesquad-components/sqd-module-template 0.1.7 → 0.1.9

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 CHANGED
@@ -1,56 +1,138 @@
1
- # Untitled UI starter kit for Next.js
1
+ # SQD Module Template: Agent's Guide
2
2
 
3
- This is an official Untitled UI starter kit for Next.js. Kickstart your Untitled UI project with Next.js in seconds.
3
+ This guide shows how to clone the template, build any Untitled UI app, wire API routes, use Supabase in the API server, publish to npm, and consume the package elsewhere.
4
4
 
5
- ## Untitled UI React
5
+ NPM package: `https://www.npmjs.com/package/@thesquad-components/sqd-module-template`
6
6
 
7
- [Untitled UI React](https://www.untitledui.com/react) is the world’s largest collection of open-source React UI components. Everything you need to design and develop modern, beautiful interfaces—fast.
7
+ ## Rules (must follow)
8
8
 
9
- Built with React 19.1, Tailwind CSS v4.1, TypeScript 5.8, and React Aria, Untitled UI React components deliver modern performance, type safety, and maintainability.
9
+ - **UI assets:** Only use Untitled UI icons from `https://www.untitledui.com/resources/icons`.
10
+ - **UI components:** Only use Untitled UI React components from `https://www.untitledui.com/react/components`.
11
+ - **API calls:** All API calls must go through your **own Next.js API routes** (no direct calls from components).
12
+ - **Module key header:** Every outbound API request must include `x-sqd-module-key`.
13
+ - **Env vars:** Use the **existing** Vercel env vars (do not create new keys).
14
+ - **Supabase:** Use the **`@supabase/supabase-js`** library for all Supabase access.
10
15
 
11
- [Learn more](https://www.untitledui.com/react) [Documentation](https://www.untitledui.com/react/docs/introduction) [Figma](https://www.untitledui.com/figma) • [FAQs](https://www.untitledui.com/faqs)
16
+ ### Supabase example (API server route)
12
17
 
13
- ## Getting started
18
+ ```ts
19
+ import { createClient } from "@supabase/supabase-js";
14
20
 
15
- First, run the development server:
21
+ const supabase = createClient(
22
+ process.env.SUPABASE_URL!,
23
+ process.env.SUPABASE_SERVICE_ROLE_KEY!
24
+ );
25
+
26
+ // inside your route handler:
27
+ const { data, error } = await supabase.from("your_table").select("*");
28
+ ```
29
+
30
+ ---
31
+
32
+ ## Beginner Guide: Clone, Build, Publish, Use (with API + Supabase)
33
+
34
+ ### 1) Clone both repos
35
+
36
+ Single command (both at once):
37
+
38
+ ```bash
39
+ git clone https://github.com/sis-thesqd/sqd-module-template && git clone https://github.com/sis-thesqd/sqd-api-server
40
+ ```
41
+
42
+ Or two commands:
43
+
44
+ ```bash
45
+ git clone https://github.com/sis-thesqd/sqd-module-template
46
+ git clone https://github.com/sis-thesqd/sqd-api-server
47
+ ```
48
+
49
+ ### 2) Install dependencies (in the template repo)
50
+
51
+ ```bash
52
+ cd sqd-module-template
53
+ npm install
54
+ ```
55
+
56
+ ### 3) Rename the package
57
+
58
+ - Open `package.json`
59
+ - Set `name` to `@thesquad-components/your-app-name`
60
+ - Save
61
+
62
+ ### 4) Build your Untitled UI app
63
+
64
+ - Open `src`
65
+ - Replace starter components with your UI
66
+ - Keep exports consistent for imports later
67
+
68
+ ### 5) Create API routes for all API calls (module repo)
69
+
70
+ - Create files under `src/app/api/<your-route>/route.ts`
71
+ - Each route should call your backend (or any external API) and return JSON
72
+ - Always include `x-sqd-module-key` when calling outward
73
+
74
+ ### 6) Supabase setup for API server routes
75
+
76
+ Available env vars in `sqd-api-server`:
77
+
78
+ - `SUPABASE_URL`
79
+ - `SUPABASE_SERVICE_ROLE_KEY`
80
+ - `SQD_MODULE_KEY` (use this one; already set in Vercel)
81
+
82
+ In your API server route, create a Supabase client using those env vars, then run queries and return JSON.
83
+
84
+ ### 7) Test locally
16
85
 
17
86
  ```bash
18
87
  npm run dev
19
- # or
20
- yarn dev
21
- # or
22
- pnpm dev
23
- # or
24
- bun dev
88
+ npm run build
89
+ ```
90
+
91
+ ### 8) Publish to npm under @thesquad-components
92
+
93
+ ```bash
94
+ npm login
95
+ npm publish --access public
25
96
  ```
26
97
 
27
- Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
98
+ If the package should be private, use `--access restricted`.
28
99
 
29
- You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
100
+ ### 9) Use it in another app
101
+
102
+ ```bash
103
+ npm install @thesquad-components/your-app-name
104
+ ```
105
+
106
+ ```ts
107
+ import { YourComponent } from "@thesquad-components/your-app-name";
108
+ ```
109
+
110
+ ### 10) Update later
111
+
112
+ - Make changes
113
+ - Bump version in `package.json`
114
+ - Publish again:
115
+
116
+ ```bash
117
+ npm publish
118
+ ```
30
119
 
31
- ## Resources
120
+ ---
32
121
 
33
- Untitled UI React is built on top of [Untitled UI Figma](https://www.untitledui.com/figma), the world's largest and most popular Figma UI kit and design system. Explore more:
122
+ ## NPM account + org access (@thesquad-components)
34
123
 
35
- **[Untitled UI Figma:](https://www.untitledui.com/react/resources/figma-files)** The world's largest Figma UI kit and design system.
36
- <br/>
37
- **[Untitled UI Icons:](https://www.untitledui.com/react/resources/icons)** A clean, consistent, and neutral icon library crafted specifically for modern UI design.
38
- <br/>
39
- **[Untitled UI file icons:](https://www.untitledui.com/react/resources/file-icons)** Free file format icons, designed specifically for modern web and UI design.
40
- <br/>
41
- **[Untitled UI flag icons:](https://www.untitledui.com/react/resources/flag-icons)** Free country flag icons, designed specifically for modern web and UI design.
42
- <br/>
43
- **[Untitled UI avatars:](https://www.untitledui.com/react/resources/avatars)** Free placeholder user avatars and profile pictures to use in your projects.
44
- <br/>
45
- **[Untitled UI logos:](https://www.untitledui.com/react/resources/logos)** Free fictional company logos to use in your projects.
124
+ ### Create an npm account
46
125
 
47
- ## License
126
+ 1) Go to `https://www.npmjs.com/signup`
127
+ 2) Create an account and verify your email
128
+ 3) Enable 2FA (recommended)
48
129
 
49
- Untitled UI React open-source components are licensed under the MIT license, which means you can use them for free in unlimited commercial projects.
130
+ ### Request access to the org (owned by Jacob)
50
131
 
51
- > [!NOTE]
52
- > This license applies only to the starter kit and to the components included in this open-source repository. [Untitled UI React PRO](https://www.untitledui.com/react) includes hundreds more advanced UI components and page examples and is subject to a separate [license agreement](https://www.untitledui.com/license).
132
+ Send Jacob the following:
53
133
 
54
- [Untitled UI license agreement →](https://www.untitledui.com/license)
134
+ - Your npm username
135
+ - The email on your npm account
136
+ - Confirmation you enabled 2FA
55
137
 
56
- [Frequently asked questions →](https://www.untitledui.com/faqs)
138
+ Once added to `@thesquad-components`, you can publish under the scope.
package/dist/index.css CHANGED
@@ -805,9 +805,6 @@
805
805
  .right-3\.5 {
806
806
  right: calc(var(--spacing) * 3.5);
807
807
  }
808
- .right-4 {
809
- right: calc(var(--spacing) * 4);
810
- }
811
808
  .-bottom-0\.5 {
812
809
  bottom: calc(var(--spacing) * -0.5);
813
810
  }
@@ -832,9 +829,6 @@
832
829
  .bottom-3 {
833
830
  bottom: calc(var(--spacing) * 3);
834
831
  }
835
- .bottom-4 {
836
- bottom: calc(var(--spacing) * 4);
837
- }
838
832
  .bottom-5 {
839
833
  bottom: calc(var(--spacing) * 5);
840
834
  }