@lobb-js/lobb-ext-auth 0.2.1 → 0.2.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.
Files changed (49) hide show
  1. package/dist/auth.d.ts +13 -0
  2. package/dist/auth.js +44 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.js +52 -0
  5. package/dist/lib/components/pages/loginPage/index.svelte +64 -0
  6. package/dist/lib/components/pages/loginPage/index.svelte.d.ts +14 -0
  7. package/dist/lib/components/pages/settings/index.svelte +53 -0
  8. package/dist/lib/components/pages/settings/index.svelte.d.ts +14 -0
  9. package/dist/lib/components/pages/settings/pages/activityFeed.svelte +21 -0
  10. package/dist/lib/components/pages/settings/pages/activityFeed.svelte.d.ts +14 -0
  11. package/dist/lib/components/pages/settings/pages/rolesAndPermissions.svelte +21 -0
  12. package/dist/lib/components/pages/settings/pages/rolesAndPermissions.svelte.d.ts +14 -0
  13. package/dist/lib/components/pages/settings/pages/users.svelte +21 -0
  14. package/dist/lib/components/pages/settings/pages/users.svelte.d.ts +14 -0
  15. package/dist/lib/components/pages/userSettings/components/account.svelte +106 -0
  16. package/dist/lib/components/pages/userSettings/components/account.svelte.d.ts +14 -0
  17. package/dist/lib/components/pages/userSettings/components/profile.svelte +87 -0
  18. package/dist/lib/components/pages/userSettings/components/profile.svelte.d.ts +14 -0
  19. package/dist/lib/components/pages/userSettings/index.svelte +48 -0
  20. package/dist/lib/components/pages/userSettings/index.svelte.d.ts +14 -0
  21. package/dist/lib/index.d.ts +0 -0
  22. package/dist/lib/index.js +2 -0
  23. package/dist/lib/utils.d.ts +12 -0
  24. package/dist/lib/utils.js +5 -0
  25. package/dist/onStartup.d.ts +2 -0
  26. package/dist/onStartup.js +21 -0
  27. package/dist/tests/login.spec.d.ts +1 -0
  28. package/dist/tests/login.spec.js +27 -0
  29. package/dist/tests/package.json +1 -0
  30. package/dist/tests/playwright.config.cjs +27 -0
  31. package/dist/tests/playwright.config.d.cts +2 -0
  32. package/package.json +7 -4
  33. package/.vscode/settings.json +0 -5
  34. package/CHANGELOG.md +0 -140
  35. package/lobb.ts +0 -108
  36. package/public/public/vite.svg +0 -1
  37. package/public/vite.svg +0 -1
  38. package/scripts/postpublish.sh +0 -12
  39. package/scripts/prepublish.sh +0 -17
  40. package/studio/app.html +0 -12
  41. package/studio/routes/+layout.svelte +0 -7
  42. package/studio/routes/+layout.ts +0 -1
  43. package/studio/routes/[...path]/+page.svelte +0 -6
  44. package/svelte.config.js +0 -24
  45. package/todo.md +0 -37
  46. package/tsconfig.app.json +0 -27
  47. package/tsconfig.json +0 -13
  48. package/tsconfig.node.json +0 -26
  49. package/vite.config.ts +0 -8
@@ -0,0 +1,12 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
3
+ export type WithoutChild<T> = T extends {
4
+ child?: any;
5
+ } ? Omit<T, "child"> : T;
6
+ export type WithoutChildren<T> = T extends {
7
+ children?: any;
8
+ } ? Omit<T, "children"> : T;
9
+ export type WithoutChildrenOrChild<T> = WithoutChildren<WithoutChild<T>>;
10
+ export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & {
11
+ ref?: U | null;
12
+ };
@@ -0,0 +1,5 @@
1
+ import { clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+ export function cn(...inputs) {
4
+ return twMerge(clsx(inputs));
5
+ }
@@ -0,0 +1,2 @@
1
+ import type { ExtensionUtils } from "@lobb-js/studio";
2
+ export declare function onStartup(utils: ExtensionUtils): Promise<void>;
@@ -0,0 +1,21 @@
1
+ import { Auth } from "./auth";
2
+ export async function onStartup(utils) {
3
+ // logout if we got an Unauthorized response
4
+ const auth = new Auth(utils);
5
+ utils.lobb.onResponse(async (response) => {
6
+ if (response.status === 401) {
7
+ const body = await response.json();
8
+ if (body.message === "JWT token has expired" ||
9
+ body.message === "Invalid JWT token") {
10
+ auth.logout();
11
+ }
12
+ }
13
+ });
14
+ const session = auth.getSession();
15
+ // if user is logged in
16
+ if (session) {
17
+ utils.ctx.extensions.auth.session = session;
18
+ return;
19
+ }
20
+ await auth.logout();
21
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import { test, expect } from "@playwright/test";
2
+ const ADMIN_EMAIL = "admin@example.com";
3
+ const ADMIN_PASSWORD = "admin";
4
+ const LOGIN_URL = "/studio/extensions/auth/login_page";
5
+ const STUDIO_URL = "/studio";
6
+ test.describe("Login page", () => {
7
+ test.beforeEach(async ({ page }) => {
8
+ await page.goto(LOGIN_URL);
9
+ });
10
+ test("shows the login form", async ({ page }) => {
11
+ await expect(page.getByText("Welcome back")).toBeVisible();
12
+ await expect(page.getByPlaceholder("email@example.com")).toBeVisible();
13
+ await expect(page.getByPlaceholder("••••••••")).toBeVisible();
14
+ await expect(page.getByRole("button", { name: "Sign In" })).toBeVisible();
15
+ });
16
+ test("logs in with valid credentials and redirects to studio", async ({ page }) => {
17
+ await page.getByPlaceholder("email@example.com").fill(ADMIN_EMAIL);
18
+ await page.getByPlaceholder("••••••••").fill(ADMIN_PASSWORD);
19
+ await page.getByRole("button", { name: "Sign In" }).click();
20
+ await page.waitForURL(STUDIO_URL);
21
+ expect(page.url()).toContain(STUDIO_URL);
22
+ });
23
+ test("shows error toast on empty form submission", async ({ page }) => {
24
+ await page.getByRole("button", { name: "Sign In" }).click();
25
+ await expect(page.getByText("Please complete all fields")).toBeVisible();
26
+ });
27
+ });
@@ -0,0 +1 @@
1
+ {"type": "commonjs"}
@@ -0,0 +1,27 @@
1
+ const { defineConfig, devices } = require("@playwright/test");
2
+
3
+ module.exports = defineConfig({
4
+ testDir: __dirname,
5
+ testMatch: "**/*.spec.ts",
6
+ fullyParallel: true,
7
+ retries: 0,
8
+ expect: { timeout: 15000 },
9
+ use: {
10
+ baseURL: "http://localhost:3000",
11
+ trace: "on-first-retry",
12
+ headless: true,
13
+ },
14
+ projects: [
15
+ {
16
+ name: "chromium",
17
+ use: { ...devices["Desktop Chrome"] },
18
+ },
19
+ ],
20
+ // Automatically start the dev server before running tests
21
+ webServer: {
22
+ command: "bun run dev",
23
+ url: "http://localhost:3000/studio",
24
+ reuseExistingServer: true,
25
+ cwd: "../../../../", // packages/auth-ext root
26
+ },
27
+ });
@@ -0,0 +1,2 @@
1
+ declare const _exports: import("@playwright/test").Config<import("@playwright/test").PlaywrightTestOptions & {}, import("@playwright/test").PlaywrightWorkerOptions & {}>;
2
+ export = _exports;
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@lobb-js/lobb-ext-auth",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "license": "AGPL-3.0-only",
5
5
  "type": "module",
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
+ "files": [
10
+ "extensions",
11
+ "dist"
12
+ ],
9
13
  "exports": {
10
14
  ".": "./extensions/auth/index.ts",
11
15
  "./studio": {
@@ -22,7 +26,6 @@
22
26
  "prepare": "svelte-kit sync || echo ''",
23
27
  "preview": "vite preview",
24
28
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
25
- "postinstall": "bun --bun playwright install chromium",
26
29
  "prepublishOnly": "./scripts/prepublish.sh",
27
30
  "postpublish": "./scripts/postpublish.sh",
28
31
  "package": "svelte-package --input extensions/auth/studio",
@@ -30,12 +33,12 @@
30
33
  "build:studio": "vite build"
31
34
  },
32
35
  "dependencies": {
33
- "@lobb-js/core": "0.13.1",
36
+ "@lobb-js/core": "^0.13.3",
34
37
  "argon2": "^0.40.3",
35
38
  "hono": "^4.7.0"
36
39
  },
37
40
  "devDependencies": {
38
- "@lobb-js/studio": "0.7.1",
41
+ "@lobb-js/studio": "^0.7.3",
39
42
  "@lucide/svelte": "^0.563.1",
40
43
  "@playwright/test": "^1.58.2",
41
44
  "@sveltejs/adapter-node": "^5.5.4",
@@ -1,5 +0,0 @@
1
- {
2
- "deno.disablePaths": [
3
- "studio"
4
- ]
5
- }
package/CHANGELOG.md DELETED
@@ -1,140 +0,0 @@
1
- # Changelog
2
- All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
3
-
4
- - - -
5
- ## auth-ext@0.2.1 - 2026-03-28
6
- #### Bug Fixes
7
- - adding readme to all packages - (3a9264a) - malik ben
8
- #### Miscellaneous Chores
9
- - add publishConfig and fix ext packages for npm publishing - (49747e9) - malik ben
10
-
11
- - - -
12
-
13
- ## auth-ext@0.2.0 - 2026-03-28
14
- #### Features
15
- - (**auth-ext**) convert studio from Svelte SPA to SvelteKit - (6f24661) - malik ben
16
- - (**auth-ext**) add Playwright e2e tests for studio login page - (5679c3e) - malik ben
17
- - (**auth-ext**) auto-discover studio extensions via import.meta.glob - (478c4be) - malik ben
18
- - (**auth-ext**) enable parallel bun test execution with port/db isolation - (721ee14) - malik ben
19
- - (**auth-ext**) migrate packages/auth-ext from Deno to Bun - (2ce1866) - malik ben
20
- - replace hasDashboardExtension with virtual:lobb-studio-extensions module - (437cb2e) - malik ben
21
- #### Bug Fixes
22
- - (**auth-ext**) move onStartup.ts to extensions/auth/studio - (af08d43) - malik ben
23
- - (**studio**) prevent @lobb-js/studio version shadowing in extensions - (cd674b9) - malik ben
24
- - add /studio subpath exports to ext packages, update studio pages to use them - (c0b9a82) - malik ben
25
- - untrack .svelte-kit from mindhar, fix process leak and $lib imports, update ai sdk versions - (017f784) - malik ben
26
- - chaning $lib to relative path - (c6d9e8f) - malik ben
27
- #### Miscellaneous Chores
28
- - (**auth-ext**) remove dashboard extension.json reference from auth extension - (27df519) - malik ben
29
- - (**auth-ext**) move backend tests to extensions/auth/tests and rename scripts - (6ba4a4e) - malik ben
30
- - (**auth-ext**) split studio into host and extension-specific directories - (6f68493) - malik ben
31
- - (**auth-ext**) move extension logic from projectExtension to extensions/auth - (e172b74) - malik ben
32
- - (**auth-ext**) flatten studio into project root and simplify workspace globs - (7a9a873) - malik ben
33
- - (**auth-ext**) rename studio directory to __studio - (abdaa72) - malik ben
34
- - (**auth-ext**) clear create_users_collections migration - (cbe5d2a) - malik ben
35
- - (**version**) 0.25.2 - (a62acb9) - Cocogitto Bot
36
- - (**version**) 0.25.1 - (afe7e69) - Cocogitto Bot
37
- - (**version**) 0.25.0 - (77a383c) - Cocogitto Bot
38
- - (**version**) 0.24.0 - (a8cb605) - Cocogitto Bot
39
- - (**version**) 0.23.0 - (60f357e) - Cocogitto Bot
40
- - (**version**) 0.22.0 - (6510e32) - Cocogitto Bot
41
- - (**version**) 0.21.0 - (c973aa9) - Cocogitto Bot
42
- - (**version**) 0.20.0 - (06cc303) - Cocogitto Bot
43
- - (**version**) 0.19.0 - (6bbc900) - Cocogitto Bot
44
- - (**version**) 0.18.0 - (efc553f) - Cocogitto Bot
45
- - (**version**) 0.17.0 - (4174f0c) - Cocogitto Bot
46
- - (**version**) 0.16.0 - (9508655) - Cocogitto Bot
47
- - (**version**) 0.15.0 - (0c2c345) - Cocogitto Bot
48
- - (**version**) 0.14.11 - (ad92b61) - Cocogitto Bot
49
- - add dev:studio/build:studio scripts, fix Dockerfiles, remove --build flag - (1595975) - malik ben
50
- - add prepublish/postpublish scripts to extension packages for standalone compatibility - (4d6108f) - malik ben
51
- - centralize studio app.css in @lobb-js/studio package, remove local copies - (05192dc) - malik ben
52
- - rename @lobb/ scope to @lobb-js/ across all packages and apps - (cce4ce0) - malik ben
53
- - add start/build scripts and gitignore build dir across all projects - (58f539d) - malik ben
54
- - update CLAUDE.md to enforce no-commit-without-explicit-instruction rule - (6d63a42) - malik ben
55
- - replace workspace:* with exact versions in all package.json files - (74fbdb7) - malik ben
56
- - rename __studio to studio and remove unused studio dirs - (77fb932) - malik ben
57
-
58
- - - -
59
-
60
- ## auth-ext@0.1.67 - 2026-02-25
61
- #### Bug Fixes
62
- - publishing extension again - (e07ac36) - Malik Najjar
63
- #### Miscellaneous Chores
64
- - (**version**) 0.14.8 - (0e6c1cb) - Cocogitto Bot
65
-
66
- - - -
67
-
68
- ## auth-ext@0.1.66 - 2026-02-22
69
- #### Bug Fixes
70
- - coggito publishing packages order fix - (573c75e) - malik ben
71
-
72
- - - -
73
-
74
- ## auth-ext@0.1.65 - 2026-02-22
75
- #### Bug Fixes
76
- - adjusted the names of the events - (6543d8c) - malik ben
77
-
78
- - - -
79
-
80
- ## auth-ext@0.1.64 - 2026-02-22
81
- #### Bug Fixes
82
- - made the collectionService become an property in the main lobb object - (146e4cb) - malik ben
83
-
84
- - - -
85
-
86
- ## auth-ext@0.1.63 - 2026-02-21
87
- #### Bug Fixes
88
- - using default export instead of named export for extensions - (37dd485) - malik ben
89
- #### Miscellaneous Chores
90
- - (**version**) 0.13.2 - (39b0145) - Cocogitto Bot
91
- - (**version**) 0.12.3 - (cd06fc0) - Cocogitto Bot
92
- - (**version**) 0.12.2 - (35b2ff3) - Cocogitto Bot
93
- - (**version**) 0.12.1 - (c548105) - Cocogitto Bot
94
- - (**version**) 0.11.1 - (659ebd3) - Cocogitto Bot
95
- - (**version**) 0.11.0 - (3f4f47e) - Cocogitto Bot
96
-
97
- - - -
98
-
99
- ## auth-ext@0.1.62 - 2026-02-17
100
- #### Bug Fixes
101
- - removing a comment - (15c57c0) - Malik Najjar
102
- #### Miscellaneous Chores
103
- - adding a comment - (fde6900) - Malik Najjar
104
-
105
- - - -
106
-
107
- ## auth-ext@0.1.61 - 2026-02-17
108
- #### Bug Fixes
109
- - removeing stupid comment - (ca41782) - Malik Najjar
110
- #### Miscellaneous Chores
111
- - (**version**) 0.10.2 - (2c92a7d) - Cocogitto Bot
112
- - adding comment - (c6cc16d) - Malik Najjar
113
-
114
- - - -
115
-
116
- ## auth-ext@0.1.60 - 2026-02-17
117
- #### Bug Fixes
118
- - update the auth extension - (5318dda) - Malik Najjar
119
- #### Miscellaneous Chores
120
- - (**version**) 0.8.0 - (fdee7ca) - Cocogitto Bot
121
-
122
- - - -
123
-
124
- ## auth-ext@0.1.59 - 2026-02-15
125
- #### Bug Fixes
126
- - fix deno publish issue - (e8dcc4f) - malik ben
127
- - issue fix - (63d66d3) - malik ben
128
- #### Miscellaneous Chores
129
- - (**version**) 0.5.5 - (d4dedeb) - Cocogitto Bot
130
- - (**version**) 0.5.4 - (1ca3970) - Cocogitto Bot
131
- - (**version**) 0.5.3 - (dcdb9cb) - Cocogitto Bot
132
- - (**version**) 0.5.2 - (aa66e29) - Cocogitto Bot
133
- - (**version**) 0.5.1 - (41b7c35) - Cocogitto Bot
134
- - (**version**) 0.5.0 - (af63147) - Cocogitto Bot
135
- - (**version**) 0.4.4 - (eaed3b4) - Cocogitto Bot
136
- - (**version**) 0.4.3 - (ea9ec49) - Cocogitto Bot
137
-
138
- - - -
139
-
140
- Changelog generated by [cocogitto](https://github.com/cocogitto/cocogitto).
package/lobb.ts DELETED
@@ -1,108 +0,0 @@
1
- import { Lobb } from "@lobb-js/core";
2
- import { auth } from "./extensions/auth/index.ts";
3
-
4
- Lobb.init({
5
- project: {
6
- name: "Social To Courier",
7
- force_sync: true,
8
- },
9
- database: {
10
- host: "localhost",
11
- port: 5432,
12
- username: "test",
13
- password: "test",
14
- database: "social_to_courier",
15
- },
16
- web_server: {
17
- host: "0.0.0.0",
18
- port: 3000,
19
- cors: {
20
- origin: "*",
21
- },
22
- },
23
- extensions: [
24
- auth({
25
- admin: {
26
- email: "admin@example.com",
27
- password: "admin",
28
- },
29
- extend_users: {
30
- fields: {
31
- instagram_user_id: {
32
- type: "string",
33
- length: 255,
34
- },
35
- instagram_token: {
36
- type: "string",
37
- length: 255,
38
- },
39
- },
40
- },
41
- roles: {
42
- public: {
43
- permissions: true,
44
- },
45
- },
46
- }),
47
- ],
48
- collections: {
49
- articles: {
50
- indexes: {},
51
- fields: {
52
- id: {
53
- type: "integer",
54
- },
55
- image: {
56
- type: "string",
57
- length: 255,
58
- },
59
- title: {
60
- type: "string",
61
- length: 255,
62
- validators: {
63
- required: true,
64
- },
65
- },
66
- description: {
67
- type: "string",
68
- length: 255,
69
- },
70
- body: {
71
- type: "string",
72
- length: 255,
73
- validators: {
74
- required: true,
75
- },
76
- },
77
- status: {
78
- type: "string",
79
- length: 255,
80
- validators: {
81
- enum: ["public", "private"],
82
- },
83
- },
84
- },
85
- },
86
- comments: {
87
- indexes: {},
88
- fields: {
89
- id: {
90
- type: "integer",
91
- },
92
- body: {
93
- type: "string",
94
- length: 255,
95
- validators: {
96
- required: true,
97
- },
98
- },
99
- article_id: {
100
- type: "integer",
101
- validators: {
102
- required: true,
103
- },
104
- },
105
- },
106
- },
107
- },
108
- });
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/public/vite.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -1,12 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Postpublish script for @lobb-js/lobb-ext-auth
4
- # Reverts package.json exports and cleans dist to avoid uncommitted changes
5
-
6
- echo "📝 Reverting package.json exports to development mode..."
7
- jq '."exports"["./studio"] = "./extensions/auth/studio/index.ts"' package.json > package.json.tmp && mv package.json.tmp package.json
8
-
9
- echo "🧹 Cleaning dist directory..."
10
- rm -rf dist
11
-
12
- echo "✅ Postpublish complete"
@@ -1,17 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Prepublish script for @lobb-js/lobb-ext-auth
4
- # Builds the studio package and updates exports for publishing
5
-
6
- echo "📦 Building studio package..."
7
- bun run package
8
-
9
- if [ $? -ne 0 ]; then
10
- echo "❌ Build failed"
11
- exit 1
12
- fi
13
-
14
- echo "📝 Updating package.json exports for publishing..."
15
- jq '."exports"["./studio"] = {"svelte": "./dist/index.js", "types": "./dist/index.d.ts"}' package.json > package.json.tmp && mv package.json.tmp package.json
16
-
17
- echo "✅ Prepublish complete"
package/studio/app.html DELETED
@@ -1,12 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <link rel="icon" href="%sveltekit.assets%/vite.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1" />
7
- %sveltekit.head%
8
- </head>
9
- <body data-sveltekit-preload-data="hover">
10
- <div style="display: contents">%sveltekit.body%</div>
11
- </body>
12
- </html>
@@ -1,7 +0,0 @@
1
- <script lang="ts">
2
- import "@lobb-js/studio/app.css";
3
-
4
- let { children } = $props();
5
- </script>
6
-
7
- {@render children()}
@@ -1 +0,0 @@
1
- export const ssr = false;
@@ -1,6 +0,0 @@
1
- <script lang="ts">
2
- import { Studio } from "@lobb-js/studio";
3
- import { env } from "$env/dynamic/public";
4
- </script>
5
-
6
- <Studio lobbUrl={env.PUBLIC_LOBB_URL} />
package/svelte.config.js DELETED
@@ -1,24 +0,0 @@
1
- import adapter from '@sveltejs/adapter-node';
2
-
3
- /** @type {import('@sveltejs/kit').Config} */
4
- const config = {
5
- kit: {
6
- adapter: adapter(),
7
- paths: {
8
- base: '/studio'
9
- },
10
- files: {
11
- lib: 'studio/lib',
12
- routes: 'studio/routes',
13
- appTemplate: 'studio/app.html',
14
- assets: 'public',
15
- hooks: {
16
- server: 'studio/hooks.server',
17
- client: 'studio/hooks.client',
18
- },
19
- params: 'studio/params',
20
- }
21
- }
22
- };
23
-
24
- export default config;
package/todo.md DELETED
@@ -1,37 +0,0 @@
1
- # high priority
2
-
3
- - remove the `dashboard_access_roles` and just put it in the specific role in the `roles` property
4
- - currently we have the payloadGuard. you can later implement the `recordGuard`
5
- for `update` and `delete`
6
- - implement rotating refresh token mechanism
7
- - you can implement the firebase adapter and get all other adapters
8
- - check `https://passkeys.dev/`. the new standart to abandon passwords
9
- - prevent any one from creating a user with the admin role
10
-
11
- # low priority
12
-
13
- - add basic authentication in lobb. or at least make something like it. where
14
- you have a users.json file and those will be the users without creating a
15
- users or anything like that. its much simpler for simpler usage
16
- - the collection_name property in the refresh_token property default value in
17
- the schema doent work. its similar to the issue of the auth collection name.
18
- although Im adding a default value to that property. but its value is
19
- undefined for some reason. investigate it
20
- - remove keep only the user id in the payload of the access and refresh tokens
21
- - rotational refresh tokens where the refresh token is changes every time its
22
- used to refresh an access token
23
- - prepare the views directory for extensions in a better way. now there is a way
24
- to view all component you have in an isolated manner. and when you run
25
- `npm run build` it will generate a js compiled version of the svelte
26
- component.
27
- - for now you need to import the main css file in all of the components in order
28
- for tailwind stuff to be indluded in the main style.css. but in the future you
29
- should import all component in an index file and include the main css there
30
- and force vite to create seperate chunks for each imported svelte compoenent
31
- there. so that you dont get one bundle because you need them seperated
32
- - change the views from svelte files into directories that holds index.svelte
33
- files. (this is better because maybe in the future you want to modularize or
34
- split your code or have other files. so they will all be organized inside that
35
- directory and you dont need to have a svelte file and then have a directory
36
- with the same name of that file to hold all the imports of that svelte file.
37
- its better to have them all stored in one directory)
package/tsconfig.app.json DELETED
@@ -1,27 +0,0 @@
1
- {
2
- "extends": "@tsconfig/svelte/tsconfig.json",
3
- "compilerOptions": {
4
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
- "target": "ES2022",
6
- "useDefineForClassFields": true,
7
- "module": "ESNext",
8
- "types": ["svelte", "vite/client"],
9
- "noEmit": true,
10
- "allowArbitraryExtensions": true,
11
- /**
12
- * Typecheck JS in `.svelte` and `.js` files by default.
13
- * Disable checkJs if you'd like to use dynamic types in JS.
14
- * Note that setting allowJs false does not prevent the use
15
- * of JS in `.svelte` files.
16
- */
17
- "allowJs": true,
18
- "checkJs": true,
19
- "moduleDetection": "force",
20
- "baseUrl": ".",
21
- "paths": {
22
- "$lib": ["./studio/lib"],
23
- "$lib/*": ["./studio/lib/*"]
24
- }
25
- },
26
- "include": ["studio/**/*.ts", "studio/**/*.js", "studio/**/*.svelte"]
27
- }
package/tsconfig.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "extends": "./.svelte-kit/tsconfig.json",
3
- "compilerOptions": {
4
- "allowJs": true,
5
- "checkJs": true,
6
- "esModuleInterop": true,
7
- "forceConsistentCasingInFileNames": true,
8
- "resolveJsonModule": true,
9
- "skipLibCheck": true,
10
- "sourceMap": true,
11
- "strict": true
12
- }
13
- }
@@ -1,26 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
- "target": "ES2023",
5
- "lib": ["ES2023"],
6
- "module": "ESNext",
7
- "types": ["node"],
8
- "skipLibCheck": true,
9
-
10
- /* Bundler mode */
11
- "moduleResolution": "bundler",
12
- "allowImportingTsExtensions": true,
13
- "verbatimModuleSyntax": true,
14
- "moduleDetection": "force",
15
- "noEmit": true,
16
-
17
- /* Linting */
18
- "strict": true,
19
- "noUnusedLocals": true,
20
- "noUnusedParameters": true,
21
- "erasableSyntaxOnly": true,
22
- "noFallthroughCasesInSwitch": true,
23
- "noUncheckedSideEffectImports": true
24
- },
25
- "include": ["vite.config.ts"]
26
- }
package/vite.config.ts DELETED
@@ -1,8 +0,0 @@
1
- import { sveltekit } from '@sveltejs/kit/vite';
2
- import { defineConfig } from 'vite';
3
- import tailwindcss from "@tailwindcss/vite";
4
- import { lobbStudioPlugins } from '@lobb-js/studio/vite-plugins';
5
-
6
- export default defineConfig({
7
- plugins: [tailwindcss(), sveltekit(), ...lobbStudioPlugins()],
8
- });