Skip to content

Commit 48af637

Browse files
Merge pull request #359 from contentstack/staging
DX | 04-08-2025 | Release
2 parents ce9e220 + 9749db7 commit 48af637

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+6296
-3461
lines changed

.babelrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['@babel/preset-env']
3+
};

.eslintrc.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
module.exports = {
2+
env: {
3+
"es2020": true,
4+
"node": true,
5+
"browser": true,
6+
"jest": true
7+
},
8+
extends: 'standard',
9+
// "globals": {
10+
// "Atomics": "readonly",
11+
// "SharedArrayBuffer": "readonly"
12+
// },
13+
// "parserOptions": {
14+
// "ecmaFeatures": {
15+
// "jsx": true
16+
// },
17+
// "ecmaVersion": 2015,
18+
// "sourceType": "module"
19+
// },
20+
parser: "@babel/eslint-parser", // Use Babel parser to handle modern JS syntax
21+
plugins: [
22+
'standard',
23+
'promise'
24+
],
25+
rules: {
26+
'semi': ['error', 'always'],
27+
'semi-spacing': ['error', { before: false, after: true }],
28+
'camelcase': 'off',
29+
'no-tabs': 'off',
30+
'eqeqeq': 'off',
31+
'no-unused-vars': 'warn',
32+
'no-undef': 'warn',
33+
'no-prototype-builtins': 'off',
34+
'no-extend-native': 'off',
35+
'no-fallthrough': 'off',
36+
'prefer-promise-reject-errors': 'off',
37+
'prefer-regex-literals': 'off',
38+
'no-useless-escape': 'off',
39+
'n/handle-callback-err': 'off',
40+
'n/no-callback-literal': 'off',
41+
'no-async-promise-executor': 'off'
42+
}
43+
};

.github/workflows/link-check.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint Check on PR
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout the repository
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: '22.x'
19+
registry-url: 'https://registry.npmjs.org'
20+
21+
- name: Install dependencies
22+
run: npm install
23+
24+
- name: Run ESLint
25+
run: npm run lint

.husky/pre-commit

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/usr/bin/env sh
2+
# Pre-commit hook to run lint, Snyk and Talisman scans, completing all before deciding to commit
3+
4+
# Function to check if a command exists
5+
command_exists() {
6+
command -v "$1" >/dev/null 2>&1
7+
}
8+
9+
# Allow bypassing the hook with an environment variable
10+
if [ "$SKIP_HOOK" = "1" ]; then
11+
echo "Skipping lint, Snyk and Talisman scans (SKIP_HOOK=1)."
12+
exit 0
13+
fi
14+
15+
# Run ESLint check first
16+
echo "Running ESLint check..."
17+
npm run lint
18+
lint_exit_code=$?
19+
20+
if [ $lint_exit_code -ne 0 ]; then
21+
echo "ESLint check failed. Please fix the linting issues and try again."
22+
echo "You can run 'npm run format' to auto-fix most issues."
23+
exit 1
24+
fi
25+
26+
echo "ESLint check passed."
27+
28+
# Check if Snyk is installed
29+
if ! command_exists snyk; then
30+
echo "Error: Snyk is not installed. Please install it and try again."
31+
exit 1
32+
fi
33+
34+
# Check if Talisman is installed
35+
if ! command_exists talisman; then
36+
echo "Error: Talisman is not installed. Please install it and try again."
37+
exit 1
38+
fi
39+
40+
# Initialize variables to track scan results
41+
snyk_failed=false
42+
talisman_failed=false
43+
44+
# Run Snyk vulnerability scan
45+
echo "Running Snyk vulnerability scan..."
46+
snyk test --all-projects > snyk_output.log 2>&1
47+
snyk_exit_code=$?
48+
49+
if [ $snyk_exit_code -eq 0 ]; then
50+
echo "Snyk scan passed: No vulnerabilities found."
51+
elif [ $snyk_exit_code -eq 1 ]; then
52+
echo "Snyk found vulnerabilities. See snyk_output.log for details."
53+
snyk_failed=true
54+
else
55+
echo "Snyk scan failed with error (exit code $snyk_exit_code). See snyk_output.log for details."
56+
snyk_failed=true
57+
fi
58+
59+
# Run Talisman secret scan (continues even if Snyk failed)
60+
echo "Running Talisman secret scan..."
61+
talisman --githook pre-commit > talisman_output.log 2>&1
62+
talisman_exit_code=$?
63+
64+
if [ $talisman_exit_code -eq 0 ]; then
65+
echo "Talisman scan passed: No secrets found."
66+
else
67+
echo "Talisman scan failed (exit code $talisman_exit_code). See talisman_output.log for details."
68+
talisman_failed=true
69+
fi
70+
71+
# Evaluate results after both scans
72+
if [ "$snyk_failed" = true ] || [ "$talisman_failed" = true ]; then
73+
echo "Commit aborted due to issues found in one or both scans."
74+
[ "$snyk_failed" = true ] && echo "- Snyk issues: Check snyk_output.log"
75+
[ "$talisman_failed" = true ] && echo "- Talisman issues: Check talisman_output.log"
76+
exit 1
77+
fi
78+
79+
# If all checks pass, allow the commit
80+
echo "All checks passed (ESLint, Snyk, Talisman). Proceeding with commit."
81+
rm -f snyk_output.log talisman_output.log
82+
exit 0

.talismanrc

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,33 @@ fileignoreconfig:
66
- filename: .github/workflows/secrets-scan.yml
77
checksum: d79ec3f3288964f7d117b9ad319a54c0ebc152e35f69be8fde95522034fdfb2a
88
- filename: package-lock.json
9-
checksum: f9d78235efa541f481a7966b0a95af27e30a6ecb6bf3049b7ae0053fbc6f2b48
9+
checksum: 215757874c719e0192e440dd4b98f4dfb6824f72e526047182fcd60cc03e3e80
10+
- filename: src/core/modules/assets.js
11+
checksum: 00f19d659b830b0f145b4db0ccf3211a4048d9488f30a224fe3c31cacca6dcd2
12+
- filename: .husky/pre-commit
13+
checksum: 52a664f536cf5d1be0bea19cb6031ca6e8107b45b6314fe7d47b7fad7d800632
14+
- filename: src/core/cache.js
15+
checksum: 85025b63df8db4a3f94ace5c7f088ea0e4d55eb8324d2265ea4a470b0c610fce
16+
- filename: src/core/cache-provider/localstorage.js
17+
checksum: 33266a67a003b665957e4a445e821b9295632cff75be0a71baf35b3576c55aa4
18+
- filename: src/core/modules/entry.js
19+
checksum: 49d6742d014ce111735611ebab16dc8c888ce8d678dfbc99620252257e780ec5
20+
- filename: src/core/contentstack.js
21+
checksum: 22e723507c1fed8b3175b57791f4249889c9305b79e5348d59d741bdf4f006ba
22+
- filename: test/config.js
23+
checksum: 4ada746af34f2868c038f53126c08c21d750ddbd037d0a62e88824dd5d9e20be
24+
- filename: test/live-preview/live-preview-test.js
25+
checksum: d742465789e00a17092a7e9664adda4342a13bc4975553371a26df658f109952
26+
- filename: src/core/lib/request.js
27+
checksum: 040f4fd184a96c57d0eb9e7134ae6ff65f8e9039c38c852c9a0f00825b4c69f1
28+
- filename: test/sync/sync-testcases.js
29+
checksum: 391b557a147c658a50256b49dcdd20fd053eb32966e9244d98c93142e4dcbf2e
30+
- filename: src/core/modules/taxonomy.js
31+
checksum: 115e63b4378809b29a037e2889f51e300edfd18682b3b6c0a4112c270fc32526
32+
- filename: src/core/modules/query.js
33+
checksum: aa6596a353665867586d00cc64225f0dea7edacc3bcfab60002a5727bd927132
34+
- filename: src/core/stack.js
35+
checksum: a467e56edcb43858512c47bd82c76dbf8799d57837f03c247e2cebe27ca5eaa8
36+
- filename: src/core/lib/utils.js
37+
checksum: 7ae53c3be5cdcd1468d66577c9450adc53e9c6aaeaeabc4275e87a47aa709850
1038
version: ""

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
## Change log
2+
### Version: 3.26.2
3+
#### Date: Aug-04-2025
4+
##### Fix:
5+
- Dependency Updated
6+
- Lint issues resolved
27

38
### Version: 3.26.1
49
#### Date: July-28-2025

0 commit comments

Comments
 (0)