Skip to content

Commit

Permalink
Make some changes required for types to work on NPM
Browse files Browse the repository at this point in the history
  • Loading branch information
NotNite committed Dec 6, 2023
1 parent b519226 commit 7b4c169
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async function buildExt(ext, side, copyManifest, fileExt) {
];

const wpModulesDir = `packages/core-extensions/src/${ext}/webpackModules`;
if (fs.existsSync(wpModulesDir)) {
if (fs.existsSync(wpModulesDir) && side === "index") {
const wpModules = fs.readdirSync(wpModulesDir);
for (const wpModule of wpModules) {
entryPoints.push(
Expand Down
3 changes: 2 additions & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"exports": {
".": "./src/index.ts",
"./import": "./src/import.d.ts",
"./*": "./src/*.ts"
"./*": "./src/*.ts",
"./coreExtensions": "./src/coreExtensions.ts"
},
"dependencies": {
"@types/flux": "^3.1.12",
Expand Down
16 changes: 8 additions & 8 deletions packages/types/src/import.d.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
declare module "@moonlight-mod/wp/spacepack_spacepack" {
import { Spacepack } from "@moonlight-mod/types/coreExtensions";
export const spacepack: Spacepack;
import { CoreExtensions } from "@moonlight-mod/types";
export const spacepack: CoreExtensions.Spacepack;
export default spacepack;
}

declare module "@moonlight-mod/wp/common_components" {
import { CommonComponents } from "@moonlight-mod/types/coreExtensions";
const components: CommonComponents;
import { CoreExtensions } from "@moonlight-mod/types";
const components: CoreExtensions.CommonComponents;
export default components;
}

declare module "@moonlight-mod/wp/common_flux" {
import { CommonFlux } from "@moonlight-mod/types/coreExtensions";
const Flux: CommonFlux;
import { CoreExtensions } from "@moonlight-mod/types";
const Flux: CoreExtensions.CommonFlux;
export default Flux;
}

declare module "@moonlight-mod/wp/common_fluxDispatcher" {
import { CommonFluxDispatcher } from "@moonlight-mod/types/coreExtensions";
const Dispatcher: CommonFluxDispatcher;
import { CoreExtensions } from "@moonlight-mod/types";
const Dispatcher: CoreExtensions.CommonFluxDispatcher;
export default Dispatcher;
}
1 change: 1 addition & 0 deletions packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
export * from "./discord";
export * from "./config";
export * from "./extension";
export * as CoreExtensions from "./coreExtensions";
export * from "./globals";
export * from "./logger";
export * as constants from "./constants";
Expand Down

0 comments on commit 7b4c169

Please sign in to comment.