Skip to content

Commit

Permalink
refactor: moved v7 to aoijs folder (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
USERSATOSHI committed Jun 8, 2024
1 parent 0637011 commit 783e1dc
Show file tree
Hide file tree
Showing 839 changed files with 14,668 additions and 25,749 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ plugins
.vscode
.DS_Store
/dist
ignore
ignore
/lib/**/index.js
25 changes: 22 additions & 3 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,34 @@ const compat = new FlatCompat({
export default [
// jsdoc.configs['flat/recommended'],
{ files: ['**/*.js'], languageOptions: { sourceType: 'commonjs' } },

...compat.extends('xo-typescript'),
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
...tseslint.configs.stylisticTypeChecked,
{
// enable object curly spacing
rules: {
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
'@typescript-eslint/consistent-type-definitions': [
'error',
'interface',
],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variable',
format: ['camelCase'],
leadingUnderscore: 'allow',
},
{
selector: 'classProperty',
format: [''],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{ selector: 'parameter', format: ['camelCase'] },
{ selector: 'typeLike', format: ['PascalCase'] },
],
},
},
{
Expand All @@ -45,8 +65,7 @@ export default [
tsdoc,
},
rules: {
// eslint-disable-next-line @typescript-eslint/naming-convention
'tsdoc/syntax': 'warn',
'tsdoc/syntax': 'error',
},
},
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
46 changes: 0 additions & 46 deletions lib/aoi.js/dev/package.json

This file was deleted.

21 changes: 0 additions & 21 deletions lib/aoi.js/dev/src/index.ts

This file was deleted.

71 changes: 71 additions & 0 deletions lib/aoi.js/generators/readme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require( "fs" );

const file = process.cwd() + "/src/functions";

const dirs = fs.readdirSync( file, { withFileTypes: true } ).filter( x => x.isDirectory() ).map( x => x.name );

const folders = {};
for ( const dir of dirs )
{
const subdirs = fs.readdirSync( file + "/" + dir, { withFileTypes: true } ).filter( x => x.isDirectory() ).map( x => x.name );
const obj = {};
for ( const subdir of subdirs )
{
const files = fs.readdirSync( file + "/" + dir + "/" + subdir, { withFileTypes: true } ).filter( x => x.isFile() && x.name.startsWith( ( "$" ) ) ).map( x => x.name.split( "." )[ 0 ] );
if( files.length)
obj[ subdir ] = files;
}
folders[ dir ] = obj;
}
console.log( folders );

const readme = `# Functions
## Directory Structure
\`\`\`mermaid
graph RL;
${ Object.keys( folders ).map( x => `${ x } --> Functions` ).join( ";\n" )};
${ Object.keys( folders ).map( x => Object.keys( folders[ x ] ).map( y => `${ y } --> ${ x }` ).join( ";\n" ) ).join( ";\n" )};
\`\`\`
## Divisions
${ Object.keys( folders ).map( x => ` - \`${ x }\`: Contains functions related to ${ x }` ).join( "\n" )}
`;

fs.writeFileSync( file + "/README.md", readme );

const DiscordReadme = `# Discord
## Directory Structure
\`\`\`mermaid
graph RL;
${ Object.keys( folders[ "discord" ] ).map( x => folders[ "discord" ][ x ].map( y => `${ y } --> ${ x }` ).join( ";\n" ) ).join( ";\n" ) };
\`\`\`
## Divisions
${ Object.keys( folders[ "discord" ] ).map( x => ` - \`${ x }\`: Contains functions related to ${ x }` ).join( "\n" )}
`;

fs.writeFileSync( file + "/discord/README.md", DiscordReadme );

const JsReadme = `# JavaScript
## Directory Structure
\`\`\`mermaid
graph RL;
${ Object.keys( folders[ "js" ] ).map( x => folders[ "js" ][ x ].map( y => `${ y } --> ${ x }` ).join( ";\n" ) ).join( ";\n" ) };
\`\`\`
## Divisions
${ Object.keys( folders[ "js" ] ).map( x => ` - \`${ x }\`: Contains functions related to ${ x }` ).join( "\n" )};
`;

fs.writeFileSync( file + "/js/README.md", JsReadme );
93 changes: 93 additions & 0 deletions lib/aoi.js/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"name": "aoi.js",
"version": "7.0.0-dev",
"description": "A next generation package to create Discord Bots with built-in string functions.",
"main": "./dist/cjs/index.js",
"exports": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},
"browser": "./browser/index.js",
"scripts": {
"test": "node tests",
"start": "node index.js",
"build": "npx tsc -p tsconfig.esm.json && npx tsc -p tsconfig.cjs.json && npm run createpack",
"build:utils": "npx tsc -p tsconfig.utils.json && node ./utils/.interals/addpkgjson.js",
"createpack": "node src/pack.js",
"lint": "eslint . --ext .ts --fix ",
"buildStart": "npm run build && npm start",
"genmd": "node generators/readme.js",
"docgen": " npx typedoc --plugin typedoc-theme-hierarchy --plugin typedoc-plugin-mermaid --plugin typedoc-plugin-extras --footerLastModified --customCss ./packers/custom.css"
},
"contributors": [
"leref",
"USERSATOSHI"
],
"license": "Apache-2.0",
"licenses": [
{
"type": "Apache-2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0"
}
],
"repository": {
"type": "git",
"url": "git+https://github.com/AkaruiDevelopment/aoi.js.git"
},
"devDependencies": {
"@eslint/eslintrc": "^3.0.2",
"@eslint/js": "^9.0.0",
"@types/js-beautify": "^1.14.3",
"@types/node": "^20.10.3",
"@types/uglify-js": "^3.17.1",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"csso": "^5.0.5",
"eslint": "^8.57.0",
"eslint-config-xo-typescript": "^4.0.0",
"globals": "^15.0.0",
"js-beautify": "^1.14.11",
"typedoc": "^0.25.4",
"typedoc-github-wiki-theme": "^1.1.0",
"typedoc-plugin-extras": "^3.0.0",
"typedoc-plugin-markdown": "^3.17.1",
"typedoc-plugin-mermaid": "^1.10.0",
"typedoc-theme-hierarchy": "^4.1.2",
"typescript": "^5.4.4",
"typescript-eslint": "^7.5.0",
"uglify-js": "^3.17.4"
},
"type": "commonjs",
"keywords": [
"aoi.js",
"aoi.js-next",
"aoijs",
"aoi",
"typescript",
"api",
"bot",
"discord",
"discordbot"
],
"engines": {
"node": ">=18.x"
},
"dependencies": {
"@akarui/structures": "^2.0.1",
"boxen": "^7.1.1",
"chalk": "^5.3.0",
"cli-spinners": "^2.9.2",
"dotenv": "^16.3.1",
"ora": "^7.0.1",
"undici": "^5.28.2",
"ws": "^8.14.2",
"zeneth": "^0.0.1"
},
"files": [
"dist",
"README.md",
"LICENSE",
"package.json"
]
}
Loading

0 comments on commit 783e1dc

Please sign in to comment.