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.
Files changed (83) hide show
  1. package/AGENTS.md +44 -98
  2. package/README.md +121 -7
  3. package/agents/framework/AGENTS.md +133 -886
  4. package/agents/project/AGENTS.md +70 -127
  5. package/agents/project/client/AGENTS.md +22 -93
  6. package/agents/project/client/pages/AGENTS.md +24 -26
  7. package/agents/project/server/routes/AGENTS.md +10 -8
  8. package/agents/project/server/services/AGENTS.md +22 -159
  9. package/agents/project/tests/AGENTS.md +11 -8
  10. package/cli/app/config.ts +7 -20
  11. package/cli/bin.js +8 -0
  12. package/cli/commands/command.ts +243 -0
  13. package/cli/commands/commandLocalRunner.js +198 -0
  14. package/cli/commands/deploy/web.ts +1 -2
  15. package/cli/commands/dev.ts +96 -1
  16. package/cli/commands/doctor.ts +8 -74
  17. package/cli/commands/explain.ts +8 -186
  18. package/cli/commands/trace.ts +228 -0
  19. package/cli/compiler/artifacts/commands.ts +217 -0
  20. package/cli/compiler/artifacts/manifest.ts +35 -21
  21. package/cli/compiler/artifacts/services.ts +300 -1
  22. package/cli/compiler/client/index.ts +43 -8
  23. package/cli/compiler/common/commands.ts +175 -0
  24. package/cli/compiler/common/index.ts +1 -1
  25. package/cli/compiler/common/proteumManifest.ts +15 -114
  26. package/cli/compiler/index.ts +25 -2
  27. package/cli/compiler/server/index.ts +31 -6
  28. package/cli/paths.ts +16 -1
  29. package/cli/presentation/commands.ts +59 -5
  30. package/cli/presentation/devSession.ts +5 -0
  31. package/cli/runtime/commands.ts +60 -1
  32. package/cli/tsconfig.json +4 -1
  33. package/cli/utils/check.ts +1 -1
  34. package/client/app/component.tsx +13 -9
  35. package/client/dev/profiler/index.tsx +1511 -0
  36. package/client/dev/profiler/noop.tsx +5 -0
  37. package/client/dev/profiler/runtime.noop.ts +116 -0
  38. package/client/dev/profiler/runtime.ts +840 -0
  39. package/client/services/router/components/router.tsx +30 -2
  40. package/client/services/router/index.tsx +27 -3
  41. package/client/services/router/request/api.ts +133 -17
  42. package/commands/proteum/diagnostics.ts +11 -0
  43. package/common/dev/commands.ts +50 -0
  44. package/common/dev/diagnostics.ts +298 -0
  45. package/common/dev/profiler.ts +91 -0
  46. package/common/dev/proteumManifest.ts +135 -0
  47. package/common/dev/requestTrace.ts +109 -0
  48. package/common/env/proteumEnv.ts +284 -0
  49. package/common/router/index.ts +4 -22
  50. package/docs/dev-commands.md +86 -0
  51. package/docs/request-tracing.md +122 -0
  52. package/package.json +1 -2
  53. package/server/app/commands.ts +35 -370
  54. package/server/app/commandsManager.ts +393 -0
  55. package/server/app/container/config.ts +11 -49
  56. package/server/app/container/console/index.ts +2 -3
  57. package/server/app/container/index.ts +5 -2
  58. package/server/app/container/trace/index.ts +364 -0
  59. package/server/app/devCommands.ts +192 -0
  60. package/server/app/devDiagnostics.ts +53 -0
  61. package/server/app/index.ts +27 -4
  62. package/server/services/cron/CronTask.ts +73 -5
  63. package/server/services/cron/index.ts +34 -11
  64. package/server/services/fetch/index.ts +3 -10
  65. package/server/services/prisma/index.ts +66 -4
  66. package/server/services/router/http/index.ts +151 -0
  67. package/server/services/router/index.ts +200 -12
  68. package/server/services/router/request/api.ts +30 -1
  69. package/server/services/router/response/index.ts +83 -10
  70. package/server/services/router/response/page/document.tsx +16 -0
  71. package/server/services/router/response/page/index.tsx +27 -1
  72. package/skills/clean-project-code/SKILL.md +7 -2
  73. package/test-results/.last-run.json +4 -0
  74. package/types/aliases.d.ts +6 -0
  75. package/types/global/utils.d.ts +7 -14
  76. package/Rte.zip +0 -0
  77. package/agents/project/agents.md.zip +0 -0
  78. package/doc/TODO.md +0 -71
  79. package/doc/front/router.md +0 -27
  80. package/doc/workspace/workspace.png +0 -0
  81. package/doc/workspace/workspace2.png +0 -0
  82. package/doc/workspace/workspace_26.01.22.png +0 -0
  83. 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
- ```
@@ -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
@@ -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
- }