@bigbinary/neeto-audit-frontend 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.github/CODEOWNERS +1 -0
  2. package/.github/pull_request_template.md +14 -0
  3. package/.github/release-drafter.yml +8 -0
  4. package/.github/workflows/auto_rebase_from_main.yml +15 -0
  5. package/.github/workflows/create_and_publish_release.yml +100 -0
  6. package/.nvmrc +1 -0
  7. package/README.md +3 -0
  8. package/common/.husky/_/husky.sh +36 -0
  9. package/common/.husky/helpers/lint_staged.sh +5 -0
  10. package/common/.husky/helpers/prevent_conflict_markers.sh +34 -0
  11. package/common/.husky/helpers/prevent_pushing_to_main.sh +22 -0
  12. package/common/.husky/pre-commit +9 -0
  13. package/common/.husky/pre-push +5 -0
  14. package/common/eslint/.eslintrc.js +1 -0
  15. package/common/prettier/.prettierrc.js +16 -0
  16. package/common/prettier/tailwind.config.js +11 -0
  17. package/common/recommendedDependencies/extension.js +11 -0
  18. package/common/recommendedDependencies/frontend.js +109 -0
  19. package/common/recommendedDependencies/index.js +5 -0
  20. package/common/recommendedDependencies/widget.js +11 -0
  21. package/dist/index.js +6099 -0
  22. package/package.json +36 -0
  23. package/rollup.config.js +33 -0
  24. package/src/cli.js +37 -0
  25. package/src/utils/index.js +159 -0
  26. package/src/verifiers/currentNodeVersion/constants.js +3 -0
  27. package/src/verifiers/currentNodeVersion/index.js +37 -0
  28. package/src/verifiers/currentNodeVersion/utils.js +5 -0
  29. package/src/verifiers/eslint/constants.js +7 -0
  30. package/src/verifiers/eslint/index.js +37 -0
  31. package/src/verifiers/husky/constants.js +9 -0
  32. package/src/verifiers/husky/index.js +46 -0
  33. package/src/verifiers/index.js +16 -0
  34. package/src/verifiers/prettier/constants.js +7 -0
  35. package/src/verifiers/prettier/index.js +40 -0
  36. package/src/verifiers/recommendedPackageVersions/constants.js +9 -0
  37. package/src/verifiers/recommendedPackageVersions/index.js +41 -0
  38. package/src/verifiers/recommendedPackageVersions/utils.js +30 -0
@@ -0,0 +1 @@
1
+ * @Thejus-Paul
@@ -0,0 +1,14 @@
1
+ - Fixes #issue_number
2
+
3
+ **Checklist**
4
+
5
+ - [ ] I have made corresponding changes to the documentation.
6
+ - [ ] I have verified the functionality in some of the neeto web-apps.
7
+ - [ ] I have added the necessary label (patch/minor/major - If package publish
8
+ is required).
9
+
10
+ <!---
11
+ ------------- NOTES -------------
12
+ 1. Do not add a patch/minor/major label if a release is not required.
13
+ 2. Strike through the points ~~like this~~ if not applicable.
14
+ --->
@@ -0,0 +1,8 @@
1
+ name-template: "v$RESOLVED_VERSION"
2
+ tag-template: "v$RESOLVED_VERSION"
3
+ template: |
4
+ ## What's Changed
5
+ $CHANGES
6
+
7
+
8
+ **Full Changelog**: https://github.com/bigbinary/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
@@ -0,0 +1,15 @@
1
+ name: PR-autoupdate-from-main
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ Auto:
10
+ name: Auto-update
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: bigbinary/pr-auto-update@v2.1.6
14
+ with:
15
+ github_token: ${{ secrets.AUTOREBASE_TOKEN }}
@@ -0,0 +1,100 @@
1
+ name: "Create and publish releases"
2
+ on:
3
+ pull_request:
4
+ branches:
5
+ - main
6
+ types:
7
+ - closed
8
+ jobs:
9
+ release:
10
+ name: "Create Release"
11
+ runs-on: ubuntu-latest
12
+ if: >-
13
+ ${{ github.event.pull_request.merged == true && (
14
+ contains(github.event.pull_request.labels.*.name, 'patch') ||
15
+ contains(github.event.pull_request.labels.*.name, 'minor') ||
16
+ contains(github.event.pull_request.labels.*.name, 'major') ) }}
17
+ steps:
18
+ - name: Checkout the repository
19
+ uses: actions/checkout@v3
20
+
21
+ - name: Setup git user
22
+ run: |
23
+ git config user.name "Thejus Paul"
24
+ git config user.email "thejuspaul@pm.me"
25
+
26
+ - name: Setup NodeJS LTS version
27
+ uses: actions/setup-node@v3
28
+ with:
29
+ node-version-file: ".nvmrc"
30
+
31
+ - name: Install PNPM
32
+ uses: pnpm/action-setup@v2
33
+ id: pnpm-install
34
+ with:
35
+ version: latest
36
+ run_install: false
37
+
38
+ - name: Get pnpm store directory
39
+ id: pnpm-cache
40
+ shell: bash
41
+ run: |
42
+ echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
43
+
44
+ - uses: actions/cache@v3
45
+ name: Setup pnpm cache
46
+ with:
47
+ path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
48
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
49
+ restore-keys: |
50
+ ${{ runner.os }}-pnpm-store-
51
+
52
+ - name: Install dependencies
53
+ run: pnpm install
54
+
55
+ - name: Generate production build
56
+ run: pnpm build
57
+
58
+ - name: Disable Git commit hooks
59
+ run: git config core.hooksPath /dev/null
60
+
61
+ - name: Bump the patch version and create git tag on release
62
+ if: ${{ contains(github.event.pull_request.labels.*.name, 'patch') }}
63
+ run: pnpm version patch
64
+
65
+ - name: Bump the minor version and create git tag on release
66
+ if: ${{ contains(github.event.pull_request.labels.*.name, 'minor') }}
67
+ run: pnpm version minor
68
+
69
+ - name: Bump the major version and create git tag on release
70
+ if: ${{ contains(github.event.pull_request.labels.*.name, 'major') }}
71
+ run: pnpm version major
72
+
73
+ - name: Get the package version from package.json
74
+ uses: tyankatsu0105/read-package-version-actions@5aad2bb630a577ee4255546eb3ee0593df68f6ca
75
+ id: package-version
76
+
77
+ - name: Create a new version release commit
78
+ uses: EndBug/add-and-commit@050a66787244b10a4874a2a5f682130263edc192
79
+ with:
80
+ message: "New version release"
81
+
82
+ - name: Push the commit to main
83
+ uses: ad-m/github-push-action@492de9080c3179a3187bd456763f988f9a06e196
84
+ with:
85
+ github_token: ${{ secrets.GITHUB_TOKEN }}
86
+ branch: main
87
+
88
+ - name: Create a release draft on release
89
+ uses: release-drafter/release-drafter@ac463ffd9cc4c6ad5682af93dc3e3591c4657ee3
90
+ env:
91
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92
+ with:
93
+ tag: v${{ steps.package-version.outputs.version }}
94
+ publish: true
95
+
96
+ - name: Publish the package on NPM
97
+ uses: JS-DevTools/npm-publish@22595ff8c4d0d9f53cef0656fbb90fbe06ee885c
98
+ with:
99
+ access: "public"
100
+ token: ${{ secrets.NPM_TOKEN }}
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 18.16
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # neeto-audit-frontend
2
+
3
+ Audits neeto frontend codebase for issues and suggests a fix.
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env sh
2
+ if [ -z "$husky_skip_init" ]; then
3
+ debug () {
4
+ if [ "$HUSKY_DEBUG" = "1" ]; then
5
+ echo "husky (debug) - $1"
6
+ fi
7
+ }
8
+
9
+ readonly hook_name="$(basename -- "$0")"
10
+ debug "starting $hook_name..."
11
+
12
+ if [ "$HUSKY" = "0" ]; then
13
+ debug "HUSKY env variable is set to 0, skipping hook"
14
+ exit 0
15
+ fi
16
+
17
+ if [ -f ~/.huskyrc ]; then
18
+ debug "sourcing ~/.huskyrc"
19
+ . ~/.huskyrc
20
+ fi
21
+
22
+ readonly husky_skip_init=1
23
+ export husky_skip_init
24
+ sh -e "$0" "$@"
25
+ exitCode="$?"
26
+
27
+ if [ $exitCode != 0 ]; then
28
+ echo "husky - $hook_name hook exited with code $exitCode (error)"
29
+ fi
30
+
31
+ if [ $exitCode = 127 ]; then
32
+ echo "husky - command not found in PATH=$PATH"
33
+ fi
34
+
35
+ exit $exitCode
36
+ fi
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+
3
+ lint_staged_files() {
4
+ npx lint-staged
5
+ }
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env sh
2
+
3
+ repeat() {
4
+ char="$1"
5
+ times="$2"
6
+ text=""
7
+ i=0
8
+
9
+ while [ $i -lt $times ]
10
+ do
11
+ text="${text}${char}"
12
+ i=$((i+1))
13
+ done
14
+ echo "$text"
15
+ }
16
+
17
+ prevent_conflict_markers() {
18
+ RED=$(tput setab 1)
19
+ NORMAL=$(tput sgr0)
20
+
21
+ left_arrow=$(repeat '<' 7)
22
+ right_arrow=$(repeat '>' 7)
23
+ equal_symbol=$(repeat '=' 7)
24
+
25
+ CONFLICT_MARKERS="${left_arrow}|${equal_symbol}|${right_arrow}"
26
+ occurrences_count=$(git --no-pager diff --staged --ignore-blank-lines --name-only -G"$CONFLICT_MARKERS" | wc -l)
27
+ if [ "$occurrences_count" -gt 0 ]
28
+ then
29
+ echo "$RED ERROR $NORMAL Found ${CONFLICT_MARKERS} symbols in staged files."
30
+ echo "Conflict markers should be removed from the following files before committing:"
31
+ git --no-pager diff --staged --ignore-blank-lines --name-only -G"$CONFLICT_MARKERS"
32
+ exit 1;
33
+ fi
34
+ }
@@ -0,0 +1,22 @@
1
+ #!/bin/sh
2
+
3
+ prevent_pushing_to_main() {
4
+ current_branch=`git symbolic-ref HEAD`
5
+ current_origin=`git remote`
6
+ if [ current_origin = "origin" -o "$current_branch" = "refs/heads/master" -o "$current_branch" = "refs/heads/main" ]
7
+ then
8
+ cat <<EOT
9
+ ======================================================================================
10
+ You are not authorized to push/commit directly to master/main branch in origin remote.
11
+ Push from a new branch and make the PR.
12
+ Or if you are 100% sure you want to push/commit to master/main branch,
13
+ then pass in the optional --no-verify option with the git command.
14
+ Example:
15
+ # Warning: pushing to main is not recommended
16
+ git push origin main --no-verify
17
+ ======================================================================================
18
+ EOT
19
+ echo "";
20
+ exit 1;
21
+ fi
22
+ }
@@ -0,0 +1,9 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+ . "$(dirname "$0")/helpers/lint_staged.sh"
4
+ . "$(dirname "$0")/helpers/prevent_pushing_to_main.sh"
5
+ . "$(dirname "$0")/helpers/prevent_conflict_markers.sh"
6
+
7
+ prevent_pushing_to_main
8
+ prevent_conflict_markers
9
+ lint_staged_files
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+ . "$(dirname "$0")/helpers/prevent_pushing_to_main.sh"
4
+
5
+ prevent_pushing_to_main
@@ -0,0 +1 @@
1
+ module.exports = require("@bigbinary/neeto-commons-frontend/configs/nanos/eslint/index.js");
@@ -0,0 +1,16 @@
1
+ module.exports = {
2
+ tailwindConfig: "./tailwind.config.js",
3
+ trailingComma: "es5",
4
+ arrowParens: "avoid",
5
+ printWidth: 80,
6
+ tabWidth: 2,
7
+ useTabs: false,
8
+ semi: true,
9
+ quoteProps: "as-needed",
10
+ jsxSingleQuote: false,
11
+ singleQuote: false,
12
+ bracketSpacing: true,
13
+ bracketSameLine: false,
14
+ proseWrap: "always",
15
+ endOfLine: "lf",
16
+ };
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ important: true,
3
+ purge: {
4
+ enabled: process.env.NODE_ENV === "production",
5
+ content: [
6
+ "./{src,example,stories}/**/*.{js,jsx}",
7
+ "./node_modules/@bigbinary/**/*.js",
8
+ ],
9
+ defaultExtractor: content => content.match(/[A-Za-z0-9-_:/]+/g) || [],
10
+ },
11
+ };
@@ -0,0 +1,11 @@
1
+ const DEPENDENCIES = {};
2
+
3
+ const DEV_DEPENDENCIES = {};
4
+
5
+ const PEER_DEPENDENCIES = {};
6
+
7
+ export default {
8
+ dependencies: DEPENDENCIES,
9
+ devDependencies: DEV_DEPENDENCIES,
10
+ peerDependencies: PEER_DEPENDENCIES,
11
+ };
@@ -0,0 +1,109 @@
1
+ const DEPENDENCIES = {};
2
+
3
+ const DEV_DEPENDENCIES = {
4
+ "@babel/core": "7.22.8",
5
+ "@babel/eslint-parser": "7.22.7",
6
+ "@babel/plugin-transform-runtime": "7.22.7",
7
+ "@babel/preset-env": "7.22.7",
8
+ "@babel/preset-react": "7.22.5",
9
+ "@babel/preset-typescript": "7.22.5",
10
+ "@babel/runtime": "7.22.6",
11
+ "@bigbinary/babel-preset-neeto": "1.0.3",
12
+ "@bigbinary/eslint-plugin-neeto": "1.0.64",
13
+ "@bigbinary/neeto-commons-frontend": "2.0.94",
14
+ "@bigbinary/neeto-filters-frontend": "2.11.18",
15
+ "@bigbinary/neeto-icons": "1.12.3",
16
+ "@bigbinary/neeto-molecules": "1.0.34",
17
+ "@bigbinary/neetoui": "5.0.13",
18
+ "@faker-js/faker": "8.0.2",
19
+ "@honeybadger-io/react": "2.0.1",
20
+ "@rollup/plugin-alias": "5.0.0",
21
+ "@rollup/plugin-babel": "6.0.3",
22
+ "@rollup/plugin-commonjs": "25.0.2",
23
+ "@rollup/plugin-json": "6.0.0",
24
+ "@rollup/plugin-node-resolve": "15.1.0",
25
+ "@rollup/plugin-replace": "5.0.2",
26
+ "@svgr/rollup": "8.0.1",
27
+ antd: "4.24.10",
28
+ autoprefixer: "10.4.14",
29
+ axios: "1.4.0",
30
+ "babel-loader": "9.1.3",
31
+ "babel-plugin-istanbul": "6.1.1",
32
+ "babel-plugin-js-logger": "1.0.17",
33
+ "babel-plugin-macros": "3.1.0",
34
+ "babel-plugin-transform-react-remove-prop-types": "0.4.24",
35
+ "babel-preset-react": "6.24.1",
36
+ "babel-preset-typescript": "7.0.0-alpha.19",
37
+ classnames: "2.3.2",
38
+ eslint: "8.44.0",
39
+ "eslint-config-prettier": "8.8.0",
40
+ "eslint-plugin-cypress": "2.13.3",
41
+ "eslint-plugin-import": "2.27.5",
42
+ "eslint-plugin-jam3": "0.2.3",
43
+ "eslint-plugin-json": "3.1.0",
44
+ "eslint-plugin-prettier": "4.2.1",
45
+ "eslint-plugin-promise": "6.1.1",
46
+ "eslint-plugin-react": "7.32.2",
47
+ "eslint-plugin-react-hooks": "4.6.0",
48
+ "eslint-plugin-unused-imports": "2.0.0",
49
+ formik: "2.4.2",
50
+ husky: "8.0.3",
51
+ i18next: "23.2.8",
52
+ "js-logger": "1.6.1",
53
+ "lint-staged": "13.2.3",
54
+ "mixpanel-browser": "2.47.0",
55
+ postcss: "8.4.25",
56
+ "postcss-import": "15.1.0",
57
+ "postcss-loader": "7.3.3",
58
+ "postcss-preset-env": "9.0.0",
59
+ prettier: "2.8.8",
60
+ "prettier-plugin-tailwindcss": "0.3.0",
61
+ qs: "6.11.2",
62
+ ramda: "0.29.0",
63
+ react: "17.0.2",
64
+ "react-dom": "17.0.2",
65
+ "react-helmet": "6.1.0",
66
+ "react-i18next": "13.0.1",
67
+ "react-query": "3.39.3",
68
+ "react-router-dom": "5.3.4",
69
+ "react-toastify": "8.2.0",
70
+ rollup: "2.79.1",
71
+ "rollup-plugin-analyzer": "4.0.0",
72
+ "rollup-plugin-cleaner": "1.0.0",
73
+ "rollup-plugin-peer-deps-external": "2.2.4",
74
+ "rollup-plugin-styles": "4.0.0",
75
+ sass: "1.63.6",
76
+ tailwindcss: "npm:@tailwindcss/postcss7-compat",
77
+ util: "0.12.5",
78
+ yup: "1.2.0",
79
+ };
80
+
81
+ const PEER_DEPENDENCIES = {
82
+ "@bigbinary/neeto-commons-frontend": "^2.0.54",
83
+ "@bigbinary/neeto-filters-frontend": "^2.8.1",
84
+ "@bigbinary/neeto-icons": "^1.9.22",
85
+ "@bigbinary/neeto-molecules": "^1.0.9",
86
+ "@bigbinary/neetoui": "^4.4.10",
87
+ "@honeybadger-io/react": "^2.0.1",
88
+ axios: "^0.27.2",
89
+ classnames: "^2.3.2",
90
+ formik: "^2.2.9",
91
+ i18next: "^22.5.1",
92
+ "js-logger": "^1.6.1",
93
+ "mixpanel-browser": "^2.45.0",
94
+ ramda: "^0.29.0",
95
+ react: "17.0.2",
96
+ "react-dom": "17.0.2",
97
+ "react-helmet": "^6.1.0",
98
+ "react-i18next": "^12.3.1",
99
+ "react-query": "3.39.2",
100
+ "react-router-dom": "5.3.0",
101
+ "react-toastify": "8.2.0",
102
+ yup: "^0.32.11",
103
+ };
104
+
105
+ export default {
106
+ dependencies: DEPENDENCIES,
107
+ devDependencies: DEV_DEPENDENCIES,
108
+ peerDependencies: PEER_DEPENDENCIES,
109
+ };
@@ -0,0 +1,5 @@
1
+ import frontend from "./frontend";
2
+ import extension from "./extension";
3
+ import widget from "./widget";
4
+
5
+ export default { extension, frontend, widget };
@@ -0,0 +1,11 @@
1
+ const DEPENDENCIES = {};
2
+
3
+ const DEV_DEPENDENCIES = {};
4
+
5
+ const PEER_DEPENDENCIES = {};
6
+
7
+ export default {
8
+ dependencies: DEPENDENCIES,
9
+ devDependencies: DEV_DEPENDENCIES,
10
+ peerDependencies: PEER_DEPENDENCIES,
11
+ };