proteum 2.1.0 → 2.1.2
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 +143 -10
- package/agents/framework/AGENTS.md +146 -886
- package/agents/project/AGENTS.md +73 -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/create.ts +5 -0
- package/cli/commands/deploy/web.ts +1 -2
- package/cli/commands/dev.ts +98 -2
- package/cli/commands/doctor.ts +8 -74
- package/cli/commands/explain.ts +8 -186
- package/cli/commands/init.ts +2 -94
- 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/index.ts +1 -4
- package/cli/paths.ts +16 -1
- package/cli/presentation/commands.ts +104 -14
- package/cli/presentation/devSession.ts +22 -3
- package/cli/presentation/proteum_logo_400x400_square_icon.txt +400 -0
- package/cli/runtime/commands.ts +121 -4
- package/cli/scaffold/index.ts +720 -0
- package/cli/scaffold/templates.ts +344 -0
- package/cli/scaffold/types.ts +26 -0
- 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 +2511 -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 +92 -0
- package/common/dev/proteumManifest.ts +135 -0
- package/common/dev/requestTrace.ts +115 -0
- package/common/env/proteumEnv.ts +284 -0
- package/common/router/index.ts +4 -22
- package/docs/dev-commands.md +93 -0
- package/docs/diagnostics.md +88 -0
- package/docs/request-tracing.md +132 -0
- package/eslint.js +11 -6
- package/package.json +3 -3
- 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 +29 -6
- package/server/index.ts +0 -1
- package/server/services/auth/index.ts +525 -61
- package/server/services/auth/router/index.ts +106 -7
- 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 +173 -6
- 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/cli/runtime/commands.ts
CHANGED
|
@@ -9,15 +9,71 @@ class InitCommand extends ProteumCommand {
|
|
|
9
9
|
|
|
10
10
|
public static usage = buildUsage('init');
|
|
11
11
|
|
|
12
|
-
public
|
|
12
|
+
public name = Option.String('--name', { description: 'Human-readable app name.' });
|
|
13
|
+
public description = Option.String('--description', { description: 'App description used in identity.yaml and package.json.' });
|
|
14
|
+
public identifier = Option.String('--identifier', { description: 'Application class and identity identifier.' });
|
|
15
|
+
public port = Option.String('--port', { description: 'Default local router port used in .env.' });
|
|
16
|
+
public url = Option.String('--url', { description: 'Default absolute URL used in .env.' });
|
|
17
|
+
public proteumVersion = Option.String('--proteum-version', {
|
|
18
|
+
description: 'Override the Proteum dependency written to package.json.',
|
|
19
|
+
});
|
|
20
|
+
public install = Option.Boolean('--install', false, { description: 'Run npm install after scaffolding.' });
|
|
21
|
+
public dryRun = Option.Boolean('--dry-run', false, { description: 'Print the scaffold plan without writing files.' });
|
|
22
|
+
public json = Option.Boolean('--json', false, { description: 'Print machine-readable scaffold output.' });
|
|
23
|
+
public force = Option.Boolean('--force', false, { description: 'Allow writing into a non-empty target directory.' });
|
|
24
|
+
public args = Option.Rest();
|
|
13
25
|
|
|
14
26
|
public async execute() {
|
|
15
|
-
|
|
16
|
-
|
|
27
|
+
const [directory = ''] = this.args;
|
|
28
|
+
|
|
29
|
+
this.setCliArgs({
|
|
30
|
+
directory,
|
|
31
|
+
name: this.name ?? '',
|
|
32
|
+
description: this.description ?? '',
|
|
33
|
+
identifier: this.identifier ?? '',
|
|
34
|
+
port: this.port ?? '',
|
|
35
|
+
url: this.url ?? '',
|
|
36
|
+
proteumVersion: this.proteumVersion ?? '',
|
|
37
|
+
install: this.install,
|
|
38
|
+
dryRun: this.dryRun,
|
|
39
|
+
json: this.json,
|
|
40
|
+
force: this.force,
|
|
41
|
+
});
|
|
17
42
|
await runCommandModule(() => import('../commands/init'));
|
|
18
43
|
}
|
|
19
44
|
}
|
|
20
45
|
|
|
46
|
+
class CreateCommand extends ProteumCommand {
|
|
47
|
+
public static paths = [['create']];
|
|
48
|
+
|
|
49
|
+
public static usage = buildUsage('create');
|
|
50
|
+
|
|
51
|
+
public route = Option.String('--route', { description: 'Explicit URL path used for page or route scaffolds.' });
|
|
52
|
+
public method = Option.String('--method', { description: 'Method name used for controller or command scaffolds.' });
|
|
53
|
+
public httpMethod = Option.String('--http-method', { description: 'HTTP verb used for route scaffolds.' });
|
|
54
|
+
public json = Option.Boolean('--json', false, { description: 'Print machine-readable scaffold output.' });
|
|
55
|
+
public dryRun = Option.Boolean('--dry-run', false, { description: 'Print the scaffold plan without writing files.' });
|
|
56
|
+
public force = Option.Boolean('--force', false, { description: 'Allow overwriting generated target files.' });
|
|
57
|
+
public args = Option.Rest();
|
|
58
|
+
|
|
59
|
+
public async execute() {
|
|
60
|
+
const [kind = '', target = ''] = this.args;
|
|
61
|
+
|
|
62
|
+
this.setCliArgs({
|
|
63
|
+
kind,
|
|
64
|
+
target,
|
|
65
|
+
route: this.route ?? '',
|
|
66
|
+
method: this.method ?? '',
|
|
67
|
+
httpMethod: this.httpMethod ?? '',
|
|
68
|
+
json: this.json,
|
|
69
|
+
dryRun: this.dryRun,
|
|
70
|
+
force: this.force,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
await runCommandModule(() => import('../commands/create'));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
21
77
|
class DevCommand extends ProteumCommand {
|
|
22
78
|
public static paths = [['dev']];
|
|
23
79
|
|
|
@@ -153,6 +209,7 @@ class ExplainCommand extends ProteumCommand {
|
|
|
153
209
|
public env = Option.Boolean('--env', false, { description: 'Include the env section.' });
|
|
154
210
|
public services = Option.Boolean('--services', false, { description: 'Include the services section.' });
|
|
155
211
|
public controllers = Option.Boolean('--controllers', false, { description: 'Include the controllers section.' });
|
|
212
|
+
public commands = Option.Boolean('--commands', false, { description: 'Include the commands section.' });
|
|
156
213
|
public routes = Option.Boolean('--routes', false, { description: 'Include the routes section.' });
|
|
157
214
|
public layouts = Option.Boolean('--layouts', false, { description: 'Include the layouts section.' });
|
|
158
215
|
public diagnostics = Option.Boolean('--diagnostics', false, {
|
|
@@ -169,6 +226,7 @@ class ExplainCommand extends ProteumCommand {
|
|
|
169
226
|
env: this.env,
|
|
170
227
|
services: this.services,
|
|
171
228
|
controllers: this.controllers,
|
|
229
|
+
commands: this.commands,
|
|
172
230
|
routes: this.routes,
|
|
173
231
|
layouts: this.layouts,
|
|
174
232
|
diagnostics: this.diagnostics,
|
|
@@ -177,7 +235,7 @@ class ExplainCommand extends ProteumCommand {
|
|
|
177
235
|
applyLegacyBooleanArgs(
|
|
178
236
|
'explain',
|
|
179
237
|
this.legacyArgs,
|
|
180
|
-
['json', 'all', 'app', 'conventions', 'env', 'services', 'controllers', 'routes', 'layouts', 'diagnostics'],
|
|
238
|
+
['json', 'all', 'app', 'conventions', 'env', 'services', 'controllers', 'commands', 'routes', 'layouts', 'diagnostics'],
|
|
181
239
|
args,
|
|
182
240
|
);
|
|
183
241
|
this.setCliArgs(args);
|
|
@@ -185,8 +243,62 @@ class ExplainCommand extends ProteumCommand {
|
|
|
185
243
|
}
|
|
186
244
|
}
|
|
187
245
|
|
|
246
|
+
class TraceCommand extends ProteumCommand {
|
|
247
|
+
public static paths = [['trace']];
|
|
248
|
+
|
|
249
|
+
public static usage = buildUsage('trace');
|
|
250
|
+
|
|
251
|
+
public port = Option.String('--port', { description: 'Override the router port used to query the running dev server.' });
|
|
252
|
+
public url = Option.String('--url', { description: 'Override the full base URL used to query the running dev server.' });
|
|
253
|
+
public json = Option.Boolean('--json', false, { description: 'Print JSON output.' });
|
|
254
|
+
public capture = Option.String('--capture', { description: 'Capture mode used by `proteum trace arm`.' });
|
|
255
|
+
public output = Option.String('--output', { description: 'Output filepath used by `proteum trace export`.' });
|
|
256
|
+
public args = Option.Rest();
|
|
257
|
+
|
|
258
|
+
public async execute() {
|
|
259
|
+
const [action = 'latest', id = ''] = this.args;
|
|
260
|
+
|
|
261
|
+
this.setCliArgs({
|
|
262
|
+
action,
|
|
263
|
+
id,
|
|
264
|
+
port: this.port ?? '',
|
|
265
|
+
url: this.url ?? '',
|
|
266
|
+
json: this.json,
|
|
267
|
+
capture: this.capture ?? '',
|
|
268
|
+
output: this.output ?? '',
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
await runCommandModule(() => import('../commands/trace'));
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
class CommandCommand extends ProteumCommand {
|
|
276
|
+
public static paths = [['command']];
|
|
277
|
+
|
|
278
|
+
public static usage = buildUsage('command');
|
|
279
|
+
|
|
280
|
+
public port = Option.String('--port', { description: 'Target an existing dev server on the given port.' });
|
|
281
|
+
public url = Option.String('--url', { description: 'Target an existing dev server at the given base URL.' });
|
|
282
|
+
public json = Option.Boolean('--json', false, { description: 'Print JSON output.' });
|
|
283
|
+
public args = Option.Rest();
|
|
284
|
+
|
|
285
|
+
public async execute() {
|
|
286
|
+
const [path = ''] = this.args;
|
|
287
|
+
|
|
288
|
+
this.setCliArgs({
|
|
289
|
+
path,
|
|
290
|
+
port: this.port ?? '',
|
|
291
|
+
url: this.url ?? '',
|
|
292
|
+
json: this.json,
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
await runCommandModule(() => import('../commands/command'));
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
188
299
|
export const registeredCommands = {
|
|
189
300
|
init: InitCommand,
|
|
301
|
+
create: CreateCommand,
|
|
190
302
|
dev: DevCommand,
|
|
191
303
|
refresh: RefreshCommand,
|
|
192
304
|
build: BuildCommand,
|
|
@@ -195,6 +307,8 @@ export const registeredCommands = {
|
|
|
195
307
|
check: CheckCommand,
|
|
196
308
|
doctor: DoctorCommand,
|
|
197
309
|
explain: ExplainCommand,
|
|
310
|
+
trace: TraceCommand,
|
|
311
|
+
command: CommandCommand,
|
|
198
312
|
} as const;
|
|
199
313
|
|
|
200
314
|
export const createCli = (version: string) => {
|
|
@@ -208,6 +322,7 @@ export const createCli = (version: string) => {
|
|
|
208
322
|
clipanion.register(Builtins.VersionCommand);
|
|
209
323
|
clipanion.register(Builtins.DefinitionsCommand);
|
|
210
324
|
clipanion.register(InitCommand);
|
|
325
|
+
clipanion.register(CreateCommand);
|
|
211
326
|
clipanion.register(DevCommand);
|
|
212
327
|
clipanion.register(RefreshCommand);
|
|
213
328
|
clipanion.register(BuildCommand);
|
|
@@ -216,6 +331,8 @@ export const createCli = (version: string) => {
|
|
|
216
331
|
clipanion.register(CheckCommand);
|
|
217
332
|
clipanion.register(DoctorCommand);
|
|
218
333
|
clipanion.register(ExplainCommand);
|
|
334
|
+
clipanion.register(TraceCommand);
|
|
335
|
+
clipanion.register(CommandCommand);
|
|
219
336
|
|
|
220
337
|
return clipanion;
|
|
221
338
|
};
|