@tulipes/cli 0.1.0-rc.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/LICENSE +21 -0
- package/README.md +46 -0
- package/dist/app-core.d.ts +33 -0
- package/dist/app-core.js +58 -0
- package/dist/app-core.js.map +1 -0
- package/dist/bin.d.ts +2 -0
- package/dist/bin.js +7 -0
- package/dist/bin.js.map +1 -0
- package/dist/dev.d.ts +8 -0
- package/dist/dev.js +22 -0
- package/dist/dev.js.map +1 -0
- package/dist/env-check.d.ts +6 -0
- package/dist/env-check.js +28 -0
- package/dist/env-check.js.map +1 -0
- package/dist/init.d.ts +25 -0
- package/dist/init.js +6416 -0
- package/dist/init.js.map +1 -0
- package/dist/inspection.d.ts +8 -0
- package/dist/inspection.js +15 -0
- package/dist/inspection.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +166 -0
- package/dist/main.js.map +1 -0
- package/dist/minimal.d.ts +2 -0
- package/dist/minimal.js +2200 -0
- package/dist/minimal.js.map +1 -0
- package/dist/new-module.d.ts +19 -0
- package/dist/new-module.js +348 -0
- package/dist/new-module.js.map +1 -0
- package/dist/package-info.d.ts +18 -0
- package/dist/package-info.js +53 -0
- package/dist/package-info.js.map +1 -0
- package/dist/routes.d.ts +8 -0
- package/dist/routes.js +54 -0
- package/dist/routes.js.map +1 -0
- package/dist/spec.d.ts +19 -0
- package/dist/spec.js +101 -0
- package/dist/spec.js.map +1 -0
- package/dist/sync.d.ts +12 -0
- package/dist/sync.js +117 -0
- package/dist/sync.js.map +1 -0
- package/dist/update.d.ts +20 -0
- package/dist/update.js +240 -0
- package/dist/update.js.map +1 -0
- package/package.json +59 -0
- package/templates/CLAUDE.md +120 -0
- package/templates/browser-auth.md +120 -0
- package/templates/claude/skills/tulipes-boot-errors/SKILL.md +74 -0
- package/templates/claude/skills/tulipes-endpoint/SKILL.md +132 -0
- package/templates/claude/skills/tulipes-env-variable/SKILL.md +78 -0
- package/templates/claude/skills/tulipes-i18n/SKILL.md +98 -0
- package/templates/claude/skills/tulipes-model/SKILL.md +107 -0
- package/templates/claude/skills/tulipes-module/SKILL.md +67 -0
- package/templates/claude/skills/tulipes-permissions/SKILL.md +105 -0
- package/templates/claude/skills/tulipes-queue/SKILL.md +68 -0
- package/templates/claude/skills/tulipes-response/SKILL.md +118 -0
- package/templates/claude/skills/tulipes-settings/SKILL.md +111 -0
- package/templates/claude/skills/tulipes-socket/SKILL.md +60 -0
- package/templates/claude/skills/tulipes-spec/SKILL.md +101 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 TulipesJS contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="https://cdn.jsdelivr.net/npm/@tulipes/core@0.7.1/assets/tulipesjs-logo.png" alt="TulipesJs" width="340">
|
|
4
|
+
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
# @tulipes/cli
|
|
8
|
+
|
|
9
|
+
The `tulipes` command line for [Tulipes](https://www.npmjs.com/package/@tulipes/core)
|
|
10
|
+
apps: scaffold, sync generated types, validate the environment, inspect routes,
|
|
11
|
+
generate OpenAPI/Postman documents, run in watch mode, add modules and upgrade.
|
|
12
|
+
It is separate from the runtime on purpose — a running app installs
|
|
13
|
+
`@tulipes/core` alone, without this package, its templates or the TypeScript
|
|
14
|
+
loader it carries.
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm install -g @tulipes/cli@next
|
|
18
|
+
tulipes init my-api # minimal preset; --preset production for the full app
|
|
19
|
+
cd my-api && corepack enable && yarn install && yarn dev
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Generated apps also list `@tulipes/cli` in `devDependencies`, so `yarn dev`,
|
|
23
|
+
`yarn sync`, `yarn spec` and `yarn tulipes new module <name>` work without a
|
|
24
|
+
global install and always match the app.
|
|
25
|
+
|
|
26
|
+
| Command | What it does |
|
|
27
|
+
|---|---|
|
|
28
|
+
| `tulipes init [dir] [--minimal \| --preset minimal \| --preset production] [--no-queues] [--no-sockets]` | scaffold an application; no services. The two opt-outs apply to the production preset and leave that provider, its files, dependencies and worker process out |
|
|
29
|
+
| `tulipes dev [entry]` | regenerate types, then run under tsx watch |
|
|
30
|
+
| `tulipes sync` | regenerate `types/config.d.ts` and `.env.example` |
|
|
31
|
+
| `tulipes env:check` | validate the environment without booting |
|
|
32
|
+
| `tulipes routes [--offline \| --runtime]` | list declared endpoints |
|
|
33
|
+
| `tulipes spec [--offline \| --runtime] [--openapi file] [--postman file] [--url base]` | generate documents (needs `@tulipes/spec` in the app) |
|
|
34
|
+
| `tulipes new module <name> [--model\|--no-model] [--queues\|--no-queues] [--sockets\|--no-sockets]` | scaffold a module for the providers the app declares |
|
|
35
|
+
| `tulipes update` | upgrade the global CLI and, inside an app, its core and CLI ranges |
|
|
36
|
+
| `tulipes -v` | print the CLI version, its bundled core, and the app's core when they differ |
|
|
37
|
+
|
|
38
|
+
Every command that touches an app boots or inspects it through **the app's
|
|
39
|
+
own** `@tulipes/core`, so there is one copy of every framework singleton; the
|
|
40
|
+
bundled core is only a fallback for directories with no install. Generated
|
|
41
|
+
dependency ranges follow the core this CLI bundles.
|
|
42
|
+
|
|
43
|
+
## Versions
|
|
44
|
+
|
|
45
|
+
`0.1.0-rc.1` bundles core `0.10.0-rc.3` and scaffolds for it. See core's
|
|
46
|
+
[MIGRATING.md](https://github.com/kemora13conf/bp-backend-express/blob/master/packages/core/MIGRATING.md#unreleased--install-the-cli-package).
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { BootHandle, BootOptions } from "@tulipes/core/boot";
|
|
2
|
+
export type BootFn = (options: BootOptions) => Promise<BootHandle>;
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a module **from the app**, not from wherever this CLI lives.
|
|
5
|
+
*
|
|
6
|
+
* `tulipes` is normally installed globally, so a bare `import(...)` inside
|
|
7
|
+
* the CLI resolves against the CLI's own node_modules. For anything the
|
|
8
|
+
* app also depends on, that yields a *second* copy — and two copies of a
|
|
9
|
+
* library that uses `instanceof` do not recognise each other's objects.
|
|
10
|
+
*/
|
|
11
|
+
export declare function importFromApp<T>(rootDir: string, specifier: string): Promise<T | undefined>;
|
|
12
|
+
/**
|
|
13
|
+
* The `boot` belonging to the app, falling back to this CLI's own.
|
|
14
|
+
*
|
|
15
|
+
* Booting through the app's own `@tulipes/core` is what keeps every shared
|
|
16
|
+
* singleton to ONE copy, and what makes the app's
|
|
17
|
+
* declared providers (`tulipes.providers`) resolve from the app rather than
|
|
18
|
+
* from wherever the CLI happens to be installed.
|
|
19
|
+
*
|
|
20
|
+
* The fallback covers an app with no local install, where the CLI's copy
|
|
21
|
+
* is the only one there is. A version skew between the two is reported by
|
|
22
|
+
* `tulipes -v`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function appBoot(rootDir: string): Promise<BootFn>;
|
|
25
|
+
/**
|
|
26
|
+
* Registers the TypeScript loader before any app file is imported.
|
|
27
|
+
*
|
|
28
|
+
* The published CLI runs as plain node while an app's modules are
|
|
29
|
+
* TypeScript, so without this every dynamic import of a `.ts` file fails
|
|
30
|
+
* to resolve. The hook is process-wide, so it also covers imports the
|
|
31
|
+
* app's own core makes afterwards. Harmless when the app is compiled.
|
|
32
|
+
*/
|
|
33
|
+
export declare function registerTypeScript(): Promise<void>;
|
package/dist/app-core.js
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { boot as bundledBoot } from "@tulipes/core/boot";
|
|
5
|
+
/**
|
|
6
|
+
* Resolves a module **from the app**, not from wherever this CLI lives.
|
|
7
|
+
*
|
|
8
|
+
* `tulipes` is normally installed globally, so a bare `import(...)` inside
|
|
9
|
+
* the CLI resolves against the CLI's own node_modules. For anything the
|
|
10
|
+
* app also depends on, that yields a *second* copy — and two copies of a
|
|
11
|
+
* library that uses `instanceof` do not recognise each other's objects.
|
|
12
|
+
*/
|
|
13
|
+
export async function importFromApp(rootDir, specifier) {
|
|
14
|
+
try {
|
|
15
|
+
// Anchored on the app's package.json so resolution starts in the app,
|
|
16
|
+
// whatever directory the CLI itself was installed into.
|
|
17
|
+
const requireFromApp = createRequire(join(rootDir, "package.json"));
|
|
18
|
+
const entry = requireFromApp.resolve(specifier);
|
|
19
|
+
return (await import(pathToFileURL(entry).href));
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The `boot` belonging to the app, falling back to this CLI's own.
|
|
27
|
+
*
|
|
28
|
+
* Booting through the app's own `@tulipes/core` is what keeps every shared
|
|
29
|
+
* singleton to ONE copy, and what makes the app's
|
|
30
|
+
* declared providers (`tulipes.providers`) resolve from the app rather than
|
|
31
|
+
* from wherever the CLI happens to be installed.
|
|
32
|
+
*
|
|
33
|
+
* The fallback covers an app with no local install, where the CLI's copy
|
|
34
|
+
* is the only one there is. A version skew between the two is reported by
|
|
35
|
+
* `tulipes -v`.
|
|
36
|
+
*/
|
|
37
|
+
export async function appBoot(rootDir) {
|
|
38
|
+
const module = await importFromApp(rootDir, "@tulipes/core/boot");
|
|
39
|
+
return module?.boot ?? bundledBoot;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Registers the TypeScript loader before any app file is imported.
|
|
43
|
+
*
|
|
44
|
+
* The published CLI runs as plain node while an app's modules are
|
|
45
|
+
* TypeScript, so without this every dynamic import of a `.ts` file fails
|
|
46
|
+
* to resolve. The hook is process-wide, so it also covers imports the
|
|
47
|
+
* app's own core makes afterwards. Harmless when the app is compiled.
|
|
48
|
+
*/
|
|
49
|
+
export async function registerTypeScript() {
|
|
50
|
+
try {
|
|
51
|
+
const tsx = (await import("tsx/esm/api"));
|
|
52
|
+
tsx.register?.();
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
// No tsx available: a compiled app still boots fine without it.
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=app-core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-core.js","sourceRoot":"","sources":["../src/app-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,IAAI,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKzD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAI,OAAe,EAAE,SAAiB;IACvE,IAAI,CAAC;QACH,sEAAsE;QACtE,wDAAwD;QACxD,MAAM,cAAc,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;QACpE,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAChD,OAAO,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAM,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,OAAe;IAC3C,MAAM,MAAM,GAAG,MAAM,aAAa,CAAoB,OAAO,EAAE,oBAAoB,CAAC,CAAC;IACrF,OAAO,MAAM,EAAE,IAAI,IAAI,WAAW,CAAC;AACrC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,CAA8B,CAAC;QACvE,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC;IACnB,CAAC;IAAC,MAAM,CAAC;QACP,gEAAgE;IAClE,CAAC;AACH,CAAC"}
|
package/dist/bin.d.ts
ADDED
package/dist/bin.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Published bin entry — compiled to dist/bin.js. The dev workspace uses
|
|
3
|
+
// bin/tulipes.js (a tsx shim over the same main) instead; publishConfig.bin
|
|
4
|
+
// swaps this one in at pack time.
|
|
5
|
+
import { main } from "./main.js";
|
|
6
|
+
await main(process.argv.slice(2));
|
|
7
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,wEAAwE;AACxE,4EAA4E;AAC5E,kCAAkC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/dev.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `tulipes dev [entry]` — sync first (generated types must never be stale
|
|
3
|
+
* when the dev server starts), then hand off to tsx in watch mode.
|
|
4
|
+
*
|
|
5
|
+
* tsx is resolved from core's own dependencies rather than trusting PATH,
|
|
6
|
+
* so the command works in any workspace layout.
|
|
7
|
+
*/
|
|
8
|
+
export declare function runDev(rootDir: string, entry: string): Promise<void>;
|
package/dist/dev.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { runSync } from "./sync.js";
|
|
5
|
+
/**
|
|
6
|
+
* `tulipes dev [entry]` — sync first (generated types must never be stale
|
|
7
|
+
* when the dev server starts), then hand off to tsx in watch mode.
|
|
8
|
+
*
|
|
9
|
+
* tsx is resolved from core's own dependencies rather than trusting PATH,
|
|
10
|
+
* so the command works in any workspace layout.
|
|
11
|
+
*/
|
|
12
|
+
export async function runDev(rootDir, entry) {
|
|
13
|
+
await runSync(rootDir);
|
|
14
|
+
const require = createRequire(import.meta.url);
|
|
15
|
+
const tsxPackage = require.resolve("tsx/package.json");
|
|
16
|
+
const tsxCli = join(dirname(tsxPackage), "dist", "cli.mjs");
|
|
17
|
+
const child = spawn(process.execPath, [tsxCli, "watch", "--clear-screen=false", entry], { cwd: rootDir, stdio: "inherit" });
|
|
18
|
+
child.on("exit", (code) => {
|
|
19
|
+
process.exitCode = code ?? 0;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../src/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAAe,EAAE,KAAa;IACzD,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAEvB,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACvD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IAE5D,MAAM,KAAK,GAAG,KAAK,CACjB,OAAO,CAAC,QAAQ,EAChB,CAAC,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,KAAK,CAAC,EAChD,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CACnC,CAAC;IACF,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QACxB,OAAO,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `tulipes env:check` — boot phases 1–3 and nothing else: validate the
|
|
3
|
+
* current environment against every module's declared contract, print the
|
|
4
|
+
* verdict, exit accordingly. Built for CI gates and deploy preflights.
|
|
5
|
+
*/
|
|
6
|
+
export declare function runEnvCheck(rootDir: string): Promise<void>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Environment } from "@tulipes/core/env";
|
|
2
|
+
import { TulipesBootError } from "@tulipes/core/errors";
|
|
3
|
+
/**
|
|
4
|
+
* `tulipes env:check` — boot phases 1–3 and nothing else: validate the
|
|
5
|
+
* current environment against every module's declared contract, print the
|
|
6
|
+
* verdict, exit accordingly. Built for CI gates and deploy preflights.
|
|
7
|
+
*/
|
|
8
|
+
export async function runEnvCheck(rootDir) {
|
|
9
|
+
let env;
|
|
10
|
+
try {
|
|
11
|
+
env = Environment.load({ rootDir });
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
if (error instanceof TulipesBootError) {
|
|
15
|
+
console.error(error.message);
|
|
16
|
+
process.exitCode = 1;
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
const snapshot = env.store.snapshot(); // secrets redacted
|
|
22
|
+
const names = Object.keys(snapshot);
|
|
23
|
+
console.log(`APP_ENV=${env.appEnv} — ${names.length} variable(s) resolved:`);
|
|
24
|
+
for (const name of names) {
|
|
25
|
+
console.log(` ✔ ${name}=${String(snapshot[name])}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=env-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-check.js","sourceRoot":"","sources":["../src/env-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAe;IAC/C,IAAI,GAAG,CAAC;IACR,IAAI,CAAC;QACH,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,gBAAgB,EAAE,CAAC;YACtC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC7B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,mBAAmB;IAC1D,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,CAAC,MAAM,MAAM,KAAK,CAAC,MAAM,wBAAwB,CAAC,CAAC;IAC7E,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC"}
|
package/dist/init.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `tulipes init [dir]` — scaffold a complete application.
|
|
3
|
+
*
|
|
4
|
+
* Three modules ship: core (sys 0 — env contract, roles, request ids),
|
|
5
|
+
* security (sys 10 — helmet, cors, logging, body parsing) and hello, a
|
|
6
|
+
* worked example of EVERY module contract: config with lifecycle hooks,
|
|
7
|
+
* ACL grants, routes, a controller, a helper, a model, a bootstrap task,
|
|
8
|
+
* a queue with its processor, and a socket namespace.
|
|
9
|
+
*
|
|
10
|
+
* The generated app therefore needs mongo and redis running — models and
|
|
11
|
+
* queues cannot work without them, and the boot refuses rather than
|
|
12
|
+
* degrading quietly.
|
|
13
|
+
*/
|
|
14
|
+
export type InitPreset = "minimal" | "production";
|
|
15
|
+
/**
|
|
16
|
+
* What the production preset composes. Models are not optional there: auth,
|
|
17
|
+
* users and settings own models, so the preset without a database is a
|
|
18
|
+
* different application, not a feature toggle. Queues and sockets are.
|
|
19
|
+
*/
|
|
20
|
+
export interface InitFeatures {
|
|
21
|
+
queues: boolean;
|
|
22
|
+
sockets: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const FULL_FEATURES: InitFeatures;
|
|
25
|
+
export declare function runInit(rootDir: string, target?: string, preset?: InitPreset, features?: InitFeatures): Promise<void>;
|