Skip to content

Commit

Permalink
Lenster to Hey rebrand (#26)
Browse files Browse the repository at this point in the history
* Lenster to Hey rebrand

* manifest fix

* Hey links to lowercase

* lenster id to Hey id

* Supportd old Lenster LensShare links via next.js redirects and fix functional tests

---------

Co-authored-by: Cesare Naldi <[email protected]>
  • Loading branch information
DanIsNearby and cesarenaldi authored Oct 2, 2023
1 parent 549eb09 commit 94fe3f4
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 55 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Where:
Some examples:

- `https://share.lens.xyz/p/0x01`
- `https://share.lens.xyz/p/0x01?by=lenster`
- `https://share.lens.xyz/p/0x01?by=hey`
- `https://share.lens.xyz/p/0x01?by=orb`

### Profile Lens Share Link
Expand All @@ -62,7 +62,7 @@ Where:
Some examples:

- `https://share.lens.xyz/u/alice.lens`
- `https://share.lens.xyz/u/alice.lens?by=lenster`
- `https://share.lens.xyz/u/alice.lens?by=Hey`

## Lens Share UI

Expand Down
2 changes: 1 addition & 1 deletion e2e/mobile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test.describe("Given a mobile browser", async () => {
test("Then it should show in order mobile and web apps options", async ({ textPost }) => {
await textPost.open();

await expect(textPost.options).toHaveText(["Buttrfly", "Orb", "Lensta", "Lenster", "Soclly"]);
await expect(textPost.options).toHaveText(["Buttrfly", "Orb", "Hey", "Lensta", "Soclly"]);
});
});
});
32 changes: 16 additions & 16 deletions e2e/profiles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ test.describe("Given a Profile link", async () => {
await expect(anyProfile.options).toHaveText([
"Buttrfly",
"Collectz",
"Hey",
"LensFrens",
"Lensta",
"Lenster",
"Lenstube",
"Riff",
"Soclly",
Expand All @@ -30,7 +30,7 @@ test.describe("Given a Publication link posted on a social media website/app", a

expect(await anyProfile.extractOpenGraphProperties()).toMatchObject({
"og:title": `@${anyProfile.handle} profile`,
"og:description": "The Social Layer of Web3 🌿",
"og:description": "The Social Layer for Web3 🌿",
"og:url": expect.stringContaining(`/u/${anyProfile.handle}`),
"og:site_name": "Lens Share",
"og:type": "profile",
Expand All @@ -44,7 +44,7 @@ test.describe("Given a Publication link posted on a social media website/app", a
"twitter:card": "summary_large_image",
"twitter:site": "LensProtocol",
"twitter:title": `@${anyProfile.handle} profile`,
"twitter:description": "The Social Layer of Web3 🌿",
"twitter:description": "The Social Layer for Web3 🌿",
"twitter:image": expect.any(String),
"twitter:image:type": "image/png",
});
Expand All @@ -55,25 +55,25 @@ test.describe("Given a Publication link posted on a social media website/app", a
test("Then it should mention the originating app in page `title` and Open Graph `site_name` tag", async ({
anyProfile,
}) => {
await anyProfile.openAsSharedBy("lenster");
await anyProfile.openAsSharedBy("Hey");

expect(await anyProfile.getTitle()).toContain("Lenster");
expect(await anyProfile.getTitle()).toContain("Hey");
expect(await anyProfile.extractOpenGraphProperties()).toMatchObject({
"og:site_name": "Lenster",
"og:site_name": "Hey",
});
});

test("Then it should mention the originating app in Twitter Card `site` if a Twitter handle is provided in the app manifest", async ({
anyProfile,
}) => {
await anyProfile.openAsSharedBy("lenster");
await anyProfile.openAsSharedBy("Hey");

expect(await anyProfile.getTitle()).toContain("Lenster");
expect(await anyProfile.getTitle()).toContain("Hey");
expect(await anyProfile.extractOpenGraphProperties()).toMatchObject({
"og:site_name": "Lenster",
"og:site_name": "Hey",
});
expect(await anyProfile.extractTwitterMetaTags()).toMatchObject({
"twitter:site": "lensterxyz",
"twitter:site": "heydotxyz",
});
});
});
Expand All @@ -82,10 +82,10 @@ test.describe("Given a Publication link posted on a social media website/app", a
test.describe("Given a Profile link with `by` attribution param", async () => {
test.describe("When opening it", async () => {
test("Then it should show the specified app first", async ({ anyProfile }) => {
await anyProfile.openAsSharedBy("lenster");
await anyProfile.openAsSharedBy("Hey");

await expect(anyProfile.options).toHaveText([
"Lenster",
"Hey",
"Buttrfly",
"Collectz",
"LensFrens",
Expand All @@ -112,20 +112,20 @@ test.describe("Given an opened Profile link", async () => {
test.describe("When submitting an app choice", async () => {
test("Then it should open the publication with the selected app", async ({ anyProfile }) => {
await anyProfile.open();
const url = await anyProfile.justOnce("Lenster");
const url = await anyProfile.justOnce("Hey");

await expect(url).toMatch(`https://lenster.xyz/u/${anyProfile.handle}`);
await expect(url).toMatch(`https://hey.xyz/u/${anyProfile.handle}`);
});
});

test.describe("When submitting an app choice with 'Remember' checkbox selected", async () => {
test("Then it should use the same app for all future publications", async ({ anyProfile }) => {
await anyProfile.open();
await anyProfile.remember("Lenster");
await anyProfile.remember("Hey");

const response = await anyProfile.open();

await expect(response?.url()).toMatch(`https://lenster.xyz/u/${anyProfile.handle}`);
await expect(response?.url()).toMatch(`https://hey.xyz/u/${anyProfile.handle}`);
});
});
});
28 changes: 14 additions & 14 deletions e2e/publications.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ test.describe("Given a Publication link", async () => {
await expect(imagePost.options).toHaveText([
"Buttrfly",
"Collectz",
"Hey",
"Lensta",
"Lenster",
"Soclly",
]);
});
Expand Down Expand Up @@ -87,25 +87,25 @@ test.describe("Given a Publication link posted on a social media website/app", a
test("Then it should mention the originating app in page `title` and Open Graph `site_name` tag", async ({
textPost,
}) => {
await textPost.openAsSharedBy("lenster");
await textPost.openAsSharedBy("Hey");

expect(await textPost.getTitle()).toContain("Lenster");
expect(await textPost.getTitle()).toContain("Hey");
expect(await textPost.extractOpenGraphProperties()).toMatchObject({
"og:site_name": "Lenster",
"og:site_name": "Hey",
});
});

test("Then it should mention the originating app in Twitter Card `site` if a Twitter handle is provided in the app manifest", async ({
textPost,
}) => {
await textPost.openAsSharedBy("lenster");
await textPost.openAsSharedBy("Hey");

expect(await textPost.getTitle()).toContain("Lenster");
expect(await textPost.getTitle()).toContain("Hey");
expect(await textPost.extractOpenGraphProperties()).toMatchObject({
"og:site_name": "Lenster",
"og:site_name": "Hey",
});
expect(await textPost.extractTwitterMetaTags()).toMatchObject({
"twitter:site": "lensterxyz",
"twitter:site": "heydotxyz",
});
});
});
Expand All @@ -121,7 +121,7 @@ test.describe("Given a Video Publication link", async () => {
await expect(videoPost.options).toHaveText([
"Buttrfly",
"Collectz",
"Lenster",
"Hey",
"Lenstube",
"Soclly",
]);
Expand All @@ -138,7 +138,7 @@ test.describe("Given a Publication link with `by` attribution param", async () =
"Lenstube",
"Buttrfly",
"Collectz",
"Lenster",
"Hey",
"Soclly",
]);
});
Expand All @@ -159,20 +159,20 @@ test.describe("Given an opened Publication link", async () => {
test.describe("When submitting an app choice", async () => {
test("Then it should open the publication with the selected app", async ({ textPost }) => {
await textPost.open();
const url = await textPost.justOnce("Lenster");
const url = await textPost.justOnce("Hey");

await expect(url).toMatch(`https://lenster.xyz/posts/${textPost.publicationId}`);
await expect(url).toMatch(`https://hey.xyz/posts/${textPost.publicationId}`);
});
});

test.describe("When submitting an app choice with 'Remember' checkbox selected", async () => {
test("Then it should use the same app for all future publications", async ({ textPost }) => {
await textPost.open();
await textPost.remember("Lenster");
await textPost.remember("Hey");

const response = await textPost.open();

await expect(response?.url()).toMatch(`https://lenster.xyz/posts/${textPost.publicationId}`);
await expect(response?.url()).toMatch(`https://hey.xyz/posts/${textPost.publicationId}`);
});
});
});
21 changes: 21 additions & 0 deletions manifests/hey.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"appId": "Hey",
"name": "Hey",
"description": "Hey is a composable, decentralized, and permission-less social media web app built with Lens Protocol 🌿",
"platform": "web",
"icon": {
"url": "https://hey.xyz/logo.png",
"background": "#000"
},
"routes": {
"home": "https://hey.xyz/",
"profile": {
"url": "https://hey.xyz/u/:handle"
},
"publication": {
"url": "https://hey.xyz/posts/:id",
"supports": ["ARTICLE", "AUDIO", "EMBED", "IMAGE", "LINK", "TEXT_ONLY", "VIDEO"]
}
},
"twitter": "heydotxyz"
}
21 changes: 0 additions & 21 deletions manifests/lenster.json

This file was deleted.

28 changes: 28 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,34 @@ const nextConfig = {
experimental: {
serverActions: true,
},
async redirects() {
return [
{
source: "/p/:id",
has: [
{
type: "query",
key: "by",
value: "lenster",
},
],
destination: "/p/:id?by=Hey",
permanent: false,
},
{
source: "/u/:handle",
has: [
{
type: "query",
key: "by",
value: "lenster",
},
],
destination: "/u/:handle?by=Hey",
permanent: false,
},
];
},
};

module.exports = nextConfig;
2 changes: 1 addition & 1 deletion src/app/p/[id]/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { resolvePlatformType } from "@/utils/device";
import { redirectTo } from "./redirect";

export async function openWith(data: FormData) {
const appId = data.get("appId") as string | null;
var appId = data.get("appId") as string | null;
invariant(appId !== null, "Missing App ID");

const publicationId = data.get("publicationId") as string | null;
Expand Down

0 comments on commit 94fe3f4

Please sign in to comment.