Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #256

Merged
merged 54 commits into from
Mar 27, 2024
Merged

Dev #256

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2b25562
fix: @frames/render turbo build
stephancill Mar 26, 2024
4836b7f
build: lint, typecheck and test code
michalkvasnicak Mar 26, 2024
6b57b18
fix: add missing runs-on
michalkvasnicak Mar 26, 2024
f3e9d1f
fix: typo
michalkvasnicak Mar 26, 2024
2db4615
build: checkout and install deps in all jobs
michalkvasnicak Mar 26, 2024
b1e9261
build: do not build starter and docs
michalkvasnicak Mar 26, 2024
d2d6e00
test: fix assertions
michalkvasnicak Mar 26, 2024
1941701
chore: deprecate old next api
michalkvasnicak Mar 26, 2024
1434879
chore: add changeset
michalkvasnicak Mar 26, 2024
b5b78db
Merge pull request #247 from framesjs/chore/deprecate-old-next-api
stephancill Mar 26, 2024
dee5dcb
Merge pull request #246 from framesjs/feat/github-actions
stephancill Mar 26, 2024
d9032bb
feat: basic create-frames cli tool
michalkvasnicak Mar 5, 2024
c718178
feat: hono, express, remix templates
michalkvasnicak Mar 25, 2024
55fab50
chore: docs use code block and revert initial command
michalkvasnicak Mar 26, 2024
e1cc938
build: do not lint/build templates
michalkvasnicak Mar 26, 2024
e5674d6
feat: custom middleware example
stephancill Mar 26, 2024
7ba28f0
Merge pull request #143 from framesjs/feat/cli-tool
stephancill Mar 26, 2024
29bcbc6
fix(nextjs): prioritize APP_URL over VERCEL_URL
stephancill Mar 26, 2024
8800afa
feat: updated multi-page example
stephancill Mar 27, 2024
4451b7c
fix: refactor frames app into frames.ts in examples
stephancill Mar 27, 2024
d594ec5
Merge pull request #244 from framesjs/fix/turbo-build
stephancill Mar 27, 2024
d860bc2
Merge pull request #250 from framesjs/feat/updated-multi-page-example
stephancill Mar 27, 2024
6142ac5
Merge pull request #251 from framesjs/fix/refactor-frames-examples
stephancill Mar 27, 2024
0bc117a
Merge pull request #248 from framesjs/feat/custom-middleware-example
stephancill Mar 27, 2024
9b5690f
feat: custom fonts example
stephancill Mar 27, 2024
654ba28
Merge pull request #249 from framesjs/fix/getcurrentutl-env-priorities
stephancill Mar 27, 2024
e017466
fix: correctly tree shake bundle
michalkvasnicak Mar 27, 2024
65c7f6c
chore: changeset
michalkvasnicak Mar 27, 2024
469011a
Merge pull request #253 from framesjs/fix/tree-shaking
stephancill Mar 27, 2024
fdea642
feat: createFrames params
stephancill Mar 25, 2024
82c41d8
fix: clean up example filenames, add steps
stephancill Mar 25, 2024
166b785
fix: frames.js for apps, @frames.js/render imports in docs
stephancill Mar 25, 2024
e0753e9
feat: context reference
stephancill Mar 25, 2024
d65714f
feat: add note about per-route middleware
stephancill Mar 25, 2024
856428a
feat: troubleshooting
stephancill Mar 26, 2024
b2e96c0
fix: FrameDefinition types
stephancill Mar 26, 2024
e9acd3a
fix: troubleshooting file name
stephancill Mar 26, 2024
fa4e870
feat: middleware docs, minor improvements
stephancill Mar 26, 2024
1a68dc5
fix: update use-frame docs
stephancill Mar 26, 2024
22ad585
chore: move old apis to a deprecated apis section
stephancill Mar 27, 2024
db8e612
fix: make button docs more visible, multi-page docs
stephancill Mar 27, 2024
45c1c99
feat: accessing request body via middleware
stephancill Mar 27, 2024
9497b7e
chore: update changeset
stephancill Mar 27, 2024
9bbaef3
Merge pull request #252 from framesjs/feat/custom-fonts-example
stephancill Mar 27, 2024
0b681fb
fix: expose new types and utils
stephancill Mar 27, 2024
ceadc1f
Update docs/pages/troubleshooting.mdx
stephancill Mar 27, 2024
26de29b
Update docs/pages/troubleshooting.mdx
stephancill Mar 27, 2024
e2d5c17
Update docs/pages/reference/core/createFrames.mdx
stephancill Mar 27, 2024
fdc917a
Update docs/pages/reference/core/createFrames.mdx
stephancill Mar 27, 2024
63b6c6b
docs: add cloudflare adapter docs and guide (#254)
michalkvasnicak Mar 27, 2024
5f9fcfb
Merge pull request #240 from framesjs/docs/docs-improvements
stephancill Mar 27, 2024
f224a71
Merge pull request #255 from framesjs/fix/expose-new-types-utils
stephancill Mar 27, 2024
2d0131f
docs: fix cloudflare workers guide (#257)
michalkvasnicak Mar 27, 2024
c3d1d94
fix: changesets
stephancill Mar 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/five-mangos-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"frames.js": patch
---

fix: turbo build
5 changes: 5 additions & 0 deletions .changeset/grumpy-moose-beam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"framesjs-starter": patch
---

feat: custom fonts example
6 changes: 6 additions & 0 deletions .changeset/heavy-nails-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"frames.js": minor
"docs": patch
---

feat: cloudflare workers adapter
12 changes: 12 additions & 0 deletions .changeset/new-emus-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"docs": patch
---

- adds default context reference to createFrames reference
- frames.js for apps section
- clean up example filenames, add steps
- createFrames params
- troubleshooting docs
- update useFrame reference
- make button docs more visible
- multi-page guide
5 changes: 5 additions & 0 deletions .changeset/new-moose-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"frames.js": patch
---

fix(nextjs): prioritize APP_URL over VERCEL_URL
5 changes: 5 additions & 0 deletions .changeset/olive-kangaroos-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"frames.js": minor
---

chore: deprecate old Next.js api
5 changes: 5 additions & 0 deletions .changeset/silly-files-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"docs": patch
---

fix: add missing parts to cf workers guide
5 changes: 5 additions & 0 deletions .changeset/smooth-bugs-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-frames": patch
---

feat: introduce cli tool to bootstrap projects from templates
5 changes: 5 additions & 0 deletions .changeset/sweet-rivers-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"frames.js": patch
---

fix: expose core types and utils via frames.js/types and frames.js/utils
5 changes: 5 additions & 0 deletions .changeset/ten-beans-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"framesjs-starter": patch
---

feat: updated multi-page example
5 changes: 5 additions & 0 deletions .changeset/thirty-dots-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"framesjs-starter": patch
---

fix: refactor frames app into frames.ts in examples
5 changes: 5 additions & 0 deletions .changeset/warm-pandas-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"frames.js": patch
---

fix: correctly tree shake the bundle
5 changes: 5 additions & 0 deletions .changeset/yellow-zoos-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"framesjs-starter": patch
---

feat: custom middleware example
87 changes: 87 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Frames.js Actions

on:
push:
branches:
- main
- dev
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
initialize:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
cache: "yarn"

- name: Install dependencies
run: yarn --frozen-lockfile

lint:
needs: [initialize]
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
cache: "yarn"

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Lint
run: yarn lint

typecheck:
needs: [initialize]
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
cache: "yarn"

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Typecheck
run: yarn build:ci

test:
needs: [lint, typecheck]
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
cache: "yarn"

- name: Install dependencies
run: yarn --frozen-lockfile

- name: Unit Tests
run: yarn test:ci
3 changes: 3 additions & 0 deletions .scripts/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
33 changes: 33 additions & 0 deletions .scripts/prepare-create-frames.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* This script is used to prepare create-frames package for publishing.
*
* It copies the templates directory to the root of the package so that it can be used by the create-frames package.
*/

import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import glob from "fast-glob";
import { cpSync, renameSync, rmSync } from 'node:fs';

const __dirname = dirname(fileURLToPath(import.meta.url));


rmSync(resolve(__dirname, "../packages/create-frames/templates"), { force: true, recursive: true });

cpSync(
resolve(__dirname, "../templates"),
resolve(__dirname, "../packages/create-frames/templates"),
{
recursive: true,
filter: (src) => !/(node_modules|\.turbo|\.next|next-env\.d\.ts)/.test(src),
}
);

const dotfiles = await glob(
resolve(__dirname, "../packages/create-frames/templates/**/.*")
);

// rename dotfiles to use underscore instead of dot so we can publish them to npm as is
for (const doftile of dotfiles) {
renameSync(doftile, doftile.replace("/.", "/_"));
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,32 @@ This guide shows you how to add frames rendering to your next.js + tailwind app

## Steps

1. Create a new repo
::::steps

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

`cd my-project`

`yarn add @frames.js/render`
Create a new Next.js app

`yarn install`
```sh
npx create-next-app@latest my-project --ts --eslint --tailwind --app
cd my-project
```

Add `@frames.js/render` to your project

2. Add proxies for routing frame requests via your backend for privacy + preventing CORS issues
```tsx filename="// ./app/frames/route.tsx"
// ./app/frames/route.tsx
```sh
yarn add @frames.js/render
```

### Add proxies for routing frame requests via your backend for privacy + preventing CORS issues
```tsx [./app/frames/route.tsx]
export { GET, POST } from "@frames.js/render/next";
```

3. Add the renderer to your page
### Add the renderer to your page

```tsx filename="// ./app/page.tsx"
// ./app/page.tsx
```tsx [./app/page.tsx]
"use client";
import {
FrameUI,
Expand Down Expand Up @@ -81,10 +87,9 @@ export default function Page() {

```

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

```tsx filename="// tailwind.config.js"
// tailwind.config.js
```tsx [tailwind.config.js]
const config = {
// ...
content: [
Expand All @@ -97,10 +102,9 @@ const config = {
}
```

5. Allow images from any domain
### Allow images from any domain

```tsx filename="// next.config.js"
// next.config.js
```tsx [next.config.js]
const nextConfig = {
images: {
remotePatterns: [
Expand All @@ -113,10 +117,10 @@ const nextConfig = {
};
```

6. Run `yarn run dev`

7. Done! 🎉
### Run `yarn run dev`

### Done! 🎉
::::

### Optional

Expand Down
Loading
Loading