Skip to content

Commit

Permalink
Merge pull request #98 from Next2D/develop
Browse files Browse the repository at this point in the history
#88 TypeScriptでの開発環境の調整
  • Loading branch information
ienaga committed Jun 22, 2023
2 parents 12a4f36 + 3645abf commit a1c2976
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- run: npm install
- run: npm run build
- run: npm run publish
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@next2d/framework",
"description": "It is a framework dedicated to Next2D that enables scene management by URL (SPA), which has been difficult with conventional Canvas/WebGL applications, and simplifies readability and shareability by fixing the development pattern (MVVM).",
"version": "1.5.7",
"version": "1.5.8",
"homepage": "https://next2d.app",
"bugs": "https://github.com/Next2D/Framework/issues/new",
"author": "Toshiyuki Ienaga <ienaga@tvon.jp>",
Expand All @@ -13,7 +13,7 @@
],
"scripts": {
"lint": "eslint src/**/*.ts",
"build": "tsc",
"publish": "tsc",
"test": "jest",
"jsdoc": "tsc && jsdoc -c jsdoc.conf.js -r dist DOCS.md"
},
Expand Down
12 changes: 5 additions & 7 deletions src/application/Context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { packages } from "./variable/Packages";
import type { View } from "../view/View";
import type { ViewModel } from "../view/ViewModel";
import type { Sprite } from "@next2d/player/dist/player/next2d/display/Sprite";
import type { ViewImpl } from "../interface/ViewImpl";
import type { ViewModelImpl } from "../interface/ViewModelImpl";

/**
* メインコンテキスト、ViewとViewModelのunbind、bindをコントロールします。
Expand All @@ -15,8 +13,8 @@ import type { ViewModelImpl } from "../interface/ViewModelImpl";
*/
export class Context
{
private _$view: ViewImpl<any> | null;
private _$viewModel: ViewModelImpl<any> | null;
private _$view: View | null;
private _$viewModel: ViewModel | null;
private _$viewName: string;
private readonly _$root: Sprite;
private readonly _$toCamelCase: ToCamelCase;
Expand Down Expand Up @@ -86,7 +84,7 @@ export class Context
* @readonly
* @public
*/
get view (): ViewImpl<any> | null
get view (): View | null
{
return this._$view;
}
Expand All @@ -100,7 +98,7 @@ export class Context
* @readonly
* @public
*/
get viewModel (): ViewModelImpl<any> | null
get viewModel (): ViewModel | null
{
return this._$viewModel;
}
Expand Down Expand Up @@ -128,7 +126,7 @@ export class Context
* @method
* @public
*/
addChild (name: string): Promise<ViewImpl<any> | void>
addChild (name: string): Promise<View | void>
{
this._$viewName = this._$toCamelCase.execute(name);

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { response } from "./application/variable/Response";
import { loaderInfoMap } from "./application/variable/LoaderInfoMap";

// output build version
console.log("%c Next2D Framework %c 1.5.7 %c https://next2d.app",
console.log("%c Next2D Framework %c 1.5.8 %c https://next2d.app",

Check warning on line 18 in src/index.ts

View workflow job for this annotation

GitHub Actions / windows-browser-test

Unexpected console statement
"color: #fff; background: #5f5f5f",
"color: #fff; background: #4bc729",
"");
Expand Down
3 changes: 0 additions & 3 deletions src/interface/ViewImpl.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/interface/ViewModelImpl.ts

This file was deleted.

10 changes: 5 additions & 5 deletions src/view/ViewModel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ViewImpl } from "../interface/ViewImpl";
import type { View } from "./View";

/**
* ViewModelの親クラス、抽象クラスとして存在しています。
Expand All @@ -18,7 +18,7 @@ export class ViewModel
* @method
* @abstract
*/
bind (view: ViewImpl<any>): Promise<ViewImpl<any>>
bind (view: View): Promise<View>
{
return this.factory(view);
}
Expand All @@ -33,7 +33,7 @@ export class ViewModel
* @public
*/
// eslint-disable-next-line no-unused-vars,no-empty-function
unbind (view: ViewImpl<any>): void {}
unbind (view: View): void {}

/**
* @description bind関数で非同期で処理を開始する共通関数です。
Expand All @@ -44,11 +44,11 @@ export class ViewModel
* @method
* @public
*/
factory (view: ViewImpl<any>): Promise<ViewImpl<any>>
factory (view: View): Promise<View>
{
return new Promise((resolve) =>
{
requestAnimationFrame(() => {
requestAnimationFrame((): void => {
return resolve(view);
});
});
Expand Down

0 comments on commit a1c2976

Please sign in to comment.