Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(*): typescript prettier vitest #57

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"presets": ["amex"]
"presets": ["amex"],
"plugins": ["@babel/plugin-transform-typescript"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does babel-preset-amex need TS support?

e.g.

{
  "presets": ["amex/ts"]
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

honestly, we maybe don't even need a separate file. could just use overrides for .ts and .tsx

}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
lib
node_modules
test-results
coverage
49 changes: 48 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
{
"extends": "amex"
"extends": ["amex", "plugin:@typescript-eslint/recommended", "prettier"],
"settings": { "import/resolver": { "typescript": {} } },
"parserOptions": {
"project": true,
"extraFileExtensions": [".json"]
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
Comment on lines +3 to +9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a ts dir to the eslint config like we did for prettier?

I think that updating the eslint config with TS support should block this PR

"overrides": [
{
"files": ["__tests__/**"],
"extends": ["amex/test", "plugin:@typescript-eslint/recommended", "prettier"],
"rules": {
"import/extensions": [
"error",
"ignorePackages",
{
"ts": "never",
"tsx": "never",
"js": "never",
"jsx": "never"
}
]
}
},
{
"files": ["src/**"],
"extends": [
"amex",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/strict-type-checked",
"prettier"
],
"rules": {
"import/extensions": [
"error",
"ignorePackages",
{
"ts": "never",
"tsx": "never",
"js": "never",
"jsx": "never"
}
]
}
}
],
"ignorePatterns": ["types"]
}
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, tests ran to see how -->
<!--- your change affects other areas of the code, etc. -->

## Types of Changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation (adding or updating documentation)
- [ ] Dependency update

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] My change requires a change to the documentation and I have updated the documentation accordingly.
- [ ] My changes are in sync with the code style of this project.
- [ ] There aren't any other open Pull Requests for the same issue/update.
Expand All @@ -33,4 +40,5 @@
- [ ] I have added the Apache 2.0 license header to any new files created.

## What is the Impact to Developers Using vitruvius?

<!--- Please describe how your changes impacts developers using vitruvius. -->
36 changes: 18 additions & 18 deletions .github/workflows/health-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ name: Health Check
on:
schedule:
# At minute 0 past hour 0800 and 2000.
- cron: '0 8,20 * * *'
- cron: '0 8,20 * * *'

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '18.x', '20.x' ]
node: ['18.x', '20.x']
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2
- run: |
git remote set-branches --add origin main
git fetch
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: npm ci
env:
NODE_ENV: development
- name: Run Test Script
run: npm run test
env:
NODE_ENV: production
- uses: actions/checkout@v2
- run: |
git remote set-branches --add origin main
git fetch
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: npm ci
env:
NODE_ENV: development
- name: Run Test Script
run: npm run test
env:
NODE_ENV: production
8 changes: 4 additions & 4 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Pull Request Labeler"
name: 'Pull Request Labeler'
on:
pull_request_target:
types: [opened, reopened]
Expand All @@ -7,6 +7,6 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v3
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/labeler@v3
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
if: ${{ steps.release.outputs.release_created }}
25 changes: 12 additions & 13 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@ name: Mark stale issues and pull requests

on:
schedule:
- cron: "0 0 * * *"
- cron: '0 0 * * *'

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity.'
stale-pr-message: 'This pull request is stale because it has been open 30 days with no activity.'
stale-issue-label: 'stale-issue'
exempt-issue-labels: 'enhancement,documentation,good-first-issue,question'
stale-pr-label: 'stale-pr'
exempt-pr-labels: 'work-in-progress'
days-before-stale: 30
days-before-close: -1
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity.'
stale-pr-message: 'This pull request is stale because it has been open 30 days with no activity.'
stale-issue-label: 'stale-issue'
exempt-issue-labels: 'enhancement,documentation,good-first-issue,question'
stale-pr-label: 'stale-pr'
exempt-pr-labels: 'work-in-progress'
days-before-stale: 30
days-before-close: -1
58 changes: 29 additions & 29 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '18.x', '20.x']
node: ['18.x', '20.x']
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v2
- run: |
git remote set-branches --add origin main
git fetch
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: npm ci
env:
NODE_ENV: development
- name: Unit Tests
run: npm run test:unit
env:
NODE_ENV: production
- name: Git History Test
run: npm run test:git-history
env:
NODE_ENV: production
- name: Lockfile Lint Test
run: npm run test:lockfile
env:
NODE_ENV: production
- name: Lint
run: npm run test:lint
env:
NODE_ENV: production
- uses: actions/checkout@v2
- run: |
git remote set-branches --add origin main
git fetch
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: npm ci
env:
NODE_ENV: development
- name: Unit Tests
run: npm run test:unit
env:
NODE_ENV: production
- name: Git History Test
run: npm run test:git-history
env:
NODE_ENV: production
- name: Lockfile Lint Test
run: npm run test:lockfile
env:
NODE_ENV: production
- name: Lint
run: npm run test:lint
env:
NODE_ENV: production
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
test-results
.jest-cache
coverage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an .npmignore that also needs updating?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in f04d16d

node_modules
lib
*.log
*.swp
*.tgz
types

.idea
.vscode
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
test-results
node_modules
src
!types/src
*.log
*.swp
package-lock.json
commitlint.config.js
.jest-cache
coverage
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/types
/lib
/test-results
coverage
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
11 changes: 4 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,20 @@

## [3.0.1](https://github.com/americanexpress/vitruvius/compare/v3.0.0...v3.0.1) (2024-02-07)


### Bug Fixes

* **release-please:** use npmrc and set registry ([#52](https://github.com/americanexpress/vitruvius/issues/52)) ([2d881d3](https://github.com/americanexpress/vitruvius/commit/2d881d353bb382ed3623703804165f9fa4c09159))
- **release-please:** use npmrc and set registry ([#52](https://github.com/americanexpress/vitruvius/issues/52)) ([2d881d3](https://github.com/americanexpress/vitruvius/commit/2d881d353bb382ed3623703804165f9fa4c09159))

## [3.0.0](https://github.com/americanexpress/vitruvius/compare/v2.0.1...v3.0.0) (2024-02-06)


### ⚠ BREAKING CHANGES

* **node:** drops support for node versions <18.x
- **node:** drops support for node versions <18.x

### Features

* **redux:** redux 5 compatible ([#47](https://github.com/americanexpress/vitruvius/issues/47)) ([e23b819](https://github.com/americanexpress/vitruvius/commit/e23b81951d494cfc15fcb39efa63ec4f25a1d0ad))

- **redux:** redux 5 compatible ([#47](https://github.com/americanexpress/vitruvius/issues/47)) ([e23b819](https://github.com/americanexpress/vitruvius/commit/e23b81951d494cfc15fcb39efa63ec4f25a1d0ad))

### Miscellaneous Chores

* **node:** drops support for node versions &lt;18.x ([0d9708d](https://github.com/americanexpress/vitruvius/commit/0d9708dd701ee3cac29ce9540cae125f3e64bd77))
- **node:** drops support for node versions &lt;18.x ([0d9708d](https://github.com/americanexpress/vitruvius/commit/0d9708dd701ee3cac29ce9540cae125f3e64bd77))
Loading
Loading