Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
start fresh with tsdx create, no template
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelLHuber committed Feb 26, 2024
1 parent a6b85e3 commit 6eebe4e
Show file tree
Hide file tree
Showing 406 changed files with 7,326 additions and 132,199 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI
on: [push]
jobs:
build:
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}

runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['10.x', '12.x', '14.x']
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Lint
run: yarn lint

- name: Test
run: yarn test --ci --coverage --maxWorkers=2

- name: Build
run: yarn build
12 changes: 12 additions & 0 deletions .github/workflows/size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: size
on: [pull_request]
jobs:
size:
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1
steps:
- uses: actions/checkout@v1
- uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
39 changes: 3 additions & 36 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,37 +1,4 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
pnpm-lock.yaml
.pnp
.pnp.js

# testing
coverage

# next.js
.next/
out/
build

# misc
*.log
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# turbo
.turbo

# vercel
.vercel
node_modules
dist
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

7 changes: 0 additions & 7 deletions .vscode/settings.json

This file was deleted.

4 changes: 2 additions & 2 deletions apps/web/LICENSE → LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Dylan Steck
Copyright (c) 2024 Samuel Huber

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
21 changes: 0 additions & 21 deletions LICENSE.md

This file was deleted.

160 changes: 103 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,103 @@
# farcaster kit

react hooks for the best farcaster apps -- [view docs](https://farcasterkit.com/docs)

### todos for the `auth` branch
note: right now the `auth` branch has housed all my latest changes, which have mostly been around auth. listed below is everthing i'm trying to finish before cleaing the branch up and merging it in <br/> ^ this really should be v1.0, but I'll worry about the versioning once everything is done
- **auth**
- [ ] wrap up `examples/auth/with-neynar` and move the `NeynarProvider` as well as components directly to Farcaster Kit's package in `packages/farcasterkit`
- [ ] also in `examples/auth` - wrap up either `with-dynamic`, `with-privy`, or `with-rainbowkit`
- each lets the user _create a FC account with a wallet_, the component/providers just need to be cleaned then added to `packages/farcasterkit` before the wallet-specific examples can get edited
- [ ] create a subsequent component/edit the `FarcasterKitProvider` in `packages/farcasterkit` to allow a user to log in & _create a signer_ with their wallet
- [ ] wrap up `examples/auth/with-auth-kit` and add the component/provider edits to `packages/farcasterkit`
- **api**
- [ ] add writes
- [ ] add read endpoints & schema that are similar or at parity to the old Warpcast APIs
- some of this will require writing materialized views over the `old-replicator`
- [ ] add new channels
- need to figure out the best way to get the channel data that isn't permissionless and only lives in Warpcast
- **misc.**
- [ ] finish the new website at `apps/web`
- the new design is there, i've just been waiting to finish these changes so i can document them on the site
- [ ] write & add styled components to storybook in `packages/components`
- [ ] potentially make some edits to `examples/starter` to showcase more of what the new changes do?
- [ ] edit `packages/create-farcaster-app` to allow the user to select [litecast](https://github.com/dylsteck/litecast)
- [ ] add linting, changelog, and other small setup configs to the monorepo


----
![farcaster kit og:image](https://i.imgur.com/qajaZLU.png)

farcaster kit is made up of two parts:
1. react hooks and modules to build the best farcaster apps
2. a rest api to fetch data with or without the hooks

### what's in the box?
- ✅ rest api
- ✅ read features
- ✅ channels module
- ✅ app-first feeds
- ✅ historic data
- ✅ user pages
- 🔜 auth hooks
- 🔜 write actions
- 🔜 multi package/provider support

### how this repo is structured
- `packages/farcasterkit` - react hooks and modules, which are available to install with `npm install farcasterkit`
- `packages/create-farcaster-app` - a CLI tool to scaffold an app using `npx create-farcaster-app`, which lives at `examples/starter`
- `apps/api` - the rest api for farcaster kit
- `apps/web` - the homepage and docs for farcaster kit, which you can [view here](https://farcasterkit.com)
- `apps/old-replicator` -- the postgres replicator powering farcaster kit, built by farcaster. a migration to the [new replicator](https://github.com/farcasterxyz/hub-monorepo/tree/main/apps/replicator) will happen soon!
- `examples/starter` - a starter app which you can scaffold by using `npx create-farcaster-app`
<br/>

built by [dylsteck](https://github.com/dylsteck) and powered by [nexus](https://withcortex.com)

----
# TSDX User Guide

Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and how to use it.

> This TSDX setup is meant for developing libraries (not apps!) that can be published to NPM. If you’re looking to build a Node app, you could use `ts-node-dev`, plain `ts-node`, or simple `tsc`.
> If you’re new to TypeScript, checkout [this handy cheatsheet](https://devhints.io/typescript)
## Commands

TSDX scaffolds your new library inside `/src`.

To run TSDX, use:

```bash
npm start # or yarn start
```

This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.

To do a one-off build, use `npm run build` or `yarn build`.

To run tests, use `npm test` or `yarn test`.

## Configuration

Code quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly.

### Jest

Jest tests are set up to run with `npm test` or `yarn test`.

### Bundle Analysis

[`size-limit`](https://github.com/ai/size-limit) is set up to calculate the real cost of your library with `npm run size` and visualize the bundle with `npm run analyze`.

#### Setup Files

This is the folder structure we set up for you:

```txt
/src
index.tsx # EDIT THIS
/test
blah.test.tsx # EDIT THIS
.gitignore
package.json
README.md # EDIT THIS
tsconfig.json
```

### Rollup

TSDX uses [Rollup](https://rollupjs.org) as a bundler and generates multiple rollup configs for various module formats and build settings. See [Optimizations](#optimizations) for details.

### TypeScript

`tsconfig.json` is set up to interpret `dom` and `esnext` types, as well as `react` for `jsx`. Adjust according to your needs.

## Continuous Integration

### GitHub Actions

Two actions are added by default:

- `main` which installs deps w/ cache, lints, tests, and builds on all pushes against a Node and OS matrix
- `size` which comments cost comparison of your library on every pull request using [`size-limit`](https://github.com/ai/size-limit)

## Optimizations

Please see the main `tsdx` [optimizations docs](https://github.com/palmerhq/tsdx#optimizations). In particular, know that you can take advantage of development-only optimizations:

```js
// ./types/index.d.ts
declare var __DEV__: boolean;

// inside your code...
if (__DEV__) {
console.log('foo');
}
```

You can also choose to install and use [invariant](https://github.com/palmerhq/tsdx#invariant) and [warning](https://github.com/palmerhq/tsdx#warning) functions.

## Module Formats

CJS, ESModules, and UMD module formats are supported.

The appropriate paths are configured in `package.json` and `dist/index.js` accordingly. Please report if any issues are found.

## Named Exports

Per Palmer Group guidelines, [always use named exports.](https://github.com/palmerhq/typescript#exports) Code split inside your React app instead of your React library.

## Including Styles

There are many ways to ship styles, including with CSS-in-JS. TSDX has no opinion on this, configure how you like.

For vanilla CSS, you can include it at the root directory and add it to the `files` section in your `package.json`, so that it can be imported separately by your users and run through their bundler's loader.

## Publishing to NPM

We recommend using [np](https://github.com/sindresorhus/np).
4 changes: 0 additions & 4 deletions apps/api/.env.example

This file was deleted.

4 changes: 0 additions & 4 deletions apps/api/.eslintrc.js

This file was deleted.

37 changes: 0 additions & 37 deletions apps/api/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions apps/api/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions apps/api/dist/index.js

This file was deleted.

1 change: 0 additions & 1 deletion apps/api/dist/index.js.map

This file was deleted.

Loading

0 comments on commit 6eebe4e

Please sign in to comment.