@beignet/cli 0.0.33 → 0.0.35
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/CHANGELOG.md +33 -0
- package/README.md +34 -7
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/inspect.js +54 -17
- package/dist/inspect.js.map +1 -1
- package/dist/lint.js +10 -3
- package/dist/lint.js.map +1 -1
- package/dist/make/inbox.d.ts.map +1 -1
- package/dist/make/inbox.js +4 -5
- package/dist/make/inbox.js.map +1 -1
- package/dist/make/payments.d.ts.map +1 -1
- package/dist/make/payments.js +5 -7
- package/dist/make/payments.js.map +1 -1
- package/dist/make/shared.js +1 -1
- package/dist/make/shared.js.map +1 -1
- package/dist/make/tenancy.d.ts.map +1 -1
- package/dist/make/tenancy.js +4 -6
- package/dist/make/tenancy.js.map +1 -1
- package/dist/make.js +8 -9
- package/dist/make.js.map +1 -1
- package/dist/provider-add.d.ts.map +1 -1
- package/dist/provider-add.js +52 -69
- package/dist/provider-add.js.map +1 -1
- package/dist/registry-edits.js +2 -1
- package/dist/registry-edits.js.map +1 -1
- package/dist/schedule.d.ts.map +1 -1
- package/dist/schedule.js +1 -1
- package/dist/schedule.js.map +1 -1
- package/dist/templates/agents.d.ts.map +1 -1
- package/dist/templates/agents.js +2 -0
- package/dist/templates/agents.js.map +1 -1
- package/dist/templates/base.js +3 -3
- package/dist/templates/base.js.map +1 -1
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +1 -0
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/server.d.ts +1 -0
- package/dist/templates/server.d.ts.map +1 -1
- package/dist/templates/server.js +19 -11
- package/dist/templates/server.js.map +1 -1
- package/dist/templates/testing.d.ts.map +1 -1
- package/dist/templates/testing.js +55 -26
- package/dist/templates/testing.js.map +1 -1
- package/dist/templates/todos.d.ts.map +1 -1
- package/dist/templates/todos.js +3 -4
- package/dist/templates/todos.js.map +1 -1
- package/package.json +3 -2
- package/skills/app-structure/SKILL.md +14 -1
- package/src/config.ts +2 -0
- package/src/inspect.ts +87 -21
- package/src/lint.ts +15 -3
- package/src/make/inbox.ts +4 -5
- package/src/make/payments.ts +4 -8
- package/src/make/shared.ts +1 -1
- package/src/make/tenancy.ts +4 -10
- package/src/make.ts +8 -9
- package/src/provider-add.ts +52 -69
- package/src/registry-edits.ts +2 -1
- package/src/schedule.ts +4 -3
- package/src/templates/agents.ts +2 -0
- package/src/templates/base.ts +3 -3
- package/src/templates/index.ts +1 -0
- package/src/templates/server.ts +19 -11
- package/src/templates/testing.ts +55 -26
- package/src/templates/todos.ts +3 -4
- package/src/test-helpers/generated-app.ts +1 -1
package/dist/make.js
CHANGED
|
@@ -3155,7 +3155,7 @@ function useCaseTestFile(names, config) {
|
|
|
3155
3155
|
import { createUseCaseTester } from "@beignet/core/application";
|
|
3156
3156
|
import { createInMemoryDevtools } from "@beignet/devtools";
|
|
3157
3157
|
import { createTestContextFactory, createTestPorts } from "@beignet/core/testing";
|
|
3158
|
-
import { createTestAnonymousActor } from "@beignet/core/
|
|
3158
|
+
import { createTestAnonymousActor } from "@beignet/core/testing";
|
|
3159
3159
|
import type { AppContext } from "${aliasModule(config.paths.appContext)}";
|
|
3160
3160
|
import { appPorts } from "${aliasModule(config.paths.infrastructurePorts)}";
|
|
3161
3161
|
import { ${names.exportName} } from "${relativeModule(filePath, useCaseFilePath(names, config))}";
|
|
@@ -3310,7 +3310,7 @@ export const ${names.singularCamel}Events = [
|
|
|
3310
3310
|
}
|
|
3311
3311
|
function resourcePolicyTestFile(names, options) {
|
|
3312
3312
|
return `import { describe, expect, it } from "@/lib/beignet-test";
|
|
3313
|
-
import { createPolicyTester } from "@beignet/core/
|
|
3313
|
+
import { createPolicyTester } from "@beignet/core/testing";
|
|
3314
3314
|
import { ${names.singularCamel}Policy } from "../policy";
|
|
3315
3315
|
import type { ${names.singularPascal} } from "../schemas";
|
|
3316
3316
|
|
|
@@ -3492,8 +3492,8 @@ function listenerFile(names, config) {
|
|
|
3492
3492
|
return `import { defineListener } from "${aliasModule(config.paths.listenersBuilder)}";
|
|
3493
3493
|
import { ${names.event.eventExportName} } from "${relativeModule(filePath, eventFilePath(names.event, config))}";
|
|
3494
3494
|
|
|
3495
|
-
export const ${names.listenerExportName} = defineListener(${names.
|
|
3496
|
-
\
|
|
3495
|
+
export const ${names.listenerExportName} = defineListener("${names.listenerName}", {
|
|
3496
|
+
\tevent: ${names.event.eventExportName},
|
|
3497
3497
|
\tasync handle({ payload, ctx }) {
|
|
3498
3498
|
\t\tctx.ports.logger.info("Listener handled", {
|
|
3499
3499
|
\t\t\tlistenerName: "${names.listenerName}",
|
|
@@ -3812,8 +3812,7 @@ function routeGroupFile(names, config, mode, _options) {
|
|
|
3812
3812
|
const contractsPath = resourceContractFilePath(names, config);
|
|
3813
3813
|
const useCasesPath = resourceUseCaseIndexPath(names, config);
|
|
3814
3814
|
return `import "@beignet/core/server-only";
|
|
3815
|
-
import { defineRouteGroup } from "
|
|
3816
|
-
import type { AppContext } from "${relativeModule(routeFilePath, config.paths.appContext)}";
|
|
3815
|
+
import { defineRouteGroup } from "${relativeModule(routeFilePath, config.paths.routesBuilder)}";
|
|
3817
3816
|
import {
|
|
3818
3817
|
create${names.singularPascal},
|
|
3819
3818
|
${mode === "resource" ? ` delete${names.singularPascal},\n get${names.singularPascal},\n` : ""} list${names.pluralPascal},
|
|
@@ -3823,7 +3822,7 @@ import {
|
|
|
3823
3822
|
${mode === "resource" ? ` delete${names.singularPascal}UseCase,\n get${names.singularPascal}UseCase,\n` : ""} list${names.pluralPascal}UseCase,
|
|
3824
3823
|
${mode === "resource" ? ` update${names.singularPascal}UseCase,\n` : ""}} from "${relativeModule(routeFilePath, useCasesPath)}";
|
|
3825
3824
|
|
|
3826
|
-
export const ${names.singularCamel}Routes = defineRouteGroup
|
|
3825
|
+
export const ${names.singularCamel}Routes = defineRouteGroup({
|
|
3827
3826
|
name: "${names.pluralKebab}",
|
|
3828
3827
|
routes: [
|
|
3829
3828
|
{ contract: list${names.pluralPascal}, useCase: list${names.pluralPascal}UseCase },
|
|
@@ -3838,11 +3837,11 @@ function testFile(names, config, mode, options) {
|
|
|
3838
3837
|
const requestTarget = "app";
|
|
3839
3838
|
return `import { describe, expect, it } from "@/lib/beignet-test";
|
|
3840
3839
|
import { createUseCaseTester } from "@beignet/core/application";
|
|
3841
|
-
${mode === "resource" ? `import { isAppError } from "@beignet/core/errors";\n` : ""}import { defineRoutes } from "@beignet/
|
|
3840
|
+
${mode === "resource" ? `import { isAppError } from "@beignet/core/errors";\n` : ""}import { defineRoutes } from "@beignet/core/server";
|
|
3842
3841
|
import { createTestApp } from "@beignet/web/testing";
|
|
3843
3842
|
import { createInMemoryDevtools } from "@beignet/devtools";
|
|
3844
3843
|
import { createTestContextFactory, createTestPorts } from "@beignet/core/testing";
|
|
3845
|
-
import { ${options.auth ? "createTestUserActor" : "createTestAnonymousActor"}${options.tenant ? ", createTestTenant" : ""} } from "@beignet/core/
|
|
3844
|
+
import { ${options.auth ? "createTestUserActor" : "createTestAnonymousActor"}${options.tenant ? ", createTestTenant" : ""} } from "@beignet/core/testing";
|
|
3846
3845
|
import type { AppContext } from "${aliasModule(config.paths.appContext)}";
|
|
3847
3846
|
import { appPorts } from "${aliasModule(config.paths.infrastructurePorts)}";
|
|
3848
3847
|
import { appContext } from "${aliasModule(serverContextPath)}";
|