From 4314f07a384a4b5d1452376d8a7315f4c7de34c8 Mon Sep 17 00:00:00 2001 From: ienaga Date: Mon, 13 Nov 2023 09:16:14 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB?= =?UTF-8?q?=E3=83=88=E3=81=AE=E3=83=88=E3=83=83=E3=83=97=E3=83=9A=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=82=92config=E3=81=A7=E8=A8=AD=E5=AE=9A=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++--- src/domain/parser/QueryParser.ts | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 9ee13d3..3da6ec1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@next2d/framework", "description": "Next2D Framework is designed according to the principles of clean architecture, domain-driven development, test-driven development, and MVVM, with an emphasis on flexibility, scalability, and maintainability, and a design methodology that keeps each layer loosely coupled.", - "version": "2.0.1", + "version": "2.0.2", "homepage": "https://next2d.app", "bugs": "https://github.com/Next2D/Framework/issues/new", "author": "Toshiyuki Ienaga (https://github.com/ienaga/)", @@ -27,8 +27,8 @@ }, "devDependencies": { "@next2d/player": "*", - "@typescript-eslint/eslint-plugin": "^6.9.1", - "@typescript-eslint/parser": "^6.9.1", + "@typescript-eslint/eslint-plugin": "^6.10.0", + "@typescript-eslint/parser": "^6.10.0", "eslint": "^8.53.0", "jsdom": "^22.1.0", "typescript": "^5.2.2", diff --git a/src/domain/parser/QueryParser.ts b/src/domain/parser/QueryParser.ts index 5158ae2..636881e 100644 --- a/src/domain/parser/QueryParser.ts +++ b/src/domain/parser/QueryParser.ts @@ -36,6 +36,7 @@ export const execute = (name: string = ""): QueryObjectImpl => } } + const defaultTop: string = config.defaultTop || "top"; if (!name) { const names: string[] = location.pathname.split("/"); names.shift(); @@ -43,16 +44,16 @@ export const execute = (name: string = ""): QueryObjectImpl => if (name && config && config.routing) { const routing: RoutingImpl = config.routing[name]; if (!routing) { - name = "top"; + name = defaultTop; } if (routing && routing.private) { - name = routing.redirect || "top"; + name = routing.redirect || defaultTop; } } if (!name) { - name = "top"; + name = defaultTop; } } @@ -75,7 +76,7 @@ export const execute = (name: string = ""): QueryObjectImpl => } if (name.slice(0, 1) === ".") { - name = name.split("/").slice(1).join("/") || "top"; + name = name.split("/").slice(1).join("/") || defaultTop; } if (name.indexOf("@") > -1) { From 22d8b6cc17346ed6cd3486a9eda8fe8307dd0f73 Mon Sep 17 00:00:00 2001 From: ienaga Date: Mon, 13 Nov 2023 09:47:55 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E3=83=A6=E3=83=8B=E3=83=83=E3=83=88?= =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=81=A8Lint=E3=82=92=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/lint.yml | 4 ++-- .npmignore | 2 +- src/domain/parser/QueryParser.ts | 2 +- src/interface/ConfigImpl.ts | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6740176..af26ed5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - run: npm install - - run: npm run lint + - run: npx eslint ./src/**/*.ts windows-browser-test: runs-on: windows-latest @@ -25,4 +25,4 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - run: npm install - - run: npm run lint \ No newline at end of file + - run: npx eslint ./src/**/*.ts \ No newline at end of file diff --git a/.npmignore b/.npmignore index 8ece253..a7e8a47 100644 --- a/.npmignore +++ b/.npmignore @@ -3,8 +3,8 @@ .gitattributes .gitignore .github -node_modules __tests__ +scripts src Framework_Flowchart.svg tsconfig.eslint.json diff --git a/src/domain/parser/QueryParser.ts b/src/domain/parser/QueryParser.ts index 636881e..46a1021 100644 --- a/src/domain/parser/QueryParser.ts +++ b/src/domain/parser/QueryParser.ts @@ -36,7 +36,7 @@ export const execute = (name: string = ""): QueryObjectImpl => } } - const defaultTop: string = config.defaultTop || "top"; + const defaultTop: string = config?.defaultTop || "top"; if (!name) { const names: string[] = location.pathname.split("/"); names.shift(); diff --git a/src/interface/ConfigImpl.ts b/src/interface/ConfigImpl.ts index ebbf461..445d8bc 100644 --- a/src/interface/ConfigImpl.ts +++ b/src/interface/ConfigImpl.ts @@ -12,6 +12,7 @@ export interface ConfigImpl extends BaseConfigImpl { routing?: { [key: string]: RoutingImpl }; + defaultTop?: string; spa: boolean; loading?: { callback: string;