Skip to content
This repository was archived by the owner on Jul 3, 2024. It is now read-only.

Commit abe22e7

Browse files
author
Ian Davies
committed
feat: typescript && gpr package
Converts project to TypeScript and publishes to GPR using GitHub Action
1 parent 46f5828 commit abe22e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+5241
-46
lines changed

.github/workflows/gpr-publish.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: GPR Publish
2+
on: [ push ]
3+
jobs:
4+
build:
5+
name: Build
6+
runs-on: ubuntu-latest
7+
steps:
8+
-
9+
name: Checkout code
10+
uses: actions/checkout@v2
11+
-
12+
name: Use Node.js 14
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: 14
16+
registry-url: https://registry.npmjs.org/
17+
-
18+
run: npm install -g yarn
19+
-
20+
run: yarn install --frozen-lockfile
21+
-
22+
run: yarn run build
23+
-
24+
run: yarn run semantic-release -- --dry-run
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
-
29+
run: yarn run semantic-release
30+
if: ${{ github.ref == 'refs/heads/main' }}
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Mac
2+
.DS_STORE
3+
4+
# Node
5+
node_modules/
6+
dist/
7+
.npmrc

.npmignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# The following files are never ignored
2+
# http://npm.github.io/publishing-pkgs-docs/publishing/the-npmignore-file.html
3+
# package.json
4+
# README
5+
# CHANGELOG
6+
# LICENSE
7+
/*
8+
!/dist/*

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @FormidableLabs/formidable

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019-2020 Formidable Labs.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+54
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,56 @@
11
# dogs
22
Formidable Dogs
3+
4+
## Contributing
5+
This repository is configured using [semantic-release](https://github.com/semantic-release/semantic-release) which automates the whole package release workflow including: determining the next version number, generating the release notes and publishing the package.
6+
7+
What does this mean for contributors? Your commit messages will be linted using [commitlint](https://github.com/conventional-changelog/commitlint) and must adhere to the [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/).
8+
9+
There are very precise rules over how git commit messages can be formatted. This leads to **more
10+
readable messages** that are easy to follow when looking through the **project history**. Also,
11+
the git commit messages are used to **generate the AngularJS change log**.
12+
13+
### Anatomy of a commit
14+
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
15+
format that includes a **type**, a **scope** and a **subject**:
16+
17+
```
18+
<type>(<scope>): <subject>
19+
<BLANK LINE>
20+
<body>
21+
<BLANK LINE>
22+
<footer>
23+
```
24+
25+
The **header** is mandatory and the **scope** of the header is optional.
26+
27+
Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier
28+
to read on GitHub as well as in various git tools.
29+
30+
### What type of commits trigger a release?
31+
Type must be one of `[build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]`.
32+
- The types `build|ci|revert` are [undocumented](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#type) but exist in [code](https://github.com/conventional-changelog/commitlint/blob/5fd27fdcd2d88435257f888d832fc19c5bbc037f/%40commitlint/config-conventional/index.test.js#L39).
33+
34+
| Commit Types | Description | Version Impact |
35+
|--------------|-----------------------------------------------------|----------------|
36+
| `chore` | Changes to the build process | N/A |
37+
| `docs` | Changes to documentation | N/A |
38+
| `feat` | Changes that support a new feature | Patch |
39+
| `fix` | Changes that fix a bug | Minor |
40+
| `perf` | Changes that improve performance | Patch |
41+
| `refactor` | Changes that neither fixes a bug nor adds a feature | N/A |
42+
| `style` | Changes that do not affect the meaning of code | N/A |
43+
| `test` | Changes to the test process | N/A |
44+
45+
### What about major version bumps?
46+
Major version bumps are considered **breaking changes** for `semantic-release` and are triggered intentionally. The footer should contain any information about major changes breaking changes and is also the place to reference GitHub issues that this commit closes.
47+
48+
**Breaking changes** should start with the word `BREAKING CHANGE:` with two newlines. The rest of the commit message is then used for this.
49+
50+
#### Example
51+
```
52+
perf: removed pictures from published package
53+
54+
BREAKING CHANGE: The dog .jpg files have been removed from the package.
55+
This decreases the package size from megabytes to kilobytes.
56+
```

package.json

+43-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,50 @@
11
{
2-
"name": "dogs",
2+
"name": "@formidablelabs/dogs",
33
"version": "1.0.0",
4-
"description": "Formidable dogs",
5-
"main": "index.js",
6-
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
8-
},
4+
"description": "Formidable Dogs",
5+
"author": "@FormidableLabs",
6+
"license": "MIT",
97
"repository": {
10-
"type": "git",
118
"url": "git+https://github.com/FormidableLabs/dogs.git"
129
},
13-
"author": "",
14-
"license": "MIT",
15-
"bugs": {
16-
"url": "https://github.com/FormidableLabs/dogs/issues"
10+
"publishConfig": {
11+
"registry": "https://npm.pkg.github.com"
12+
},
13+
"scripts": {
14+
"build": "rimraf dist/ && tsc"
15+
},
16+
"main": "dist/index.js",
17+
"typings": "dist/index.d.ts",
18+
"dependencies": {},
19+
"devDependencies": {
20+
"@commitlint/cli": "^11.0.0",
21+
"@commitlint/config-conventional": "^11.0.0",
22+
"@semantic-release/git": "^9.0.0",
23+
"husky": "^4.3.0",
24+
"rimraf": "^3.0.2",
25+
"semantic-release": "^17.2.1",
26+
"typescript": "^4.0.3"
27+
},
28+
"commitlint": {
29+
"extends": [
30+
"@commitlint/config-conventional"
31+
]
32+
},
33+
"husky": {
34+
"hooks": {
35+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
36+
}
1737
},
18-
"homepage": "https://github.com/FormidableLabs/dogs#readme"
38+
"release": {
39+
"branches": [
40+
"main"
41+
],
42+
"plugins": [
43+
"@semantic-release/commit-analyzer",
44+
"@semantic-release/release-notes-generator",
45+
"@semantic-release/npm",
46+
"@semantic-release/github",
47+
"@semantic-release/git"
48+
]
49+
}
1950
}

annie.jpg src/annie.jpg

File renamed without changes.

baker.jpg src/baker.jpg

File renamed without changes.

beau.jpg src/beau.jpg

File renamed without changes.

boba.jpg src/boba.jpg

File renamed without changes.

boone.jpg src/boone.jpg

File renamed without changes.

callie.jpg src/callie.jpg

File renamed without changes.

cassie.jpg src/cassie.jpg

File renamed without changes.

charlie.jpg src/charlie.jpg

File renamed without changes.

cleo.jpg src/cleo.jpg

File renamed without changes.

daisy.jpg src/daisy.jpg

File renamed without changes.

dixie.jpg src/dixie.jpg

File renamed without changes.

elliemae.jpg src/elliemae.jpg

File renamed without changes.

fred.jpg src/fred.jpg

File renamed without changes.

harley.jpg src/harley.jpg

File renamed without changes.

0 commit comments

Comments
 (0)