@gaman/kame 0.1.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.
Files changed (52) hide show
  1. package/README.md +21 -0
  2. package/dist/commands/buntest-cmd.d.ts +1 -0
  3. package/dist/commands/buntest-cmd.js +23 -0
  4. package/dist/commands/buntest-cmd.mjs +24 -0
  5. package/dist/commands/fetch.d.ts +1 -0
  6. package/dist/commands/fetch.js +46 -0
  7. package/dist/commands/fetch.mjs +46 -0
  8. package/dist/commands/gen-controller.d.ts +1 -0
  9. package/dist/commands/gen-controller.js +21 -0
  10. package/dist/commands/gen-controller.mjs +24 -0
  11. package/dist/commands/gen-exception.d.ts +1 -0
  12. package/dist/commands/gen-exception.js +23 -0
  13. package/dist/commands/gen-exception.mjs +26 -0
  14. package/dist/commands/gen-middleware.d.ts +1 -0
  15. package/dist/commands/gen-middleware.js +23 -0
  16. package/dist/commands/gen-middleware.mjs +26 -0
  17. package/dist/commands/gen-module.d.ts +1 -0
  18. package/dist/commands/gen-module.js +40 -0
  19. package/dist/commands/gen-module.mjs +47 -0
  20. package/dist/commands/gen-router.d.ts +1 -0
  21. package/dist/commands/gen-router.js +19 -0
  22. package/dist/commands/gen-router.mjs +22 -0
  23. package/dist/commands/gen-service.d.ts +1 -0
  24. package/dist/commands/gen-service.js +55 -0
  25. package/dist/commands/gen-service.mjs +58 -0
  26. package/dist/commands/registry.d.ts +26 -0
  27. package/dist/commands/registry.js +75 -0
  28. package/dist/commands/registry.mjs +51 -0
  29. package/dist/compose/index.d.ts +5 -0
  30. package/dist/compose/index.js +33 -0
  31. package/dist/compose/index.mjs +15 -0
  32. package/dist/index.d.ts +3 -0
  33. package/dist/index.js +30 -0
  34. package/dist/index.mjs +10 -0
  35. package/dist/input-parser.d.ts +5 -0
  36. package/dist/input-parser.js +40 -0
  37. package/dist/input-parser.mjs +19 -0
  38. package/dist/repl.d.ts +9 -0
  39. package/dist/repl.js +63 -0
  40. package/dist/repl.mjs +45 -0
  41. package/dist/templates/module.d.ts +6 -0
  42. package/dist/templates/module.js +123 -0
  43. package/dist/templates/module.mjs +97 -0
  44. package/dist/templates/service.d.ts +1 -0
  45. package/dist/templates/service.js +41 -0
  46. package/dist/templates/service.mjs +20 -0
  47. package/dist/utils.d.ts +10 -0
  48. package/dist/utils.js +27 -0
  49. package/dist/utils.mjs +5 -0
  50. package/package.json +41 -0
  51. package/tsconfig.dts.json +60 -0
  52. package/tsconfig.json +8 -0
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
+ var service_exports = {};
17
+ __export(service_exports, {
18
+ standaloneServiceTemplate: () => standaloneServiceTemplate
19
+ });
20
+ module.exports = __toCommonJS(service_exports);
21
+ var import_utils = require('../utils.js');
22
+ const standaloneServiceTemplate = (name) => {
23
+ const nameCapitalized = (0, import_utils.capitalize)(name);
24
+ return `
25
+ import { composeService } from './../compose/index.ts';
26
+ import type { RT } from './../types.ts';
27
+
28
+ export const ${nameCapitalized}Service = composeService(() => {
29
+
30
+ // TODO: Implement ${nameCapitalized}Service logic here
31
+
32
+ return {};
33
+ });
34
+
35
+ export type ${nameCapitalized}Service = RT<typeof ${nameCapitalized}Service>;
36
+ `.trim();
37
+ };
38
+ // Annotate the CommonJS export names for ESM import in node:
39
+ 0 && (module.exports = {
40
+ standaloneServiceTemplate
41
+ });
@@ -0,0 +1,20 @@
1
+ import { capitalize } from "../utils.mjs";
2
+ const standaloneServiceTemplate = (name) => {
3
+ const nameCapitalized = capitalize(name);
4
+ return `
5
+ import { composeService } from 'gaman/compose';
6
+ import type { RT } from 'gaman/types';
7
+
8
+ export const ${nameCapitalized}Service = composeService(() => {
9
+
10
+ // TODO: Implement ${nameCapitalized}Service logic here
11
+
12
+ return {};
13
+ });
14
+
15
+ export type ${nameCapitalized}Service = RT<typeof ${nameCapitalized}Service>;
16
+ `.trim();
17
+ };
18
+ export {
19
+ standaloneServiceTemplate
20
+ };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Mengubah karakter pertama menjadi huruf besar
3
+ * Contoh: userCreator -> UserCreator
4
+ */
5
+ export declare const capitalize: (str: string) => string;
6
+ /**
7
+ * Mengubah karakter pertama menjadi huruf kecil
8
+ * Contoh: UserProfile -> userProfile
9
+ */
10
+ export declare const toCamelCase: (str: string) => string;
package/dist/utils.js ADDED
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: !0 });
9
+ }, __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from == "object" || typeof from == "function")
11
+ for (let key of __getOwnPropNames(from))
12
+ !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ return to;
14
+ };
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
+ var utils_exports = {};
17
+ __export(utils_exports, {
18
+ capitalize: () => capitalize,
19
+ toCamelCase: () => toCamelCase
20
+ });
21
+ module.exports = __toCommonJS(utils_exports);
22
+ const capitalize = (str) => str && str.charAt(0).toUpperCase() + str.slice(1), toCamelCase = (str) => str && str.charAt(0).toLowerCase() + str.slice(1);
23
+ // Annotate the CommonJS export names for ESM import in node:
24
+ 0 && (module.exports = {
25
+ capitalize,
26
+ toCamelCase
27
+ });
package/dist/utils.mjs ADDED
@@ -0,0 +1,5 @@
1
+ const capitalize = (str) => str && str.charAt(0).toUpperCase() + str.slice(1), toCamelCase = (str) => str && str.charAt(0).toLowerCase() + str.slice(1);
2
+ export {
3
+ capitalize,
4
+ toCamelCase
5
+ };
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@gaman/kame",
3
+ "version": "0.1.0",
4
+ "author": "angga7togk",
5
+ "license": "MIT",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "require": "./dist/index.js",
11
+ "import": "./dist/index.mjs"
12
+ },
13
+ "./compose": {
14
+ "types": "./dist/compose/index.d.ts",
15
+ "require": "./dist/compose/index.js",
16
+ "import": "./dist/compose/index.mjs"
17
+ }
18
+ },
19
+ "keywords": [
20
+ "gamanjs",
21
+ "gaman",
22
+ "gaman cli",
23
+ "kame",
24
+ "cli",
25
+ "repl",
26
+ "bun"
27
+ ],
28
+ "repository": {
29
+ "url": "git+https://github.com/7TogkID/gaman.git",
30
+ "directory": "packages/kame"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/7TogkID/gaman/issues"
34
+ },
35
+ "homepage": "https://gaman.7togk.id",
36
+ "publishConfig": {
37
+ "access": "public",
38
+ "registry": "https://registry.npmjs.org"
39
+ },
40
+ "gitHead": "8d1bf3bbac4b72847e9157e2c95d75b5e90c89cf"
41
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "compilerOptions": {
3
+ "preserveSymlinks": true,
4
+ "target": "ES2021",
5
+ "lib": [
6
+ "ESNext"
7
+ ],
8
+ "module": "ES2022",
9
+ "rootDir": "./src",
10
+ "outDir": "./dist",
11
+
12
+ "moduleResolution": "node",
13
+ "resolveJsonModule": true,
14
+ "skipLibCheck": true,
15
+ "declaration": true,
16
+ "emitDeclarationOnly": true,
17
+ "baseUrl": ".",
18
+ "paths": {
19
+ "gaman": [
20
+ "../../dist/index.d.ts"
21
+ ],
22
+ "gaman/types": [
23
+ "../../dist/types.d.ts"
24
+ ],
25
+ "gaman/responder": [
26
+ "../../dist/responder.d.ts"
27
+ ],
28
+ "gaman/compose": [
29
+ "../../dist/compose/index.d.ts"
30
+ ],
31
+ "gaman/utils": [
32
+ "../../dist/utils/index.d.ts"
33
+ ],
34
+ "gaman/formdata": [
35
+ "../../dist/context/formdata/index.d.ts"
36
+ ],
37
+ "gaman/header": [
38
+ "../../dist/context/header/index.d.ts"
39
+ ],
40
+ "gaman/enums": [
41
+ "../../dist/enums/index.d.ts"
42
+ ]
43
+ }
44
+ },
45
+ "include": [
46
+ "src/**/*"
47
+ ],
48
+ "exclude": [
49
+ "node_modules",
50
+ "test",
51
+ "example",
52
+ "dist",
53
+ "build.ts",
54
+ "old",
55
+ "src-test",
56
+ "**/*.test.*",
57
+ "benchmark",
58
+ "**/*.benchmark.*"
59
+ ]
60
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "./dist"
5
+ },
6
+ "include": ["src/**/*"],
7
+ "exclude": ["node_modules", "dist"]
8
+ }