json-crud-ui-components 1.5.3 → 1.7.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/bin/cli.js +1 -1
- package/bin/v6/commands/init/steps/checks.js +21 -0
- package/bin/v6/commands/init/steps/resolveFolderName.js +14 -0
- package/bin/v6/commands/init.js +77 -0
- package/bin/v7/commands/init/steps/checks.js +21 -0
- package/bin/v7/commands/init/steps/resolveFolderName.js +14 -0
- package/bin/v7/commands/init/template/v5/index.html +48 -0
- package/bin/v7/commands/init/template/v5/tailwindcss-3.4.17.css +83 -0
- package/bin/v7/commands/init.js +75 -0
- package/bin/v7/commands/initHtml/steps/announce.js +3 -0
- package/bin/v7/commands/initHtml/steps/checks.js +18 -0
- package/bin/v7/commands/initHtml/steps/createProject.js +5 -0
- package/bin/v7/commands/initHtml/steps/locateDestination.js +5 -0
- package/bin/v7/commands/initHtml/steps/locateSource.js +32 -0
- package/bin/v7/commands/initHtml/template/v5/index.html +48 -0
- package/bin/v7/commands/initHtml/template/v5/tailwindcss-3.4.17.css +83 -0
- package/bin/v7/commands/initHtml.js +24 -0
- package/bin/v7/commands/initJs/steps/announce.js +3 -0
- package/bin/v7/commands/initJs/steps/createProject.js +7 -0
- package/bin/v7/commands/initJs/steps/locateDestination.js +5 -0
- package/bin/v7/commands/initJs/steps/locateSource.js +32 -0
- package/bin/{v5/commands/init.js → v7/commands/initJs.js} +6 -6
- package/bin/v7/core/getAllVersions.js +12 -0
- package/bin/v7/core/showUsage.js +41 -0
- package/bin/{v4 → v7}/start.js +2 -0
- package/package.json +1 -1
- package/bin/v4/commands/init.js +0 -25
- package/bin/v4/core/showUsage.js +0 -49
- package/bin/v5/commands/initJs/steps/checks.js +0 -23
- /package/bin/{v4 → v6}/commands/addListeners/steps/announce.js +0 -0
- /package/bin/{v4 → v6}/commands/addListeners/steps/checks.js +0 -0
- /package/bin/{v4 → v6}/commands/addListeners/steps/createProject.js +0 -0
- /package/bin/{v4 → v6}/commands/addListeners/steps/locateDestination.js +0 -0
- /package/bin/{v4 → v6}/commands/addListeners/steps/locateSource.js +0 -0
- /package/bin/{v4 → v6}/commands/addListeners/steps/resolveFolderName.js +0 -0
- /package/bin/{v4 → v6}/commands/addListeners/template/v2/hookAllListeners.js +0 -0
- /package/bin/{v4 → v6}/commands/addListeners.js +0 -0
- /package/bin/{v4 → v6}/commands/buildHeader/steps/announce.js +0 -0
- /package/bin/{v4 → v6}/commands/buildHeader/steps/createProject.js +0 -0
- /package/bin/{v4 → v6}/commands/buildHeader/steps/locateDestination.js +0 -0
- /package/bin/{v4 → v6}/commands/buildHeader/steps/locateSource.js +0 -0
- /package/bin/{v4 → v6}/commands/buildHeader/steps/resolveFolderName.js +0 -0
- /package/bin/{v4 → v6}/commands/buildHeader/template/v1/buildHeader.js +0 -0
- /package/bin/{v4 → v6}/commands/buildHeader.js +0 -0
- /package/bin/{v4 → v6}/commands/htmlIdClick/steps/announce.js +0 -0
- /package/bin/{v4 → v6}/commands/htmlIdClick/steps/checks.js +0 -0
- /package/bin/{v4 → v6}/commands/htmlIdClick/steps/createProject.js +0 -0
- /package/bin/{v4 → v6}/commands/htmlIdClick/steps/locateDestination.js +0 -0
- /package/bin/{v4 → v6}/commands/htmlIdClick/steps/locateSource.js +0 -0
- /package/bin/{v4 → v6}/commands/htmlIdClick/steps/resolveFolderName.js +0 -0
- /package/bin/{v4 → v6}/commands/htmlIdClick/template/v1/clickFunc.js +0 -0
- /package/bin/{v4 → v6}/commands/htmlIdClick/template/v1/start.js +0 -0
- /package/bin/{v4 → v6}/commands/htmlIdClick.js +0 -0
- /package/bin/{v4 → v6}/commands/init/steps/announce.js +0 -0
- /package/bin/{v4 → v6}/commands/init/steps/createProject.js +0 -0
- /package/bin/{v4 → v6}/commands/init/steps/locateDestination.js +0 -0
- /package/bin/{v4 → v6}/commands/init/steps/locateSource.js +0 -0
- /package/bin/{v4/commands/init/template/v3 → v6/commands/init/template/v5/Index}/FormLoad/DomContentLoaded/buildHeader.js +0 -0
- /package/bin/{v4/commands/init/template/v3 → v6/commands/init/template/v5/Index}/FormLoad/DomContentLoaded/buildMenuItem.js +0 -0
- /package/bin/{v4/commands/init/template/v3 → v6/commands/init/template/v5/Index}/FormLoad/DomContentLoaded/runAfterDomLoad.js +0 -0
- /package/bin/{v4/commands/init/template/v3 → v6/commands/init/template/v5/Index}/FormLoad/DomContentLoaded/start.js +0 -0
- /package/bin/{v4/commands/init/template/v3 → v6/commands/init/template/v5/Index}/FormLoad/start.js +0 -0
- /package/bin/{v4/commands/init/template/v3 → v6/commands/init/template/v5/Index}/headers.json +0 -0
- /package/bin/{v4/commands/init/template/v3 → v6/commands/init/template/v5/Index}/start.js +0 -0
- /package/bin/{v5/commands/init/template/v4 → v6/commands/init/template/v5}/index.html +0 -0
- /package/bin/{v5/commands/init/template/v4 → v6/commands/init/template/v5}/tailwindcss-3.4.17.css +0 -0
- /package/bin/{v5/commands/addListeners → v6/commands/initHtml}/steps/announce.js +0 -0
- /package/bin/{v5 → v6}/commands/initHtml/steps/checks.js +0 -0
- /package/bin/{v5 → v6}/commands/initHtml/steps/createProject.js +0 -0
- /package/bin/{v5/commands/addListeners → v6/commands/initHtml}/steps/locateDestination.js +0 -0
- /package/bin/{v5/commands/addListeners → v6/commands/initHtml}/steps/locateSource.js +0 -0
- /package/bin/{v4/commands/init → v6/commands/initHtml}/steps/resolveFolderName.js +0 -0
- /package/bin/{v5/commands/initHtml/template/v4 → v6/commands/initHtml/template/v5}/index.html +0 -0
- /package/bin/{v5/commands/initHtml/template/v4 → v6/commands/initHtml/template/v5}/tailwindcss-3.4.17.css +0 -0
- /package/bin/{v5 → v6}/commands/initHtml.js +0 -0
- /package/bin/{v5/commands/buildHeader → v6/commands/initJs}/steps/announce.js +0 -0
- /package/bin/{v4/commands/init → v6/commands/initJs}/steps/checks.js +0 -0
- /package/bin/{v5/commands/addListeners → v6/commands/initJs}/steps/createProject.js +0 -0
- /package/bin/{v5/commands/buildHeader → v6/commands/initJs}/steps/locateDestination.js +0 -0
- /package/bin/{v5/commands/buildHeader → v6/commands/initJs}/steps/locateSource.js +0 -0
- /package/bin/{v5/commands/init → v6/commands/initJs}/steps/resolveFolderName.js +0 -0
- /package/bin/{v5/commands/init/template/v3 → v6/commands/initJs/template/v4}/FormLoad/DomContentLoaded/buildHeader.js +0 -0
- /package/bin/{v5/commands/init/template/v3 → v6/commands/initJs/template/v4}/FormLoad/DomContentLoaded/buildMenuItem.js +0 -0
- /package/bin/{v5/commands/init/template/v3 → v6/commands/initJs/template/v4}/FormLoad/DomContentLoaded/runAfterDomLoad.js +0 -0
- /package/bin/{v5/commands/init/template/v3 → v6/commands/initJs/template/v4}/FormLoad/DomContentLoaded/start.js +0 -0
- /package/bin/{v5/commands/init/template/v3 → v6/commands/initJs/template/v4}/FormLoad/start.js +0 -0
- /package/bin/{v5/commands/init/template/v3 → v6/commands/initJs/template/v4}/headers.json +0 -0
- /package/bin/{v5/commands/init/template/v3 → v6/commands/initJs/template/v4}/start.js +0 -0
- /package/bin/{v5 → v6}/commands/initJs.js +0 -0
- /package/bin/{v5 → v6}/core/getAllVersions.js +0 -0
- /package/bin/{v4 → v6}/core/parseInput.js +0 -0
- /package/bin/{v4 → v6}/core/resolveCommand.js +0 -0
- /package/bin/{v5 → v6}/core/showUsage.js +0 -0
- /package/bin/{v5 → v6}/start.js +0 -0
- /package/bin/{v5/commands/htmlIdClick → v7/commands/addListeners}/steps/announce.js +0 -0
- /package/bin/{v5 → v7}/commands/addListeners/steps/checks.js +0 -0
- /package/bin/{v5/commands/buildHeader → v7/commands/addListeners}/steps/createProject.js +0 -0
- /package/bin/{v5/commands/htmlIdClick → v7/commands/addListeners}/steps/locateDestination.js +0 -0
- /package/bin/{v5/commands/htmlIdClick → v7/commands/addListeners}/steps/locateSource.js +0 -0
- /package/bin/{v5 → v7}/commands/addListeners/steps/resolveFolderName.js +0 -0
- /package/bin/{v5 → v7}/commands/addListeners/template/v2/hookAllListeners.js +0 -0
- /package/bin/{v5 → v7}/commands/addListeners.js +0 -0
- /package/bin/{v5/commands/init → v7/commands/buildHeader}/steps/announce.js +0 -0
- /package/bin/{v5/commands/htmlIdClick → v7/commands/buildHeader}/steps/createProject.js +0 -0
- /package/bin/{v5/commands/init → v7/commands/buildHeader}/steps/locateDestination.js +0 -0
- /package/bin/{v5/commands/init → v7/commands/buildHeader}/steps/locateSource.js +0 -0
- /package/bin/{v5 → v7}/commands/buildHeader/steps/resolveFolderName.js +0 -0
- /package/bin/{v5 → v7}/commands/buildHeader/template/v1/buildHeader.js +0 -0
- /package/bin/{v5 → v7}/commands/buildHeader.js +0 -0
- /package/bin/{v5/commands/initHtml → v7/commands/htmlIdClick}/steps/announce.js +0 -0
- /package/bin/{v5 → v7}/commands/htmlIdClick/steps/checks.js +0 -0
- /package/bin/{v5/commands/init → v7/commands/htmlIdClick}/steps/createProject.js +0 -0
- /package/bin/{v5/commands/initHtml → v7/commands/htmlIdClick}/steps/locateDestination.js +0 -0
- /package/bin/{v5/commands/initHtml → v7/commands/htmlIdClick}/steps/locateSource.js +0 -0
- /package/bin/{v5 → v7}/commands/htmlIdClick/steps/resolveFolderName.js +0 -0
- /package/bin/{v5 → v7}/commands/htmlIdClick/template/v1/clickFunc.js +0 -0
- /package/bin/{v5 → v7}/commands/htmlIdClick/template/v1/start.js +0 -0
- /package/bin/{v5 → v7}/commands/htmlIdClick.js +0 -0
- /package/bin/{v5/commands/initJs → v7/commands/init}/steps/announce.js +0 -0
- /package/bin/{v5/commands/initJs → v7/commands/init}/steps/createProject.js +0 -0
- /package/bin/{v5/commands/initJs → v7/commands/init}/steps/locateDestination.js +0 -0
- /package/bin/{v5/commands/initJs → v7/commands/init}/steps/locateSource.js +0 -0
- /package/bin/{v5/commands/initHtml/template/v3 → v7/commands/init/template/v5/Index}/FormLoad/DomContentLoaded/buildHeader.js +0 -0
- /package/bin/{v5/commands/initHtml/template/v3 → v7/commands/init/template/v5/Index}/FormLoad/DomContentLoaded/buildMenuItem.js +0 -0
- /package/bin/{v5/commands/initHtml/template/v3 → v7/commands/init/template/v5/Index}/FormLoad/DomContentLoaded/runAfterDomLoad.js +0 -0
- /package/bin/{v5/commands/initHtml/template/v3 → v7/commands/init/template/v5/Index}/FormLoad/DomContentLoaded/start.js +0 -0
- /package/bin/{v5/commands/initHtml/template/v3 → v7/commands/init/template/v5/Index}/FormLoad/start.js +0 -0
- /package/bin/{v5/commands/initHtml/template/v3 → v7/commands/init/template/v5/Index}/headers.json +0 -0
- /package/bin/{v5/commands/initHtml/template/v3 → v7/commands/init/template/v5/Index}/start.js +0 -0
- /package/bin/{v5 → v7}/commands/initHtml/steps/resolveFolderName.js +0 -0
- /package/bin/{v5/commands/init → v7/commands/initJs}/steps/checks.js +0 -0
- /package/bin/{v5 → v7}/commands/initJs/steps/resolveFolderName.js +0 -0
- /package/bin/{v5/commands/initJs/template/v3 → v7/commands/initJs/template/v4}/FormLoad/DomContentLoaded/buildHeader.js +0 -0
- /package/bin/{v5/commands/initJs/template/v3 → v7/commands/initJs/template/v4}/FormLoad/DomContentLoaded/buildMenuItem.js +0 -0
- /package/bin/{v5/commands/initJs/template/v3 → v7/commands/initJs/template/v4}/FormLoad/DomContentLoaded/runAfterDomLoad.js +0 -0
- /package/bin/{v5/commands/initJs/template/v3 → v7/commands/initJs/template/v4}/FormLoad/DomContentLoaded/start.js +0 -0
- /package/bin/{v5/commands/initJs/template/v3 → v7/commands/initJs/template/v4}/FormLoad/start.js +0 -0
- /package/bin/{v5/commands/initJs/template/v3 → v7/commands/initJs/template/v4}/headers.json +0 -0
- /package/bin/{v5/commands/initJs/template/v3 → v7/commands/initJs/template/v4}/start.js +0 -0
- /package/bin/{v5 → v7}/core/parseInput.js +0 -0
- /package/bin/{v5 → v7}/core/resolveCommand.js +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { locateSource } from "./init/steps/locateSource.js";
|
|
2
|
+
import { locateDestination } from "./init/steps/locateDestination.js";
|
|
3
|
+
|
|
4
|
+
import { createProject } from "./init/steps/createProject.js";
|
|
5
|
+
import { announce } from "./init/steps/announce.js";
|
|
6
|
+
|
|
7
|
+
import resolveFolderName from "./init/steps/resolveFolderName.js";
|
|
8
|
+
import checks from "./init/steps/checks.js";
|
|
9
|
+
|
|
10
|
+
export default ({
|
|
11
|
+
folderName = "",
|
|
12
|
+
toPath = process.cwd(),
|
|
13
|
+
inAnnounce = true,
|
|
14
|
+
showLog = false
|
|
15
|
+
}) => {
|
|
16
|
+
if (showLog) {
|
|
17
|
+
console.log("Resolving folder name...");
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const resolvedFolderName = resolveFolderName({
|
|
21
|
+
name: folderName
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
if (showLog) {
|
|
25
|
+
console.log(`resolvedFolderName : ${resolvedFolderName}`);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const fromChecks = checks({
|
|
29
|
+
toPath,
|
|
30
|
+
inAnnounce,
|
|
31
|
+
inFolderName: resolvedFolderName,
|
|
32
|
+
showLog
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
if (fromChecks) return false;
|
|
36
|
+
|
|
37
|
+
if (showLog) {
|
|
38
|
+
console.log("Locating source...");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const source = locateSource({
|
|
42
|
+
showLog
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
if (showLog) {
|
|
46
|
+
console.log("Locating destination...");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const destination = locateDestination({
|
|
50
|
+
inResolvedFolderName: resolvedFolderName,
|
|
51
|
+
showLog
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if (showLog) {
|
|
55
|
+
console.log("Creating project...");
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
createProject({
|
|
59
|
+
source,
|
|
60
|
+
destination,
|
|
61
|
+
showLog
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
if (inAnnounce) {
|
|
65
|
+
|
|
66
|
+
if (showLog) {
|
|
67
|
+
console.log("Announcing...");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
announce({
|
|
71
|
+
inResolvedFolderName: resolvedFolderName,
|
|
72
|
+
showLog
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
|
|
4
|
+
const validate = ({ toPath }) => {
|
|
5
|
+
if (fs.existsSync(toPath)) {
|
|
6
|
+
|
|
7
|
+
const files = fs.readdirSync(toPath);
|
|
8
|
+
|
|
9
|
+
if (files.length > 0) {
|
|
10
|
+
console.log("index folder should be empty");
|
|
11
|
+
return true;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return false;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default validate;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
|
|
9
|
+
const templatePath = path.join(
|
|
10
|
+
__dirname,
|
|
11
|
+
"..",
|
|
12
|
+
"template"
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const versions = fs
|
|
16
|
+
.readdirSync(templatePath)
|
|
17
|
+
.filter(item => item.startsWith("v"));
|
|
18
|
+
|
|
19
|
+
const highestVersion =
|
|
20
|
+
versions.sort().at(-1);
|
|
21
|
+
|
|
22
|
+
const sourceVersion =
|
|
23
|
+
highestVersion;
|
|
24
|
+
|
|
25
|
+
export const locateSource = () => {
|
|
26
|
+
return path.join(
|
|
27
|
+
__dirname,
|
|
28
|
+
"..",
|
|
29
|
+
"template",
|
|
30
|
+
sourceVersion
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>KeshavSoft</title>
|
|
8
|
+
|
|
9
|
+
<!-- Tailwind CDN -->
|
|
10
|
+
<!-- <script src="https://cdn.tailwindcss.com"></script> -->
|
|
11
|
+
<script src="./tailwindcss-3.4.17.css"></script>
|
|
12
|
+
<!-- Heroicons (SVG inline, no extra CDN needed) -->
|
|
13
|
+
|
|
14
|
+
<style>
|
|
15
|
+
mark {
|
|
16
|
+
background-color: yellow;
|
|
17
|
+
color: black;
|
|
18
|
+
}
|
|
19
|
+
</style>
|
|
20
|
+
</head>
|
|
21
|
+
|
|
22
|
+
<body class="bg-gray-100 flex flex-col min-h-screen">
|
|
23
|
+
|
|
24
|
+
<main class="flex-grow">
|
|
25
|
+
|
|
26
|
+
<div id="header"></div>
|
|
27
|
+
|
|
28
|
+
<section class="mx-auto px-3 py-6
|
|
29
|
+
max-w-3xl
|
|
30
|
+
lg:max-w-5xl
|
|
31
|
+
xl:max-w-6xl">
|
|
32
|
+
|
|
33
|
+
<div id="kSTableContainer"></div>
|
|
34
|
+
|
|
35
|
+
</section>
|
|
36
|
+
|
|
37
|
+
</main>
|
|
38
|
+
|
|
39
|
+
<footer class="bg-gray-200 text-gray-700 text-center py-4">
|
|
40
|
+
<div class="max-w-6xl mx-auto px-4">
|
|
41
|
+
© 2026 KeshavSoft • Contact
|
|
42
|
+
</div>
|
|
43
|
+
</footer>
|
|
44
|
+
|
|
45
|
+
<script type="module" src="./Index/start.js"></script>
|
|
46
|
+
</body>
|
|
47
|
+
|
|
48
|
+
</html>
|