Skip to content

Commit

Permalink
docs: standardize (#163)
Browse files Browse the repository at this point in the history
* combine contributing docs
* point new release notes to releases

Co-authored-by: Shereef Marzouk <shereef.marzouk@daysmart.com>
  • Loading branch information
mikejpeters and Shereef committed Mar 12, 2022
1 parent bbb0844 commit cec06df
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 77 deletions.
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
@@ -1,5 +1,34 @@
# Contribution guide

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.

Commits follow the [Angular commit convention](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines).

Run `npx cz` to commit with prompts to help you write a commit message.

## Pull Request Process

Once you have finished making your changes:

1. Make sure that your code satisfies the standards laid out in the [testing](#testing) and [coding style](#coding-style) section of this document.
2. Update README.md with details on any changes to the interface or behavior of the plugin.
3. Submit your PR, using the PR template provided to describe the details of your changes.

Then,

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.
- 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.
5. A contributor with push access to the repo will merge the PR after all tests and fixes have occured.
6. A new release will be published (if appropriate).

### Testing

Please read our [testing guide](./test/README.md) and ensure any changes are covered by unit tests, and integration tests if applicable.

### Coding Style

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.

### Code of Conduct

Please be polite and respectful in all your communication and actions towards others in the serverless-finch community.
78 changes: 31 additions & 47 deletions README.md
Expand Up @@ -26,7 +26,7 @@ custom:
# [other configuration parameters] (see Configuration Parameters below)
```

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

**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).

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

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

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

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

Expand Down Expand Up @@ -154,7 +154,7 @@ custom:

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/*",`

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

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

---

**objectHeaders**
**objectHeaders**

_optional_, no default

Expand Down Expand Up @@ -221,9 +221,9 @@ custom:
...
```

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

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`.
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`.

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'.

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

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

* `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.
* `httpRedirectCode` is the HTTP status code to use for the redirect (e.g. 301, 303, 308).
* `protocol` is the protocol to use for the redirect and must be 'http' or 'https'. Defaults to the protocol from the original request.
* `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`_.
* `replaceKeyWith` specifies a specific page to redirect requests to (e.g. 'landing.html'). _Cannot be specified along with `replaceKeyPrefixWith`_.
- `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.
- `httpRedirectCode` is the HTTP status code to use for the redirect (e.g. 301, 303, 308).
- `protocol` is the protocol to use for the redirect and must be 'http' or 'https'. Defaults to the protocol from the original request.
- `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`_.
- `replaceKeyWith` specifies a specific page to redirect requests to (e.g. 'landing.html'). _Cannot be specified along with `replaceKeyPrefixWith`_.

The `condition` property has two optional parameters:

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

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

Expand All @@ -308,7 +308,7 @@ custom:
...
```

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.
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.

---

Expand Down Expand Up @@ -360,9 +360,6 @@ custom:

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.




### Command-line Parameters

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

Use this parameter to specify what AWS region your bucket will be deployed in.
Use this parameter to specify what AWS region your bucket will be deployed in.

This option will always determine the deployment region if specified. If `region`
is not specified via the CLI, we use the `region` option specified under
custom/client in `serverless.yml`. If that is not specified, we use the Serverless
is not specified via the CLI, we use the `region` option specified under
custom/client in `serverless.yml`. If that is not specified, we use the Serverless
region specified under `provider` in `serverless.yml`.

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

## Contributing

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

## Release Notes

### v3.0.0

- Serverless 3 compatibility
- Updated dependencies

### v2.8.0

- Adds a lot of patches and fixes from old deps to new ones.

### v2.7.6

- Adds support for easier NPM deploys via GitHub releases
- Allows to set the "redirect" property of routing rules to be an empty string, which is a legitimate value. - [EnricoPicci](https://github.com/EnricoPicci)
- Clearer details on where the plugin uploads files when key prefixed. [Lilja](https://github.com/Lilja)
- Why 2.7.6 you ask? Because there were a lot of CI tests that made this release happen. A awful lot of them.
See [Releases](https://github.com/fernando-mc/serverless-finch/releases) for releases after `v2.6.0`.

### v2.6.0

Expand All @@ -475,45 +458,46 @@ For guidelines on contributing to the project, please refer to our [Contributing
- 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)

### v2.4.\*

- 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)
- 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)
- Fixed some testing instructions
- Path resolution bugfix - [Olga Skurativska](https://github.com/ol-ko) - [Pull 87](https://github.com/fernando-mc/serverless-finch/pull/87)
- Typo and legacy promise bugfixes - [Joel Van Horn](https://github.com/joelvh), [Raptor](https://github.com/redhat-raptor), [Frederik Ring](https://github.com/m90)

### v2.0.\*
### v2.0.\*

- 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)
- Added Python tests of functionality to speed up development - [fernando-mc](https://github.com/fernando-mc)
- Major refactor of entire codebase to move towards modularity and testability
- Added the ability to set HTTP headers for objects in bucket ([Issue 24](https://github.com/fernando-mc/serverless-finch/issues/24))
- 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))
- Added command-line options to disable (Initially implemented in [Pull 28](https://github.com/fernando-mc/serverless-finch/pull/28/files)):
+ Bucket contents being deleted before deployment
+ Bucket configuration being overwritten on deployment
+ Bucket policy being overwritten on deployment
+ Bucket CORS configuration being overwritten on deployment
- Added validation checks for all configuration options
- Bucket contents being deleted before deployment
- Bucket configuration being overwritten on deployment
- Bucket policy being overwritten on deployment
- Bucket CORS configuration being overwritten on deployment
- Added validation checks for all configuration options
- Removed "stage" command-line option. It was not being used for anything

### v1.4.\*

- 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))

### v1.3.\*

- 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))
- 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))
- Added a new AWS region ([Pull 14](https://github.com/fernando-mc/serverless-finch/pull/14) - [daguix](https://github.com/daguix))
- Fixed an issue with resolving serverless variables ([Pull 18](https://github.com/fernando-mc/serverless-finch/pull/18) - [shentonfreude](https://github.com/shentonfreude))

### v1.2.\*

- 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))
- Fixed automated builds for the project (no functional differences)

## Maintainers
- **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/).
- Fernando Medina Corey - [fernando-mc](https://github.com/fernando-mc)
- Linus Marco - [linusmarco](https://github.com/linusmarco)

## Contributors

- [stefan-lz](https://github.com/stefan-lz)
- [WarWithinMe](https://github.com/WarWithinMe)
- [tahir-mm](https://github.com/tahir-mm)
Expand Down
30 changes: 0 additions & 30 deletions docs/CONTRIBUTING.md

This file was deleted.

0 comments on commit cec06df

Please sign in to comment.