nuxt-discord 0.0.9 → 0.0.10

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/module.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
+ import * as __runtime_logger from '../dist/runtime/logger.js';
2
3
  import * as _nuxt_kit from '@nuxt/kit';
3
4
  import * as nuxt_schema from 'nuxt/schema';
4
5
  import { DiscordClient } from '/Users/jeffz/Dev/nuxt-discord/dist/runtime/server/utils/client.js';
@@ -6,12 +7,6 @@ import { IntegerOption, NumberOption, StringOption } from '../dist/runtime/serve
6
7
  import { ClientOptions, ApplicationCommandOptionType, ChatInputCommandInteraction } from 'discord.js';
7
8
  import { ListenOptions } from 'listhen';
8
9
 
9
- declare const logger: {
10
- log: (...args: unknown[]) => void;
11
- warn: (...args: unknown[]) => void;
12
- error: (...args: unknown[]) => void;
13
- };
14
-
15
10
  interface NuxtDiscordOptions {
16
11
  /**
17
12
  * Options passed to the internal Discord client.
@@ -133,7 +128,7 @@ interface NuxtDiscordContext {
133
128
  root: _nuxt_kit.Resolver['resolve'];
134
129
  module: _nuxt_kit.Resolver['resolve'];
135
130
  };
136
- logger: typeof logger;
131
+ logger: typeof __runtime_logger.logger;
137
132
  }
138
133
 
139
134
  declare const _default: _nuxt_schema.NuxtModule<NuxtDiscordOptions, NuxtDiscordOptions, false>;
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-discord",
3
3
  "configKey": "discord",
4
- "version": "0.0.9",
4
+ "version": "0.0.10",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
7
7
  "unbuild": "3.5.0"
package/dist/module.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createResolver, installModule, extendPages, updateTemplates, addVitePlugin, isIgnored, addServerTemplate, addTemplate, addTypeTemplate, defineNuxtModule, addServerScanDir, addImports } from '@nuxt/kit';
2
2
  import { ApplicationCommandOptionType, GatewayIntentBits } from 'discord.js';
3
- import ansis from 'ansis';
3
+ import { logger } from '../dist/runtime/logger.js';
4
4
  import { globSync, readFileSync, existsSync, mkdirSync, writeFileSync } from 'node:fs';
5
5
  import path from 'node:path';
6
6
  import ts from 'typescript';
@@ -11,13 +11,6 @@ import { WebSocketServer } from 'ws';
11
11
  import defu from 'defu';
12
12
  import { genSafeVariableName, genImport, genArrayFromRaw, genString } from 'knitwork';
13
13
 
14
- const logger = {
15
- // eslint-disable-next-line no-console
16
- log: (...args) => console.log(ansis.hex("#5865F2").bold("[Discord]"), ...args),
17
- warn: (...args) => console.warn(ansis.yellow.bold("[Discord]"), ...args),
18
- error: (...args) => console.error(ansis.red.bold("[Discord]"), ...args)
19
- };
20
-
21
14
  function createContext(options, nuxt) {
22
15
  return {
23
16
  nuxt,
@@ -0,0 +1,5 @@
1
+ export declare const logger: {
2
+ log: (...args: unknown[]) => void;
3
+ warn: (...args: unknown[]) => void;
4
+ error: (...args: unknown[]) => void;
5
+ };
@@ -0,0 +1,7 @@
1
+ import ansis from "ansis";
2
+ export const logger = {
3
+ // eslint-disable-next-line no-console
4
+ log: (...args) => console.log(ansis.hex("#5865F2").bold("[Discord]"), ...args),
5
+ warn: (...args) => console.warn(ansis.yellow.bold("[Discord]"), ...args),
6
+ error: (...args) => console.error(ansis.red.bold("[Discord]"), ...args)
7
+ };
@@ -1,7 +1,7 @@
1
1
  import fs from "node:fs";
2
2
  import slashCommands from "discord/slashCommands";
3
3
  import { defineNitroPlugin, useRuntimeConfig } from "nitropack/runtime";
4
- import { logger } from "../../../logger";
4
+ import { logger } from "../../logger.js";
5
5
  import { DiscordClient } from "../utils/client.js";
6
6
  export default defineNitroPlugin(async (nitro) => {
7
7
  const runtimeConfig = useRuntimeConfig();
@@ -1,7 +1,7 @@
1
1
  import process from "node:process";
2
2
  import { ApplicationCommandOptionType, Events, Client as InternalClient, REST, Routes, SlashCommandBuilder } from "discord.js";
3
3
  import { useNitroApp } from "nitropack/runtime";
4
- import { logger } from "../../../logger";
4
+ import { logger } from "../../logger.js";
5
5
  let currentInteraction = null;
6
6
  export function useInteraction() {
7
7
  return currentInteraction;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-discord",
3
3
  "type": "module",
4
- "version": "0.0.9",
4
+ "version": "0.0.10",
5
5
  "description": "A Nuxt module for building Discord bots",
6
6
  "author": "Jize Zou <jeffzou2001@gmail.com> (https://github.com/zojize)",
7
7
  "license": "MIT",