Skip to content

Commit

Permalink
[#322] Remove contribution guide from readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mosharaf13 authored and malparty committed Sep 14, 2023
1 parent 2683520 commit 8622cdc
Showing 1 changed file with 0 additions and 118 deletions.
118 changes: 0 additions & 118 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,124 +62,6 @@ make dev

Read more about Rails Application Template in the [official Rails Guides](https://guides.rubyonrails.org/rails_application_templates.html).

## How to contribute

### Template structure

```
.
├── .template
│ ├── addons
│ │ └── docker
│ │ ├── ...
│ │ └── template.rb
│ └── variants
│ ├── api
│ │ ├── ...
│ │ └── template.rb
│ └── web
│ ├── ...
│ └── template.rb
├── app
├── bin
├── config
├── spec
├── ...
├── README.md
├── README.md.tt
└── template.rb
```

We keep the Rails-app-like structure. On the root, there are base project file templates.
Other files including the template options are in `.template` folder.

There are 2 kinds of the template options:

1. **Variants** - For the app main options, which are `web` and `api`.

2. **Addons** - For other extra options that we can add to the project like `docker` or `bootstrap`,
use the prompt `ask` to generate a question before generating the project.

### Template files

There are 2 template file types:

1. **`.tt` files**

This file is used for templating the whole new file.
In case if we want to create a new file that Rails has not generated.

2. **`.rb` files**

This is used for modifying the files that Rails has generated.
The file name should be the same as on the generated app.
If it is not a ruby file, append the `.rb` as an extension e.g. `Gemfile.rb`

### Template specs

We are using [Serverspec](https://serverspec.org/) to test the template.
For any changes made, you **must** add a spec for it.

Test files are located under `.template/spec` folder

```
.
├── ...
├── .template
│ ├── ...
│ ├── spec
│ │ └── addons
│ │ │ └── base
│ │ │ │ └── docker
│ │ │ │ │ ├── ...
│ │ │ │ │ └── template_spec.rb
│ │ │ │ └── semaphore
│ │ │ │ │ ├── ...
│ │ │ │ │ └── template_spec.rb
│ │ │ └── variants
│ │ │ │ └── web
│ │ │ │ │ └── boostrap
│ │ │ │ │ ├── ...
│ │ │ │ │ └── template_spec.rb
│ │ │ │ └── api
│ │ │ │ │ └── addon
│ │ │ │ │ ├── ...
│ │ │ │ │ └── template_spec.rb
│ │ └── base
│ │ │ ├── ...
│ │ │ └── template_spec.rb
│ │ └── variants
│ │ │ └── web
│ │ │ │ ├── ...
│ │ │ │ └── template_spec.rb
│ │ │ └── api
│ │ │ │ ├── ...
│ │ │ │ └── template_spec.rb
```

### Template Strings

When using template string with heredoc, use the proper name following the file type / content.

This provides the meaningful context to the content and some IDEs also support to highlight the content depending on the type.

- `DOCKERFILE`
- `ERB`
- `HTML`
- `IGNORE` - For any ignore file e.g. `.gitignore`, `.eslintignore`
- `JAVASCRIPT`
- `JSON`
- `PROCFILE`
- `RUBY`
- `SCSS`
- `SHELL`

For other files that are not fit the types above, use the extension as the name
e.g. `TOOL_VERSION` for `.tool-version` file.

For the normal string, name it after the content
e.g. `ERROR` for template error message.

## Testing the Template

To run [RuboCop](https://github.com/rubocop/rubocop) against the template:
Expand Down

0 comments on commit 8622cdc

Please sign in to comment.