Skip to content

Commit 4836b7f

Browse files
build: lint, typecheck and test code
1 parent 7cda976 commit 4836b7f

File tree

5 files changed

+85
-1
lines changed

5 files changed

+85
-1
lines changed

.github/workflows/github-actions.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Frames.js Actions
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
pull_request:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
initialize:
16+
timeout-minutes: 5
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Check out code
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 2
23+
24+
- name: Setup Node.js environment
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 18
28+
cache: "yarn"
29+
30+
- name: Install dependencies
31+
run: yarn --frozen-lockfile
32+
33+
lint:
34+
needs: [initialize]
35+
steps:
36+
- name: Lint
37+
run: yarn lint
38+
39+
typecheck:
40+
needs: [initialize]
41+
steps:
42+
- name: Typecheck
43+
run: yarn build:ci
44+
45+
test:
46+
need: [lint, typecheck]
47+
timeout-minutes: 10
48+
steps:
49+
- name: Unit Tests
50+
run: yarn test:ci

jest.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** @type {import('jest').Config} */
2+
module.exports = {
3+
projects: ["<rootDir>/packages/frames.js/jest.config.js"],
4+
};

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
"private": true,
44
"scripts": {
55
"build": "turbo build",
6+
"build:ci": "turbo build --filter=!debugger",
67
"dev": "FJS_MONOREPO=true turbo dev --filter=framesjs-starter... --filter=debugger...",
78
"dev:custom-redirects": "turbo dev --filter=custom-redirects...",
89
"dev:utils-starter": "turbo dev --filter=utils-starter...",
910
"dev:all": "turbo dev",
1011
"lint": "turbo lint",
12+
"test:ci": "jest --ci",
1113
"test": "cd ./packages/frames.js && npm run test:watch",
1214
"publish-packages": "turbo run build lint && changeset version && changeset publish && git push --follow-tags origin main",
1315
"publish-canary": "turbo run build lint && cd ./packages/frames.js && yarn publish --tag canary && git push --follow-tags origin main",
@@ -36,4 +38,4 @@
3638
"packages/*"
3739
],
3840
"version": "0.3.0-canary.0"
39-
}
41+
}

packages/frames.js/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@
212212
"devDependencies": {
213213
"@open-frames/types": "^0.0.6",
214214
"@remix-run/node": "^2.8.1",
215+
"@types/supertest": "^6.0.2",
215216
"@types/express": "^4.17.21",
216217
"@xmtp/frames-client": "^0.4.3",
217218
"@xmtp/frames-validator": "^0.5.2",

yarn.lock

+27
Original file line numberDiff line numberDiff line change
@@ -2943,6 +2943,11 @@
29432943
resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.6.0.tgz#eac397f28bf1d6ae0ae081363eca2f425bedf0d5"
29442944
integrity sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==
29452945

2946+
"@types/cookiejar@^2.1.5":
2947+
version "2.1.5"
2948+
resolved "https://registry.yarnpkg.com/@types/cookiejar/-/cookiejar-2.1.5.tgz#14a3e83fa641beb169a2dd8422d91c3c345a9a78"
2949+
integrity sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q==
2950+
29462951
"@types/debug@^4.0.0", "@types/debug@^4.1.7":
29472952
version "4.1.12"
29482953
resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.12.tgz#a155f21690871953410df4b6b6f53187f0500917"
@@ -3080,6 +3085,11 @@
30803085
resolved "https://registry.yarnpkg.com/@types/mdx/-/mdx-2.0.11.tgz#21f4c166ed0e0a3a733869ba04cd8daea9834b8e"
30813086
integrity sha512-HM5bwOaIQJIQbAYfax35HCKxx7a3KrK3nBtIqJgSOitivTD1y3oW9P3rxY9RkXYPUk7y/AjAohfHKmFpGE79zw==
30823087

3088+
"@types/methods@^1.1.4":
3089+
version "1.1.4"
3090+
resolved "https://registry.yarnpkg.com/@types/methods/-/methods-1.1.4.tgz#d3b7ac30ac47c91054ea951ce9eed07b1051e547"
3091+
integrity sha512-ymXWVrDiCxTBE3+RIrrP533E70eA+9qu7zdWoHuOmGujkYtzf4HQF96b8nwHLqhuf4ykX61IGRIB38CC6/sImQ==
3092+
30833093
"@types/mime@*":
30843094
version "3.0.4"
30853095
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.4.tgz#2198ac274de6017b44d941e00261d5bc6a0e0a45"
@@ -3199,6 +3209,23 @@
31993209
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8"
32003210
integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==
32013211

3212+
"@types/superagent@^8.1.0":
3213+
version "8.1.6"
3214+
resolved "https://registry.yarnpkg.com/@types/superagent/-/superagent-8.1.6.tgz#e660543b1a4b7c7473caec4799de87ff68216270"
3215+
integrity sha512-yzBOv+6meEHSzV2NThYYOA6RtqvPr3Hbob9ZLp3i07SH27CrYVfm8CrF7ydTmidtelsFiKx2I4gZAiAOamGgvQ==
3216+
dependencies:
3217+
"@types/cookiejar" "^2.1.5"
3218+
"@types/methods" "^1.1.4"
3219+
"@types/node" "*"
3220+
3221+
"@types/supertest@^6.0.2":
3222+
version "6.0.2"
3223+
resolved "https://registry.yarnpkg.com/@types/supertest/-/supertest-6.0.2.tgz#2af1c466456aaf82c7c6106c6b5cbd73a5e86588"
3224+
integrity sha512-137ypx2lk/wTQbW6An6safu9hXmajAifU/s7szAHLN/FeIm5w7yR0Wkl9fdJMRSHwOn4HLAI0DaB2TOORuhPDg==
3225+
dependencies:
3226+
"@types/methods" "^1.1.4"
3227+
"@types/superagent" "^8.1.0"
3228+
32023229
"@types/trusted-types@^2.0.2":
32033230
version "2.0.7"
32043231
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11"

0 commit comments

Comments
 (0)