@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.
- package/README.md +21 -0
- package/dist/commands/buntest-cmd.d.ts +1 -0
- package/dist/commands/buntest-cmd.js +23 -0
- package/dist/commands/buntest-cmd.mjs +24 -0
- package/dist/commands/fetch.d.ts +1 -0
- package/dist/commands/fetch.js +46 -0
- package/dist/commands/fetch.mjs +46 -0
- package/dist/commands/gen-controller.d.ts +1 -0
- package/dist/commands/gen-controller.js +21 -0
- package/dist/commands/gen-controller.mjs +24 -0
- package/dist/commands/gen-exception.d.ts +1 -0
- package/dist/commands/gen-exception.js +23 -0
- package/dist/commands/gen-exception.mjs +26 -0
- package/dist/commands/gen-middleware.d.ts +1 -0
- package/dist/commands/gen-middleware.js +23 -0
- package/dist/commands/gen-middleware.mjs +26 -0
- package/dist/commands/gen-module.d.ts +1 -0
- package/dist/commands/gen-module.js +40 -0
- package/dist/commands/gen-module.mjs +47 -0
- package/dist/commands/gen-router.d.ts +1 -0
- package/dist/commands/gen-router.js +19 -0
- package/dist/commands/gen-router.mjs +22 -0
- package/dist/commands/gen-service.d.ts +1 -0
- package/dist/commands/gen-service.js +55 -0
- package/dist/commands/gen-service.mjs +58 -0
- package/dist/commands/registry.d.ts +26 -0
- package/dist/commands/registry.js +75 -0
- package/dist/commands/registry.mjs +51 -0
- package/dist/compose/index.d.ts +5 -0
- package/dist/compose/index.js +33 -0
- package/dist/compose/index.mjs +15 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +30 -0
- package/dist/index.mjs +10 -0
- package/dist/input-parser.d.ts +5 -0
- package/dist/input-parser.js +40 -0
- package/dist/input-parser.mjs +19 -0
- package/dist/repl.d.ts +9 -0
- package/dist/repl.js +63 -0
- package/dist/repl.mjs +45 -0
- package/dist/templates/module.d.ts +6 -0
- package/dist/templates/module.js +123 -0
- package/dist/templates/module.mjs +97 -0
- package/dist/templates/service.d.ts +1 -0
- package/dist/templates/service.js +41 -0
- package/dist/templates/service.mjs +20 -0
- package/dist/utils.d.ts +10 -0
- package/dist/utils.js +27 -0
- package/dist/utils.mjs +5 -0
- package/package.json +41 -0
- package/tsconfig.dts.json +60 -0
- 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
|
+
};
|
package/dist/utils.d.ts
ADDED
|
@@ -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
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
|
+
}
|