json-crud-ui-components 1.1.1

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.
Files changed (52) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +225 -0
  3. package/bin/cli.js +12 -0
  4. package/bin/core/getLatestVersion.js +13 -0
  5. package/bin/core/loadRunner.js +9 -0
  6. package/bin/v1/commands/addListeners/steps/announce.js +3 -0
  7. package/bin/v1/commands/addListeners/steps/createProject.js +7 -0
  8. package/bin/v1/commands/addListeners/steps/locateDestination.js +5 -0
  9. package/bin/v1/commands/addListeners/steps/locateSource.js +32 -0
  10. package/bin/v1/commands/addListeners/steps/resolveFolderName.js +17 -0
  11. package/bin/v1/commands/addListeners/template/v1/AddListeners/start.js +14 -0
  12. package/bin/v1/commands/addListeners/template/v2/start.js +4 -0
  13. package/bin/v1/commands/addListeners.js +20 -0
  14. package/bin/v1/commands/htmlIdClick/steps/announce.js +3 -0
  15. package/bin/v1/commands/htmlIdClick/steps/createProject.js +7 -0
  16. package/bin/v1/commands/htmlIdClick/steps/locateDestination.js +5 -0
  17. package/bin/v1/commands/htmlIdClick/steps/locateSource.js +32 -0
  18. package/bin/v1/commands/htmlIdClick/steps/resolveFolderName.js +17 -0
  19. package/bin/v1/commands/htmlIdClick/template/v1/clickFunc.js +4 -0
  20. package/bin/v1/commands/htmlIdClick/template/v1/start.js +9 -0
  21. package/bin/v1/commands/htmlIdClick.js +20 -0
  22. package/bin/v1/commands/init/steps/announce.js +3 -0
  23. package/bin/v1/commands/init/steps/createProject.js +7 -0
  24. package/bin/v1/commands/init/steps/locateDestination.js +5 -0
  25. package/bin/v1/commands/init/steps/locateSource.js +32 -0
  26. package/bin/v1/commands/init/steps/resolveFolderName.js +17 -0
  27. package/bin/v1/commands/init/template/v1/Index/FormLoad/DomContentLoaded/buildHeader.js +68 -0
  28. package/bin/v1/commands/init/template/v1/Index/FormLoad/DomContentLoaded/buildMenuItem.js +121 -0
  29. package/bin/v1/commands/init/template/v1/Index/FormLoad/DomContentLoaded/runAfterDomLoad.js +7 -0
  30. package/bin/v1/commands/init/template/v1/Index/FormLoad/DomContentLoaded/start.js +7 -0
  31. package/bin/v1/commands/init/template/v1/Index/FormLoad/start.js +5 -0
  32. package/bin/v1/commands/init/template/v1/Index/start.js +7 -0
  33. package/bin/v1/commands/init/template/v2/FormLoad/DomContentLoaded/buildHeader.js +68 -0
  34. package/bin/v1/commands/init/template/v2/FormLoad/DomContentLoaded/buildMenuItem.js +121 -0
  35. package/bin/v1/commands/init/template/v2/FormLoad/DomContentLoaded/runAfterDomLoad.js +7 -0
  36. package/bin/v1/commands/init/template/v2/FormLoad/DomContentLoaded/start.js +7 -0
  37. package/bin/v1/commands/init/template/v2/FormLoad/start.js +5 -0
  38. package/bin/v1/commands/init/template/v2/start.js +7 -0
  39. package/bin/v1/commands/init/template/v3/FormLoad/DomContentLoaded/buildHeader.js +58 -0
  40. package/bin/v1/commands/init/template/v3/FormLoad/DomContentLoaded/buildMenuItem.js +121 -0
  41. package/bin/v1/commands/init/template/v3/FormLoad/DomContentLoaded/runAfterDomLoad.js +7 -0
  42. package/bin/v1/commands/init/template/v3/FormLoad/DomContentLoaded/start.js +7 -0
  43. package/bin/v1/commands/init/template/v3/FormLoad/start.js +5 -0
  44. package/bin/v1/commands/init/template/v3/headers.json +45 -0
  45. package/bin/v1/commands/init/template/v3/start.js +7 -0
  46. package/bin/v1/commands/init.js +22 -0
  47. package/bin/v1/core/parseInput.js +9 -0
  48. package/bin/v1/core/resolveCommand.js +14 -0
  49. package/bin/v1/core/showUsage.js +39 -0
  50. package/bin/v1/start.js +25 -0
  51. package/index.js +5 -0
  52. package/package.json +35 -0
@@ -0,0 +1,14 @@
1
+ import init from "../commands/init.js";
2
+ import addListeners from "../commands/addListeners.js";
3
+ import htmlIdClick from "../commands/htmlIdClick.js";
4
+
5
+ // resolveCommand.js
6
+ const map = {
7
+ init,
8
+ addListeners,
9
+ htmlIdClick
10
+ };
11
+
12
+ export default function resolveCommand(cmd) {
13
+ return map[cmd] || null;
14
+ };
@@ -0,0 +1,39 @@
1
+ /*
2
+ KSchema CLI – Entry Flow
3
+
4
+ 1. Read user input from terminal (parseInput)
5
+ 2. If no command → show usage (first-time user safety)
6
+ 3. If help flags → show usage (quick guidance)
7
+ 4. Resolve command dynamically (no hardcoding logic)
8
+ 5. If command not found → inform + guide back to usage
9
+ 6. Execute command with parsed input
10
+
11
+ Goal:
12
+ - Zero confusion for user
13
+ - Single source of truth (showUsage)
14
+ - Easy to extend (just add commands, no core changes)
15
+ */
16
+
17
+ export default function showUsage(version) {
18
+ const g = "\x1b[32m";
19
+ const y = "\x1b[33m";
20
+ const c = "\x1b[36m";
21
+ const gray = "\x1b[90m";
22
+ const r = "\x1b[0m";
23
+
24
+ console.log(`
25
+ ${c}🚀 json-crud-ui v${version}${r}
26
+
27
+ ${y}Usage:${r}
28
+ ${g}npx @keshavsoft/kschema-api-gen${r} <command> [options]
29
+
30
+ ${y}Commands:${r}
31
+ ${g}endPointsJs${r} Checks for end-points.js file in that location
32
+
33
+ ${y}Examples:${r}
34
+ ${gray}npx @keshavsoft/kschema-api-gen endPointsJs ShowAll${r}
35
+
36
+ ${y}Tip:${r}
37
+ ${gray}npm i -g @keshavsoft/kschema-api-gen${r}
38
+ `);
39
+ }
@@ -0,0 +1,25 @@
1
+ import parseInput from "./core/parseInput.js";
2
+ import showUsage from './core/showUsage.js';
3
+
4
+ import resolveCommand from "./core/resolveCommand.js";
5
+
6
+ import pkg from '../../package.json' with { type: 'json' };
7
+
8
+ const version = pkg.version;
9
+
10
+ const run = async () => {
11
+ const input = parseInput();
12
+
13
+ if (input.action === "--help" || input.action === "-h" || input.action === "help") return showUsage(version);
14
+ console.log("input : ", input);
15
+
16
+ const command = resolveCommand(input.cmd);
17
+
18
+ if (!command) return (console.log(`Unknown command: ${input.cmd}\n`), showUsage(version));
19
+
20
+ await command({
21
+ folderName: input.folderName
22
+ });
23
+ };
24
+
25
+ export default run;
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import getLatestVersion from "./bin/core/getLatestVersion.js";
2
+
3
+ const v = getLatestVersion();
4
+
5
+ export default (await import(`./bin/${v}/tasks/actions/EndPointsJs/index.js`)).default;
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "json-crud-ui-components",
3
+ "version": "1.1.1",
4
+ "description": "working on ui for our json crud using modules",
5
+ "keywords": [
6
+ "cli",
7
+ "scaffold",
8
+ "templates",
9
+ "node",
10
+ "project-generator"
11
+ ],
12
+ "dependencies": {
13
+ },
14
+ "type": "module",
15
+ "exports": {
16
+ ".": "./index.js"
17
+ },
18
+ "bin": {
19
+ "json-crud-ui-components": "./bin/cli.js"
20
+ },
21
+ "files": [
22
+ "bin/",
23
+ "index.js",
24
+ "README.md",
25
+ "LICENSE"
26
+ ],
27
+ "homepage": "https://cli.keshavsoft.com",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/keshavsoft/json-crud-ui-components"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/keshavsoft/json-crud-ui-components/issues"
34
+ }
35
+ }