Skip to content

Commit

Permalink
Merge pull request #844 from lens-protocol/main
Browse files Browse the repository at this point in the history
chore: post-release update
  • Loading branch information
cesarenaldi authored Feb 14, 2024
2 parents 1f95547 + a998169 commit a501740
Show file tree
Hide file tree
Showing 25 changed files with 179 additions and 100 deletions.
4 changes: 4 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"eighty-timers-mix",
"eleven-numbers-wave",
"empty-apricots-cross",
"fifty-singers-dance",
"five-seals-tap",
"flat-boxes-work",
"fluffy-apricots-provide",
Expand All @@ -71,6 +72,7 @@
"fuzzy-balloons-check",
"fuzzy-dodos-greet",
"fuzzy-pillows-unite",
"gentle-glasses-jam",
"giant-games-type",
"gold-dolphins-pump",
"gold-radios-hunt",
Expand Down Expand Up @@ -107,6 +109,7 @@
"loud-weeks-bake",
"many-jeans-cough",
"mean-ducks-tan",
"metal-bikes-applaud",
"metal-cougars-train",
"mighty-planets-retire",
"modern-spies-confess",
Expand Down Expand Up @@ -175,6 +178,7 @@
"ten-insects-cover",
"thin-falcons-tap",
"thin-news-pull",
"thirty-eyes-act",
"three-cougars-pay",
"tidy-kangaroos-bake",
"tidy-pants-punch",
Expand Down
4 changes: 2 additions & 2 deletions examples/node/scripts/misc/onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ dotenv.config();
const typedAbi = abi as ethers.ContractInterface;

const permissonlessCreatorAddress = {
development: '0x42b302BBB4fA27c21d32EdF602E4e2aA65746999',
production: 'TBD',
development: '0xCb4FB63c3f13CB83cCD6F10E9e5F29eC250329Cc',
production: '0x0b5e6100243f793e480DE6088dE6bA70aA9f3872',
};

if (!process.env.INFURA_API_KEY) {
Expand Down
9 changes: 9 additions & 0 deletions packages/api-bindings/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @lens-protocol/api-bindings

## 0.11.0-alpha.28

### Patch Changes

- 66c6df157: **fixed:** make `useAccessToken` reactive
- 9c7fd3ee3: **feat:** `useCreateProfile` hook
- Updated dependencies [9c7fd3ee3]
- @lens-protocol/domain@0.11.0-alpha.21

## 0.11.0-alpha.27

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/api-bindings/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lens-protocol/api-bindings",
"version": "0.11.0-alpha.27",
"version": "0.11.0-alpha.28",
"description": "Graphql fragments, react hooks, typescript types of lens API.",
"repository": {
"directory": "packages/api-bindings",
Expand Down
8 changes: 8 additions & 0 deletions packages/blockchain-bindings/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @lens-protocol/blockchain-bindings

## 0.10.0-alpha.22

### Patch Changes

- 9c7fd3ee3: **feat:** `useCreateProfile` hook
- Updated dependencies [9c7fd3ee3]
- @lens-protocol/domain@0.11.0-alpha.21

## 0.10.0-alpha.21

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/blockchain-bindings/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lens-protocol/blockchain-bindings",
"version": "0.10.0-alpha.21",
"version": "0.10.0-alpha.22",
"description": "Utilities for interacting with the blockchain.",
"repository": {
"directory": "packages/blockchain-bindings",
Expand Down
7 changes: 7 additions & 0 deletions packages/client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @lens-protocol/client

## 2.0.0-alpha.31

### Patch Changes

- Updated dependencies [9c7fd3ee3]
- @lens-protocol/blockchain-bindings@0.10.0-alpha.22

## 2.0.0-alpha.30

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lens-protocol/client",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Low level Lens API client",
"repository": {
"directory": "packages/client",
Expand Down
6 changes: 6 additions & 0 deletions packages/domain/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @lens-protocol/domain

## 0.11.0-alpha.21

### Patch Changes

- 9c7fd3ee3: **feat:** `useCreateProfile` hook

## 0.11.0-alpha.20

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/domain/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lens-protocol/domain",
"version": "0.11.0-alpha.20",
"version": "0.11.0-alpha.21",
"description": "Critical Business Rules and Application-specific Business Rules",
"exports": {
"./mocks": {
Expand Down
17 changes: 17 additions & 0 deletions packages/react-native/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# @lens-protocol/react-native

## 0.1.0-alpha.8

### Minor Changes

- da4c26e34: **feat:** Added `useLazyProfilesManaged` hook
- 9c7fd3ee3: **feat:** `useCreateProfile` hook

### Patch Changes

- 66c6df157: **fixed:** make `useAccessToken` reactive
- Updated dependencies [da4c26e34]
- Updated dependencies [66c6df157]
- Updated dependencies [9c7fd3ee3]
- @lens-protocol/react@2.0.0-alpha.31
- @lens-protocol/api-bindings@0.11.0-alpha.28
- @lens-protocol/domain@0.11.0-alpha.21

## 0.1.0-alpha.7

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lens-protocol/react-native",
"version": "0.1.0-alpha.7",
"version": "0.1.0-alpha.8",
"description": "Lens Protocol SDK for React Native",
"main": "dist/lens-protocol-react-native.cjs.js",
"module": "dist/lens-protocol-react-native.esm.js",
Expand Down
17 changes: 17 additions & 0 deletions packages/react-web/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# @lens-protocol/react-web

## 2.0.0-alpha.31

### Minor Changes

- da4c26e34: **feat:** Added `useLazyProfilesManaged` hook
- 9c7fd3ee3: **feat:** `useCreateProfile` hook

### Patch Changes

- 66c6df157: **fixed:** make `useAccessToken` reactive
- Updated dependencies [da4c26e34]
- Updated dependencies [66c6df157]
- Updated dependencies [9c7fd3ee3]
- @lens-protocol/react@2.0.0-alpha.31
- @lens-protocol/api-bindings@0.11.0-alpha.28
- @lens-protocol/domain@0.11.0-alpha.21

## 2.0.0-alpha.30

### Minor Changes
Expand Down
25 changes: 25 additions & 0 deletions packages/react-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,28 @@ This package enables you to build web applications on top of the Lens Protocol u
- [GitHub monorepo](https://github.com/lens-protocol/lens-sdk)
- [Getting Started](https://lens-protocol.github.io/lens-sdk/modules/_lens_protocol_react_web.html#md:quick-start)
- [SDK Reference](https://lens-protocol.github.io/lens-sdk/modules/_lens_protocol_react_web.html)

## Troubleshooting

These are some common issues you may run into while using `@lens-protocol/react`. If you encounter something not listed here try searching for [GitHub issues](https://github.com/lens-protocol/lens-sdk/issues).

### Next.js build failing

You might see your Next.js failing with an error like this:

```
Error: Directory import '[...]/node_modules/@apollo/client/link/context' is not supported resolving ES modules imported from [...]/node_modules/@lens-protocol/api-bindings/dist/index.js
Did you mean to import @apollo/client/link/context/context.cjs?
```

The root cause is the lack of ESM support from Apollo Client which manifests itself when imported as sub-dependency of `@lens-protocol/api-bindings` (which in turn is imported by `@lens-protocol/react`). See open Apollo Client [issue](https://github.com/apollographql/apollo-feature-requests/issues/287).

To fix it you need to edit you `next.config.js` so to make sure the Lens SDK and its sub-dependencies a transpiled by Next.js build pipeline.

```js
const nextConfig = {
transpilePackages: ['@lens-protocol'],
};
```

For further details on how to integrate Lens SDK with a Next.js app, there is a working Next.js example in this monorepo: https://github.com/lens-protocol/lens-sdk/tree/main/examples/nextjs
2 changes: 1 addition & 1 deletion packages/react-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lens-protocol/react-web",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Lens Protocol SDK for React web applications",
"main": "dist/lens-protocol-react-web.cjs.js",
"module": "dist/lens-protocol-react-web.esm.js",
Expand Down
59 changes: 40 additions & 19 deletions packages/react-web/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,50 +1,69 @@
/**
* @module Core
*
* ## Quick start
*
* Install:
* Install the Lens React Web SDK package.
*
* | Package Manager | Command |
* |:---------------:|:------- |
* | npm | `npm install @lens-protocol/react-web@latest` |
* | yarn | `yarn add @lens-protocol/react-web@latest` |
* | pnpm | `pnpm add @lens-protocol/react-web@latest` |
*
* If you use [wagmi](https://wagmi.sh/) you can install the companion package:
* In the following examples we will show you integration with Wagmi and we will explain later how to integrate other libraries via custom bindings.
*
* Install the Lens Wagmi bindings package and its peer dependencies.
*
* | Package Manager | Command |
* |:---------------:|:------- |
* | npm | `npm install @lens-protocol/wagmi@latest` |
* | yarn | `yarn add @lens-protocol/wagmi@latest` |
* | pnpm | `pnpm add @lens-protocol/wagmi@latest` |
* | npm | `npm install viem@2 wagmi@2 @tanstack/react-query@5 @lens-protocol/wagmi@latest` |
* | yarn | `yarn add viem@2 viem@2 wagmi@2 @tanstack/react-query@5 @lens-protocol/wagmi@latest` |
* | pnpm | `pnpm add viem@2 viem@2 wagmi@2 @tanstack/react-query@5 @lens-protocol/wagmi@latest` |
*
* Follow the [Wagmi documentation](https://wagmi.sh/react/getting-started#create-config) to create the Wagmi configuration.
*
* ```ts
* import { createConfig, http } from "wagmi";
* import { polygon } from "wagmi/chains";
*
* const wagmiConfig = createConfig({
* chains: [polygon],
* transports: {
* [polygon.id]: http(),
* },
* });
* ```
*
* In the following examples we will show you integration with wagmi and we will explain later how to use custom bindings.
* Next, use this configuration with the `bindings` from the `@lens-protocol/wagmi` package to generate the [LensConfig](https://lens-protocol.github.io/lens-sdk/types/_lens_protocol_react_web.index.LensConfig.html) object.
*
* Create the {@link LensConfig}:
*
* ```ts
* import { LensConfig, development } from '@lens-protocol/react-web';
* import { bindings as wagmiBindings } from '@lens-protocol/wagmi';
* import { LensConfig, production } from "@lens-protocol/react-web";
* import { bindings } from "@lens-protocol/wagmi";
*
* const lensConfig: LensConfig = {
* bindings: wagmiBindings(),
* environment: development,
* environment: production,
* bindings: bindings(wagmiConfig),
* };
* ```
*
* Wrap your app with the {@link LensProvider | `<LensProvider>`} and pass the `LensConfig` as a prop.
* Now, wrap your app with the `<LensProvider>` component and pass the `LensConfig` object you created earlier.
*
* ```tsx
* import { LensProvider } from '@lens-protocol/react-web';
* import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
* import { WagmiProvider } from "wagmi";
*
* const queryClient = new QueryClient();
*
* function App() {
* return (
* <WagmiConfig config={config}>
* <LensProvider config={lensConfig}>
* <YourRoutes />
* </LensProvider>
* </WagmiConfig>
* <WagmiProvider config={wagmiConfig}>
* <QueryClientProvider client={queryClient}>
* <LensProvider config={lensConfig}>
* <YourApp />
* </LensProvider>
* </QueryClientProvider>
* </WagmiProvider>
* );
* }
* ```
Expand All @@ -67,6 +86,8 @@
* getSigner: () => wallet
* };
* ```
*
* @module Core
*/
'use client';

Expand Down
16 changes: 16 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @lens-protocol/react

## 2.0.0-alpha.31

### Minor Changes

- da4c26e34: **feat:** Added `useLazyProfilesManaged` hook
- 9c7fd3ee3: **feat:** `useCreateProfile` hook

### Patch Changes

- 66c6df157: **fixed:** make `useAccessToken` reactive
- Updated dependencies [66c6df157]
- Updated dependencies [9c7fd3ee3]
- @lens-protocol/api-bindings@0.11.0-alpha.28
- @lens-protocol/blockchain-bindings@0.10.0-alpha.22
- @lens-protocol/domain@0.11.0-alpha.21

## 2.0.0-alpha.30

### Minor Changes
Expand Down
35 changes: 3 additions & 32 deletions packages/react/README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,12 @@
# `@lens-protocol/react`

The official Lens Protocol bindings for React applications.

This package enables you to build applications on top of the Lens Protocol using React.
This package is a low-level package meant to be used by other Lens React SDK public packages. **It is not intended to be used directly.**

> **Note**
>
> This is a low-level package, if you are building a web application you might want to look into `@lens-protocol/react-web` package.
>
> You can use this package to build a React Native app, see the `example/react-native` example in this repo. In the future we are considering to provide a battery-included `@lens-protocol/react-native` package for RN apps.
> If you are building a web application you might want to look into `@lens-protocol/react-web` package for web apps, and `@lens-protocol/react-native` for React Native apps.
## Documentation
Useful links:

- [GitHub monorepo](https://github.com/lens-protocol/lens-sdk)
- [Getting Started](https://docs.lens.xyz/docs/sdk-react-getting-started)

## Troubleshooting

These are some common issues you may run into while using `@lens-protocol/react`. If you encounter something not listed here try searching for [GitHub issues](https://github.com/lens-protocol/lens-sdk/issues).

### Next.js build failing

You might see your Next.js failing with an error like this:

```
Error: Directory import '[...]/node_modules/@apollo/client/link/context' is not supported resolving ES modules imported from [...]/node_modules/@lens-protocol/api-bindings/dist/index.js
Did you mean to import @apollo/client/link/context/context.cjs?
```

The root cause is the lack of ESM support from Apollo Client which manifests itself when imported as sub-dependency of `@lens-protocol/api-bindings` (which in turn is imported by `@lens-protocol/react`). See open Apollo Client [issue](https://github.com/apollographql/apollo-feature-requests/issues/287).

To fix it you need to edit you `next.config.js` so to make sure the Lens SDK and its sub-dependencies a transpiled by Next.js build pipeline.

```js
const nextConfig = {
transpilePackages: ['@lens-protocol'],
};
```

For further details on how to integrate Lens SDK with a Next.js app, there is a working Next.js example in this monorepo: https://github.com/lens-protocol/lens-sdk/tree/main/examples/nextjs
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lens-protocol/react",
"version": "2.0.0-alpha.30",
"version": "2.0.0-alpha.31",
"description": "Interacting with the Lens Protocol API using React.",
"main": "dist/lens-protocol-react.cjs.js",
"module": "dist/lens-protocol-react.esm.js",
Expand Down
Loading

0 comments on commit a501740

Please sign in to comment.