Skip to content

Commit a8f9b99

Browse files
authored
Merge pull request #256 from framesjs/dev
Dev
2 parents 63fb99d + c3d1d94 commit a8f9b99

File tree

232 files changed

+10393
-597
lines changed

Some content is hidden

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

232 files changed

+10393
-597
lines changed

.changeset/five-mangos-try.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"frames.js": patch
3+
---
4+
5+
fix: turbo build

.changeset/grumpy-moose-beam.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"framesjs-starter": patch
3+
---
4+
5+
feat: custom fonts example

.changeset/heavy-nails-love.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"frames.js": minor
3+
"docs": patch
4+
---
5+
6+
feat: cloudflare workers adapter

.changeset/new-emus-love.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"docs": patch
3+
---
4+
5+
- adds default context reference to createFrames reference
6+
- frames.js for apps section
7+
- clean up example filenames, add steps
8+
- createFrames params
9+
- troubleshooting docs
10+
- update useFrame reference
11+
- make button docs more visible
12+
- multi-page guide

.changeset/new-moose-talk.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"frames.js": patch
3+
---
4+
5+
fix(nextjs): prioritize APP_URL over VERCEL_URL

.changeset/olive-kangaroos-talk.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"frames.js": minor
3+
---
4+
5+
chore: deprecate old Next.js api

.changeset/silly-files-cheat.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"docs": patch
3+
---
4+
5+
fix: add missing parts to cf workers guide

.changeset/smooth-bugs-admire.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-frames": patch
3+
---
4+
5+
feat: introduce cli tool to bootstrap projects from templates

.changeset/sweet-rivers-join.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"frames.js": patch
3+
---
4+
5+
fix: expose core types and utils via frames.js/types and frames.js/utils

.changeset/ten-beans-compete.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"framesjs-starter": patch
3+
---
4+
5+
feat: updated multi-page example

.changeset/thirty-dots-doubt.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"framesjs-starter": patch
3+
---
4+
5+
fix: refactor frames app into frames.ts in examples

.changeset/warm-pandas-laugh.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"frames.js": patch
3+
---
4+
5+
fix: correctly tree shake the bundle

.changeset/yellow-zoos-promise.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"framesjs-starter": patch
3+
---
4+
5+
feat: custom middleware example

.github/workflows/github-actions.yml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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+
22+
- name: Setup Node.js environment
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 18
26+
cache: "yarn"
27+
28+
- name: Install dependencies
29+
run: yarn --frozen-lockfile
30+
31+
lint:
32+
needs: [initialize]
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Check out code
36+
uses: actions/checkout@v4
37+
38+
- name: Setup Node.js environment
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: 18
42+
cache: "yarn"
43+
44+
- name: Install dependencies
45+
run: yarn --frozen-lockfile
46+
47+
- name: Lint
48+
run: yarn lint
49+
50+
typecheck:
51+
needs: [initialize]
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Check out code
55+
uses: actions/checkout@v4
56+
57+
- name: Setup Node.js environment
58+
uses: actions/setup-node@v4
59+
with:
60+
node-version: 18
61+
cache: "yarn"
62+
63+
- name: Install dependencies
64+
run: yarn --frozen-lockfile
65+
66+
- name: Typecheck
67+
run: yarn build:ci
68+
69+
test:
70+
needs: [lint, typecheck]
71+
runs-on: ubuntu-latest
72+
timeout-minutes: 10
73+
steps:
74+
- name: Check out code
75+
uses: actions/checkout@v4
76+
77+
- name: Setup Node.js environment
78+
uses: actions/setup-node@v4
79+
with:
80+
node-version: 18
81+
cache: "yarn"
82+
83+
- name: Install dependencies
84+
run: yarn --frozen-lockfile
85+
86+
- name: Unit Tests
87+
run: yarn test:ci

.scripts/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

.scripts/prepare-create-frames.js

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* This script is used to prepare create-frames package for publishing.
3+
*
4+
* It copies the templates directory to the root of the package so that it can be used by the create-frames package.
5+
*/
6+
7+
import { dirname, resolve } from "node:path";
8+
import { fileURLToPath } from "node:url";
9+
import glob from "fast-glob";
10+
import { cpSync, renameSync, rmSync } from 'node:fs';
11+
12+
const __dirname = dirname(fileURLToPath(import.meta.url));
13+
14+
15+
rmSync(resolve(__dirname, "../packages/create-frames/templates"), { force: true, recursive: true });
16+
17+
cpSync(
18+
resolve(__dirname, "../templates"),
19+
resolve(__dirname, "../packages/create-frames/templates"),
20+
{
21+
recursive: true,
22+
filter: (src) => !/(node_modules|\.turbo|\.next|next-env\.d\.ts)/.test(src),
23+
}
24+
);
25+
26+
const dotfiles = await glob(
27+
resolve(__dirname, "../packages/create-frames/templates/**/.*")
28+
);
29+
30+
// rename dotfiles to use underscore instead of dot so we can publish them to npm as is
31+
for (const doftile of dotfiles) {
32+
renameSync(doftile, doftile.replace("/.", "/_"));
33+
}

docs/pages/guides/display-frames.mdx docs/pages/guides/apps/display-frames.mdx

+24-20
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,32 @@ This guide shows you how to add frames rendering to your next.js + tailwind app
99

1010
## Steps
1111

12-
1. Create a new repo
12+
::::steps
1313

14-
`npx create-next-app@latest my-project --ts --eslint --tailwind --app`
14+
### Create a new repo
1515

16-
`cd my-project`
1716

18-
`yarn add @frames.js/render`
17+
Create a new Next.js app
1918

20-
`yarn install`
19+
```sh
20+
npx create-next-app@latest my-project --ts --eslint --tailwind --app
21+
cd my-project
22+
```
23+
24+
Add `@frames.js/render` to your project
2125

22-
2. Add proxies for routing frame requests via your backend for privacy + preventing CORS issues
23-
```tsx filename="// ./app/frames/route.tsx"
24-
// ./app/frames/route.tsx
26+
```sh
27+
yarn add @frames.js/render
28+
```
29+
30+
### Add proxies for routing frame requests via your backend for privacy + preventing CORS issues
31+
```tsx [./app/frames/route.tsx]
2532
export { GET, POST } from "@frames.js/render/next";
2633
```
2734

28-
3. Add the renderer to your page
35+
### Add the renderer to your page
2936

30-
```tsx filename="// ./app/page.tsx"
31-
// ./app/page.tsx
37+
```tsx [./app/page.tsx]
3238
"use client";
3339
import {
3440
FrameUI,
@@ -81,10 +87,9 @@ export default function Page() {
8187

8288
```
8389

84-
4. In order for the styles to work, your project should have tailwind set up as well as the tailwind.config.js rule
90+
### In order for the styles to work, your project should have tailwind set up as well as the tailwind.config.js rule
8591

86-
```tsx filename="// tailwind.config.js"
87-
// tailwind.config.js
92+
```tsx [tailwind.config.js]
8893
const config = {
8994
// ...
9095
content: [
@@ -97,10 +102,9 @@ const config = {
97102
}
98103
```
99104

100-
5. Allow images from any domain
105+
### Allow images from any domain
101106

102-
```tsx filename="// next.config.js"
103-
// next.config.js
107+
```tsx [next.config.js]
104108
const nextConfig = {
105109
images: {
106110
remotePatterns: [
@@ -113,10 +117,10 @@ const nextConfig = {
113117
};
114118
```
115119

116-
6. Run `yarn run dev`
117-
118-
7. Done! 🎉
120+
### Run `yarn run dev`
119121

122+
### Done! 🎉
123+
::::
120124

121125
### Optional
122126

0 commit comments

Comments
 (0)