Skip to content
This repository has been archived by the owner on May 18, 2023. It is now read-only.

Release 1.4 #126

Merged
merged 20 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
cdk.out/
node_modules/
dist/
docs/
bin/
scripts/link.js
**/*.test.ts
6 changes: 3 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ module.exports = {
],
rules: {
// Remove any type warnings.
'@typescript-eslint/no-explicit-any':['off',{
fixToUnknown: true,
ignoreRestArgs: true
'@typescript-eslint/no-explicit-any':['error',{
fixToUnknown: false,
ignoreRestArgs: false
}],
// Don't require semicolons in interface definitions
'@typescript-eslint/member-delimiter-style': ['error', {
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,4 @@ dist
.ts-build-cache
.mira.snapshot
mira-error-logs*
**/cdk.out
42 changes: 33 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@ Ensure all your tests pass and linting is successful before opening a PR.

ℹ️ _Before a release can be published, ensure you have followed the instructions in the documentation: [Creating and publishing unscoped public packages]._

Each release consists of three steps:
Also, if this is a major release (with breaking changes), then a migration instructions page should have been created and added to the documentation set.

1. Update the auto-generated documentation and package version, then commit them to the repository.
2. Tag the package version commit with the same version number.
3. Publish the new version of the package to NPM Packages.
Each release consists of these steps:

At the end of the release, there should be a commit on `master` tagged with the package version, and the package is published to the NPM packages repository in this git repository.
1. Update the auto-generated documentation and package version on the master branch, then commit them to the repository.
2. PR the changes to the release branch.
3. Tag the package version commit with the same version number.
4. Add release notes to Github.
5. Publish the new version of the package to NPM Packages.
6. Publicise the release.

At the end of the release, there should be a commit on `release` tagged with the package version, and the package is published to the NPM packages repository in this git repository.

### 1. Update the Package Version and Documentation

Expand Down Expand Up @@ -60,13 +65,16 @@ Open a Pull Request for this new branch and wait for approval. Once approved, us

ℹ️ _The commit message represents the version number at that point in time. Setting this to just the version number helps track down these specific commits. Note: This does not follow the [Conventional Commits] style, but does align with the `npm version` style_.

### 2. Tag the Package Version Commit
### 2. PR the changes to the release branch
Pull Request the changes on `master` to the `release` branch, and wait for approval. Once approved, use a **Squash Merge** with the commit message **`1.1.0`**

### 3. Tag the Package Version Commit

Pull the changes locally and make sure your local HEAD points to the merge commit of the PR.
Pull the `release` branch changes locally and make sure your local HEAD points to the merge commit of the PR.

```bash
% git fetch origin
% git checkout origin/master
% git checkout origin/release
% git log --pretty=oneline -5
3axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1.1.0
# ... other commits
Expand All @@ -85,7 +93,18 @@ git tag v1.1.0
git push origin v1.1.0 # note the `v`
```

### 3. Publish to NPM Packages
### 4. Add release notes to Github
Use git log to list all the commits since the last release, substituing whatever number of lines is enough to show all the commits, e.g.:

```bash
% git log --pretty=oneline -20 # 20 lines in this case
```

Use the [Mira releases] page to edit the description of the release, copying over all the commit lines and removing the commit hashes for clarity.

If this is a major release, then a link to the migration instructions page should also be added to the description.

### 5. Publish to NPM Packages

Now that your tag is pushed, you can publish the package. Make sure the repository is clean and node modules are installed correctly.

Expand All @@ -102,7 +121,12 @@ npm publish

This lints, builds and tests the package, then publishes it to NPM. You can view the package on the [Mira packages page][Mira packages].

### 6. Publicise the release.

Notify any interested parties that the release is in place, and post the news on appropriate social media.

[Creating and publishing unscoped public packages]: https://docs.npmjs.com/creating-and-publishing-unscoped-public-packages
[npm version]: https://docs.npmjs.com/cli-commands/version.html
[Conventional Commits]: https://www.conventionalcommits.org/
[Mira packages]: https://www.npmjs.com/package/mira?activeTab=versions
[Mira releases]: https://github.com/nearform/mira/releases
14 changes: 10 additions & 4 deletions __mocks__/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { IConfig } from 'config'
import { Config } from '../src/config/mira-config'

const config: Record<string, unknown> = {
'app.prefix': 'John',
Expand Down Expand Up @@ -42,7 +43,7 @@ const configMock: IConfig = {
return setting in config
},
util: {
loadFileConfigs (): any {
loadFileConfigs (): Config {
return {
app: {
name: 'S3Webhosting',
Expand All @@ -53,16 +54,21 @@ const configMock: IConfig = {
},
accounts: {
default: {
name: 'hello',
profile: 'mira-dev',
env: {
account: '101259067028',
region: 'eu-west-1'
},
profile: 'mira-dev'
}
}
}
}
}
} as any
} as any // eslint-disable-line @typescript-eslint/no-explicit-any
}
/*
The `any` type in the line above is required to accomplish the same value returned by
the `loadFileConfigs` function in the `config` module
*/

export default configMock
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Mira consists of the following built-ins:
* An opinionated set of AWS CDK aspects, e.g. IAM Policy validator.
* Complementary sample applications e.g. a simple S3-based web hosting app.

__Note: Currently supported version of the AWS CDK is: *[1.61.1](https://github.com/aws/aws-cdk/releases/tag/v1.61.1)*.__
__Note: Currently supported version of the AWS CDK is: *[1.67.0](https://github.com/aws/aws-cdk/releases/tag/v1.67.0)*.__

Please make sure your application depends on that exact version of the CDK.

Expand Down
5 changes: 3 additions & 2 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
* [Home](/)
* [Mira Overview](/overview/)
* [Quick Start Guide](/quick-start/)
* [Config](/config/)
* [Working with Mira](/working-with-mira/)
* [Configuration](/config/)
* [Continuous Integration](/cicd/)
* [Sample Applications](/samples/)
* [Guidelines](/guidelines/)
* [API Documentation](/api/ ':ignore API Documentation')
2 changes: 1 addition & 1 deletion docs/api/assets/js/search.json

Large diffs are not rendered by default.

Loading