Skip to content

Commit 1e4f346

Browse files
author
tanvi
committed
feat: initial release of schema-sentinel v1.0.0
- Schema inference engine (JSON, XML, GraphQL) - Schema diff engine with 10 drift types and severity levels - Multi-format report generator (Console, JSON, Markdown, HTML) - File-based snapshot store with versioning - CLI tool with 6 commands (snapshot, check, diff, list, history, watch) - Watch mode with webhook alerts for monitoring - 101 tests across 6 test suites - Integration examples for Jest, Mocha, Playwright, Cypress, Karate, REST Assured, pytest, Postman - CI/CD GitHub Actions workflows
0 parents  commit 1e4f346

46 files changed

Lines changed: 10107 additions & 0 deletions

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
node-version: [18, 20, 22]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
25+
- name: Install dependencies
26+
run: npm ci
27+
28+
- name: Build
29+
run: npm run build
30+
31+
- name: Run tests
32+
run: npm test
33+
34+
- name: Upload coverage
35+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == 20
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: coverage-report
39+
path: coverage/
40+
41+
publish:
42+
needs: test
43+
runs-on: ubuntu-latest
44+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
45+
permissions:
46+
contents: read
47+
id-token: write
48+
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- uses: actions/setup-node@v4
53+
with:
54+
node-version: 20
55+
registry-url: 'https://registry.npmjs.org'
56+
57+
- run: npm ci
58+
- run: npm run build
59+
- run: npm test
60+
61+
# Only publish if version changed
62+
- name: Check if version changed
63+
id: version
64+
run: |
65+
PUBLISHED=$(npm view schema-sentinel version 2>/dev/null || echo "0.0.0")
66+
CURRENT=$(node -p "require('./package.json').version")
67+
echo "published=$PUBLISHED" >> $GITHUB_OUTPUT
68+
echo "current=$CURRENT" >> $GITHUB_OUTPUT
69+
if [ "$PUBLISHED" != "$CURRENT" ]; then
70+
echo "changed=true" >> $GITHUB_OUTPUT
71+
else
72+
echo "changed=false" >> $GITHUB_OUTPUT
73+
fi
74+
75+
- name: Publish to npm
76+
if: steps.version.outputs.changed == 'true'
77+
run: npm publish --provenance --access public
78+
env:
79+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
80+

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version bump type (patch, minor, major)'
8+
required: true
9+
default: 'patch'
10+
type: choice
11+
options:
12+
- patch
13+
- minor
14+
- major
15+
16+
jobs:
17+
release:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
id-token: write
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
with:
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: 20
31+
registry-url: 'https://registry.npmjs.org'
32+
33+
- run: npm ci
34+
- run: npm run build
35+
- run: npm test
36+
37+
- name: Configure Git
38+
run: |
39+
git config user.name "github-actions[bot]"
40+
git config user.email "github-actions[bot]@users.noreply.github.com"
41+
42+
- name: Bump version
43+
run: npm version ${{ inputs.version }} -m "release: v%s"
44+
45+
- name: Push tag
46+
run: git push origin main --tags
47+
48+
- name: Publish to npm
49+
run: npm publish --provenance --access public
50+
env:
51+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
52+
53+
- name: Create GitHub Release
54+
uses: softprops/action-gh-release@v2
55+
with:
56+
tag_name: v${{ steps.version.outputs.new_version }}
57+
generate_release_notes: true
58+

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build output
5+
dist/
6+
7+
# Test output
8+
coverage/
9+
test/.test-schemas/
10+
test/.test-file-store/
11+
12+
# Temp files
13+
.tmp/
14+
*.log
15+
16+
# IDE
17+
.idea/
18+
.vscode/
19+
*.swp
20+
*.swo
21+
22+
# OS
23+
.DS_Store
24+
Thumbs.db
25+
26+
# Schema store (demo)
27+
demo-schemas/
28+

.npmignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Source (published package only needs dist/)
2+
src/
3+
test/
4+
integrations/
5+
6+
# Config files
7+
tsconfig.json
8+
tsconfig.build.json
9+
jest.config.js
10+
.eslintrc*
11+
.prettierrc*
12+
13+
# Dev files
14+
.github/
15+
coverage/
16+
node_modules/
17+
*.log
18+
.tmp/
19+
20+
# Misc
21+
api-schema-drift-detector-plan.md
22+

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MIT License
2+
3+
Copyright (c) 2026 schema-sentinel contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

0 commit comments

Comments
 (0)