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

chore: prepare release react 2.0.0-alpha.36 #884

Merged
merged 10 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 10 additions & 0 deletions .changeset/early-gorillas-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@lens-protocol/react-native": minor
"@lens-protocol/react-web": minor
"@lens-protocol/react": minor
"@lens-protocol/gated-content": patch
"@lens-protocol/shared-kernel": patch
"@lens-protocol/api-bindings": patch
---

**feat:** adds experimental `useOptimisticCreatePost` hook
8 changes: 8 additions & 0 deletions .changeset/giant-panthers-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@lens-protocol/api-bindings": patch
"@lens-protocol/react": patch
"@lens-protocol/react-native": patch
"@lens-protocol/react-web": patch
---

**feat:** add optimistic updates for publication stats
7 changes: 7 additions & 0 deletions .changeset/gorgeous-bats-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@lens-protocol/react": patch
"@lens-protocol/react-native": patch
"@lens-protocol/react-web": patch
---

**feat:** refetch profile stats after content creation
8 changes: 8 additions & 0 deletions .changeset/kind-wombats-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@lens-protocol/api-bindings": minor
"@lens-protocol/react": minor
"@lens-protocol/react-native": minor
"@lens-protocol/react-web": minor
---

**feat:** added `useRateLimits` hook
8 changes: 8 additions & 0 deletions .changeset/light-seas-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@lens-protocol/api-bindings": minor
"@lens-protocol/react": minor
"@lens-protocol/react-native": minor
"@lens-protocol/react-web": minor
---

**feat:** added `resolveCollectPolicy` helper and exchange rate details
10 changes: 9 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
"api-bindings-v1": "0.10.1",
"react-v1": "1.3.1",
"react-web-v1": "1.3.1",
"example-next-js": "0.1.0"
"example-next-js": "0.1.0",
"lens-next-app": "0.1.0",
"example-native": "0.0.1"
},
"changesets": [
"afraid-comics-fry",
Expand Down Expand Up @@ -55,6 +57,7 @@
"dirty-tools-hammer",
"dry-cobras-bow",
"dull-bags-nail",
"early-gorillas-enjoy",
"early-penguins-whisper",
"early-spiders-scream",
"eighty-timers-mix",
Expand All @@ -78,11 +81,13 @@
"fuzzy-pillows-unite",
"gentle-glasses-jam",
"giant-games-type",
"giant-panthers-listen",
"gold-dolphins-pump",
"gold-radios-hunt",
"gold-ways-float",
"gold-wombats-tell",
"good-insects-compete",
"gorgeous-bats-dance",
"gorgeous-pigs-kneel",
"gorgeous-rice-trade",
"green-ligers-flow",
Expand All @@ -105,6 +110,7 @@
"hot-hornets-drum",
"itchy-mails-shout",
"khaki-students-pump",
"kind-wombats-serve",
"large-cars-know",
"large-glasses-grin",
"late-clocks-rhyme",
Expand All @@ -113,6 +119,7 @@
"lemon-drinks-exercise",
"lemon-schools-decide",
"lemon-terms-perform",
"light-seas-cheat",
"light-suits-glow",
"long-ants-guess",
"long-carpets-marry",
Expand Down Expand Up @@ -212,6 +219,7 @@
"violet-impalas-grab",
"wet-dogs-refuse",
"wicked-bobcats-joke",
"wise-shirts-repeat",
"witty-pugs-flow",
"witty-roses-burn",
"yellow-cows-push",
Expand Down
5 changes: 5 additions & 0 deletions .changeset/wise-shirts-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lens-protocol/client": patch
---

**fix:** fix profile metadata request args when no AppId defined
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "CI"

on:
push:
branches: [main, "develop"]
branches: [main, develop]
pull_request:
branches: [main, "develop"]
branches: [main, develop]

jobs:
install:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/lens-next-app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Lens Next App E2E Test"

on:
push:
branches: [main, develop]

jobs:
e2e:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"

- run: pnpm install --frozen-lockfile

- name: Install Playwright Browsers
run: pnpm --dir examples/lens-next-app exec playwright install --with-deps

- name: Run Playwright tests
run: pnpm --dir examples/lens-next-app run test:e2e

- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
1 change: 1 addition & 0 deletions examples/lens-next-app/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# playwright
/test-results/
/playwright-report/
/playwright/.cache/
36 changes: 36 additions & 0 deletions examples/lens-next-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
13 changes: 13 additions & 0 deletions examples/lens-next-app/e2e/desktop.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { devices, test, expect } from "@playwright/test";

test.use(devices["Desktop Chrome"]);

test.describe("Given a desktop browser", async () => {
test.describe("When opening the default page", async () => {
test("Then the welcome text should appear", async ({ page }) => {
await page.goto("/");

await expect(page.getByRole("heading", { name: "Welcome to Lens" })).toBeVisible();
});
});
});
13 changes: 13 additions & 0 deletions examples/lens-next-app/e2e/mobile.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { devices, test, expect } from "@playwright/test";

test.use(devices["iPhone 13"]);

test.describe("Given a mobile browser", async () => {
test.describe("When opening the default page", async () => {
test("Then the welcome text should appear", async ({ page }) => {
await page.goto("/");

await expect(page.getByRole("heading", { name: "Welcome to Lens" })).toBeVisible();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@ const nextConfig = {
// Until the @apollo-client fixes the ESM modules support (https://github.com/apollographql/apollo-feature-requests/issues/287)
// it's required to either transpile the `@lens-protocol` packages or make sure they won't get `imported` during SSR.
transpilePackages: ["@lens-protocol"],

webpack: (config) => {
// Ignore warnings from the 3rd party packages
config.ignoreWarnings = [
{ module: /pino/ },
{ module: /node-gyp-build/ },
{ module: /@metamask/ },
];

return config;
},
};

module.exports = nextConfig;
export default nextConfig;
37 changes: 37 additions & 0 deletions examples/lens-next-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "lens-next-app",
"description": "Lens SDK Next.js Starter App",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"test:e2e": "playwright test"
},
"dependencies": {
"@lens-protocol/react-web": "latest",
"@lens-protocol/wagmi": "latest",
"@tanstack/react-query": "^5.18.1",
"connectkit": "^1.7.2",
"next": "^14.1.1",
"react": "^18",
"react-dom": "^18",
"viem": "^2.7.6",
"wagmi": "^2.5.6"
},
"devDependencies": {
"@playwright/test": "^1.42.1",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"dotenv": "^16.3.1",
"eslint": "^8",
"eslint-config-next": "14.1.1",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5"
}
}
38 changes: 38 additions & 0 deletions examples/lens-next-app/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { defineConfig } from "@playwright/test";
import dotenv from "dotenv";

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
dotenv.config();

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./e2e",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:3000",
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
},
/* Run your local dev server before starting the tests */
webServer: {
command: "pnpm dev",
url: "http://localhost:3000",
reuseExistingServer: !process.env.CI,
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ module.exports = {
tailwindcss: {},
autoprefixer: {},
},
}
};
Binary file added examples/lens-next-app/public/lens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ body {
)
rgb(var(--background-start-rgb));
}

@layer utilities {
.text-balance {
text-wrap: balance;
}
}
20 changes: 20 additions & 0 deletions examples/lens-next-app/src/app/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";

import { Providers } from "../components/Providers";
import { Web3Provider } from "@/components/Web3Provider";
import "./globals.css";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "Create Next App",
title: "Lens SDK + ConnectKit + Next.js App",
description: "Generated by create next app",
};

export default function RootLayout({ children }: { children: React.ReactNode }) {
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body className={inter.className}>
<Providers>{children}</Providers>
<Web3Provider>{children}</Web3Provider>
</body>
</html>
);
Expand Down
Loading
Loading