json-crud-ui-components 1.4.3 → 1.5.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/v5/commands/addListeners/steps/checks.js +25 -0
- package/bin/{v3/commands/addListeners/template/v2/start.js → v5/commands/addListeners/template/v2/hookAllListeners.js} +1 -1
- package/bin/{v3 → v5}/commands/addListeners.js +12 -0
- package/bin/v5/commands/htmlIdClick/steps/checks.js +25 -0
- package/bin/v5/commands/htmlIdClick/steps/resolveFolderName.js +14 -0
- package/bin/{v3 → v5}/commands/htmlIdClick.js +13 -1
- package/bin/v5/commands/init/steps/checks.js +23 -0
- package/bin/v5/commands/init/template/v4/index.html +48 -0
- package/bin/v5/commands/init/template/v4/tailwindcss-3.4.17.css +83 -0
- package/bin/{v3 → v5}/commands/init.js +4 -2
- package/bin/v5/commands/initHtml/steps/announce.js +3 -0
- package/bin/v5/commands/initHtml/steps/checks.js +23 -0
- package/bin/v5/commands/initHtml/steps/createProject.js +7 -0
- package/bin/v5/commands/initHtml/steps/locateDestination.js +5 -0
- package/bin/v5/commands/initHtml/steps/locateSource.js +32 -0
- package/bin/{v3/commands/htmlIdClick → v5/commands/initHtml}/steps/resolveFolderName.js +1 -1
- package/bin/{v3/commands/init/template/v1/Index → v5/commands/initHtml/template/v3}/FormLoad/DomContentLoaded/buildHeader.js +6 -16
- package/bin/{v3/commands/init/template/v1/Index → v5/commands/initHtml/template/v3}/FormLoad/DomContentLoaded/runAfterDomLoad.js +1 -1
- package/bin/v5/commands/initHtml/template/v3/headers.json +45 -0
- package/bin/v5/commands/initHtml/template/v4/index.html +48 -0
- package/bin/v5/commands/initHtml/template/v4/tailwindcss-3.4.17.css +83 -0
- package/bin/v5/commands/initHtml.js +25 -0
- package/bin/v5/commands/initJs/steps/announce.js +3 -0
- package/bin/v5/commands/initJs/steps/checks.js +23 -0
- package/bin/v5/commands/initJs/steps/createProject.js +7 -0
- package/bin/v5/commands/initJs/steps/locateDestination.js +5 -0
- package/bin/v5/commands/initJs/steps/locateSource.js +32 -0
- package/bin/v5/commands/initJs/steps/resolveFolderName.js +17 -0
- package/bin/{v3/commands/init/template/v2 → v5/commands/initJs/template/v3}/FormLoad/DomContentLoaded/buildHeader.js +6 -16
- package/bin/{v3/commands/init/template/v2 → v5/commands/initJs/template/v3}/FormLoad/DomContentLoaded/runAfterDomLoad.js +1 -1
- package/bin/v5/commands/initJs/template/v3/headers.json +45 -0
- package/bin/v5/commands/initJs.js +25 -0
- package/bin/v5/core/getAllVersions.js +12 -0
- package/bin/v5/core/showUsage.js +41 -0
- package/bin/{v3 → v5}/start.js +2 -0
- package/package.json +1 -1
- package/bin/v3/core/showUsage.js +0 -39
- /package/bin/{v3 → v5}/commands/addListeners/steps/announce.js +0 -0
- /package/bin/{v3 → v5}/commands/addListeners/steps/createProject.js +0 -0
- /package/bin/{v3 → v5}/commands/addListeners/steps/locateDestination.js +0 -0
- /package/bin/{v3 → v5}/commands/addListeners/steps/locateSource.js +0 -0
- /package/bin/{v3 → v5}/commands/addListeners/steps/resolveFolderName.js +0 -0
- /package/bin/{v3 → v5}/commands/buildHeader/steps/announce.js +0 -0
- /package/bin/{v3 → v5}/commands/buildHeader/steps/createProject.js +0 -0
- /package/bin/{v3 → v5}/commands/buildHeader/steps/locateDestination.js +0 -0
- /package/bin/{v3 → v5}/commands/buildHeader/steps/locateSource.js +0 -0
- /package/bin/{v3 → v5}/commands/buildHeader/steps/resolveFolderName.js +0 -0
- /package/bin/{v3 → v5}/commands/buildHeader/template/v1/buildHeader.js +0 -0
- /package/bin/{v3 → v5}/commands/buildHeader.js +0 -0
- /package/bin/{v3 → v5}/commands/htmlIdClick/steps/announce.js +0 -0
- /package/bin/{v3 → v5}/commands/htmlIdClick/steps/createProject.js +0 -0
- /package/bin/{v3 → v5}/commands/htmlIdClick/steps/locateDestination.js +0 -0
- /package/bin/{v3 → v5}/commands/htmlIdClick/steps/locateSource.js +0 -0
- /package/bin/{v3 → v5}/commands/htmlIdClick/template/v1/clickFunc.js +0 -0
- /package/bin/{v3 → v5}/commands/htmlIdClick/template/v1/start.js +0 -0
- /package/bin/{v3 → v5}/commands/init/steps/announce.js +0 -0
- /package/bin/{v3 → v5}/commands/init/steps/createProject.js +0 -0
- /package/bin/{v3 → v5}/commands/init/steps/locateDestination.js +0 -0
- /package/bin/{v3 → v5}/commands/init/steps/locateSource.js +0 -0
- /package/bin/{v3 → v5}/commands/init/steps/resolveFolderName.js +0 -0
- /package/bin/{v3 → v5}/commands/init/template/v3/FormLoad/DomContentLoaded/buildHeader.js +0 -0
- /package/bin/{v3/commands/init/template/v1/Index → v5/commands/init/template/v3}/FormLoad/DomContentLoaded/buildMenuItem.js +0 -0
- /package/bin/{v3 → v5}/commands/init/template/v3/FormLoad/DomContentLoaded/runAfterDomLoad.js +0 -0
- /package/bin/{v3/commands/init/template/v1/Index → v5/commands/init/template/v3}/FormLoad/DomContentLoaded/start.js +0 -0
- /package/bin/{v3/commands/init/template/v1/Index → v5/commands/init/template/v3}/FormLoad/start.js +0 -0
- /package/bin/{v3 → v5}/commands/init/template/v3/headers.json +0 -0
- /package/bin/{v3/commands/init/template/v1/Index → v5/commands/init/template/v3}/start.js +0 -0
- /package/bin/{v3/commands/init/template/v2 → v5/commands/initHtml/template/v3}/FormLoad/DomContentLoaded/buildMenuItem.js +0 -0
- /package/bin/{v3/commands/init/template/v2 → v5/commands/initHtml/template/v3}/FormLoad/DomContentLoaded/start.js +0 -0
- /package/bin/{v3/commands/init/template/v2 → v5/commands/initHtml/template/v3}/FormLoad/start.js +0 -0
- /package/bin/{v3/commands/init/template/v2 → v5/commands/initHtml/template/v3}/start.js +0 -0
- /package/bin/{v3/commands/init → v5/commands/initJs}/template/v3/FormLoad/DomContentLoaded/buildMenuItem.js +0 -0
- /package/bin/{v3/commands/init → v5/commands/initJs}/template/v3/FormLoad/DomContentLoaded/start.js +0 -0
- /package/bin/{v3/commands/init → v5/commands/initJs}/template/v3/FormLoad/start.js +0 -0
- /package/bin/{v3/commands/init → v5/commands/initJs}/template/v3/start.js +0 -0
- /package/bin/{v3 → v5}/core/parseInput.js +0 -0
- /package/bin/{v3 → v5}/core/resolveCommand.js +0 -0
package/bin/cli.js
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
|
|
4
|
+
const validate = ({ toPath, inDefaultFolderName, inFileNameToCheck }) => {
|
|
5
|
+
const fileNameToCheck = inFileNameToCheck;
|
|
6
|
+
|
|
7
|
+
const htmlPath = path.join(toPath, fileNameToCheck);
|
|
8
|
+
const indexPath = path.join(toPath, inDefaultFolderName);
|
|
9
|
+
|
|
10
|
+
if (!fs.existsSync(htmlPath)) {
|
|
11
|
+
console.log(`${fileNameToCheck} not found`);
|
|
12
|
+
|
|
13
|
+
return true;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
if (fs.existsSync(indexPath)) {
|
|
17
|
+
console.log(`${folderNameToCheck} folder found`);
|
|
18
|
+
|
|
19
|
+
return true;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return false;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default validate;
|
|
@@ -5,8 +5,20 @@ import { createProject } from "./addListeners/steps/createProject.js";
|
|
|
5
5
|
import { announce } from "./addListeners/steps/announce.js";
|
|
6
6
|
|
|
7
7
|
import resolveFolderName from "./addListeners/steps/resolveFolderName.js";
|
|
8
|
+
import checks from "./addListeners/steps/checks.js";
|
|
9
|
+
|
|
10
|
+
const defaultFolderName = "AddListeners";
|
|
11
|
+
const fileNameToCheck = "runAfterDomLoad.js";
|
|
8
12
|
|
|
9
13
|
export default ({ folderName = "", toPath = process.cwd(), inAnnounce = true }) => {
|
|
14
|
+
const fromChecks = checks({
|
|
15
|
+
toPath, inAnnounce,
|
|
16
|
+
inDefaultFolderName: defaultFolderName,
|
|
17
|
+
inFileNameToCheck: fileNameToCheck
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (fromChecks) return false;
|
|
21
|
+
|
|
10
22
|
const resolvedFolderName = resolveFolderName({
|
|
11
23
|
name: folderName
|
|
12
24
|
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
const fileNameToCheck = "runAfterDomLoad.js";
|
|
4
|
+
const folderNameToCheck = "AddListeners";
|
|
5
|
+
|
|
6
|
+
const validate = ({ toPath }) => {
|
|
7
|
+
const htmlPath = path.join(toPath, fileNameToCheck);
|
|
8
|
+
const indexPath = path.join(toPath, folderNameToCheck);
|
|
9
|
+
|
|
10
|
+
if (!fs.existsSync(htmlPath)) {
|
|
11
|
+
console.log(`${fileNameToCheck} not found`);
|
|
12
|
+
|
|
13
|
+
return true;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
if (fs.existsSync(indexPath)) {
|
|
17
|
+
console.log(`${folderNameToCheck} folder found`);
|
|
18
|
+
|
|
19
|
+
return true;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return false;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default validate;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
|
|
3
|
+
export default function resolveFolderName({ name, inDefaultFolderName = "<htmlId>" }) {
|
|
4
|
+
if (name === null) {
|
|
5
|
+
name = inDefaultFolderName;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
// case 2: user provided → strict
|
|
9
|
+
if (fs.existsSync(name)) {
|
|
10
|
+
throw new Error(`Folder already exists: ${name}`);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
return name;
|
|
14
|
+
};
|
|
@@ -5,10 +5,22 @@ import { createProject } from "./htmlIdClick/steps/createProject.js";
|
|
|
5
5
|
import { announce } from "./htmlIdClick/steps/announce.js";
|
|
6
6
|
|
|
7
7
|
import resolveFolderName from "./htmlIdClick/steps/resolveFolderName.js";
|
|
8
|
+
import checks from "./addListeners/steps/checks.js";
|
|
9
|
+
|
|
10
|
+
const defaultFolderName = "htmlId";
|
|
11
|
+
const fileNameToCheck = "hookAllListeners.js";
|
|
8
12
|
|
|
9
13
|
export default ({ folderName = "", toPath = process.cwd(), inAnnounce = true }) => {
|
|
14
|
+
const fromChecks = checks({
|
|
15
|
+
toPath, inAnnounce,
|
|
16
|
+
inDefaultFolderName: defaultFolderName,
|
|
17
|
+
inFileNameToCheck: fileNameToCheck
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
if (fromChecks) return false;
|
|
21
|
+
|
|
10
22
|
const resolvedFolderName = resolveFolderName({
|
|
11
|
-
name: folderName
|
|
23
|
+
name: folderName, inDefaultFolderName: defaultFolderName
|
|
12
24
|
});
|
|
13
25
|
|
|
14
26
|
const source = locateSource();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
|
|
4
|
+
const validate = ({ toPath }) => {
|
|
5
|
+
const htmlPath = path.join(toPath, "index.html");
|
|
6
|
+
const indexPath = path.join(toPath, "index");
|
|
7
|
+
|
|
8
|
+
if (!fs.existsSync(htmlPath)) {
|
|
9
|
+
console.log("index.html not found");
|
|
10
|
+
|
|
11
|
+
return true;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
if (fs.existsSync(indexPath)) {
|
|
15
|
+
console.log("index folder found");
|
|
16
|
+
|
|
17
|
+
return true;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return false;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default validate;
|
|
@@ -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>
|