Skip to content

Commit

Permalink
3.1 was a fricking nightmare
Browse files Browse the repository at this point in the history
Signed-off-by: RedGuy12 <[email protected]>
  • Loading branch information
cobaltt7 committed Dec 19, 2023
1 parent aee16fa commit 82acee9
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 59 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.vscode
dist/
node_modules/
package-lock.json
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ This guide references the following imported values in inline code blocks:
```js
import {
ApplicationCommandType,
type ApplicationCommandOptionType
type AutocompleteInteraction,
type Awaitable,
Expand All @@ -377,10 +378,8 @@ import {
type RepliableInteraction,
type Snowflake,
type SelectMenuType,
ApplicationCommandType,
} from "discord.js";
import {
type ClientEvent,
defineButton,
defineChatCommand,
defineSubcommands,
Expand All @@ -389,6 +388,7 @@ import {
defineEvent,
defineModal,
defineSelect,
type ClientEvent,
} from "strife.js";
import path from "node:path";
import url from "node:url";
Expand Down
17 changes: 7 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
{
"name": "strife.js",
"version": "3.1.3",
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js",
"default": "./dist/esm/index.js"
}
},
"version": "4.0.0",
"type": "module",
"main": "./dist/index.js",
"files": [
"dist",
"src",
Expand All @@ -17,11 +11,14 @@
"LICENSE"
],
"scripts": {
"build": "rm -rf dist && tsc --build tsconfig.cjs.json tsconfig.esm.json tsconfig.types.json && echo {\"type\":\"module\"} > ./dist/esm/package.json",
"build": "rm -rf dist && tsc --build tsconfig.json",
"dev": "npm run build && tsc --project tsconfig.esm.json --watch",
"format": "prettier --write \"**\" \"!dist/**\" --ignore-unknown"
},
"prettier": "@redguy12/prettier-config",
"dependencies": {
"tslib": "2.6.2"
},
"devDependencies": {
"@redguy12/prettier-config": "2.0.2",
"@types/node": "<=18.11.1",
Expand Down
5 changes: 1 addition & 4 deletions src/definition/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ export function transformOptions(

if (option.choices)
transformed.choices = Object.entries(option.choices)
.map(([choice, value]) => ({
name: choice,
value, // todo: oops
}))
.map(([value, name]) => ({ value, name }))
.sort((one, two) => one.name.localeCompare(two.name));

transformed.channelTypes = option.channelTypes ?? [
Expand Down
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { login } from "./client.js";
export default login;

export * from "./client.js";
export * from "./definition/commands/index.js";
export * from "./definition/commands.js";
export * from "./definition/components.js";
export * from "./definition/events.js";
export * from "./client.js";
export * from "./util.js";
2 changes: 1 addition & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type CacheType } from "discord.js";
import type { CacheType } from "discord.js";

export type CacheReducer<InGuild extends boolean> = InGuild extends true
? "cached" | "raw"
Expand Down
10 changes: 0 additions & 10 deletions tsconfig.cjs.json

This file was deleted.

10 changes: 0 additions & 10 deletions tsconfig.esm.json

This file was deleted.

17 changes: 9 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
{
"compilerOptions": {
"allowJs": true,
"baseUrl": "./",
"checkJs": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"baseUrl": "./",
"checkJs": true,
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "preserve",
"lib": ["ESNext", "DOM"],
"maxNodeModuleJsDepth": 0,
"importHelpers": true,
"module": "NodeNext",
"noEmitOnError": true,
"noErrorTruncation": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "dist",
"resolveJsonModule": true,
"sourceMap": true,
"strict": true,
"stripInternal": true
"target": "es2021", "verbatimModuleSyntax": true
},
"exclude": ["node_modules", ".git", "dist"],
"typeAcquisition": { "enable": true }
Expand Down
12 changes: 0 additions & 12 deletions tsconfig.types.json

This file was deleted.

0 comments on commit 82acee9

Please sign in to comment.