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.38 #897

Merged
merged 10 commits into from
Apr 4, 2024
8 changes: 8 additions & 0 deletions .changeset/chilled-turtles-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@lens-protocol/api-bindings": patch
"@lens-protocol/react-web": patch
"@lens-protocol/react": patch
"@lens-protocol/react-native": patch
---

**chore:** remove unused local-only field
6 changes: 6 additions & 0 deletions .changeset/healthy-poets-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@lens-protocol/client": minor
---

**chore:** removed Poaps module as was never implemented on the API side
**chore:** removed accessToken overwrite for `publication.postOnchain` method
3 changes: 3 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"chatty-ligers-care",
"chatty-socks-promise",
"chilled-panthers-march",
"chilled-turtles-pull",
"chilly-mirrors-fry",
"chilly-toes-check",
"cold-pants-do",
Expand Down Expand Up @@ -98,6 +99,7 @@
"happy-onions-act",
"happy-pumpkins-clean",
"healthy-avocados-rhyme",
"healthy-poets-serve",
"heavy-dodos-raise",
"heavy-lizards-eat",
"heavy-terms-prove",
Expand Down Expand Up @@ -177,6 +179,7 @@
"shy-pugs-taste",
"silent-mangos-yawn",
"silly-meals-tell",
"silly-paws-mate",
"six-cherries-notice",
"six-feet-sparkle",
"six-flowers-smell",
Expand Down
9 changes: 9 additions & 0 deletions .changeset/silly-paws-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@lens-protocol/react-native": minor
"@lens-protocol/react-web": minor
"@lens-protocol/api-bindings": patch
"@lens-protocol/domain": patch
"@lens-protocol/react": patch
---

**feat:** supports Unknown Reference modules
15 changes: 0 additions & 15 deletions examples/node/scripts/poaps/event.ts

This file was deleted.

18 changes: 0 additions & 18 deletions examples/node/scripts/poaps/fetch.ts

This file was deleted.

21 changes: 0 additions & 21 deletions examples/node/scripts/poaps/holders.ts

This file was deleted.

19 changes: 0 additions & 19 deletions examples/node/scripts/poaps/mutualEvents.ts

This file was deleted.

47 changes: 0 additions & 47 deletions examples/node/scripts/publication/postOnchain-token-overwrite.ts

This file was deleted.

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.34

### Patch Changes

- 8dcaeda61: **chore:** remove unused local-only field
- 880fb5de3: **feat:** supports Unknown Reference modules
- Updated dependencies [880fb5de3]
- @lens-protocol/[email protected]

## 0.11.0-alpha.33

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/api-bindings/codegen-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ generates:
# - https://api-mumbai.lens-v2.crtlkey.com/ # staging
- https://api-v2-mumbai-live.lens.dev/graphql # testnet
# - http://localhost:4000/
- src/lens/graphql/client.graphql
documents:
- src/lens/graphql/*.graphql
plugins:
Expand Down Expand Up @@ -98,5 +97,6 @@ generates:
operationResultSuffix: 'Data' # goes with typescript-operations.operationResultSuffix
fragmentVariablePrefix: Fragment # because FragmentDoc suffix is removed by omitOperationSuffix we need to add a prefix to differentiate fragment types from fragment documents
documentMode: documentNode
withMutationFn: false
- 'typescript-apollo-client-helpers'
- 'fragment-matcher'
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.33",
"version": "0.11.0-alpha.34",
"description": "Graphql fragments, react hooks, typescript types of lens API.",
"repository": {
"directory": "packages/api-bindings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ describe(`Given a cursor-based paginated query field`, () => {
describe('when fetching the next page', () => {
it(`should:
- append incoming items to the existing ones
- update "pageInfo.prev" to results prior the first page and "pageInfo.next" to results after the new last page
- update "pageInfo.moreAfter" accordingly`, async () => {
- update "pageInfo.prev" to results prior the first page and "pageInfo.next" to results after the new last page`, async () => {
const initialResult = mockAnyPaginatedQueryResult({
next: nextCursor,
prev: prevCursor,
Expand Down Expand Up @@ -76,17 +75,14 @@ describe(`Given a cursor-based paginated query field`, () => {
expect(data.result).toMatchObject({
items: [...initialResult.items, ...nextResult.items],
pageInfo: {
moreAfter: true,
next: nextResult.pageInfo.next,
prev: initialResult.pageInfo.prev,
},
});
});

describe('but the incoming result is empty', () => {
it(`should:
- NOT update the "pageInfo.next" cursor
- unset the "pageInfo.moreAfter" flag`, async () => {
it(`should NOT update the "pageInfo.next" cursor`, async () => {
const initialResult = mockAnyPaginatedQueryResult({
next: nextCursor,
prev: prevCursor,
Expand Down Expand Up @@ -116,7 +112,6 @@ describe(`Given a cursor-based paginated query field`, () => {

expect(data.result).toMatchObject({
pageInfo: {
moreAfter: false,
next: initialResult.pageInfo.next,
prev: initialResult.pageInfo.prev,
},
Expand All @@ -128,8 +123,7 @@ describe(`Given a cursor-based paginated query field`, () => {
describe('when fetching the previous page', () => {
it(`should:
- prepend incoming items to the existing ones
- update the "pageInfo.prev" to results prior the new first page and "pageInfo.next" to results after the last page
- update the "pageInfo.moreAfter" accordingly`, async () => {
- update the "pageInfo.prev" to results prior the new first page and "pageInfo.next" to results after the last page`, async () => {
const initialResult = mockAnyPaginatedQueryResult({
prev: prevCursor,
next: null,
Expand Down Expand Up @@ -160,7 +154,6 @@ describe(`Given a cursor-based paginated query field`, () => {
expect(data.result).toMatchObject({
items: [...prevResult.items, ...initialResult.items],
pageInfo: {
moreAfter: false,
next: initialResult.pageInfo.next,
prev: prevResult.pageInfo.prev,
},
Expand Down Expand Up @@ -198,7 +191,6 @@ describe(`Given a cursor-based paginated query field`, () => {

expect(data.result).toMatchObject({
pageInfo: {
moreAfter: true,
next: initialResult.pageInfo.next,
prev: initialResult.pageInfo.prev,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,6 @@ export function cursorBasedPagination<TResult extends CursorBasedPaginatedResult
return {
keyArgs,

read(existing: SafeReadonly<TResult> | undefined) {
if (!existing) {
return existing;
}

const { items, pageInfo } = existing;

// items that are not in the cache anymore (for .e.g deleted publication)
const readRes: SafeReadonly<TResult> = {
...existing,
items,
pageInfo: {
...pageInfo,
moreAfter: existing.pageInfo.moreAfter ?? existing.pageInfo.next !== null,
},
};

return readRes;
},

merge(
existing: SafeReadonly<TResult> | undefined,
incoming: SafeReadonly<TResult>,
Expand All @@ -61,7 +41,6 @@ export function cursorBasedPagination<TResult extends CursorBasedPaginatedResult
items: existingItems,
pageInfo: {
...incoming.pageInfo, // future-proofing in case we add more fields to pageInfo
moreAfter: existing.pageInfo.next !== null,
next: existing.pageInfo.next,
prev: existing.pageInfo.prev,
},
Expand All @@ -73,7 +52,6 @@ export function cursorBasedPagination<TResult extends CursorBasedPaginatedResult
items: incomingItems.concat(existingItems),
pageInfo: {
...incoming.pageInfo, // future-proofing in case we add more fields to pageInfo
moreAfter: existing.pageInfo.moreAfter,
next: existing.pageInfo.next,
prev: incoming.pageInfo.prev ?? existing.pageInfo.prev,
},
Expand All @@ -87,7 +65,6 @@ export function cursorBasedPagination<TResult extends CursorBasedPaginatedResult
items: existingItems,
pageInfo: {
...incoming.pageInfo, // future-proofing in case we add more fields to pageInfo
moreAfter: false,
next: existing.pageInfo.next,
prev: existing.pageInfo.prev,
},
Expand All @@ -99,7 +76,6 @@ export function cursorBasedPagination<TResult extends CursorBasedPaginatedResult
items: existingItems.concat(incomingItems),
pageInfo: {
...incoming.pageInfo, // future-proofing in case we add more fields to pageInfo
moreAfter: incoming.pageInfo.next !== null,
next: incoming.pageInfo.next,
prev: existing.pageInfo.prev,
},
Expand Down
16 changes: 15 additions & 1 deletion packages/api-bindings/src/lens/__helpers__/fragments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,21 @@ export function mockQuoteFragment(overrides?: Partial<Omit<gql.Quote, '__typenam
};
}

export function mockUnknownReferenceModuleSettings(
overrides?: Partial<gql.UnknownReferenceModuleSettings>,
): gql.UnknownReferenceModuleSettings {
return {
contract: mockNetworkAddressFragment(),
signlessApproved: true,
sponsoredApproved: true,
initializeCalldata: null,
initializeResultData: null,
verified: false,
...overrides,
__typename: 'UnknownReferenceModuleSettings',
};
}

export function mockMirrorFragment(
overrides?: Partial<Omit<gql.Mirror, '__typename'>>,
): gql.Mirror {
Expand Down Expand Up @@ -294,7 +309,6 @@ export function mockPaginatedResultInfo(
overrides: Partial<gql.PaginatedResultInfo> = {},
): gql.PaginatedResultInfo {
return {
moreAfter: false,
prev: null,
next: null,
...overrides,
Expand Down
3 changes: 0 additions & 3 deletions packages/api-bindings/src/lens/graphql/client.graphql

This file was deleted.

1 change: 0 additions & 1 deletion packages/api-bindings/src/lens/graphql/fragments.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ fragment ProfileMentioned on ProfileMentioned {

fragment PaginatedResultInfo on PaginatedResultInfo {
__typename
moreAfter @client
prev
next
}
Expand Down
Loading
Loading