Skip to content

Commit cec06df

Browse files
mikejpetersShereef
andauthored
docs: standardize (#163)
* combine contributing docs * point new release notes to releases Co-authored-by: Shereef Marzouk <shereef.marzouk@daysmart.com>
1 parent bbb0844 commit cec06df

File tree

3 files changed

+60
-77
lines changed

3 files changed

+60
-77
lines changed

CONTRIBUTING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Contribution guide
22

3+
When contributing to this repository, please first open an issue so that the community of contributors to this repository can discuss the suggestion before a change is made.
4+
35
Commits follow the [Angular commit convention](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines).
46

57
Run `npx cz` to commit with prompts to help you write a commit message.
8+
9+
## Pull Request Process
10+
11+
Once you have finished making your changes:
12+
13+
1. Make sure that your code satisfies the standards laid out in the [testing](#testing) and [coding style](#coding-style) section of this document.
14+
2. Update README.md with details on any changes to the interface or behavior of the plugin.
15+
3. Submit your PR, using the PR template provided to describe the details of your changes.
16+
17+
Then,
18+
19+
4. For substantial changes to the plugin, we will try to get at least two community sign-offs and some discussion of the PR before merging.
20+
- For non-controversial or minor PRs (e.g. phrasing updates in the documentation, minor refactoring of constants), one approval will be sufficient to move forward.
21+
5. A contributor with push access to the repo will merge the PR after all tests and fixes have occured.
22+
6. A new release will be published (if appropriate).
23+
24+
### Testing
25+
26+
Please read our [testing guide](./test/README.md) and ensure any changes are covered by unit tests, and integration tests if applicable.
27+
28+
### Coding Style
29+
30+
This repository uses [prettier](https://prettier.io/) to enforce a uniform coding style. You may install an editor plugin for prettier, but code will also be auto-formatted via a git hook whenever you commit code.
31+
32+
### Code of Conduct
33+
34+
Please be polite and respectful in all your communication and actions towards others in the serverless-finch community.

README.md

Lines changed: 31 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ custom:
2626
# [other configuration parameters] (see Configuration Parameters below)
2727
```
2828

29-
**NOTE:** *For full example configurations, please refer to the [examples](examples) folder.*
29+
**NOTE:** _For full example configurations, please refer to the [examples](examples) folder._
3030

3131
**Second**, Create a website folder in the root directory of your Serverless project. This is where your distribution-ready website should live. By default the plugin expects the files to live in a folder called `client/dist`. But this is configurable with the `distributionFolder` option (see the [Configuration Parameters](#configuration-parameters) below).
3232

@@ -50,7 +50,7 @@ serverless client deploy [--region $REGION] [--no-delete-contents] [--no-config-
5050

5151
The plugin should output the location of your newly deployed static site to the console.
5252

53-
**Note:** *See [Command-line Parameters](#command-line-parameters) for details on command above*
53+
**Note:** _See [Command-line Parameters](#command-line-parameters) for details on command above_
5454

5555
**WARNING:** The plugin will overwrite any data you have in the bucket name you set above if it already exists.
5656

@@ -154,7 +154,7 @@ custom:
154154

155155
Use this parameter to specify the path to a _single_ custom policy file. If not set, it defaults to a config for a basic static website. Currently, only JSON is supported. In your policy, make sure that your resource has the correct bucket name specified above: `"Resource": "arn:aws:s3:::BUCKET_NAME/*",`
156156

157-
_Note: You can also use `${env:PWD}` if you want to dynamically specify the policy within your repo. for example:_
157+
_Note: You can also use `${env:PWD}` if you want to dynamically specify the policy within your repo. for example:_
158158

159159
```yaml
160160
custom:
@@ -192,7 +192,7 @@ _See above docs on `bucketPolicyFile` option for how to provide a dynamic file p
192192

193193
---
194194

195-
**objectHeaders**
195+
**objectHeaders**
196196

197197
_optional_, no default
198198

@@ -221,9 +221,9 @@ custom:
221221
...
222222
```
223223

224-
Use the `objectHeaders` option to set HTTP response headers be sent to clients requesting uploaded files from your website.
224+
Use the `objectHeaders` option to set HTTP response headers be sent to clients requesting uploaded files from your website.
225225

226-
Headers may be specified globally for all files in the bucket by adding a `name`, `value` pair to the `ALL_OBJECTS` property of the `objectHeaders` option. They may also be specified for specific folders or files within your site by specifying properties with names like `specific-directory/` (trailing slash required to indicate folder) or `specific-file.ext`, where the folder and/or file paths are relative to `distributionFolder`.
226+
Headers may be specified globally for all files in the bucket by adding a `name`, `value` pair to the `ALL_OBJECTS` property of the `objectHeaders` option. They may also be specified for specific folders or files within your site by specifying properties with names like `specific-directory/` (trailing slash required to indicate folder) or `specific-file.ext`, where the folder and/or file paths are relative to `distributionFolder`.
227227

228228
Headers with more specificity will take precedence over more general ones. For instance, if 'Cache-Control' was set to 'max-age=100' in `ALL_OBJECTS` and to 'max-age=500' in `my/folder/`, the files in `my/folder/` would get a header of 'Cache-Control: max-age=500'.
229229

@@ -275,16 +275,16 @@ The `routingRules` option can be used to define rules for when and how certain r
275275

276276
The `redirect` property of each rule has five optional parameters:
277277

278-
* `hostName` is the name of the host that the request should be redirected to (e.g. 'www.other-site.com'). Defaults to the host from the original request.
279-
* `httpRedirectCode` is the HTTP status code to use for the redirect (e.g. 301, 303, 308).
280-
* `protocol` is the protocol to use for the redirect and must be 'http' or 'https'. Defaults to the protocol from the original request.
281-
* `replaceKeyPrefixWith` specifies the string to replace the portion of the route specified in the `keyPrefixEquals` with in the redirect. For instance, if you want to redirect requests for pages starting with '/images' to pages starting with '/assets/images', you can specify `keyPrefixEquals` as '/images' and `replaceKeyPrefixWith` as '/assets/images'. _Cannot be specified along with `replaceKeyWith`_.
282-
* `replaceKeyWith` specifies a specific page to redirect requests to (e.g. 'landing.html'). _Cannot be specified along with `replaceKeyPrefixWith`_.
278+
- `hostName` is the name of the host that the request should be redirected to (e.g. 'www.other-site.com'). Defaults to the host from the original request.
279+
- `httpRedirectCode` is the HTTP status code to use for the redirect (e.g. 301, 303, 308).
280+
- `protocol` is the protocol to use for the redirect and must be 'http' or 'https'. Defaults to the protocol from the original request.
281+
- `replaceKeyPrefixWith` specifies the string to replace the portion of the route specified in the `keyPrefixEquals` with in the redirect. For instance, if you want to redirect requests for pages starting with '/images' to pages starting with '/assets/images', you can specify `keyPrefixEquals` as '/images' and `replaceKeyPrefixWith` as '/assets/images'. _Cannot be specified along with `replaceKeyWith`_.
282+
- `replaceKeyWith` specifies a specific page to redirect requests to (e.g. 'landing.html'). _Cannot be specified along with `replaceKeyPrefixWith`_.
283283

284284
The `condition` property has two optional parameters:
285285

286-
* `keyPrefixEquals` specifies that requests to pages starting with the specified value should be redirected. Often used with the `replaceKeyPrefixWith` and `replaceKeyWith` `redirect` properties.
287-
* `httpErrorCodeReturnedEquals` specifies that requests resulting in the given HTTP error code (e.g. 404, 500) should be redirected.
286+
- `keyPrefixEquals` specifies that requests to pages starting with the specified value should be redirected. Often used with the `replaceKeyPrefixWith` and `replaceKeyWith` `redirect` properties.
287+
- `httpErrorCodeReturnedEquals` specifies that requests resulting in the given HTTP error code (e.g. 404, 500) should be redirected.
288288

289289
_If `condition` is not specified, then all requests will be redirected in accordance with the specified `redirect` properties_
290290

@@ -308,7 +308,7 @@ custom:
308308
...
309309
```
310310

311-
The `uploadOrder` option can be used for ordering the files uploaded to the bucket. When combined with `--no-delete-contents` this helps with 0 downtime, as we can make sure we upload any assets before serving the html files which need them.
311+
The `uploadOrder` option can be used for ordering the files uploaded to the bucket. When combined with `--no-delete-contents` this helps with 0 downtime, as we can make sure we upload any assets before serving the html files which need them.
312312

313313
---
314314

@@ -360,9 +360,6 @@ custom:
360360

361361
This allows you to opt out of having serverless-finch create or configure the s3 bucket. Instead, you can rely on an existing bucket or a CloudFormation definition.
362362

363-
364-
365-
366363
### Command-line Parameters
367364

368365
**--region**
@@ -373,11 +370,11 @@ _optional_, defaults to value specified in `provider` section of `serverless.yml
373370
serverless client deploy --region $REGION
374371
```
375372

376-
Use this parameter to specify what AWS region your bucket will be deployed in.
373+
Use this parameter to specify what AWS region your bucket will be deployed in.
377374

378375
This option will always determine the deployment region if specified. If `region`
379-
is not specified via the CLI, we use the `region` option specified under
380-
custom/client in `serverless.yml`. If that is not specified, we use the Serverless
376+
is not specified via the CLI, we use the `region` option specified under
377+
custom/client in `serverless.yml`. If that is not specified, we use the Serverless
381378
region specified under `provider` in `serverless.yml`.
382379

383380
---
@@ -444,25 +441,11 @@ Use this parameter if you do not want a confirmation prompt to interrupt automat
444441

445442
## Contributing
446443

447-
For guidelines on contributing to the project, please refer to our [Contributing](docs/CONTRIBUTING.md) page.
444+
Please read our [contribution guide](./CONTRIBUTING.md).
448445

449446
## Release Notes
450447

451-
### v3.0.0
452-
453-
- Serverless 3 compatibility
454-
- Updated dependencies
455-
456-
### v2.8.0
457-
458-
- Adds a lot of patches and fixes from old deps to new ones.
459-
460-
### v2.7.6
461-
462-
- Adds support for easier NPM deploys via GitHub releases
463-
- Allows to set the "redirect" property of routing rules to be an empty string, which is a legitimate value. - [EnricoPicci](https://github.com/EnricoPicci)
464-
- Clearer details on where the plugin uploads files when key prefixed. [Lilja](https://github.com/Lilja)
465-
- Why 2.7.6 you ask? Because there were a lot of CI tests that made this release happen. A awful lot of them.
448+
See [Releases](https://github.com/fernando-mc/serverless-finch/releases) for releases after `v2.6.0`.
466449

467450
### v2.6.0
468451

@@ -475,45 +458,46 @@ For guidelines on contributing to the project, please refer to our [Contributing
475458
- Added the `sse` option to allow you to encrypt files with Server Side Encryption using `AES256` or `aws:kms` - [Pull 91](https://github.com/fernando-mc/serverless-finch/pull/91) - [Severi Haverila](https://github.com/severi)
476459

477460
### v2.4.\*
461+
478462
- Added the `manageResources` option to allow you to tell serverless-finch to not interact with your S3 bucket - [Pull 75](https://github.com/fernando-mc/serverless-finch/pull/75) - [sprockow](https://github.com/sprockow)
479463
- Added the `keyPrefix` option to enable working with S3 folders - [Pull 76](https://github.com/fernando-mc/serverless-finch/pull/76) - [Archanium](https://github.com/Archanium)
480464
- Fixed some testing instructions
481465
- Path resolution bugfix - [Olga Skurativska](https://github.com/ol-ko) - [Pull 87](https://github.com/fernando-mc/serverless-finch/pull/87)
482466
- Typo and legacy promise bugfixes - [Joel Van Horn](https://github.com/joelvh), [Raptor](https://github.com/redhat-raptor), [Frederik Ring](https://github.com/m90)
483467

484-
### v2.0.\*
468+
### v2.0.\*
469+
485470
- Added ability to deploy files in a specific order to maximize uptime - [Issue 63](https://github.com/fernando-mc/serverless-finch/issues/63) - [stefan-lz](https://github.com/stefan-lz)
486471
- Added Python tests of functionality to speed up development - [fernando-mc](https://github.com/fernando-mc)
487472
- Major refactor of entire codebase to move towards modularity and testability
488473
- Added the ability to set HTTP headers for objects in bucket ([Issue 24](https://github.com/fernando-mc/serverless-finch/issues/24))
489474
- Added the ability to set redirect and routing options for the website (Initially implemented in [Pull 23](https://github.com/fernando-mc/serverless-finch/pull/23))
490475
- Added command-line options to disable (Initially implemented in [Pull 28](https://github.com/fernando-mc/serverless-finch/pull/28/files)):
491-
+ Bucket contents being deleted before deployment
492-
+ Bucket configuration being overwritten on deployment
493-
+ Bucket policy being overwritten on deployment
494-
+ Bucket CORS configuration being overwritten on deployment
495-
- Added validation checks for all configuration options
476+
- Bucket contents being deleted before deployment
477+
- Bucket configuration being overwritten on deployment
478+
- Bucket policy being overwritten on deployment
479+
- Bucket CORS configuration being overwritten on deployment
480+
- Added validation checks for all configuration options
496481
- Removed "stage" command-line option. It was not being used for anything
497482

498483
### v1.4.\*
484+
499485
- Added the ability to set custom index and error documents. ([Pull 20](https://github.com/fernando-mc/serverless-finch/pull/20) - [evanseeds](https://github.com/evanseeds))
500486

501487
### v1.3.\*
488+
502489
- Added the ability to set a `distributionFolder` configuration value. This enables you to upload your website files from a custom directory ([Pull 12](https://github.com/fernando-mc/serverless-finch/pull/12) - [pradel](https://github.com/pradel))
503490
- Updated the URL to the official static website endpoint URL ([Pull 13](https://github.com/fernando-mc/serverless-finch/pull/13) - [amsross](https://github.com/amsross))
504491
- Added a new AWS region ([Pull 14](https://github.com/fernando-mc/serverless-finch/pull/14) - [daguix](https://github.com/daguix))
505492
- Fixed an issue with resolving serverless variables ([Pull 18](https://github.com/fernando-mc/serverless-finch/pull/18) - [shentonfreude](https://github.com/shentonfreude))
506493

507494
### v1.2.\*
495+
508496
- Added the `remove` option to tear down what you deploy. ([Pull 10](https://github.com/fernando-mc/serverless-finch/pull/10) thanks to [redroot](https://github.com/redroot))
509497
- Fixed automated builds for the project (no functional differences)
510498

511-
## Maintainers
512-
- **You** - If you're interested in having a more active role in development and becoming a maintainer [get in touch](https://www.fernandomc.com/contact/).
513-
- Fernando Medina Corey - [fernando-mc](https://github.com/fernando-mc)
514-
- Linus Marco - [linusmarco](https://github.com/linusmarco)
515-
516499
## Contributors
500+
517501
- [stefan-lz](https://github.com/stefan-lz)
518502
- [WarWithinMe](https://github.com/WarWithinMe)
519503
- [tahir-mm](https://github.com/tahir-mm)

docs/CONTRIBUTING.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)