@webda/create 0.0.0-stage → 4.0.0-beta.5
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/LICENSE +166 -0
- package/README.md +27 -2
- package/agent/.claude-plugin/plugin.json +7 -0
- package/agent/AGENTS.md +47 -0
- package/agent/CLAUDE.md +3 -0
- package/agent/skills/webda-configuration/SKILL.md +61 -0
- package/agent/skills/webda-deploy/SKILL.md +103 -0
- package/agent/skills/webda-models/SKILL.md +137 -0
- package/agent/skills/webda-operations/SKILL.md +82 -0
- package/agent/skills/webda-services/SKILL.md +90 -0
- package/agent/skills/webda-stores/SKILL.md +66 -0
- package/agent/skills/webda-testing/SKILL.md +80 -0
- package/lib/agents.d.ts +21 -0
- package/lib/agents.d.ts.map +1 -0
- package/lib/agents.js +33 -0
- package/lib/agents.js.map +1 -0
- package/lib/bin.d.ts +3 -0
- package/lib/bin.d.ts.map +1 -0
- package/lib/bin.js +4 -0
- package/lib/bin.js.map +1 -0
- package/lib/compose.d.ts +32 -0
- package/lib/compose.d.ts.map +1 -0
- package/lib/compose.js +51 -0
- package/lib/compose.js.map +1 -0
- package/lib/generate.d.ts +39 -0
- package/lib/generate.d.ts.map +1 -0
- package/lib/generate.js +85 -0
- package/lib/generate.js.map +1 -0
- package/lib/index.d.ts +26 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +97 -0
- package/lib/index.js.map +1 -0
- package/lib/install.d.ts +25 -0
- package/lib/install.d.ts.map +1 -0
- package/lib/install.js +34 -0
- package/lib/install.js.map +1 -0
- package/lib/merge.d.ts +8 -0
- package/lib/merge.d.ts.map +1 -0
- package/lib/merge.js +25 -0
- package/lib/merge.js.map +1 -0
- package/lib/options.d.ts +64 -0
- package/lib/options.d.ts.map +1 -0
- package/lib/options.js +125 -0
- package/lib/options.js.map +1 -0
- package/lib/prompts.d.ts +27 -0
- package/lib/prompts.d.ts.map +1 -0
- package/lib/prompts.js +73 -0
- package/lib/prompts.js.map +1 -0
- package/lib/template.d.ts +25 -0
- package/lib/template.d.ts.map +1 -0
- package/lib/template.js +46 -0
- package/lib/template.js.map +1 -0
- package/lib/versions.d.ts +22 -0
- package/lib/versions.d.ts.map +1 -0
- package/lib/versions.js +52 -0
- package/lib/versions.js.map +1 -0
- package/lib/versions.json +42 -0
- package/package.json +44 -3
- package/templates/base/files/README.md +16 -0
- package/templates/base/files/_gitignore +6 -0
- package/templates/base/files/src/models/Project.model.ts +19 -0
- package/templates/base/files/src/models/Task.model.ts +24 -0
- package/templates/base/files/src/services/task.service.ts +29 -0
- package/templates/base/files/test/app.spec.ts +57 -0
- package/templates/base/files/tsconfig.json +18 -0
- package/templates/base/files/vitest.config.ts +10 -0
- package/templates/base/package.json +35 -0
- package/templates/base/webda.config.json +19 -0
- package/templates/features/graphql/agents.md +1 -0
- package/templates/features/graphql/package.json +5 -0
- package/templates/features/graphql/webda.config.json +1 -0
- package/templates/features/grpc/agents.md +1 -0
- package/templates/features/grpc/package.json +5 -0
- package/templates/features/grpc/webda.config.json +6 -0
- package/templates/features/mcp/agents.md +1 -0
- package/templates/features/mcp/package.json +5 -0
- package/templates/features/mcp/webda.config.json +1 -0
- package/templates/features/store-file/agents.md +1 -0
- package/templates/features/store-file/package.json +5 -0
- package/templates/features/store-file/webda.config.json +1 -0
- package/templates/features/store-mongodb/agents.md +1 -0
- package/templates/features/store-mongodb/files/.env.example +1 -0
- package/templates/features/store-mongodb/files/docker-compose.yml +8 -0
- package/templates/features/store-mongodb/package.json +5 -0
- package/templates/features/store-mongodb/webda.config.json +1 -0
- package/templates/features/store-postgres/agents.md +1 -0
- package/templates/features/store-postgres/files/.env.example +5 -0
- package/templates/features/store-postgres/files/docker-compose.yml +9 -0
- package/templates/features/store-postgres/package.json +5 -0
- package/templates/features/store-postgres/webda.config.json +1 -0
package/lib/versions.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { readdir, readFile } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
/** Tool versions taken from @webda/core devDependencies so apps build like the monorepo */
|
|
5
|
+
export const EXTERNAL_TOOLS = ["typescript", "vite", "vitest", "sinon", "@types/node"];
|
|
6
|
+
/**
|
|
7
|
+
* Replace template versions (`workspace:*` for @webda packages, `managed` for tools)
|
|
8
|
+
* @param pkg - package.json content, mutated
|
|
9
|
+
* @param resolve - version lookup
|
|
10
|
+
*/
|
|
11
|
+
export function applyVersions(pkg, resolve) {
|
|
12
|
+
for (const field of ["dependencies", "devDependencies"]) {
|
|
13
|
+
const deps = pkg[field] ?? {};
|
|
14
|
+
for (const [name, range] of Object.entries(deps)) {
|
|
15
|
+
if (range !== "workspace:*" && range !== "managed")
|
|
16
|
+
continue;
|
|
17
|
+
const version = resolve(name);
|
|
18
|
+
if (version === undefined) {
|
|
19
|
+
throw new Error(`No version available for ${name}`);
|
|
20
|
+
}
|
|
21
|
+
deps[name] = version;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Resolve versions from the `versions.json` written at build time
|
|
27
|
+
* @param versions - package name → version
|
|
28
|
+
* @returns the resolver
|
|
29
|
+
*/
|
|
30
|
+
export function fromVersionsFile(versions) {
|
|
31
|
+
return name => versions[name];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Resolve @webda packages to `link:` paths in a monorepo checkout, tools from @webda/core devDependencies
|
|
35
|
+
* @param root - monorepo root
|
|
36
|
+
* @returns the resolver
|
|
37
|
+
*/
|
|
38
|
+
export async function fromWorkspace(root) {
|
|
39
|
+
const links = {};
|
|
40
|
+
let tools = {};
|
|
41
|
+
for (const dir of await readdir(join(root, "packages"))) {
|
|
42
|
+
const file = join(root, "packages", dir, "package.json");
|
|
43
|
+
if (!existsSync(file))
|
|
44
|
+
continue;
|
|
45
|
+
const pkg = JSON.parse(await readFile(file, "utf8"));
|
|
46
|
+
links[pkg.name] = `link:${join(root, "packages", dir)}`;
|
|
47
|
+
if (pkg.name === "@webda/core")
|
|
48
|
+
tools = pkg.devDependencies ?? {};
|
|
49
|
+
}
|
|
50
|
+
return name => links[name] ?? (EXTERNAL_TOOLS.includes(name) ? tools[name] : undefined);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=versions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../src/versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,2FAA2F;AAC3F,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;AAEvF;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,GAAwB,EAAE,OAAwB;IAC9E,KAAK,MAAM,KAAK,IAAI,CAAC,cAAc,EAAE,iBAAiB,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,GAA2B,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QACtD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACjD,IAAI,KAAK,KAAK,aAAa,IAAI,KAAK,KAAK,SAAS;gBAAE,SAAS;YAC7D,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;YAC9B,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,EAAE,CAAC,CAAC;YACtD,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;QACvB,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgC;IAC/D,OAAO,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAY;IAC9C,MAAM,KAAK,GAA2B,EAAE,CAAC;IACzC,IAAI,KAAK,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,GAAG,IAAI,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC;QACxD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;QACzD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,SAAS;QAChC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QACrD,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,QAAQ,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,CAAC;QACxD,IAAI,GAAG,CAAC,IAAI,KAAK,aAAa;YAAE,KAAK,GAAG,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC;IACpE,CAAC;IACD,OAAO,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAC1F,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@webda/amqp": "4.0.0-beta.5",
|
|
3
|
+
"@webda/async": "4.0.0-beta.5",
|
|
4
|
+
"@webda/auth": "4.0.0-beta.5",
|
|
5
|
+
"@webda/aws": "4.0.0-beta.5",
|
|
6
|
+
"@webda/cache": "4.0.0-beta.5",
|
|
7
|
+
"@webda/cloudevents": "4.0.0-beta.5",
|
|
8
|
+
"@webda/compiler": "4.0.0-beta.5",
|
|
9
|
+
"@webda/content-mapper": "4.0.0-beta.5",
|
|
10
|
+
"@webda/core": "4.0.0-beta.5",
|
|
11
|
+
"typescript": "7.1.0-dev.20260929.1",
|
|
12
|
+
"vite": "^6.0.0",
|
|
13
|
+
"vitest": "^4.1.2",
|
|
14
|
+
"sinon": "^21.0.3",
|
|
15
|
+
"@types/node": "25.5.0",
|
|
16
|
+
"@webda/create": "4.0.0-beta.5",
|
|
17
|
+
"@webda/debug": "4.0.0-beta.5",
|
|
18
|
+
"@webda/decorators": "4.0.0-beta.5",
|
|
19
|
+
"@webda/elasticsearch": "4.0.0-beta.5",
|
|
20
|
+
"@webda/fs": "4.0.0-beta.5",
|
|
21
|
+
"@webda/gcp": "4.0.0-beta.5",
|
|
22
|
+
"@webda/google-auth": "4.0.0-beta.5",
|
|
23
|
+
"@webda/graphql": "4.0.0-beta.5",
|
|
24
|
+
"@webda/grpc": "4.0.0-beta.5",
|
|
25
|
+
"@webda/hawk": "4.0.0-beta.5",
|
|
26
|
+
"@webda/kubernetes": "4.0.0-beta.5",
|
|
27
|
+
"@webda/mcp": "4.0.0-beta.5",
|
|
28
|
+
"@webda/mock": "4.0.0-beta.5",
|
|
29
|
+
"@webda/models": "4.0.0-beta.5",
|
|
30
|
+
"@webda/mongo": "4.0.0-beta.5",
|
|
31
|
+
"@webda/oci": "4.0.0-beta.5",
|
|
32
|
+
"@webda/otel": "4.0.0-beta.5",
|
|
33
|
+
"@webda/postgres": "4.0.0-beta.5",
|
|
34
|
+
"@webda/ql": "4.0.0-beta.5",
|
|
35
|
+
"@webda/runtime": "4.0.0-beta.5",
|
|
36
|
+
"@webda/serialize": "4.0.0-beta.5",
|
|
37
|
+
"@webda/test": "4.0.0-beta.5",
|
|
38
|
+
"@webda/tsc-esm": "4.0.0-beta.5",
|
|
39
|
+
"@webda/utils": "4.0.0-beta.5",
|
|
40
|
+
"@webda/versioning": "4.0.0-beta.5",
|
|
41
|
+
"@webda/workout": "4.0.0-beta.5"
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webda/create",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "4.0.0-beta.5",
|
|
4
|
+
"description": "Create a Webda application with guidance for coding agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"create": "./lib/bin.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "lib/index.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"lib",
|
|
12
|
+
"templates",
|
|
13
|
+
"agent"
|
|
14
|
+
],
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/node": "25.5.0",
|
|
17
|
+
"typescript": "7.1.0-dev.20260929.1",
|
|
18
|
+
"vite": "^6.0.0",
|
|
19
|
+
"vitest": "^4.1.2",
|
|
20
|
+
"@webda/test": "4.0.0-beta.5"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=22.0.0"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/loopingz/webda.io.git",
|
|
31
|
+
"directory": "packages/create"
|
|
32
|
+
},
|
|
33
|
+
"license": "LGPL-3.0-only",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@clack/prompts": "^1.8.1"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -p tsconfig.json && node scripts/write-versions.mjs",
|
|
39
|
+
"format": "prettier --check src/**/*",
|
|
40
|
+
"format:fix": "prettier --write src/**/*",
|
|
41
|
+
"lint": "eslint",
|
|
42
|
+
"lint:fix": "eslint --fix",
|
|
43
|
+
"pretest": "tsc -p tsconfig.json",
|
|
44
|
+
"test": "vitest run",
|
|
45
|
+
"test:templates": "node scripts/test-templates.mjs"
|
|
46
|
+
}
|
|
6
47
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# __APP_NAME__
|
|
2
|
+
|
|
3
|
+
A [Webda](https://webda.io) v4 application.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm run debug # build, then dev server with the interactive debug console on http://localhost:18080
|
|
7
|
+
npm run serve # build, then HTTP server on http://localhost:18080
|
|
8
|
+
npm run build # compile and generate webda.module.json
|
|
9
|
+
npm test # build, then run the tests
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
- Models: `src/models/`
|
|
13
|
+
- Services: `src/services/`
|
|
14
|
+
- Configuration: `webda.config.json`
|
|
15
|
+
|
|
16
|
+
Working with a coding agent? It reads `AGENTS.md`; skills are in `.agents/skills/`.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OneToMany, UuidModel } from "@webda/models";
|
|
2
|
+
import type { Task } from "./Task.model.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A project groups tasks
|
|
6
|
+
*/
|
|
7
|
+
export class Project extends UuidModel {
|
|
8
|
+
/**
|
|
9
|
+
* Project name
|
|
10
|
+
* @minLength 1
|
|
11
|
+
* @maxLength 100
|
|
12
|
+
*/
|
|
13
|
+
name!: string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Tasks of the project
|
|
17
|
+
*/
|
|
18
|
+
tasks!: OneToMany<Task, Project, "project">;
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BelongTo, UuidModel } from "@webda/models";
|
|
2
|
+
import type { Project } from "./Project.model.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A task to do in a project
|
|
6
|
+
*/
|
|
7
|
+
export class Task extends UuidModel {
|
|
8
|
+
/**
|
|
9
|
+
* What needs to be done
|
|
10
|
+
* @minLength 1
|
|
11
|
+
* @maxLength 200
|
|
12
|
+
*/
|
|
13
|
+
title!: string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Whether the task is finished
|
|
17
|
+
*/
|
|
18
|
+
done!: boolean;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Project the task belongs to
|
|
22
|
+
*/
|
|
23
|
+
project!: BelongTo<Project>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Operation, Service, useLog } from "@webda/core";
|
|
2
|
+
import { Task } from "../models/Task.model.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Parameters of TaskService, set in webda.config.json
|
|
6
|
+
*/
|
|
7
|
+
export class TaskServiceParameters extends Service.Parameters {}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Behaviour spanning several tasks
|
|
11
|
+
*
|
|
12
|
+
* @WebdaModda
|
|
13
|
+
*/
|
|
14
|
+
export class TaskService<T extends TaskServiceParameters = TaskServiceParameters> extends Service<T> {
|
|
15
|
+
static Parameters = TaskServiceParameters;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Count the open and finished tasks of a project
|
|
19
|
+
* @param project - project uuid
|
|
20
|
+
* @returns task counts
|
|
21
|
+
*/
|
|
22
|
+
@Operation()
|
|
23
|
+
async summary(project: string): Promise<{ open: number; done: number }> {
|
|
24
|
+
const { results } = await Task.query("project = ?", [project]);
|
|
25
|
+
const done = results.filter(task => task.done).length;
|
|
26
|
+
useLog("INFO", "Summary of project", project);
|
|
27
|
+
return { open: results.length - done, done };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { suite, test } from "@webda/test";
|
|
2
|
+
import * as assert from "node:assert";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { resolve } from "node:path";
|
|
5
|
+
import { TestApplication, WebdaApplicationTest } from "@webda/core/lib/test/index.js";
|
|
6
|
+
import { useModel, useService } from "@webda/core";
|
|
7
|
+
|
|
8
|
+
const appDir = resolve(import.meta.dirname, "..");
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Loads this application from its directory
|
|
12
|
+
*/
|
|
13
|
+
class AppTestApplication extends TestApplication {
|
|
14
|
+
getNamespace() {
|
|
15
|
+
return "__NAMESPACE__";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
filterModule(_filename: string): boolean {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@suite
|
|
24
|
+
class AppTest extends WebdaApplicationTest {
|
|
25
|
+
getTestConfiguration(): string {
|
|
26
|
+
return appDir;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
getApplication() {
|
|
30
|
+
return new AppTestApplication(this.getTestConfiguration());
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Keep webda.config.json as is: the default would replace the store with a MemoryStore
|
|
35
|
+
*/
|
|
36
|
+
async tweakApp() {}
|
|
37
|
+
|
|
38
|
+
@test
|
|
39
|
+
async configuredServicesStart() {
|
|
40
|
+
const config = JSON.parse(readFileSync(resolve(appDir, "webda.config.json"), "utf8"));
|
|
41
|
+
const started = Object.keys(this.webda.getServices());
|
|
42
|
+
for (const name of Object.keys(config.services)) {
|
|
43
|
+
assert.ok(started.includes(name), `${name} should start`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@test
|
|
48
|
+
async summarizesTheTasksOfAProject() {
|
|
49
|
+
const Project = useModel<any>("__NAMESPACE__/Project");
|
|
50
|
+
const Task = useModel<any>("__NAMESPACE__/Task");
|
|
51
|
+
const project = await Project.create({ name: "Launch" });
|
|
52
|
+
await Task.create({ title: "Write the docs", done: true, project: project.getUUID() });
|
|
53
|
+
await Task.create({ title: "Ship it", done: false, project: project.getUUID() });
|
|
54
|
+
const summary = await (useService("TaskService" as any) as any).summary(project.getUUID());
|
|
55
|
+
assert.deepStrictEqual(summary, { open: 1, done: 1 });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2022",
|
|
4
|
+
"module": "nodenext",
|
|
5
|
+
"moduleResolution": "nodenext",
|
|
6
|
+
"outDir": "./lib",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"strict": false,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"declaration": true,
|
|
11
|
+
"experimentalDecorators": false,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"declarationMap": true
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*", ".webda/module.d.ts"],
|
|
17
|
+
"exclude": ["**/node_modules", "**/*.spec.ts"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "__APP_NAME__",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "webdac build",
|
|
8
|
+
"predebug": "webdac build",
|
|
9
|
+
"debug": "webda debug",
|
|
10
|
+
"preserve": "webdac build",
|
|
11
|
+
"serve": "webda serve",
|
|
12
|
+
"pretest": "webdac build",
|
|
13
|
+
"test": "vitest run"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@webda/core": "workspace:*",
|
|
17
|
+
"@webda/models": "workspace:*"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/node": "managed",
|
|
21
|
+
"@webda/compiler": "workspace:*",
|
|
22
|
+
"@webda/debug": "workspace:*",
|
|
23
|
+
"@webda/test": "workspace:*",
|
|
24
|
+
"sinon": "managed",
|
|
25
|
+
"typescript": "managed",
|
|
26
|
+
"vite": "managed",
|
|
27
|
+
"vitest": "managed"
|
|
28
|
+
},
|
|
29
|
+
"webda": {
|
|
30
|
+
"namespace": "__NAMESPACE__"
|
|
31
|
+
},
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=22.0.0"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": ".webda/config.schema.json",
|
|
3
|
+
"version": 4,
|
|
4
|
+
"parameters": {},
|
|
5
|
+
"services": {
|
|
6
|
+
"HttpServer": {
|
|
7
|
+
"type": "Webda/HttpServer"
|
|
8
|
+
},
|
|
9
|
+
"DomainService": {
|
|
10
|
+
"type": "Webda/DomainService"
|
|
11
|
+
},
|
|
12
|
+
"RESTService": {
|
|
13
|
+
"type": "Webda/RESTOperationsTransport"
|
|
14
|
+
},
|
|
15
|
+
"TaskService": {
|
|
16
|
+
"type": "TaskService"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
GraphQL is generated from the models and operations and served by `GraphQLService` at `/graphql`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "services": { "GraphQLService": { "type": "Webda/GraphQLService" } } }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gRPC is served on port 50051 (HTTP/2 cleartext) by `GRPCService`; its services are generated from the models and operations.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
`MCP` is served at `/mcp` and exposes the operations as Model Context Protocol tools and the models as resources, with the same permissions as the other transports.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "services": { "MCP": { "type": "Webda/McpService" } } }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Each record is a JSON file in `./data` (ignored by git). Delete the folder to reset the data.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "services": { "Registry": { "type": "Webda/FileStore", "folder": "./data" } } }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
MongoDB runs locally: `docker compose up -d`, then `cp .env.example .env`. The connection comes from `WEBDA_MONGO_URL` (see `.env.example`); tests load `.env` automatically; for `npm run debug` or `npm run serve`, export the variables first (`set -a; . ./.env; set +a`); never put credentials in `webda.config.json`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
WEBDA_MONGO_URL=mongodb://webda:webda@localhost:27017
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "services": { "Registry": { "type": "Webda/MongoStore", "collection": "registry" } } }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
PostgreSQL runs locally: `docker compose up -d`, then `cp .env.example .env`. The connection comes from the standard `PG*` variables (see `.env.example`); tests load `.env` automatically; for `npm run debug` or `npm run serve`, export the variables first (`set -a; . ./.env; set +a`); never put credentials in `webda.config.json`. Tables are created automatically.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "services": { "Registry": { "type": "Webda/PostgresStore", "table": "registry" } } }
|