Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 71 additions & 12 deletions packages/asset-manager/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,84 @@
# Engine Asset Manager
<div align="center">
<br />
<p>
<a href="https://github.com/NanoForge-dev"><img src="https://github.com/NanoForge-dev/blob/main/.github/logo.png" width="546" alt="NanoForge" /></a>
</p>
<br />
<p>
<a href="https://www.npmjs.com/package/@nanoforge-dev/asset-manager"><img src="https://img.shields.io/npm/v/@nanoforge-dev/asset-manager.svg?maxAge=3600" alt="npm version" /></a>
<a href="https://www.npmjs.com/package/@nanoforge-dev/asset-manager"><img src="https://img.shields.io/npm/dt/@nanoforge-dev/asset-manager.svg?maxAge=3600" alt="npm downloads" /></a>
<a href="https://github.com/NanoForge-dev/Engine/actions"><img src="https://github.com/NanoForge-dev/Engine/actions/workflows/tests.yml/badge.svg" alt="Tests status" /></a>
<a href="https://github.com/NanoForge-dev/Engine/commits/main/packages/asset-manager"><img src="https://img.shields.io/github/last-commit/NanoForge-dev/Engine.svg?logo=github&logoColor=ffffff&path=packages%2Fasset-manager" alt="Last commit." /></a>
</p>
</div>

## Installing dependencies
## About

To install dependencies run:
`@nanoforge-dev/asset-manager` is a manager for loading assets to uniform work with between client and server.

## Installation

**Node.js 24.11.0 or newer is required.**

```sh
pnpm i
npm install @nanoforge-dev/asset-manager
yarn add @nanoforge-dev/asset-manager
pnpm add @nanoforge-dev/asset-manager
bun add @nanoforge-dev/asset-manager
```

## Building
## Example usage

To build the project run:
Initialize the library in your main file

```sh
pnpm build
```ts
import { AssetManagerLibrary } from "@nanoforge-dev/asset-manager";
import { type IRunOptions } from "@nanoforge-dev/common";
import { NanoforgeFactory } from "@nanoforge-dev/core";

export async function main(options: IRunOptions) {
const app = NanoforgeFactory.createClient(); // Or NanoforgeFactory.createServer()

const assetManager = new AssetManagerLibrary();

app.useAssetManager(assetManager);

await app.init(options);

await app.run();
}
```

## Tests
Use to load assets

To run tests use:
```ts
export async function mySystem(registry: Registry, ctx: Context) {
const assetManager = ctx.libs.getAssetManager<AssetManagerLibrary>();

```sh
pnpm test
const file = assetManager.getAsset("/path/to/file.txt");
const text = await file.text();

// Do something with file or text
}
```

## Links

- [GitHub][source]
- [npm][npm]

## Contributing

Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
[documentation][documentation].
See [the contribution guide][contributing] if you'd like to submit a PR.

## Help

If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to ask questions in [discussions][discussions].

[documentation]: https://github.com/NanoForge-dev/Engine
[discussions]: https://github.com/NanoForge-dev/Engine/discussions
[source]: https://github.com/NanoForge-dev/Engine/tree/main/packages/asset-manager
[npm]: https://www.npmjs.com/package/@nanoforge-dev/asset-manager
[contributing]: https://github.com/NanoForge-dev/Engine/blob/main/.github/CONTRIBUTING.md
52 changes: 38 additions & 14 deletions packages/common/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,49 @@
# Engine Common
<div align="center">
<br />
<p>
<a href="https://github.com/NanoForge-dev"><img src="https://github.com/NanoForge-dev/blob/main/.github/logo.png" width="546" alt="NanoForge" /></a>
</p>
<br />
<p>
<a href="https://www.npmjs.com/package/@nanoforge-dev/common"><img src="https://img.shields.io/npm/v/@nanoforge-dev/common.svg?maxAge=3600" alt="npm version" /></a>
<a href="https://www.npmjs.com/package/@nanoforge-dev/common"><img src="https://img.shields.io/npm/dt/@nanoforge-dev/common.svg?maxAge=3600" alt="npm downloads" /></a>
<a href="https://github.com/NanoForge-dev/Engine/actions"><img src="https://github.com/NanoForge-dev/Engine/actions/workflows/tests.yml/badge.svg" alt="Tests status" /></a>
<a href="https://github.com/NanoForge-dev/Engine/commits/main/packages/common"><img src="https://img.shields.io/github/last-commit/NanoForge-dev/Engine.svg?logo=github&logoColor=ffffff&path=packages%2Fcommon" alt="Last commit." /></a>
</p>
</div>

## Installing dependencies
## About

To install dependencies run:
`@nanoforge-dev/common` is library with common interfaces and utilities used by Nanoforge Engine.

## Installation

**Node.js 24.11.0 or newer is required.**

```sh
pnpm i
npm install @nanoforge-dev/common
yarn add @nanoforge-dev/common
pnpm add @nanoforge-dev/common
bun add @nanoforge-dev/common
```

## Building
## Links

To build the project run:
- [GitHub][source]
- [npm][npm]

```sh
pnpm build
```
## Contributing

## Tests
Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
[documentation][documentation].
See [the contribution guide][contributing] if you'd like to submit a PR.

To run tests use:
## Help

```sh
pnpm test
```
If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to ask questions in [discussions][discussions].

[documentation]: https://github.com/NanoForge-dev/Engine
[discussions]: https://github.com/NanoForge-dev/Engine/discussions
[source]: https://github.com/NanoForge-dev/Engine/tree/main/packages/common
[npm]: https://www.npmjs.com/package/@nanoforge-dev/common
[contributing]: https://github.com/NanoForge-dev/Engine/blob/main/.github/CONTRIBUTING.md
133 changes: 121 additions & 12 deletions packages/config/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,134 @@
# Engine Config
<div align="center">
<br />
<p>
<a href="https://github.com/NanoForge-dev"><img src="https://github.com/NanoForge-dev/blob/main/.github/logo.png" width="546" alt="NanoForge" /></a>
</p>
<br />
<p>
<a href="https://www.npmjs.com/package/@nanoforge-dev/config"><img src="https://img.shields.io/npm/v/@nanoforge-dev/config.svg?maxAge=3600" alt="npm version" /></a>
<a href="https://www.npmjs.com/package/@nanoforge-dev/config"><img src="https://img.shields.io/npm/dt/@nanoforge-dev/config.svg?maxAge=3600" alt="npm downloads" /></a>
<a href="https://github.com/NanoForge-dev/Engine/actions"><img src="https://github.com/NanoForge-dev/Engine/actions/workflows/tests.yml/badge.svg" alt="Tests status" /></a>
<a href="https://github.com/NanoForge-dev/Engine/commits/main/packages/config"><img src="https://img.shields.io/github/last-commit/NanoForge-dev/Engine.svg?logo=github&logoColor=ffffff&path=packages%2Fconfig" alt="Last commit." /></a>
</p>
</div>

## Installing dependencies
## About

To install dependencies run:
`@nanoforge-dev/config` is a wrapper of [class-validator][class-validator] and [class-transformer][class-transformer] to imports validation and transformation decorators.

## Installation

**Node.js 24.11.0 or newer is required.**

```sh
pnpm i
npm install @nanoforge-dev/config
yarn add @nanoforge-dev/config
pnpm add @nanoforge-dev/config
bun add @nanoforge-dev/config
```

## Building
## Warning

To build the project run:
This library is of exclusive usage for other libraries. To put variables in the environment to allow libraries to use it through this config library, you must put it in factory options :

```sh
pnpm build
```ts
import { type IRunOptions } from "@nanoforge-dev/common";
import { NanoforgeFactory } from "@nanoforge-dev/core";
import { NetworkLibrary } from "@nanoforge-dev/network";

export async function main(options: IRunOptions) {
const app = NanoforgeFactory.createClient({
environment: {
serverTcpPort: "4445",
serverUdpPort: "4444",
serverAddress: "127.0.0.1",
},
});

const network = new NetworkLibrary();

app.useNetwork(network);

await app.init(options);

await app.run();
}
```

## Tests
## Example usage

To run tests use:
Initialize the library in your main file.

```sh
pnpm test
```ts
export class NetworkClientLibrary extends BaseNetworkLibrary {
get __name(): string {
return "NetworkClientLibrary";
}

public override async __init(context: InitContext): Promise<void> {
const config = await context.config.registerConfig(ClientConfigNetwork);

// Do something with config
}
}
```

Using this config

```ts
import {
Default,
Expose,
IsByteLength,
IsIpOrFQDN,
IsOptional,
IsPort,
} from "@nanoforge-dev/config";

export class ClientConfigNetwork {
// This var must be a string port (ex: "4444") but can be undefined
@Expose()
@IsOptional()
@IsPort()
serverTcpPort?: string;

@Expose()
@IsOptional()
@IsPort()
serverUdpPort?: string;

// This var must be ip address or fqdn (it cannot be undefined)
@Expose()
@IsIpOrFQDN()
serverAddress?: string;

// This var must be a byte length between 2 and 64. It can be undefined as it as a default value.
@Expose()
@Default("PACKET_END")
@IsByteLength(2, 64)
magicValue!: string;
}
```

## Links

- [GitHub][source]
- [npm][npm]

## Contributing

Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
[documentation][documentation].
See [the contribution guide][contributing] if you'd like to submit a PR.

## Help

If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to ask questions in [discussions][discussions].

[documentation]: https://github.com/NanoForge-dev/Engine
[discussions]: https://github.com/NanoForge-dev/Engine/discussions
[source]: https://github.com/NanoForge-dev/Engine/tree/main/packages/config
[npm]: https://www.npmjs.com/package/@nanoforge-dev/config
[contributing]: https://github.com/NanoForge-dev/Engine/blob/main/.github/CONTRIBUTING.md
[class-validator]: https://github.com/typestack/class-validator
[class-transformer]: https://github.com/typestack/class-transformer
67 changes: 54 additions & 13 deletions packages/core/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,66 @@
# Engine Core
<div align="center">
<br />
<p>
<a href="https://github.com/NanoForge-dev"><img src="https://github.com/NanoForge-dev/blob/main/.github/logo.png" width="546" alt="NanoForge" /></a>
</p>
<br />
<p>
<a href="https://www.npmjs.com/package/@nanoforge-dev/core"><img src="https://img.shields.io/npm/v/@nanoforge-dev/core.svg?maxAge=3600" alt="npm version" /></a>
<a href="https://www.npmjs.com/package/@nanoforge-dev/core"><img src="https://img.shields.io/npm/dt/@nanoforge-dev/core.svg?maxAge=3600" alt="npm downloads" /></a>
<a href="https://github.com/NanoForge-dev/Engine/actions"><img src="https://github.com/NanoForge-dev/Engine/actions/workflows/tests.yml/badge.svg" alt="Tests status" /></a>
<a href="https://github.com/NanoForge-dev/Engine/commits/main/packages/core"><img src="https://img.shields.io/github/last-commit/NanoForge-dev/Engine.svg?logo=github&logoColor=ffffff&path=packages%2Fcore" alt="Last commit." /></a>
</p>
</div>

## Installing dependencies
## About

To install dependencies run:
`@nanoforge-dev/core` is a core package that contains game main loop. It is used to initialize the game and run it.

## Installation

**Node.js 24.11.0 or newer is required.**

```sh
pnpm i
npm install @nanoforge-dev/core
yarn add @nanoforge-dev/core
pnpm add @nanoforge-dev/core
bun add @nanoforge-dev/core
```

## Building
## Example usage

To build the project run:
Initialize the game in your main file.

```sh
pnpm build
```
```ts
import { type IRunOptions } from "@nanoforge-dev/common";
import { NanoforgeFactory } from "@nanoforge-dev/core";

## Tests
export async function main(options: IRunClientOptions) {
const app = NanoforgeFactory.createClient();

To run tests use:
await app.init(options);

```sh
pnpm test
await app.run();
}
```

## Links

- [GitHub][source]
- [npm][npm]

## Contributing

Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
[documentation][documentation].
See [the contribution guide][contributing] if you'd like to submit a PR.

## Help

If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to ask questions in [discussions][discussions].

[documentation]: https://github.com/NanoForge-dev/Engine
[discussions]: https://github.com/NanoForge-dev/Engine/discussions
[source]: https://github.com/NanoForge-dev/Engine/tree/main/packages/core
[npm]: https://www.npmjs.com/package/@nanoforge-dev/core
[contributing]: https://github.com/NanoForge-dev/Engine/blob/main/.github/CONTRIBUTING.md
Loading
Loading