Skip to content

Commit

Permalink
Merge pull request #268 from react-hookz/esm
Browse files Browse the repository at this point in the history
feat: switch to module package
  • Loading branch information
xobotyi authored Feb 4, 2024
2 parents 684ed31 + 62f9df7 commit 6d502e9
Show file tree
Hide file tree
Showing 19 changed files with 3,423 additions and 3,490 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
indent_style = tab
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 100

[*.yml]
indent_style = space
indent_size = 2
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.idea
node_modules
coverage
CHANGELOG.md
src/**/*.js
src/**/*.cjs
src/**/*.d.ts
!.eslintrc.cjs
!.prettierrc.cjs
!.github
37 changes: 37 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const commonJSRules = {};

module.exports = {
root: true,

parserOptions: {
extraFileExtensions: ['.md'],
},

settings: {
'import/ignore': ['react-apexcharts'],
},

overrides: [
{
files: ['*.js', '*.cjs', '*.jsx', '*.cjsx'],
extends: ['@react-hookz/eslint-config/base.cjs'],
rules: {
...commonJSRules,
},
},
{
files: ['*.ts', '*.cts', '*.tsx'],
parserOptions: {
project: './tsconfig.eslint.json',
},
extends: ['@react-hookz/eslint-config/typescript.cjs'],
rules: {
...commonJSRules,
},
},
{
files: ['*.md'],
extends: ['@react-hookz/eslint-config/md.cjs'],
},
],
};
22 changes: 0 additions & 22 deletions .eslintrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ updates:
timezone: "Etc/UTC"
rebase-strategy: auto
versioning-strategy: increase
commit-message:
prefix: "fix(deps)"
prefix-development: "chore(deps)"
36 changes: 9 additions & 27 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 16

- uses: bahmutov/npm-install@v1
with:
useRollingCache: true
install-command: yarn --frozen-lockfile

- name: "Lint"
run: yarn lint -f @react-hookz/gha

build:
name: "Build"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20

- uses: bahmutov/npm-install@v1
with:
Expand All @@ -55,13 +34,16 @@ jobs:
- name: "Build"
run: yarn build

- name: "Lint"
run: yarn lint -f @react-hookz/gha

dependabot-merge:
name: "Dependabot automerge"
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
needs: [ "build", "lint" ]
needs: [ "lint" ]
if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
steps:
- uses: fastify/github-action-merge-dependabot@v3
Expand All @@ -71,7 +53,7 @@ jobs:
semantic-release:
name: "Release"
runs-on: ubuntu-latest
needs: [ "build", "lint" ]
needs: [ "lint" ]
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
outputs:
new-release-published: ${{ steps.release.outputs.new-release-published }}
Expand All @@ -83,7 +65,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20

- uses: bahmutov/npm-install@v1
with:
Expand All @@ -95,15 +77,15 @@ jobs:

- name: "Release"
id: "release"
uses: codfish/semantic-release-action@v3.0.0
uses: codfish/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

gen-contributors:
name: "Generate Contributors List"
runs-on: ubuntu-latest
needs: [ "build", "lint" ]
needs: [ "lint" ]
if: github.event_name == 'push'
permissions:
contents: write
Expand Down
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/.idea
/dist
/node_modules
yarn-error.log
node_modules
/coverage
/src/**/*.js
/src/**/*.cjs
/src/**/*.d.ts
/src/**/*.d.cts
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!/src/**/*.js
!/src/**/*.d.ts
3 changes: 3 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const config = require('@react-hookz/eslint-config/.prettierrc.cjs');

module.exports = config;
3 changes: 0 additions & 3 deletions .prettierrc.js

This file was deleted.

6 changes: 6 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'footer-max-line-length': [1, 'always', 100],
},
};
6 changes: 0 additions & 6 deletions commitlint.config.js

This file was deleted.

156 changes: 85 additions & 71 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,73 +1,87 @@
{
"name": "@react-hookz/eslint-formatter-gha",
"description": "Eslint formatter that that outputs GitHub Actions annotations.",
"version": "1.0.1",
"keywords": [
"eslint",
"formatter",
"github",
"eslint-formatter",
"eslintformatter",
"guthub-actions",
"guthubactions"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/react-hookz/eslint-formatter-gha.git"
},
"bugs": {
"url": "https://github.com/react-hookz/eslint-formatter-gha/issues"
},
"publishConfig": {
"access": "public"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"/dist"
],
"lint-staged": {
"*.{js,jsx,ts,tsx,md,mdx}": "eslint --fix"
},
"release": {
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/github"
]
},
"scripts": {
"prepare": "husky install",
"lint": "eslint ./ --ext ts,js,tsx,jsx,md,mdx",
"lint:fix": "yarn lint --fix",
"build": "yarn build:cleanup && yarn build:cjs",
"build:cleanup": "rimraf ./dist",
"build:cjs": "tsc -p ./tsconfig.build.json"
},
"dependencies": {
"@actions/core": "^1.10.1"
},
"devDependencies": {
"@commitlint/cli": "^17.7.2",
"@commitlint/config-conventional": "^17.8.0",
"@commitlint/cz-commitlint": "^17.7.2",
"@react-hookz/eslint-config": "^1.8.0",
"@react-hookz/eslint-formatter-gha": "^1.0.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^8.1.0",
"@types/eslint": "^8.44.4",
"@types/node": "^20.8.6",
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"prettier": "^2.8.8",
"rimraf": "^5.0.5",
"semantic-release": "^19.0.5",
"typescript": "^5.2.2",
"yarn": "^1.22.19"
}
"name": "@react-hookz/eslint-formatter-gha",
"description": "Eslint formatter that that outputs GitHub Actions annotations.",
"version": "1.0.1",
"keywords": [
"eslint",
"formatter",
"github",
"eslint-formatter",
"eslintformatter",
"guthub-actions",
"guthubactions"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/react-hookz/eslint-formatter-gha.git"
},
"bugs": {
"url": "https://github.com/react-hookz/eslint-formatter-gha/issues"
},
"publishConfig": {
"access": "public"
},
"type": "module",
"main": "./src/index.js",
"types": "./src/index.d.ts",
"sideEffects": false,
"exports": {
".": {
"require": "./src/index.cjs"
}
},
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"@actions/core": "^1.10.1"
},
"devDependencies": {
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@commitlint/cz-commitlint": "^18.6.0",
"@react-hookz/eslint-config": "^2.1.5",
"@react-hookz/eslint-formatter-gha": "^1.0.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^9.2.6",
"@types/eslint": "^8.56.2",
"@types/node": "^20.11.16",
"eslint": "^8.56.0",
"eslint-plugin-prettier": "^5.1.3",
"husky": "^9.0.10",
"lint-staged": "^15.2.1",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"semantic-release": "^23.0.0",
"typescript": "^5.3.3",
"yarn": "^1.22.21"
},
"scripts": {
"prepare": "husky install",
"commit": "git-cz",
"build": "yarn build:clean && tsc --version && tsc",
"build:clean": "yarn rimraf -g ./src/**/*.js ./src/**/*.d.ts",
"lint": "eslint .",
"lint:fix": "yarn lint --fix --fix-type problem,suggestion,layout"
},
"config": {
"commitizen": {
"path": "@commitlint/cz-commitlint"
}
},
"lint-staged": {
"*.{js,jsx,ts,cts,tsx,md,mdx}": "eslint --fix"
},
"release": {
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git",
"@semantic-release/github"
]
}
}
Loading

0 comments on commit 6d502e9

Please sign in to comment.