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/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8528354..c00691b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,7 +12,6 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: "18.x" registry-url: "https://registry.npmjs.org" - run: npm install - run: npm run publish 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/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..46a1021 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) { 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;