proteum 1.0.0 → 1.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.
Files changed (70) hide show
  1. package/AGENTS.md +9 -0
  2. package/cli/app/config.ts +61 -0
  3. package/cli/app/index.ts +227 -0
  4. package/cli/bin.js +35 -0
  5. package/cli/commands/build.ts +60 -0
  6. package/cli/commands/deploy/app.ts +29 -0
  7. package/cli/commands/deploy/web.ts +60 -0
  8. package/cli/commands/dev.ts +124 -0
  9. package/cli/commands/init.ts +85 -0
  10. package/cli/commands/refresh.ts +18 -0
  11. package/cli/compiler/client/identite.ts +69 -0
  12. package/cli/compiler/client/index.ts +343 -0
  13. package/cli/compiler/common/babel/index.ts +173 -0
  14. package/cli/compiler/common/babel/plugins/index.ts +0 -0
  15. package/cli/compiler/common/babel/plugins/services.ts +586 -0
  16. package/cli/compiler/common/babel/routes/imports.ts +127 -0
  17. package/cli/compiler/common/babel/routes/routes.ts +1170 -0
  18. package/cli/compiler/common/files/autres.ts +39 -0
  19. package/cli/compiler/common/files/images.ts +42 -0
  20. package/cli/compiler/common/files/style.ts +82 -0
  21. package/cli/compiler/common/index.ts +165 -0
  22. package/cli/compiler/index.ts +585 -0
  23. package/cli/compiler/server/index.ts +220 -0
  24. package/cli/index.ts +213 -0
  25. package/cli/paths.ts +165 -0
  26. package/cli/print.ts +12 -0
  27. package/cli/tsconfig.json +42 -0
  28. package/cli/utils/index.ts +22 -0
  29. package/cli/utils/keyboard.ts +78 -0
  30. package/client/app/index.ts +2 -0
  31. package/client/components/Dialog/Manager.tsx +3 -49
  32. package/client/components/Dialog/index.less +3 -1
  33. package/client/components/index.ts +1 -2
  34. package/client/services/router/index.tsx +6 -16
  35. package/common/errors/index.tsx +12 -31
  36. package/package.json +58 -22
  37. package/server/app/container/config.ts +20 -1
  38. package/server/app/container/console/index.ts +1 -1
  39. package/server/services/auth/index.ts +62 -27
  40. package/server/services/auth/router/request.ts +17 -6
  41. package/server/services/router/http/index.ts +3 -3
  42. package/server/services/router/response/index.ts +1 -1
  43. package/server/services/schema/request.ts +28 -10
  44. package/server/utils/slug.ts +0 -3
  45. package/tsconfig.common.json +2 -1
  46. package/types/global/constants.d.ts +12 -0
  47. package/changelog.md +0 -5
  48. package/client/components/Button.tsx +0 -298
  49. package/client/components/Dialog/card.tsx +0 -208
  50. package/client/data/input.ts +0 -32
  51. package/client/pages/bug.tsx.old +0 -60
  52. package/templates/composant.tsx +0 -40
  53. package/templates/form.ts +0 -30
  54. package/templates/modal.tsx +0 -47
  55. package/templates/modele.ts +0 -56
  56. package/templates/page.tsx +0 -74
  57. package/templates/route.ts +0 -43
  58. package/templates/service.ts +0 -75
  59. package/vscode/copyimportationpath/.eslintrc.json +0 -24
  60. package/vscode/copyimportationpath/.vscodeignore +0 -12
  61. package/vscode/copyimportationpath/CHANGELOG.md +0 -9
  62. package/vscode/copyimportationpath/README.md +0 -3
  63. package/vscode/copyimportationpath/copyimportationpath-0.0.1.vsix +0 -0
  64. package/vscode/copyimportationpath/out/extension.js +0 -206
  65. package/vscode/copyimportationpath/out/extension.js.map +0 -1
  66. package/vscode/copyimportationpath/package-lock.json +0 -4536
  67. package/vscode/copyimportationpath/package.json +0 -86
  68. package/vscode/copyimportationpath/src/extension.ts +0 -300
  69. package/vscode/copyimportationpath/tsconfig.json +0 -22
  70. package/vscode/copyimportationpath/vsc-extension-quickstart.md +0 -42
@@ -1,208 +0,0 @@
1
- /*----------------------------------
2
- - DEPENDANCES
3
- ----------------------------------*/
4
-
5
- // Npm
6
- import React from 'react';
7
-
8
- // Composants globaux
9
- import Button from '@client/components/Button';
10
-
11
- /*----------------------------------
12
- - TYPES
13
- ----------------------------------*/
14
- import { ComponentChild } from 'preact';
15
-
16
- type funcBtns = () => void
17
-
18
- type Boutons = { [label: string]: funcBtns }
19
-
20
- /*----------------------------------
21
- - CONTENU
22
- ----------------------------------*/
23
- export type Props = {
24
-
25
- // Informations modale
26
- type?: 'primary' | 'success' | 'warning' | 'error' | 'loading' | 'info',
27
- cover?: string,
28
- icon?: ComponentChild,
29
- title?: string | ComponentChild,
30
- className?: string,
31
-
32
- children?: ComponentChild,
33
- isToast?: boolean,
34
- width?: number,
35
-
36
- footer?: ComponentChild,
37
- boutons?: Boutons | null, // nul = pas de footer
38
- defaultBtn?: string,
39
-
40
- prison?: boolean,
41
- /* Hide after x seconds */autohide?: number | false,
42
- close?: funcBtns,
43
- onClose?: () => Promise<any>,
44
- }
45
-
46
- export default ({
47
-
48
- // Content
49
- type,
50
- cover,
51
- icon,
52
- title,
53
- className = '',
54
-
55
- children,
56
- isToast,
57
- width,
58
-
59
- footer,
60
- boutons,
61
- defaultBtn,
62
-
63
- onClose,
64
- close,
65
- autohide,
66
- prison,
67
-
68
- }: Props) => {
69
-
70
- // Boutons
71
- if (footer === undefined && boutons !== null) {
72
-
73
- // Default buttons
74
- if (boutons === undefined || !Object.keys(boutons).length) {
75
-
76
- // Toast: by default, if no buttons, we autohide after 3 seconds
77
- if (autohide === undefined)
78
- autohide = 3;
79
-
80
- // If isToast, we show a default OK button
81
- if (close && !isToast)
82
- boutons = { 'Ok': () => close(true) };
83
- else
84
- boutons = null;
85
-
86
- }
87
-
88
- if (boutons !== null) {
89
-
90
- const nbBtns = Object.keys(boutons).length;
91
-
92
- footer = Object.entries(boutons).map(([texte, action]: [string, Function], index: number) => {
93
- const dernier = nbBtns > 1 && index === nbBtns - 1;
94
- return (
95
- <Button
96
- async
97
- onClick={() => action()}
98
- type={(defaultBtn === undefined ? dernier : (defaultBtn === texte)) ? 'primary' : undefined}
99
- >
100
- {texte}
101
- </Button>
102
- )
103
- });
104
- }
105
- }
106
-
107
- if (typeof icon === 'string')
108
- icon = <i class={"svg-" + icon} />
109
- else if (icon === undefined)
110
- switch (type) {
111
- case 'info':
112
- icon = <i src="info-circle" />
113
- break;
114
- case 'success':
115
- icon = <i src="check-circle" />
116
- break;
117
- case 'warning':
118
- icon = <i src="exclamation-circle" />
119
- break;
120
- case 'error':
121
- icon = <i src="times-circle" />
122
- break;
123
- case 'loading':
124
- icon = <i src="spin" />
125
- break;
126
- }
127
-
128
- // Autohide
129
- if (isToast)
130
- React.useEffect(() => {
131
- if (autohide) {
132
- const timeout = setTimeout(() => close(true), autohide * 1000);
133
- return () => clearTimeout(timeout);
134
- }
135
- }, []);
136
-
137
- let render = isToast ? (
138
- <div class="card row bg dark" onClick={() => isToast && !prison && close(true)}>
139
-
140
- {icon}
141
-
142
- <div>
143
-
144
- {typeof title === "string" ? (
145
- <strong>{title}</strong>
146
- ) : title}
147
-
148
- {children}
149
-
150
- </div>
151
-
152
- </div>
153
- ) : (
154
- <div class={"card pd-2 col al-top " + className} style={width === undefined
155
- ? {}
156
- : { minWidth: width + "px", maxWidth: width + "px" }
157
- }>
158
-
159
- {(title || icon) && (
160
- <header {...{
161
- class: ('col ' + type),
162
- style: cover ? {
163
- backgroundImage: 'url(' + cover + ')'
164
- } : undefined
165
- }}>
166
-
167
- {icon}
168
-
169
- {typeof title === "string" ? (
170
- <strong>{title}</strong>
171
- ) : title}
172
-
173
- {(!prison && close) && (
174
- <Button class="close" icon="times" size="s" shape="pill" onClick={async () => {
175
- if (typeof close === "function") {
176
-
177
- if (onClose !== undefined)
178
- onClose(false);
179
- else
180
- close(false);
181
- }
182
- }} />
183
- )}
184
-
185
- </header>
186
- )}
187
-
188
- {children && (
189
- <div class="col content">
190
-
191
- {children}
192
-
193
- </div>
194
- )}
195
-
196
- {footer && (
197
- <footer class="row fill actions">
198
-
199
- {footer}
200
-
201
- </footer>
202
- )}
203
-
204
- </div>
205
- )
206
-
207
- return render;
208
- }
@@ -1,32 +0,0 @@
1
- /*----------------------------------
2
- - DEPENDANCES
3
- ----------------------------------*/
4
-
5
- // Libs métier
6
- import buildValidators, { champ } from '@common/data/input/validators/build';
7
- import { validateurFichier, TOptsValidateurFichier } from '@common/data/input/validators/basic';
8
-
9
- /*----------------------------------
10
- - VALIDATEURS
11
- ----------------------------------*/
12
-
13
- export default buildValidators({
14
-
15
- file: ({ ...opts }: TOptsValidateurFichier & {}) => champ<object>('fichier', {
16
- ...opts,
17
- valider: async (val: any, donneesSaisie: TObjetDonnees, donneesRetour: TObjetDonnees) => {
18
-
19
- console.log('VALIDER FICHIER COTÉ CLIENT', val);
20
-
21
- // Chaine = url ancien fichier = conservation = sera ignoré coté serveur
22
- if (typeof val === 'string')
23
- return val;
24
-
25
- // Validation universelle
26
- val = await validateurFichier(opts, val, donneesSaisie, donneesRetour);
27
-
28
- return opts.valider ? await opts.valider(val, donneesSaisie, donneesRetour) : val;
29
- }
30
- })
31
-
32
- });
@@ -1,60 +0,0 @@
1
- /*----------------------------------
2
- - DEPENDANCES
3
- ----------------------------------*/
4
- // Npm
5
- import React from 'react';
6
-
7
- // Core components
8
- import { Button, Input } from '@client/components';
9
- import Card, { Props as CardProps } from '@client/components/Dialog/card';
10
-
11
- // Core libs
12
- import useContext from '@/client/context';
13
-
14
- /*----------------------------------
15
- - TYPES
16
- ----------------------------------*/
17
-
18
- export default ({ ...self }: {} & CardProps) => {
19
-
20
- const { api, modal, clientBug } = useContext();
21
-
22
- const [observation, setObservation] = React.useState("");
23
- const [before, setBefore] = React.useState("");
24
-
25
- const send = () => clientBug({ observation, before }).then(() =>
26
- modal.success("Thanks You !", `Your bug report will be review in the next 12 hours.`).then(() =>
27
- self.close(true)
28
- )
29
- );
30
-
31
- const close = () => modal.confirm("Cancel your report ?", "All your changes will not be saved.").then(close =>
32
- close && self.close(true)
33
- );
34
-
35
- self.onClose = close
36
-
37
- return (
38
- <Card {...self} title="Report a problem" footer={<>
39
-
40
- <Button onClick={() => close()}>
41
- Cancel
42
- </Button>
43
-
44
- <Button type="primary" onClick={send}>
45
- Send Report
46
- </Button>
47
-
48
- </>}>
49
-
50
- <p>What's the problem ?</p>
51
-
52
- <Input type="longtext" title="Description of the problem" value={observation} onChange={setObservation} />
53
-
54
- <p>What did you do just before the problem occurs ?</p>
55
-
56
- <Input type="longtext" title="How the problem occured ?" value={before} onChange={setBefore} />
57
-
58
- </Card>
59
- )
60
- }
@@ -1,40 +0,0 @@
1
- // Regex: \/[A-Z][a-zA-Z]+(\/index)?\.tsx$
2
-
3
- /*----------------------------------
4
- - DEPENDENCIES
5
- ----------------------------------*/
6
-
7
- // Npm
8
- import React from 'react';
9
-
10
- // Core libs
11
- import useContext from '@/client/context';
12
-
13
- // Core components
14
- import Button from '@client/components/Button';
15
-
16
- // App
17
-
18
- /*----------------------------------
19
- - TYPES
20
- ----------------------------------*/
21
-
22
- type Props = {
23
-
24
- }
25
-
26
- /*----------------------------------
27
- - COMPONENT
28
- ----------------------------------*/
29
- export default ({ }: Props) => {
30
-
31
- const { api, user } = useContext();
32
-
33
- return (
34
- <div>
35
-
36
- </div>
37
- )
38
-
39
-
40
- }
package/templates/form.ts DELETED
@@ -1,30 +0,0 @@
1
- // Regex: \/common\/forms\/.+\.ts$
2
-
3
- /*----------------------------------
4
- - DEPENDANCES
5
- ----------------------------------*/
6
-
7
- // Core libs
8
- import schema from '@validator';
9
-
10
- // Core components
11
- import Input from '@client/components/input';
12
-
13
- /*----------------------------------
14
- - TYPES
15
- ----------------------------------*/
16
-
17
- export type TFormData = {
18
- email: string
19
- }
20
-
21
- /*----------------------------------
22
- - VALIDTEURS
23
- ----------------------------------*/
24
- // Rappel: Les validateurs associés au type de la propriété sont executés en priorité
25
- export default schema.new({
26
- email: schema.string({
27
- rendu: Input,
28
- titre: "Your Email Address",
29
- }),
30
- })
@@ -1,47 +0,0 @@
1
- // Regex: \/Modal([A-Z][a-zA-Z]+)?\.tsx$
2
-
3
- /*----------------------------------
4
- - DEPENDANCES
5
- ----------------------------------*/
6
-
7
- // Npm
8
- import React from 'react';
9
-
10
- // Cre libs
11
- import useContext from '@/client/context';
12
-
13
- // Core components
14
- import Card, { Props as CardProps } from '@client/components/Dialog/card';
15
- import Button from '@client/components/Button';
16
-
17
- /*----------------------------------
18
- - COMPOSANT
19
- ----------------------------------*/
20
- export default ({ close, ...props }: Partial<CardProps>) => {
21
-
22
- const { api, modal } = useContext();
23
-
24
- const send = () => api.post('/auth/getinvite', { }).then(() => {
25
-
26
- modal.success('Yeah !', "It's ok");
27
- close(true);
28
-
29
- });
30
-
31
- return (
32
- <div class="card col" title="Hello" {...props}>
33
-
34
- <header class="row">
35
- <h2>Hello</h2>
36
- </header>
37
-
38
- <p>This is a text</p>
39
-
40
- <footer class="row actions fill">
41
- <Button iconR="long-arrow-right" async onClick={send}>
42
- Continue
43
- </Button>
44
- </footer>
45
- </div>
46
- )
47
- }
@@ -1,56 +0,0 @@
1
- // Regex: \/server\/models\/.+\.ts$
2
-
3
- /*----------------------------------
4
- - DEPENDANCES
5
- ----------------------------------*/
6
- import Modele, {
7
- // Définitions
8
- Table, Column, API, Scopes,
9
- // Associations
10
- HasOne, HasMany
11
- } from '@serveur/database/modele';
12
-
13
- import Query from '@serveur/database/jsql/query/runner';
14
-
15
- /*----------------------------------
16
- - IMPORTATIONS TYPES
17
- ----------------------------------*/
18
-
19
- import { Utilisateur } from '@modeles';
20
-
21
- /*----------------------------------
22
- - DEFINITIONS TYPES
23
- ----------------------------------*/
24
-
25
-
26
- /*----------------------------------
27
- - MODELE
28
- ----------------------------------*/
29
- @Scopes([])
30
- @Table('content', 'ModuleNames')
31
- export default class ModuleName extends Modele {
32
-
33
- /*----------------------------------
34
- - IDENTIFICATION
35
- ----------------------------------*/
36
- @API() @Column()
37
- public id!: number;
38
-
39
- /*----------------------------------
40
- - AFFICHAGE
41
- ----------------------------------*/
42
-
43
- @API() @Column()
44
- public titre!: string;
45
-
46
- @Column()
47
- public createur_id!: number;
48
- @API() @HasOne(() => Utilisateur, { fk: 'createur_id' })
49
- public createur?: Utilisateur;
50
-
51
- /*----------------------------------
52
- - SCOPES
53
- ----------------------------------*/
54
- /*public static StatusStatic = () =>
55
- new Query<ModuleName>(Scope, {})*/
56
- }
@@ -1,74 +0,0 @@
1
- // Regex: \/client\/pages\/(?<PATH>.+)\.tsx$
2
-
3
- /*----------------------------------
4
- - DEPENDANCES
5
- ----------------------------------*/
6
-
7
- // Npm
8
- import React from 'react';
9
-
10
- // Core
11
- import route from '@router';
12
- import { useState } from '@/client/context';
13
-
14
- // Core components
15
- import Button from '@client/components/Button';
16
-
17
- // App
18
- import Page from '@client/pages/_layout/app/Page';
19
- import type { NAME } from '@/server/libs/PATH';
20
-
21
- /*----------------------------------
22
- - CONTROLEUR
23
- ----------------------------------*/
24
- route.page('/PATH', { }, ({}, { api }) => ({
25
-
26
- NAMELOWERs: api.get('/PATH')
27
-
28
- }), ({ NAMELOWERs }, { api, modal, toast, user }) => {
29
-
30
- /*----------------------------------
31
- - STATE
32
- ----------------------------------*/
33
-
34
- const [{ state }, setState] = useState<{
35
- state: string
36
- }>({
37
- state: ""
38
- });
39
-
40
- /*----------------------------------
41
- - ACTIONS
42
- ----------------------------------*/
43
-
44
- const action = () => api.post('/PATH', { }).then(() => {
45
- modal.success('Yeah !', "It's ok");
46
- close(true);
47
- });
48
-
49
- /*----------------------------------
50
- - RENDER
51
- ----------------------------------*/
52
- return (
53
- <Page breadcrumb={{ Parent: null }} title="NAME" subtitle="Subtitle" actions={<>
54
-
55
- <ul id="actions" class="row al-left wrap">
56
-
57
- <li class="row stat m card color-1">
58
- <i src="wallet" class="solid" />
59
- <div class="label">
60
- Name
61
- <strong>Number</strong>
62
- </div>
63
- </li>
64
-
65
- </ul>
66
-
67
- </>}>
68
-
69
-
70
-
71
- </Page>
72
- )
73
-
74
- });
@@ -1,43 +0,0 @@
1
- // Regex: \/server\/routes\/(?<PATH>.+)\.ts$
2
-
3
- /*----------------------------------
4
- - DEPENDANCES
5
- ----------------------------------*/
6
-
7
- // Core
8
- import route from '@router';
9
-
10
- // App
11
- import NAME from '@/server/libs/PATH';
12
-
13
- /*----------------------------------
14
- - ROUTES
15
- ----------------------------------*/
16
-
17
- route.get('/PATH', async ({ user, request }) => {
18
-
19
- return await NAME.List(user, false, request);
20
-
21
- });
22
-
23
- route.get('/PATH/:id', async ({ schema, user }) => {
24
-
25
- const { id } = await schema.validate({
26
- id: schema.string()
27
- });
28
-
29
- return await NAME.Get(id, user);
30
-
31
- });
32
-
33
- route.post('/PATH/:id', async ({ auth, schema }) => {
34
-
35
- const user = await auth.check("USER");
36
-
37
- const { id } = await schema.validate({
38
- id: schema.string(),
39
- });
40
-
41
- return await NAME.Action(id, user);
42
-
43
- });
@@ -1,75 +0,0 @@
1
- // Regex: \/server\/libs\/.+\.ts$
2
-
3
- /*----------------------------------
4
- - DEPENDANCES
5
- ----------------------------------*/
6
-
7
- // Npm
8
-
9
- // Core
10
- import { $ } from '@server/app';
11
-
12
- // App
13
- import User from '@/server/models';
14
-
15
- /*----------------------------------
16
- - CONFIG
17
- ----------------------------------*/
18
-
19
-
20
-
21
- /*----------------------------------
22
- - TYPES
23
- ----------------------------------*/
24
-
25
-
26
- /*----------------------------------
27
- - SERVICE
28
- ----------------------------------*/
29
- class NAMEs {
30
-
31
- /*----------------------------------
32
- - INFORMATIONS
33
- ----------------------------------*/
34
- public async List( user: User | null ): Promise<NAME[]> {
35
-
36
- const NAMELOWER = await $.sql<NAME>`
37
- SELECT
38
- id
39
- FROM core.NAME
40
- ORDER BY date DESC
41
- LIMIT 25
42
- `.all();
43
-
44
- return NAMELOWER;
45
-
46
- }
47
-
48
- public async Get( id: string, user: User ): Promise<NAME> {
49
-
50
- const NAMELOWERs = await $.sql<NAME>`
51
- SELECT
52
- id
53
- FROM core.NAME
54
- WHERE id = ${id}
55
- `.firstOrFail();
56
-
57
- return NAMELOWERs;
58
-
59
- }
60
-
61
- /*----------------------------------
62
- - ACTIONS
63
- ----------------------------------*/
64
- public async Action( id: string, user: User ): Promise<NAME> {
65
-
66
- const NAMELOWER = await this.Get(id, user);
67
-
68
- return true;
69
-
70
- }
71
-
72
-
73
- }
74
-
75
- export default new NAMEs
@@ -1,24 +0,0 @@
1
- {
2
- "root": true,
3
- "parser": "@typescript-eslint/parser",
4
- "parserOptions": {
5
- "ecmaVersion": 6,
6
- "sourceType": "module"
7
- },
8
- "plugins": [
9
- "@typescript-eslint"
10
- ],
11
- "rules": {
12
- "@typescript-eslint/naming-convention": "warn",
13
- "@typescript-eslint/semi": "warn",
14
- "curly": "warn",
15
- "eqeqeq": "warn",
16
- "no-throw-literal": "warn",
17
- "semi": "off"
18
- },
19
- "ignorePatterns": [
20
- "out",
21
- "dist",
22
- "**/*.d.ts"
23
- ]
24
- }