make dependencies.d.ts a txt file

This commit is contained in:
Jacob Nguyen
2023-06-10 09:44:00 -05:00
parent e94a2be41f
commit 28f9390865
6 changed files with 18 additions and 42 deletions

View File

@@ -1,3 +1,9 @@
/**
* This file serves as intellisense for sern projects.
* Types are declared here for dependencies to function properly
* Service(s) api rely on this file to provide a better developer experience.
*/
import { SernEmitter, Logging, CoreModuleStore, ModuleManager, ErrorHandling, CoreDependencies, Singleton } from '@sern/handler'
import { Client } from 'discord.js'

View File

@@ -73,11 +73,11 @@ async function runInteractive() {
};
console.log(greenBright(`overwrite: ${argv.overwrite ?? false};\ncopy: ${selectedTemplate} ${root}`));
await copyFolderRecursiveAsync(selectedTemplate , root);
console.log(greenBright('Writing sern.config.json to '+ result.name + "/sern.config.json"));
await fs.promises.writeFile(path.join(root, 'sern.config.json'), JSON.stringify(configJson), 'utf8');
console.log(greenBright('Writing dependencies.d.ts to '+ name));
await Promise.all([
fs.promises.writeFile(path.join(root, 'sern.config.json'), JSON.stringify(configJson), 'utf8'),
fs.promises.writeFile(path.join(root, 'src', 'dependencies.d.ts'), await fs.promises.readFile(path.join(cwd, 'dependencies.d.txt')), 'utf8')
]);
console.log(greenBright('Done! visit https://sern.dev for documentation and join https://sern.dev/discord! Happy hacking :)' ));
}
@@ -107,9 +107,12 @@ async function runShort(templateName: string, name:string) {
console.log(greenBright(`overwrite: ${argv.overwrite ?? false};\ncopy: ${selectedTemplate} ${root}`));
await copyFolderRecursiveAsync(selectedTemplate , root);
console.log(greenBright('Writing sern.config.json to '+ name + "/sern.config.json"));
await fs.promises.writeFile(path.join(root, 'sern.config.json'), JSON.stringify(configJson), 'utf8');
console.log(greenBright('Writing dependencies.d.ts to '+ name));
await Promise.all([
fs.promises.writeFile(path.join(root, 'sern.config.json'), JSON.stringify(configJson), 'utf8'),
fs.promises.writeFile(path.join(root, 'src', 'dependencies.d.ts'), await fs.promises.readFile(path.join(cwd, 'dependencies.d.txt')), 'utf8')
]);
console.log(greenBright('Done! visit https://sern.dev for documentation and join https://sern.dev/discord! Happy hacking :)' ));
}
async function init() {

View File

@@ -1,11 +0,0 @@
import { SernEmitter, Logging, CoreModuleStore, ModuleManager, ErrorHandling, CoreDependencies, Singleton } from '@sern/handler'
import { Client } from 'discord.js'
declare global {
interface Dependencies extends CoreDependencies {
'@sern/client': Singleton<Client>
}
}
export {}

View File

@@ -1,5 +1,5 @@
const { Client, GatewayIntentBits } = require('discord.js');
const { Sern, single, DefaultLogging } = require('@sern/handler');
const { Sern, single } = require('@sern/handler');
const client = new Client({
intents: [

View File

@@ -1,11 +0,0 @@
import { SernEmitter, Logging, CoreModuleStore, ModuleManager, ErrorHandling, CoreDependencies, Singleton } from '@sern/handler'
import { Client } from 'discord.js'
declare global {
interface Dependencies extends CoreDependencies {
'@sern/client': Singleton<Client>
}
}
export {}

View File

@@ -1,11 +0,0 @@
import { SernEmitter, Logging, CoreModuleStore, ModuleManager, ErrorHandling, CoreDependencies, Singleton } from '@sern/handler'
import { Client } from 'discord.js'
declare global {
interface Dependencies extends CoreDependencies {
'@sern/client': Singleton<Client>
}
}
export {}