Skip to content

Commit 316608a

Browse files
committed
chore: 🤖 setup repo, add docs
1 parent b7af430 commit 316608a

14 files changed

+6525
-9307
lines changed

.all-contributorsrc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"projectName": "angular-versions-action",
3+
"projectOwner": "@ngworker",
4+
"repoType": "github",
5+
"repoHost": "https://github.com",
6+
"files": [
7+
"README.md"
8+
],
9+
"imageSize": 100,
10+
"commit": true,
11+
"commitConvention": "angular",
12+
"contributors": [
13+
{
14+
"login": "NachoVazquez",
15+
"name": "Nacho Vazquez",
16+
"avatar_url": "https://avatars3.githubusercontent.com/u/9338604?v=4",
17+
"profile": "https://github.com/NachoVazquez",
18+
"contributions": [
19+
"question",
20+
"bug",
21+
"business",
22+
"code",
23+
"doc",
24+
"example",
25+
"ideas",
26+
"infra",
27+
"maintenance",
28+
"projectManagement",
29+
"review",
30+
"security",
31+
"test",
32+
"tool",
33+
"userTesting"
34+
]
35+
}
36+
],
37+
"contributorsPerLine": 7
38+
}

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see https://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.ts]
12+
quote_type = single
13+
14+
[*.md]
15+
max_line_length = off
16+
trim_trailing_whitespace = false

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v2
1414
- run: |
15-
npm install
15+
yarn
1616
- run: |
17-
npm run all
17+
yarn all
1818
test: # make sure the action works on a clean machine without building
1919
runs-on: ubuntu-latest
2020
steps:

CONTRIBUTING.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Contributing to Angular Versions Action
2+
3+
🙏 We would ❤️ for you to contribute to `AngularVersionsAction` and help make it even better than it is today!
4+
5+
## Developing
6+
7+
Install the dependencies
8+
9+
```bash
10+
yarn
11+
```
12+
13+
Build the typescript and package it for distribution
14+
15+
```bash
16+
yarn build && yarn package
17+
```
18+
19+
Run the tests :heavy_check_mark:
20+
21+
```bash
22+
yarn test
23+
```
24+
25+
## <a name="rules"></a> Coding Rules
26+
27+
To ensure consistency throughout the source code, keep these rules in mind as you are working:
28+
29+
- All features or bug fixes **must be tested** by one or more specs (unit-tests).
30+
- All public API methods **must be documented**.
31+
32+
## <a name="commit"></a> Commit Message Guidelines
33+
34+
We have very precise rules over how our git commit messages can be formatted. This leads to **more
35+
readable messages** that are easy to follow when looking through the **project history**. But also,
36+
we use the git commit messages to **generate the Lumberjack changelog**.
37+
38+
### Commit Message Format
39+
40+
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
41+
format that includes a **type**, a **scope** and a **subject**:
42+
43+
```
44+
<type>(<scope>): <subject>
45+
<BLANK LINE>
46+
<body>
47+
<BLANK LINE>
48+
<footer>
49+
```
50+
51+
The **header** is mandatory and the **scope** of the header is optional.
52+
53+
Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
54+
to read on GitHub as well as in various git tools.
55+
56+
The footer should contain a [closing reference to an issue](https://help.github.com/articles/closing-issues-via-commit-messages/) if any.

ISSUE_TEMPLATE.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!--
2+
PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.
3+
4+
ISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.
5+
-->
6+
7+
## I'm submitting a...
8+
9+
<!-- Check one of the following options with "x" -->
10+
<pre><code>
11+
[ ] Regression (a behavior that used to work and stopped working in a new release)
12+
[ ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
13+
[ ] Performance issue
14+
[ ] Feature request
15+
[ ] Documentation issue or request
16+
[ ] Support request
17+
[ ] Other... Please describe:
18+
</code></pre>
19+
20+
## Current behavior
21+
22+
<!-- Describe how the issue manifests. -->
23+
24+
## Expected behavior
25+
26+
<!-- Describe what the desired behavior would be. -->
27+
28+
## Minimal reproduction of the problem with instructions
29+
30+
## What is the motivation / use case for changing the behavior?
31+
32+
<!-- Describe the motivation or the concrete use case. -->
33+
34+
## Environment
35+
36+
<pre><code>
37+
Angular version: X.Y.Z
38+
<!-- Check whether this is still an issue in the most recent Angular version -->
39+
40+
Browser:
41+
- [ ] Chrome (desktop) version XX
42+
- [ ] Chrome (Android) version XX
43+
- [ ] Chrome (iOS) version XX
44+
- [ ] Firefox version XX
45+
- [ ] Safari (desktop) version XX
46+
- [ ] Safari (iOS) version XX
47+
- [ ] IE version XX
48+
- [ ] Edge version XX
49+
50+
For Tooling issues:
51+
- Node version: XX <!-- run `node --version` -->
52+
- Platform: <!-- Mac, Linux, Windows -->
53+
54+
Others:
55+
<!-- Anything else relevant? Operating system version, IDE, package manager, HTTP server, ... -->
56+
</code></pre>

PULL_REQUEST_TEMPLATE.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## PR Checklist
2+
3+
Please check if your PR fulfills the following requirements:
4+
5+
- [ ] The commit message follows our guidelines: CONTRIBUTING.md#commit
6+
- [ ] Tests for the changes have been added (for bug fixes / features)
7+
- [ ] Docs have been added / updated (for bug fixes / features)
8+
9+
## PR Type
10+
11+
What kind of change does this PR introduce?
12+
13+
<!-- Please check the one that applies to this PR using "x". -->
14+
15+
```
16+
[ ] Bugfix
17+
[ ] Feature
18+
[ ] Code style update (formatting, local variables)
19+
[ ] Refactoring (no functional changes, no api changes)
20+
[ ] Build related changes
21+
[ ] CI related changes
22+
[ ] Documentation content changes
23+
[ ] Other... Please describe:
24+
```
25+
26+
## What is the current behavior?
27+
28+
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
29+
30+
Issue Number: N/A
31+
32+
## What is the new behavior?
33+
34+
## Does this PR introduce a breaking change?
35+
36+
```
37+
[ ] Yes
38+
[ ] No
39+
```
40+
41+
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
42+
43+
## Other information

README.md

Lines changed: 21 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,39 @@
1-
<p align="center">
2-
<a href="https://github.com/actions/typescript-action/actions"><img alt="typescript-action status" src="https://github.com/actions/typescript-action/workflows/build-test/badge.svg"></a>
3-
</p>
1+
# GitHub Action - Match Angular Versions
42

5-
# Create a JavaScript Action using TypeScript
3+
This GitHub Action (written in JavaScript) modifies the root `package.json` of a project and replaces the version of all **Angular** related dependencies for given base version.
64

7-
Use this template to bootstrap the creation of a TypeScript action.:rocket:
5+
[![ngworker](https://img.shields.io/badge/ngworker-%40-red)](https://github.com/ngworker/)
86

9-
This template includes compilation support, tests, a validation workflow, publishing, and versioning guidance.
7+
## Usage
108

11-
If you are new, there's also a simpler introduction. See the [Hello World JavaScript Action](https://github.com/actions/hello-world-javascript-action)
9+
### Pre-requisites
1210

13-
## Create an action from this template
11+
Create a workflow `.yml` file in your repositories `.github/workflows` directory. An [example workflow](#example-workflow---match-Angular-versions) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
1412

15-
Click the `Use this Template` and provide the new repo details for your action
13+
### Inputs
1614

17-
## Code in Main
15+
- `angular_version`: The base Angular version used to match the dependency version. Ex: 8.0.0, 10.0.14. To check the full list of supported versions, see [supported versions](###Supported-Angular-versions).
1816

19-
Install the dependencies
20-
```bash
21-
$ npm install
22-
```
23-
24-
Build the typescript and package it for distribution
25-
```bash
26-
$ npm run build && npm run package
27-
```
28-
29-
Run the tests :heavy_check_mark:
30-
```bash
31-
$ npm test
32-
33-
PASS ./index.test.js
34-
✓ throws invalid number (3ms)
35-
wait 500 ms (504ms)
36-
test runs (95ms)
37-
38-
...
39-
```
40-
41-
## Change action.yml
42-
43-
The action.yml contains defines the inputs and output for your action.
44-
45-
Update the action.yml with your name, description, inputs and outputs for your action.
46-
47-
See the [documentation](https://help.github.com/en/articles/metadata-syntax-for-github-actions)
48-
49-
## Change the Code
17+
### Example workflow - match Angular versions
5018

51-
Most toolkit and CI/CD operations involve async operations so the action is run in an async function.
52-
53-
```javascript
54-
import * as core from '@actions/core';
55-
...
56-
57-
async function run() {
58-
try {
59-
...
60-
}
61-
catch (error) {
62-
core.setFailed(error.message);
63-
}
64-
}
65-
66-
run()
67-
```
68-
69-
See the [toolkit documentation](https://github.com/actions/toolkit/blob/master/README.md#packages) for the various packages.
70-
71-
## Publish to a distribution branch
72-
73-
Actions are run from GitHub repos so we will checkin the packed dist folder.
74-
75-
Then run [ncc](https://github.com/zeit/ncc) and push the results:
76-
```bash
77-
$ npm run package
78-
$ git add dist
79-
$ git commit -a -m "prod dependencies"
80-
$ git push origin releases/v1
19+
```yaml
20+
todo: 'Complete example later'
8121
```
8222
83-
Note: We recommend using the `--license` option for ncc, which will create a license file for all of the production node modules used in your project.
23+
This will replace the version of several dependencies related to Angular in the package.json. It will use versions compatible with the given Angular version.
8424
85-
Your action is now published! :rocket:
25+
### Supported Angular versions
8626
87-
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
27+
At the moment this actions supports a limited set of Angular versions listed below.
8828
89-
## Validate
29+
- 8.0.0
30+
- 9.0.0
31+
- 10.0.0
9032
91-
You can now validate the action by referencing `./` in a workflow in your repo (see [test.yml](.github/workflows/test.yml))
92-
93-
```yaml
94-
uses: ./
95-
with:
96-
milliseconds: 1000
97-
```
33+
## Contributing
9834
99-
See the [actions tab](https://github.com/actions/typescript-action/actions) for runs of this action! :rocket:
35+
We would love you to contribute to `@ngworker/angular-versions-action`, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
10036

101-
## Usage:
37+
## License
10238

103-
After testing you can [create a v1 tag](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) to reference the stable and latest V1 action
39+
The scripts and documentation in this project are released under the [MIT License](LICENSE)

action.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
name: 'Your name here'
2-
description: 'Provide a description here'
3-
author: 'Your name or organization here'
1+
name: "Match Angular Versions"
2+
description: "Modifies the package.json with matching dependency versions for a given base Angular version"
3+
author: "GitHub"
44
inputs:
5-
milliseconds: # change this
5+
angular_version:
6+
description: "The base Angular version used to match the dependency versions"
67
required: true
7-
description: 'input description here'
8-
default: 'default value if applicable'
98
runs:
10-
using: 'node12'
11-
main: 'dist/index.js'
9+
using: "node12"
10+
main: "dist/index.js"
11+
branding:
12+
icon: "package"
13+
color: "gray-dark"

commitlint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional']
3+
}

0 commit comments

Comments
 (0)