firstly 0.0.14 → 0.0.16-next.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.
- package/CHANGELOG.md +16 -0
- package/esm/ROUTES.d.ts +10 -2
- package/esm/ROUTES.js +5 -1
- package/esm/auth/Entities.js +1 -0
- package/esm/auth/server/AuthController.server.js +2 -1
- package/esm/auth/server/handleAuth.js +2 -1
- package/esm/auth/server/handleGuard.d.ts +10 -4
- package/esm/auth/server/handleGuard.js +8 -41
- package/esm/auth/server/module.d.ts +29 -1
- package/esm/auth/server/module.js +4 -1
- package/esm/auth/static/assets/{Page-UV_hqY7I.d.ts → Page-BgIgl-Te.d.ts} +2 -2
- package/esm/auth/static/assets/{Page-UV_hqY7I.js → Page-BgIgl-Te.js} +1 -1
- package/esm/auth/static/assets/{Page-DdKMiUZn.d.ts → Page-HDnoBhpE.d.ts} +2 -2
- package/esm/auth/static/assets/{Page-DdKMiUZn.js → Page-HDnoBhpE.js} +5 -5
- package/esm/auth/static/assets/{Page-B0XXxe0N.d.ts → Page-f5pC21Yg.d.ts} +2 -2
- package/esm/auth/static/assets/{Page-B0XXxe0N.js → Page-f5pC21Yg.js} +1 -1
- package/esm/auth/static/assets/{index-C9jzxOBu.js → index-DAjei0Ie.js} +2 -2
- package/esm/auth/static/index.html +4 -4
- package/esm/auth/types.d.ts +1 -0
- package/esm/bin/cmd.js +16 -16
- package/esm/changeLog/server/index.d.ts +1 -1
- package/esm/changeLog/server/index.js +1 -1
- package/esm/cron/server/index.d.ts +1 -1
- package/esm/cron/server/index.js +1 -1
- package/esm/feedback/server/index.d.ts +1 -1
- package/esm/feedback/server/index.js +1 -1
- package/esm/helper.d.ts +1 -1
- package/esm/helper.js +4 -3
- package/esm/index.d.ts +5 -3
- package/esm/index.js +5 -3
- package/esm/mail/server/index.d.ts +2 -2
- package/esm/mail/server/index.js +7 -4
- package/esm/server/index.d.ts +49 -0
- package/esm/server/index.js +109 -1
- package/esm/svelte/FF_Cell.svelte +104 -0
- package/esm/svelte/FF_Cell.svelte.d.ts +24 -0
- package/esm/svelte/FF_Cell_Caption.svelte +20 -0
- package/esm/svelte/FF_Cell_Caption.svelte.d.ts +24 -0
- package/esm/svelte/FF_Cell_Display.svelte +61 -0
- package/esm/svelte/FF_Cell_Display.svelte.d.ts +22 -0
- package/esm/svelte/FF_Cell_Edit.svelte +104 -0
- package/esm/svelte/FF_Cell_Edit.svelte.d.ts +25 -0
- package/esm/svelte/FF_Cell_Error.svelte +20 -0
- package/esm/svelte/FF_Cell_Error.svelte.d.ts +24 -0
- package/esm/svelte/FF_Cell_Hint.svelte +20 -0
- package/esm/svelte/FF_Cell_Hint.svelte.d.ts +24 -0
- package/esm/svelte/FF_Config.svelte +29 -0
- package/esm/svelte/FF_Config.svelte.d.ts +9 -0
- package/esm/svelte/FF_Display.svelte +51 -0
- package/esm/svelte/FF_Display.svelte.d.ts +22 -0
- package/esm/svelte/FF_Edit.svelte +104 -0
- package/esm/svelte/FF_Edit.svelte.d.ts +25 -0
- package/esm/svelte/FF_Error.svelte +23 -0
- package/esm/svelte/FF_Error.svelte.d.ts +22 -0
- package/esm/svelte/FF_Field.svelte +62 -0
- package/esm/svelte/FF_Field.svelte.d.ts +22 -0
- package/esm/svelte/FF_Form.svelte +156 -0
- package/esm/svelte/FF_Form.svelte.d.ts +30 -0
- package/esm/svelte/FF_Grid.svelte +257 -0
- package/esm/svelte/FF_Grid.svelte.d.ts +31 -0
- package/esm/svelte/FF_Hint.svelte +21 -0
- package/esm/svelte/FF_Hint.svelte.d.ts +22 -0
- package/esm/svelte/FF_Label.svelte +23 -0
- package/esm/svelte/FF_Label.svelte.d.ts +22 -0
- package/esm/svelte/FF_Layout.svelte +62 -0
- package/esm/svelte/FF_Layout.svelte.d.ts +24 -0
- package/esm/svelte/FF_Repo.svelte.d.ts +69 -0
- package/esm/svelte/FF_Repo.svelte.js +170 -0
- package/esm/svelte/actions/intersection.d.ts +6 -0
- package/esm/svelte/actions/intersection.js +17 -0
- package/esm/svelte/class/SP.svelte.d.ts +61 -0
- package/esm/svelte/class/SP.svelte.js +412 -0
- package/esm/svelte/customField.d.ts +69 -0
- package/esm/svelte/customField.js +4 -0
- package/esm/svelte/dialog/DialogManagement.svelte +101 -0
- package/esm/svelte/dialog/DialogManagement.svelte.d.ts +18 -0
- package/esm/svelte/dialog/DialogPrimitive.svelte +157 -0
- package/esm/svelte/dialog/DialogPrimitive.svelte.d.ts +38 -0
- package/esm/svelte/dialog/dialog.d.ts +58 -0
- package/esm/svelte/dialog/dialog.js +130 -0
- package/esm/svelte/ff_Config.svelte.d.ts +91 -0
- package/esm/svelte/ff_Config.svelte.js +111 -0
- package/esm/svelte/firstly.css +14 -0
- package/esm/svelte/helpers/debounce.d.ts +1 -0
- package/esm/svelte/helpers/debounce.js +7 -0
- package/esm/svelte/helpers.d.ts +29 -0
- package/esm/svelte/helpers.js +38 -0
- package/esm/svelte/index.d.ts +32 -0
- package/esm/svelte/index.js +29 -0
- package/esm/svelte/tryCatch.d.ts +12 -0
- package/esm/svelte/tryCatch.js +18 -0
- package/esm/sveltekit/server/index.d.ts +1 -1
- package/esm/sveltekit/server/index.js +1 -1
- package/esm/ui/Field.svelte +1 -1
- package/esm/ui/Grid.svelte +8 -2
- package/esm/ui/Grid2.svelte +354 -0
- package/esm/ui/Grid2.svelte.d.ts +58 -0
- package/esm/ui/GridLoading.svelte +33 -8
- package/esm/ui/GridLoading.svelte.d.ts +1 -0
- package/esm/ui/GridPaginate.svelte +0 -3
- package/esm/ui/GridPaginate.svelte.d.ts +0 -1
- package/esm/ui/GridPaginate2.svelte +25 -0
- package/esm/ui/GridPaginate2.svelte.d.ts +7 -0
- package/esm/ui/dialog/dialog.d.ts +3 -1
- package/esm/ui/dialog/dialog.js +2 -0
- package/esm/ui/link/LinkPlus.svelte +8 -6
- package/package.json +28 -13
- package/esm/api/index.d.ts +0 -49
- package/esm/api/index.js +0 -109
- /package/esm/auth/static/assets/{index-C9jzxOBu.d.ts → index-DAjei0Ie.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firstly",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16-next.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Firstly, an opinionated Remult setup!",
|
|
6
6
|
"funding": "https://github.com/sponsors/jycouet",
|
|
@@ -16,19 +16,29 @@
|
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@sveltejs/kit": ">=1.0.0 <3.0.0",
|
|
19
|
-
"remult": "2.7.32
|
|
19
|
+
"remult": ">=2.7.32",
|
|
20
20
|
"svelte": ">=5"
|
|
21
21
|
},
|
|
22
|
+
"peerDependenciesMeta": {
|
|
23
|
+
"@sveltejs/kit": {
|
|
24
|
+
"optional": true
|
|
25
|
+
},
|
|
26
|
+
"svelte": {
|
|
27
|
+
"optional": true
|
|
28
|
+
}
|
|
29
|
+
},
|
|
22
30
|
"dependencies": {
|
|
23
31
|
"@clack/prompts": "0.10.0",
|
|
24
|
-
"@kitql/internals": "0.10.
|
|
32
|
+
"@kitql/internals": "0.10.4",
|
|
33
|
+
"@layerstack/svelte-actions": "1.0.0",
|
|
34
|
+
"@layerstack/utils": "1.0.0",
|
|
25
35
|
"@mdi/js": "7.4.47",
|
|
26
36
|
"@melt-ui/svelte": "0.86.3",
|
|
27
37
|
"@oslojs/crypto": "1.0.1",
|
|
28
38
|
"@oslojs/encoding": "1.1.0",
|
|
29
39
|
"@oslojs/otp": "1.1.0",
|
|
30
40
|
"@types/nodemailer": "6.4.14",
|
|
31
|
-
"arctic": "3.
|
|
41
|
+
"arctic": "3.6.0",
|
|
32
42
|
"bcryptjs": "3.0.2",
|
|
33
43
|
"clsx": "2.1.1",
|
|
34
44
|
"cron": "4.1.0",
|
|
@@ -39,8 +49,8 @@
|
|
|
39
49
|
"tailwind-merge": "2.6.0",
|
|
40
50
|
"tailwindcss": "3.4.4",
|
|
41
51
|
"vite": "6.2.2",
|
|
42
|
-
"vite-plugin-kit-routes": "0.8.
|
|
43
|
-
"vite-plugin-stripper": "0.9.0
|
|
52
|
+
"vite-plugin-kit-routes": "0.8.4",
|
|
53
|
+
"vite-plugin-stripper": "0.9.0"
|
|
44
54
|
},
|
|
45
55
|
"sideEffects": false,
|
|
46
56
|
"bin": "./esm/bin/cmd.js",
|
|
@@ -50,9 +60,14 @@
|
|
|
50
60
|
"svelte": "./esm/index.js",
|
|
51
61
|
"default": "./esm/index.js"
|
|
52
62
|
},
|
|
53
|
-
"./
|
|
54
|
-
"types": "./esm/
|
|
55
|
-
"default": "./esm/
|
|
63
|
+
"./server": {
|
|
64
|
+
"types": "./esm/server/index.d.ts",
|
|
65
|
+
"default": "./esm/server/index.js"
|
|
66
|
+
},
|
|
67
|
+
"./svelte": {
|
|
68
|
+
"types": "./esm/svelte/index.d.ts",
|
|
69
|
+
"svelte": "./esm/svelte/index.js",
|
|
70
|
+
"default": "./esm/svelte/index.js"
|
|
56
71
|
},
|
|
57
72
|
"./vite": {
|
|
58
73
|
"types": "./esm/vite/index.d.ts",
|
|
@@ -65,7 +80,7 @@
|
|
|
65
80
|
"types": "./esm/formats/index.d.ts",
|
|
66
81
|
"default": "./esm/formats/index.js"
|
|
67
82
|
},
|
|
68
|
-
"./auth
|
|
83
|
+
"./auth": {
|
|
69
84
|
"types": "./esm/auth/index.d.ts",
|
|
70
85
|
"default": "./esm/auth/index.js"
|
|
71
86
|
},
|
|
@@ -73,7 +88,7 @@
|
|
|
73
88
|
"types": "./esm/auth/server/index.d.ts",
|
|
74
89
|
"default": "./esm/auth/server/index.js"
|
|
75
90
|
},
|
|
76
|
-
"./changeLog
|
|
91
|
+
"./changeLog": {
|
|
77
92
|
"types": "./esm/changeLog/index.d.ts",
|
|
78
93
|
"default": "./esm/changeLog/index.js"
|
|
79
94
|
},
|
|
@@ -85,7 +100,7 @@
|
|
|
85
100
|
"types": "./esm/cron/server/index.d.ts",
|
|
86
101
|
"default": "./esm/cron/server/index.js"
|
|
87
102
|
},
|
|
88
|
-
"./feedback
|
|
103
|
+
"./feedback": {
|
|
89
104
|
"types": "./esm/feedback/index.d.ts",
|
|
90
105
|
"default": "./esm/feedback/index.js"
|
|
91
106
|
},
|
|
@@ -93,7 +108,7 @@
|
|
|
93
108
|
"types": "./esm/feedback/server/index.d.ts",
|
|
94
109
|
"default": "./esm/feedback/server/index.js"
|
|
95
110
|
},
|
|
96
|
-
"./mail
|
|
111
|
+
"./mail": {
|
|
97
112
|
"types": "./esm/mail/index.d.ts",
|
|
98
113
|
"default": "./esm/mail/index.js"
|
|
99
114
|
},
|
package/esm/api/index.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { RequestEvent } from '@sveltejs/kit';
|
|
2
|
-
import { type ClassType } from 'remult';
|
|
3
|
-
import type { RemultServerOptions } from 'remult/server';
|
|
4
|
-
import { Log } from '@kitql/helpers';
|
|
5
|
-
type ModuleInput = {
|
|
6
|
-
/**
|
|
7
|
-
* The name of the module (usefull for logging and debugging purposes)
|
|
8
|
-
*/
|
|
9
|
-
name: string;
|
|
10
|
-
priority?: number;
|
|
11
|
-
entities?: ClassType<any>[];
|
|
12
|
-
controllers?: ClassType<any>[];
|
|
13
|
-
initApi?: RemultServerOptions<RequestEvent>['initApi'];
|
|
14
|
-
initRequest?: RemultServerOptions<RequestEvent>['initRequest'];
|
|
15
|
-
modules?: Module[];
|
|
16
|
-
};
|
|
17
|
-
export declare class Module {
|
|
18
|
-
name: string;
|
|
19
|
-
log: Log;
|
|
20
|
-
priority?: number;
|
|
21
|
-
entities?: ClassType<any>[];
|
|
22
|
-
controllers?: ClassType<any>[];
|
|
23
|
-
initApi?: RemultServerOptions<RequestEvent>['initApi'];
|
|
24
|
-
initRequest?: RemultServerOptions<RequestEvent>['initRequest'];
|
|
25
|
-
modules?: Module[];
|
|
26
|
-
constructor(input: ModuleInput);
|
|
27
|
-
}
|
|
28
|
-
type Options = RemultServerOptions<RequestEvent<Partial<Record<string, string>>, string | null>> & {
|
|
29
|
-
modules?: Module[] | undefined;
|
|
30
|
-
};
|
|
31
|
-
declare module 'remult' {
|
|
32
|
-
interface RemultContext {
|
|
33
|
-
request: RequestEvent;
|
|
34
|
-
setHeaders(headers: Record<string, string>): void;
|
|
35
|
-
setCookie(...args: Parameters<RequestEvent['cookies']['set']>): void;
|
|
36
|
-
deleteCookie(...args: Parameters<RequestEvent['cookies']['delete']>): void;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
export declare let entities: ClassType<any>[];
|
|
40
|
-
/**
|
|
41
|
-
* it's basically `remultSveltekit` with the `modules` option
|
|
42
|
-
* @deprecated will be done directly in remult when modules will be in 😉
|
|
43
|
-
*/
|
|
44
|
-
export declare const firstly: (o: Options) => import("remult/remult-sveltekit").RemultSveltekitServer;
|
|
45
|
-
/**
|
|
46
|
-
* Full flat and ordered list by index and concatenaining the modules name
|
|
47
|
-
*/
|
|
48
|
-
export declare const modulesFlatAndOrdered: (modules: Module[]) => Module[];
|
|
49
|
-
export {};
|
package/esm/api/index.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import {} from 'remult';
|
|
2
|
-
import { remultSveltekit } from 'remult/remult-sveltekit';
|
|
3
|
-
import { Log } from '@kitql/helpers';
|
|
4
|
-
import { building } from '$app/environment';
|
|
5
|
-
import { sveltekit } from '../sveltekit/server';
|
|
6
|
-
export class Module {
|
|
7
|
-
name;
|
|
8
|
-
log;
|
|
9
|
-
priority;
|
|
10
|
-
entities;
|
|
11
|
-
controllers;
|
|
12
|
-
initApi;
|
|
13
|
-
initRequest;
|
|
14
|
-
modules;
|
|
15
|
-
constructor(input) {
|
|
16
|
-
this.name = input.name;
|
|
17
|
-
this.log = new Log(`firstly | ${this.name}`);
|
|
18
|
-
this.priority = input.priority;
|
|
19
|
-
this.entities = input.entities;
|
|
20
|
-
this.controllers = input.controllers;
|
|
21
|
-
this.initApi = input.initApi;
|
|
22
|
-
this.initRequest = input.initRequest;
|
|
23
|
-
this.modules = input.modules;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export let entities = [];
|
|
27
|
-
/**
|
|
28
|
-
* it's basically `remultSveltekit` with the `modules` option
|
|
29
|
-
* @deprecated will be done directly in remult when modules will be in 😉
|
|
30
|
-
*/
|
|
31
|
-
export const firstly = (o) => {
|
|
32
|
-
const modulesSorted = modulesFlatAndOrdered([
|
|
33
|
-
...[...(o.modules ?? []), sveltekit()],
|
|
34
|
-
new Module({
|
|
35
|
-
name: 'default',
|
|
36
|
-
entities: o.entities ?? [],
|
|
37
|
-
controllers: o.controllers ?? [],
|
|
38
|
-
initRequest: o.initRequest,
|
|
39
|
-
initApi: o.initApi,
|
|
40
|
-
}),
|
|
41
|
-
]);
|
|
42
|
-
entities = modulesSorted.flatMap((m) => m.entities ?? []);
|
|
43
|
-
return remultSveltekit({
|
|
44
|
-
// Changing the default default of remult
|
|
45
|
-
logApiEndPoints: false,
|
|
46
|
-
admin: true,
|
|
47
|
-
defaultGetLimit: 25,
|
|
48
|
-
error: o.error
|
|
49
|
-
? o.error
|
|
50
|
-
: async (e) => {
|
|
51
|
-
// REMULT P2: validation error should probably be 409
|
|
52
|
-
// if 400 we move to 409
|
|
53
|
-
if (e.httpStatusCode == 400) {
|
|
54
|
-
e.sendError(409, e.responseBody);
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
// Add user configuration
|
|
58
|
-
...o,
|
|
59
|
-
// Module part
|
|
60
|
-
entities,
|
|
61
|
-
controllers: modulesSorted.flatMap((m) => m.controllers ?? []),
|
|
62
|
-
initRequest: async (kitEvent, op) => {
|
|
63
|
-
for (let i = 0; i < modulesSorted.length; i++) {
|
|
64
|
-
const f = modulesSorted[i].initRequest;
|
|
65
|
-
if (f) {
|
|
66
|
-
try {
|
|
67
|
-
await f(kitEvent, op);
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
modulesSorted[i].log.error(error);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
initApi: async (r) => {
|
|
76
|
-
if (!building) {
|
|
77
|
-
for (let i = 0; i < modulesSorted.length; i++) {
|
|
78
|
-
const f = modulesSorted[i].initApi;
|
|
79
|
-
if (f) {
|
|
80
|
-
try {
|
|
81
|
-
await f(r);
|
|
82
|
-
}
|
|
83
|
-
catch (error) {
|
|
84
|
-
modulesSorted[i].log.error(error);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* Full flat and ordered list by index and concatenaining the modules name
|
|
94
|
-
*/
|
|
95
|
-
export const modulesFlatAndOrdered = (modules) => {
|
|
96
|
-
const flattenModules = (modules, parentName = '') => {
|
|
97
|
-
return modules.reduce((acc, module) => {
|
|
98
|
-
const fullName = parentName ? `${parentName}-${module.name}` : module.name;
|
|
99
|
-
// Create a new module object without the 'modules' property
|
|
100
|
-
const { modules: _, ...flatModule } = module;
|
|
101
|
-
const newModule = { ...flatModule, name: fullName };
|
|
102
|
-
const subModules = module.modules ? flattenModules(module.modules, fullName) : [];
|
|
103
|
-
return [...acc, newModule, ...subModules];
|
|
104
|
-
}, []);
|
|
105
|
-
};
|
|
106
|
-
const flatModules = flattenModules(modules);
|
|
107
|
-
flatModules.sort((a, b) => (a.priority || 0) - (b.priority || 0));
|
|
108
|
-
return flatModules;
|
|
109
|
-
};
|
|
File without changes
|