From c8087219381c72233af7aef3bfd60fc587d479c4 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 30 May 2023 15:46:43 -0400 Subject: [PATCH] Spelling (#772) * spelling: account Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: activated Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: additional Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: appropriate Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: bskyweb Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: description Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: display Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: highlighted Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: javascript Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: locally-hosted Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: notification Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: occurring Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: parenthetical Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: preexisting Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: prefetched Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: punctuation Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: simplicity Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --------- Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- Dockerfile | 4 ++-- __tests__/lib/string.test.ts | 4 ++-- bskyweb/README.md | 2 +- bskyweb/templates/base.html | 4 ++-- docs/build.md | 4 ++-- src/lib/notifee.ts | 30 +++++++++++++------------ src/lib/routes/helpers.ts | 2 +- src/lib/strings/rich-text-detection.ts | 2 +- src/platform/polyfills.ts | 2 +- src/state/models/content/post-thread.ts | 13 +++++++---- src/state/models/feeds/notifications.ts | 6 ++--- src/state/models/session.ts | 4 ++-- src/view/com/auth/create/Step1.tsx | 6 ++--- src/view/com/profile/ProfileHeader.tsx | 2 +- src/view/com/util/post-embeds/index.tsx | 2 +- src/view/screens/Home.tsx | 2 +- 16 files changed, 48 insertions(+), 41 deletions(-) diff --git a/Dockerfile b/Dockerfile index fbd13beb..241926db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ENV CGO_ENABLED=1 COPY . . # -# Generate the Javascript webpack. +# Generate the JavaScript webpack. # RUN mkdir --parents $NVM_DIR && \ wget \ @@ -36,7 +36,7 @@ RUN \. "$NVM_DIR/nvm.sh" && \ RUN find ./bskyweb/static && find ./web-build/static # -# Generate the bksyweb Go binary. +# Generate the bskyweb Go binary. # RUN cd bskyweb/ && \ go mod download && \ diff --git a/__tests__/lib/string.test.ts b/__tests__/lib/string.test.ts index f25bd02a..936708cf 100644 --- a/__tests__/lib/string.test.ts +++ b/__tests__/lib/string.test.ts @@ -48,7 +48,7 @@ describe('detectLinkables', () => { 'Classic article https://socket3.wordpress.com/2018/02/03/designing-windows-95s-user-interface/ ', 'https://foo.com https://bar.com/whatever https://baz.com', 'punctuation https://foo.com, https://bar.com/whatever; https://baz.com.', - 'parenthentical (https://foo.com)', + 'parenthetical (https://foo.com)', 'except for https://foo.com/thing_(cool)', ] const outputs = [ @@ -112,7 +112,7 @@ describe('detectLinkables', () => { {link: 'https://baz.com'}, '.', ], - ['parenthentical (', {link: 'https://foo.com'}, ')'], + ['parenthetical (', {link: 'https://foo.com'}, ')'], ['except for ', {link: 'https://foo.com/thing_(cool)'}], ] it('correctly handles a set of text inputs', () => { diff --git a/bskyweb/README.md b/bskyweb/README.md index a74cda0d..d6064737 100644 --- a/bskyweb/README.md +++ b/bskyweb/README.md @@ -2,7 +2,7 @@ ### SPA Bundle (monolithic static javascript file) -To build the SPA bundle (`bundle.web.js`), first get a Javascript development +To build the SPA bundle (`bundle.web.js`), first get a JavaScript development environment set up. Either follow the top-level README, or something quick like: diff --git a/bskyweb/templates/base.html b/bskyweb/templates/base.html index 5725b7af..abd312ed 100644 --- a/bskyweb/templates/base.html +++ b/bskyweb/templates/base.html @@ -122,8 +122,8 @@ {%- block body_all %}
diff --git a/docs/build.md b/docs/build.md index 33e7f675..ca6f938a 100644 --- a/docs/build.md +++ b/docs/build.md @@ -26,11 +26,11 @@ - Run once: `yarn e2e:build` - Each test run: `yarn e2e:run` - Tips - - Make sure you copy the `.env.example` to `.env` and add the appropiate tokens (e.g. `SENTRY_AUTH_TOKEN` can be created on the Sentry dashboard). If this is not required, you can remove it from `eas.json` and `package.json`, as well as any mentions in the code. + - Make sure you copy the `.env.example` to `.env` and add the appropriate tokens (e.g. `SENTRY_AUTH_TOKEN` can be created on the Sentry dashboard). If this is not required, you can remove it from `eas.json` and `package.json`, as well as any mentions in the code. - If you want to use Expo EAS on your own builds without ejecting from Expo, make sure to change the `owner` as well as `extra.eas.projectId` properties. If you do not have an Expo account, you may remove these properties. - `npx react-native info` Checks what has been installed. - The android simulator won't be able to access localhost services unless you run `adb reverse tcp:{PORT} tcp:{PORT}` - - For instance, the localhosted dev-wallet will need `adb reverse tcp:3001 tcp:3001` + - For instance, the locally-hosted dev-wallet will need `adb reverse tcp:3001 tcp:3001` - For some reason, the typescript compiler chokes on platform-specific files (e.g. `foo.native.ts`) but only when compiling for Web thus far. Therefore we always have one version of the file which doesn't use a platform specifier, and that should be the Web version. ([More info](https://stackoverflow.com/questions/44001050/platform-specific-import-component-in-react-native-with-typescript).) ## Go-Server Build diff --git a/src/lib/notifee.ts b/src/lib/notifee.ts index 86631903..42feb01c 100644 --- a/src/lib/notifee.ts +++ b/src/lib/notifee.ts @@ -41,26 +41,26 @@ export function displayNotification( } export function displayNotificationFromModel( - notif: NotificationsFeedItemModel, + notification: NotificationsFeedItemModel, ) { let author = sanitizeDisplayName( - notif.author.displayName || notif.author.handle, + notification.author.displayName || notification.author.handle, ) let title: string let body: string = '' - if (notif.isLike) { + if (notification.isLike) { title = `${author} liked your post` - body = notif.additionalPost?.thread?.postRecord?.text || '' - } else if (notif.isRepost) { + body = notification.additionalPost?.thread?.postRecord?.text || '' + } else if (notification.isRepost) { title = `${author} reposted your post` - body = notif.additionalPost?.thread?.postRecord?.text || '' - } else if (notif.isMention) { + body = notification.additionalPost?.thread?.postRecord?.text || '' + } else if (notification.isMention) { title = `${author} mentioned you` - body = notif.additionalPost?.thread?.postRecord?.text || '' - } else if (notif.isReply) { + body = notification.additionalPost?.thread?.postRecord?.text || '' + } else if (notification.isReply) { title = `${author} replied to your post` - body = notif.additionalPost?.thread?.postRecord?.text || '' - } else if (notif.isFollow) { + body = notification.additionalPost?.thread?.postRecord?.text || '' + } else if (notification.isFollow) { title = 'New follower!' body = `${author} has followed you` } else { @@ -68,10 +68,12 @@ export function displayNotificationFromModel( } let image if ( - AppBskyEmbedImages.isView(notif.additionalPost?.thread?.post.embed) && - notif.additionalPost?.thread?.post.embed.images[0]?.thumb + AppBskyEmbedImages.isView( + notification.additionalPost?.thread?.post.embed, + ) && + notification.additionalPost?.thread?.post.embed.images[0]?.thumb ) { - image = notif.additionalPost.thread.post.embed.images[0].thumb + image = notification.additionalPost.thread.post.embed.images[0].thumb } return displayNotification(title, body, image) } diff --git a/src/lib/routes/helpers.ts b/src/lib/routes/helpers.ts index cfa6ae53..071e1ae9 100644 --- a/src/lib/routes/helpers.ts +++ b/src/lib/routes/helpers.ts @@ -11,7 +11,7 @@ export function getCurrentRoute(state: State) { export function isStateAtTabRoot(state: State | undefined) { if (!state) { // NOTE - // if state is not defined it's because init is occuring + // if state is not defined it's because init is occurring // and therefore we can safely assume we're at root // -prf return true diff --git a/src/lib/strings/rich-text-detection.ts b/src/lib/strings/rich-text-detection.ts index 51d09ec5..931617cd 100644 --- a/src/lib/strings/rich-text-detection.ts +++ b/src/lib/strings/rich-text-detection.ts @@ -27,7 +27,7 @@ export function detectLinkables(text: string): DetectedLinkable[] { matchValue = matchValue.slice(1) } - // strip ending puncuation + // strip ending punctuation if (/[.,;!?]$/.test(matchValue)) { matchValue = matchValue.slice(0, -1) } diff --git a/src/platform/polyfills.ts b/src/platform/polyfills.ts index a64c2c33..d5028c29 100644 --- a/src/platform/polyfills.ts +++ b/src/platform/polyfills.ts @@ -23,7 +23,7 @@ globalThis.atob = (str: string): string => { ) } - // Adding the padding if missing, for semplicity + // Adding the padding if missing, for simplicity str += '=='.slice(2 - (str.length & 3)) var bitmap, result = '', diff --git a/src/state/models/content/post-thread.ts b/src/state/models/content/post-thread.ts index 74a75d80..577b76e0 100644 --- a/src/state/models/content/post-thread.ts +++ b/src/state/models/content/post-thread.ts @@ -118,7 +118,7 @@ export class PostThreadItemModel { assignTreeModels( v: AppBskyFeedDefs.ThreadViewPost, - higlightedPostUri: string, + highlightedPostUri: string, includeParent = true, includeChildren = true, ) { @@ -130,7 +130,12 @@ export class PostThreadItemModel { parentModel._showChildReplyLine = true if (v.parent.parent) { parentModel._showParentReplyLine = true - parentModel.assignTreeModels(v.parent, higlightedPostUri, true, false) + parentModel.assignTreeModels( + v.parent, + highlightedPostUri, + true, + false, + ) } this.parent = parentModel } else if (AppBskyFeedDefs.isNotFoundPost(v.parent)) { @@ -147,10 +152,10 @@ export class PostThreadItemModel { const itemModel = new PostThreadItemModel(this.rootStore, item) itemModel._depth = this._depth + 1 itemModel._showParentReplyLine = - itemModel.parentUri !== higlightedPostUri && replies.length === 0 + itemModel.parentUri !== highlightedPostUri && replies.length === 0 if (item.replies?.length) { itemModel._showChildReplyLine = true - itemModel.assignTreeModels(item, higlightedPostUri, false, true) + itemModel.assignTreeModels(item, highlightedPostUri, false, true) } replies.push(itemModel) } else if (AppBskyFeedDefs.isNotFoundPost(item)) { diff --git a/src/state/models/feeds/notifications.ts b/src/state/models/feeds/notifications.ts index 3777abb9..5005f1d9 100644 --- a/src/state/models/feeds/notifications.ts +++ b/src/state/models/feeds/notifications.ts @@ -181,7 +181,7 @@ export class NotificationsFeedItemModel { return false } - get additionaDataUri(): string | undefined { + get additionalDataUri(): string | undefined { if (this.isReply || this.isQuote || this.isMention) { return this.uri } else if (this.isLike || this.isRepost) { @@ -492,7 +492,7 @@ export class NotificationsFeedModel { 'mostRecent', res.data.notifications[0], ) - const addedUri = notif.additionaDataUri + const addedUri = notif.additionalDataUri if (addedUri) { const postsRes = await this.rootStore.agent.app.bsky.feed.getPosts({ uris: [addedUri], @@ -585,7 +585,7 @@ export class NotificationsFeedModel { `item-${_idCounter++}`, item, ) - const uri = itemModel.additionaDataUri + const uri = itemModel.additionalDataUri if (uri) { const models = addedPostMap.get(uri) || [] models.push(itemModel) diff --git a/src/state/models/session.ts b/src/state/models/session.ts index c3653760..aa9c9775 100644 --- a/src/state/models/session.ts +++ b/src/state/models/session.ts @@ -187,7 +187,7 @@ export class SessionModel { account => account.service === service && account.did === did, ) - // fall back to any pre-existing access tokens + // fall back to any preexisting access tokens let refreshJwt = session?.refreshJwt || existingAccount?.refreshJwt let accessJwt = session?.accessJwt || existingAccount?.accessJwt if (event === 'expired') { @@ -247,7 +247,7 @@ export class SessionModel { const res = await agent.getProfile({actor: did}).catch(_e => undefined) if (res) { return { - dispayName: res.data.displayName, + displayName: res.data.displayName, aviUrl: res.data.avatar, } } diff --git a/src/view/com/auth/create/Step1.tsx b/src/view/com/auth/create/Step1.tsx index ac0d706d..57747f07 100644 --- a/src/view/com/auth/create/Step1.tsx +++ b/src/view/com/auth/create/Step1.tsx @@ -32,7 +32,7 @@ export const Step1 = observer(({model}: {model: CreateAccountModel}) => { model.setServiceDescription(undefined) }, [setIsDefaultSelected, model]) - const fetchServiceDesription = React.useMemo( + const fetchServiceDescription = React.useMemo( () => debounce(() => model.fetchServiceDescription(), 1e3), [model], ) @@ -40,9 +40,9 @@ export const Step1 = observer(({model}: {model: CreateAccountModel}) => { const onChangeServiceUrl = React.useCallback( (v: string) => { model.setServiceUrl(v) - fetchServiceDesription() + fetchServiceDescription() }, - [model, fetchServiceDesription], + [model, fetchServiceDescription], ) const onDebugChangeServiceUrl = React.useCallback( diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index 3b9ca67c..d5ae3a88 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -218,7 +218,7 @@ const ProfileHeaderLoaded = observer( onRefreshAll() Toast.show('Account unblocked') } catch (e: any) { - store.log.error('Failed to block unaccount', e) + store.log.error('Failed to block account', e) Toast.show(`There was an issue! ${e.toString()}`) } }, diff --git a/src/view/com/util/post-embeds/index.tsx b/src/view/com/util/post-embeds/index.tsx index 9eb140c2..8156d773 100644 --- a/src/view/com/util/post-embeds/index.tsx +++ b/src/view/com/util/post-embeds/index.tsx @@ -109,7 +109,7 @@ export function PostEmbeds({ RNImage.prefetch(firstImageToShow) items.forEach(item => { if (firstImageToShow !== item.uri) { - // First image already prefeched above + // First image already prefetched above RNImage.prefetch(item.uri) } }) diff --git a/src/view/screens/Home.tsx b/src/view/screens/Home.tsx index eae4d979..d7a2aa23 100644 --- a/src/view/screens/Home.tsx +++ b/src/view/screens/Home.tsx @@ -202,7 +202,7 @@ const FeedPage = observer( } }, [store, doPoll, onSoftReset, screen, feed]), ) - // fires when tab is actived/deactivated + // fires when tab is activated/deactivated // - check for latest useTabFocusEffect( 'Home',