Skip to content

Commit 0de079b

Browse files
committed
chore: rename internal "unicorns" to "people"
1 parent ce8a263 commit 0de079b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+401
-410
lines changed

.github/FUNDING.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
open_collective: unicorn-utterances
1+
open_collective: playfulprogramming

CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ a project may be further defined and clarified by project maintainers.
5656

5757
Instances of abusive, harassing, or otherwise unacceptable behavior may be
5858
reported by contacting the project team in [our Discord](https://discord.gg/FMcvc6T)
59-
(tag the @unicorn-umpire role, they're the admins/team members). All complaints
59+
(tag the @playground-protector role, they're the admins/team members). All complaints
6060
will be reviewed and investigated and will result in a response that
6161
is deemed necessary and appropriate to the circumstances. The project team is
6262
obligated to maintain confidentiality with regard to the reporter of an incident.

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Contents:
2020

2121
# Creating an author profile
2222

23-
Before creating a post, you'll need to add some information about yourself. To do this, create a new folder in [`content/`](./content/data/unicorns.json) with your username, and add an `index.md` inside it; e.g. `content/eric/index.md`.
23+
Before creating a post, you'll need to add some information about yourself. To do this, create a new folder in [`content/`](./content/) with your username, and add an `index.md` inside it; e.g. `content/eric/index.md`.
2424

2525
Here's an example of what your `index.md` might look like:
2626

__mocks__/data/mock-collection.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { MockUnicorn } from "./mock-unicorn";
1+
import { MockPerson } from "./mock-person";
22
import { CollectionInfo } from "types/index";
33

44
export const MockCollection: CollectionInfo = {
55
kind: "collection",
6-
authors: [MockUnicorn.id],
6+
authors: [MockPerson.id],
77
tags: [],
88
postCount: 3,
99
coverImgMeta: {

__mocks__/data/mock-unicorn.ts __mocks__/data/mock-person.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { MockRole } from "./mock-role";
2-
import { UnicornInfo } from "types/index";
2+
import { PersonInfo } from "types/index";
33

4-
export const MockUnicorn: UnicornInfo = {
5-
kind: "unicorn",
4+
export const MockPerson: PersonInfo = {
5+
kind: "person",
66
name: "Joe",
77
firstName: "Joe",
88
lastName: "Other",
@@ -36,8 +36,8 @@ export const MockUnicorn: UnicornInfo = {
3636
},
3737
};
3838

39-
export const MockUnicornTwo: UnicornInfo = {
40-
kind: "unicorn",
39+
export const MockPersonTwo: PersonInfo = {
40+
kind: "person",
4141
name: "Diane",
4242
firstName: "Diane",
4343
lastName: "",

__mocks__/data/mock-post.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MockUnicorn, MockUnicornTwo } from "./mock-unicorn";
1+
import { MockPerson, MockPersonTwo } from "./mock-person";
22
import { MockLicense } from "./mock-license";
33
import { PostInfo } from "types/index";
44

@@ -10,7 +10,7 @@ export const MockPost: PostInfo = {
1010
tags: ["item1"],
1111
description: "This is a short description dunno why this would be this short",
1212
excerpt: "This is a short description dunno why this would be this short",
13-
authors: [MockUnicorn.id],
13+
authors: [MockPerson.id],
1414
license: MockLicense.id,
1515
locale: "en",
1616
locales: ["en", "es"],
@@ -31,7 +31,7 @@ export const MockMultiAuthorPost: PostInfo = {
3131
"This is another short description dunno why this would be this short",
3232
excerpt:
3333
"This is another short description dunno why this would be this short",
34-
authors: [MockUnicornTwo.id, MockUnicorn.id],
34+
authors: [MockPersonTwo.id, MockPerson.id],
3535
license: MockLicense.id,
3636
locale: "en",
3737
locales: ["en", "es"],
@@ -52,7 +52,7 @@ export const MockMuliLanguagePost: PostInfo = {
5252
"This is another short description dunno why this would be this short",
5353
excerpt:
5454
"This is another short description dunno why this would be this short",
55-
authors: [MockUnicornTwo.id, MockUnicorn.id],
55+
authors: [MockPersonTwo.id, MockPerson.id],
5656
license: MockLicense.id,
5757
locale: "en",
5858
locales: ["en", "es"],
@@ -74,7 +74,7 @@ export const MockCanonicalPost: PostInfo = {
7474
"This is another short description dunno why this would be this short",
7575
excerpt:
7676
"This is another short description dunno why this would be this short",
77-
authors: [MockUnicornTwo.id, MockUnicorn.id],
77+
authors: [MockPersonTwo.id, MockPerson.id],
7878
license: MockLicense.id,
7979
locale: "en",
8080
locales: ["en", "es"],

api/search.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { VercelRequest, VercelResponse } from "@vercel/node";
22
import Fuse from "fuse.js";
33
import { createRequire } from "node:module";
44

5-
import type { CollectionInfo, UnicornInfo, PostInfo } from "types/index";
5+
import type { CollectionInfo, PersonInfo, PostInfo } from "types/index";
66
import type { ServerReturnType } from "../src/views/search/types";
77

88
const require = createRequire(import.meta.url);
@@ -35,14 +35,14 @@ const collectionFuse = new Fuse<CollectionInfo>(
3535
collectionIndex,
3636
);
3737

38-
const unicorns: Record<string, UnicornInfo> = searchIndex.unicorns;
38+
const people: Record<string, PersonInfo> = searchIndex.people;
3939

4040
function runQuery(req: VercelRequest): ServerReturnType {
4141
// TODO: `pickdeep` only required fields
4242
const searchStr = req?.query?.query as string;
4343
if (!searchStr) {
4444
return {
45-
unicorns: {},
45+
people: {},
4646
posts: [],
4747
totalPosts: 0,
4848
collections: [],
@@ -51,7 +51,7 @@ function runQuery(req: VercelRequest): ServerReturnType {
5151
}
5252
if (searchStr === "*") {
5353
return {
54-
unicorns,
54+
people,
5555
posts,
5656
totalPosts: posts.length,
5757
collections,
@@ -64,16 +64,16 @@ function runQuery(req: VercelRequest): ServerReturnType {
6464
.search(searchStr)
6565
.map((item) => item.item);
6666

67-
const searchedUnicorns: Record<string, UnicornInfo> = {};
67+
const searchedPeople: Record<string, PersonInfo> = {};
6868
for (const post of searchedPosts) {
69-
for (const id of post.authors) searchedUnicorns[id] = unicorns[id];
69+
for (const id of post.authors) searchedPeople[id] = people[id];
7070
}
7171
for (const collection of searchedCollections) {
72-
for (const id of collection.authors) searchedUnicorns[id] = unicorns[id];
72+
for (const id of collection.authors) searchedPeople[id] = people[id];
7373
}
7474

7575
return {
76-
unicorns: searchedUnicorns,
76+
people: searchedPeople,
7777
posts: searchedPosts,
7878
totalPosts: searchedPosts.length,
7979
collections: searchedCollections,

build-scripts/epubs/generate-epubs.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { CollectionInfo, PostInfo } from "types/index";
88
import {
99
getCollectionsByLang,
1010
getPostsByCollection,
11-
getUnicornById,
11+
getPersonById,
1212
} from "utils/api";
1313
import { createEpubPlugins } from "utils/markdown/createEpubPlugins";
1414
import { getMarkdownVFile } from "utils/markdown/getMarkdownVFile";
@@ -140,7 +140,7 @@ async function generateCollectionEPub(
140140
fileLocation: string,
141141
) {
142142
const authors = collection.authors
143-
.map((id) => getUnicornById(id, collection.locale)?.name)
143+
.map((id) => getPersonById(id, collection.locale)?.name)
144144
.filter((name): name is string => !!name);
145145

146146
const referenceTitle = "References";

build-scripts/search-index.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Fuse from "fuse.js";
22
import * as fs from "fs";
33
import * as path from "path";
44
import * as api from "utils/api";
5-
import { PostInfo, CollectionInfo, UnicornInfo } from "types/index";
5+
import { PostInfo, CollectionInfo, PersonInfo } from "types/index";
66

77
const posts = api.getPostsByLang("en");
88
const collections = api.getCollectionsByLang("en");
@@ -18,7 +18,7 @@ const createPostIndex = () => {
1818
name: "authorName",
1919
getFn: (post) => {
2020
return post.authors
21-
.map((id) => api.getUnicornById(id, post.locale)!.name)
21+
.map((id) => api.getPersonById(id, post.locale)!.name)
2222
.join(", ");
2323
},
2424
weight: 1.8,
@@ -31,7 +31,7 @@ const createPostIndex = () => {
3131
name: "authorHandles",
3232
getFn: (post) => {
3333
return post.authors
34-
.map((id) => api.getUnicornById(id, post.locale))
34+
.map((id) => api.getPersonById(id, post.locale))
3535
.flatMap((author) => Object.values(author!.socials))
3636
.filter((handle) => handle)
3737
.join(", ");
@@ -61,7 +61,7 @@ const createCollectionIndex = () => {
6161
name: "authorName",
6262
getFn: (post) => {
6363
return post.authors
64-
.map((id) => api.getUnicornById(id, post.locale)!.name)
64+
.map((id) => api.getPersonById(id, post.locale)!.name)
6565
.join(", ");
6666
},
6767
weight: 1.8,
@@ -70,7 +70,7 @@ const createCollectionIndex = () => {
7070
name: "authorHandles",
7171
getFn: (post) => {
7272
return post.authors
73-
.map((id) => api.getUnicornById(id, post.locale))
73+
.map((id) => api.getPersonById(id, post.locale))
7474
.flatMap((author) => Object.values(author!.socials))
7575
.filter((handle) => handle)
7676
.join(", ");
@@ -89,19 +89,19 @@ const createCollectionIndex = () => {
8989
const postIndex = createPostIndex();
9090
const collectionIndex = createCollectionIndex();
9191

92-
const unicorns = api.getUnicornsByLang("en").reduce(
93-
(obj, unicorn) => {
94-
obj[unicorn.id] = unicorn;
92+
const people = api.getPeopleByLang("en").reduce(
93+
(obj, person) => {
94+
obj[person.id] = person;
9595
return obj;
9696
},
97-
{} as Record<string, UnicornInfo>,
97+
{} as Record<string, PersonInfo>,
9898
);
9999

100100
const json = JSON.stringify({
101101
postIndex,
102102
posts,
103103
collectionIndex,
104104
collections,
105-
unicorns,
105+
people,
106106
});
107107
fs.writeFileSync(path.resolve(process.cwd(), "./api/searchIndex.json"), json);

build-scripts/social-previews/layouts/twitter-preview.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from "preact";
22
import { ComponentProps, Layout } from "../base";
33
import style from "./twitter-preview-css";
44
import fs from "fs/promises";
5-
import { getUnicornById } from "utils/api";
5+
import { getPersonById } from "utils/api";
66

77
const playfulProgrammingHead = await fs.readFile(
88
"src/assets/playfulprogramming_sticker.svg",
@@ -79,7 +79,7 @@ const TwitterLargeCard = ({
7979
<div class="postInfo">
8080
<span class="authors">
8181
{post.authors
82-
.map((id) => getUnicornById(id, post.locale)!.name)
82+
.map((id) => getPersonById(id, post.locale)!.name)
8383
.join(", ")}
8484
</span>
8585
<span class="date">

build-scripts/social-previews/shared-post-preview-png.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { findAllAfter } from "unist-util-find-all-after";
1010
import { toString } from "hast-util-to-string";
1111
import rehypeStringify from "rehype-stringify";
1212
import { Layout, PAGE_HEIGHT, PAGE_WIDTH } from "./base";
13-
import { getUnicornById } from "utils/api";
13+
import { getPersonById } from "utils/api";
1414
import { getPostContentMarkdown } from "utils/get-post-content";
1515

1616
const unifiedChain = unified()
@@ -71,7 +71,7 @@ export const renderPostPreviewToString = async (
7171
const authorImageMap = Object.fromEntries(
7272
await Promise.all(
7373
post.authors.map(async (authorId) => {
74-
const author = getUnicornById(authorId, post.locale)!;
74+
const author = getPersonById(authorId, post.locale)!;
7575

7676
if (authorImageCache.has(author.id))
7777
return [author.id, authorImageCache.get(author.id)];

content/crutchcorn/posts/draw-under-navbar-using-react-native/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
---
1010

1111

12-
While working on [my React Native mobile app](https://gitshark.dev), [the super-talented designer for the project](/unicorns/edpratti) raised an interesting question to me:
12+
While working on [my React Native mobile app](https://gitshark.dev), [the super-talented designer for the project](/people/edpratti) raised an interesting question to me:
1313

1414
> "Are we able to draw under the navigation bar and status bar? [Google officially recommends new apps to do so](https://youtu.be/Nf-fP2u9vjI).
1515

content/data/i18n/en.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"title.n_words": "%s words",
2121
"desc.chapter_listing": "Chapter listing",
2222
"desc.translated_into": "Translated by our community into:",
23-
"desc.unicorn_roles": "Roles assigned to this user",
23+
"desc.person_roles": "Roles assigned to this user",
2424
"desc.original_link": "Originally posted at",
2525
"action.go_back": "Go back",
2626
"action.view_profile": "View profile",

content/data/i18n/pt-br.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"title.n_words": "%s palavras",
2020
"desc.chapter_listing": "Capítulos",
2121
"desc.translated_into": "Traduzido pela nossa comunidade para:",
22-
"desc.unicorn_roles": "Funções atribuídas a este usuário",
22+
"desc.person_roles": "Funções atribuídas a este usuário",
2323
"desc.original_link": "Originalmente publicado em",
2424
"action.go_back": "Voltar",
2525
"action.view_profile": "Ver perfil",

content/splatkillwill/posts/dom-pollution-why-i-prefer-vue-over-angular/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@ So much more going on. This is because, even though the components look like the
9090

9191
This doesn't mean Angular is all that bad. Actually, the reason Angular components are written this way is to closely resemble a proposed standard; Web Components.
9292

93-
Speaking of that checkout [Corbin](/unicorns/crutchcorn)'s [series on Web Components](/collections/web-components-101) and also [Angular elements](https://angular.io/guide/elements).
93+
Speaking of that checkout [Corbin](/people/crutchcorn)'s [series on Web Components](/collections/web-components-101) and also [Angular elements](https://angular.io/guide/elements).

public/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
content
22
content/**
33
.ignored_*
4-
unicorn-profile-pic-map.ts
4+
people-profile-pic-map.ts
55
searchIndex.js
66
generated/
77
*.epub

src/components/collection-card/collection-card.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { Button } from "components/index";
33
import { CollectionInfo } from "types/CollectionInfo";
44
import forward from "src/icons/arrow_right.svg?raw";
55
import { Picture as UUPicture } from "components/image/picture";
6-
import { UnicornInfo } from "types/UnicornInfo";
6+
import { PersonInfo } from "types/PersonInfo";
77

88
interface CollectionCardProps {
99
collection: CollectionInfo;
10-
authors: UnicornInfo[];
10+
authors: PersonInfo[];
1111
headingTag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
1212
}
1313

src/components/post-card/post-card-grid.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import style from "./post-card-grid.module.scss";
22
import { PostCard, PostCardExpanded } from "./post-card";
3-
import { PostInfo, UnicornInfo } from "types/index";
3+
import { PostInfo, PersonInfo } from "types/index";
44
import { HTMLAttributes } from "preact/compat";
55
import { isDefined } from "utils/is-defined";
66

77
export interface PostGridProps extends HTMLAttributes<HTMLUListElement> {
88
postsToDisplay: PostInfo[];
9-
postAuthors: Map<string, UnicornInfo>;
9+
postAuthors: Map<string, PersonInfo>;
1010
postHeadingTag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
1111
expanded?: boolean;
1212
}

src/components/post-card/post-card.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import style from "./post-card.module.scss";
2-
import { PostInfo, UnicornInfo } from "types/index";
2+
import { PostInfo, PersonInfo } from "types/index";
33
import { Chip } from "components/index";
44
import date from "src/icons/date.svg?raw";
55
import authorsSvg from "src/icons/authors.svg?raw";
@@ -9,7 +9,7 @@ import { buildSearchQuery } from "src/views/search/search";
99
interface PostCardProps {
1010
headingTag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
1111
post: PostInfo;
12-
authors: Pick<UnicornInfo, "id" | "name">[];
12+
authors: Pick<PersonInfo, "id" | "name">[];
1313
class?: string;
1414
}
1515

src/components/related-posts/related-posts-card.astro

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
import style from "./related-posts-card.module.scss";
33
import { getHrefContainerProps } from "utils/href-container-script";
4-
import { UnicornInfo } from "types/UnicornInfo";
4+
import { PersonInfo } from "../../types/PersonInfo";
55
66
interface RelatedPostsCardProps {
77
title: string;
88
slug: string;
9-
authors: UnicornInfo[];
9+
authors: PersonInfo[];
1010
}
1111
1212
const { title, slug, authors } = Astro.props as RelatedPostsCardProps;

src/components/related-posts/related-posts.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const suggestedArticles = getSuggestedArticles(post);
1616
1717
function getPostAuthors(post: PostInfo) {
1818
return post.authors
19-
.map((unicornId) => api.getUnicornById(unicornId, post.locale))
19+
.map((personId) => api.getPersonById(personId, post.locale))
2020
.filter(isDefined);
2121
}
2222
---

0 commit comments

Comments
 (0)