calabasas 0.0.1 → 0.0.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/dist/config.d.ts +38 -0
- package/dist/config.js +7 -0
- package/dist/index.js +0 -31
- package/package.json +11 -4
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Type definitions for calabasas
|
|
2
|
+
// Project: https://calabasas.dev
|
|
3
|
+
|
|
4
|
+
export type SyncConfig = {
|
|
5
|
+
guilds?: boolean;
|
|
6
|
+
channels?: boolean;
|
|
7
|
+
roles?: boolean;
|
|
8
|
+
members?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type EventConfig = {
|
|
12
|
+
[eventType: string]: true | string[];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type CalabasasConfig = {
|
|
16
|
+
sync?: SyncConfig;
|
|
17
|
+
events?: EventConfig;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Define your Calabasas configuration.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { defineCalabasas } from "calabasas";
|
|
26
|
+
*
|
|
27
|
+
* export default defineCalabasas({
|
|
28
|
+
* sync: {
|
|
29
|
+
* guilds: true,
|
|
30
|
+
* channels: true,
|
|
31
|
+
* },
|
|
32
|
+
* events: {
|
|
33
|
+
* messageCreate: ["id", "content", "author"],
|
|
34
|
+
* },
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export function defineCalabasas(config: CalabasasConfig): CalabasasConfig;
|
package/dist/config.js
ADDED
package/dist/index.js
CHANGED
|
@@ -2781,28 +2781,6 @@ export default defineCalabasas({
|
|
|
2781
2781
|
},
|
|
2782
2782
|
});
|
|
2783
2783
|
`;
|
|
2784
|
-
var DEFINE_CALABASAS_TEMPLATE = `// Type definitions for calabasas.config.ts
|
|
2785
|
-
|
|
2786
|
-
export type SyncConfig = {
|
|
2787
|
-
guilds?: boolean;
|
|
2788
|
-
channels?: boolean;
|
|
2789
|
-
roles?: boolean;
|
|
2790
|
-
members?: boolean;
|
|
2791
|
-
};
|
|
2792
|
-
|
|
2793
|
-
export type EventConfig = {
|
|
2794
|
-
[eventType: string]: true | string[];
|
|
2795
|
-
};
|
|
2796
|
-
|
|
2797
|
-
export type CalabasasConfig = {
|
|
2798
|
-
sync?: SyncConfig;
|
|
2799
|
-
events?: EventConfig;
|
|
2800
|
-
};
|
|
2801
|
-
|
|
2802
|
-
export function defineCalabasas(config: CalabasasConfig): CalabasasConfig {
|
|
2803
|
-
return config;
|
|
2804
|
-
}
|
|
2805
|
-
`;
|
|
2806
2784
|
async function init() {
|
|
2807
2785
|
const convexDir = path3.resolve(process.cwd(), "convex");
|
|
2808
2786
|
const configPath = path3.join(convexDir, "calabasas.config.ts");
|
|
@@ -2822,15 +2800,6 @@ async function init() {
|
|
|
2822
2800
|
}
|
|
2823
2801
|
fs7.writeFileSync(configPath, CONFIG_TEMPLATE);
|
|
2824
2802
|
console.log("Created convex/calabasas.config.ts");
|
|
2825
|
-
const typesDir = path3.join(convexDir, "lib");
|
|
2826
|
-
const typesPath = path3.join(typesDir, "calabasas.ts");
|
|
2827
|
-
if (!fs7.existsSync(typesDir)) {
|
|
2828
|
-
fs7.mkdirSync(typesDir, { recursive: true });
|
|
2829
|
-
}
|
|
2830
|
-
if (!fs7.existsSync(typesPath)) {
|
|
2831
|
-
fs7.writeFileSync(typesPath, DEFINE_CALABASAS_TEMPLATE);
|
|
2832
|
-
console.log("Created convex/lib/calabasas.ts");
|
|
2833
|
-
}
|
|
2834
2803
|
console.log("");
|
|
2835
2804
|
console.log("Next steps:");
|
|
2836
2805
|
console.log("1. Edit convex/calabasas.config.ts to configure sync and events");
|
package/package.json
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "calabasas",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "CLI for Calabasas - Discord Gateway as a Service for Convex",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"calabasas": "dist/index.js"
|
|
8
8
|
},
|
|
9
|
-
"main": "./dist/
|
|
9
|
+
"main": "./dist/config.js",
|
|
10
|
+
"module": "./dist/config.js",
|
|
11
|
+
"types": "./dist/config.d.ts",
|
|
10
12
|
"exports": {
|
|
11
|
-
".":
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/config.d.ts",
|
|
15
|
+
"import": "./dist/config.js"
|
|
16
|
+
}
|
|
12
17
|
},
|
|
13
18
|
"scripts": {
|
|
14
|
-
"build": "bun build
|
|
19
|
+
"build": "bun run build:cli && bun run build:lib",
|
|
20
|
+
"build:cli": "bun build src/index.ts --outdir dist --target node",
|
|
21
|
+
"build:lib": "bun build src/config.ts --outfile dist/config.js --target node --format esm && cp src/config.d.ts dist/config.d.ts",
|
|
15
22
|
"typecheck": "tsc --noEmit",
|
|
16
23
|
"prepublishOnly": "bun run build"
|
|
17
24
|
},
|