@ostack.tech/ui-kform-scaffolder 0.12.2 → 0.12.3

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.
@@ -113,7 +113,11 @@ function scaffoldApi(schematic, data) {
113
113
  addEjsTemplateFile(data, "api/reportError.ts", reportErrorTsEjs, ejsData);
114
114
  addEjsTemplateFile(data, "api/submit.ts", submitTsEjs, ejsData);
115
115
  }
116
+ const DEFAULT_SCAFFOLD_ISSUE_MESSAGES = true;
116
117
  function scaffoldIssueMessages(schematic, data) {
118
+ if (!shouldScaffoldIssueMessages(data)) {
119
+ return;
120
+ }
117
121
  const fileName = joinPaths(
118
122
  data.currentDir,
119
123
  `${schematic.name}IssueMessages.tsx`
@@ -128,6 +132,9 @@ function scaffoldIssueMessages(schematic, data) {
128
132
  currentFile: file
129
133
  });
130
134
  }
135
+ function shouldScaffoldIssueMessages(data) {
136
+ return data.scaffoldIssueMessages ?? DEFAULT_SCAFFOLD_ISSUE_MESSAGES;
137
+ }
131
138
  function scaffoldIssueMessagesConstant(schematic, data) {
132
139
  data.currentFile.imports.push({
133
140
  moduleName: "@ostack.tech/ui-kform",
@@ -751,7 +758,7 @@ function layoutAnnex(schematic, data) {
751
758
  }
752
759
  return { schematic, data, formPages };
753
760
  }
754
- const DEFAULT_ACTIVE_PATH_SEARCH_PARAM = "activePath";
761
+ const DEFAULT_ACTIVE_PATH_SEARCH_PARAM = "page";
755
762
  function scaffoldAppComponent(schematic, data) {
756
763
  const fileName = joinPaths(data.currentDir, `${schematic.name}App.tsx`);
757
764
  let file = data.files.get(fileName);
@@ -781,12 +788,17 @@ function scaffoldAppComponentFile(schematic, data) {
781
788
  {
782
789
  moduleName: `./${schematic.name}Context.ts`,
783
790
  name: `use${schematic.name}Context`
784
- },
785
- {
786
- moduleName: `./${schematic.name}IssueMessages.tsx`,
787
- name: `${constantCase(schematic.name)}_ISSUE_MESSAGES`
788
791
  }
789
792
  );
793
+ let issueMessagesProp = "";
794
+ if (shouldScaffoldIssueMessages(data)) {
795
+ data.currentFile.imports.push({
796
+ moduleName: `./${schematic.name}IssueMessages.tsx`,
797
+ name: `${constantCase(schematic.name)}_ISSUE_MESSAGES`
798
+ });
799
+ issueMessagesProp = `
800
+ issueMessages={${constantCase(schematic.name)}_ISSUE_MESSAGES}`;
801
+ }
790
802
  data.currentFile.declarations.push(code`
791
803
  export function ${schematic.name}App() {
792
804
  const { externalContexts } = use${schematic.name}Context();
@@ -812,8 +824,7 @@ function scaffoldAppComponentFile(schematic, data) {
812
824
  }
813
825
  formTitle="${capitalCase(schematic.name)}"
814
826
  activePath={activePath}
815
- onActivePathChange={setActivePath}
816
- issueMessages={${constantCase(schematic.name)}_ISSUE_MESSAGES}
827
+ onActivePathChange={setActivePath}${issueMessagesProp}
817
828
  defaultLocale={${localeVar}}
818
829
  reportError={reportError}
819
830
  >
@@ -912,7 +923,7 @@ function scaffoldFormPage(data, annex, formPage) {
912
923
  }
913
924
  );
914
925
  let issueMessagesProp = "";
915
- if (formPage.data.currentPath !== "/") {
926
+ if (shouldScaffoldIssueMessages(data) && formPage.data.currentPath !== "/") {
916
927
  data.currentFile.imports.push({
917
928
  moduleName: `./${joinPaths(
918
929
  formPage.data.currentDir.slice(
@@ -1477,7 +1488,7 @@ function scaffoldViteProject(schematic, data) {
1477
1488
  formId: kebabCase(schematic.name),
1478
1489
  formClass: schematic.name,
1479
1490
  formTitle: capitalCase(schematic.name),
1480
- ostackUiVersion: "0.12.2",
1491
+ ostackUiVersion: "0.12.3",
1481
1492
  kFormVersion: "0.32.4",
1482
1493
  dependencyVersions: JSON.parse('{"@eslint/js":"^9.39.3","@fortawesome/fontawesome-svg-core":"^7.2.0","@fortawesome/free-brands-svg-icons":"^7.2.0","@fortawesome/free-regular-svg-icons":"^7.2.0","@fortawesome/free-solid-svg-icons":"^7.2.0","@ostack.tech/kform":"^0.32.4","@ostack.tech/kform-react":"^0.32.4","@ostack.tech/kform-scaffolder":"^0.32.4","@storybook/addon-docs":"^10.2.14","@storybook/addon-links":"^10.2.14","@storybook/react-vite":"^10.2.14","@types/node":"^22.19.13","@types/react":"^19.2.14","@types/react-dom":"^19.2.3","@vitejs/plugin-react":"^5.1.4","change-case":"^5.4.4","cpy-cli":"^7.0.0","date-fns":"^4.1.0","eslint":"^9.39.2","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.5","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-react-refresh":"^0.5.2","eslint-plugin-simple-import-sort":"^12.1.1","eslint-plugin-storybook":"^10.2.14","globals":"^17.4.0","happy-dom":"^20.7.0","lint-staged":"^16.3.1","prettier":"^3.8.1","prettier-plugin-jsdoc":"^1.8.0","react":"^19.2.4","react-dom":"^19.2.4","rimraf":"^6.1.3","sass-embedded":"^1.97.3","simple-git-hooks":"^2.13.1","storybook":"^10.2.14","terser":"^5.46.0","tslib":"^2.8.1","typescript":"~5.9.3","typescript-eslint":"^8.56.1","vite":"^7.3.1","vite-plugin-dts":"^4.5.4","vitest":"^4.0.18","write-excel-file":"^3.0.5","zustand":"^5.0.11"}'),
1483
1494
  externalContextsData: data.serializationFormat === "json" ? "{}" : `<${schematic.name}ExternalContexts />`,
@@ -1539,7 +1550,7 @@ function SchematicBuilder({
1539
1550
  /* @__PURE__ */ jsx(SerializationFormatConfig, {}),
1540
1551
  /* @__PURE__ */ jsx(UseTableValuesSerializerConfig, {})
1541
1552
  ] }),
1542
- version = "0.12.2",
1553
+ version = "0.12.3",
1543
1554
  ...otherProps
1544
1555
  }) {
1545
1556
  return /* @__PURE__ */ jsx(
@@ -1611,6 +1622,7 @@ export {
1611
1622
  scaffoldStyles,
1612
1623
  scaffoldViteProject,
1613
1624
  shortSchematicKind,
1625
+ shouldScaffoldIssueMessages,
1614
1626
  stringSchematicKind,
1615
1627
  tableAnnexesSchematicKind,
1616
1628
  tableSchematicKind