Skip to content

Commit 90a322c

Browse files
committed
feat: v3.0.0 - ML integration, leetspeak detection, Unicode normalization
- Add ML-powered toxicity detection with TensorFlow.js integration - Implement leetspeak detection with 3 intensity levels (basic, moderate, aggressive) - Add Unicode normalization for homoglyph and obfuscation detection - Implement result caching with LRU eviction for high-performance repeated checks - Add configuration export/import for sharing between environments - Add comprehensive benchmarks for both JS and Python packages - Update documentation with new features and API reference
1 parent 7f641ec commit 90a322c

36 files changed

+6314
-69
lines changed

.github/dependabot.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
version: 2
2+
updates:
3+
# Root npm dependencies
4+
- package-ecosystem: "npm"
5+
directory: "/"
6+
schedule:
7+
interval: "monthly"
8+
open-pull-requests-limit: 3
9+
groups:
10+
# Group ALL minor and patch updates together
11+
all-minor-patch:
12+
patterns:
13+
- "*"
14+
update-types:
15+
- "minor"
16+
- "patch"
17+
labels:
18+
- "dependencies"
19+
commit-message:
20+
prefix: "chore(deps)"
21+
22+
# JavaScript package (packages/js)
23+
- package-ecosystem: "npm"
24+
directory: "/packages/js"
25+
schedule:
26+
interval: "monthly"
27+
open-pull-requests-limit: 3
28+
groups:
29+
# Group dev dependencies
30+
dev-dependencies:
31+
dependency-type: "development"
32+
update-types:
33+
- "minor"
34+
- "patch"
35+
# Group production dependencies
36+
production:
37+
dependency-type: "production"
38+
update-types:
39+
- "minor"
40+
- "patch"
41+
labels:
42+
- "dependencies"
43+
- "javascript"
44+
commit-message:
45+
prefix: "chore(deps)"
46+
47+
# Python dependencies
48+
- package-ecosystem: "pip"
49+
directory: "/packages/py"
50+
schedule:
51+
interval: "monthly"
52+
open-pull-requests-limit: 2
53+
groups:
54+
all-python:
55+
patterns:
56+
- "*"
57+
update-types:
58+
- "minor"
59+
- "patch"
60+
labels:
61+
- "dependencies"
62+
- "python"
63+
commit-message:
64+
prefix: "chore(deps)"
65+
66+
# GitHub Actions
67+
- package-ecosystem: "github-actions"
68+
directory: "/"
69+
schedule:
70+
interval: "monthly"
71+
open-pull-requests-limit: 2
72+
groups:
73+
actions:
74+
patterns:
75+
- "*"
76+
labels:
77+
- "dependencies"
78+
commit-message:
79+
prefix: "chore(deps)"

.github/workflows/auto-release.yml

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,27 @@ jobs:
6565
echo "Manual release triggered: ${{ github.event.inputs.release_type }} (${{ github.event.inputs.channel }})"
6666
exit 0
6767
fi
68-
68+
69+
# Get the commit message
70+
COMMIT_MSG=$(git log -1 --pretty=%B)
71+
echo "Commit message: $COMMIT_MSG"
72+
73+
# Skip release for dependency updates and version bumps
74+
if [[ "$COMMIT_MSG" =~ ^chore\(deps ]] || \
75+
[[ "$COMMIT_MSG" =~ ^Merge\ pull\ request.*dependabot ]] || \
76+
[[ "$COMMIT_MSG" =~ \[skip\ ci\] ]] || \
77+
[[ "$COMMIT_MSG" =~ ^chore:\ bump\ version ]]; then
78+
echo "should_release=false" >> $GITHUB_OUTPUT
79+
echo "⏭️ Skipping release for dependency/maintenance commit"
80+
exit 0
81+
fi
82+
6983
# Use sync-versions.js script for semantic release detection
7084
chmod +x scripts/sync-versions.js
71-
85+
7286
# Check if commit should trigger a release using our semantic detection
7387
RELEASE_OUTPUT=$(node scripts/sync-versions.js detect 2>&1)
74-
88+
7589
if echo "$RELEASE_OUTPUT" | grep -q "should_release=true"; then
7690
echo "$RELEASE_OUTPUT" >> $GITHUB_OUTPUT
7791
echo "🎯 Semantic release detected"
@@ -210,6 +224,7 @@ jobs:
210224
publish-npm:
211225
name: 📦 Publish to npm
212226
runs-on: ubuntu-latest
227+
environment: npm-publish
213228
needs: [detect-release, bump-version, build]
214229
if: always() && needs.detect-release.outputs.should_release == 'true' && needs.build.result == 'success'
215230

@@ -238,17 +253,20 @@ jobs:
238253
name: packages-${{ github.sha }}
239254
path: ./artifacts/
240255

241-
- name: 🔧 Install root dependencies
256+
- name: 🔧 Upgrade npm for OIDC support
257+
run: npm install -g npm@latest
258+
259+
- name: 🔧 Install root dependencies
242260
run: |
243261
# Install root dependencies to get husky and other tools
244262
npm ci
245-
263+
246264
- name: 📦 Publish to npm
247265
working-directory: packages/js
248266
run: |
249267
npm ci --ignore-scripts
250268
npm run build
251-
269+
252270
# Determine npm tag
253271
if [ "${{ needs.detect-release.outputs.channel }}" = "beta" ]; then
254272
NPM_TAG="beta"
@@ -257,11 +275,11 @@ jobs:
257275
else
258276
NPM_TAG="latest"
259277
fi
260-
278+
261279
echo "Publishing to npm with tag: $NPM_TAG"
262-
npm publish --tag $NPM_TAG
263-
env:
264-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
280+
# Using OIDC trusted publisher - no token needed
281+
# --provenance adds verified build attestation
282+
npm publish --tag $NPM_TAG --provenance --access public
265283
266284
# Publish to PyPI
267285
publish-pypi:
@@ -335,10 +353,17 @@ jobs:
335353
run: |
336354
git config --local user.email "action@github.com"
337355
git config --local user.name "GitHub Action"
338-
356+
339357
TAG_NAME="v${{ needs.bump-version.outputs.new_version }}"
340-
git tag $TAG_NAME
341-
git push origin $TAG_NAME
358+
359+
# Check if tag already exists
360+
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
361+
echo "⚠️ Tag $TAG_NAME already exists, skipping tag creation"
362+
else
363+
git tag $TAG_NAME
364+
git push origin $TAG_NAME
365+
echo "✅ Created and pushed tag $TAG_NAME"
366+
fi
342367
343368
- name: 📝 Generate Release Notes
344369
id: notes

0 commit comments

Comments
 (0)