{"id":15363168,"url":"https://github.com/techquery/crank-router","last_synced_at":"2025-10-13T11:14:56.519Z","repository":{"id":98205595,"uuid":"258475511","full_name":"TechQuery/crank-router","owner":"TechQuery","description":"Router component for Crank engine, which is based on Iterable Observer.","archived":false,"fork":false,"pushed_at":"2020-05-27T18:37:23.000Z","size":144,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-01T18:29:47.732Z","etag":null,"topics":["async","component","crank","generator","iterator","observable","router"],"latest_commit_sha":null,"homepage":"https://tech-query.me/crank-router/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TechQuery.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":"Contributing.md","funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-24T10:05:44.000Z","updated_at":"2020-05-27T18:36:13.000Z","dependencies_parsed_at":"2023-05-18T15:03:42.505Z","dependency_job_id":null,"html_url":"https://github.com/TechQuery/crank-router","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":"0.18181818181818177","last_synced_commit":"1d5f38505d9db51708252ba9e9c376346ddf1776"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/TechQuery/crank-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechQuery%2Fcrank-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechQuery%2Fcrank-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechQuery%2Fcrank-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechQuery%2Fcrank-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TechQuery","download_url":"https://codeload.github.com/TechQuery/crank-router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TechQuery%2Fcrank-router/sbom","scorecard":{"id":138559,"data":{"date":"2025-08-04","repo":{"name":"github.com/TechQuery/crank-router","commit":"1d5f38505d9db51708252ba9e9c376346ddf1776"},"scorecard":{"version":"v5.2.1-28-gc1d103a9","commit":"c1d103a9bb9f635ec7260bf9aa0699466fa4be0e"},"score":3.4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/11 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#sast"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/TechQuery/crank-router/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/TechQuery/crank-router/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/TechQuery/crank-router/main.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:21","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#branch-protection"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: License:0","Info: FSF or OSI recognized license: GNU Lesser General Public License v3.0: License:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#license"}}]},"last_synced_at":"2025-08-16T07:19:23.045Z","repository_id":98205595,"created_at":"2025-08-16T07:19:23.045Z","updated_at":"2025-08-16T07:19:23.045Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014760,"owners_count":26085593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","component","crank","generator","iterator","observable","router"],"created_at":"2024-10-01T13:04:58.791Z","updated_at":"2025-10-13T11:14:56.488Z","avatar_url":"https://github.com/TechQuery.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crank Router\n\n**Router component** for [Crank engine][1], which is based on [Iterable Observer][2].\n\n[![NPM Dependency](https://david-dm.org/TechQuery/crank-router.svg)][3]\n[![API Document](https://github.com/TechQuery/crank-router/workflows/API%20Document/badge.svg?branch=master)][4]\n\n[![NPM](https://nodei.co/npm/crank-router.png?downloads=true\u0026downloadRank=true\u0026stars=true)][5]\n\n## Feature\n\n-   **Page Link** (support `\u003ca /\u003e`, `\u003carea /\u003e` \u0026 `\u003cform /\u003e`)\n\n    -   `\u003ca href=\"route/path\"\u003ePage title\u003c/a\u003e`\n    -   `\u003ca href=\"route/path\" title=\"Page title\" target=\"_self\"\u003eExample page\u003c/a\u003e`\n    -   `\u003ca href=\"#page-section\"\u003ePage section\u003c/a\u003e` (Scroll to an Anchor smoothly)\n    -   `\u003cform method=\"get\" action=\"route/path\" /\u003e` (Form Data processed by `URLSearchParams`)\n\n-   **Path Mode**: `location.hash` (default) \u0026 `history.pushState()`\n\n-   **Async Loading** (recommend to use with `import()` ECMAScript proposal)\n\n## Installation\n\n```shell\nnpm install @bikeshaving/crank crank-router \\\n    iterable-observer web-utility\n```\n\n## Example\n\n-   [Source code](https://github.com/TechQuery/crank-router/tree/master/test/source)\n\n-   [Online preview](https://tech-query.me/crank-router/demo/)\n\n`index.tsx`\n\n```jsx\nimport { createElement } from '@bikeshaving/crank';\nimport { renderer } from '@bikeshaving/crank/dom';\nimport { Router } from 'crank-router/source';\n\nimport { Page } from './Page';\n\nwindow.onload = () =\u003e\n    renderer.render(\n        \u003cRouter\n            className=\"router\"\n            startClass=\"start\"\n            endClass=\"end\"\n            map={[\n                { path: '', component: Page },\n                { path: 'test', component: Page },\n                { path: /Example/i, component: Page }\n            ]}\n        /\u003e,\n        document.body\n    );\n```\n\n`Page.tsx`\n\n```jsx\nimport { createElement, Fragment } from '@bikeshaving/crank';\nimport { PageProps } from 'crank-router/source';\n\nconst Color = {\n    test: 'lightblue',\n    example: 'pink'\n};\n\nexport function Page({ path, history, ...data }: PageProps) {\n    return (\n        \u003cFragment\u003e\n            \u003cnav\u003e\n                \u003ca href=\"test?id=1\"\u003eTest\u003c/a\u003e\n                \u003ca href=\"example?id=2\"\u003eExample\u003c/a\u003e\n            \u003c/nav\u003e\n            \u003cul style={{ background: Color[path] }}\u003e\n                \u003cli\u003epath: {path}\u003c/li\u003e\n                \u003cli\u003edata: {JSON.stringify(data)}\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/Fragment\u003e\n    );\n}\n```\n\n`index.less`\n\n```LESS\nbody {\n    margin: 0;\n}\nnav \u003e a {\n    display: inline-block;\n    margin: 0.5rem;\n}\n.router {\n    width: 100vw;\n    height: 100vh;\n    overflow: auto;\n    position: relative;\n    \u0026 \u003e * {\n        position: absolute;\n        top: 0;\n        left: 0;\n        transform: translateX(0);\n        opacity: 1;\n        transition: 0.5s;\n    }\n    .start {\n        transform: translateX(100%);\n        opacity: 0;\n    }\n    .end {\n        transform: translateX(-100%);\n        opacity: 0;\n    }\n}\n```\n\n## Inspiration\n\n-   https://github.com/bikeshaving/crank/issues/27#issuecomment-617633472\n\n-   https://github.com/EasyWebApp/cell-router\n\n[1]: https://crank.js.org/\n[2]: https://web-cell.dev/iterable-observer/\n[3]: https://david-dm.org/TechQuery/crank-router\n[4]: https://github.com/TechQuery/crank-router/actions\n[5]: https://nodei.co/npm/crank-router/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechquery%2Fcrank-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftechquery%2Fcrank-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftechquery%2Fcrank-router/lists"}