create-croissant 0.1.17 → 0.1.19

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.1.17",
6
+ "version": "0.1.19",
7
7
  "description": "Scaffold a new project using the Croissant Stack",
8
8
  "repository": {
9
9
  "type": "git",
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npm run lint
@@ -0,0 +1,11 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ # Get the name of the branch being pushed
5
+ branch=$(git rev-parse --abbrev-ref HEAD)
6
+
7
+ # Only run if pushing to main
8
+ if [ "$branch" = "main" ]; then
9
+ echo "Pushing to main branch, running CI checks..."
10
+ npm run ci
11
+ fi
@@ -50,15 +50,11 @@ const data = {
50
50
  }
51
51
 
52
52
  export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
53
- const [user, setUser] = React.useState<typeof authClient.$Infer.Session.user | null>(null)
53
+ const {
54
+ data: session,
55
+ } = authClient.useSession()
54
56
 
55
- React.useEffect(() => {
56
- const checkSession = async () => {
57
- const { data: sessionData } = await authClient.getSession()
58
- setUser(sessionData?.user || null)
59
- }
60
- checkSession()
61
- }, [])
57
+ const user = session?.user || null
62
58
 
63
59
  return (
64
60
  <Sidebar {...props}>
@@ -1,3 +1,3 @@
1
- import { createAuthClient } from "better-auth/client";
1
+ import { createAuthClient } from "better-auth/react";
2
2
 
3
3
  export const authClient = createAuthClient();
@@ -8,15 +8,18 @@
8
8
  "lint": "turbo lint",
9
9
  "format": "turbo format",
10
10
  "typecheck": "turbo typecheck",
11
+ "ci": "npm run lint && npm run typecheck && npm run build",
11
12
  "db:up": "docker compose up -d",
12
13
  "db:down": "docker compose down",
13
14
  "db:logs": "docker compose logs -f",
14
- "update-deps": "npx npm-check-updates -u -w --root && npm install"
15
+ "update-deps": "npx npm-check-updates -u -w --root && npm install",
16
+ "prepare": "husky"
15
17
  },
16
18
  "devDependencies": {
17
19
  "@better-auth/core": "^1.6.7",
18
20
  "@tanstack/eslint-config": "0.4.0",
19
21
  "eslint": "10.2.1",
22
+ "husky": "^9.1.7",
20
23
  "prettier": "^3.8.1",
21
24
  "prettier-plugin-tailwindcss": "^0.7.2",
22
25
  "turbo": "^2.8.17",
@@ -1,19 +0,0 @@
1
- import * as React from "react"
2
-
3
- const MOBILE_BREAKPOINT = 768
4
-
5
- export function useIsMobile() {
6
- const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
7
-
8
- React.useEffect(() => {
9
- const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
10
- const onChange = () => {
11
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
12
- }
13
- mql.addEventListener("change", onChange)
14
- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
15
- return () => mql.removeEventListener("change", onChange)
16
- }, [])
17
-
18
- return !!isMobile
19
- }