create-drobek-module 0.6.1 → 0.7.0
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/README.md +15 -0
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/template/README.md +1 -1
package/README.md
CHANGED
|
@@ -33,6 +33,21 @@ the code imports — `"@drobek/modules": "npm:@freema/drobek-modules@^X.Y.Z"`
|
|
|
33
33
|
in `devDependencies` — and declares the peer `"@drobek/modules": ">=X.Y.Z"`
|
|
34
34
|
the server's installer checks.
|
|
35
35
|
|
|
36
|
+
A module can also extend another one through its slots instead of (or
|
|
37
|
+
besides) serving an app: a sign-in method contributes to `auth.provider`,
|
|
38
|
+
an e-mail provider for the whole server (SES, Postmark, a company relay)
|
|
39
|
+
contributes `defineEmailTransport({ id, label, secrets, send })` to
|
|
40
|
+
`email.transport` and is chosen with `EMAIL_TRANSPORT=<id>` — see
|
|
41
|
+
[E-mail transports from modules](https://github.com/freema/drobek/blob/main/docs/MODULES.md#e-mail-transports-from-modules);
|
|
42
|
+
a place for the server's errors (an incident webhook, a log service) contributes
|
|
43
|
+
`defineErrorReporter({ id, label, secrets, report })` to the core-hosted
|
|
44
|
+
`errors.reporter` slot and is chosen with `ERROR_REPORTER=<id>` — see
|
|
45
|
+
[Error reporters from modules](https://github.com/freema/drobek/blob/main/docs/MODULES.md#error-reporters-from-modules).
|
|
46
|
+
A module that does nothing but that serves only the server: it may drop
|
|
47
|
+
`skill`, `routes` and the SDK, keep `configSchema: z.object({})`, and agents
|
|
48
|
+
and app owners never see it —
|
|
49
|
+
[Operator-only modules](https://github.com/freema/drobek/blob/main/docs/MODULES.md#operator-only-modules).
|
|
50
|
+
|
|
36
51
|
The guide is
|
|
37
52
|
[Writing a module](https://github.com/freema/drobek/blob/main/docs/MODULES.md#writing-a-module).
|
|
38
53
|
Licence: AGPL-3.0-only.
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* create-drobek-module
|
|
2
|
+
* create-drobek-module — scaffold an external drobek platform
|
|
3
3
|
* module from `template/`:
|
|
4
4
|
*
|
|
5
5
|
* npm create drobek-module@latest erp → drobek-module-erp/, module "erp"
|
|
@@ -21,9 +21,9 @@ import { fileURLToPath } from 'node:url';
|
|
|
21
21
|
export const TEMPLATE_DIR = fileURLToPath(new URL('../template', import.meta.url));
|
|
22
22
|
/** `defineModule({ name })`: also the URL segment, config key, skill name and table prefix. */
|
|
23
23
|
const MODULE_NAME_RE = /^[a-z][a-z0-9]{1,30}$/;
|
|
24
|
-
const RESERVED = ['sdk', 'v1', 'drobek', 'internal'];
|
|
24
|
+
const RESERVED = ['sdk', 'v1', 'drobek', 'internal', 'errors'];
|
|
25
25
|
/** The modules drobek ships: a new module needs its own name (replacing one is an operator decision, docs/MODULES.md). */
|
|
26
|
-
const BUILT_IN = ['auth', 'email', 'forms', 'data', 'proxy', 'files', 'sync'];
|
|
26
|
+
const BUILT_IN = ['auth', 'email', 'forms', 'data', 'proxy', 'files', 'sync', 'oidc'];
|
|
27
27
|
const PACKAGE_RE = /^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/;
|
|
28
28
|
/** Resolve `<name>` (a short name, `drobek-module-<x>` or a scoped package) to package, module and directory names. */
|
|
29
29
|
export function parseTarget(input, moduleOverride) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-drobek-module",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Scaffold a drobek platform module: npm create drobek-module@latest <name> — routes, SDK, a migration, SKILL.md, vitest + PGlite tests and the checkSkill gate.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|
package/template/README.md
CHANGED
|
@@ -44,7 +44,7 @@ task selfhost:module:add -- {{package}}@0.1.0 # or the URL of a packed tarba
|
|
|
44
44
|
and add the module to `DROBEK_MODULES` in `.env.production`:
|
|
45
45
|
|
|
46
46
|
```sh
|
|
47
|
-
DROBEK_MODULES=auth,email,forms,data,proxy,files,sync,{{entry}}
|
|
47
|
+
DROBEK_MODULES=auth,email,forms,data,proxy,files,sync,oidc,{{entry}}
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
Then restart drobek (see the self-hosting guide). The server refuses a module whose
|