@carlonicora/nextjs-jsonapi 1.38.1 → 1.38.2
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/scripts/generate-web-module/generator.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/generator.js +5 -0
- package/dist/scripts/generate-web-module/generator.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/container.template.js +7 -7
- package/dist/scripts/generate-web-module/templates/components/container.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/content.template.js +1 -1
- package/dist/scripts/generate-web-module/templates/components/content.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/deleter.template.js +2 -2
- package/dist/scripts/generate-web-module/templates/components/deleter.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/details.template.js +1 -1
- package/dist/scripts/generate-web-module/templates/components/details.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/editor.template.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/editor.template.js +8 -13
- package/dist/scripts/generate-web-module/templates/components/editor.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/list-container.template.js +1 -1
- package/dist/scripts/generate-web-module/templates/components/list-container.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/list.template.js +5 -5
- package/dist/scripts/generate-web-module/templates/components/list.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/multi-selector.template.js +2 -2
- package/dist/scripts/generate-web-module/templates/components/multi-selector.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/selector.template.js +2 -2
- package/dist/scripts/generate-web-module/templates/components/selector.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/context.template.js +4 -4
- package/dist/scripts/generate-web-module/templates/context.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/data/interface.template.js +3 -3
- package/dist/scripts/generate-web-module/templates/data/interface.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/data/model.template.js +2 -2
- package/dist/scripts/generate-web-module/templates/data/model.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/data/service.template.js +1 -1
- package/dist/scripts/generate-web-module/templates/data/service.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/module.template.js +1 -1
- package/dist/scripts/generate-web-module/templates/module.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/pages/detail-page.template.js +4 -4
- package/dist/scripts/generate-web-module/templates/pages/detail-page.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/pages/list-page.template.js +2 -2
- package/dist/scripts/generate-web-module/templates/pages/list-page.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/table-hook.template.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/templates/table-hook.template.js +10 -6
- package/dist/scripts/generate-web-module/templates/table-hook.template.js.map +1 -1
- package/dist/scripts/generate-web-module/types/template-data.interface.d.ts +2 -0
- package/dist/scripts/generate-web-module/types/template-data.interface.d.ts.map +1 -1
- package/package.json +1 -1
- package/scripts/generate-web-module/generator.ts +5 -0
- package/scripts/generate-web-module/templates/components/container.template.ts +7 -7
- package/scripts/generate-web-module/templates/components/content.template.ts +1 -1
- package/scripts/generate-web-module/templates/components/deleter.template.ts +2 -2
- package/scripts/generate-web-module/templates/components/details.template.ts +1 -1
- package/scripts/generate-web-module/templates/components/editor.template.ts +23 -18
- package/scripts/generate-web-module/templates/components/list-container.template.ts +1 -1
- package/scripts/generate-web-module/templates/components/list.template.ts +5 -5
- package/scripts/generate-web-module/templates/components/multi-selector.template.ts +2 -2
- package/scripts/generate-web-module/templates/components/selector.template.ts +2 -2
- package/scripts/generate-web-module/templates/context.template.ts +4 -4
- package/scripts/generate-web-module/templates/data/interface.template.ts +5 -11
- package/scripts/generate-web-module/templates/data/model.template.ts +2 -2
- package/scripts/generate-web-module/templates/data/service.template.ts +1 -1
- package/scripts/generate-web-module/templates/module.template.ts +1 -1
- package/scripts/generate-web-module/templates/pages/detail-page.template.ts +4 -4
- package/scripts/generate-web-module/templates/pages/list-page.template.ts +2 -2
- package/scripts/generate-web-module/templates/table-hook.template.ts +16 -8
- package/scripts/generate-web-module/types/template-data.interface.ts +9 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.template.js","sourceRoot":"","sources":["../../../../../scripts/generate-web-module/templates/data/service.template.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAWH,0DA0BC;AAhCD;;;;;GAKG;AACH,SAAgB,uBAAuB,CAAC,IAA0B;IAChE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,0BAA0B,EAAE,GAAG,IAAI,CAAC;IAElE,MAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,aAAa,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAClD,MAAM,cAAc,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,mBAAmB,GAAG,2BAA2B,CAAC,IAAI,CAAC,CAAC;IAC9D,MAAM,YAAY,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAChD,MAAM,YAAY,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAChD,MAAM,YAAY,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAEhD,OAAO,GAAG,OAAO;;eAEJ,KAAK,CAAC,UAAU;EAC7B,aAAa;;EAEb,cAAc;;EAEd,mBAAmB;EACnB,YAAY;;EAEZ,YAAY;;EAEZ,YAAY;;CAEb,CAAC;AACF,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,IAA0B;IACjD,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEvB,OAAO;;WAEE,KAAK,CAAC,UAAU,UAAU,KAAK,CAAC,UAAU,gCAAgC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"service.template.js","sourceRoot":"","sources":["../../../../../scripts/generate-web-module/templates/data/service.template.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAWH,0DA0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EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEvB,OAAO,iCAAiC,KAAK,CAAC,UAAU,mBAAmB,KAAK,CAAC,UAAU;;sBAEvE,KAAK,CAAC,UAAU;;0DAEoB,KAAK,CAAC,UAAU;;;IAGtE,CAAC;AACL,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB,CAAC,IAA0B;IACtD,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEvB,OAAO,mCAAmC,KAAK,CAAC,SAAS;;sBAErC,KAAK,CAAC,UAAU;;0DAEoB,KAAK,CAAC,UAAU,gBAAgB,KAAK,CAAC,SAAS;;IAErG,CAAC;AACL,CAAC"}
|
|
@@ -18,7 +18,7 @@ function generateModuleTemplate(data) {
|
|
|
18
18
|
// Build inclusions for lists
|
|
19
19
|
const listFieldNames = getListFieldNames(data);
|
|
20
20
|
const listInclusionFields = listFieldNames.map((f) => `\`${f}\``).join(", ");
|
|
21
|
-
return `import { ${names.pascalCase} } from "@/features/${data.
|
|
21
|
+
return `import { ${names.pascalCase} } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}";
|
|
22
22
|
import { createJsonApiInclusion } from "@carlonicora/nextjs-jsonapi/core";
|
|
23
23
|
import { ModuleFactory } from "@carlonicora/nextjs-jsonapi/core";
|
|
24
24
|
import { ${field_mapping_types_1.DEFAULT_MODULE_ICON} } from "lucide-react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.template.js","sourceRoot":"","sources":["../../../../scripts/generate-web-module/templates/module.template.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAWH,wDA6BC;AArCD,sEAAmE;AAEnE;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAC,IAA0B;IAC/D,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IAEnE,6BAA6B;IAC7B,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,mBAAmB,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE7E,OAAO,YAAY,KAAK,CAAC,UAAU,uBAAuB,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"module.template.js","sourceRoot":"","sources":["../../../../scripts/generate-web-module/templates/module.template.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAWH,wDA6BC;AArCD,sEAAmE;AAEnE;;;;;GAKG;AACH,SAAgB,sBAAsB,CAAC,IAA0B;IAC/D,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IAEnE,6BAA6B;IAC7B,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,mBAAmB,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE7E,OAAO,YAAY,KAAK,CAAC,UAAU,uBAAuB,IAAI,CAAC,eAAe,IAAI,KAAK,CAAC,SAAS,SAAS,KAAK,CAAC,UAAU;;;WAGjH,yCAAmB;;eAEf,KAAK,CAAC,UAAU;;iBAEd,KAAK,CAAC,WAAW;aACrB,KAAK,CAAC,WAAW;aACjB,KAAK,CAAC,UAAU;iBACZ,QAAQ;YACb,yCAAmB;;;;oCAIK,QAAQ,OAAO,mBAAmB;;;;;;CAMrE,CAAC;AACF,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,IAA0B;IACnD,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACxC,MAAM,UAAU,GAAa,EAAE,CAAC;IAEhC,2CAA2C;IAC3C,IAAI,cAAc,EAAE,CAAC;QACnB,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,CAAC;IAED,yDAAyD;IACzD,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACvB,IAAI,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAClF,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -14,10 +14,10 @@ exports.generateDetailPageTemplate = generateDetailPageTemplate;
|
|
|
14
14
|
*/
|
|
15
15
|
function generateDetailPageTemplate(data) {
|
|
16
16
|
const { names } = data;
|
|
17
|
-
return `import ${names.pascalCase}Container from "@/features/${data.
|
|
18
|
-
import { ${names.pascalCase}Provider } from "@/features/${data.
|
|
19
|
-
import { ${names.pascalCase}Interface } from "@/features/${data.
|
|
20
|
-
import { ${names.pascalCase}Service } from "@/features/${data.
|
|
17
|
+
return `import ${names.pascalCase}Container from "@/features/${data.importTargetDir}/${names.kebabCase}/components/containers/${names.pascalCase}Container";
|
|
18
|
+
import { ${names.pascalCase}Provider } from "@/features/${data.importTargetDir}/${names.kebabCase}/contexts/${names.pascalCase}Context";
|
|
19
|
+
import { ${names.pascalCase}Interface } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Interface";
|
|
20
|
+
import { ${names.pascalCase}Service } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Service";
|
|
21
21
|
import { generateSpecificMetadata } from "@/utils/metadata";
|
|
22
22
|
import { PageContainer } from "@carlonicora/nextjs-jsonapi/components";
|
|
23
23
|
import { Modules } from "@carlonicora/nextjs-jsonapi/core";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detail-page.template.js","sourceRoot":"","sources":["../../../../../scripts/generate-web-module/templates/pages/detail-page.template.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAUH,gEAkDC;AAxDD;;;;;GAKG;AACH,SAAgB,0BAA0B,CAAC,IAA0B;IACnE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEvB,OAAO,UAAU,KAAK,CAAC,UAAU,8BAA8B,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"detail-page.template.js","sourceRoot":"","sources":["../../../../../scripts/generate-web-module/templates/pages/detail-page.template.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAUH,gEAkDC;AAxDD;;;;;GAKG;AACH,SAAgB,0BAA0B,CAAC,IAA0B;IACnE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEvB,OAAO,UAAU,KAAK,CAAC,UAAU,8BAA8B,IAAI,CAAC,eAAe,IAAI,KAAK,CAAC,SAAS,0BAA0B,KAAK,CAAC,UAAU;WACvI,KAAK,CAAC,UAAU,+BAA+B,IAAI,CAAC,eAAe,IAAI,KAAK,CAAC,SAAS,aAAa,KAAK,CAAC,UAAU;WACnH,KAAK,CAAC,UAAU,gCAAgC,IAAI,CAAC,eAAe,IAAI,KAAK,CAAC,SAAS,SAAS,KAAK,CAAC,UAAU;WAChH,KAAK,CAAC,UAAU,8BAA8B,IAAI,CAAC,eAAe,IAAI,KAAK,CAAC,SAAS,SAAS,KAAK,CAAC,UAAU;;;;;;;;;;iBAUxG,KAAK,CAAC,UAAU,kCAAkC,KAAK,CAAC,UAAU;;;;;;UAMzE,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,UAAU,8BAA8B,KAAK,CAAC,UAAU;;;sBAGtE,KAAK,CAAC,UAAU;;YAE1B,KAAK,CAAC,SAAS;;wBAEH,KAAK,CAAC,WAAW,0BAA0B,KAAK,CAAC,SAAS;uBAC3D,KAAK,CAAC,WAAW;;;;;gCAKR,KAAK,CAAC,UAAU;;UAEtC,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,UAAU,8BAA8B,KAAK,CAAC,UAAU;;0DAElC,KAAK,CAAC,UAAU,gCAAgC,KAAK,CAAC,SAAS;;;OAGlH,KAAK,CAAC,UAAU,sBAAsB,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,SAAS;;WAEtE,KAAK,CAAC,UAAU;;QAEnB,KAAK,CAAC,UAAU;;;CAGvB,CAAC;AACF,CAAC"}
|
|
@@ -14,8 +14,8 @@ exports.generateListPageTemplate = generateListPageTemplate;
|
|
|
14
14
|
*/
|
|
15
15
|
function generateListPageTemplate(data) {
|
|
16
16
|
const { names } = data;
|
|
17
|
-
return `import ${names.pascalCase}ListContainer from "@/features/${data.
|
|
18
|
-
import { ${names.pascalCase}Provider } from "@/features/${data.
|
|
17
|
+
return `import ${names.pascalCase}ListContainer from "@/features/${data.importTargetDir}/${names.kebabCase}/components/containers/${names.pascalCase}ListContainer";
|
|
18
|
+
import { ${names.pascalCase}Provider } from "@/features/${data.importTargetDir}/${names.kebabCase}/contexts/${names.pascalCase}Context";
|
|
19
19
|
import { PageContainer } from "@carlonicora/nextjs-jsonapi/components";
|
|
20
20
|
import { Modules } from "@carlonicora/nextjs-jsonapi/core";
|
|
21
21
|
import { Action } from "@carlonicora/nextjs-jsonapi/core";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-page.template.js","sourceRoot":"","sources":["../../../../../scripts/generate-web-module/templates/pages/list-page.template.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAUH,4DAsBC;AA5BD;;;;;GAKG;AACH,SAAgB,wBAAwB,CAAC,IAA0B;IACjE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEvB,OAAO,UAAU,KAAK,CAAC,UAAU,kCAAkC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"list-page.template.js","sourceRoot":"","sources":["../../../../../scripts/generate-web-module/templates/pages/list-page.template.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAUH,4DAsBC;AA5BD;;;;;GAKG;AACH,SAAgB,wBAAwB,CAAC,IAA0B;IACjE,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEvB,OAAO,UAAU,KAAK,CAAC,UAAU,kCAAkC,IAAI,CAAC,eAAe,IAAI,KAAK,CAAC,SAAS,0BAA0B,KAAK,CAAC,UAAU;WAC3I,KAAK,CAAC,UAAU,+BAA+B,IAAI,CAAC,eAAe,IAAI,KAAK,CAAC,SAAS,aAAa,KAAK,CAAC,UAAU;;;;;;gCAM9F,KAAK,CAAC,YAAY;0DACQ,KAAK,CAAC,UAAU;;;OAGnE,KAAK,CAAC,UAAU;oCACa,KAAK,CAAC,WAAW;WAC1C,KAAK,CAAC,UAAU;;QAEnB,KAAK,CAAC,UAAU;;;CAGvB,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-hook.template.d.ts","sourceRoot":"","sources":["../../../../scripts/generate-web-module/templates/table-hook.template.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAiB,MAAM,kCAAkC,CAAC;AAGvF;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"table-hook.template.d.ts","sourceRoot":"","sources":["../../../../scripts/generate-web-module/templates/table-hook.template.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAiB,MAAM,kCAAkC,CAAC;AAGvF;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CA6E5E"}
|
|
@@ -19,11 +19,13 @@ function generateTableHookTemplate(data) {
|
|
|
19
19
|
const hasRelevance = fields.some((f) => f.name === "relevance");
|
|
20
20
|
return `"use client";
|
|
21
21
|
|
|
22
|
-
import { ${names.pascalCase}Fields } from "@/features/${data.
|
|
23
|
-
import { ${names.pascalCase}Interface } from "@/features/${data.
|
|
22
|
+
import { ${names.pascalCase}Fields } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Fields";
|
|
23
|
+
import { ${names.pascalCase}Interface } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Interface";
|
|
24
24
|
import { cellDate, cellId${hasAuthors ? ", ContributorsList" : ""} } from "@carlonicora/nextjs-jsonapi/components";
|
|
25
|
-
import { Modules } from "@carlonicora/nextjs-jsonapi/core";${extendsContent
|
|
26
|
-
|
|
25
|
+
import { Modules } from "@carlonicora/nextjs-jsonapi/core";${extendsContent
|
|
26
|
+
? `
|
|
27
|
+
import { ContentInterface } from "@carlonicora/nextjs-jsonapi/core";`
|
|
28
|
+
: ""}
|
|
27
29
|
import {
|
|
28
30
|
registerTableGenerator,
|
|
29
31
|
TableContent,
|
|
@@ -102,8 +104,10 @@ function generateFieldColumnEntries(data) {
|
|
|
102
104
|
<Tooltip>
|
|
103
105
|
<TooltipTrigger>
|
|
104
106
|
<Link href={generateUrl({ page: Modules.${names.pascalCase}, id: ${names.camelCase}.id })}>{${names.camelCase}.name}</Link>
|
|
105
|
-
</TooltipTrigger>${extendsContent
|
|
106
|
-
|
|
107
|
+
</TooltipTrigger>${extendsContent
|
|
108
|
+
? `
|
|
109
|
+
<TooltipContent>{${names.camelCase}.tldr}</TooltipContent>`
|
|
110
|
+
: `
|
|
107
111
|
<TooltipContent>{${names.camelCase}.name}</TooltipContent>`}
|
|
108
112
|
</Tooltip>
|
|
109
113
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-hook.template.js","sourceRoot":"","sources":["../../../../scripts/generate-web-module/templates/table-hook.template.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAWH,
|
|
1
|
+
{"version":3,"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AI7C,CAAC,CAAC;QACN,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -98,6 +98,8 @@ export interface FrontendTemplateData {
|
|
|
98
98
|
moduleId: string;
|
|
99
99
|
endpoint: string;
|
|
100
100
|
targetDir: string;
|
|
101
|
+
/** Stripped version of targetDir for use in imports (e.g., "culling" instead of "features/culling") */
|
|
102
|
+
importTargetDir: string;
|
|
101
103
|
extendsContent: boolean;
|
|
102
104
|
fields: FrontendField[];
|
|
103
105
|
relationships: FrontendRelationship[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-data.interface.d.ts","sourceRoot":"","sources":["../../../../scripts/generate-web-module/types/template-data.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,iBAAiB,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"template-data.interface.d.ts","sourceRoot":"","sources":["../../../../scripts/generate-web-module/types/template-data.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;G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IAG1B,0BAA0B,EAAE,yBAAyB,EAAE,CAAC;CACzD;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,eAAe,CAAC;CACvF"}
|
package/package.json
CHANGED
|
@@ -128,7 +128,11 @@ export async function generateWebModule(options: GenerateWebModuleOptions): Prom
|
|
|
128
128
|
*/
|
|
129
129
|
function buildTemplateData(schema: JsonModuleDefinition): FrontendTemplateData {
|
|
130
130
|
const names = transformNames(schema.moduleName, schema.endpointName);
|
|
131
|
+
// Keep original targetDir for file path generation (buildFilePaths handles stripping)
|
|
131
132
|
const targetDir = schema.targetDir;
|
|
133
|
+
// Strip the first segment (features or foundations) for import paths
|
|
134
|
+
// since @/features/ alias already includes it (e.g., "features/culling" → "culling")
|
|
135
|
+
const importTargetDir = schema.targetDir.split("/").slice(1).join("/") || schema.targetDir;
|
|
132
136
|
const extendsContent = detectExtendsContent(schema.fields, schema.extendsContent);
|
|
133
137
|
|
|
134
138
|
// Map fields
|
|
@@ -156,6 +160,7 @@ function buildTemplateData(schema: JsonModuleDefinition): FrontendTemplateData {
|
|
|
156
160
|
moduleId: schema.moduleId,
|
|
157
161
|
endpoint: schema.endpointName,
|
|
158
162
|
targetDir,
|
|
163
|
+
importTargetDir,
|
|
159
164
|
extendsContent,
|
|
160
165
|
fields: allFields, // Keep all fields for interface generation
|
|
161
166
|
relationships,
|
|
@@ -32,10 +32,10 @@ function generateContentContainerTemplate(data: FrontendTemplateData): string {
|
|
|
32
32
|
|
|
33
33
|
return `"use client";
|
|
34
34
|
|
|
35
|
-
import ${names.pascalCase}Content from "@/features/${data.
|
|
36
|
-
import ${names.pascalCase}Details from "@/features/${data.
|
|
37
|
-
import { use${names.pascalCase}Context } from "@/features/${data.
|
|
38
|
-
import { ${names.pascalCase}Interface } from "@/features/${data.
|
|
35
|
+
import ${names.pascalCase}Content from "@/features/${data.importTargetDir}/${names.kebabCase}/components/details/${names.pascalCase}Content";
|
|
36
|
+
import ${names.pascalCase}Details from "@/features/${data.importTargetDir}/${names.kebabCase}/components/details/${names.pascalCase}Details";
|
|
37
|
+
import { use${names.pascalCase}Context } from "@/features/${data.importTargetDir}/${names.kebabCase}/contexts/${names.pascalCase}Context";
|
|
38
|
+
import { ${names.pascalCase}Interface } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Interface";
|
|
39
39
|
import {
|
|
40
40
|
AllowedUsersDetails,
|
|
41
41
|
PageContentContainer,
|
|
@@ -97,9 +97,9 @@ function generateSimpleContainerTemplate(data: FrontendTemplateData): string {
|
|
|
97
97
|
|
|
98
98
|
return `"use client";
|
|
99
99
|
|
|
100
|
-
import ${names.pascalCase}Details from "@/features/${data.
|
|
101
|
-
import { use${names.pascalCase}Context } from "@/features/${data.
|
|
102
|
-
import { ${names.pascalCase}Interface } from "@/features/${data.
|
|
100
|
+
import ${names.pascalCase}Details from "@/features/${data.importTargetDir}/${names.kebabCase}/components/details/${names.pascalCase}Details";
|
|
101
|
+
import { use${names.pascalCase}Context } from "@/features/${data.importTargetDir}/${names.kebabCase}/contexts/${names.pascalCase}Context";
|
|
102
|
+
import { ${names.pascalCase}Interface } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Interface";
|
|
103
103
|
import { PageContentContainer } from "@carlonicora/nextjs-jsonapi/components";
|
|
104
104
|
|
|
105
105
|
type ${names.pascalCase}ContainerProps = {
|
|
@@ -23,7 +23,7 @@ export function generateContentTemplate(data: FrontendTemplateData): string | nu
|
|
|
23
23
|
|
|
24
24
|
return `"use client";
|
|
25
25
|
|
|
26
|
-
import { use${names.pascalCase}Context } from "@/features/${data.
|
|
26
|
+
import { use${names.pascalCase}Context } from "@/features/${data.importTargetDir}/${names.kebabCase}/contexts/${names.pascalCase}Context";
|
|
27
27
|
import { BlockNoteEditorContainer } from "@carlonicora/nextjs-jsonapi/components";
|
|
28
28
|
import { Card } from "@carlonicora/nextjs-jsonapi/components";
|
|
29
29
|
|
|
@@ -17,8 +17,8 @@ export function generateDeleterTemplate(data: FrontendTemplateData): string {
|
|
|
17
17
|
|
|
18
18
|
return `"use client";
|
|
19
19
|
|
|
20
|
-
import { ${names.pascalCase}Interface } from "@/features/${data.
|
|
21
|
-
import { ${names.pascalCase}Service } from "@/features/${data.
|
|
20
|
+
import { ${names.pascalCase}Interface } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Interface";
|
|
21
|
+
import { ${names.pascalCase}Service } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Service";
|
|
22
22
|
import { CommonDeleter } from "@carlonicora/nextjs-jsonapi/components";
|
|
23
23
|
import { usePageUrlGenerator } from "@carlonicora/nextjs-jsonapi/client";
|
|
24
24
|
|
|
@@ -20,7 +20,7 @@ export function generateDetailsTemplate(data: FrontendTemplateData): string {
|
|
|
20
20
|
|
|
21
21
|
return `"use client";
|
|
22
22
|
|
|
23
|
-
import { use${names.pascalCase}Context } from "@/features/${data.
|
|
23
|
+
import { use${names.pascalCase}Context } from "@/features/${data.importTargetDir}/${names.kebabCase}/contexts/${names.pascalCase}Context";
|
|
24
24
|
import { AttributeElement, ContentTitle, ReactMarkdownContainer } from "@carlonicora/nextjs-jsonapi/components";
|
|
25
25
|
import { useSharedContext } from "@carlonicora/nextjs-jsonapi/contexts";
|
|
26
26
|
import { Modules } from "@carlonicora/nextjs-jsonapi/core";
|
|
@@ -8,7 +8,13 @@ import { FrontendTemplateData, FrontendField, FrontendRelationship } from "../..
|
|
|
8
8
|
import { toCamelCase, pluralize, toPascalCase } from "../../transformers/name-transformer";
|
|
9
9
|
import { AUTHOR_VARIANT } from "../../types/field-mapping.types";
|
|
10
10
|
import { getFormFieldJsx } from "../../transformers/field-mapper";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
getRelationshipFormJsx,
|
|
13
|
+
getDefaultValueExpression,
|
|
14
|
+
getPayloadMapping,
|
|
15
|
+
isFoundationImport,
|
|
16
|
+
FOUNDATION_COMPONENTS_PACKAGE,
|
|
17
|
+
} from "../../transformers/relationship-resolver";
|
|
12
18
|
|
|
13
19
|
/**
|
|
14
20
|
* Generate the editor component file content
|
|
@@ -81,11 +87,15 @@ ${defaultValues}
|
|
|
81
87
|
}
|
|
82
88
|
}, [open]);
|
|
83
89
|
|
|
84
|
-
${
|
|
90
|
+
${
|
|
91
|
+
hasAuthor
|
|
92
|
+
? ` useEffect(() => {
|
|
85
93
|
if (currentUser && !form.getValues("author")?.id) {
|
|
86
94
|
form.setValue("author", { id: currentUser.id, name: currentUser.name, avatar: currentUser.avatar });
|
|
87
95
|
}
|
|
88
|
-
}, [currentUser]);`
|
|
96
|
+
}, [currentUser]);`
|
|
97
|
+
: ""
|
|
98
|
+
}
|
|
89
99
|
|
|
90
100
|
${onSubmit}
|
|
91
101
|
|
|
@@ -142,8 +152,12 @@ function generateImports(data: FrontendTemplateData): string {
|
|
|
142
152
|
const imports: string[] = [];
|
|
143
153
|
|
|
144
154
|
// Module imports
|
|
145
|
-
imports.push(
|
|
146
|
-
|
|
155
|
+
imports.push(
|
|
156
|
+
`import { ${names.pascalCase}Input, ${names.pascalCase}Interface } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Interface";`,
|
|
157
|
+
);
|
|
158
|
+
imports.push(
|
|
159
|
+
`import { ${names.pascalCase}Service } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Service";`,
|
|
160
|
+
);
|
|
147
161
|
|
|
148
162
|
// Relationship selector imports
|
|
149
163
|
const hasAuthor = relationships.some((r) => r.variant === AUTHOR_VARIANT);
|
|
@@ -169,12 +183,7 @@ function generateImports(data: FrontendTemplateData): string {
|
|
|
169
183
|
imports.push(`import { revalidatePaths } from "@/utils/revalidation";`);
|
|
170
184
|
|
|
171
185
|
// Library component imports
|
|
172
|
-
const componentImports: string[] = [
|
|
173
|
-
"CommonEditorButtons",
|
|
174
|
-
"CommonEditorHeader",
|
|
175
|
-
"CommonEditorTrigger",
|
|
176
|
-
"errorToast",
|
|
177
|
-
];
|
|
186
|
+
const componentImports: string[] = ["CommonEditorButtons", "CommonEditorHeader", "CommonEditorTrigger", "errorToast"];
|
|
178
187
|
|
|
179
188
|
// Check for field types that need specific components
|
|
180
189
|
const hasContentField = fields.some((f) => f.isContentField || f.name === "content");
|
|
@@ -188,11 +197,9 @@ function generateImports(data: FrontendTemplateData): string {
|
|
|
188
197
|
}
|
|
189
198
|
|
|
190
199
|
// Check if any relationship has boolean or date fields that need specific form components
|
|
191
|
-
const hasRelBooleanFields = relationships.some((rel) =>
|
|
192
|
-
rel.fields?.some((f) => f.type === "boolean")
|
|
193
|
-
);
|
|
200
|
+
const hasRelBooleanFields = relationships.some((rel) => rel.fields?.some((f) => f.type === "boolean"));
|
|
194
201
|
const hasRelDateFields = relationships.some((rel) =>
|
|
195
|
-
rel.fields?.some((f) => f.type === "date" || f.type === "datetime")
|
|
202
|
+
rel.fields?.some((f) => f.type === "date" || f.type === "datetime"),
|
|
196
203
|
);
|
|
197
204
|
|
|
198
205
|
if (hasRelBooleanFields) {
|
|
@@ -456,9 +463,7 @@ function generateOnSubmit(data: FrontendTemplateData): string {
|
|
|
456
463
|
// Relationships
|
|
457
464
|
relationships.forEach((rel) => {
|
|
458
465
|
const fieldId = toCamelCase(rel.variant || rel.name);
|
|
459
|
-
const payloadKey = rel.single
|
|
460
|
-
? `${fieldId}Id`
|
|
461
|
-
: `${toCamelCase(rel.name)}Ids`;
|
|
466
|
+
const payloadKey = rel.single ? `${fieldId}Id` : `${toCamelCase(rel.name)}Ids`;
|
|
462
467
|
|
|
463
468
|
if (rel.single) {
|
|
464
469
|
payloadFields.push(` ${payloadKey}: values.${fieldId}?.id,`);
|
|
@@ -17,7 +17,7 @@ export function generateListContainerTemplate(data: FrontendTemplateData): strin
|
|
|
17
17
|
|
|
18
18
|
return `"use client";
|
|
19
19
|
|
|
20
|
-
import ${names.pascalCase}List from "@/features/${data.
|
|
20
|
+
import ${names.pascalCase}List from "@/features/${data.importTargetDir}/${names.kebabCase}/components/lists/${names.pascalCase}List";
|
|
21
21
|
|
|
22
22
|
function ${names.pascalCase}ListContainerInternal() {
|
|
23
23
|
return <${names.pascalCase}List />;
|
|
@@ -21,11 +21,11 @@ export function generateListTemplate(data: FrontendTemplateData): string {
|
|
|
21
21
|
|
|
22
22
|
return `"use client";
|
|
23
23
|
|
|
24
|
-
import ${names.pascalCase}Editor from "@/features/${data.
|
|
25
|
-
import { ${names.pascalCase}Fields } from "@/features/${data.
|
|
26
|
-
import { ${names.pascalCase}Interface } from "@/features/${data.
|
|
27
|
-
import { ${names.pascalCase}Service } from "@/features/${data.
|
|
28
|
-
import "@/features/${data.
|
|
24
|
+
import ${names.pascalCase}Editor from "@/features/${data.importTargetDir}/${names.kebabCase}/components/forms/${names.pascalCase}Editor";
|
|
25
|
+
import { ${names.pascalCase}Fields } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Fields";
|
|
26
|
+
import { ${names.pascalCase}Interface } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Interface";
|
|
27
|
+
import { ${names.pascalCase}Service } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Service";
|
|
28
|
+
import "@/features/${data.importTargetDir}/${names.kebabCase}/hooks/use${names.pascalCase}TableStructure";
|
|
29
29
|
import { ContentListTable } from "@carlonicora/nextjs-jsonapi/components";
|
|
30
30
|
import { Modules } from "@carlonicora/nextjs-jsonapi/core";
|
|
31
31
|
import { DataListRetriever, useDataListRetriever } from "@carlonicora/nextjs-jsonapi/client";
|
|
@@ -18,8 +18,8 @@ export function generateMultiSelectorTemplate(data: FrontendTemplateData): strin
|
|
|
18
18
|
return `"use client";
|
|
19
19
|
|
|
20
20
|
import { FormFieldWrapper, MultiSelect } from "@carlonicora/nextjs-jsonapi/components";
|
|
21
|
-
import { ${names.pascalCase}Interface } from "@/features/${data.
|
|
22
|
-
import { ${names.pascalCase}Service } from "@/features/${data.
|
|
21
|
+
import { ${names.pascalCase}Interface } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Interface";
|
|
22
|
+
import { ${names.pascalCase}Service } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Service";
|
|
23
23
|
import { DataListRetriever, useDataListRetriever } from "@carlonicora/nextjs-jsonapi/client";
|
|
24
24
|
import { useDebounce } from "@carlonicora/nextjs-jsonapi/client";
|
|
25
25
|
import { Modules } from "@carlonicora/nextjs-jsonapi/core";
|
|
@@ -30,8 +30,8 @@ import {
|
|
|
30
30
|
PopoverContent,
|
|
31
31
|
PopoverTrigger,
|
|
32
32
|
} from "@carlonicora/nextjs-jsonapi/components";
|
|
33
|
-
import { ${names.pascalCase}Interface } from "@/features/${data.
|
|
34
|
-
import { ${names.pascalCase}Service } from "@/features/${data.
|
|
33
|
+
import { ${names.pascalCase}Interface } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Interface";
|
|
34
|
+
import { ${names.pascalCase}Service } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Service";
|
|
35
35
|
import { DataListRetriever, useDataListRetriever } from "@carlonicora/nextjs-jsonapi/client";
|
|
36
36
|
import { useDebounce } from "@carlonicora/nextjs-jsonapi/client";
|
|
37
37
|
import { Modules } from "@carlonicora/nextjs-jsonapi/core";
|
|
@@ -17,10 +17,10 @@ export function generateContextTemplate(data: FrontendTemplateData): string {
|
|
|
17
17
|
|
|
18
18
|
return `"use client";
|
|
19
19
|
|
|
20
|
-
import ${names.pascalCase}Deleter from "@/features/${data.
|
|
21
|
-
import ${names.pascalCase}Editor from "@/features/${data.
|
|
22
|
-
import { ${names.pascalCase}Interface } from "@/features/${data.
|
|
23
|
-
import { ${names.pascalCase}Service } from "@/features/${data.
|
|
20
|
+
import ${names.pascalCase}Deleter from "@/features/${data.importTargetDir}/${names.kebabCase}/components/forms/${names.pascalCase}Deleter";
|
|
21
|
+
import ${names.pascalCase}Editor from "@/features/${data.importTargetDir}/${names.kebabCase}/components/forms/${names.pascalCase}Editor";
|
|
22
|
+
import { ${names.pascalCase}Interface } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Interface";
|
|
23
|
+
import { ${names.pascalCase}Service } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Service";
|
|
24
24
|
import { SharedProvider } from "@carlonicora/nextjs-jsonapi/contexts";
|
|
25
25
|
import { usePageUrlGenerator } from "@carlonicora/nextjs-jsonapi/client";
|
|
26
26
|
import { BreadcrumbItemData } from "@carlonicora/nextjs-jsonapi/core";
|
|
@@ -37,20 +37,14 @@ function generateImports(data: FrontendTemplateData): string {
|
|
|
37
37
|
|
|
38
38
|
// Relationship interface imports
|
|
39
39
|
relationships.forEach((rel) => {
|
|
40
|
-
imports.push(
|
|
41
|
-
`import { ${rel.interfaceName} } from "${rel.interfaceImportPath}";`
|
|
42
|
-
);
|
|
40
|
+
imports.push(`import { ${rel.interfaceName} } from "${rel.interfaceImportPath}";`);
|
|
43
41
|
});
|
|
44
42
|
|
|
45
43
|
// Base interface import
|
|
46
44
|
if (extendsContent) {
|
|
47
|
-
imports.push(
|
|
48
|
-
`import { ContentInput, ContentInterface } from "@/features/features/content/data/ContentInterface";`
|
|
49
|
-
);
|
|
45
|
+
imports.push(`import { ContentInput, ContentInterface } from "@/features/content/data/ContentInterface";`);
|
|
50
46
|
} else {
|
|
51
|
-
imports.push(
|
|
52
|
-
`import { ApiDataInterface } from "@carlonicora/nextjs-jsonapi/core";`
|
|
53
|
-
);
|
|
47
|
+
imports.push(`import { ApiDataInterface } from "@carlonicora/nextjs-jsonapi/core";`);
|
|
54
48
|
}
|
|
55
49
|
|
|
56
50
|
return imports.join("\n");
|
|
@@ -132,7 +126,7 @@ function generateInterface(data: FrontendTemplateData): string {
|
|
|
132
126
|
// Build return type - use intersection if relationship has fields
|
|
133
127
|
let baseType = rel.interfaceName;
|
|
134
128
|
if (rel.fields && rel.fields.length > 0) {
|
|
135
|
-
const metaFields = rel.fields.map(f => `${f.name}?: ${f.tsType}`).join("; ");
|
|
129
|
+
const metaFields = rel.fields.map((f) => `${f.name}?: ${f.tsType}`).join("; ");
|
|
136
130
|
baseType = `${rel.interfaceName} & { ${metaFields} }`;
|
|
137
131
|
}
|
|
138
132
|
|
|
@@ -142,7 +136,7 @@ function generateInterface(data: FrontendTemplateData): string {
|
|
|
142
136
|
const propertyName = pluralize(toCamelCase(rel.name));
|
|
143
137
|
// Use intersection type if relationship has fields (edge properties)
|
|
144
138
|
if (rel.fields && rel.fields.length > 0) {
|
|
145
|
-
const metaFields = rel.fields.map(f => `${f.name}?: ${f.tsType}`).join("; ");
|
|
139
|
+
const metaFields = rel.fields.map((f) => `${f.name}?: ${f.tsType}`).join("; ");
|
|
146
140
|
getterLines.push(` get ${propertyName}(): (${rel.interfaceName} & { ${metaFields} })[];`);
|
|
147
141
|
} else {
|
|
148
142
|
getterLines.push(` get ${propertyName}(): ${rel.interfaceName}[];`);
|
|
@@ -48,7 +48,7 @@ function generateImports(data: FrontendTemplateData): string {
|
|
|
48
48
|
|
|
49
49
|
// Own interface import
|
|
50
50
|
imports.push(
|
|
51
|
-
`import { ${names.pascalCase}Input, ${names.pascalCase}Interface } from "@/features/${data.
|
|
51
|
+
`import { ${names.pascalCase}Input, ${names.pascalCase}Interface } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Interface";`,
|
|
52
52
|
);
|
|
53
53
|
|
|
54
54
|
// Relationship interface imports
|
|
@@ -58,7 +58,7 @@ function generateImports(data: FrontendTemplateData): string {
|
|
|
58
58
|
|
|
59
59
|
// Base class and core imports
|
|
60
60
|
if (extendsContent) {
|
|
61
|
-
imports.push(`import { Content } from "@/features/
|
|
61
|
+
imports.push(`import { Content } from "@/features/content/data/Content";`);
|
|
62
62
|
imports.push(`import { JsonApiHydratedDataInterface, Modules } from "@carlonicora/nextjs-jsonapi/core";`);
|
|
63
63
|
} else {
|
|
64
64
|
imports.push(
|
|
@@ -49,7 +49,7 @@ function generateImports(data: FrontendTemplateData): string {
|
|
|
49
49
|
|
|
50
50
|
return `import { AbstractService, HttpMethod, NextRef, PreviousRef } from "@carlonicora/nextjs-jsonapi/core";
|
|
51
51
|
import { EndpointCreator } from "@carlonicora/nextjs-jsonapi/core";
|
|
52
|
-
import { ${names.pascalCase}Input, ${names.pascalCase}Interface } from "@/features/${data.
|
|
52
|
+
import { ${names.pascalCase}Input, ${names.pascalCase}Interface } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Interface";
|
|
53
53
|
import { Modules } from "@carlonicora/nextjs-jsonapi/core";`;
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -20,7 +20,7 @@ export function generateModuleTemplate(data: FrontendTemplateData): string {
|
|
|
20
20
|
const listFieldNames = getListFieldNames(data);
|
|
21
21
|
const listInclusionFields = listFieldNames.map((f) => `\`${f}\``).join(", ");
|
|
22
22
|
|
|
23
|
-
return `import { ${names.pascalCase} } from "@/features/${data.
|
|
23
|
+
return `import { ${names.pascalCase} } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}";
|
|
24
24
|
import { createJsonApiInclusion } from "@carlonicora/nextjs-jsonapi/core";
|
|
25
25
|
import { ModuleFactory } from "@carlonicora/nextjs-jsonapi/core";
|
|
26
26
|
import { ${DEFAULT_MODULE_ICON} } from "lucide-react";
|
|
@@ -15,10 +15,10 @@ import { FrontendTemplateData } from "../../types/template-data.interface";
|
|
|
15
15
|
export function generateDetailPageTemplate(data: FrontendTemplateData): string {
|
|
16
16
|
const { names } = data;
|
|
17
17
|
|
|
18
|
-
return `import ${names.pascalCase}Container from "@/features/${data.
|
|
19
|
-
import { ${names.pascalCase}Provider } from "@/features/${data.
|
|
20
|
-
import { ${names.pascalCase}Interface } from "@/features/${data.
|
|
21
|
-
import { ${names.pascalCase}Service } from "@/features/${data.
|
|
18
|
+
return `import ${names.pascalCase}Container from "@/features/${data.importTargetDir}/${names.kebabCase}/components/containers/${names.pascalCase}Container";
|
|
19
|
+
import { ${names.pascalCase}Provider } from "@/features/${data.importTargetDir}/${names.kebabCase}/contexts/${names.pascalCase}Context";
|
|
20
|
+
import { ${names.pascalCase}Interface } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Interface";
|
|
21
|
+
import { ${names.pascalCase}Service } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Service";
|
|
22
22
|
import { generateSpecificMetadata } from "@/utils/metadata";
|
|
23
23
|
import { PageContainer } from "@carlonicora/nextjs-jsonapi/components";
|
|
24
24
|
import { Modules } from "@carlonicora/nextjs-jsonapi/core";
|
|
@@ -15,8 +15,8 @@ import { FrontendTemplateData } from "../../types/template-data.interface";
|
|
|
15
15
|
export function generateListPageTemplate(data: FrontendTemplateData): string {
|
|
16
16
|
const { names } = data;
|
|
17
17
|
|
|
18
|
-
return `import ${names.pascalCase}ListContainer from "@/features/${data.
|
|
19
|
-
import { ${names.pascalCase}Provider } from "@/features/${data.
|
|
18
|
+
return `import ${names.pascalCase}ListContainer from "@/features/${data.importTargetDir}/${names.kebabCase}/components/containers/${names.pascalCase}ListContainer";
|
|
19
|
+
import { ${names.pascalCase}Provider } from "@/features/${data.importTargetDir}/${names.kebabCase}/contexts/${names.pascalCase}Context";
|
|
20
20
|
import { PageContainer } from "@carlonicora/nextjs-jsonapi/components";
|
|
21
21
|
import { Modules } from "@carlonicora/nextjs-jsonapi/core";
|
|
22
22
|
import { Action } from "@carlonicora/nextjs-jsonapi/core";
|
|
@@ -22,11 +22,15 @@ export function generateTableHookTemplate(data: FrontendTemplateData): string {
|
|
|
22
22
|
|
|
23
23
|
return `"use client";
|
|
24
24
|
|
|
25
|
-
import { ${names.pascalCase}Fields } from "@/features/${data.
|
|
26
|
-
import { ${names.pascalCase}Interface } from "@/features/${data.
|
|
25
|
+
import { ${names.pascalCase}Fields } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Fields";
|
|
26
|
+
import { ${names.pascalCase}Interface } from "@/features/${data.importTargetDir}/${names.kebabCase}/data/${names.pascalCase}Interface";
|
|
27
27
|
import { cellDate, cellId${hasAuthors ? ", ContributorsList" : ""} } from "@carlonicora/nextjs-jsonapi/components";
|
|
28
|
-
import { Modules } from "@carlonicora/nextjs-jsonapi/core";${
|
|
29
|
-
|
|
28
|
+
import { Modules } from "@carlonicora/nextjs-jsonapi/core";${
|
|
29
|
+
extendsContent
|
|
30
|
+
? `
|
|
31
|
+
import { ContentInterface } from "@carlonicora/nextjs-jsonapi/core";`
|
|
32
|
+
: ""
|
|
33
|
+
}
|
|
30
34
|
import {
|
|
31
35
|
registerTableGenerator,
|
|
32
36
|
TableContent,
|
|
@@ -107,9 +111,13 @@ function generateFieldColumnEntries(data: FrontendTemplateData): string {
|
|
|
107
111
|
<Tooltip>
|
|
108
112
|
<TooltipTrigger>
|
|
109
113
|
<Link href={generateUrl({ page: Modules.${names.pascalCase}, id: ${names.camelCase}.id })}>{${names.camelCase}.name}</Link>
|
|
110
|
-
</TooltipTrigger>${
|
|
111
|
-
|
|
112
|
-
|
|
114
|
+
</TooltipTrigger>${
|
|
115
|
+
extendsContent
|
|
116
|
+
? `
|
|
117
|
+
<TooltipContent>{${names.camelCase}.tldr}</TooltipContent>`
|
|
118
|
+
: `
|
|
119
|
+
<TooltipContent>{${names.camelCase}.name}</TooltipContent>`
|
|
120
|
+
}
|
|
113
121
|
</Tooltip>
|
|
114
122
|
);
|
|
115
123
|
},
|
|
@@ -135,7 +143,7 @@ function generateFieldColumnEntries(data: FrontendTemplateData): string {
|
|
|
135
143
|
|
|
136
144
|
// Other displayable fields (excluding id, name, tldr, abstract, content, dates)
|
|
137
145
|
const displayableFields = fields.filter(
|
|
138
|
-
(f) => !["id", "name", "tldr", "abstract", "content", "createdAt", "updatedAt"].includes(f.name)
|
|
146
|
+
(f) => !["id", "name", "tldr", "abstract", "content", "createdAt", "updatedAt"].includes(f.name),
|
|
139
147
|
);
|
|
140
148
|
|
|
141
149
|
displayableFields.forEach((field) => {
|
|
@@ -35,7 +35,13 @@ export interface FrontendField {
|
|
|
35
35
|
/**
|
|
36
36
|
* Form component types
|
|
37
37
|
*/
|
|
38
|
-
export type FormComponentType =
|
|
38
|
+
export type FormComponentType =
|
|
39
|
+
| "FormInput"
|
|
40
|
+
| "FormTextarea"
|
|
41
|
+
| "BlockNoteEditor"
|
|
42
|
+
| "Checkbox"
|
|
43
|
+
| "DatePicker"
|
|
44
|
+
| "FormInputNumber";
|
|
39
45
|
|
|
40
46
|
/**
|
|
41
47
|
* Frontend relationship representation
|
|
@@ -121,6 +127,8 @@ export interface FrontendTemplateData {
|
|
|
121
127
|
moduleId: string;
|
|
122
128
|
endpoint: string;
|
|
123
129
|
targetDir: string;
|
|
130
|
+
/** Stripped version of targetDir for use in imports (e.g., "culling" instead of "features/culling") */
|
|
131
|
+
importTargetDir: string;
|
|
124
132
|
|
|
125
133
|
// Parent class detection
|
|
126
134
|
extendsContent: boolean;
|