@ostack.tech/ui-kform-scaffolder 1.2.0-beta.0 → 1.2.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/ostack-ui-kform-scaffolder.js +272 -101
- package/dist/ostack-ui-kform-scaffolder.js.map +1 -1
- package/dist/webapp/assets/index-B5F6GfVR.js +1499 -0
- package/dist/webapp/index.html +1 -1
- package/package.json +8 -8
- package/types/configs/UseReactCompilerConfig.d.ts +5 -0
- package/types/configs/UseTableValuesSerializerConfig.d.ts +5 -3
- package/types/index.d.ts +1 -0
- package/types/scaffolding/ScaffoldingData.d.ts +7 -8
- package/dist/webapp/assets/index-CrUWy2VO.js +0 -1509
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
1
2
|
import { ListableBuilderWithoutKindSelect, SchematicBuilder as SchematicBuilder$1, UseTableValuesSerializerConfig as UseTableValuesSerializerConfig$1, addEjsTemplateFile, addTemplateFile, annotate, anySchematicKind as anySchematicKind$1, bigDecimalSchematicKind as bigDecimalSchematicKind$1, bigIntegerSchematicKind as bigIntegerSchematicKind$1, booleanSchematicKind as booleanSchematicKind$1, byteSchematicKind as byteSchematicKind$1, classSchematicKind as classSchematicKind$1, code, configScaffolder, createSchematic, doubleSchematicKind as doubleSchematicKind$1, enumSchematicKind as enumSchematicKind$1, fileSchematicKind as fileSchematicKind$1, floatSchematicKind as floatSchematicKind$1, intSchematicKind as intSchematicKind$1, joinPaths, listSchematicKind, localDateSchematicKind as localDateSchematicKind$1, longSchematicKind as longSchematicKind$1, scaffoldModels, scaffoldSchemas, scaffoldValidator, shortSchematicKind as shortSchematicKind$1, stringSchematicKind as stringSchematicKind$1, tableSchematicKind as tableSchematicKind$1, tsFile, useConfig } from "@ostack.tech/kform-scaffolder";
|
|
2
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { useRef } from "react";
|
|
@@ -5,57 +6,177 @@ import { camelCase, capitalCase, constantCase, kebabCase, pascalCase, sentenceCa
|
|
|
5
6
|
//#region src/configs/DefaultLocaleConfig.tsx
|
|
6
7
|
var DEFAULT_LOCALE = "en-US";
|
|
7
8
|
var LOCALES = JSON.parse("[\"en-GB\",\"en-US\",\"fr-FR\",\"pt-PT\"]");
|
|
8
|
-
function DefaultLocaleConfig(
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
function DefaultLocaleConfig(t0) {
|
|
10
|
+
const $ = c(8);
|
|
11
|
+
const { defaultValue: t1, disabled } = t0;
|
|
12
|
+
const [config, setConfig] = useConfig("defaultLocale", t1 === void 0 ? DEFAULT_LOCALE : t1);
|
|
13
|
+
let t2;
|
|
14
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
15
|
+
t2 = /* @__PURE__ */ jsx("label", { children: "Default locale" });
|
|
16
|
+
$[0] = t2;
|
|
17
|
+
} else t2 = $[0];
|
|
18
|
+
let t3;
|
|
19
|
+
if ($[1] !== setConfig) {
|
|
20
|
+
t3 = (evt) => {
|
|
21
|
+
setConfig(evt.target.value);
|
|
22
|
+
};
|
|
23
|
+
$[1] = setConfig;
|
|
24
|
+
$[2] = t3;
|
|
25
|
+
} else t3 = $[2];
|
|
26
|
+
let t4;
|
|
27
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
28
|
+
t4 = LOCALES.map(_temp);
|
|
29
|
+
$[3] = t4;
|
|
30
|
+
} else t4 = $[3];
|
|
31
|
+
let t5;
|
|
32
|
+
if ($[4] !== config || $[5] !== disabled || $[6] !== t3) {
|
|
33
|
+
t5 = /* @__PURE__ */ jsxs("div", {
|
|
34
|
+
className: "builder-config-field",
|
|
35
|
+
children: [t2, /* @__PURE__ */ jsx("select", {
|
|
36
|
+
value: config,
|
|
37
|
+
onChange: t3,
|
|
38
|
+
disabled,
|
|
39
|
+
children: t4
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
42
|
+
$[4] = config;
|
|
43
|
+
$[5] = disabled;
|
|
44
|
+
$[6] = t3;
|
|
45
|
+
$[7] = t5;
|
|
46
|
+
} else t5 = $[7];
|
|
47
|
+
return t5;
|
|
48
|
+
}
|
|
49
|
+
function _temp(locale) {
|
|
50
|
+
return /* @__PURE__ */ jsx("option", {
|
|
51
|
+
value: locale,
|
|
52
|
+
children: locale
|
|
53
|
+
}, locale);
|
|
24
54
|
}
|
|
25
55
|
//#endregion
|
|
26
56
|
//#region src/configs/SerializationFormatConfig.tsx
|
|
27
57
|
var DEFAULT_SERIALIZATION_FORMAT = "json";
|
|
28
|
-
function SerializationFormatConfig(
|
|
58
|
+
function SerializationFormatConfig(t0) {
|
|
59
|
+
const $ = c(11);
|
|
60
|
+
const { defaultValue: t1, disabled } = t0;
|
|
61
|
+
const defaultValue = t1 === void 0 ? DEFAULT_SERIALIZATION_FORMAT : t1;
|
|
29
62
|
const [useTableValuesSerializerConfig, setUseTableValuesSerializerConfig] = useConfig("useTableValuesSerializer", false);
|
|
30
63
|
const lastUseTableValuesSerializerConfig = useRef(useTableValuesSerializerConfig);
|
|
31
64
|
const [config, setConfig] = useConfig("serializationFormat", defaultValue);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
65
|
+
let t2;
|
|
66
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
67
|
+
t2 = /* @__PURE__ */ jsx("label", { children: "Serialization format" });
|
|
68
|
+
$[0] = t2;
|
|
69
|
+
} else t2 = $[0];
|
|
70
|
+
let t3;
|
|
71
|
+
if ($[1] !== setConfig || $[2] !== setUseTableValuesSerializerConfig || $[3] !== useTableValuesSerializerConfig) {
|
|
72
|
+
t3 = (evt) => {
|
|
73
|
+
setConfig(evt.target.value);
|
|
74
|
+
if (evt.target.value === "xml") {
|
|
75
|
+
lastUseTableValuesSerializerConfig.current = useTableValuesSerializerConfig;
|
|
76
|
+
setUseTableValuesSerializerConfig(true);
|
|
77
|
+
} else setUseTableValuesSerializerConfig(lastUseTableValuesSerializerConfig.current);
|
|
78
|
+
};
|
|
79
|
+
$[1] = setConfig;
|
|
80
|
+
$[2] = setUseTableValuesSerializerConfig;
|
|
81
|
+
$[3] = useTableValuesSerializerConfig;
|
|
82
|
+
$[4] = t3;
|
|
83
|
+
} else t3 = $[4];
|
|
84
|
+
let t4;
|
|
85
|
+
let t5;
|
|
86
|
+
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
87
|
+
t4 = /* @__PURE__ */ jsx("option", {
|
|
88
|
+
value: "json",
|
|
89
|
+
children: "JSON"
|
|
90
|
+
});
|
|
91
|
+
t5 = /* @__PURE__ */ jsx("option", {
|
|
92
|
+
value: "xml",
|
|
93
|
+
children: "XML"
|
|
94
|
+
});
|
|
95
|
+
$[5] = t4;
|
|
96
|
+
$[6] = t5;
|
|
97
|
+
} else {
|
|
98
|
+
t4 = $[5];
|
|
99
|
+
t5 = $[6];
|
|
100
|
+
}
|
|
101
|
+
let t6;
|
|
102
|
+
if ($[7] !== config || $[8] !== disabled || $[9] !== t3) {
|
|
103
|
+
t6 = /* @__PURE__ */ jsxs("div", {
|
|
104
|
+
className: "builder-config-field",
|
|
105
|
+
children: [t2, /* @__PURE__ */ jsxs("select", {
|
|
106
|
+
value: config,
|
|
107
|
+
onChange: t3,
|
|
108
|
+
disabled,
|
|
109
|
+
children: [t4, t5]
|
|
50
110
|
})]
|
|
51
|
-
})
|
|
52
|
-
|
|
111
|
+
});
|
|
112
|
+
$[7] = config;
|
|
113
|
+
$[8] = disabled;
|
|
114
|
+
$[9] = t3;
|
|
115
|
+
$[10] = t6;
|
|
116
|
+
} else t6 = $[10];
|
|
117
|
+
return t6;
|
|
118
|
+
}
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/configs/UseReactCompilerConfig.tsx
|
|
121
|
+
function UseReactCompilerConfig(t0) {
|
|
122
|
+
const $ = c(6);
|
|
123
|
+
const { defaultValue: t1, disabled } = t0;
|
|
124
|
+
const [config, setConfig] = useConfig("useReactCompiler", t1 === void 0 ? false : t1);
|
|
125
|
+
let t2;
|
|
126
|
+
if ($[0] !== setConfig) {
|
|
127
|
+
t2 = (evt) => setConfig(evt.target.checked);
|
|
128
|
+
$[0] = setConfig;
|
|
129
|
+
$[1] = t2;
|
|
130
|
+
} else t2 = $[1];
|
|
131
|
+
let t3;
|
|
132
|
+
if ($[2] !== config || $[3] !== disabled || $[4] !== t2) {
|
|
133
|
+
t3 = /* @__PURE__ */ jsx("div", {
|
|
134
|
+
className: "builder-config-field",
|
|
135
|
+
children: /* @__PURE__ */ jsxs("label", { children: [/* @__PURE__ */ jsx("input", {
|
|
136
|
+
type: "checkbox",
|
|
137
|
+
checked: config,
|
|
138
|
+
onChange: t2,
|
|
139
|
+
disabled
|
|
140
|
+
}), "Use React Compiler"] })
|
|
141
|
+
});
|
|
142
|
+
$[2] = config;
|
|
143
|
+
$[3] = disabled;
|
|
144
|
+
$[4] = t2;
|
|
145
|
+
$[5] = t3;
|
|
146
|
+
} else t3 = $[5];
|
|
147
|
+
return t3;
|
|
53
148
|
}
|
|
54
149
|
//#endregion
|
|
55
150
|
//#region src/configs/UseTableValuesSerializerConfig.tsx
|
|
56
|
-
function UseTableValuesSerializerConfig(
|
|
57
|
-
const
|
|
58
|
-
|
|
151
|
+
function UseTableValuesSerializerConfig(t0) {
|
|
152
|
+
const $ = c(7);
|
|
153
|
+
let disabled;
|
|
154
|
+
let otherProps;
|
|
155
|
+
let t1;
|
|
156
|
+
if ($[0] !== t0) {
|
|
157
|
+
({defaultSerializationFormatValue: t1, disabled, ...otherProps} = t0);
|
|
158
|
+
$[0] = t0;
|
|
159
|
+
$[1] = disabled;
|
|
160
|
+
$[2] = otherProps;
|
|
161
|
+
$[3] = t1;
|
|
162
|
+
} else {
|
|
163
|
+
disabled = $[1];
|
|
164
|
+
otherProps = $[2];
|
|
165
|
+
t1 = $[3];
|
|
166
|
+
}
|
|
167
|
+
const [serializationFormatConfig] = useConfig("serializationFormat", t1 === void 0 ? DEFAULT_SERIALIZATION_FORMAT : t1);
|
|
168
|
+
const t2 = disabled || serializationFormatConfig === "xml";
|
|
169
|
+
let t3;
|
|
170
|
+
if ($[4] !== otherProps || $[5] !== t2) {
|
|
171
|
+
t3 = /* @__PURE__ */ jsx(UseTableValuesSerializerConfig$1, {
|
|
172
|
+
disabled: t2,
|
|
173
|
+
...otherProps
|
|
174
|
+
});
|
|
175
|
+
$[4] = otherProps;
|
|
176
|
+
$[5] = t2;
|
|
177
|
+
$[6] = t3;
|
|
178
|
+
} else t3 = $[6];
|
|
179
|
+
return t3;
|
|
59
180
|
}
|
|
60
181
|
//#endregion
|
|
61
182
|
//#region src/scaffolding/templates/react-app/src/api/apiFetch.ts.ejs?raw
|
|
@@ -647,9 +768,6 @@ function scaffoldAppComponentFile(schematic, data) {
|
|
|
647
768
|
}, {
|
|
648
769
|
moduleName: "@ostack.tech/ui-kform",
|
|
649
770
|
name: "IssuesPanel"
|
|
650
|
-
}, {
|
|
651
|
-
moduleName: "react",
|
|
652
|
-
name: "useMemo"
|
|
653
771
|
}, {
|
|
654
772
|
moduleName: data.kmpModuleName,
|
|
655
773
|
name: `${schematic.name}FormMode`
|
|
@@ -663,6 +781,10 @@ function scaffoldAppComponentFile(schematic, data) {
|
|
|
663
781
|
moduleName: `./${schematic.name}Context.ts`,
|
|
664
782
|
name: `use${schematic.name}Context`
|
|
665
783
|
});
|
|
784
|
+
if (!data.useReactCompiler) data.currentFile.imports.push({
|
|
785
|
+
moduleName: "react",
|
|
786
|
+
name: "useMemo"
|
|
787
|
+
});
|
|
666
788
|
let issueMessagesProp = "";
|
|
667
789
|
if (shouldScaffoldIssueMessages(data)) {
|
|
668
790
|
data.currentFile.imports.push({
|
|
@@ -684,10 +806,7 @@ function scaffoldAppComponentFile(schematic, data) {
|
|
|
684
806
|
? externalContexts.initialValue
|
|
685
807
|
: undefined
|
|
686
808
|
}
|
|
687
|
-
externalContexts={useMemo(
|
|
688
|
-
() => ktMapToObject(externalContexts.toMap()),
|
|
689
|
-
[externalContexts],
|
|
690
|
-
)}
|
|
809
|
+
externalContexts={${data.useReactCompiler ? "ktMapToObject(externalContexts.toMap())" : "useMemo(() => ktMapToObject(externalContexts.toMap()), [externalContexts])"}}
|
|
691
810
|
readOnly={externalContexts.mode === ${schematic.name}FormMode.READ}
|
|
692
811
|
formTitle="${capitalCase(schematic.name)}"
|
|
693
812
|
activePath={activePath}
|
|
@@ -895,11 +1014,8 @@ function scaffoldExternalContexts(schematic, data) {
|
|
|
895
1014
|
addEjsTemplateFile(data, `${schematic.name}ExternalContexts.kt`, ExternalContexts_kt_default, ejsData);
|
|
896
1015
|
}
|
|
897
1016
|
//#endregion
|
|
898
|
-
//#region src/scaffolding/templates/build.gradle.kts?raw
|
|
899
|
-
var build_gradle_default$1 = "import org.gradle.kotlin.dsl.configure\nimport org.gradle.kotlin.dsl.withType\nimport org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsEnvSpec\nimport org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin\n\nplugins {\n alias(libs.plugins.kotlin.multiplatform) apply false\n}\n\n/** Gradle daemon JVM version. */\ntasks.named<UpdateDaemonJvm>(\"updateDaemonJvm\") {\n languageVersion = JavaLanguageVersion.of(libs.versions.jvmToolchain.get())\n}\n\n/** Configure Node.js used by Kotlin/JS. */\nplugins.withType<NodeJsRootPlugin> {\n configure<NodeJsEnvSpec> {\n version = libs.versions.nodejs.get()\n downloadBaseUrl = null // Prevent repository declaration\n }\n}\n";
|
|
900
|
-
//#endregion
|
|
901
1017
|
//#region src/scaffolding/templates/build-logic/build.gradle.kts?raw
|
|
902
|
-
var build_gradle_default = "plugins { `kotlin-dsl` }\n\ndependencies {\n implementation(libs.nodeGradle.plugin)\n}\n";
|
|
1018
|
+
var build_gradle_default$1 = "plugins { `kotlin-dsl` }\n\ndependencies {\n implementation(libs.nodeGradle.plugin)\n}\n";
|
|
903
1019
|
//#endregion
|
|
904
1020
|
//#region src/scaffolding/templates/build-logic/settings.gradle.kts?raw
|
|
905
1021
|
var settings_gradle_default = "@Suppress(\"UnstableApiUsage\")\ndependencyResolutionManagement {\n versionCatalogs {\n create(\"libs\") {\n from(files(\"../gradle/libs.versions.toml\"))\n }\n }\n repositories { gradlePluginPortal() }\n}\n\nrootProject.name = \"build-logic\"\n";
|
|
@@ -907,6 +1023,9 @@ var settings_gradle_default = "@Suppress(\"UnstableApiUsage\")\ndependencyResolu
|
|
|
907
1023
|
//#region src/scaffolding/templates/build-logic/src/main/kotlin/node-gradle-conventions.gradle.kts?raw
|
|
908
1024
|
var node_gradle_conventions_gradle_default = "plugins { id(\"com.github.node-gradle.node\") }\n\nval libs = versionCatalogs.named(\"libs\")\nval isCI = System.getenv(\"CI\") !in arrayOf(null, \"0\", \"false\")\n\nnode {\n download = true\n version = libs.findVersion(\"nodejs\").get().requiredVersion\n npmInstallCommand = if (isCI) \"ci\" else \"install\"\n distBaseUrl = null // Prevent repository declaration\n}\n";
|
|
909
1025
|
//#endregion
|
|
1026
|
+
//#region src/scaffolding/templates/build.gradle.kts?raw
|
|
1027
|
+
var build_gradle_default = "import org.gradle.kotlin.dsl.configure\nimport org.gradle.kotlin.dsl.withType\nimport org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsEnvSpec\nimport org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin\n\nplugins {\n alias(libs.plugins.kotlin.multiplatform) apply false\n}\n\n/** Gradle daemon JVM version. */\ntasks.named<UpdateDaemonJvm>(\"updateDaemonJvm\") {\n languageVersion = JavaLanguageVersion.of(libs.versions.jvmToolchain.get())\n}\n\n/** Configure Node.js used by Kotlin/JS. */\nplugins.withType<NodeJsRootPlugin> {\n configure<NodeJsEnvSpec> {\n version = libs.versions.nodejs.get()\n downloadBaseUrl = null // Prevent repository declaration\n }\n}\n";
|
|
1028
|
+
//#endregion
|
|
910
1029
|
//#region src/scaffolding/templates/gradle.properties.ejs?raw
|
|
911
1030
|
var gradle_properties_default = "group=<%= gradlePropertiesGroup %>\nversion=0.0.1\n\nkotlin.code.style=official\n# Use `npm` instead of `yarn`\nkotlin.js.yarn=false\n\norg.gradle.caching=true\norg.gradle.configuration-cache=true\n";
|
|
912
1031
|
//#endregion
|
|
@@ -914,10 +1033,10 @@ var gradle_properties_default = "group=<%= gradlePropertiesGroup %>\nversion=0.0
|
|
|
914
1033
|
var gradle_daemon_jvm_properties_default = "#This file is generated by updateDaemonJvm\ntoolchainUrl.FREE_BSD.AARCH64=https\\://api.foojay.io/disco/v3.0/ids/cb205e54cea236622eee3d62deb2c768/redirect\ntoolchainUrl.FREE_BSD.X86_64=https\\://api.foojay.io/disco/v3.0/ids/452acd2202c1005abda962c6dae7fc5f/redirect\ntoolchainUrl.LINUX.AARCH64=https\\://api.foojay.io/disco/v3.0/ids/cb205e54cea236622eee3d62deb2c768/redirect\ntoolchainUrl.LINUX.X86_64=https\\://api.foojay.io/disco/v3.0/ids/452acd2202c1005abda962c6dae7fc5f/redirect\ntoolchainUrl.MAC_OS.AARCH64=https\\://api.foojay.io/disco/v3.0/ids/faa59212208d027d066d1bbe337c5da5/redirect\ntoolchainUrl.MAC_OS.X86_64=https\\://api.foojay.io/disco/v3.0/ids/adf5b89d64773eff73f900e61dd2d632/redirect\ntoolchainUrl.UNIX.AARCH64=https\\://api.foojay.io/disco/v3.0/ids/cb205e54cea236622eee3d62deb2c768/redirect\ntoolchainUrl.UNIX.X86_64=https\\://api.foojay.io/disco/v3.0/ids/452acd2202c1005abda962c6dae7fc5f/redirect\ntoolchainUrl.WINDOWS.AARCH64=https\\://api.foojay.io/disco/v3.0/ids/e0e37f85a97c5f2df685b37b14a25072/redirect\ntoolchainUrl.WINDOWS.X86_64=https\\://api.foojay.io/disco/v3.0/ids/ccc3884e65cd85bb71a09d2223c77229/redirect\ntoolchainVersion=<%= jvmToolchainVersion %>\n";
|
|
915
1034
|
//#endregion
|
|
916
1035
|
//#region src/scaffolding/templates/gradle/libs.versions.toml.ejs?raw
|
|
917
|
-
var libs_versions_toml_default = "[versions]\n# Plugins\nkotlin = \"2.4.10\"\nnodeGradle = \"7.1.0\"\n# Libraries\nkform = \"<%= kFormVersion %>\"\nkotlinxCoroutines = \"1.11.0\"\n<%_ if (includeKotlinxDatetime) { -%>\nkotlinxDatetime = \"0.8.0\"\n<%_ } -%>\n<%_ if (serializationFormat === \"json\") { -%>\nkotlinxSerialization = \"1.11.0\"\n<%_ } -%>\n<%_ if (includeKtMath) { -%>\nktMath = \"0.10.2\"\n<%_ } -%>\nslf4j = \"2.0.
|
|
1036
|
+
var libs_versions_toml_default = "[versions]\n# Plugins\nkotlin = \"2.4.10\"\nnodeGradle = \"7.1.0\"\n# Libraries\nkform = \"<%= kFormVersion %>\"\nkotlinxCoroutines = \"1.11.0\"\n<%_ if (includeKotlinxDatetime) { -%>\nkotlinxDatetime = \"0.8.0\"\n<%_ } -%>\n<%_ if (serializationFormat === \"json\") { -%>\nkotlinxSerialization = \"1.11.0\"\n<%_ } -%>\n<%_ if (includeKtMath) { -%>\nktMath = \"0.10.2\"\n<%_ } -%>\nslf4j = \"2.0.19\"\n<%_ if (serializationFormat === \"xml\") { -%>\nxmlutil = \"0.91.1\"\n<%_ } -%>\n<%_ if (includeKotlinxDatetime) { -%>\n# npm libraries\njsJodaTimezone = \"2.23.0\"\n<%_ } -%>\n# Runtimes\njvmToolchain = \"<%= jvmToolchainVersion %>\"\nnodejs = \"<%= nodejsVersion %>\"\n\n[libraries]\nkform = { module = \"tech.ostack:kform\", version.ref = \"kform\" }\nkform-jsBindings = { module = \"tech.ostack:kform-js-bindings\", version.ref = \"kform\" }\nkform-test = { module = \"tech.ostack:kform-test\", version.ref = \"kform\" }\nkotlinxCoroutines-test = { module = \"org.jetbrains.kotlinx:kotlinx-coroutines-test\", version.ref = \"kotlinxCoroutines\" }\n<%_ if (includeKotlinxDatetime) { -%>\nkotlinxDatetime = { module = \"org.jetbrains.kotlinx:kotlinx-datetime\", version.ref = \"kotlinxDatetime\" }\n<%_ } -%>\n<%_ if (serializationFormat === \"json\") { -%>\nkotlinxSerialization-json = { module = \"org.jetbrains.kotlinx:kotlinx-serialization-json\", version.ref = \"kotlinxSerialization\" }\n<%_ } -%>\n<%_ if (includeKtMath) { -%>\nktMath = { module = \"io.github.gciatto:kt-math\", version.ref = \"ktMath\" }\n<%_ } -%>\nslf4j-simple = { module = \"org.slf4j:slf4j-simple\", version.ref = \"slf4j\" }\n<%_ if (serializationFormat === \"xml\") { -%>\nxmlutil-serialization = { module = \"io.github.pdvrieze.xmlutil:serialization\", version.ref = \"xmlutil\" }\n<%_ } -%>\n# `build-logic` plugins\nnodeGradle-plugin = { module = \"com.github.node-gradle:gradle-node-plugin\", version.ref = \"nodeGradle\" }\n\n[plugins]\nkotlin-multiplatform = { id = \"org.jetbrains.kotlin.multiplatform\", version.ref = \"kotlin\" }\nkotlin-serialization = { id = \"org.jetbrains.kotlin.plugin.serialization\", version.ref = \"kotlin\" }\n";
|
|
918
1037
|
//#endregion
|
|
919
1038
|
//#region src/scaffolding/templates/react-app/build.gradle.kts.ejs?raw
|
|
920
|
-
var build_gradle_kts_default$1 = "import com.github.gradle.node.npm.task.NpmTask\n\nplugins {\n id(\"node-gradle-conventions\")\n base\n}\n\nval sharedPackage = project(\":shared\").file(\"build/<%= formId %>-shared-$version.tgz\")\n\nval npmInstallShared = tasks.register<NpmTask>(\"npmInstallShared\") {\n group = \"build\"\n dependsOn(\":shared:packJsPackage\")\n npmCommand = listOf(\"install\", \"<%= formId %>-shared@file:$sharedPackage\")\n\n inputs.file(sharedPackage)\n outputs.dir(\"node_modules/<%= formId %>-shared\")\n}\n\ntasks.npmInstall {\n dependsOn(npmInstallShared)\n}\n\ntasks.register<NpmTask>(\"npmRunDev\") {\n group = \"development\"\n dependsOn(tasks.npmInstall)\n npmCommand = listOf(\"run\", \"dev\")\n}\n\nprivate fun NpmTask.npmRunBuild(buildReason: String) {\n group = \"build\"\n dependsOn(tasks.npmInstall)\n npmCommand = listOf(\"run\", \"build\")\n environment = mapOf(\"VITE_BUILD_REASON\" to buildReason)\n\n inputs.dir(\"src\")\n inputs.file(sharedPackage)\n inputs.file(\"index.html\")\n inputs.file(\"package.json\")\n inputs.file(\"tsconfig.json\")\n inputs.file(\"tsconfig.app.json\")\n inputs.file(\"tsconfig.node.json\")\n inputs.file(\"vite.config.ts\")\n outputs.dir(\"build/dist\")\n}\n\nval npmRunBuild = tasks.register<NpmTask>(\"npmRunBuild\") {\n npmRunBuild(\"production\")\n}\n\nval npmRunBuildPreview = tasks.register<NpmTask>(\"npmRunBuildPreview\") {\n npmRunBuild(\"preview\")\n}\n\ntasks.register<NpmTask>(\"npmRunPreview\") {\n group = \"development\"\n dependsOn(npmRunBuildPreview)\n npmCommand = listOf(\"run\", \"preview\")\n}\n\nval npmRunLint = tasks.register<NpmTask>(\"npmRunLint\") {\n group = \"verification\"\n dependsOn(tasks.npmInstall)\n npmCommand = listOf(\"run\", \"lint\")\n\n inputs.dir(\"src\")\n inputs.file(\"
|
|
1039
|
+
var build_gradle_kts_default$1 = "import com.github.gradle.node.npm.task.NpmTask\n\nplugins {\n id(\"node-gradle-conventions\")\n base\n}\n\nval sharedPackage = project(\":shared\").file(\"build/<%= formId %>-shared-$version.tgz\")\n\nval npmInstallShared = tasks.register<NpmTask>(\"npmInstallShared\") {\n group = \"build\"\n dependsOn(\":shared:packJsPackage\")\n npmCommand = listOf(\"install\", \"<%= formId %>-shared@file:$sharedPackage\")\n\n inputs.file(sharedPackage)\n outputs.dir(\"node_modules/<%= formId %>-shared\")\n}\n\ntasks.npmInstall {\n dependsOn(npmInstallShared)\n}\n\ntasks.register<NpmTask>(\"npmRunDev\") {\n group = \"development\"\n dependsOn(tasks.npmInstall)\n npmCommand = listOf(\"run\", \"dev\")\n}\n\nprivate fun NpmTask.npmRunBuild(buildReason: String) {\n group = \"build\"\n dependsOn(tasks.npmInstall)\n npmCommand = listOf(\"run\", \"build\")\n environment = mapOf(\"VITE_BUILD_REASON\" to buildReason)\n\n inputs.dir(\"src\")\n inputs.file(sharedPackage)\n inputs.file(\"index.html\")\n inputs.file(\"package.json\")\n inputs.file(\"tsconfig.json\")\n inputs.file(\"tsconfig.app.json\")\n inputs.file(\"tsconfig.node.json\")\n inputs.file(\"vite.config.ts\")\n outputs.dir(\"build/dist\")\n}\n\nval npmRunBuild = tasks.register<NpmTask>(\"npmRunBuild\") {\n npmRunBuild(\"production\")\n}\n\nval npmRunBuildPreview = tasks.register<NpmTask>(\"npmRunBuildPreview\") {\n npmRunBuild(\"preview\")\n}\n\ntasks.register<NpmTask>(\"npmRunPreview\") {\n group = \"development\"\n dependsOn(npmRunBuildPreview)\n npmCommand = listOf(\"run\", \"preview\")\n}\n\nval npmRunLint = tasks.register<NpmTask>(\"npmRunLint\") {\n group = \"verification\"\n dependsOn(tasks.npmInstall)\n npmCommand = listOf(\"run\", \"lint\")\n\n inputs.dir(\"src\")\n inputs.file(\".oxlintrc.json\")\n inputs.file(\"package.json\")\n inputs.file(\"tsconfig.json\")\n inputs.file(\"tsconfig.app.json\")\n inputs.file(\"tsconfig.node.json\")\n outputs.upToDateWhen { true }\n}\n\ntasks.assemble {\n dependsOn(npmRunBuild)\n}\n\ntasks.check {\n dependsOn(npmRunLint)\n}\n";
|
|
921
1040
|
//#endregion
|
|
922
1041
|
//#region src/scaffolding/templates/settings.gradle.kts.ejs?raw
|
|
923
1042
|
var settings_gradle_kts_default = "plugins {\n id(\"org.gradle.toolchains.foojay-resolver-convention\") version \"1.0.0\"\n}\n\n@Suppress(\"UnstableApiUsage\")\ndependencyResolutionManagement {\n repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS\n repositories {\n mavenCentral()\n\n // Node.js download repository\n ivy {\n name = \"Node.js\"\n setUrl(\"https://nodejs.org/dist/\")\n patternLayout { artifact(\"v[revision]/[artifact](-v[revision]-[classifier]).[ext]\") }\n metadataSources { artifact() }\n content { includeModule(\"org.nodejs\", \"node\") }\n }\n }\n}\n\nincludeBuild(\"build-logic\")\ninclude(\"shared\", \"react-app\")\n\nrootProject.name = \"<%= formId %>\"\n";
|
|
@@ -937,7 +1056,7 @@ function scaffoldGradleProject(schematic, data) {
|
|
|
937
1056
|
filePackage: data.currentPackage,
|
|
938
1057
|
formId: kebabCase(schematic.name),
|
|
939
1058
|
formTitle: capitalCase(schematic.name),
|
|
940
|
-
kFormVersion: "1.
|
|
1059
|
+
kFormVersion: "1.2.0",
|
|
941
1060
|
serializationFormat: data.serializationFormat ?? "json",
|
|
942
1061
|
includeKotlinxDatetime: data.includeKotlinxDatetime ?? usesKotlinxDatetime(schematic, data),
|
|
943
1062
|
includeKtMath: data.includeKtMath ?? usesKtMath(schematic),
|
|
@@ -948,9 +1067,9 @@ function scaffoldGradleProject(schematic, data) {
|
|
|
948
1067
|
addEjsTemplateFile(data, "settings.gradle.kts", settings_gradle_kts_default, ejsData);
|
|
949
1068
|
addEjsTemplateFile(data, "gradle/libs.versions.toml", libs_versions_toml_default, ejsData);
|
|
950
1069
|
addEjsTemplateFile(data, "gradle/gradle-daemon-jvm.properties", gradle_daemon_jvm_properties_default, ejsData);
|
|
951
|
-
addTemplateFile(data, "build.gradle.kts", build_gradle_default
|
|
1070
|
+
addTemplateFile(data, "build.gradle.kts", build_gradle_default);
|
|
952
1071
|
addTemplateFile(data, "build-logic/settings.gradle.kts", settings_gradle_default);
|
|
953
|
-
addTemplateFile(data, "build-logic/build.gradle.kts", build_gradle_default);
|
|
1072
|
+
addTemplateFile(data, "build-logic/build.gradle.kts", build_gradle_default$1);
|
|
954
1073
|
addTemplateFile(data, "build-logic/src/main/kotlin/node-gradle-conventions.gradle.kts", node_gradle_conventions_gradle_default);
|
|
955
1074
|
addEjsTemplateFile(data, "shared/build.gradle.kts", build_gradle_kts_default, ejsData);
|
|
956
1075
|
if (ejsData.includeKotlinxDatetime) addEjsTemplateFile(data, "shared/src/jsMain/kotlin/JsJodaTimeZone.kt", JsJodaTimeZone_kt_default, ejsData);
|
|
@@ -969,12 +1088,12 @@ var gradle_wrapper_default$1 = "data:application/java-archive;base64,UEsDBBQACAg
|
|
|
969
1088
|
//#region src/scaffolding/templates/gradle/wrapper/gradle-wrapper.properties?raw
|
|
970
1089
|
var gradle_wrapper_default = "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-9.5.0-bin.zip\nnetworkTimeout=10000\nretries=0\nretryBackOffMs=500\nvalidateDistributionUrl=true\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n";
|
|
971
1090
|
//#endregion
|
|
972
|
-
//#region src/scaffolding/templates/gradlew.bat?raw
|
|
973
|
-
var gradlew_default = "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n@rem SPDX-License-Identifier: Apache-2.0\r\n@rem\r\n\r\n@if \"%DEBUG%\"==\"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables, and ensure extensions are enabled\r\nsetlocal EnableExtensions\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\"==\"\" set DIRNAME=.\r\n@rem This is normally unused\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif %ERRORLEVEL% equ 0 goto execute\r\n\r\necho. 1>&2\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2\r\necho. 1>&2\r\necho Please set the JAVA_HOME variable in your environment to match the 1>&2\r\necho location of your Java installation. 1>&2\r\n\r\n\"%COMSPEC%\" /c exit 1\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho. 1>&2\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2\r\necho. 1>&2\r\necho Please set the JAVA_HOME variable in your environment to match the 1>&2\r\necho location of your Java installation. 1>&2\r\n\r\n\"%COMSPEC%\" /c exit 1\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\n\r\n\r\n@rem Execute Gradle\r\n@rem endlocal doesn't take effect until after the line is parsed and variables are expanded\r\n@rem which allows us to clear the local environment before executing the java command\r\nendlocal & \"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -jar \"%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\" %* & call :exitWithErrorLevel\r\n\r\n:exitWithErrorLevel\r\n@rem Use \"%COMSPEC%\" /c exit to allow operators to work properly in scripts\r\n\"%COMSPEC%\" /c exit %ERRORLEVEL%\r\n";
|
|
974
|
-
//#endregion
|
|
975
1091
|
//#region src/scaffolding/templates/gradlew?raw
|
|
976
1092
|
var gradlew_raw_default = "#!/bin/sh\n\n#\n# Copyright © 2015 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n# SPDX-License-Identifier: Apache-2.0\n#\n\n##############################################################################\n#\n# Gradle start up script for POSIX generated by Gradle.\n#\n# Important for running:\n#\n# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n# noncompliant, but you have some other compliant shell such as ksh or\n# bash, then to run this script, type that shell name before the whole\n# command line, like:\n#\n# ksh Gradle\n#\n# Busybox and similar reduced shells will NOT work, because this script\n# requires all of these POSIX shell features:\n# * functions;\n# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n# «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n# * compound commands having a testable exit status, especially «case»;\n# * various built-in commands including «command», «set», and «ulimit».\n#\n# Important for patching:\n#\n# (2) This script targets any POSIX shell, so it avoids extensions provided\n# by Bash, Ksh, etc; in particular arrays are avoided.\n#\n# The \"traditional\" practice of packing multiple parameters into a\n# space-separated string is a well documented source of bugs and security\n# problems, so this is (mostly) avoided, by progressively accumulating\n# options in \"$@\", and eventually passing that to Java.\n#\n# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n# see the in-line comments for details.\n#\n# There are tweaks for specific operating systems such as AIX, CygWin,\n# Darwin, MinGW, and NonStop.\n#\n# (3) This script is generated from the Groovy template\n# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n# within the Gradle project.\n#\n# You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n APP_HOME=${app_path%\"${app_path##*/}\"} # leaves a trailing /; empty if no leading path\n [ -h \"$app_path\" ]\ndo\n ls=$( ls -ld \"$app_path\" )\n link=${ls#*' -> '}\n case $link in #(\n /*) app_path=$link ;; #(\n *) app_path=$APP_HOME$link ;;\n esac\ndone\n\n# This is normally unused\n# shellcheck disable=SC2034\nAPP_BASE_NAME=${0##*/}\n# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)\nAPP_HOME=$( cd -P \"${APP_HOME:-./}\" > /dev/null && printf '%s\\n' \"$PWD\" ) || exit\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n echo \"$*\"\n} >&2\n\ndie () {\n echo\n echo \"$*\"\n echo\n exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in #(\n CYGWIN* ) cygwin=true ;; #(\n Darwin* ) darwin=true ;; #(\n MSYS* | MINGW* ) msys=true ;; #(\n NONSTOP* ) nonstop=true ;;\nesac\n\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n # IBM's JDK on AIX uses strange locations for the executables\n JAVACMD=$JAVA_HOME/jre/sh/java\n else\n JAVACMD=$JAVA_HOME/bin/java\n fi\n if [ ! -x \"$JAVACMD\" ] ; then\n die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n fi\nelse\n JAVACMD=java\n if ! command -v java >/dev/null 2>&1\n then\n die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n fi\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n case $MAX_FD in #(\n max*)\n # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.\n # shellcheck disable=SC2039,SC3045\n MAX_FD=$( ulimit -H -n ) ||\n warn \"Could not query maximum file descriptor limit\"\n esac\n case $MAX_FD in #(\n '' | soft) :;; #(\n *)\n # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.\n # shellcheck disable=SC2039,SC3045\n ulimit -n \"$MAX_FD\" ||\n warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n# * args from the command line\n# * the main class name\n# * -classpath\n# * -D...appname settings\n# * --module-path (only if needed)\n# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n\n JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n # Now convert the arguments - kludge to limit ourselves to /bin/sh\n for arg do\n if\n case $arg in #(\n -*) false ;; # don't mess with options #(\n /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath\n [ -e \"$t\" ] ;; #(\n *) false ;;\n esac\n then\n arg=$( cygpath --path --ignore --mixed \"$arg\" )\n fi\n # Roll the args list around exactly as many times as the number of\n # args, so each arg winds up back in the position where it started, but\n # possibly modified.\n #\n # NB: a `for` loop captures its iteration list before it begins, so\n # changing the positional parameters here affects neither the number of\n # iterations, nor the values presented in `arg`.\n shift # remove old arg\n set -- \"$@\" \"$arg\" # push replacement arg\n done\nfi\n\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Collect all arguments for the java command:\n# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,\n# and any embedded shellness will be escaped.\n# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be\n# treated as '${Hostname}' itself on the command line.\n\nset -- \\\n \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n -jar \"$APP_HOME/gradle/wrapper/gradle-wrapper.jar\" \\\n \"$@\"\n\n# Stop when \"xargs\" is not available.\nif ! command -v xargs >/dev/null 2>&1\nthen\n die \"xargs is not available\"\nfi\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n# readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n# set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n xargs -n1 |\n sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n tr '\\n' ' '\n )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n";
|
|
977
1093
|
//#endregion
|
|
1094
|
+
//#region src/scaffolding/templates/gradlew.bat?raw
|
|
1095
|
+
var gradlew_default = "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n@rem SPDX-License-Identifier: Apache-2.0\r\n@rem\r\n\r\n@if \"%DEBUG%\"==\"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables, and ensure extensions are enabled\r\nsetlocal EnableExtensions\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\"==\"\" set DIRNAME=.\r\n@rem This is normally unused\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif %ERRORLEVEL% equ 0 goto execute\r\n\r\necho. 1>&2\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2\r\necho. 1>&2\r\necho Please set the JAVA_HOME variable in your environment to match the 1>&2\r\necho location of your Java installation. 1>&2\r\n\r\n\"%COMSPEC%\" /c exit 1\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho. 1>&2\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2\r\necho. 1>&2\r\necho Please set the JAVA_HOME variable in your environment to match the 1>&2\r\necho location of your Java installation. 1>&2\r\n\r\n\"%COMSPEC%\" /c exit 1\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\n\r\n\r\n@rem Execute Gradle\r\n@rem endlocal doesn't take effect until after the line is parsed and variables are expanded\r\n@rem which allows us to clear the local environment before executing the java command\r\nendlocal & \"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -jar \"%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\" %* & call :exitWithErrorLevel\r\n\r\n:exitWithErrorLevel\r\n@rem Use \"%COMSPEC%\" /c exit to allow operators to work properly in scripts\r\n\"%COMSPEC%\" /c exit %ERRORLEVEL%\r\n";
|
|
1096
|
+
//#endregion
|
|
978
1097
|
//#region src/scaffolding/scaffolders/scaffoldGradleWrapper.ts
|
|
979
1098
|
function scaffoldGradleWrapper(_schematic, data) {
|
|
980
1099
|
addTemplateFile(data, "gradlew", gradlew_raw_default, { executable: true });
|
|
@@ -1015,7 +1134,7 @@ function scaffoldMainDeclarations(schematic, data) {
|
|
|
1015
1134
|
export function renderRoot(encodedExternalContexts: string) {
|
|
1016
1135
|
createRoot(document.getElementById("${kebabCase(schematic.name)}-app-root")!).render(
|
|
1017
1136
|
<StrictMode>
|
|
1018
|
-
<${schematic.name}Context
|
|
1137
|
+
<${schematic.name}Context
|
|
1019
1138
|
value={{
|
|
1020
1139
|
externalContexts: decode${schematic.name}ExternalContextsFromString(
|
|
1021
1140
|
encodedExternalContexts,
|
|
@@ -1023,7 +1142,7 @@ function scaffoldMainDeclarations(schematic, data) {
|
|
|
1023
1142
|
}}
|
|
1024
1143
|
>
|
|
1025
1144
|
<${schematic.name}App />
|
|
1026
|
-
</${schematic.name}Context
|
|
1145
|
+
</${schematic.name}Context>
|
|
1027
1146
|
</StrictMode>,
|
|
1028
1147
|
);
|
|
1029
1148
|
}
|
|
@@ -1031,7 +1150,7 @@ function scaffoldMainDeclarations(schematic, data) {
|
|
|
1031
1150
|
}
|
|
1032
1151
|
//#endregion
|
|
1033
1152
|
//#region src/scaffolding/templates/_editorconfig?raw
|
|
1034
|
-
var _editorconfig_raw_default = "# http://editorconfig.org\nroot = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\nindent_size = 2\nindent_style = space\ninsert_final_newline = true\nmax_line_length =
|
|
1153
|
+
var _editorconfig_raw_default = "# http://editorconfig.org\nroot = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\nindent_size = 2\nindent_style = space\ninsert_final_newline = true\nmax_line_length = 100\ntrim_trailing_whitespace = true\n\n[*.bat]\nend_of_line = crlf\n\n[{*.kt,*.kts,*.md}]\nindent_size = 4\n";
|
|
1035
1154
|
//#endregion
|
|
1036
1155
|
//#region src/scaffolding/templates/_gitattributes?raw
|
|
1037
1156
|
var _gitattributes_raw_default = "* text=auto eol=lf\n*.bat text eol=crlf\n";
|
|
@@ -1066,14 +1185,14 @@ function scaffoldStyles(_schematic, data) {
|
|
|
1066
1185
|
addTemplateFile(data, "index.scss", src_default);
|
|
1067
1186
|
}
|
|
1068
1187
|
//#endregion
|
|
1069
|
-
//#region src/scaffolding/templates/react-app/
|
|
1070
|
-
var
|
|
1188
|
+
//#region src/scaffolding/templates/react-app/_oxlintrc.json?raw
|
|
1189
|
+
var _oxlintrc_default = "{\n \"$schema\": \"./node_modules/oxlint/configuration_schema.json\",\n \"plugins\": [\"react\", \"typescript\", \"oxc\"],\n \"options\": { \"typeAware\": true },\n \"rules\": {\n \"react/rules-of-hooks\": \"error\",\n \"react/only-export-components\": [\"warn\", { \"allowConstantExport\": true }]\n }\n}\n";
|
|
1071
1190
|
//#endregion
|
|
1072
1191
|
//#region src/scaffolding/templates/react-app/index.html.ejs?raw
|
|
1073
1192
|
var index_html_default = "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <link rel=\"icon\" type=\"image/svg+xml\" href=\"/favicon.svg\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title><%= formTitle %></title>\n <style>\n body {\n margin: 0;\n }\n </style>\n </head>\n <body>\n <div id=\"<%= formId %>-app-root\"></div>\n <script type=\"module\">\n import { renderRoot } from \"/src/main.tsx\";\n\n renderRoot(<%- encodedExternalContexts %>);\n <\/script>\n </body>\n</html>\n";
|
|
1074
1193
|
//#endregion
|
|
1075
1194
|
//#region src/scaffolding/templates/react-app/package.json.ejs?raw
|
|
1076
|
-
var package_json_default = "{\n \"name\": \"<%= formId %>-react-app\",\n \"private\": true,\n \"version\": \"0.0.0\",\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n \"build\": \"tsc -b && vite build\",\n \"lint\": \"
|
|
1195
|
+
var package_json_default = "{\n \"name\": \"<%= formId %>-react-app\",\n \"private\": true,\n \"version\": \"0.0.0\",\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vite\",\n \"build\": \"tsc -b && vite build\",\n \"lint\": \"oxlint\",\n \"preview\": \"vite preview\"\n },\n \"dependencies\": {\n \"@fortawesome/fontawesome-svg-core\": \"<%= dependencyVersions[\"@fortawesome/fontawesome-svg-core\"] %>\",\n \"@fortawesome/free-regular-svg-icons\": \"<%= dependencyVersions[\"@fortawesome/free-regular-svg-icons\"] %>\",\n \"@fortawesome/free-solid-svg-icons\": \"<%= dependencyVersions[\"@fortawesome/free-solid-svg-icons\"] %>\",\n \"@ostack.tech/kform-react\": \"^<%= kFormVersion %>\",\n \"@ostack.tech/ui\": \"^<%= ostackUiVersion %>\",\n \"@ostack.tech/ui-kform\": \"^<%= ostackUiVersion %>\",\n \"date-fns\": \"<%= dependencyVersions[\"date-fns\"] %>\",\n \"<%= formId %>-shared\": \"file:../shared/build/<%= formId %>-shared-0.0.1.tgz\",\n \"react\": \"<%= dependencyVersions.react %>\",\n \"react-dom\": \"<%= dependencyVersions[\"react-dom\"] %>\"\n },\n \"devDependencies\": {\n <%_ if (useReactCompiler) { -%>\n \"@babel/core\": \"^8.0.5\",\n \"@rolldown/plugin-babel\": \"^0.2.4\",\n <%_ } -%>\n \"@types/node\": \"<%= dependencyVersions[\"@types/node\"] %>\",\n \"@types/ostack.tech__kform\": \"npm:@ostack.tech/kform@^<%= kFormVersion %>\",\n \"@types/react\": \"<%= dependencyVersions[\"@types/react\"] %>\",\n \"@types/react-dom\": \"<%= dependencyVersions[\"@types/react-dom\"] %>\",\n \"@vitejs/plugin-react\": \"<%= dependencyVersions[\"@vitejs/plugin-react\"] %>\",\n <%_ if (useReactCompiler) { -%>\n \"babel-plugin-react-compiler\": \"^1.0.0\",\n <%_ } -%>\n \"oxlint\": \"<%= dependencyVersions.oxlint %>\",\n \"oxlint-tsgolint\": \"<%= dependencyVersions[\"oxlint-tsgolint\"] %>\",\n \"sass-embedded\": \"<%= dependencyVersions[\"sass-embedded\"] %>\",\n \"typescript\": \"<%= dependencyVersions.typescript %>\",\n \"vite\": \"<%= dependencyVersions.vite %>\"\n }\n}\n";
|
|
1077
1196
|
//#endregion
|
|
1078
1197
|
//#region src/scaffolding/templates/react-app/public/favicon.svg?raw
|
|
1079
1198
|
var favicon_default = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"46\" fill=\"none\" viewBox=\"0 0 48 46\"><path fill=\"#863bff\" d=\"M25.946 44.938c-.664.845-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.287c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.497 0-3.578-1.842-3.578H1.237c-.92 0-1.456-1.04-.92-1.788L10.013.474c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.579 1.842 3.579h11.377c.943 0 1.473 1.088.89 1.83L25.947 44.94z\" style=\"fill:#863bff;fill:color(display-p3 .5252 .23 1);fill-opacity:1\"/><mask id=\"a\" width=\"48\" height=\"46\" x=\"0\" y=\"0\" maskUnits=\"userSpaceOnUse\" style=\"mask-type:alpha\"><path fill=\"#000\" d=\"M25.842 44.938c-.664.844-2.021.375-2.021-.698V33.937a2.26 2.26 0 0 0-2.262-2.262H10.183c-.92 0-1.456-1.04-.92-1.788l7.48-10.471c1.07-1.498 0-3.579-1.842-3.579H1.133c-.92 0-1.456-1.04-.92-1.787L9.91.473c.214-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.471c-1.07 1.498 0 3.578 1.842 3.578h11.377c.943 0 1.473 1.088.89 1.832L25.843 44.94z\" style=\"fill:#000;fill-opacity:1\"/></mask><g mask=\"url(#a)\"><g filter=\"url(#b)\"><ellipse cx=\"5.508\" cy=\"14.704\" fill=\"#ede6ff\" rx=\"5.508\" ry=\"14.704\" style=\"fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1\" transform=\"matrix(.00324 1 1 -.00324 -4.47 31.516)\"/></g><g filter=\"url(#c)\"><ellipse cx=\"10.399\" cy=\"29.851\" fill=\"#ede6ff\" rx=\"10.399\" ry=\"29.851\" style=\"fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1\" transform=\"matrix(.00324 1 1 -.00324 -39.328 7.883)\"/></g><g filter=\"url(#d)\"><ellipse cx=\"5.508\" cy=\"30.487\" fill=\"#7e14ff\" rx=\"5.508\" ry=\"30.487\" style=\"fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1\" transform=\"rotate(89.814 -25.913 -14.639)scale(1 -1)\"/></g><g filter=\"url(#e)\"><ellipse cx=\"5.508\" cy=\"30.599\" fill=\"#7e14ff\" rx=\"5.508\" ry=\"30.599\" style=\"fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1\" transform=\"rotate(89.814 -32.644 -3.334)scale(1 -1)\"/></g><g filter=\"url(#f)\"><ellipse cx=\"5.508\" cy=\"30.599\" fill=\"#7e14ff\" rx=\"5.508\" ry=\"30.599\" style=\"fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1\" transform=\"matrix(.00324 1 1 -.00324 -34.34 30.47)\"/></g><g filter=\"url(#g)\"><ellipse cx=\"14.072\" cy=\"22.078\" fill=\"#ede6ff\" rx=\"14.072\" ry=\"22.078\" style=\"fill:#ede6ff;fill:color(display-p3 .9275 .9033 1);fill-opacity:1\" transform=\"rotate(93.35 24.506 48.493)scale(-1 1)\"/></g><g filter=\"url(#h)\"><ellipse cx=\"3.47\" cy=\"21.501\" fill=\"#7e14ff\" rx=\"3.47\" ry=\"21.501\" style=\"fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1\" transform=\"rotate(89.009 28.708 47.59)scale(-1 1)\"/></g><g filter=\"url(#i)\"><ellipse cx=\"3.47\" cy=\"21.501\" fill=\"#7e14ff\" rx=\"3.47\" ry=\"21.501\" style=\"fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1\" transform=\"rotate(89.009 28.708 47.59)scale(-1 1)\"/></g><g filter=\"url(#j)\"><ellipse cx=\".387\" cy=\"8.972\" fill=\"#7e14ff\" rx=\"4.407\" ry=\"29.108\" style=\"fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1\" transform=\"rotate(39.51 .387 8.972)\"/></g><g filter=\"url(#k)\"><ellipse cx=\"47.523\" cy=\"-6.092\" fill=\"#7e14ff\" rx=\"4.407\" ry=\"29.108\" style=\"fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1\" transform=\"rotate(37.892 47.523 -6.092)\"/></g><g filter=\"url(#l)\"><ellipse cx=\"41.412\" cy=\"6.333\" fill=\"#47bfff\" rx=\"5.971\" ry=\"9.665\" style=\"fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1\" transform=\"rotate(37.892 41.412 6.333)\"/></g><g filter=\"url(#m)\"><ellipse cx=\"-1.879\" cy=\"38.332\" fill=\"#7e14ff\" rx=\"4.407\" ry=\"29.108\" style=\"fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1\" transform=\"rotate(37.892 -1.88 38.332)\"/></g><g filter=\"url(#n)\"><ellipse cx=\"-1.879\" cy=\"38.332\" fill=\"#7e14ff\" rx=\"4.407\" ry=\"29.108\" style=\"fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1\" transform=\"rotate(37.892 -1.88 38.332)\"/></g><g filter=\"url(#o)\"><ellipse cx=\"35.651\" cy=\"29.907\" fill=\"#7e14ff\" rx=\"4.407\" ry=\"29.108\" style=\"fill:#7e14ff;fill:color(display-p3 .4922 .0767 1);fill-opacity:1\" transform=\"rotate(37.892 35.651 29.907)\"/></g><g filter=\"url(#p)\"><ellipse cx=\"38.418\" cy=\"32.4\" fill=\"#47bfff\" rx=\"5.971\" ry=\"15.297\" style=\"fill:#47bfff;fill:color(display-p3 .2799 .748 1);fill-opacity:1\" transform=\"rotate(37.892 38.418 32.4)\"/></g></g><defs><filter id=\"b\" width=\"60.045\" height=\"41.654\" x=\"-19.77\" y=\"16.149\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"7.659\"/></filter><filter id=\"c\" width=\"90.34\" height=\"51.437\" x=\"-54.613\" y=\"-7.533\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"7.659\"/></filter><filter id=\"d\" width=\"79.355\" height=\"29.4\" x=\"-49.64\" y=\"2.03\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"4.596\"/></filter><filter id=\"e\" width=\"79.579\" height=\"29.4\" x=\"-45.045\" y=\"20.029\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"4.596\"/></filter><filter id=\"f\" width=\"79.579\" height=\"29.4\" x=\"-43.513\" y=\"21.178\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"4.596\"/></filter><filter id=\"g\" width=\"74.749\" height=\"58.852\" x=\"15.756\" y=\"-17.901\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"7.659\"/></filter><filter id=\"h\" width=\"61.377\" height=\"25.362\" x=\"23.548\" y=\"2.284\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"4.596\"/></filter><filter id=\"i\" width=\"61.377\" height=\"25.362\" x=\"23.548\" y=\"2.284\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"4.596\"/></filter><filter id=\"j\" width=\"56.045\" height=\"63.649\" x=\"-27.636\" y=\"-22.853\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"4.596\"/></filter><filter id=\"k\" width=\"54.814\" height=\"64.646\" x=\"20.116\" y=\"-38.415\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"4.596\"/></filter><filter id=\"l\" width=\"33.541\" height=\"35.313\" x=\"24.641\" y=\"-11.323\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"4.596\"/></filter><filter id=\"m\" width=\"54.814\" height=\"64.646\" x=\"-29.286\" y=\"6.009\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"4.596\"/></filter><filter id=\"n\" width=\"54.814\" height=\"64.646\" x=\"-29.286\" y=\"6.009\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"4.596\"/></filter><filter id=\"o\" width=\"54.814\" height=\"64.646\" x=\"8.244\" y=\"-2.416\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"4.596\"/></filter><filter id=\"p\" width=\"39.409\" height=\"43.623\" x=\"18.713\" y=\"10.588\" color-interpolation-filters=\"sRGB\" filterUnits=\"userSpaceOnUse\"><feFlood flood-opacity=\"0\" result=\"BackgroundImageFix\"/><feBlend in=\"SourceGraphic\" in2=\"BackgroundImageFix\" result=\"shape\"/><feGaussianBlur result=\"effect1_foregroundBlur_2002_17158\" stdDeviation=\"4.596\"/></filter></defs></svg>";
|
|
@@ -1082,13 +1201,13 @@ var favicon_default = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" he
|
|
|
1082
1201
|
var tsconfig_app_default = "{\n \"compilerOptions\": {\n \"tsBuildInfoFile\": \"./node_modules/.tmp/tsconfig.app.tsbuildinfo\",\n \"target\": \"es2023\",\n \"lib\": [\"ES2023\", \"DOM\"],\n \"module\": \"esnext\",\n \"types\": [\"vite/client\"],\n \"allowArbitraryExtensions\": true,\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"moduleResolution\": \"bundler\",\n \"allowImportingTsExtensions\": true,\n \"verbatimModuleSyntax\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n \"jsx\": \"react-jsx\",\n\n /* Linting */\n \"noUnusedLocals\": true,\n \"noUnusedParameters\": true,\n \"erasableSyntaxOnly\": true,\n \"noFallthroughCasesInSwitch\": true\n },\n \"include\": [\"src\"]\n}\n";
|
|
1083
1202
|
//#endregion
|
|
1084
1203
|
//#region src/scaffolding/templates/react-app/tsconfig.json?raw
|
|
1085
|
-
var tsconfig_default = "{\n \"files\": [],\n \"references\": [
|
|
1204
|
+
var tsconfig_default = "{\n \"files\": [],\n \"references\": [{ \"path\": \"./tsconfig.app.json\" }, { \"path\": \"./tsconfig.node.json\" }]\n}\n";
|
|
1086
1205
|
//#endregion
|
|
1087
1206
|
//#region src/scaffolding/templates/react-app/tsconfig.node.json?raw
|
|
1088
1207
|
var tsconfig_node_default = "{\n \"compilerOptions\": {\n \"tsBuildInfoFile\": \"./node_modules/.tmp/tsconfig.node.tsbuildinfo\",\n \"target\": \"es2023\",\n \"lib\": [\"ES2023\"],\n \"types\": [\"node\"],\n \"skipLibCheck\": true,\n\n /* Bundler mode */\n \"module\": \"nodenext\",\n \"allowImportingTsExtensions\": true,\n \"verbatimModuleSyntax\": true,\n \"moduleDetection\": \"force\",\n \"noEmit\": true,\n\n /* Linting */\n \"noUnusedLocals\": true,\n \"noUnusedParameters\": true,\n \"erasableSyntaxOnly\": true,\n \"noFallthroughCasesInSwitch\": true\n },\n \"include\": [\"vite.config.ts\"]\n}\n";
|
|
1089
1208
|
//#endregion
|
|
1090
1209
|
//#region src/scaffolding/templates/react-app/vite.config.ts.ejs?raw
|
|
1091
|
-
var vite_config_ts_default = "import { resolve } from \"node:path\";\n\nimport react from \"@vitejs/plugin-react\";\nimport { defineConfig } from \"vite\";\n\n// https://vite.dev/config/\nexport default defineConfig({\n plugins: [react()],\n build: {\n outDir: \"<%= viteConfigOutDir %>\",\n rolldownOptions: {\n preserveEntrySignatures: \"exports-only\",\n input: {\n \"<%= formId %>-app\":\n process.env.VITE_BUILD_REASON === \"preview\"
|
|
1210
|
+
var vite_config_ts_default = "import { resolve } from \"node:path\";\n\n<%_ if (useReactCompiler) { -%>\nimport babel from \"@rolldown/plugin-babel\";\nimport react, { reactCompilerPreset } from \"@vitejs/plugin-react\";\n<%_ } else { -%>\nimport react from \"@vitejs/plugin-react\";\n<%_ } -%>\nimport { defineConfig } from \"vite\";\n\n// https://vite.dev/config/\nexport default defineConfig({\n plugins: [\n react(),\n <%_ if (useReactCompiler) { -%>\n babel({ presets: [reactCompilerPreset()] }),\n <%_ } -%>\n ],\n build: {\n outDir: \"<%= viteConfigOutDir %>\",\n rolldownOptions: {\n preserveEntrySignatures: \"exports-only\",\n input: {\n \"<%= formId %>-app\":\n process.env.VITE_BUILD_REASON === \"preview\" ? \"index.html\" : \"src/main.tsx\",\n },\n output: {\n // Output files without hashes, making it easier to serve them in the server. However, the\n // server is expected to somehow \"version\" them for cache busting purposes.\n entryFileNames: \"assets/[name].js\",\n chunkFileNames: \"assets/[name].js\",\n assetFileNames: \"assets/[name].[ext]\",\n },\n },\n },\n resolve: {\n alias: {\n // Due to how Kotlin \"bundles\" dependencies, we need to use the `@ostack.tech/kform` produced\n // by the shared module.\n \"@ostack.tech/kform\": resolve(\n import.meta.dirname,\n \"node_modules/<%= formId %>-shared/ostack-kform.mjs\",\n ),\n },\n },\n server: {\n proxy: { \"<%= apiBasePath %>\": \"<%= viteConfigProxyTarget %>\" },\n },\n});\n";
|
|
1092
1211
|
//#endregion
|
|
1093
1212
|
//#region src/scaffolding/scaffolders/scaffoldViteProject.ts
|
|
1094
1213
|
var DEFAULT_VITE_CONFIG_OUT_DIR = "build/dist/";
|
|
@@ -1098,9 +1217,10 @@ function scaffoldViteProject(schematic, data) {
|
|
|
1098
1217
|
formId: kebabCase(schematic.name),
|
|
1099
1218
|
formClass: schematic.name,
|
|
1100
1219
|
formTitle: capitalCase(schematic.name),
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1220
|
+
useReactCompiler: data.useReactCompiler,
|
|
1221
|
+
ostackUiVersion: "1.2.0",
|
|
1222
|
+
kFormVersion: "1.2.0",
|
|
1223
|
+
dependencyVersions: JSON.parse("{\"@fortawesome/fontawesome-svg-core\":\"^7.3.1\",\"@fortawesome/free-brands-svg-icons\":\"^7.3.1\",\"@fortawesome/free-regular-svg-icons\":\"^7.3.1\",\"@fortawesome/free-solid-svg-icons\":\"^7.3.1\",\"@ostack.tech/kform\":\"^1.2.0\",\"@ostack.tech/kform-react\":\"^1.2.0\",\"@ostack.tech/kform-scaffolder\":\"^1.2.0\",\"@storybook/addon-a11y\":\"^10.6.0\",\"@storybook/addon-docs\":\"^10.6.0\",\"@storybook/addon-links\":\"^10.6.0\",\"@storybook/react-vite\":\"^10.6.0\",\"@testing-library/react\":\"^16.3.3\",\"@types/node\":\"^24.13.4\",\"@types/react\":\"^19.3.0\",\"@types/react-dom\":\"^19.3.0\",\"@vitejs/plugin-react\":\"^6.1.1\",\"change-case\":\"^5.4.4\",\"cpy-cli\":\"^7.0.0\",\"date-fns\":\"^4.4.0\",\"happy-dom\":\"^20.14.5\",\"lint-staged\":\"^17.5.1\",\"oxc-transform-react\":\"^0.150.0\",\"oxfmt\":\"^0.68.0\",\"oxlint\":\"^1.83.0\",\"oxlint-tsgolint\":\"^7.0.2001\",\"prettier\":\"^3.9.7\",\"react\":\"^19.3.0\",\"react-dom\":\"^19.3.0\",\"refractor\":\"^5.0.0\",\"rimraf\":\"^6.1.3\",\"sass-embedded\":\"^1.104.1\",\"simple-git-hooks\":\"^2.14.0\",\"storybook\":\"^10.6.0\",\"terser\":\"^5.51.2\",\"tslib\":\"^2.8.1\",\"typescript\":\"~6.0.3\",\"vite\":\"^8.3.0\",\"vitest\":\"^5.0.1\",\"write-excel-file\":\"^4.1.1\",\"zod\":\"^4.6.5\",\"zustand\":\"^5.0.15\"}"),
|
|
1104
1224
|
encodedExternalContexts: JSON.stringify(data.serializationFormat === "json" ? "{}" : `<${schematic.name}ExternalContexts />`),
|
|
1105
1225
|
apiBasePath: data.apiBasePath ?? "/api/",
|
|
1106
1226
|
viteConfigOutDir: data.viteConfigOutDir ?? "build/dist/",
|
|
@@ -1111,51 +1231,102 @@ function scaffoldViteProject(schematic, data) {
|
|
|
1111
1231
|
addTemplateFile(data, "react-app/tsconfig.json", tsconfig_default);
|
|
1112
1232
|
addTemplateFile(data, "react-app/tsconfig.app.json", tsconfig_app_default);
|
|
1113
1233
|
addTemplateFile(data, "react-app/tsconfig.node.json", tsconfig_node_default);
|
|
1114
|
-
addTemplateFile(data, "react-app
|
|
1234
|
+
addTemplateFile(data, "react-app/.oxlintrc.json", _oxlintrc_default);
|
|
1115
1235
|
addEjsTemplateFile(data, "react-app/index.html", index_html_default, ejsData);
|
|
1116
1236
|
addTemplateFile(data, "react-app/public/favicon.svg", favicon_default);
|
|
1117
1237
|
}
|
|
1118
1238
|
//#endregion
|
|
1119
1239
|
//#region src/SchematicBuilder.tsx
|
|
1120
|
-
var
|
|
1121
|
-
var
|
|
1122
|
-
var
|
|
1123
|
-
|
|
1240
|
+
var KOTLIN_MAIN_DATA = { currentDir: "shared/src/commonMain/kotlin" };
|
|
1241
|
+
var KOTLIN_TEST_DATA = { currentDir: "shared/src/commonTest/kotlin" };
|
|
1242
|
+
var REACT_APP_DATA = { currentDir: "react-app/src" };
|
|
1243
|
+
var DEFAULT_APP_VERSION = "1.2.0";
|
|
1244
|
+
var DEFAULT_SCAFFOLDERS = [
|
|
1124
1245
|
scaffoldProjectMisc,
|
|
1125
1246
|
scaffoldGradleWrapper,
|
|
1126
1247
|
scaffoldGradleProject,
|
|
1127
1248
|
scaffoldViteProject,
|
|
1128
|
-
configScaffolder(scaffoldSchemas,
|
|
1129
|
-
configScaffolder(scaffoldModels,
|
|
1130
|
-
configScaffolder(scaffoldResponses,
|
|
1131
|
-
configScaffolder(scaffoldExternalContexts,
|
|
1132
|
-
configScaffolder(scaffoldSerializer,
|
|
1133
|
-
configScaffolder(scaffoldValidator,
|
|
1134
|
-
configScaffolder(scaffoldMain,
|
|
1135
|
-
configScaffolder(scaffoldStyles,
|
|
1136
|
-
configScaffolder(scaffoldAppComponent,
|
|
1137
|
-
configScaffolder(scaffoldAppContext,
|
|
1138
|
-
configScaffolder(scaffoldApi,
|
|
1139
|
-
configScaffolder(scaffoldPageComponents,
|
|
1140
|
-
]
|
|
1249
|
+
configScaffolder(scaffoldSchemas, KOTLIN_MAIN_DATA),
|
|
1250
|
+
configScaffolder(scaffoldModels, KOTLIN_MAIN_DATA),
|
|
1251
|
+
configScaffolder(scaffoldResponses, KOTLIN_MAIN_DATA),
|
|
1252
|
+
configScaffolder(scaffoldExternalContexts, KOTLIN_MAIN_DATA),
|
|
1253
|
+
configScaffolder(scaffoldSerializer, KOTLIN_MAIN_DATA),
|
|
1254
|
+
configScaffolder(scaffoldValidator, KOTLIN_TEST_DATA),
|
|
1255
|
+
configScaffolder(scaffoldMain, REACT_APP_DATA),
|
|
1256
|
+
configScaffolder(scaffoldStyles, REACT_APP_DATA),
|
|
1257
|
+
configScaffolder(scaffoldAppComponent, REACT_APP_DATA),
|
|
1258
|
+
configScaffolder(scaffoldAppContext, REACT_APP_DATA),
|
|
1259
|
+
configScaffolder(scaffoldApi, REACT_APP_DATA),
|
|
1260
|
+
configScaffolder(scaffoldPageComponents, REACT_APP_DATA)
|
|
1261
|
+
];
|
|
1262
|
+
var DEFAULT_SCAFFOLDING_DATA = (schematic) => ({
|
|
1141
1263
|
useFileBase64Serializer: true,
|
|
1264
|
+
useReactCompiler: true,
|
|
1142
1265
|
...schematic.config
|
|
1143
|
-
})
|
|
1266
|
+
});
|
|
1267
|
+
var DEFAULT_CONFIGS = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1144
1268
|
/* @__PURE__ */ jsx(DefaultLocaleConfig, {}),
|
|
1145
1269
|
/* @__PURE__ */ jsx(SerializationFormatConfig, {}),
|
|
1146
|
-
/* @__PURE__ */ jsx(UseTableValuesSerializerConfig, {})
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1270
|
+
/* @__PURE__ */ jsx(UseTableValuesSerializerConfig, {}),
|
|
1271
|
+
/* @__PURE__ */ jsx(UseReactCompilerConfig, { defaultValue: true })
|
|
1272
|
+
] });
|
|
1273
|
+
function SchematicBuilder(t0) {
|
|
1274
|
+
const $ = c(16);
|
|
1275
|
+
let otherProps;
|
|
1276
|
+
let t1;
|
|
1277
|
+
let t2;
|
|
1278
|
+
let t3;
|
|
1279
|
+
let t4;
|
|
1280
|
+
let t5;
|
|
1281
|
+
let t6;
|
|
1282
|
+
if ($[0] !== t0) {
|
|
1283
|
+
({name: t1, schematicKinds: t2, scaffolders: t3, scaffoldingData: t4, configs: t5, version: t6, ...otherProps} = t0);
|
|
1284
|
+
$[0] = t0;
|
|
1285
|
+
$[1] = otherProps;
|
|
1286
|
+
$[2] = t1;
|
|
1287
|
+
$[3] = t2;
|
|
1288
|
+
$[4] = t3;
|
|
1289
|
+
$[5] = t4;
|
|
1290
|
+
$[6] = t5;
|
|
1291
|
+
$[7] = t6;
|
|
1292
|
+
} else {
|
|
1293
|
+
otherProps = $[1];
|
|
1294
|
+
t1 = $[2];
|
|
1295
|
+
t2 = $[3];
|
|
1296
|
+
t3 = $[4];
|
|
1297
|
+
t4 = $[5];
|
|
1298
|
+
t5 = $[6];
|
|
1299
|
+
t6 = $[7];
|
|
1300
|
+
}
|
|
1301
|
+
const name = t1 === void 0 ? "ostack-ui-kform" : t1;
|
|
1302
|
+
const schematicKinds = t2 === void 0 ? defaultSchematicKinds : t2;
|
|
1303
|
+
const scaffolders = t3 === void 0 ? DEFAULT_SCAFFOLDERS : t3;
|
|
1304
|
+
const scaffoldingData = t4 === void 0 ? DEFAULT_SCAFFOLDING_DATA : t4;
|
|
1305
|
+
const configs = t5 === void 0 ? DEFAULT_CONFIGS : t5;
|
|
1306
|
+
const version = t6 === void 0 ? DEFAULT_APP_VERSION : t6;
|
|
1307
|
+
let t7;
|
|
1308
|
+
if ($[8] !== configs || $[9] !== name || $[10] !== otherProps || $[11] !== scaffolders || $[12] !== scaffoldingData || $[13] !== schematicKinds || $[14] !== version) {
|
|
1309
|
+
t7 = /* @__PURE__ */ jsx(SchematicBuilder$1, {
|
|
1310
|
+
name,
|
|
1311
|
+
schematicKinds,
|
|
1312
|
+
scaffolders,
|
|
1313
|
+
scaffoldingData,
|
|
1314
|
+
configs,
|
|
1315
|
+
version,
|
|
1316
|
+
...otherProps
|
|
1317
|
+
});
|
|
1318
|
+
$[8] = configs;
|
|
1319
|
+
$[9] = name;
|
|
1320
|
+
$[10] = otherProps;
|
|
1321
|
+
$[11] = scaffolders;
|
|
1322
|
+
$[12] = scaffoldingData;
|
|
1323
|
+
$[13] = schematicKinds;
|
|
1324
|
+
$[14] = version;
|
|
1325
|
+
$[15] = t7;
|
|
1326
|
+
} else t7 = $[15];
|
|
1327
|
+
return t7;
|
|
1157
1328
|
}
|
|
1158
1329
|
//#endregion
|
|
1159
|
-
export { DEFAULT_ACTIVE_PATH_SEARCH_PARAM, DEFAULT_API_BASE_PATH, DEFAULT_INCLUDE_SERIALIZATION_FORMAT_VERSION, DEFAULT_JVM_TOOLCHAIN_VERSION, DEFAULT_LOCALE, DEFAULT_NODEJS_VERSION, DEFAULT_REPORT_ERROR_API_ENDPOINT, DEFAULT_SERIALIZATION_FORMAT, DEFAULT_SUBMIT_API_ENDPOINT, DEFAULT_VITE_CONFIG_OUT_DIR, DEFAULT_VITE_CONFIG_PROXY_TARGET, DefaultLocaleConfig, LOCALES, SchematicBuilder, SerializationFormatConfig, UseTableValuesSerializerConfig, anySchematicKind, bigDecimalSchematicKind, bigIntegerSchematicKind, booleanSchematicKind, byteSchematicKind, classAnnexSchematicKind, classFormPageSchematicKind, classSchematicKind, defaultSchematicKinds, doubleSchematicKind, enumRadioGroupSchematicKind, enumSchematicKind, enumSelectSchematicKind, fileSchematicKind, floatSchematicKind, intSchematicKind, listCheckboxGroupSchematicKind, listSelectMultipleSchematicKind, localDateSchematicKind, longSchematicKind, reactAppLayout, scaffoldApi, scaffoldAppComponent, scaffoldAppContext, scaffoldAppLayout, scaffoldExternalContexts, scaffoldField, scaffoldGradleProject, scaffoldGradleWrapper, scaffoldIssueMessages, scaffoldMain, scaffoldPageComponents, scaffoldProjectMisc, scaffoldResponses, scaffoldSerializer, scaffoldStyles, scaffoldViteProject, shortSchematicKind, shouldScaffoldIssueMessages, stringSchematicKind, tableAnnexesSchematicKind, tableSchematicKind };
|
|
1330
|
+
export { DEFAULT_ACTIVE_PATH_SEARCH_PARAM, DEFAULT_API_BASE_PATH, DEFAULT_INCLUDE_SERIALIZATION_FORMAT_VERSION, DEFAULT_JVM_TOOLCHAIN_VERSION, DEFAULT_LOCALE, DEFAULT_NODEJS_VERSION, DEFAULT_REPORT_ERROR_API_ENDPOINT, DEFAULT_SERIALIZATION_FORMAT, DEFAULT_SUBMIT_API_ENDPOINT, DEFAULT_VITE_CONFIG_OUT_DIR, DEFAULT_VITE_CONFIG_PROXY_TARGET, DefaultLocaleConfig, LOCALES, SchematicBuilder, SerializationFormatConfig, UseReactCompilerConfig, UseTableValuesSerializerConfig, anySchematicKind, bigDecimalSchematicKind, bigIntegerSchematicKind, booleanSchematicKind, byteSchematicKind, classAnnexSchematicKind, classFormPageSchematicKind, classSchematicKind, defaultSchematicKinds, doubleSchematicKind, enumRadioGroupSchematicKind, enumSchematicKind, enumSelectSchematicKind, fileSchematicKind, floatSchematicKind, intSchematicKind, listCheckboxGroupSchematicKind, listSelectMultipleSchematicKind, localDateSchematicKind, longSchematicKind, reactAppLayout, scaffoldApi, scaffoldAppComponent, scaffoldAppContext, scaffoldAppLayout, scaffoldExternalContexts, scaffoldField, scaffoldGradleProject, scaffoldGradleWrapper, scaffoldIssueMessages, scaffoldMain, scaffoldPageComponents, scaffoldProjectMisc, scaffoldResponses, scaffoldSerializer, scaffoldStyles, scaffoldViteProject, shortSchematicKind, shouldScaffoldIssueMessages, stringSchematicKind, tableAnnexesSchematicKind, tableSchematicKind };
|
|
1160
1331
|
|
|
1161
1332
|
//# sourceMappingURL=ostack-ui-kform-scaffolder.js.map
|