{"id":13720229,"url":"https://github.com/kiliman/rmx-cli","last_synced_at":"2025-04-04T17:10:57.907Z","repository":{"id":37798952,"uuid":"459726434","full_name":"kiliman/rmx-cli","owner":"kiliman","description":"A CLI tool for Remix applications","archived":false,"fork":false,"pushed_at":"2024-04-22T12:44:07.000Z","size":274,"stargazers_count":187,"open_issues_count":2,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T16:11:07.776Z","etag":null,"topics":["cli","remix"],"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/kiliman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2022-02-15T19:46:52.000Z","updated_at":"2025-03-03T02:15:20.000Z","dependencies_parsed_at":"2024-10-03T12:17:39.382Z","dependency_job_id":"342b5b7c-e51f-436e-84c2-f2a9d767e646","html_url":"https://github.com/kiliman/rmx-cli","commit_stats":{"total_commits":87,"total_committers":9,"mean_commits":9.666666666666666,"dds":"0.11494252873563215","last_synced_commit":"f3b5ba039e6be2b6b0f1bd87e7a405d131779ae4"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiliman%2Frmx-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiliman%2Frmx-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiliman%2Frmx-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiliman%2Frmx-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiliman","download_url":"https://codeload.github.com/kiliman/rmx-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246797603,"owners_count":20835614,"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","remix"],"created_at":"2024-08-03T01:01:01.302Z","updated_at":"2025-04-04T17:10:57.890Z","avatar_url":"https://github.com/kiliman.png","language":"TypeScript","funding_links":[],"categories":["CLI","miscellaneous","TypeScript"],"sub_categories":[],"readme":"# rmx-cli\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n\n[![All Contributors](https://img.shields.io/badge/all_contributors-9-orange.svg?style=flat-square)](#contributors-)\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\nA CLI tool for Remix applications. Future versions will support adding external\ncommands.\n\n## 🛠 Installation\n\n```bash\nnpm install -D rmx-cli\n```\n\n# Commands\n\n## 🎁 svg-sprite ✨ NEW\n\nGenerate SVG sprites recursively from `SOURCE_FOLDER`. It generates the sprite file,\nas well as a React component to create the icon by specifying the fully-typed icon name.\nIt also exports the `href` of the sprite file to use in the Remix `links` export.\n\nThe `OUTPUT_PATH` can be a folder or a filename. If it is a filename, that will be used\nas the base name if there are multiple source folders. For example:\n_components/icons/icon.tsx_ will generate an _icons.tsx_ and _icons.svg_ file for every\nsource folder.\n\nIf you want to generate a React component for _each_ icon, then add the `--components`\nargument. Then you can import the named icon directly.\n\n\u003e NOTE: The React component name will be the filename in TitleCase\n\nYou can specify a custom template file that will be used as the base for the generated\nReact component. The typed `IconNames` and exported components will be be appended to this\ntemplate file. An array of icon names is also exported: `export const iconNames = [\"...\"] as const`\n\nHere's a sample template file:\n\n```ts\nimport { type SVGProps } from 'react'\nimport { cn } from '~/utils/misc'\nimport href from './sprite.svg'\nexport { href }\n\nconst sizeClassName = {\n  font: 'w-font h-font',\n  xs: 'w-3 h-3',\n  sm: 'w-4 h-4',\n  md: 'w-5 h-5',\n  lg: 'w-6 h-6',\n  xl: 'w-7 h-7',\n} as const\n\ntype Size = keyof typeof sizeClassName\n\nexport default function Icon({\n  icon,\n  size = 'font',\n  className,\n  ...props\n}: SVGProps\u003cSVGSVGElement\u003e \u0026 { icon: IconName; size?: Size }) {\n  return (\n    \u003csvg\n      {...props}\n      className={cn(sizeClassName[size], 'inline self-center', className)}\n    \u003e\n      \u003cuse href={`${href}#${icon}`} /\u003e\n    \u003c/svg\u003e\n  )\n}\n```\n\n```\nnpx rmx-cli svg-sprite SOURCE_FOLDER OUTPUT_PATH [--components]\n        [--template=TEMPLATE_FILE]\n        [--components-template=TEMPLATE_FILE]\n        [--fill=COLOR] [--stroke=COLOR]\n\nSOURCE_FOLDER: folder containing .svg files\nOUTPUT_PATH: output path for sprite file and components\n\n* If OUTPUT_PATH ends with .tsx, then use this as the base filename\n  (default: icon.tsx)\n\n--sprite=FILENAME: base filename of sprite file (default: icon.svg)\n--types=FILENAME : base filename of IconType export file\n                   if present, will not generate component file\n--components     : generate named components for each icon\n--template=TEMPLATE_FILE: use custom template file\n--fill=COLOR     : specify fill color or \"keep\" to keep original colors\n                   default is \"currentColor\"\n--stroke=COLOR   : specify stroke color or \"keep\" to keep original colors\n                   default is \"currentColor\"\n```\n\n### Usage\n\n_Example:_\n\n```bash\nnpx rmx-cli svg-sprite assets/svg app/components/icons\n```\n\n```ts\n// import default Icon component and specify the icon by name\n// import the href to the sprite file to use in `links` export\nimport {\n  default as RadixIcon,\n  href as radixIcons,\n} from \"~/components/radixicons\";\n\n\u003cRadixIcon icon=\"bookmark\" className=\"text-red-500 h-6 w-6\" /\u003e\n\u003cRadixIcon icon=\"envelope-open\" className=\"text-green-500 h-6 w-6\" /\u003e\n\n// OR import named icon components (using --components flag)\nimport {\n  ArchiveBoxIcon,\n  ArrowDownIcon,\n  CakeIcon,\n  href as outline24Icons,\n} from \"~/components/heroicons/24/outline\";\n\n// generate \u003clink rel=\"preload\"\u003e for the sprite file\nexport const links: LinksFunction = () =\u003e [\n  { rel: \"preload\", href: outline24Icons, as: \"image\" },\n  { rel: \"stylesheet\", href: tailwindCss },\n];\n\n// control color and size using className\n\u003cArchiveBoxIcon className=\"text-red-500 h-6 w-6\" /\u003e\n\u003cArrowDownIcon className=\"text-green-500 h-6 w-6\" /\u003e\n\u003cCakeIcon className=\"text-blue-500 h-6 w-6\" /\u003e\n```\n\n\u003cimg src=\"./images/svg-sprite.png\" style=\"max-width:400px\"\u003e\n\n## 🪂 eject-ras\n\nEject your Remix project from Remix App Server to Express\n\n```bash\nnpx rmx-cli eject-ras\n```\n\n## 📦 get-esm-packages\n\nScan for ESM package to add to _remix.config.js_ `serverDependenciesToBundle`\n\n```bash\nnpx rmx-cli get-esm-packages [package-name ...]\n```\n\n### Usage\n\n```bash\n  Example:\n    npx rmx-cli get-esm-packages @remix-run/node @remix-run/react\n```\n\n## 🏷️ version\n\nList all Remix package versions installed in node_modules\n\n```bash\nnpx rmx-cli version\n```\n\n## 🚀 gen-remix\n\nTHis script will generate a _remix.ts_ file which re-exports all exports\nfrom specified packages. This essentially works like the _magic_ `remix`\npackage from early Remix.\n\nWhy is this useful?\n\n1. Go back to importing from one file instead of adapter specific packages. If you ever switch adapters, just re-generate the _remix.ts_ file.\n2. Adds support for overrides. Now you can override a standard Remix export with your own function. Like replacing `json`, `useLoaderData`, etc. with the `remix-typedjson` functions.\n3. Add `\"postinstall\": \"rmx gen-remix\"` to _package.json_ to ensure the file is regenerated when upgrading Remix packages.\n\n### Usage\n\n```bash\nUsage:\n    $ npx rmx gen-remix [options]\n\n  Options:\n    --config PATH       Config path (default: ./gen-remix.config.json)\n    --packages PACKAGES List of packages to export\n    --output PATH       Output path (default: ./app/remix.ts)\n\n  Example:\n    rmx gen-remix --packages @remix-run/node @remix-run/react\n```\n\n### Config\n\nYou can also include an optional config (defaults to _gen-remix.config.json_) where you can specify overrides.\n\n```json\n{\n  \"exports\": [\"packageA\", \"packageB\"],\n  \"overrides\": {\n    \"\u003csource-package\u003e\": [\n      \"\u003coriginal-package\u003e\": {\n        \"\u003coriginal-export\u003e\": \"\u003cnew-source-export\u003e\",\n        ...\n      },\n      \"\u003coriginal-package\u003e\": {\n        \"\u003coriginal-export\u003e\": \"\u003cnew-source-export\u003e\",\n        ...\n      }\n    ],\n    ...\n  }\n}\n```\n\n### Example config:\n\nThis config replaces the Remix `json`, `redirect`, `useActionData`, etc. with the versions for [`remix-typedjson`](https://github.com/kiliman/remix-typedjson).\n\n```json\n{\n  \"exports\": [\"@remix-run/node\", \"@remix-run/react\", \"remix-typedjson\"],\n  \"overrides\": {\n    \"remix-typedjson\": {\n      \"@remix-run/node\": {\n        \"json\": \"typedjson\",\n        \"redirect\": \"redirect\"\n      },\n      \"@remix-run/react\": {\n        \"useActionData\": \"useTypedActionData\",\n        \"useFetcher\": \"useTypedFetcher\",\n        \"useLoaderData\": \"useTypedLoaderData\"\n      }\n    }\n  }\n}\n```\n\n## 😍 Contributors\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://kiliman.dev/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/47168?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKiliman\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Kiliman/rmx-cli/commits?author=kiliman\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/Kiliman/rmx-cli/commits?author=kiliman\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://codsen.com/os/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/8344688?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRoy Revelt\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Kiliman/rmx-cli/commits?author=revelt\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://kentcdodds.com/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1500684?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKent C. Dodds\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Kiliman/rmx-cli/commits?author=kentcdodds\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://bgwebagency.in/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/13310363?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eKiran Dash\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Kiliman/rmx-cli/commits?author=kirandash\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/andrewcohen\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1016046?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAndrew Cohen\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Kiliman/rmx-cli/commits?author=andrewcohen\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/courdek\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/319738?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAndrew Coppola\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Kiliman/rmx-cli/commits?author=courdek\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://about.me/knisterpeter\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/327445?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMarkus Wolf\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Kiliman/rmx-cli/commits?author=KnisterPeter\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://justinrhall.dev/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1288694?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJustin Hall\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Kiliman/rmx-cli/commits?author=wKovacs64\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/Kiliman/rmx-cli/issues?q=author%3AwKovacs64\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://florianweinaug.de/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/17765766?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eFlorian Weinaug\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Kiliman/rmx-cli/commits?author=fweinaug\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/Kiliman/rmx-cli/issues?q=author%3Afweinaug\" title=\"Bug reports\"\u003e🐛\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiliman%2Frmx-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiliman%2Frmx-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiliman%2Frmx-cli/lists"}