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

Refactor: upgrade to ts project #46

Merged
merged 5 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
7 changes: 0 additions & 7 deletions .babelrc

This file was deleted.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/*.md
15 changes: 12 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@
"es6": true,
"node": true
},
"extends": ["@alifd/eslint-config-next", "prettier"],
"parser": "@typescript-eslint/parser",
"extends": [
"@alifd/eslint-config-next",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"plugins": ["@typescript-eslint"],
"rules": {
"valid-jsdoc": "off",
"max-statements": "off",
"max-len": "off",
"no-unused-vars": 1,
"import/prefer-default-export": 0
"import/prefer-default-export": 0,
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "warn",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "error"
}
}
57 changes: 6 additions & 51 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,19 @@ name: test
on: [push, pull_request]

jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master

- name: setup node
uses: actions/setup-node@v2
with:
node-version: '14'

- name: cache package-lock.json
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}

- name: create package-lock.json
run: npm i --package-lock-only --legacy-peer-deps

- name: hack for singe file
run: |
if [ ! -d "package-temp-dir" ]; then
mkdir package-temp-dir
fi
cp package-lock.json package-temp-dir
- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}

- name: install
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
run: npm ci

test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@master
- uses: actions/checkout@v3

- name: restore cache from package-lock.json
uses: actions/cache@v2
- uses: actions/setup-node@v3
with:
path: package-temp-dir
key: lock-${{ github.sha }}
node-version: 16
cache: 'npm'

- name: restore cache from node_modules
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
- run: npm ci

- name: test
run: npm test
- run: npm run test

- name: coverage
run: bash <(curl -s https://codecov.io/bash)
needs: setup
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
4 changes: 2 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"singleQuote": true,
"overrides": [
{
"files": "*.d.ts",
"files": "package.json",
"options": {
"parser": "typescript"
"tabWidth": 2
}
}
]
Expand Down
28 changes: 0 additions & 28 deletions demo/usage.md

This file was deleted.

8 changes: 0 additions & 8 deletions ice.config.js

This file was deleted.

2 changes: 2 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
coverageDirectory: './coverage/',
collectCoverage: true,
verbose: true,
preset: 'ts-jest/presets/js-with-ts',
};
Loading