@betterstart/cli 0.1.35 → 0.1.36
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.js +8 -5
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -448,7 +448,8 @@ function generateEmailTemplate(schema, cwd, cmsDir, options = {}) {
|
|
|
448
448
|
const pascal = toPascalCase(formName);
|
|
449
449
|
const fields = getAllFormSchemaFields(schema).filter((f) => f.name);
|
|
450
450
|
const includeDynamic = hasDynamicFields(schema);
|
|
451
|
-
const
|
|
451
|
+
const kebab = toKebabCase(formName);
|
|
452
|
+
const filePath = path3.join(cwd, cmsDir, "lib", "emails", `${kebab}-submission.tsx`);
|
|
452
453
|
const dir = path3.dirname(filePath);
|
|
453
454
|
if (!fs3.existsSync(dir)) fs3.mkdirSync(dir, { recursive: true });
|
|
454
455
|
if (fs3.existsSync(filePath) && !options.force) {
|
|
@@ -1727,7 +1728,8 @@ function generateFormActions(schema, cwd, actionsDir, options) {
|
|
|
1727
1728
|
return { success: false, error: '${f.label} is required' }
|
|
1728
1729
|
}`
|
|
1729
1730
|
).join("\n ");
|
|
1730
|
-
const
|
|
1731
|
+
const kebab = toKebabCase(formName);
|
|
1732
|
+
const filePath = path6.join(cwd, actionsDir, `${kebab}-form.ts`);
|
|
1731
1733
|
const dir = path6.dirname(filePath);
|
|
1732
1734
|
if (!fs6.existsSync(dir)) fs6.mkdirSync(dir, { recursive: true });
|
|
1733
1735
|
if (fs6.existsSync(filePath) && !options.force) {
|
|
@@ -2514,7 +2516,8 @@ function generateFormHook(schema, cwd, hooksDir, options) {
|
|
|
2514
2516
|
const formName = schema.name;
|
|
2515
2517
|
const pascal = toPascalCase(formName);
|
|
2516
2518
|
const camel = toCamelCase(formName);
|
|
2517
|
-
const
|
|
2519
|
+
const kebab = toKebabCase(formName);
|
|
2520
|
+
const filePath = path9.join(cwd, hooksDir, `use-${kebab}-form.ts`);
|
|
2518
2521
|
const dir = path9.dirname(filePath);
|
|
2519
2522
|
if (!fs9.existsSync(dir)) fs9.mkdirSync(dir, { recursive: true });
|
|
2520
2523
|
if (fs9.existsSync(filePath) && !options.force) {
|
|
@@ -2528,8 +2531,8 @@ function generateFormHook(schema, cwd, hooksDir, options) {
|
|
|
2528
2531
|
export${pascal}SubmissionsJSON,
|
|
2529
2532
|
get${pascal}Submission,
|
|
2530
2533
|
get${pascal}Submissions,
|
|
2531
|
-
} from '@cms/actions/${
|
|
2532
|
-
import type { Create${pascal}SubmissionInput } from '@cms/actions/${
|
|
2534
|
+
} from '@cms/actions/${kebab}-form'
|
|
2535
|
+
import type { Create${pascal}SubmissionInput } from '@cms/actions/${kebab}-form'
|
|
2533
2536
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
|
2534
2537
|
import { toast } from 'sonner'
|
|
2535
2538
|
|