@bigbinary/neeto-audit-frontend 2.0.20 → 2.1.1
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.
- package/.neetoci/bump_version.yml +15 -0
- package/.nvmrc +1 -1
- package/.scripts/bump_version.sh +67 -0
- package/common/.husky/common/helpers/lint_staged.sh +0 -0
- package/common/.husky/common/helpers/neeto_audit_frontend.sh +0 -0
- package/common/.husky/common/helpers/prevent_conflict_markers.sh +0 -0
- package/common/.husky/common/helpers/prevent_pushing_to_main.sh +0 -0
- package/common/.husky/common/pre-commit +0 -0
- package/common/.husky/extension/pre-push +0 -0
- package/common/.husky/frontend/pre-push +0 -0
- package/common/.husky/nano/pre-push +0 -0
- package/common/.husky/widget/pre-push +0 -0
- package/dist/index.js +1 -1
- package/package.json +8 -8
- package/src/cli.js +0 -0
- package/src/verifiers/currentNodeVersion/constants.js +1 -1
- package/.github/workflows/auto_rebase_from_main.yml +0 -15
- package/.github/workflows/create_and_publish_release.yml +0 -99
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
version: v1.0
|
|
2
|
+
fail_fast: true
|
|
3
|
+
is_cypress: false
|
|
4
|
+
plan: standard-2
|
|
5
|
+
|
|
6
|
+
triggers:
|
|
7
|
+
- event: branch
|
|
8
|
+
branch_name: main
|
|
9
|
+
- event: pull_request
|
|
10
|
+
|
|
11
|
+
commands:
|
|
12
|
+
- checkout
|
|
13
|
+
- neetoci-version node 22.13
|
|
14
|
+
- neetoci-version ruby 3.3.5
|
|
15
|
+
- bash ./.scripts/bump_version.sh
|
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
22.13
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
install_gh() {
|
|
2
|
+
type -p curl >/dev/null || sudo apt install curl -y
|
|
3
|
+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
|
|
4
|
+
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
|
|
5
|
+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null
|
|
6
|
+
sudo apt update
|
|
7
|
+
sudo apt install gh -y
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
bump_package() {
|
|
11
|
+
echo "== Bump the PNPM package version =="
|
|
12
|
+
npm install -g pnpm
|
|
13
|
+
pnpm install
|
|
14
|
+
pnpm build
|
|
15
|
+
pnpm config set version-tag-prefix "v"
|
|
16
|
+
pnpm version "$VERSION_LABEL" --no-git-tag-version
|
|
17
|
+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >~/.npmrc
|
|
18
|
+
pnpm publish --no-git-checks
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
raise_pr() {
|
|
22
|
+
git config user.name "Thejus Paul"
|
|
23
|
+
git config user.email "thejuspaul@pm.me"
|
|
24
|
+
git config core.hooksPath /dev/null
|
|
25
|
+
git push origin --delete bump-version
|
|
26
|
+
git checkout -b bump-version
|
|
27
|
+
git add -A
|
|
28
|
+
git commit -m "Bump version"
|
|
29
|
+
git push --set-upstream origin bump-version
|
|
30
|
+
gh pr create -B main -H bump-version -t "Bump version" -b "This is an automated PR." -l mergepr -a @me
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
install_gh
|
|
34
|
+
|
|
35
|
+
LATEST_COMMIT_SHA=$(git log -1 --pretty=format:"%H")
|
|
36
|
+
echo "Latest commit SHA: $LATEST_COMMIT_SHA"
|
|
37
|
+
|
|
38
|
+
PR_NUMBER=$(gh pr list --state merged --search "$LATEST_COMMIT_SHA" --json number --jq ".[0].number")
|
|
39
|
+
echo "Last merged PR number: $PR_NUMBER"
|
|
40
|
+
|
|
41
|
+
PR_LABELS=$(gh pr view $PR_NUMBER --json labels --jq ".labels[].name" | tr "\n" " " | cut -d " " -f 1-)
|
|
42
|
+
echo "PR labels: $PR_LABELS"
|
|
43
|
+
|
|
44
|
+
[[ -z "$PR_LABELS" ]] && exit 0
|
|
45
|
+
|
|
46
|
+
ALL_VERSION_LABELS=(major minor patch)
|
|
47
|
+
|
|
48
|
+
PR_VERSION_LABELS=()
|
|
49
|
+
for version_label in "${ALL_VERSION_LABELS[@]}"; do
|
|
50
|
+
if echo "$PR_LABELS" | grep -q -o "$version_label"; then
|
|
51
|
+
PR_VERSION_LABELS+=("$version_label")
|
|
52
|
+
fi
|
|
53
|
+
done
|
|
54
|
+
|
|
55
|
+
PR_VERSION_LABELS_STR="${PR_VERSION_LABELS[*]}"
|
|
56
|
+
echo "Semantic versions present in PR labels: $PR_VERSION_LABELS_STR"
|
|
57
|
+
|
|
58
|
+
VERSION_LABEL=$(echo "${PR_VERSION_LABELS[0]}" | xargs)
|
|
59
|
+
echo "Version label selected: $VERSION_LABEL"
|
|
60
|
+
|
|
61
|
+
if [[ -n "$VERSION_LABEL" ]]; then
|
|
62
|
+
bump_package
|
|
63
|
+
else
|
|
64
|
+
echo "PR label doesn't exist"
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
raise_pr
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -15881,7 +15881,7 @@ const getPackageJson = async (debug) => {
|
|
|
15881
15881
|
|
|
15882
15882
|
const NVMRC_FILE_PATH = "./.nvmrc";
|
|
15883
15883
|
|
|
15884
|
-
const REQUIRED_NODE_VERSION = { major:
|
|
15884
|
+
const REQUIRED_NODE_VERSION = { major: 22, minor: 0, patch: 0 };
|
|
15885
15885
|
|
|
15886
15886
|
const getSemVer = (version) =>
|
|
15887
15887
|
version
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-audit-frontend",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Audits neeto frontend codebase for issues and suggests a fix.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./dist/index.js",
|
|
@@ -9,10 +9,6 @@
|
|
|
9
9
|
"audit",
|
|
10
10
|
"frontend"
|
|
11
11
|
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"build": "rollup -c",
|
|
14
|
-
"release": "rollup -c && yalc push --sig"
|
|
15
|
-
},
|
|
16
12
|
"author": "Thejus Paul <thejuspaul@protonmail.ch>",
|
|
17
13
|
"license": "UNLICENSED",
|
|
18
14
|
"devDependencies": {
|
|
@@ -40,8 +36,12 @@
|
|
|
40
36
|
"@bigbinary/neeto-commons-frontend": "^3.1.10",
|
|
41
37
|
"ramda": "^0.29.1"
|
|
42
38
|
},
|
|
43
|
-
"packageManager": "pnpm@8.
|
|
39
|
+
"packageManager": "pnpm@8.15.9+sha512.499434c9d8fdd1a2794ebf4552b3b25c0a633abcee5bb15e7b5de90f32f47b513aca98cd5cfd001c31f0db454bc3804edccd578501e4ca293a6816166bbd9f81",
|
|
44
40
|
"engines": {
|
|
45
|
-
"node": ">=
|
|
41
|
+
"node": ">=22"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "rollup -c",
|
|
45
|
+
"release": "rollup -c && yalc push --sig"
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
}
|
package/src/cli.js
CHANGED
|
File without changes
|
|
@@ -1,99 +0,0 @@
|
|
|
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@v4
|
|
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@v4
|
|
28
|
-
with:
|
|
29
|
-
node-version: "20"
|
|
30
|
-
|
|
31
|
-
- name: Install PNPM
|
|
32
|
-
uses: pnpm/action-setup@v4
|
|
33
|
-
id: pnpm-install
|
|
34
|
-
with:
|
|
35
|
-
run_install: false
|
|
36
|
-
|
|
37
|
-
- name: Get pnpm store directory
|
|
38
|
-
id: pnpm-cache
|
|
39
|
-
shell: bash
|
|
40
|
-
run: |
|
|
41
|
-
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
42
|
-
|
|
43
|
-
- uses: actions/cache@v4
|
|
44
|
-
name: Setup pnpm cache
|
|
45
|
-
with:
|
|
46
|
-
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
47
|
-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
48
|
-
restore-keys: |
|
|
49
|
-
${{ runner.os }}-pnpm-store-
|
|
50
|
-
|
|
51
|
-
- name: Install dependencies
|
|
52
|
-
run: pnpm install
|
|
53
|
-
|
|
54
|
-
- name: Generate production build
|
|
55
|
-
run: pnpm build
|
|
56
|
-
|
|
57
|
-
- name: Disable Git commit hooks
|
|
58
|
-
run: git config core.hooksPath /dev/null
|
|
59
|
-
|
|
60
|
-
- name: Bump the patch version and create git tag on release
|
|
61
|
-
if: ${{ contains(github.event.pull_request.labels.*.name, 'patch') }}
|
|
62
|
-
run: pnpm version patch
|
|
63
|
-
|
|
64
|
-
- name: Bump the minor version and create git tag on release
|
|
65
|
-
if: ${{ contains(github.event.pull_request.labels.*.name, 'minor') }}
|
|
66
|
-
run: pnpm version minor
|
|
67
|
-
|
|
68
|
-
- name: Bump the major version and create git tag on release
|
|
69
|
-
if: ${{ contains(github.event.pull_request.labels.*.name, 'major') }}
|
|
70
|
-
run: pnpm version major
|
|
71
|
-
|
|
72
|
-
- name: Get the package version from package.json
|
|
73
|
-
uses: tyankatsu0105/read-package-version-actions@5aad2bb630a577ee4255546eb3ee0593df68f6ca
|
|
74
|
-
id: package-version
|
|
75
|
-
|
|
76
|
-
- name: Create a new version release commit
|
|
77
|
-
uses: EndBug/add-and-commit@050a66787244b10a4874a2a5f682130263edc192
|
|
78
|
-
with:
|
|
79
|
-
message: "New version release"
|
|
80
|
-
|
|
81
|
-
- name: Push the commit to main
|
|
82
|
-
uses: ad-m/github-push-action@492de9080c3179a3187bd456763f988f9a06e196
|
|
83
|
-
with:
|
|
84
|
-
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
85
|
-
branch: main
|
|
86
|
-
|
|
87
|
-
- name: Create a release draft on release
|
|
88
|
-
uses: release-drafter/release-drafter@ac463ffd9cc4c6ad5682af93dc3e3591c4657ee3
|
|
89
|
-
env:
|
|
90
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
91
|
-
with:
|
|
92
|
-
tag: v${{ steps.package-version.outputs.version }}
|
|
93
|
-
publish: true
|
|
94
|
-
|
|
95
|
-
- name: Publish the package on NPM
|
|
96
|
-
uses: JS-DevTools/npm-publish@22595ff8c4d0d9f53cef0656fbb90fbe06ee885c
|
|
97
|
-
with:
|
|
98
|
-
access: "public"
|
|
99
|
-
token: ${{ secrets.NPM_TOKEN }}
|