Skip to content
Snippets Groups Projects
Unverified Commit 2a83680c authored by Guilherme Gazzo's avatar Guilherme Gazzo Committed by GitHub
Browse files

Chore: Template to generate packages (#25174)


Co-authored-by: default avatarDiego Sampaio <chinello@gmail.com>
parent 0d33e4fc
No related branches found
No related tags found
No related merge requests found
......@@ -2,3 +2,4 @@
/packages/core-typings/ @RocketChat/chat-engine
/.vscode/ @RocketChat/chat-engine
/.github/ @RocketChat/chat-engine
/_templates/ @RocketChat/chat-engine
---
message: |
hygen {bold generator new} --name [NAME] --action [ACTION]
hygen {bold generator with-prompt} --name [NAME] --action [ACTION]
---
\ No newline at end of file
---
to: _templates/<%= name %>/<%= action || 'new' %>/hello.ejs.t
---
---
to: app/hello.js
---
const hello = ```
Hello!
This is your first hygen template.
Learn what it can do here:
https://github.com/jondot/hygen
```
console.log(hello)
---
to: _templates/<%= name %>/<%= action || 'new' %>/hello.ejs.t
---
---
to: app/hello.js
---
const hello = ```
Hello!
This is your first prompt based hygen template.
Learn what it can do here:
https://github.com/jondot/hygen
```
console.log(hello)
---
to: _templates/<%= name %>/<%= action || 'new' %>/prompt.js
---
// see types of prompts:
// https://github.com/enquirer/enquirer/tree/master/examples
//
module.exports = [
{
type: 'input',
name: 'message',
message: "What's your message?"
}
]
---
setup: <%= name %>
force: true # this is because mostly, people init into existing folders is safe
---
---
to: packages/<%= name %>/src/index.ts
---
export default () => "<%= h.capitalize(name) %>";
---
to: packages/<%= name %>/package.json
---
{
"name": "@rocket.chat/<%= name.toLowerCase() %>",
"version": "0.0.1",
"private": true,
"devDependencies": {
"@types/jest": "^27.4.1",
"eslint": "^8.12.0",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typescript": "~4.3.5"
},
"scripts": {
"eslint": "eslint --ext .js,.jsx,.ts,.tsx .",
"eslint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix",
"jest": "jest",
"build": "tsc -p tsconfig.json"
},
"main": "./dist/index.js",
"typings": "./dist/index.d.ts",
"files": [
"/dist"
],
"dependencies": {
}
}
---
to: packages/<%= name %>/tsconfig.json
---
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist"
},
"include": ["./src/**/*"]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment