diff --git a/.eslintrc.json b/.eslintrc.json index a38da33f..cd27de37 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -23,24 +23,20 @@ "sourceType": "module", "project": ["./tsconfig.json"], "ecmaFeatures": { - "jsx": true + "jsx": true } }, - "plugins": [ - "react", - "@typescript-eslint", - "react-hooks" - ], + "plugins": ["react", "@typescript-eslint", "react-hooks"], "rules": { "@typescript-eslint/semi": ["error", "always"], "@typescript-eslint/space-before-function-paren": 0, "prefer-arrow-callback": "error", "react/function-component-definition": [ - "error", - { - "namedComponents": "arrow-function", - "unnamedComponents": "arrow-function" - } + "error", + { + "namedComponents": "arrow-function", + "unnamedComponents": "arrow-function" + } ] }, "ignorePatterns": ["*/*.config.js", "*.config.js"], diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c807dfdf..b8943a69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,24 +1,23 @@ name: CI on: - push: - branches: - - main - pull_request: + push: + branches: + - main + pull_request: jobs: - build: - runs-on: [self-hosted, debian-stable] - steps: - - name: Clean Workspace - uses: mickem/clean-after-action@v1 - - name: Checkout - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - - name: Install dependencies - run: npm ci - - name: Compile - run: npm run tsc - + build: + runs-on: [self-hosted, debian-stable] + steps: + - name: Clean Workspace + uses: mickem/clean-after-action@v1 + - name: Checkout + uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install dependencies + run: npm ci + - name: Compile + run: npm run tsc diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index afd3bdf5..38f5084b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,35 +1,34 @@ name: Publish package on: - release: - types: [created] - + release: + types: [created] jobs: - build: - runs-on: [self-hosted, debian-stable] - steps: - - name: Clean Workspace - uses: mickem/clean-after-action@v1 - - name: Checkout - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - registry-url: 'https://npm.pkg.github.com' - scope: '@ZeroGachis' - # Skip post-install scripts here, as a malicious - # script could steal GITHUB_TOKEN. - - name: Install dependencies - run: npm ci --ignore-scripts - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # `npm rebuild` will run all those post-install scripts for us. - - name: Rebuild & Prepare dependencies - run: npm rebuild && npm run prepare --if-present - - name: Compile - run: npm run tsc - - name: Publish to Github Registry - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + build: + runs-on: [self-hosted, debian-stable] + steps: + - name: Clean Workspace + uses: mickem/clean-after-action@v1 + - name: Checkout + uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: 'https://npm.pkg.github.com' + scope: '@ZeroGachis' + # Skip post-install scripts here, as a malicious + # script could steal GITHUB_TOKEN. + - name: Install dependencies + run: npm ci --ignore-scripts + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # `npm rebuild` will run all those post-install scripts for us. + - name: Rebuild & Prepare dependencies + run: npm rebuild && npm run prepare --if-present + - name: Compile + run: npm run tsc + - name: Publish to Github Registry + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..1b8ac889 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +# Ignore artifacts: +build +coverage diff --git a/.prettierrc.json b/.prettierrc.json index a0efbdea..23581c70 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -4,6 +4,7 @@ "printWidth": 100, "tabWidth": 4, "trailingComma": "all", + "endOfLine": "crlf", "overrides": [ { "files": "*.json", diff --git a/example/src/App.tsx b/example/src/App.tsx index aa391223..7bcac069 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -28,4 +28,4 @@ const App = () => { ); }; -export default App; +export default App; diff --git a/package-lock.json b/package-lock.json index 0ffabb65..a995ca11 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "jest": "^28.1.1", "jest-junit": "^15.0.0", "pod-install": "^0.1.0", + "prettier": "2.8.4", "react": "18.1.0", "react-native": "0.70.6", "typescript": "^4.9.5" @@ -13746,6 +13747,21 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-format": { "version": "28.1.3", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.3.tgz", @@ -26337,6 +26353,12 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, + "prettier": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "dev": true + }, "pretty-format": { "version": "28.1.3", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.3.tgz", diff --git a/package.json b/package.json index 61c2df12..494abd55 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "jest": "^28.1.1", "jest-junit": "^15.0.0", "pod-install": "^0.1.0", + "prettier": "2.8.4", "react": "18.1.0", "react-native": "0.70.6", "typescript": "^4.9.5" @@ -77,7 +78,5 @@ "/example/node_modules", "/lib/" ] - }, - "dependencies": { } }