Skip to content

Commit cdaae90

Browse files
committed
feat(core): add default libraries to constructor
1 parent e3c968c commit cdaae90

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

packages/core/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
"taze": "taze major -w",
3232
"lint-staged": "lint-staged"
3333
},
34+
"dependencies": {
35+
"@nanoforge/asset-manager": "workspace:^",
36+
"@nanoforge/common": "workspace:^",
37+
"@nanoforge/input": "workspace:^"
38+
},
3439
"devDependencies": {
3540
"@commitlint/cli": "^19.8.0",
3641
"@commitlint/config-conventional": "^19.8.0",

packages/core/src/application/nanoforge-factory.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1+
import { AssetManagerLibrary } from "@nanoforge/asset-manager";
2+
import { InputLibrary } from "@nanoforge/input";
3+
14
import { type IApplicationOptions } from "./application-options.type";
25
import { NanoforgeClient } from "./nanoforge-client";
36
import { NanoforgeServer } from "./nanoforge-server";
47

58
class NanoforgeFactoryStatic {
69
createClient(options?: Partial<IApplicationOptions>): NanoforgeClient {
7-
return new NanoforgeClient(options);
10+
const app = new NanoforgeClient(options);
11+
app.useAssetManager(new AssetManagerLibrary());
12+
app.useInput(new InputLibrary());
13+
return app;
814
}
915

1016
createServer(options?: Partial<IApplicationOptions>): NanoforgeServer {
11-
return new NanoforgeServer(options);
17+
const app = new NanoforgeServer(options);
18+
app.useAssetManager(new AssetManagerLibrary());
19+
return app;
1220
}
1321
}
1422

packages/core/tsconfig.build.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
"references": [
1212
{
1313
"path": "../common/tsconfig.build.json"
14+
},
15+
{
16+
"path": "../asset-manager/tsconfig.build.json"
17+
},
18+
{
19+
"path": "../input/tsconfig.build.json"
1420
}
1521
]
1622
}

pnpm-lock.yaml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)