{"id":20196822,"url":"https://github.com/itsjonq/remake","last_synced_at":"2025-04-10T10:43:58.878Z","repository":{"id":33783164,"uuid":"162017602","full_name":"ItsJonQ/remake","owner":"ItsJonQ","description":"🦋 Remake: A simple generator from locally defined templates","archived":false,"fork":false,"pushed_at":"2023-03-02T21:13:17.000Z","size":3711,"stargazers_count":3,"open_issues_count":19,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-24T09:38:28.503Z","etag":null,"topics":["cli","generator","javascript","nodejs","react","template"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ItsJonQ.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}},"created_at":"2018-12-16T16:02:20.000Z","updated_at":"2022-11-14T18:10:45.000Z","dependencies_parsed_at":"2023-02-18T05:35:16.939Z","dependency_job_id":null,"html_url":"https://github.com/ItsJonQ/remake","commit_stats":null,"previous_names":["itsjonq/remake-cli"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsJonQ%2Fremake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsJonQ%2Fremake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsJonQ%2Fremake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsJonQ%2Fremake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ItsJonQ","download_url":"https://codeload.github.com/ItsJonQ/remake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248200497,"owners_count":21063908,"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","generator","javascript","nodejs","react","template"],"created_at":"2024-11-14T04:26:12.739Z","updated_at":"2025-04-10T10:43:58.860Z","avatar_url":"https://github.com/ItsJonQ.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🦋 Remake\n\n[![Build Status](https://travis-ci.org/ItsJonQ/remake.svg?branch=master)](https://travis-ci.org/ItsJonQ/remake)\n[![npm version](https://badge.fury.io/js/%40itsjonq%2Fremake.svg)](https://badge.fury.io/js/%40itsjonq%2Fremake)\n\n\u003e A simple generator from locally defined templates!\n\n```\nUsage: remake\n  🦋  Remake\n\n  remake \u003ccmd\u003e --option\n\n  Example:\n  remake component --name=MyComponent --someProp=value\n\n\nOptions:\n  -V, --version    output the version number\n  -n, --name       The name for the generate file(s)\n  -o, --output     Location to output generated file(s)\n  -i, --entry      Location of the template file(s)\n  -w, --overwrite  Overwrite existing files\n  -s, --silence    Suppresses the logs\n  -h, --help       output usage information\n\nCommands:\n  *              The directory name for the template under .remake/\n```\n\n## Table of contents\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n-   [Installation](#installation)\n-   [Usage](#usage)\n    -   [Create the template files](#create-the-template-files)\n    -   [Run the command](#run-the-command)\n-   [Example](#example)\n-   [License](#license)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Installation\n\n```\nnpm install --save-dev @itsjonq/remake\n```\n\nTo install it globally, run:\n\n```\nnpm install -g @itsjonq/remake\n```\n\n## Usage\n\n### Create the template files\n\nIn your project's root directory, create a new directory called `.remake`:\n\n```\nmy-app/\n├── .remake/\n└── .../\n```\n\nWithin the `.remake` directory, create sub directories to associate with \"commands\" that you would like Remake to run. In this example, we'll create a directory called `component`, which Remake will use when running the command `component`:\n\n```\nmy-app/\n├── .remake/\n│   └── component/\n└── .../\n```\n\nUnder the new `component` directory, we'll add a couple of files that we want Remake to generate for us:\n\n```\nmy-app/\n├── .remake/\n│   └── component/\n│       └── remake-name/\n│           ├── index.js\n│           └── remake-name.js\n└── .../\n```\n\nNotice the `remake-name` directory and `remake-name.js` file. Remake will use `props` you provide to replace any `remake-*` file name. For this example, the file name will be replaced with the `name` prop.\n\nWithin the `remake-name.js`, let's add some template content:\n\n```jsx\n// component/remake-name/remake-name.js\nimport React from 'react'\n\nexport class \u003c%= name %\u003e extends React.PureComponent {\n  render () {\n    return \u003cdiv /\u003e\n  }\n}\n\nexport default \u003c%= name %\u003e\n```\n\nNotice the `\u003c%= name %\u003e`. Remake uses [lodash.template](https://lodash.com/docs/4.17.11#template) to parse and modify template files. The `name` prop is provided to the template through CLI arguments. You can specify anything you'd like! Including `if/else` logic, if you wanna get fancy.\n\n### Run the command\n\nOnce you're happy with your template files, run the `remake` command.\n\nThe recommended way is to add a `remake` script to your project's `package.json`, like so:\n\n```\n  ...\n  \"remake\": \"remake\",\n  ...\n```\n\nYou can even add the options to dedicated `remake` scripts for more commonly generated templates:\n\n```\n\"remake:component\": \"remake component --output=src/components\"\n```\n\nAlternatively, if you've installed `remake` globally, you can run:\n\n```\nremake component --name=Hello\n```\n\nFor this example, remake will generate the following files:\n\n```\nmy-app/\n├── .remake/\n│   └── component/\n│       └── remake-name/\n│           ├── index.js\n│           └── remake-name.js\n├── Hello\n│   ├── index.js\n│   └── Hello.js\n└── .../\n```\n\nIf we take a look at `Hello.js`, you'll see that the `\u003c%= name %\u003e` variables have been replaced by `Hello`, specified by `--name=Hello`:\n\n```jsx\n// Hello/Hello.js\nimport React from 'react';\n\nexport class Hello extends React.PureComponent {\n\trender() {\n\t\treturn \u003cdiv /\u003e;\n\t}\n}\n\nexport default Hello;\n```\n\n## Example\n\nCheck out the example in the [`example` directory](https://github.com/ItsJonQ/remake/tree/master/example) 🙌\n\n## License\n\nMIT © [Q](https://jonquach.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsjonq%2Fremake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsjonq%2Fremake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsjonq%2Fremake/lists"}