Skip to content

Commit 84123ef

Browse files
authored
feat(client): next version initial commit (#36)
* feat(client): next version initial commit * feat(user): Added user endpoints * feat(client): added missing endpoints * test(form): added form tests * test(user): added user tests made max worker 1 * docs(form): added form api jsdoc * docs(folder): added jsdoc to folder * docs(report): added jsdoc to report * docs(submission): added jsdoc to submission * docs(user): added jsdoc to user * test(folder): added tests to folder * test(report): added report test * chore(bundling): migrated to pure tsc * fix(tests): fix tests and test the built library * chore(ci): added github actions templates
1 parent 2af91c7 commit 84123ef

37 files changed

+5348
-1279
lines changed

.github/workflows/build-test.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build and Test
2+
on:
3+
# manual trigger
4+
workflow_dispatch:
5+
# reuse workflow run
6+
workflow_call:
7+
# on pull request
8+
pull_request:
9+
# on push to master branch
10+
push:
11+
branches:
12+
- 'master'
13+
- 'next'
14+
jobs:
15+
build-test:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: 20
22+
registry-url: https://registry.npmjs.org/
23+
24+
- name: Cache
25+
uses: actions/cache@v3
26+
with:
27+
path: node_modules
28+
key: ${{ runner.os }}-package-${{ hashFiles('**/package-lock.json') }}
29+
restore-keys: |
30+
${{ runner.os }}-package-
31+
32+
- name: Install dependencies
33+
run: npm i
34+
35+
- name: Run tests
36+
run: npm run test
37+
env:
38+
JF_API_KEY: ${{ secrets.TEST_USER_API_KEY }}
39+
40+
- name: Build package
41+
run: npm run build

.github/workflows/publish.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish
2+
on:
3+
# on release
4+
release:
5+
types: [released, prereleased]
6+
7+
jobs:
8+
build-test:
9+
uses: ./.github/workflows/build-test.yml
10+
publish:
11+
needs: build-test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-node@v3
16+
with:
17+
node-version: 20
18+
19+
- name: Cache
20+
uses: actions/cache@v3
21+
with:
22+
path: node_modules
23+
key: ${{ runner.os }}-package-${{ hashFiles('**/package-lock.json') }}
24+
restore-keys: |
25+
${{ runner.os }}-package-
26+
27+
- name: Build package
28+
run: npm run build
29+
30+
- name: Publish package
31+
if: github.event_name == 'release' && github.event.release.draft == false
32+
run: |
33+
if [[ ${{ github.event.release.prerelease }} == true || ${{ github.event.release.tag_name }} =~ -alpha|-beta|-rc ]]; then
34+
npm publish --tag next
35+
else
36+
npm publish --tag latest
37+
fi
38+
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules/
1+
node_modules/
2+
dist/

0 commit comments

Comments
 (0)