Skip to content

Commit

Permalink
feat(core): http-only wrapper (#9281)
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl authored Apr 1, 2023
1 parent 9d69bba commit 11e682c
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 4 deletions.
14 changes: 11 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@
"module": "./dist/index.mjs",
"typings": "./dist/index.d.ts",
"exports": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./http-only": {
"import": "./dist/http-only.mjs",
"require": "./dist/http-only.js",
"types": "./dist/http-only.d.ts"
}
},
"directories": {
"lib": "src",
Expand Down Expand Up @@ -59,6 +66,7 @@
"@types/node": "16.18.23",
"@vitest/coverage-c8": "^0.29.8",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.1.0",
"eslint": "^8.37.0",
"eslint-config-neon": "^0.1.41",
"eslint-formatter-pretty": "^5.0.0",
Expand Down
11 changes: 11 additions & 0 deletions packages/core/src/http-only/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export * from '../api/index.js';
export * from '../util/index.js';

export * from 'discord-api-types/v10';

/**
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/core/#readme | @discordjs/core} version
* that you are currently using.
*/
// This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild
export const version = '[VI]{{inject}}[/VI]' as string;
7 changes: 7 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,10 @@ export * from './client.js';
export * from './util/index.js';

export * from 'discord-api-types/v10';

/**
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/core/#readme | @discordjs/core} version
* that you are currently using.
*/
// This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild
export const version = '[VI]{{inject}}[/VI]' as string;
9 changes: 8 additions & 1 deletion packages/core/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import { esbuildPluginVersionInjector } from 'esbuild-plugin-version-injector';
import { createTsupConfig } from '../../tsup.config.js';

export default createTsupConfig({});
export default createTsupConfig({
entry: {
index: 'src/index.ts',
'http-only': 'src/http-only/index.ts',
},
esbuildPlugins: [esbuildPluginVersionInjector()],
});
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2007,6 +2007,7 @@ __metadata:
"@vladfrangu/async_event_emitter": ^2.1.4
cross-env: ^7.0.3
discord-api-types: ^0.37.37
esbuild-plugin-version-injector: ^1.1.0
eslint: ^8.37.0
eslint-config-neon: ^0.1.41
eslint-formatter-pretty: ^5.0.0
Expand Down

0 comments on commit 11e682c

Please sign in to comment.