@vimcord/plugin-dotenv 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 +22 -0
- package/dist/index.cjs +58 -0
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +30 -0
- package/package.json +20 -0
- package/src/index.ts +29 -0
- package/tsconfig.json +10 -0
- package/tsup.config.ts +11 -0
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
██╗ ██╗██╗███╗ ███╗ ██████╗ ██████╗ ██████╗ ██████╗
|
|
5
|
+
██║ ██║██║████╗ ████║██╔════╝██╔═══██╗██╔══██╗██╔══██╗
|
|
6
|
+
██║ ██║██║██╔████╔██║██║ ██║ ██║██████╔╝██║ ██║
|
|
7
|
+
╚██╗ ██╔╝██║██║╚██╔╝██║██║ ██║ ██║██╔══██╗██║ ██║
|
|
8
|
+
╚████╔╝ ██║██║ ╚═╝ ██║╚██████╗╚██████╔╝██║ ██║██████╔╝
|
|
9
|
+
╚═══╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
**vhem-cord** — the Discord.js framework that actually respects your time
|
|
13
|
+
|
|
14
|
+
[](https://www.npmjs.com/package/vimcord)
|
|
15
|
+
[](https://www.npmjs.com/package/vimcord)
|
|
16
|
+
[](https://www.typescriptlang.org/)
|
|
17
|
+
[](LICENSE)
|
|
18
|
+
[](https://discord.js.org/)
|
|
19
|
+
|
|
20
|
+
[Installation](#installation) · [Quick Start](#quick-start) · [Features](#features) · [API](#api-reference) · [Examples](#examples)
|
|
21
|
+
|
|
22
|
+
</div>
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
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: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
DotEnvPlugin: () => DotEnvPlugin,
|
|
24
|
+
PLUGIN_DESCRIPTION: () => PLUGIN_DESCRIPTION,
|
|
25
|
+
PLUGIN_NAME: () => PLUGIN_NAME,
|
|
26
|
+
PLUGIN_VERSION: () => PLUGIN_VERSION
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(index_exports);
|
|
29
|
+
var import_dotenv = require("dotenv");
|
|
30
|
+
var import_core = require("@vimcord/core");
|
|
31
|
+
var PLUGIN_NAME = "dotenv";
|
|
32
|
+
var PLUGIN_DESCRIPTION = "Configures dotEnv to inject environment variables.";
|
|
33
|
+
var PLUGIN_VERSION = "0.1.0";
|
|
34
|
+
var DotEnvPlugin = class extends import_core.VimcordPlugin {
|
|
35
|
+
constructor(config) {
|
|
36
|
+
super();
|
|
37
|
+
this.config = config;
|
|
38
|
+
}
|
|
39
|
+
config;
|
|
40
|
+
name = PLUGIN_NAME;
|
|
41
|
+
description = PLUGIN_DESCRIPTION;
|
|
42
|
+
version = PLUGIN_VERSION;
|
|
43
|
+
install(client) {
|
|
44
|
+
(0, import_dotenv.configDotenv)({ quiet: true, ...this.config });
|
|
45
|
+
client.logger.plugin.success("dotenv", "Environment variables injected");
|
|
46
|
+
this.installed = true;
|
|
47
|
+
}
|
|
48
|
+
uninstall() {
|
|
49
|
+
this.installed = false;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
DotEnvPlugin,
|
|
55
|
+
PLUGIN_DESCRIPTION,
|
|
56
|
+
PLUGIN_NAME,
|
|
57
|
+
PLUGIN_VERSION
|
|
58
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DotenvConfigOptions } from 'dotenv';
|
|
2
|
+
import { VimcordPlugin, Vimcord } from '@vimcord/core';
|
|
3
|
+
|
|
4
|
+
declare const PLUGIN_NAME = "dotenv";
|
|
5
|
+
declare const PLUGIN_DESCRIPTION = "Configures dotEnv to inject environment variables.";
|
|
6
|
+
declare const PLUGIN_VERSION = "0.1.0";
|
|
7
|
+
declare class DotEnvPlugin extends VimcordPlugin {
|
|
8
|
+
private config?;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
version: string;
|
|
12
|
+
constructor(config?: DotenvConfigOptions | undefined);
|
|
13
|
+
install(client: Vimcord): void;
|
|
14
|
+
uninstall(): void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { DotEnvPlugin, PLUGIN_DESCRIPTION, PLUGIN_NAME, PLUGIN_VERSION };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DotenvConfigOptions } from 'dotenv';
|
|
2
|
+
import { VimcordPlugin, Vimcord } from '@vimcord/core';
|
|
3
|
+
|
|
4
|
+
declare const PLUGIN_NAME = "dotenv";
|
|
5
|
+
declare const PLUGIN_DESCRIPTION = "Configures dotEnv to inject environment variables.";
|
|
6
|
+
declare const PLUGIN_VERSION = "0.1.0";
|
|
7
|
+
declare class DotEnvPlugin extends VimcordPlugin {
|
|
8
|
+
private config?;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
version: string;
|
|
12
|
+
constructor(config?: DotenvConfigOptions | undefined);
|
|
13
|
+
install(client: Vimcord): void;
|
|
14
|
+
uninstall(): void;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { DotEnvPlugin, PLUGIN_DESCRIPTION, PLUGIN_NAME, PLUGIN_VERSION };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { configDotenv } from "dotenv";
|
|
3
|
+
import { VimcordPlugin } from "@vimcord/core";
|
|
4
|
+
var PLUGIN_NAME = "dotenv";
|
|
5
|
+
var PLUGIN_DESCRIPTION = "Configures dotEnv to inject environment variables.";
|
|
6
|
+
var PLUGIN_VERSION = "0.1.0";
|
|
7
|
+
var DotEnvPlugin = class extends VimcordPlugin {
|
|
8
|
+
constructor(config) {
|
|
9
|
+
super();
|
|
10
|
+
this.config = config;
|
|
11
|
+
}
|
|
12
|
+
config;
|
|
13
|
+
name = PLUGIN_NAME;
|
|
14
|
+
description = PLUGIN_DESCRIPTION;
|
|
15
|
+
version = PLUGIN_VERSION;
|
|
16
|
+
install(client) {
|
|
17
|
+
configDotenv({ quiet: true, ...this.config });
|
|
18
|
+
client.logger.plugin.success("dotenv", "Environment variables injected");
|
|
19
|
+
this.installed = true;
|
|
20
|
+
}
|
|
21
|
+
uninstall() {
|
|
22
|
+
this.installed = false;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
DotEnvPlugin,
|
|
27
|
+
PLUGIN_DESCRIPTION,
|
|
28
|
+
PLUGIN_NAME,
|
|
29
|
+
PLUGIN_VERSION
|
|
30
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vimcord/plugin-dotenv",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"author": "xsqu1znt",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "dist/index.cjs",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.js",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"dotenv": "^17.4.2",
|
|
13
|
+
"@vimcord/core": "0.1.0"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsup",
|
|
17
|
+
"check": "tsc --noEmit",
|
|
18
|
+
"format": "prettier --write \"./**/*.{ts,json}\""
|
|
19
|
+
}
|
|
20
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { DotenvConfigOptions } from "dotenv";
|
|
2
|
+
|
|
3
|
+
import { configDotenv } from "dotenv";
|
|
4
|
+
import { Vimcord, VimcordPlugin } from "@vimcord/core";
|
|
5
|
+
|
|
6
|
+
export const PLUGIN_NAME = "dotenv";
|
|
7
|
+
export const PLUGIN_DESCRIPTION = "Configures dotEnv to inject environment variables.";
|
|
8
|
+
export const PLUGIN_VERSION = "0.1.0";
|
|
9
|
+
|
|
10
|
+
export class DotEnvPlugin extends VimcordPlugin {
|
|
11
|
+
override name = PLUGIN_NAME;
|
|
12
|
+
override description = PLUGIN_DESCRIPTION;
|
|
13
|
+
override version = PLUGIN_VERSION;
|
|
14
|
+
|
|
15
|
+
constructor(private config?: DotenvConfigOptions) {
|
|
16
|
+
super();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
override install(client: Vimcord): void {
|
|
20
|
+
configDotenv({ quiet: true, ...this.config });
|
|
21
|
+
client.logger.plugin.success("dotenv", "Environment variables injected");
|
|
22
|
+
this.installed = true;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override uninstall(): void {
|
|
26
|
+
// noop
|
|
27
|
+
this.installed = false;
|
|
28
|
+
}
|
|
29
|
+
}
|
package/tsconfig.json
ADDED