{"id":18782612,"url":"https://github.com/binlf/lofo","last_synced_at":"2025-04-13T12:11:34.952Z","repository":{"id":255778278,"uuid":"778565768","full_name":"binlf/lofo","owner":"binlf","description":"(🔨WIP) A tool for managing local fonts in your Next.js project.","archived":false,"fork":false,"pushed_at":"2025-02-23T02:52:13.000Z","size":1171,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T08:22:16.168Z","etag":null,"topics":["cli","fonts","localfonts","nextjs","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/lofo","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/binlf.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}},"created_at":"2024-03-28T00:41:38.000Z","updated_at":"2025-03-30T00:52:15.000Z","dependencies_parsed_at":"2024-09-07T04:13:27.644Z","dependency_job_id":"dec03c0a-f6a6-45e7-afaf-f118019810f2","html_url":"https://github.com/binlf/lofo","commit_stats":null,"previous_names":["binlf/lofo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binlf%2Flofo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binlf%2Flofo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binlf%2Flofo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binlf%2Flofo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binlf","download_url":"https://codeload.github.com/binlf/lofo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710446,"owners_count":21149191,"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","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":["cli","fonts","localfonts","nextjs","typescript"],"created_at":"2024-11-07T20:36:38.640Z","updated_at":"2025-04-13T12:11:34.945Z","avatar_url":"https://github.com/binlf.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LoFo\n\n\u003e A tool for managing local fonts in your Next.js project!\n\n```\n npx lofo\n```\n\n## ⬜Installation\n\nTo get started, run the above command in the root directory of your project and `lofo` would automatically try to get everything set up properly. You can also install the CLI globally on your machine by running the command below:\n\n```\nnpm install -g lofo\n```\n\n...after which you should be able to execute the CLI by running the command: `lofo` in your terminal...\n\n### 🔍How it works.\n\nWhen the CLI is executed, it would look through your project for a `fonts` directory and create one(_if it doesn't exist_) in the root directory of your project.\n\n\u003e [!NOTE]\n\u003e _It would **not** check your entire project directory tree recursively, it instead checks directories that a `fonts` directory would likely be found(based on common [conventions](https://github.com/binlf/lofo/blob/abd7a448baacb791037d3627139d620c14530f31/src/constants.ts#L2)). As this would most likely vary from person-to-person, you could put all your local font files in a directory named `fonts` in the root directory of your project. You could [move](https://github.com/binlf/lofo?tab=readme-ov-file#fonts-directory-destination) it somewhere else afterwards! A common convention you could also consider is putting your `fonts` directory(containing all your font files) in the `public/` directory of your Next.js project._\n\nIn the latter scenario, after the creation of the `fonts` directory, it would prompt you to move your local font files[_these files typically have extensions such as `.otf`, `.ttf`, `.woff`, `.woff2` etc._] into the `fonts` directory.\n\nIt would then resolve the paths to all the font files in your `fonts` directory and then generate the code snippet to add the font imports into your Next.js project. _This would typically be written to your root `layout.tsx` file._\n\n### 📂Project Structure\n\n_This is an example project structure to begin with before running the cli -- not cumpulsory_\n\n```\nmy-project/\n├── app\n├── pages\n├── public\n├── fonts/\n│   ├── my-font.woff2\n│   └── ...\n└── ...\n```\n\n### 📍Fonts Directory Destination\n\nThe final destination of the `fonts` directory is up to you. You can decide to move the `fonts` directory to a different location, this can be achieved by running the CLI with an argument[_yet to be implemented_] or manually moving the `fonts` directory through your project directory tree(in your IDE). If you prefer the latter, remember to run `lofo` afterwards to auto-update your import path[**_this is a compulsory step_**]...\n\nUsing a command line argument with the `lofo` command:\n\n\u003e _Replace values in angle brackets with real values_\n\n| Command                                                | Description                                                                                                                                                                                                  | Example                      |\n| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------- |\n| `lofo --dest \u003cpath\u003e` or `lofo -d \u003cpath\u003e`               | Run this command when adding a new font to your project to designate a \"final destination\" for the `fonts` directory. The value of `\u003cpath\u003e` is resolved relative to your root directory                      | `lofo --dest public/assets/` |\n| `lofo remove [font_family]` or `lofo rm [font_family]` | Run this command to remove a specified font family from your project -- the `fonts` directory. _Run `lofo rm` or `lofo remove` to display a list of existing fonts from which you can select one to delete._ | `lofo rm Roboto`             |\n| `lofo remove --all` or `lofo remove -a `               | Run this command to remove all font files and font family directories from your project -- the `fonts` directory                                                                                             | `lofo rm --all`              |\n\n### 👀Quirks\n\n\u003e These are known \"quirks\" that you may notice during usage, some are by design, others are minor issues that would be fixed.\n\n#### _Quirk: Something GOOFED._\n\nUnfortunately, every failure can't be accounted for and the only \"escape hatch\" for now is the command: `lofo rm --all` -- this command would remove all the font files and directories in the `fonts` directory, this should give you a \"fresh\" slate. If after doing this, something still goofs[something still goes wrong], please don't hesitate to open an [issue](https://github.com/binlf/lofo/issues/new).\n\n### 🗾Roadmap\n\n- [ ] Add support for React.js projects\n- [ ] Add support for Next.js projects using the pages router\n- [ ] Add support for Vanilla.js projects\n- [ ] Add support for React Native projects\n\n\u003e [!WARNING]\n\u003e _This project, at this time, is in active development and makes some assumptions about your project and conventions. Feel free to open an [issue](https://github.com/binlf/lofo/issues/new) if you catch something🧐!_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinlf%2Flofo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinlf%2Flofo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinlf%2Flofo/lists"}