{"id":30663562,"url":"https://github.com/starlanestudios/sceptre","last_synced_at":"2026-04-07T09:31:07.045Z","repository":{"id":309971731,"uuid":"154004157","full_name":"StarlaneStudios/sceptre","owner":"StarlaneStudios","description":"A CLI tool for compiling React Router page structures into generated imports","archived":false,"fork":false,"pushed_at":"2023-04-20T15:00:51.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-31T17:18:16.268Z","etag":null,"topics":["codegen","nextjs","nodejs","react","react-router","routing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StarlaneStudios.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"zenodo":null}},"created_at":"2018-10-21T12:08:15.000Z","updated_at":"2023-04-08T01:26:44.000Z","dependencies_parsed_at":"2025-08-14T23:14:06.149Z","dependency_job_id":"4a0c38f0-853b-4798-9feb-8750d80a269a","html_url":"https://github.com/StarlaneStudios/sceptre","commit_stats":null,"previous_names":["exodiusstudios/sceptre","exodiusstudios/node-sceptre"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/StarlaneStudios/sceptre","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarlaneStudios%2Fsceptre","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarlaneStudios%2Fsceptre/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarlaneStudios%2Fsceptre/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarlaneStudios%2Fsceptre/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StarlaneStudios","download_url":"https://codeload.github.com/StarlaneStudios/sceptre/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StarlaneStudios%2Fsceptre/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31507908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["codegen","nextjs","nodejs","react","react-router","routing"],"created_at":"2025-08-31T17:13:28.151Z","updated_at":"2026-04-07T09:31:07.020Z","avatar_url":"https://github.com/StarlaneStudios.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/StarlaneStudios/sceptre/main/.github/logo.svg\" height=\"164\"\u003e\n\u003c/p\u003e\n\n# Sceptre\n\nImplement Next.js style page directories in your single page application by generating routing definitions from a page directory.\n\n## Installation\n\nInstall the CLI\n\n```\nnpm install -g sceptre\n```\n\n## Page folder structure\n\nPages are defined using a folder structure in your application. Subfolders denote path segments, while pages map to `index.tsx` or `index.jsx` files. When using sceptre, each page is given it's own directory in which assets and styles can be placed, allowing for a clean and structured page setup.\n\n## Exporting pages\n\nEach page is expected to contain a default export of it's `RouteObject`. The `path` property will automatically be populated when parsing the tree, so it may be omitted.\n\n```tsx\nconst IndexPage = () =\u003e {\n    return (\n        \u003cdiv\u003e\n            Page content\n        \u003c/div\u003e\n    )\n};\n\nIndexPage.info = {\n\ttitle: 'Index Page'\n}\n\nexport default IndexPage;\n```\n\n### URL Parameters\n\nParameters can be defined by using `[name]` as folder name. This will automatically translate into `:name` when building routes.\n\nWe also support a other parameter type: `...` which will match any path segment.\n\n### Index mapping\n\nFolders named `@` will map to the index page of the parent directory.\n\n### Parent pages\n\nYou can add a parent pages by making a folder named `_` anywhere in your file tree. Parent pages are responsible for placing an `\u003cOutlet /\u003e` where child routes will be rendered. Routes can be parented any number of times, each rendering in its closest parent outlet.\n\nVisual example:\n```\n/example/_\t\t\t\t- Responsible for rendering outlet 1\n/example/@\t\t\t\t- Rendered inside outlet 1\n/example/page/_\t\t\t- Rendered inside outlet 1 and responsible for rendering outlet 2\n/example/page/@\t\t\t- Rendered inside outlet 2\n/example/page/child \t- Rendered inside outlet 2\n```\n\n### Example folder structure\n\n```\npages/\n    @/\n        index.tsx\n        styles.tsx\n    help/\n        index.tsx\n        style.scss\n    settings/\n        _/\n            index.tsx\n        overview/\n            index.tsx\n        [param]/\n            index.tsx\n    folder/\n        _/\n            index.tsx\n        [...]/\n            index.tsx\n            style.scss\n```\n\nThe above example translates to the given routes\n\n```\n/\n/help\n/settings/overview\n/settings/:param\n/folder/*\n```\n\n## Usage\n```bash\nsceptre ./src/pages/**/index.tsx ./src/generated/routes.ts --base ./src/pages\n```\n\nThis command will compile all index components placed recursively within the pages directory and generates a routes.ts.\n\n### Base directory\nThe `--base` flag should point to the directory containing all pages. By default it is set to the current execution directory.\n\n### Identing\nYou can optionally pass `--indent none | tab | \u003cnumber\u003e` to control the indentation of the generated routing configuration. By default indentation is disabled.\n\n### Forced js extensions\nCertain environments may require all script file imports to end with `.js` regardless of their actual extension. In this case you can pass the `--force-js` flag.\n\n## Vindigo\n\nThis package was originally developed for use in [Vindigo](https://github.com/StarlaneStudios/vindigo), a free and open source task planner.\n\n## License\n\nsceptre is licensed under [MIT](https://github.com/StarlaneStudios/sceptre/blob/main/LICENSE)\n\nCopyright (c) 2022-present, [Starlane Studios](https://starlane.studio/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarlanestudios%2Fsceptre","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarlanestudios%2Fsceptre","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarlanestudios%2Fsceptre/lists"}