Skip to content

Commit 7fcbba7

Browse files
Merge branch 'main' into 70-enforce-type-safety-production-build-validation
2 parents c5304f1 + 34bcc91 commit 7fcbba7

116 files changed

Lines changed: 4769 additions & 9420 deletions

File tree

Some content is hidden

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

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Starknet Configuration
2+
NEXT_PUBLIC_STARKNET_NETWORK=goerli-alpha
3+
# NEXT_PUBLIC_STARKNET_RPC_URL=https://your-rpc-endpoint.com
4+
5+
# Optional: For production deployments
6+
# NEXT_PUBLIC_STARKNET_NETWORK=mainnet-alpha

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
.next/
3+
public/
4+
build/
5+
coverage/

.eslintrc.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,18 @@
1313
"@typescript-eslint/no-unused-expressions": "warn"
1414
}
1515
}
16+
{
17+
"extends": [
18+
"next/core-web-vitals",
19+
"next/typescript",
20+
"prettier"
21+
],
22+
"plugins": [
23+
"prettier"
24+
],
25+
"rules": {
26+
"@typescript-eslint/no-unused-vars": "off",
27+
"@typescript-eslint/no-explicit-any": "off",
28+
"prettier/prettier": "error"
29+
}
30+
}

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: TeachLink Community
4+
url: https://t.me/teachlinkOD
5+
about: Ask questions and discuss changes with maintainers.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: "PR Quality Gates / Governance"
2+
description: "Work related to CI, branch protection, PR process, governance"
3+
title: "[Governance] <short description>"
4+
labels: ["frontend", "devops", "ci", "governance", "priority-high"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Use this template for branch protection, CI, and PR process improvements.
10+
11+
- type: input
12+
id: background
13+
attributes:
14+
label: Background
15+
description: Why is this needed?
16+
validations:
17+
required: true
18+
19+
- type: textarea
20+
id: acceptance
21+
attributes:
22+
label: Acceptance Criteria
23+
description: List the conditions that must be true to close this issue.
24+
value: |
25+
- [ ] PR cannot merge without passing CI
26+
- [ ] PR cannot merge without approval
27+
- [ ] Direct push to main/develop is blocked
28+
- [ ] All PRs must reference an issue
29+
- [ ] All conversations must be resolved
30+
validations:
31+
required: true
32+
33+
- type: textarea
34+
id: implementation
35+
attributes:
36+
label: Implementation notes
37+
description: Optional implementation plan / links.
38+
validations:
39+
required: false

.github/branch-protection.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Branch protection (repository settings)
2+
3+
These are **GitHub repository settings** (not enforced by code). Configure them under:
4+
**Settings → Branches → Branch protection rules**.
5+
6+
## Protected branches
7+
Create rules for:
8+
- `main`
9+
- `develop`
10+
11+
## Required settings
12+
Enable the following options:
13+
14+
### блок direct pushes
15+
-**Restrict who can push to matching branches** (recommended)
16+
-**Do not allow force pushes**
17+
-**Do not allow deletions**
18+
19+
### Require PRs
20+
-**Require a pull request before merging**
21+
-**Require approvals**: at least **1** (or **2** if desired)
22+
-**Dismiss stale approvals when new commits are pushed**
23+
-**Require conversation resolution before merging**
24+
25+
### Require checks
26+
-**Require status checks to pass before merging**
27+
- ✅ Select required checks from `Frontend CI`:
28+
- `type-check`
29+
- `lint`
30+
- `build`
31+
- `test`
32+
33+
### Keep branch up to date
34+
-**Require branches to be up to date before merging**
35+
36+
## PR must reference an issue
37+
GitHub does not have a single built-in "require issue link" toggle for all repos.
38+
Recommended options:
39+
40+
1. **Process enforcement (lightweight)**
41+
- Use `.github/pull_request_template.md` and require `Closes #<issue>` in the PR.
42+
43+
2. **Stronger enforcement (recommended)**
44+
- Add a dedicated GitHub Action that fails if the PR body does not contain `Closes #<number>`.
45+
- If you want this, we can add a small workflow using `actions/github-script`.
46+
47+
## Notes
48+
- Repository admins can optionally be included or excluded from these requirements.
49+
- Configure the same rule set for both `main` and `develop` to avoid bypass paths.

.github/pull_request_template.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Summary
2+
<!-- What does this PR change and why? -->
3+
4+
## Related Issue
5+
<!-- REQUIRED: link the issue this PR addresses -->
6+
Closes #
7+
8+
## Type of change
9+
- [ ] Feature
10+
- [ ] Bug fix
11+
- [ ] Chore / Refactor
12+
- [ ] Docs
13+
14+
## Screenshots / Recording (if UI)
15+
<!-- Optional -->
16+
17+
## Testing
18+
<!-- REQUIRED: describe how you tested this change -->
19+
- [ ] `npm run type-check`
20+
- [ ] `npm run lint`
21+
- [ ] `npm run test`
22+
- [ ] `npm run build`
23+
24+
## Quality gate checklist
25+
- [ ] CI checks pass (Frontend CI)
26+
- [ ] At least 1–2 approvals (per branch protection rules)
27+
- [ ] Branch is up-to-date with the base branch
28+
- [ ] All conversations resolved
29+
- [ ] PR description includes `Closes #<issue-number>`

.github/workflows/ci.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Frontend CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
type-check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: "20"
19+
cache: "npm"
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Run Type Check
25+
run: npm run type-check
26+
27+
lint:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Set up Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: "20"
36+
cache: "npm"
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
41+
- name: Run Lint
42+
run: npm run lint
43+
44+
validate:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Set up Node.js
50+
uses: actions/setup-node@v4
51+
with:
52+
node-version: "20"
53+
cache: "npm"
54+
55+
- name: Install dependencies
56+
run: npm ci
57+
58+
- name: Validate UI (icons, responsive)
59+
run: npm run validate:ui
60+
61+
- name: Validate Web3 (wallet, env)
62+
run: npm run validate:web3
63+
64+
build:
65+
runs-on: ubuntu-latest
66+
needs: [type-check, lint, validate]
67+
steps:
68+
- uses: actions/checkout@v4
69+
70+
- name: Set up Node.js
71+
uses: actions/setup-node@v4
72+
with:
73+
node-version: "20"
74+
cache: "npm"
75+
76+
- name: Install dependencies
77+
run: npm ci
78+
79+
- name: Run Build
80+
run: npm run build
81+
env:
82+
NEXT_PUBLIC_STARKNET_NETWORK: goerli-alpha
83+
84+
- name: Check for build errors
85+
run: |
86+
if [ -f .next/build-manifest.json ]; then
87+
echo "✅ Build completed successfully"
88+
else
89+
echo "❌ Build failed - no manifest found"
90+
exit 1
91+
fi
92+
93+
test:
94+
runs-on: ubuntu-latest
95+
needs: [build]
96+
steps:
97+
- uses: actions/checkout@v4
98+
99+
- name: Set up Node.js
100+
uses: actions/setup-node@v4
101+
with:
102+
node-version: "20"
103+
cache: "npm"
104+
105+
- name: Install dependencies
106+
run: npm ci
107+
108+
- name: Run Tests
109+
run: npm run test
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: PR Quality Gates
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize, reopened]
6+
branches: [main, develop]
7+
8+
permissions:
9+
pull-requests: read
10+
11+
jobs:
12+
require-linked-issue:
13+
name: Require linked issue in PR body
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Validate PR body contains issue closing keyword
17+
uses: actions/github-script@v7
18+
with:
19+
script: |
20+
const body = context.payload.pull_request?.body || '';
21+
// Accept common keywords: close/closes/closed/fix/fixes/fixed/resolve/resolves/resolved
22+
// Require a github issue reference like: "Closes #123"
23+
const re = /(close[sd]?|fix(e[sd])?|resolve[sd]?)\s+#\d+/i;
24+
if (!re.test(body)) {
25+
core.setFailed('PR description must reference an issue using e.g. "Closes #123".');
26+
}

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
# Run lint-staged
5+
npx --no -- lint-staged

0 commit comments

Comments
 (0)