proteum 2.1.0 → 2.1.1
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/AGENTS.md +44 -98
- package/README.md +121 -7
- package/agents/framework/AGENTS.md +133 -886
- package/agents/project/AGENTS.md +70 -127
- package/agents/project/client/AGENTS.md +22 -93
- package/agents/project/client/pages/AGENTS.md +24 -26
- package/agents/project/server/routes/AGENTS.md +10 -8
- package/agents/project/server/services/AGENTS.md +22 -159
- package/agents/project/tests/AGENTS.md +11 -8
- package/cli/app/config.ts +7 -20
- package/cli/bin.js +8 -0
- package/cli/commands/command.ts +243 -0
- package/cli/commands/commandLocalRunner.js +198 -0
- package/cli/commands/deploy/web.ts +1 -2
- package/cli/commands/dev.ts +96 -1
- package/cli/commands/doctor.ts +8 -74
- package/cli/commands/explain.ts +8 -186
- package/cli/commands/trace.ts +228 -0
- package/cli/compiler/artifacts/commands.ts +217 -0
- package/cli/compiler/artifacts/manifest.ts +35 -21
- package/cli/compiler/artifacts/services.ts +300 -1
- package/cli/compiler/client/index.ts +43 -8
- package/cli/compiler/common/commands.ts +175 -0
- package/cli/compiler/common/index.ts +1 -1
- package/cli/compiler/common/proteumManifest.ts +15 -114
- package/cli/compiler/index.ts +25 -2
- package/cli/compiler/server/index.ts +31 -6
- package/cli/paths.ts +16 -1
- package/cli/presentation/commands.ts +59 -5
- package/cli/presentation/devSession.ts +5 -0
- package/cli/runtime/commands.ts +60 -1
- package/cli/tsconfig.json +4 -1
- package/cli/utils/check.ts +1 -1
- package/client/app/component.tsx +13 -9
- package/client/dev/profiler/index.tsx +1511 -0
- package/client/dev/profiler/noop.tsx +5 -0
- package/client/dev/profiler/runtime.noop.ts +116 -0
- package/client/dev/profiler/runtime.ts +840 -0
- package/client/services/router/components/router.tsx +30 -2
- package/client/services/router/index.tsx +27 -3
- package/client/services/router/request/api.ts +133 -17
- package/commands/proteum/diagnostics.ts +11 -0
- package/common/dev/commands.ts +50 -0
- package/common/dev/diagnostics.ts +298 -0
- package/common/dev/profiler.ts +91 -0
- package/common/dev/proteumManifest.ts +135 -0
- package/common/dev/requestTrace.ts +109 -0
- package/common/env/proteumEnv.ts +284 -0
- package/common/router/index.ts +4 -22
- package/docs/dev-commands.md +86 -0
- package/docs/request-tracing.md +122 -0
- package/package.json +1 -2
- package/server/app/commands.ts +35 -370
- package/server/app/commandsManager.ts +393 -0
- package/server/app/container/config.ts +11 -49
- package/server/app/container/console/index.ts +2 -3
- package/server/app/container/index.ts +5 -2
- package/server/app/container/trace/index.ts +364 -0
- package/server/app/devCommands.ts +192 -0
- package/server/app/devDiagnostics.ts +53 -0
- package/server/app/index.ts +27 -4
- package/server/services/cron/CronTask.ts +73 -5
- package/server/services/cron/index.ts +34 -11
- package/server/services/fetch/index.ts +3 -10
- package/server/services/prisma/index.ts +66 -4
- package/server/services/router/http/index.ts +151 -0
- package/server/services/router/index.ts +200 -12
- package/server/services/router/request/api.ts +30 -1
- package/server/services/router/response/index.ts +83 -10
- package/server/services/router/response/page/document.tsx +16 -0
- package/server/services/router/response/page/index.tsx +27 -1
- package/skills/clean-project-code/SKILL.md +7 -2
- package/test-results/.last-run.json +4 -0
- package/types/aliases.d.ts +6 -0
- package/types/global/utils.d.ts +7 -14
- package/Rte.zip +0 -0
- package/agents/project/agents.md.zip +0 -0
- package/doc/TODO.md +0 -71
- package/doc/front/router.md +0 -27
- package/doc/workspace/workspace.png +0 -0
- package/doc/workspace/workspace2.png +0 -0
- package/doc/workspace/workspace_26.01.22.png +0 -0
- package/server/services/router/http/session.ts.old +0 -40
package/Rte.zip
DELETED
|
Binary file
|
|
Binary file
|
package/doc/TODO.md
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
* Fix erreurs type Client / Server context
|
|
2
|
-
* Server side: ServerContext
|
|
3
|
-
* Client side: ClientContext | ServerContext
|
|
4
|
-
* PageResponse extends Response
|
|
5
|
-
* Toast service
|
|
6
|
-
* ClientApplication hooks
|
|
7
|
-
app.on('bug')
|
|
8
|
-
app.on('error')
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Dependancies injection
|
|
12
|
-
|
|
13
|
-
# Full stack Pages
|
|
14
|
-
|
|
15
|
-
```typescript
|
|
16
|
-
import Router from '@server/services/router';
|
|
17
|
-
import { TRouterContext as ServerServices } from '@server/services/router/response';
|
|
18
|
-
import { TRouterContext as ClientServices } from '@client/services/router/response';
|
|
19
|
-
|
|
20
|
-
abstract class Controller<
|
|
21
|
-
TRouter extends Router,
|
|
22
|
-
TData extends any = any,
|
|
23
|
-
TUserAccess extends string = string
|
|
24
|
-
> {
|
|
25
|
-
|
|
26
|
-
abstract auth: TUserAccess;
|
|
27
|
-
|
|
28
|
-
abstract get( services: ServerServices<TRouter> ): Promise<TData>;
|
|
29
|
-
|
|
30
|
-
abstract render( context: TData, services: ClientServices<TRouter> ): ComponentChild;
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
```typescript
|
|
36
|
-
//? /headhunter/missions/suggested'
|
|
37
|
-
class Missions extends Controller<CrossPath["router"]> {
|
|
38
|
-
|
|
39
|
-
auth = 'USER';
|
|
40
|
-
|
|
41
|
-
async get({ headhunting, response, auth }) {
|
|
42
|
-
|
|
43
|
-
const user = await auth.check('USER');
|
|
44
|
-
|
|
45
|
-
const suggested = await headhunting.missions.Suggest( user );
|
|
46
|
-
|
|
47
|
-
return { suggested }
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
render({ page, api, suggested }) {
|
|
51
|
-
return (
|
|
52
|
-
<Page title="App title here" subtitle="SEO description here">{page.loading || <>
|
|
53
|
-
|
|
54
|
-
<section class="col">
|
|
55
|
-
|
|
56
|
-
<header class="row">
|
|
57
|
-
<h2 class="col-1">Suggested Missions</h2>
|
|
58
|
-
</header>
|
|
59
|
-
|
|
60
|
-
<div class="grid xa3">
|
|
61
|
-
{suggested.map( mission => (
|
|
62
|
-
<MissionCard mission={mission} />
|
|
63
|
-
))}
|
|
64
|
-
</div>
|
|
65
|
-
</section>
|
|
66
|
-
|
|
67
|
-
</>}</Page>
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
```
|
package/doc/front/router.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Disallowed
|
|
2
|
-
|
|
3
|
-
- To destructure page data objects
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
route.page('/withdraw', { bodyId: 'withdraw' }, ({}, { api }) => ({
|
|
7
|
-
|
|
8
|
-
withdraw: api.get('/withdraw')
|
|
9
|
-
|
|
10
|
-
}), ({ withdraw: { history, balance, minimum, fees } }, { api, modal, page, user }) => {
|
|
11
|
-
|
|
12
|
-
...
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Do instead:
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
route.page('/withdraw', { bodyId: 'withdraw' }, ({}, { api }) => ({
|
|
19
|
-
|
|
20
|
-
withdraw: api.get('/withdraw')
|
|
21
|
-
|
|
22
|
-
}), ({ withdraw }, { api, modal, page, user }) => {
|
|
23
|
-
|
|
24
|
-
const { history, balance, minimum, fees } = withdraw;
|
|
25
|
-
|
|
26
|
-
...
|
|
27
|
-
```
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// Npm
|
|
2
|
-
import session from 'express-session';
|
|
3
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
4
|
-
import redisConnector from 'connect-redis';
|
|
5
|
-
const RedisStore = redisConnector(session);
|
|
6
|
-
|
|
7
|
-
// Services
|
|
8
|
-
import type { THttpConfig } from '@server/services/http';
|
|
9
|
-
import Redis from '@server/services/redis';
|
|
10
|
-
|
|
11
|
-
// Middleware
|
|
12
|
-
export const createSessionMiddleware = (httpConfig: THttpConfig) => {
|
|
13
|
-
return session({
|
|
14
|
-
|
|
15
|
-
genid: (req) => {
|
|
16
|
-
return /*req.id;*/uuidv4(); // ID session via UUID
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
name: httpConfig.session.name,
|
|
20
|
-
store: new RedisStore({
|
|
21
|
-
client: Redis.instance,
|
|
22
|
-
ttl: httpConfig.session.duration // secondes
|
|
23
|
-
}),
|
|
24
|
-
secret: httpConfig.session.secret,
|
|
25
|
-
|
|
26
|
-
// Ces deux valeurs sont recommandes avec session filestore
|
|
27
|
-
// https://github.com/valery-barysok/session-file-store/blob/master/examples/express-example/app.js
|
|
28
|
-
resave: true, // Quand false, /admin/console réinitialise la session
|
|
29
|
-
saveUninitialized: true,
|
|
30
|
-
|
|
31
|
-
cookie: {
|
|
32
|
-
maxAge: httpConfig.session.duration * 1000, // millisecondes
|
|
33
|
-
//sameSite: true,
|
|
34
|
-
httpOnly: true,
|
|
35
|
-
// Les variables d'environnement sont des chaines
|
|
36
|
-
secure: httpConfig.ssl,
|
|
37
|
-
path: '/',
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
}
|