{"id":13531459,"url":"https://github.com/SamKirkland/plop-templates","last_synced_at":"2025-04-01T19:32:07.701Z","repository":{"id":44115866,"uuid":"186753199","full_name":"SamKirkland/plop-templates","owner":"SamKirkland","description":"VSCode extension for plop.js file templates","archived":false,"fork":false,"pushed_at":"2022-12-11T15:00:42.000Z","size":263,"stargazers_count":24,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T22:32:14.291Z","etag":null,"topics":["extension","visual-studio-code","vscode","vscode-extension"],"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/SamKirkland.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-05-15T05:12:24.000Z","updated_at":"2025-01-23T07:24:13.000Z","dependencies_parsed_at":"2023-01-27T01:31:44.839Z","dependency_job_id":null,"html_url":"https://github.com/SamKirkland/plop-templates","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKirkland%2Fplop-templates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKirkland%2Fplop-templates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKirkland%2Fplop-templates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKirkland%2Fplop-templates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamKirkland","download_url":"https://codeload.github.com/SamKirkland/plop-templates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246700608,"owners_count":20819901,"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":["extension","visual-studio-code","vscode","vscode-extension"],"created_at":"2024-08-01T07:01:03.180Z","updated_at":"2025-04-01T19:32:05.926Z","avatar_url":"https://github.com/SamKirkland.png","language":"TypeScript","funding_links":[],"categories":["IDE Plugins"],"sub_categories":[],"readme":"# \u003cimg src=\"https://raw.githubusercontent.com/samkirkland/plop-templates/master/resources/logo.png\" width=\"48\"\u003ePlop File Templates for Visual Studio Code\n\nInstall the extension on the [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=SamKirkland.plop-templates)\n\n## Features\nThis extension adds single and multi-file templates to Visual Studio Code.\nAdd a template by right clicking the desired location and selecting `📄 New File from Template`\n\n\n## Creating new project item from template \nTo invoke template selection, simply right click on a folder or file in vscode file explorer and click the `📄 New File from Template` menu item.\n\n\u003cimg src=\"https://raw.githubusercontent.com/samkirkland/plop-templates/master/resources/menu.png\"\u003e\n\n## Extension Setup\n1) Install the [VSCode extension](https://marketplace.visualstudio.com/items?itemName=SamKirkland.plop-templates)\n2) Install [plop.js](https://github.com/plopjs/plop) globally using `npm install plop -g` *(optionally you can install plop for [just your current project](#Using-a-local-version-of-plop))*. Note: Plop 3.1.1 or higher required\n3) Now for the fun part! Create a new file called `plopfile.js` at the root of your project (same folder as `package.json`, the name/location is [configurable](#Settings)).\n```js\nmodule.exports = function (plop) {\n    // create your generators here\n    // Read more about templates at https://plopjs.com/\n    plop.setGenerator(\"basic template\", {\n        description: \"this is a skeleton plopfile\",\n        prompts: [\n            {\n                // You should always include a \"destinationpath\" prompt when using this extension\n                // this extension will automatically answer this prompt for the user.\n                // Which allows your plop file to be placed in the correct location\n                type: \"input\",\n                name: \"destinationpath\",\n                message: \"Template destination path\"\n            },\n            {\n                type: \"input\",\n                name: \"fileName\",\n                message: \"file name\"\n            }\n        ],\n        actions: [\n            {\n                type: \"add\",\n                path: \"{{destinationpath}}/{{fileName}}.js\",\n                templateFile: \"plop-templates/exampleFile.hbs\"\n            }\n        ]\n    });\n};\n```\n\n\n###### ProTip: Add plop templates as a [recommended extension](https://code.visualstudio.com/docs/editor/extension-gallery#_workspace-recommended-extensions) to your `Workspace` or `Project` settings file and commit it. Then everyone on your team will see this extension!\n\n## Settings\nTo change settings open vscodes settings window and navigate to the plop extension settings\n\n(`File` \u0026rarr; `Preferences` \u0026rarr; `Settings` \u0026rarr; Search for `plopTemplates`)\n\n\n| Title           | Description                                                                                                                                                                                                                                                                                                                                                                                                                       | Default Value                      |\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|\n| configFileName  | File name or path to plop file                                                                                                                                                                                                                                                                                                                                                                                                    | `plopfile.js` at root of workspace |\n| terminalName    | Name of the Terminal window created for plop                                                                                                                                                                                                                                                                                                                                                                                      | `terminalName`                     |\n| plopCommand     | By default this extension assumes plop is installed globally (`npm install -g plop`).\u003cbr\u003eIf you'd like to use a local version of plop you can do so by adding `\"add-form-template\": \"plop\"` to your `\"scripts\"` record in your `package.json`.\u003cbr\u003e\u003cbr\u003eExample:\u003cbr\u003e```\"scripts\": { \"add-from-template\": \"plop\" }```\u003cbr\u003e\u003cbr\u003eNext update the `plopCommand` setting with your command name (in the example above \"add-from-template\") | `plop`                             |\n| destinationPath | Name of the prompt the destination path will be passed in as                                                                                                                                                                                                                                                                                                                                                                      | `destinationpath`                  |\n\n## Using a local version of plop\nThis extension expects plop.js to be install globally using `npm install plop -g` if you do not want to do this you can use a local version by doing the following\n\n1) Install plop for the current project by running `npm install --save-dev plop`\n  \n2) In your `package.json` file under `scripts` add a new `plop-script` script.\n```\n{\n    // rest of your package.json file...\n    \"scripts\": {\n        \"plop-script\": \"plop\", // this tells the extension to use this projects version of plop\n    },\n    // rest of your package.json file...\n}\n```\n\n3) Go to `File` \u0026rarr; `Preferences` \u0026rarr; `Settings` \u0026rarr; Search for `plopTemplates`\n\n4) Edit the \"Plop Command\" setting to your script name from step 3. In the example above we used `plop-script`\n\n\n## Resolving common issues\n* `Cannot find module ...\\node_modules\\plop\\src\\plop.js'`\n  * You need to install plop globally, do so by running the following `npm install -g plop`\n  * Alternatively you can [install plop for just the current project](#Using-a-local-version-of-plop)\n* `The term 'plop' is not recognized as the name of a cmdlet, function, script file, or operable program...`\n  * You need to install plop globally, do so by running the following `npm install -g plop`\n  * Alternatively you can [install plop for just the current project](#Using-a-local-version-of-plop)\n* `Couldn't load plop config file at the path: \".../plopfile.js\" - ENOENT: no such file or directory, stat '...\\plopfile.js'`\n  * You need to create a plopfile with generators. Please see [Extension Setup](#Extension-Setup)\n\n\n## Release Notes\n\n#### 1.2.0\n- Plop 3.1.1 or higher required\n- Removed shipped plop dependency\n- Removed shipped handlebars dependency\n- Reduced size from 7,200KB --\u003e 54KB\n- Reduced load time\n\n#### 1.1.0\n- Fixing bug caused in 1.0.5 causing `MODULE_NOT_FOUND` error\n- Updated plop to latest version (2.7.4) and node-plop (0.26.2)\n\n#### 1.0.5\n- Documentation updates\n\n#### 1.0.4\n- Skip 'destinationpathName' parameter automatically (thanks [@rbadapanda](https://github.com/rbadapanda))\n\n#### 1.0.3\n- Added destinationpath command\n\n#### 1.0.2\n- Fixed command naming\n- Added link to vscode marketplace\n- Added issues link\n- Added plopCommand setting\n\n#### 1.0.0\n- Initial release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSamKirkland%2Fplop-templates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSamKirkland%2Fplop-templates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSamKirkland%2Fplop-templates/lists"}