Skip to content

Commit afaee8d

Browse files
authored
Merge pull request #1 from JeraldJF/main
#feat: generic editor v2 react version - Initial commit
2 parents 35a29b5 + dc49320 commit afaee8d

60 files changed

Lines changed: 15334 additions & 2 deletions

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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Dev harness config (copy to .env.local). All optional.
2+
# Proxy same-origin /action calls to a real backend during dev:
3+
VITE_API_PROXY=https://dev.sunbirded.org
4+
# Pre-fill the harness:
5+
VITE_CONTENT_ID=
6+
VITE_LANGUAGE=en
7+
VITE_FRAMEWORK=NCF

.github/workflows/npm-publish.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Generic Editor v2 — CI & Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
pull_request:
8+
9+
# Least privilege by default; the publish job needs no extra scopes.
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
# ── Lint, test & build: runs on every push and pull_request ──────────────
15+
test:
16+
name: Lint, Test & Build
17+
runs-on: ubuntu-22.04
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '22.21.1'
26+
cache: 'npm'
27+
cache-dependency-path: package-lock.json
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Lint
33+
run: npm run lint
34+
35+
- name: Run tests
36+
run: npm test
37+
38+
- name: Build
39+
run: npm run build
40+
41+
# ── Publish to npm: runs only on a tag ───────────────────────────────────
42+
publish-npm:
43+
name: Publish to npm
44+
needs: test
45+
if: startsWith(github.ref, 'refs/tags/')
46+
runs-on: ubuntu-22.04
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@v4
50+
51+
- name: Set up Node.js
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: '22.21.1'
55+
registry-url: 'https://registry.npmjs.org'
56+
cache: 'npm'
57+
cache-dependency-path: package-lock.json
58+
59+
- name: Install dependencies
60+
run: npm ci
61+
62+
- name: Build package
63+
run: npm run build
64+
65+
- name: Publish to npm
66+
run: npm publish --access public
67+
env:
68+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/pull-request.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Pull Request Quality Checks
2+
3+
# Runs on every commit pushed to an open PR (opened / synchronize / reopened).
4+
on:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
checks:
12+
name: Lint, Build & Test
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 24.12.0
23+
cache: 'npm'
24+
cache-dependency-path: package-lock.json
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Lint
30+
run: npm run lint
31+
32+
- name: Build
33+
run: npm run build
34+
35+
- name: Test
36+
run: npm test

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
node_modules
2+
dist
3+
.env
4+
.env.*
5+
!.env.example
6+
*.tsbuildinfo
7+
.DS_Store
8+
coverage

0 commit comments

Comments
 (0)