@forinda/kickjs-cli 4.2.0 → 5.0.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/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli
|
|
2
|
+
* @forinda/kickjs-cli v5.0.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -108,7 +108,6 @@ async function fileExists(filePath) {
|
|
|
108
108
|
const PACKAGE_DEPS = {
|
|
109
109
|
auth: "@forinda/kickjs-auth",
|
|
110
110
|
swagger: "@forinda/kickjs-swagger",
|
|
111
|
-
otel: "@forinda/kickjs-otel",
|
|
112
111
|
ws: "@forinda/kickjs-ws",
|
|
113
112
|
queue: "@forinda/kickjs-queue",
|
|
114
113
|
devtools: "@forinda/kickjs-devtools"
|
|
@@ -335,10 +334,6 @@ function generateEntryFile(name, template, version, packages = []) {
|
|
|
335
334
|
case "cqrs": {
|
|
336
335
|
const cqrsImports = [];
|
|
337
336
|
const cqrsAdapters = [];
|
|
338
|
-
if (packages.includes("otel")) {
|
|
339
|
-
cqrsImports.push(`import { OtelAdapter } from '@forinda/kickjs-otel'`);
|
|
340
|
-
cqrsAdapters.push(` OtelAdapter({ serviceName: '${name}' }),`);
|
|
341
|
-
}
|
|
342
337
|
if (packages.includes("devtools")) {
|
|
343
338
|
cqrsImports.push(`import { DevToolsAdapter } from '@forinda/kickjs-devtools'`);
|
|
344
339
|
cqrsAdapters.push(` DevToolsAdapter(),`);
|
|
@@ -375,10 +370,6 @@ export const app = await bootstrap({
|
|
|
375
370
|
imports.push(`import { DevToolsAdapter } from '@forinda/kickjs-devtools'`);
|
|
376
371
|
adapters.push(` DevToolsAdapter(),`);
|
|
377
372
|
}
|
|
378
|
-
if (packages.includes("otel")) {
|
|
379
|
-
imports.push(`import { OtelAdapter } from '@forinda/kickjs-otel'`);
|
|
380
|
-
adapters.push(` OtelAdapter({ serviceName: '${name}' }),`);
|
|
381
|
-
}
|
|
382
373
|
return `import 'reflect-metadata'
|
|
383
374
|
// Side-effect import — registers the extended env schema with kickjs
|
|
384
375
|
// **before** any controller / service / @Value gets resolved. Without
|
|
@@ -403,10 +394,6 @@ export const app = await bootstrap({ modules${adapters.length ? `,\n adapters:
|
|
|
403
394
|
restImports.push(`import { SwaggerAdapter } from '@forinda/kickjs-swagger'`);
|
|
404
395
|
restAdapters.push(` SwaggerAdapter({\n info: { title: '${name}', version: '${version}' },\n }),`);
|
|
405
396
|
}
|
|
406
|
-
if (packages.includes("otel")) {
|
|
407
|
-
restImports.push(`import { OtelAdapter } from '@forinda/kickjs-otel'`);
|
|
408
|
-
restAdapters.push(` OtelAdapter({ serviceName: '${name}' }),`);
|
|
409
|
-
}
|
|
410
397
|
return `import 'reflect-metadata'
|
|
411
398
|
// Side-effect import — registers the extended env schema with kickjs
|
|
412
399
|
// **before** any controller / service / @Value gets resolved. Without
|
|
@@ -632,7 +619,7 @@ function generateReadme(name, template, pm) {
|
|
|
632
619
|
};
|
|
633
620
|
const packages = ["@forinda/kickjs", "@forinda/kickjs-vite"];
|
|
634
621
|
if (template !== "minimal") packages.push("@forinda/kickjs-swagger", "@forinda/kickjs-devtools");
|
|
635
|
-
if (template === "cqrs") packages.push("@forinda/kickjs-queue", "@forinda/kickjs-ws"
|
|
622
|
+
if (template === "cqrs") packages.push("@forinda/kickjs-queue", "@forinda/kickjs-ws");
|
|
636
623
|
return `# ${name}
|
|
637
624
|
|
|
638
625
|
A **${templateLabels[template] ?? "REST API"}** built with [KickJS](https://forinda.github.io/kick-js/) — a decorator-driven Node.js framework on Express 5 and TypeScript.
|
|
@@ -677,11 +664,11 @@ kick add auth # Authentication (JWT, API key, OAuth)
|
|
|
677
664
|
kick add swagger # OpenAPI documentation
|
|
678
665
|
kick add ws # WebSocket support
|
|
679
666
|
kick add queue # Background job processing
|
|
680
|
-
kick add mailer # Email sending
|
|
681
|
-
kick add cron # Scheduled tasks
|
|
682
667
|
kick add --list # Show all available packages
|
|
683
668
|
\`\`\`
|
|
684
669
|
|
|
670
|
+
For email, scheduled tasks, multi-tenancy, OpenTelemetry, GraphQL, and notifications use the BYO recipes in the [KickJS guides](https://forinda.github.io/kick-js/guide/) — they wire the upstream library through \`defineAdapter()\` / \`definePlugin()\` directly, so you keep control of the integration.
|
|
671
|
+
|
|
685
672
|
## Environment Variables
|
|
686
673
|
|
|
687
674
|
Copy \`.env.example\` to \`.env\` and configure:
|
|
@@ -1652,8 +1639,7 @@ async function initProject(options) {
|
|
|
1652
1639
|
log(" kick add <pkg> Install a KickJS package + peers");
|
|
1653
1640
|
log(" kick add --list Show all available packages");
|
|
1654
1641
|
log("");
|
|
1655
|
-
log("Available: auth, swagger, drizzle, prisma, ws,
|
|
1656
|
-
log(" queue, mailer, otel, devtools, multi-tenant, notifications, mcp, testing");
|
|
1642
|
+
log("Available: auth, swagger, drizzle, prisma, ws, queue, devtools, mcp, testing");
|
|
1657
1643
|
log("");
|
|
1658
1644
|
}
|
|
1659
1645
|
//#endregion
|
|
@@ -1739,11 +1725,6 @@ const OPTIONAL_PACKAGES = [
|
|
|
1739
1725
|
label: "Swagger",
|
|
1740
1726
|
hint: "OpenAPI docs"
|
|
1741
1727
|
},
|
|
1742
|
-
{
|
|
1743
|
-
value: "otel",
|
|
1744
|
-
label: "OpenTelemetry",
|
|
1745
|
-
hint: "tracing & metrics"
|
|
1746
|
-
},
|
|
1747
1728
|
{
|
|
1748
1729
|
value: "ws",
|
|
1749
1730
|
label: "WebSocket",
|
|
@@ -1754,34 +1735,14 @@ const OPTIONAL_PACKAGES = [
|
|
|
1754
1735
|
label: "Queue",
|
|
1755
1736
|
hint: "BullMQ/RabbitMQ/Kafka"
|
|
1756
1737
|
},
|
|
1757
|
-
{
|
|
1758
|
-
value: "cron",
|
|
1759
|
-
label: "Cron [deprecated, see /guide/cron]",
|
|
1760
|
-
hint: "scheduled jobs"
|
|
1761
|
-
},
|
|
1762
|
-
{
|
|
1763
|
-
value: "mailer",
|
|
1764
|
-
label: "Mailer [deprecated, see /guide/mailer]",
|
|
1765
|
-
hint: "SMTP, Resend, SES"
|
|
1766
|
-
},
|
|
1767
1738
|
{
|
|
1768
1739
|
value: "devtools",
|
|
1769
1740
|
label: "DevTools",
|
|
1770
1741
|
hint: "debug dashboard"
|
|
1771
|
-
},
|
|
1772
|
-
{
|
|
1773
|
-
value: "notifications",
|
|
1774
|
-
label: "Notifications [deprecated, see /guide/notifications]",
|
|
1775
|
-
hint: "email, Slack, Discord"
|
|
1776
|
-
},
|
|
1777
|
-
{
|
|
1778
|
-
value: "multi-tenant",
|
|
1779
|
-
label: "Multi-Tenant [deprecated, see /guide/multi-tenancy]",
|
|
1780
|
-
hint: "tenant resolution"
|
|
1781
1742
|
}
|
|
1782
1743
|
];
|
|
1783
1744
|
function registerInitCommand(program) {
|
|
1784
|
-
program.command("new [name]").alias("init").description("Create a new KickJS project (use \".\" for current directory)").option("-d, --directory <dir>", "Target directory (defaults to project name)").option("--pm <manager>", "Package manager: pnpm | npm | yarn | bun").option("--git", "Initialize git repository").option("--no-git", "Skip git initialization").option("--install", "Install dependencies after scaffolding").option("--no-install", "Skip dependency installation").option("-f, --force", "Remove existing files without prompting").option("-t, --template <type>", "Project template: rest | ddd | cqrs | minimal").option("-r, --repo <type>", "Default repository: prisma | drizzle | inmemory | custom").option("--packages <packages>", "Comma-separated packages to include (e.g. auth,swagger,
|
|
1745
|
+
program.command("new [name]").alias("init").description("Create a new KickJS project (use \".\" for current directory)").option("-d, --directory <dir>", "Target directory (defaults to project name)").option("--pm <manager>", "Package manager: pnpm | npm | yarn | bun").option("--git", "Initialize git repository").option("--no-git", "Skip git initialization").option("--install", "Install dependencies after scaffolding").option("--no-install", "Skip dependency installation").option("-f, --force", "Remove existing files without prompting").option("-t, --template <type>", "Project template: rest | ddd | cqrs | minimal").option("-r, --repo <type>", "Default repository: prisma | drizzle | inmemory | custom").option("--packages <packages>", "Comma-separated packages to include (e.g. auth,swagger,ws,queue)").action(async (name, opts) => {
|
|
1785
1746
|
intro("KickJS — Create a new project");
|
|
1786
1747
|
if (!name) name = await text({
|
|
1787
1748
|
message: "Project name",
|
|
@@ -8244,11 +8205,6 @@ const PACKAGE_REGISTRY = {
|
|
|
8244
8205
|
peers: [],
|
|
8245
8206
|
description: "OpenAPI spec + Swagger UI + ReDoc"
|
|
8246
8207
|
},
|
|
8247
|
-
graphql: {
|
|
8248
|
-
pkg: "@forinda/kickjs-graphql",
|
|
8249
|
-
peers: ["graphql"],
|
|
8250
|
-
description: "[DEPRECATED — removed in v5] GraphQL resolvers + GraphiQL. See guide/graphql for the BYO recipe (graphql-http / Yoga / Apollo / Pothos)."
|
|
8251
|
-
},
|
|
8252
8208
|
drizzle: {
|
|
8253
8209
|
pkg: "@forinda/kickjs-drizzle",
|
|
8254
8210
|
peers: ["drizzle-orm"],
|
|
@@ -8264,11 +8220,6 @@ const PACKAGE_REGISTRY = {
|
|
|
8264
8220
|
peers: ["socket.io"],
|
|
8265
8221
|
description: "WebSocket with @WsController decorators"
|
|
8266
8222
|
},
|
|
8267
|
-
otel: {
|
|
8268
|
-
pkg: "@forinda/kickjs-otel",
|
|
8269
|
-
peers: ["@opentelemetry/api"],
|
|
8270
|
-
description: "[DEPRECATED — removed in v5] OpenTelemetry tracing + metrics. See guide/otel for the BYO recipe (also covers the processHooks: errors-only setting for SDK shutdown)."
|
|
8271
|
-
},
|
|
8272
8223
|
devtools: {
|
|
8273
8224
|
pkg: "@forinda/kickjs-devtools",
|
|
8274
8225
|
peers: [],
|
|
@@ -8280,16 +8231,6 @@ const PACKAGE_REGISTRY = {
|
|
|
8280
8231
|
peers: ["jsonwebtoken"],
|
|
8281
8232
|
description: "Authentication — JWT, API key, and custom strategies"
|
|
8282
8233
|
},
|
|
8283
|
-
mailer: {
|
|
8284
|
-
pkg: "@forinda/kickjs-mailer",
|
|
8285
|
-
peers: ["nodemailer"],
|
|
8286
|
-
description: "[DEPRECATED — removed in v5] Email sending. See guide/mailer for the BYO recipe + console-mailer asset-manager example."
|
|
8287
|
-
},
|
|
8288
|
-
cron: {
|
|
8289
|
-
pkg: "@forinda/kickjs-cron",
|
|
8290
|
-
peers: ["croner"],
|
|
8291
|
-
description: "[DEPRECATED — removed in v5] Cron job scheduling. See guide/cron for the BYO recipe (croner + framework metadata helpers)."
|
|
8292
|
-
},
|
|
8293
8234
|
queue: {
|
|
8294
8235
|
pkg: "@forinda/kickjs-queue",
|
|
8295
8236
|
peers: [],
|
|
@@ -8310,16 +8251,6 @@ const PACKAGE_REGISTRY = {
|
|
|
8310
8251
|
peers: ["kafkajs"],
|
|
8311
8252
|
description: "Queue with Kafka"
|
|
8312
8253
|
},
|
|
8313
|
-
"multi-tenant": {
|
|
8314
|
-
pkg: "@forinda/kickjs-multi-tenant",
|
|
8315
|
-
peers: [],
|
|
8316
|
-
description: "[DEPRECATED — removed in v5] Tenant resolution middleware. See guide/multi-tenancy for the BYO recipe (defineHttpContextDecorator + Scope.REQUEST DI)."
|
|
8317
|
-
},
|
|
8318
|
-
notifications: {
|
|
8319
|
-
pkg: "@forinda/kickjs-notifications",
|
|
8320
|
-
peers: [],
|
|
8321
|
-
description: "[DEPRECATED — removed in v5] Multi-channel notifications. See guide/notifications for the BYO recipe."
|
|
8322
|
-
},
|
|
8323
8254
|
mcp: {
|
|
8324
8255
|
pkg: "@forinda/kickjs-mcp",
|
|
8325
8256
|
peers: ["@modelcontextprotocol/sdk"],
|
|
@@ -8373,7 +8304,7 @@ function printPackageList() {
|
|
|
8373
8304
|
const peers = info.peers.length ? ` (+ ${info.peers.join(", ")})` : "";
|
|
8374
8305
|
console.log(` ${padded} ${info.description}${peers}`);
|
|
8375
8306
|
}
|
|
8376
|
-
console.log("\n Usage: kick add
|
|
8307
|
+
console.log("\n Usage: kick add auth drizzle swagger");
|
|
8377
8308
|
console.log(" kick add queue:bullmq");
|
|
8378
8309
|
console.log();
|
|
8379
8310
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli
|
|
2
|
+
* @forinda/kickjs-cli v5.0.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -1591,10 +1591,6 @@ function generateEntryFile(name, template, version, packages = []) {
|
|
|
1591
1591
|
case "cqrs": {
|
|
1592
1592
|
const cqrsImports = [];
|
|
1593
1593
|
const cqrsAdapters = [];
|
|
1594
|
-
if (packages.includes("otel")) {
|
|
1595
|
-
cqrsImports.push(`import { OtelAdapter } from '@forinda/kickjs-otel'`);
|
|
1596
|
-
cqrsAdapters.push(` OtelAdapter({ serviceName: '${name}' }),`);
|
|
1597
|
-
}
|
|
1598
1594
|
if (packages.includes("devtools")) {
|
|
1599
1595
|
cqrsImports.push(`import { DevToolsAdapter } from '@forinda/kickjs-devtools'`);
|
|
1600
1596
|
cqrsAdapters.push(` DevToolsAdapter(),`);
|
|
@@ -1631,10 +1627,6 @@ export const app = await bootstrap({
|
|
|
1631
1627
|
imports.push(`import { DevToolsAdapter } from '@forinda/kickjs-devtools'`);
|
|
1632
1628
|
adapters.push(` DevToolsAdapter(),`);
|
|
1633
1629
|
}
|
|
1634
|
-
if (packages.includes("otel")) {
|
|
1635
|
-
imports.push(`import { OtelAdapter } from '@forinda/kickjs-otel'`);
|
|
1636
|
-
adapters.push(` OtelAdapter({ serviceName: '${name}' }),`);
|
|
1637
|
-
}
|
|
1638
1630
|
return `import 'reflect-metadata'
|
|
1639
1631
|
// Side-effect import — registers the extended env schema with kickjs
|
|
1640
1632
|
// **before** any controller / service / @Value gets resolved. Without
|
|
@@ -1659,10 +1651,6 @@ export const app = await bootstrap({ modules${adapters.length ? `,\n adapters:
|
|
|
1659
1651
|
restImports.push(`import { SwaggerAdapter } from '@forinda/kickjs-swagger'`);
|
|
1660
1652
|
restAdapters.push(` SwaggerAdapter({\n info: { title: '${name}', version: '${version}' },\n }),`);
|
|
1661
1653
|
}
|
|
1662
|
-
if (packages.includes("otel")) {
|
|
1663
|
-
restImports.push(`import { OtelAdapter } from '@forinda/kickjs-otel'`);
|
|
1664
|
-
restAdapters.push(` OtelAdapter({ serviceName: '${name}' }),`);
|
|
1665
|
-
}
|
|
1666
1654
|
return `import 'reflect-metadata'
|
|
1667
1655
|
// Side-effect import — registers the extended env schema with kickjs
|
|
1668
1656
|
// **before** any controller / service / @Value gets resolved. Without
|
|
@@ -2769,7 +2757,6 @@ export type ${pascal}DTO = z.infer<typeof ${camel}Schema>
|
|
|
2769
2757
|
const PACKAGE_DEPS = {
|
|
2770
2758
|
auth: "@forinda/kickjs-auth",
|
|
2771
2759
|
swagger: "@forinda/kickjs-swagger",
|
|
2772
|
-
otel: "@forinda/kickjs-otel",
|
|
2773
2760
|
ws: "@forinda/kickjs-ws",
|
|
2774
2761
|
queue: "@forinda/kickjs-queue",
|
|
2775
2762
|
devtools: "@forinda/kickjs-devtools"
|
|
@@ -2994,7 +2981,7 @@ function generateReadme(name, template, pm) {
|
|
|
2994
2981
|
};
|
|
2995
2982
|
const packages = ["@forinda/kickjs", "@forinda/kickjs-vite"];
|
|
2996
2983
|
if (template !== "minimal") packages.push("@forinda/kickjs-swagger", "@forinda/kickjs-devtools");
|
|
2997
|
-
if (template === "cqrs") packages.push("@forinda/kickjs-queue", "@forinda/kickjs-ws"
|
|
2984
|
+
if (template === "cqrs") packages.push("@forinda/kickjs-queue", "@forinda/kickjs-ws");
|
|
2998
2985
|
return `# ${name}
|
|
2999
2986
|
|
|
3000
2987
|
A **${templateLabels[template] ?? "REST API"}** built with [KickJS](https://forinda.github.io/kick-js/) — a decorator-driven Node.js framework on Express 5 and TypeScript.
|
|
@@ -3039,11 +3026,11 @@ kick add auth # Authentication (JWT, API key, OAuth)
|
|
|
3039
3026
|
kick add swagger # OpenAPI documentation
|
|
3040
3027
|
kick add ws # WebSocket support
|
|
3041
3028
|
kick add queue # Background job processing
|
|
3042
|
-
kick add mailer # Email sending
|
|
3043
|
-
kick add cron # Scheduled tasks
|
|
3044
3029
|
kick add --list # Show all available packages
|
|
3045
3030
|
\`\`\`
|
|
3046
3031
|
|
|
3032
|
+
For email, scheduled tasks, multi-tenancy, OpenTelemetry, GraphQL, and notifications use the BYO recipes in the [KickJS guides](https://forinda.github.io/kick-js/guide/) — they wire the upstream library through \`defineAdapter()\` / \`definePlugin()\` directly, so you keep control of the integration.
|
|
3033
|
+
|
|
3047
3034
|
## Environment Variables
|
|
3048
3035
|
|
|
3049
3036
|
Copy \`.env.example\` to \`.env\` and configure:
|
|
@@ -3950,7 +3937,7 @@ async function initProject(options) {
|
|
|
3950
3937
|
}
|
|
3951
3938
|
}
|
|
3952
3939
|
try {
|
|
3953
|
-
const { runTypegen } = await import("./typegen-
|
|
3940
|
+
const { runTypegen } = await import("./typegen-B13guHZF.mjs");
|
|
3954
3941
|
await runTypegen({
|
|
3955
3942
|
cwd: dir,
|
|
3956
3943
|
allowDuplicates: true,
|
|
@@ -4014,8 +4001,7 @@ async function initProject(options) {
|
|
|
4014
4001
|
log(" kick add <pkg> Install a KickJS package + peers");
|
|
4015
4002
|
log(" kick add --list Show all available packages");
|
|
4016
4003
|
log("");
|
|
4017
|
-
log("Available: auth, swagger, drizzle, prisma, ws,
|
|
4018
|
-
log(" queue, mailer, otel, devtools, multi-tenant, notifications, mcp, testing");
|
|
4004
|
+
log("Available: auth, swagger, drizzle, prisma, ws, queue, devtools, mcp, testing");
|
|
4019
4005
|
log("");
|
|
4020
4006
|
}
|
|
4021
4007
|
//#endregion
|