Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
egorio committed Oct 18, 2022
1 parent e345fe3 commit f8ad24f
Show file tree
Hide file tree
Showing 23 changed files with 17,390 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
quote_type = single
trim_trailing_whitespace = false

[*.{js,ts,json}]
max_line_length = 120
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.config.js
dist
docs
node_modules
53 changes: 53 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'import', 'prettier', 'filenames'],
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
'prettier',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
curly: 'error',
'sort-imports': 'off',
'import/order': 'off',
'import/no-default-export': 'error',
'import/no-duplicates': 'error',
'import/no-extraneous-dependencies': 'error',
'import/no-unassigned-import': 'error',
'import/no-unresolved': 'off',
'prettier/prettier': [
'error',
{
printWidth: 120,
singleQuote: true,
trailingComma: 'es5',
},
{
usePrettierrc: false,
},
],
'@typescript-eslint/no-use-before-define': [
'error',
{
functions: false,
},
],
'@typescript-eslint/interface-name-prefix': ['off'],
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowExpressions: true,
allowTypedFunctionExpressions: true,
allowHigherOrderFunctions: true,
},
],
'@typescript-eslint/no-non-null-assertion': ['off'],
},
ignorePatterns: ['dist', 'node_modules'],
};
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
versioning-strategy: increase-if-necessary
15 changes: 15 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Rehearsal TS Upgrade (DEBUG)
on:
workflow_dispatch:

jobs:
test_action:
name: Run Upgrade
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
base-path: './test'
- uses: lhotari/action-upterm@v1
16 changes: 16 additions & 0 deletions .github/workflows/local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Rehearsal TS Upgrade
on:
workflow_dispatch:
push:
branches: ['master']

jobs:
test_action:
name: Run Upgrade
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
base-path: './test'
14 changes: 14 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Rehearsal TS Upgrade (PROD)
on:
workflow_dispatch:

jobs:
test_action:
name: Run Upgrade
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: rehearsal-js/action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
base-path: './test'
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.DS_Store

.idea/
.history/
.vscode/

*.log
*.tgz
*.tmp

coverage/
dist/
node_modules/
tmp/

**SCRATCH**
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "es5"
}
42 changes: 42 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
LinkedIn Open Source Code of Conduct
-------------------------------------

This code of conduct outlines expectations for participation in LinkedIn-managed open source communities, as well as steps for reporting unacceptable behavior. We are committed to providing a welcoming and inspiring community for all. People violating this code of conduct may be banned from the community.

Our open source communities strive to:

* **Be friendly and patient:** Remember you might not be communicating in someone else's primary spoken or programming language, and others may not have your level of understanding.
* **Be welcoming:** Our communities welcome and support people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, color, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability.
* **Be respectful:** We are a world-wide community of professionals, and we conduct ourselves professionally. Disagreement is no excuse for poor behavior and poor manners. Disrespectful and unacceptable behavior includes, but is not limited to:
* Violent threats or language.
* Discriminatory or derogatory jokes and language.
* Posting sexually explicit or violent material.
* Posting, or threatening to post, people's personally identifying information ("doxing").
* Insults, especially those using discriminatory terms or slurs.
* Behavior that could be perceived as sexual attention.
* Advocating for or encouraging any of the above behaviors.
* **Understand disagreements:** Disagreements, both social and technical, are useful learning opportunities. Seek to understand the other viewpoints and resolve differences constructively.
* This code is not exhaustive or complete. It serves to capture our common understanding of a productive, collaborative environment. We expect the code to be followed in spirit as much as in the letter.

### Scope

This code of conduct applies to all repos and communities for LinkedIn-managed open source projects regardless of whether or not the repo explicitly calls out its use of this code. The code also applies in public spaces when an individual is representing a project or its community. Examples include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

Note: Some LinkedIn-managed communities have codes of conduct that pre-date this document and issue resolution process. While communities are not required to change their code, they are expected to use the resolution process outlined here. The review team will coordinate with the communities involved to address your concerns.

### Reporting Code of Conduct Issues

We encourage all communities to resolve issues on their own whenever possible. This builds a broader and deeper understanding and ultimately a healthier interaction. In the event that an issue cannot be resolved locally, please feel free to report your concerns by contacting [oss@linkedin.com](mailto:oss@linkedin.com).

In your report please include:

* Your contact information.
* Names (real, usernames or pseudonyms) of any individuals involved. If there are additional witnesses, please include them as well.
* Your account of what occurred, and if you believe the incident is ongoing. If there is a publicly available record (e.g. a mailing list archive or a public chat log), please include a link or attachment.
* Any additional information that may be helpful.

All reports will be reviewed by a multi-person team and will result in a response that is deemed necessary and appropriate to the circumstances. Where additional perspectives are needed, the team may seek insight from others with relevant expertise or experience. The confidentiality of the person reporting the incident will be kept at all times. Involved parties are never part of the review team.

Anyone asked to stop unacceptable behavior is expected to comply immediately. If an individual engages in unacceptable behavior, the review team may take any action they deem appropriate, including a permanent ban from the community.

_This code of conduct is based on the [Microsoft](https://opensource.microsoft.com/codeofconduct/) Open Source Code of Conduct which was based on the [template](http://todogroup.org/opencodeofconduct) established by the [TODO Group](http://todogroup.org/) and used by numerous other large communities (e.g., [Facebook](https://code.facebook.com/pages/876921332402685/open-source-code-of-conduct), [Yahoo](https://yahoo.github.io/codeofconduct), [Twitter](https://engineering.twitter.com/opensource/code-of-conduct), [GitHub](http://todogroup.org/opencodeofconduct/#opensource@github.com)) and the Scope section from the [Contributor Covenant version 1.4](http://contributor-covenant.org/version/1/4/)._
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Contributing Guide

Currently, we will ignore all issues and pull requests as this software is a work in progress.
We will be adding features and fixing bugs as we go.
File renamed without changes.
8 changes: 8 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Copyright 2021 LinkedIn Corporation and Contributors.
All Rights Reserved.

Licensed under the BSD 2-Clause License (the "License").
See [LICENSE](./LICENSE.md) in the project root for license information.

With the exception any directories containing their own `LICENSE` file are redistributions
and covered under the existing license terms.
45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
# action-dev
Rehearsal-JS GutHub Action
# Rehearsal GitHub Action

Runs Rehearsal Update to keep your TypeScript project ready for the latest TypeScript version.

The action updates a project code where it's possible and creates tickets (issues) for issues that need engineer interaction.

Learn about [@rehearsal/migrate](https://github.com/rehearsal-js/rehearsal-js/tree/master/packages/migrate) if you want to migrate your project from JavaScript to TypeScript.

# Features

- Creates a Pull Request with code changes to make a project ready for the upcoming TypeScript version
- Opens Tickets (Issues) with suggested code changes have to be made by engineer
- Provides a report in [SARIF](https://github.com/microsoft/sarif-tutorials) format compatible with [Checkup](https://checkupjs.github.io/) and [SARIF Viewer for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=MS-SarifVSCode.sarif-viewer)

# Usage

Create a `rehearsal.yml` file in `.github/workflows` directory to configure the action.
See [action.yml](https://github.com/rehearsal-js/action/blob/master/action.yml) for available input parameters.

The configuration could look like this:

```yaml
name: Rehearsal TS Upgrade

on:
workflow_dispatch:
schedule:
- cron: '0 8 * * 1'

jobs:
rehearse:
name: Run Upgrade
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: rehearsal-js/action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
```

# License

The scripts and documentation in this project has released under the [BSD-2-Clause](https://github.com/rehearsal-js/action/blob/master/LICENSE.md)
35 changes: 35 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 'Rehearsal TypeScript Upgrade Action'
description: 'Run Rehearsal to upgrade the project to support the latest version of TypeScript'

branding:
icon: check-circle
color: blue

inputs:
github-token:
description: 'GitHub authentication token (https://docs.github.com/en/authentication)'
required: true
base-path:
description: 'Application base path (contains tsconfig.json)'
default: '.'
required: false
git-user-name:
description: 'Git commit user name'
default: 'rehearsal[bot]'
required: false
git-user-email:
description: 'Git commit user email'
default: '<>'
required: false
pull-request-branch:
description: 'Branch name to use in Pull Request'
default: 'rehearsal-bot/upgrade'
required: false
pull-request-draft:
description: 'Create a draft Pull Request'
default: false
required: false

runs:
using: 'node16'
main: 'bin/index.js'

0 comments on commit f8ad24f

Please sign in to comment.