Skip to content

Commit cf64bba

Browse files
Merge pull request #41 from Seen-Arabic/chore/repository-cleanup
chore: clean up repository tooling and release checks
2 parents 34927a2 + 2339c84 commit cf64bba

23 files changed

Lines changed: 269 additions & 229 deletions

‎.gitattributes‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

‎.github/ISSUE_TEMPLATE/bug_report.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ assignees: ''
2626

2727
يرجى توضيح البيئة التي كنت تستخدمها عند حدوث المشكلة. يمكن ذلك أن يشمل:
2828

29-
- بيئة التشغيل (مثل Node.js 22.x، أو المتصفح Chrome، أو Next.js / Vite)
30-
- إصدار الحزمة arabic-services (مثل 1.1.0)
31-
- نظام التشغيل (مثل Windows أو Linux أو macOS)
29+
- بيئة التشغيل (مثل Node.js 22.x، أو المتصفح Chrome، أو Next.js / Vite)
30+
- إصدار الحزمة arabic-services (مثل 1.1.0)
31+
- نظام التشغيل (مثل Windows أو Linux أو macOS)
3232

3333
## السلوك المتوقع (Expected Behavior)
3434

‎.github/ISSUE_TEMPLATE/feature_request.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ assignees: ''
3030

3131
هل تعتبر هذه الميزة ذات أهمية عالية أم منخفضة؟ يرجى تحديد درجة الأهمية بوضوح.
3232

33-
- [ ] عالية الأهمية
34-
- [ ] متوسطة الأهمية
35-
- [ ] منخفضة الأهمية
33+
- [ ] عالية الأهمية
34+
- [ ] متوسطة الأهمية
35+
- [ ] منخفضة الأهمية

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
1-
## وصف الفكرة (Feature Idea)
1+
## ملخص التغيير (Summary)
22

3-
يرجى وصف الفكرة أو الميزة الجديدة التي تود إضافتها إلى المشروع بوضوح هنا. يمكن أن تكون هذه الفكرة ميزة جديدة أو تحسين على ميزة موجودة.
3+
اشرح المشكلة والتغيير الناتج، واربط الـIssue إن وجد.
44

5-
## الهدف (Goal)
5+
## التوافق (Compatibility)
66

7-
ما الهدف من هذه الميزة؟ ما الفائدة التي ستقدمها للمستخدمين والمطورين؟ يرجى توضيح الفائدة والقيمة المضافة التي ستحققها هذه الفكرة.
7+
وضّح أي تأثير على الـAPI أو القيم الافتراضية أو النتائج أو طرق استيراد الحزمة.
88

9-
## سياق الاستخدام (Use Case)
9+
## التحقق (Validation)
1010

11-
يرجى توضيح سيناريوهات الاستخدام التي تتطلب هذه الميزة. ما هي الحالات التي ستُستخدم فيها؟ وما الأوضاع التي تحتاج إلى هذه الميزة؟
11+
اذكر الأوامر والنتائج وأي فحوص لم تُنفذ.
1212

13-
## توصيف تفصيلي (Detailed Description)
14-
15-
يرجى تقديم توصيف مفصل لكيفية عمل هذه الميزة والتفاصيل الفنية اللازمة لتنفيذها. يمكنك توضيح واجهة المستخدم المقترحة، وكيفية تفاعل المستخدم مع الميزة، وأي تأثيرات قد تكون لها على المشروع.
16-
17-
## السياق الإضافي (Additional Context)
18-
19-
هل هناك أي سياق إضافي يمكن أن يساعد في فهم الفكرة وأهميتها؟ يمكنك توضيح المزيد من التفاصيل التقنية أو وضع روابط لموارد مرتبطة بالفكرة.
20-
21-
## الأهمية (Priority)
22-
23-
هل تعتبر هذه الميزة ذات أهمية عالية أم منخفضة؟ يرجى تحديد درجة الأهمية بوضوح.
24-
25-
- [ ] عالية الأهمية
26-
- [ ] متوسطة الأهمية
27-
- [ ] منخفضة الأهمية
13+
- [ ] `npm run format:check`
14+
- [ ] `npm run lint`
15+
- [ ] `npm test` (source tests, build, artifact tests)
16+
- [ ] تحديث التوثيق و`[Unreleased]` عند الحاجة، مع الحفاظ على الإصدارات السابقة.

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ jobs:
3232
- name: Install dependencies
3333
run: npm ci
3434

35-
- name: Run lint, build, and tests
36-
run: npm run lint && npm run build && npm test
35+
- name: Check formatting, lint, and tests
36+
run: npm run format:check && npm run lint && npm test

‎.github/workflows/npm-publish.yml‎

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,68 @@
11
name: Publish Package to npmjs
22

3-
# Trigger this workflow when a release is published
43
on:
54
release:
65
types: [published]
76
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: 'Existing release tag to publish (for example, v1.2.0)'
10+
required: true
11+
type: string
812

913
jobs:
1014
build:
11-
# Specify the runner environment
1215
runs-on: ubuntu-latest
1316
permissions:
1417
contents: write
1518
id-token: write
19+
env:
20+
RELEASE_TAG: ${{ github.event.release.tag_name || inputs.tag }}
1621

1722
steps:
18-
# Step 1: Check out the repository's code
1923
- name: Check out repository
2024
uses: actions/checkout@v4
25+
with:
26+
ref: ${{ env.RELEASE_TAG }}
27+
fetch-depth: 0
2128

22-
# Step 2: Set up Node.js environment
2329
- name: Set up Node.js
2430
uses: actions/setup-node@v4
2531
with:
26-
node-version: '24' # Node 24 includes npm 11+ required for OIDC Trusted Publishing
32+
node-version: '24'
33+
34+
- name: Verify release tag and version
35+
run: |
36+
node <<'NODE'
37+
const { execFileSync } = require('node:child_process');
38+
const { version } = require('./package.json');
39+
const tag = process.env.RELEASE_TAG;
40+
if (tag !== `v${version}`) {
41+
throw new Error('Release tag must match the package.json version');
42+
}
43+
const commit = ref => execFileSync('git', ['rev-parse', '--verify', ref], { encoding: 'utf8' }).trim();
44+
if (commit(`refs/tags/${tag}^{commit}`) !== commit('HEAD')) {
45+
throw new Error('The checked-out commit must match the release tag');
46+
}
47+
NODE
2748
28-
# Step 3: Install dependencies using npm ci
2949
- name: Install dependencies
3050
run: npm ci
3151

32-
# Step 4: Build package and bundles
33-
- name: Build package and bundles
34-
id: build
35-
run: npm run build
52+
- name: Check formatting, lint, and tests
53+
id: verify
54+
run: npm run format:check && npm run lint && npm test
3655

37-
# Step 5: Publish the package to npm using Trusted Publishing (OIDC)
3856
- name: Publish to npm
39-
run: npm publish --provenance --access public
57+
# Verification already built and tested these artifacts; local publishing keeps prepublishOnly.
58+
run: npm publish --provenance --access public --ignore-scripts
4059

41-
# Step 6: Upload bundle assets to release
4260
- name: Upload bundle assets to release
43-
if: always() && steps.build.outcome == 'success'
61+
if: always() && steps.verify.outcome == 'success'
4462
uses: softprops/action-gh-release@v2
4563
with:
64+
tag_name: ${{ env.RELEASE_TAG }}
65+
fail_on_unmatched_files: true
4666
files: |
4767
dist/umd/arabic-services.umd.js
4868
dist/umd/arabic-services.umd.js.map

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Thumbs.db
1515

1616
# Test results and coverage
1717
coverage/
18+
.tree-shaking-*/
1819
*.test.ts.snap
1920

2021
# Environment variables

‎.npmignore‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Testing
2-
__tests__/
2+
tests/
33
coverage/
4-
jest.config.js
54
*.test.ts
65
*.test.ts.snap
76

‎.prettierignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/dist
2+
CHANGELOG.md
3+
package-lock.json

‎AGENT.md‎

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)