suparisma 0.0.2 → 0.0.3

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.
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ // THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.supabase = void 0;
5
+ const supabase_js_1 = require("@supabase/supabase-js");
6
+ console.log(`NEXT_PUBLIC_SUPABASE_URL: ${process.env.NEXT_PUBLIC_SUPABASE_URL}`);
7
+ console.log(`NEXT_PUBLIC_SUPABASE_ANON_KEY: ${process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY}`);
8
+ exports.supabase = (0, supabase_js_1.createClient)(process.env.NEXT_PUBLIC_SUPABASE_URL, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suparisma",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Opinionated typesafe React realtime CRUD hooks generator for all your Supabase tables, powered by Prisma.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -8,8 +8,18 @@
8
8
  "start": "node dist/index.js",
9
9
  "test": "jest",
10
10
  "generate-prisma-types": "prisma generate",
11
- "generate-hooks": "ts-node --transpile-only src/index.ts"
11
+ "generate-hooks-dev": "npx prisma generate && npx prisma db push && ts-node --transpile-only src/index.ts generate",
12
+ "run-next-example": "cd src/examples/with-next && npm run dev"
12
13
  },
14
+ "keywords": [
15
+ "react",
16
+ "hooks",
17
+ "supabase",
18
+ "prisma",
19
+ "typescript",
20
+ "nextjs",
21
+ "realtime"
22
+ ],
13
23
  "dependencies": {
14
24
  "@supabase/supabase-js": "^2.49.4",
15
25
  "dotenv": "^16.5.0",
@@ -1,4 +1,4 @@
1
- // This is your Prisma schema file,
1
+ // This is a sample Prisma schema file,
2
2
  // learn more about it in the docs: https://pris.ly/d/prisma-schema
3
3
 
4
4
  // Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
@@ -13,10 +13,26 @@ datasource db {
13
13
  url = env("DATABASE_URL")
14
14
  }
15
15
 
16
- model User {
16
+ enum SomeEnum {
17
+ ONE
18
+ TWO
19
+ THREE
20
+ }
21
+
22
+ // Realtime is enabled by default for all models
23
+ model Thing {
17
24
  id String @id @default(uuid())
18
- email String @unique
19
25
  name String?
26
+ someEnum SomeEnum @default(ONE)
27
+ someNumber Int?
20
28
  createdAt DateTime @default(now())
21
29
  updatedAt DateTime @updatedAt
22
30
  }
31
+
32
+ // @disableRealtime
33
+ model AuditLog {
34
+ id String @id @default(uuid())
35
+ action String
36
+ details String?
37
+ createdAt DateTime @default(now())
38
+ }
package/tsconfig.json CHANGED
@@ -16,5 +16,5 @@
16
16
  "jsx": "preserve"
17
17
  },
18
18
  "include": ["src/**/*", "../src/app/**/*.ts"],
19
- "exclude": ["node_modules", "**/*.spec.ts"]
19
+ "exclude": ["node_modules", "**/*.spec.ts", "src/examples/**/*"]
20
20
  }
package/src/config.ts DELETED
@@ -1,7 +0,0 @@
1
- // Configuration
2
- export const PRISMA_SCHEMA_PATH = process.env.SUPARISMA_PRISMA_SCHEMA_PATH || 'prisma/schema.prisma';
3
- export const OUTPUT_DIR = process.env.SUPARISMA_OUTPUT_DIR || 'src/suparisma/generated';
4
- export const TYPES_DIR = `${OUTPUT_DIR}/types`;
5
- export const HOOKS_DIR = `${OUTPUT_DIR}/hooks`;
6
- export const UTILS_DIR = `${OUTPUT_DIR}/utils`;
7
- export const HOOK_NAME_PREFIX = 'useSuparisma';