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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,5 @@ dist

# NX
.nx/
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md
2 changes: 1 addition & 1 deletion .husky/commit-msg
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bun --no-install commitlint --edit "$1"
pnpm --no-install commitlint --edit "$1"
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion .husky/pre-push
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pnpm nx run-many --target=lint,test:unit
pnpm lerna run lint,test:unit
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ pnpm-lock.yaml
package-lock.json
yarn.lock
bun.lock

/.nx/cache
/.nx/workspace-data
2 changes: 1 addition & 1 deletion example/pong/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ Allow you to build project and copy it to the loader, and then run the loader (C

```shell
./run.sh Loader
```
```
1,842 changes: 1,811 additions & 31 deletions example/pong/bun.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion example/pong/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ import globals from "globals";
import tseslint from "typescript-eslint";

export default [
{ files: ["src/**/*.{js,mjs,cjs,ts}"] },
{
files: ["src/**/*.{ts}"],
},
{ languageOptions: { globals: globals.node } },

pluginJs.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.strict,
eslintConfigPrettier,
{ ignores: ["**/*.js"] },
{
rules: {
"@typescript-eslint/consistent-type-imports": [
Expand Down
24 changes: 15 additions & 9 deletions example/pong/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,28 @@
"typescript": "^5"
},
"optionalDependencies": {
"@nanoforge/common": "latest",
"@nanoforge/core": "latest",
"@nanoforge/asset-manager": "latest",
"@nanoforge/ecs": "latest",
"@nanoforge/graphics-2d": "latest",
"@nanoforge/sound": "latest"
"@nanoforge/common": "workspace:^",
"@nanoforge/core": "workspace:^",
"@nanoforge/asset-manager": "workspace:^",
"@nanoforge/config": "workspace:^",
"@nanoforge/ecs": "workspace:^",
"@nanoforge/graphics-2d": "workspace:^",
"@nanoforge/sound": "workspace:^"
},
"engines": {
"node": "23.6.0",
"bun": "1.2.4"
"bun": "1.2.23"
},
"packageManager": "[email protected].4",
"packageManager": "[email protected].23",
"lint-staged": {
"**/*.{js,ts,html,css}": [
"eslint --fix",
"prettier --write"
]
}
},
"workspaces": [
".",
"../../packages/*",
"../../libs/*"
]
}
3 changes: 1 addition & 2 deletions example/pong/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"paths": {
}
"paths": {}
}
}
7 changes: 0 additions & 7 deletions example/pong/update.sh

This file was deleted.

2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"cache": true
}
}
}
}
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,29 @@
"tslib": "^2.8.1"
},
"devDependencies": {
"@commitlint/cli": "^19.8.0",
"@commitlint/config-conventional": "^19.8.0",
"@eslint/js": "^9.23.0",
"@commitlint/cli": "^20.0.0",
"@commitlint/config-conventional": "^20.0.0",
"@eslint/js": "^9.36.0",
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/node": "^22.13.13",
"eslint": "^9.23.0",
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-format": "^1.0.1",
"eslint-plugin-prettier": "^5.2.5",
"globals": "^16.0.0",
"@types/node": "^22.18.7",
"eslint": "^9.36.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-format": "^1.0.2",
"eslint-plugin-prettier": "^5.5.4",
"globals": "^16.4.0",
"husky": "^9.1.7",
"lerna": "^8.2.1",
"lint-staged": "^15.5.0",
"prettier": "^3.5.3",
"taze": "^19.0.2",
"typescript": "^5.8.2",
"typescript-eslint": "^8.28.0"
"lerna": "^8.2.4",
"lint-staged": "^16.2.3",
"prettier": "^3.6.2",
"taze": "^19.7.0",
"typescript": "^5.9.2",
"typescript-eslint": "^8.45.0"
},
"engines": {
"node": "23.6.0",
"pnpm": "10.6.5"
"pnpm": "10.17.1"
},
"packageManager": "pnpm@10.6.5",
"packageManager": "pnpm@10.17.1",
"lint-staged": {
"**/*.{js,ts}": [
"eslint --fix",
Expand Down
40 changes: 20 additions & 20 deletions packages/asset-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,31 @@
"@nanoforge/common": "workspace:^"
},
"devDependencies": {
"@commitlint/cli": "^19.8.0",
"@commitlint/config-conventional": "^19.8.0",
"@eslint/js": "^9.23.0",
"@commitlint/cli": "^20.0.0",
"@commitlint/config-conventional": "^20.0.0",
"@eslint/js": "^9.36.0",
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/jest": "^29.5.14",
"@types/node": "^22.13.13",
"eslint": "^9.23.0",
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-format": "^1.0.1",
"eslint-plugin-jest": "^28.11.0",
"eslint-plugin-prettier": "^5.2.5",
"globals": "^16.0.0",
"jest": "^29.7.0",
"lint-staged": "^15.5.0",
"prettier": "^3.5.3",
"taze": "^19.0.2",
"ts-jest": "^29.3.0",
"typescript": "^5.8.2",
"typescript-eslint": "^8.28.0"
"@types/jest": "^30.0.0",
"@types/node": "^22.18.7",
"eslint": "^9.36.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-format": "^1.0.2",
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-prettier": "^5.5.4",
"globals": "^16.4.0",
"jest": "^30.2.0",
"lint-staged": "^16.2.3",
"prettier": "^3.6.2",
"taze": "^19.7.0",
"ts-jest": "^29.4.4",
"typescript": "^5.9.2",
"typescript-eslint": "^8.45.0"
},
"engines": {
"node": "23.6.0",
"pnpm": "10.6.5"
"pnpm": "10.17.1"
},
"packageManager": "pnpm@10.6.5",
"packageManager": "pnpm@10.17.1",
"lint-staged": {
"**/*.{js,ts}": [
"eslint --fix",
Expand Down
10 changes: 8 additions & 2 deletions packages/asset-manager/test/asset-manager.library.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { ApplicationContext, InitContext, LibraryManager } from "@nanoforge/common";
import {
ApplicationContext,
type IConfigRegistry,
InitContext,
LibraryManager,
} from "@nanoforge/common";

import { AssetManagerLibrary } from "../src";

describe("Asset Manager Library", () => {
const library = new AssetManagerLibrary();
const appContext = new ApplicationContext();
const libraryManager = new LibraryManager();
const context = new InitContext(appContext, libraryManager, {
const configRegistry = {} as IConfigRegistry;
const context = new InitContext(appContext, libraryManager, configRegistry, {
// @ts-ignore
canvas: null,
files: {
Expand Down
28 changes: 14 additions & 14 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@
"lint-staged": "lint-staged"
},
"devDependencies": {
"@commitlint/cli": "^19.8.0",
"@commitlint/config-conventional": "^19.8.0",
"@eslint/js": "^9.23.0",
"@commitlint/cli": "^20.0.0",
"@commitlint/config-conventional": "^20.0.0",
"@eslint/js": "^9.36.0",
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
"eslint": "^9.23.0",
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-format": "^1.0.1",
"eslint-plugin-prettier": "^5.2.5",
"globals": "^16.0.0",
"lint-staged": "^15.5.0",
"prettier": "^3.5.3",
"taze": "^19.0.2",
"typescript-eslint": "^8.28.0"
"eslint": "^9.36.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-format": "^1.0.2",
"eslint-plugin-prettier": "^5.5.4",
"globals": "^16.4.0",
"lint-staged": "^16.2.3",
"prettier": "^3.6.2",
"taze": "^19.7.0",
"typescript-eslint": "^8.45.0"
},
"engines": {
"node": "23.6.0",
"pnpm": "10.6.5"
"pnpm": "10.17.1"
},
"packageManager": "pnpm@10.6.5",
"packageManager": "pnpm@10.17.1",
"lint-staged": {
"**/*.{js,ts}": [
"eslint --fix",
Expand Down
15 changes: 13 additions & 2 deletions packages/common/src/context/contexts/executions/init.context.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
import { type LibraryManager } from "../../../library";
import { type IConfigRegistry, type LibraryManager } from "../../../library";
import { type IRunOptions } from "../../../options";
import { type ApplicationContext } from "../application.context";
import { BaseContext } from "./base.context";

export class InitContext extends BaseContext {
private readonly _canvas: IRunOptions["canvas"];
private readonly _files: IRunOptions["files"];
private readonly _config: IConfigRegistry;

constructor(context: ApplicationContext, libraryManager: LibraryManager, options: IRunOptions) {
constructor(
context: ApplicationContext,
libraryManager: LibraryManager,
configRegistry: IConfigRegistry,
options: IRunOptions,
) {
super(context, libraryManager);

this._canvas = options.canvas;
this._files = options.files;
this._config = configRegistry;
}

get canvas(): IRunOptions["canvas"] {
Expand All @@ -21,4 +28,8 @@ export class InitContext extends BaseContext {
get files(): IRunOptions["files"] {
return this._files;
}

get config(): IConfigRegistry {
return this._config;
}
}
1 change: 1 addition & 0 deletions packages/common/src/library/config/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./interfaces/config-registry.type";
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface IConfigRegistry {
registerConfig<T extends object>(config: new () => T): Promise<T | never>;
}
1 change: 1 addition & 0 deletions packages/common/src/library/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./config";
export * from "./libraries";
export * from "./manager";
Loading
Loading