Skip to content

Commit

Permalink
feat: v1 (#4)
Browse files Browse the repository at this point in the history
* feat: v1

* refactor: `pnpm` -> `npm`

* refactor: polish

* fix: lint issues
  • Loading branch information
Yohe-Am authored Dec 15, 2023
1 parent 8eea525 commit 3700c7e
Show file tree
Hide file tree
Showing 29 changed files with 86,679 additions and 8,545 deletions.
5 changes: 2 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
lib/
dist/
node_modules/
coverage/
index.js
ghjk.ts
9 changes: 2 additions & 7 deletions .github/linters/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
env:
node: true
es6: true
jest: true

globals:
Atomics: readonly
Expand All @@ -10,8 +9,8 @@ globals:
ignorePatterns:
- '!.*'
- '**/node_modules/.*'
- '**/dist/.*'
- '**/coverage/.*'
- '*.js'
- 'ghjk.ts'
- '*.json'

parser: '@typescript-eslint/parser'
Expand All @@ -24,15 +23,13 @@ parserOptions:
- './tsconfig.json'

plugins:
- jest
- '@typescript-eslint'

extends:
- eslint:recommended
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
- plugin:github/recommended
- plugin:jest/recommended

rules:
{
Expand All @@ -51,8 +48,6 @@ rules:
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/explicit-member-accessibility':
['error', { 'accessibility': 'no-public' }],
'@typescript-eslint/explicit-function-return-type':
['error', { 'allowExpressions': true }],
'@typescript-eslint/func-call-spacing': ['error', 'never'],
'@typescript-eslint/no-array-constructor': 'error',
'@typescript-eslint/no-empty-interface': 'error',
Expand Down
9 changes: 7 additions & 2 deletions .github/linters/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"compilerOptions": {
"noEmit": true
},
"include": ["../../__tests__/**/*", "../../src/**/*"],
"exclude": ["../../dist", "../../node_modules", "../../coverage", "*.json"]
"include": ["../../src/*.ts"],
"exclude": [
"../../src/*.js",
"../../src/ghjk.ts",
"../../node_modules",
"*.json"
]
}
18 changes: 9 additions & 9 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# In TypeScript actions, `dist/` is a special directory. When you reference
# In TypeScript actions, `dist/`(index.js) is a special directory. When you reference
# an action with the `uses:` property, `dist/index.js` is the code that will be
# run. For this project, the `dist/index.js` file is transpiled from other
# source files. This workflow ensures the `dist/` directory contains the
Expand All @@ -20,7 +20,7 @@ permissions:

jobs:
check-dist:
name: Check dist/
name: Check index.js
runs-on: ubuntu-latest

steps:
Expand All @@ -39,26 +39,26 @@ jobs:
id: install
run: npm ci

- name: Build dist/ Directory
- name: Build index.js
id: build
run: npm run bundle
run: npm run build

# This will fail the workflow if the PR wasn't created by Dependabot.
- name: Compare Directories
id: diff
run: |
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then
if [ "$(git diff --ignore-space-at-eol --text index.js | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff --ignore-space-at-eol --text dist/
git diff --ignore-space-at-eol --text index.js
exit 1
fi
# If `dist/` was different than expected, and this was not a Dependabot
# If `index.js` was different than expected, and this was not a Dependabot
# PR, upload the expected version as a workflow artifact.
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
name: Upload Artifact
id: upload
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
name: index.js
path: index.js
42 changes: 5 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,6 @@ permissions:
contents: read

jobs:
test-typescript:
name: TypeScript Tests
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
cache: npm

- name: Install Dependencies
id: npm-ci
run: npm ci

- name: Check Format
id: npm-format-check
run: npm run format:check

- name: Lint
id: npm-lint
run: npm run lint

- name: Test
id: npm-ci-test
run: npm run ci-test

test-action:
name: GitHub Actions Test
runs-on: ubuntu-latest
Expand All @@ -54,9 +22,9 @@ jobs:
- name: Test Local Action
id: test-action
uses: ./
with:
milliseconds: 2000
env:
GHJK_VERSION: 6040bb3

- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.time }}"
- name: Check avail of pnpm
shell: bash
run: pnpm --version
48 changes: 0 additions & 48 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: super-linter/super-linter/slim@v5
env:
DEFAULT_BRANCH: main
FILTER_REGEX_EXCLUDE: dist/**/*
FILTER_REGEX_EXCLUDE: .*\.(js|md)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TYPESCRIPT_DEFAULT_STYLE: prettier
VALIDATE_ALL_CODEBASE: true
Expand Down
5 changes: 3 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist/
node_modules/
coverage/
index.js
ghjk.ts
LICENSE
4 changes: 0 additions & 4 deletions CODEOWNERS

This file was deleted.

Loading

0 comments on commit 3700c7e

Please sign in to comment.