{"id":13903031,"url":"https://github.com/chenasraf/simple-scaffold","last_synced_at":"2025-04-05T05:04:59.609Z","repository":{"id":39879963,"uuid":"109893033","full_name":"chenasraf/simple-scaffold","owner":"chenasraf","description":"Generate any file structure - from single components to entire app boilerplates, with a single command.","archived":false,"fork":false,"pushed_at":"2024-11-15T21:42:38.000Z","size":5663,"stargazers_count":56,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T04:07:14.093Z","etag":null,"topics":["cli","file","files","generator","javascript","scaffold","scaffolding","template","typescript"],"latest_commit_sha":null,"homepage":"https://chenasraf.github.io/simple-scaffold/","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/chenasraf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"chenasraf","patreon":null,"open_collective":null,"ko_fi":"casraf","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=TSH3C3ABGQM22\u0026currency_code=ILS\u0026source=url"]}},"created_at":"2017-11-07T21:28:51.000Z","updated_at":"2025-02-07T03:50:26.000Z","dependencies_parsed_at":"2024-06-21T01:13:29.946Z","dependency_job_id":"68f365db-9c01-426c-97ca-7a5575b39a57","html_url":"https://github.com/chenasraf/simple-scaffold","commit_stats":{"total_commits":190,"total_committers":5,"mean_commits":38.0,"dds":0.3526315789473684,"last_synced_commit":"d658ab9152e75ef5e510fba0362cc4da104333b0"},"previous_names":[],"tags_count":94,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fsimple-scaffold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fsimple-scaffold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fsimple-scaffold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenasraf%2Fsimple-scaffold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenasraf","download_url":"https://codeload.github.com/chenasraf/simple-scaffold/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289426,"owners_count":20914464,"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","file","files","generator","javascript","scaffold","scaffolding","template","typescript"],"created_at":"2024-08-06T22:01:34.408Z","updated_at":"2025-04-05T05:04:59.592Z","avatar_url":"https://github.com/chenasraf.png","language":"TypeScript","funding_links":["https://github.com/sponsors/chenasraf","https://ko-fi.com/casraf","https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=TSH3C3ABGQM22\u0026currency_code=ILS\u0026source=url","https://ko-fi.com/casraf'"],"categories":["cli"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://chenasraf.github.io//simple-scaffold/img/logo-lg.png\" alt=\"Logo\" /\u003e\n\u003c/p\u003e\n\n\u003ch2 align=\"center\"\u003e\n\n[GitHub](https://github.com/chenasraf/simple-scaffold) |\n[Documentation](https://chenasraf.github.io/simple-scaffold) |\n[NPM](https://npmjs.com/package/simple-scaffold) | [casraf.dev](https://casraf.dev)\n\n![master](https://img.shields.io/github/package-json/v/chenasraf/simple-scaffold/master?label=master)\n![build](https://img.shields.io/github/actions/workflow/status/chenasraf/simple-scaffold/release.yml?branch=master)\n\n\u003c/h2\u003e\n\nLooking to streamline your workflow and get your projects up and running quickly? Look no further\nthan Simple Scaffold - the easy-to-use NPM package that simplifies the process of organizing and\ncopying your commonly-created files.\n\nWith its agnostic and un-opinionated approach, Simple Scaffold can handle anything from a few simple\nfiles to an entire app boilerplate setup. Plus, with the power of **Handlebars.js** syntax, you can\neasily replace custom data and personalize your files to fit your exact needs. But that's not all -\nyou can also use it to loop through data, use conditions, and write custom functions using helpers.\n\nDon't waste any more time manually copying and pasting files - let Simple Scaffold do the heavy\nlifting for you and start building your projects faster and more efficiently today!\n\n\u003cdiv align=\"center\"\u003e\n\n![Intro](https://chenasraf.github.io/simple-scaffold/img/intro.gif)\n\n\u003c/div\u003e\n\n---\n\n## Documentation\n\nSee full documentation [here](https://chenasraf.github.io/simple-scaffold).\n\n- [Command Line Interface (CLI) usage](https://chenasraf.github.io/simple-scaffold/docs/usage/cli)\n- [Node.js usage](https://chenasraf.github.io/simple-scaffold/docs/usage/node)\n- [Templates](https://chenasraf.github.io/simple-scaffold/docs/usage/templates)\n- [Configuration Files](https://chenasraf.github.io/simple-scaffold/docs/usage/configuration_files)\n- [Migration](https://chenasraf.github.io/simple-scaffold/docs/usage/migration)\n\n## Getting Started\n\n### Cheat Sheet\n\nA quick rundown of common usage scenarios:\n\n- Remote template config file on GitHub:\n\n  ```sh\n  npx simple-scaffold -g username/repository -c scaffold.js -k component NewComponentName\n  ```\n\n- Local template config file:\n\n  ```sh\n  npx simple-scaffold -c scaffold.js -k component NewComponentName\n  ```\n\n- Local one-time usage:\n\n  ```sh\n  npx simple-scaffold -t templates/component -o src/components NewComponentName\n  ```\n\n### Remote Configurations\n\nThe fastest way to get started is to is to re-use someone else's (or your own) work using a template\nrepository.\n\nA remote config can be loaded in one of these ways:\n\n- For templates hosted on GitHub, the syntax is `-g user/repository_name`\n- For other Git platforms like GitLab, use `-g https://example.com/user/repository_name.git`\n\nThese remote configurations support multiple scaffold groups, which can be specified using the\n`--key` or `-k` argument:\n\n```sh\n$ npx simple-scaffold \\\n  -g chenasraf/simple-scaffold \\\n  -k component \\\n  PageWrapper\n\n# equivalent to:\n$ npx simple-scaffold \\\n  -g https://github.com/chenasraf/simple-scaffold.git \\\n  -c scaffold.config.js \\\n  -k component \\\n  PageWrapper\n```\n\nBy default, the template name is set to `default` when the `--key` option is not provided.\n\nSee information about each option and flag using the `--help` flag, or read the\n[CLI documentation](https://chenasraf.github.io/simple-scaffold/docs/usage/cli). For information\nabout how configuration files work, [see below](#configuration-files).\n\n### Configuration Files\n\nYou can use a config file to more easily maintain all your scaffold definitions.\n\n`scaffold.config.js`\n\n```js\nmodule.exports = {\n  // use \"default\" to avoid needing to specify key\n  // in this case the key is \"component\"\n  component: {\n    templates: [\"templates/component\"],\n    output: \"src/components\",\n    data: {\n      // ...\n    },\n  },\n}\n```\n\nThen call your scaffold like this:\n\n```sh\n$ npx simple-scaffold -c scaffold.config.js PageWrapper\n```\n\nThis will allow you to avoid needing to remember which configs are needed or to store them in a\none-liner in `package.json` which can get pretty long and messy, and harder to maintain.\n\nAlso, this allows you to define more complex scaffolds with logic without having to use the Node.js\nAPI directly. (Of course you always have the option to still do so if you wish)\n\nMore information can be found at the\n[Configuration Files documentation](https://chenasraf.github.io/simple-scaffold/docs/usage/configuration_files).\n\n### Templates Structure\n\nTemplates are **any file** in the a directory given to `--templates`.\n\nSimple Scaffold will maintain any file and directory structure you try to generate, while replacing\nany tokens such as `{{ name }}` or other custom-data using\n[Handlebars.js](https://handlebarsjs.com/).\n\n`templates/component/{{ pascalName name }}.tsx`\n\n```tsx\n// Created: {{ now 'yyyy-MM-dd' }}\nimport React from 'react'\n\nexport default {{pascalCase name}}: React.FC = (props) =\u003e {\n  return (\n    \u003cdiv className=\"{{camelCase name}}\"\u003e{{pascalCase name}} Component\u003c/div\u003e\n  )\n}\n```\n\nTo generate the template output once without saving a configuration file, run:\n\n```sh\n# generate single component\n$ npx simple-scaffold \\\n  -t templates/component \\\n  -o src/components \\\n  PageWrapper\n```\n\nThis will immediately create the following file: `src/components/PageWrapper.tsx`\n\n```tsx\n// Created: 2077-01-01\nimport React from 'react'\n\nexport default PageWrapper: React.FC = (props) =\u003e {\n  return (\n    \u003cdiv className=\"pageWrapper\"\u003ePageWrapper Component\u003c/div\u003e\n  )\n}\n```\n\n## Contributing\n\nI am developing this package on my free time, so any support, whether code, issues, or just stars is\nvery helpful to sustaining its life. If you are feeling incredibly generous and would like to donate\njust a small amount to help sustain this project, I would be very very thankful!\n\n\u003ca href='https://ko-fi.com/casraf' target='_blank'\u003e\n  \u003cimg\n    height='36'\n    src='https://cdn.ko-fi.com/cdn/kofi1.png?v=3'\n    alt='Buy Me a Coffee at ko-fi.com' \n  /\u003e\n\u003c/a\u003e\n\nI welcome any issues or pull requests on GitHub. If you find a bug, or would like a new feature,\ndon't hesitate to open an appropriate issue and I will do my best to reply promptly.\n\nIf you are a developer and want to contribute code, here are some starting tips:\n\n1. Fork this repository\n2. Run `pnpm install`\n3. Run `pnpm dev` to start file watch mode\n4. Make any changes you would like\n5. Create tests for your changes\n6. Update the relevant documentation (readme, code comments, type comments)\n7. Create a PR on upstream\n\nSome tips on getting around the code:\n\n- Use `pnpm cmd` to use the CLI feature of Simple Scaffold from within the root directory, enabling\n  you to test different behaviors. See `pnpm cmd -h` for more information.\n- Use `pnpm test` to run tests\n- Use `pnpm docs:build` to build the documentation once\n- Use `pnpm docs:watch` to start docs in watch mode\n- Use `pnpm build` to build the output\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenasraf%2Fsimple-scaffold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenasraf%2Fsimple-scaffold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenasraf%2Fsimple-scaffold/lists"}