Skip to content

Commit ae64f5e

Browse files
committed
feat: move to lerna
1 parent 0660b99 commit ae64f5e

File tree

116 files changed

+25498
-9946
lines changed

Some content is hidden

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

116 files changed

+25498
-9946
lines changed

.markdownlint.jsonc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"default": true,
3+
"MD007": { "indent": 4 },
4+
"MD013": false,
5+
"MD033": { "allowed_elements": ["code", "kbd", "pre", "sub", "div", "img"] },
6+
"MD041": false,
7+
"no-hard-tabs": false
8+
}

README.md

Whitespace-only changes.

commitlint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ module.exports = {
2121
],
2222
],
2323
},
24-
};
24+
}

jest.setup.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

lerna.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"packages": ["packages/*"],
3+
"useNx": false,
4+
"version": "0.0.1",
5+
"npmClient": "yarn"
6+
}

next-env.d.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

package.json

Lines changed: 8 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,27 @@
11
{
2-
"name": "website",
3-
"version": "0.0.1",
2+
"name": "prettyavatars",
43
"private": true,
5-
"scripts": {
6-
"dev": "concurrently \"next dev\" \"firebase emulators:start --only firestore,auth\"",
7-
"build": "next build",
8-
"start": "next start",
9-
"lint": "next lint",
10-
"lint:fix": "eslint src --fix && yarn format",
11-
"lint:strict": "eslint --max-warnings=0 src",
12-
"typecheck": "tsc --noEmit --incremental false",
13-
"test:watch": "jest --watch",
14-
"test": "jest",
15-
"format": "prettier -w .",
16-
"format:check": "prettier -c .",
17-
"postbuild": "next-sitemap --config next-sitemap.config.js",
18-
"prepare": "husky install"
19-
},
20-
"dependencies": {
21-
"@faker-js/faker": "^7.6.0",
22-
"@fortawesome/fontawesome-svg-core": "^6.2.1",
23-
"@fortawesome/free-solid-svg-icons": "^6.2.1",
24-
"@fortawesome/react-fontawesome": "^0.2.0",
25-
"@headlessui/react": "^1.7.7",
26-
"@kodingdotninja/use-tailwind-breakpoint": "^0.0.5",
27-
"@next-auth/firebase-adapter": "^1.0.3",
28-
"@next-auth/upstash-redis-adapter": "^3.0.3",
29-
"@tanstack/react-query": "^4.22.0",
30-
"@trpc/client": "^10.8.1",
31-
"@trpc/next": "^10.8.1",
32-
"@trpc/react-query": "^10.8.1",
33-
"@trpc/server": "^10.8.1",
34-
"@types/request-ip": "^0.0.37",
35-
"@upstash/ratelimit": "^0.1.5",
36-
"@upstash/redis": "^1.19.1",
37-
"clsx": "^1.2.1",
38-
"color": "^4.2.3",
39-
"firebase": "^9.15.0",
40-
"firebase-admin": "^11.4.1",
41-
"next": "^13.1.1",
42-
"next-auth": "^4.19.0",
43-
"next-dark-mode": "4.0.0-beta.1",
44-
"nice-color-palettes": "^3.0.0",
45-
"react": "^18.2.0",
46-
"react-code-blocks": "^0.0.9-0",
47-
"react-color": "^2.19.3",
48-
"react-dom": "^18.2.0",
49-
"react-html-parser": "^2.0.2",
50-
"react-icons": "^4.7.1",
51-
"request-ip": "^3.3.0",
52-
"tailwind-merge": "^1.8.1",
53-
"text-to-svg": "^3.1.5",
54-
"use-dark-mode": "^2.3.1",
55-
"use-persisted-state": "^0.3.3",
56-
"usehooks-ts": "^2.9.1",
57-
"zod": "^3.20.2"
58-
},
594
"devDependencies": {
605
"@commitlint/cli": "^16.3.0",
616
"@commitlint/config-conventional": "^16.2.4",
62-
"@svgr/webpack": "^6.5.1",
63-
"@tailwindcss/forms": "^0.5.3",
64-
"@testing-library/jest-dom": "^5.16.5",
65-
"@testing-library/react": "^13.4.0",
66-
"@types/color": "^3.0.3",
67-
"@types/react": "^18.0.26",
68-
"@types/react-color": "^3.0.6",
69-
"@types/react-html-parser": "^2.0.2",
70-
"@types/text-to-svg": "^3.1.1",
71-
"@types/use-persisted-state": "^0.3.1",
727
"@typescript-eslint/eslint-plugin": "^5.48.0",
738
"@typescript-eslint/parser": "^5.48.0",
74-
"autoprefixer": "^10.4.13",
75-
"concurrently": "^7.6.0",
769
"eslint": "^8.31.0",
7710
"eslint-config-next": "^13.1.1",
7811
"eslint-config-prettier": "^8.6.0",
7912
"eslint-plugin-simple-import-sort": "^7.0.0",
8013
"eslint-plugin-unused-imports": "^2.0.0",
81-
"firebase-tools": "^11.21.0",
8214
"husky": "^7.0.4",
83-
"jest": "^27.5.1",
84-
"lint-staged": "^12.5.0",
85-
"next-router-mock": "^0.7.5",
86-
"next-sitemap": "^2.5.28",
87-
"postcss": "^8.4.21",
15+
"lerna": "^5.1.6",
8816
"prettier": "^2.8.1",
89-
"prettier-plugin-tailwindcss": "^0.1.13",
90-
"tailwindcss": "^3.2.4",
9117
"typescript": "^4.9.4"
9218
},
19+
"scripts": {
20+
"dev": "lerna run dev",
21+
"build": "lerna run build",
22+
"test": "lerna run test",
23+
"prepare": "husky install"
24+
},
9325
"lint-staged": {
9426
"**/*.{js,jsx,ts,tsx}": [
9527
"eslint --fix",

packages/prettyavatars/README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<div align="center">
2+
3+
# Pretty Avatars
4+
5+
A collection of pretty default avatars for your next project
6+
7+
![boring avatars preview](packages/prettyavatars/public/preview.png)
8+
9+
</div>
10+
11+
## Install
12+
13+
```sh
14+
npm install prettyavatars
15+
```
16+
17+
```sh
18+
yarn add prettyavatars
19+
```
20+
21+
## Usage
22+
23+
<!-- prettier-ignore -->
24+
```tsx
25+
import Avatar from 'prettyavatars'
26+
27+
<Avatar
28+
variant='marble'
29+
name='Maria Mitchell'
30+
size={40}
31+
colors={['#92A1C6', '#146A7C', '#F0AB3D', '#C271B4', '#C20D90']}
32+
/>
33+
```
34+
35+
Or with tree-shaking:
36+
37+
<!-- prettier-ignore -->
38+
```tsx
39+
import LetterAvatar from 'prettyavatars/letter'
40+
41+
<LetterAvatar
42+
name='Maria Mitchell'
43+
size={40}
44+
colors={['#92A1C6', '#146A7C', '#F0AB3D', '#C271B4', '#C20D90']}
45+
/>
46+
```
47+
48+
### Props
49+
50+
| Prop | Type |
51+
| ----------- | ---------------------------------------------------------------------- |
52+
| **variant** | oneOf: `letter`, `marble`, `beam`, `pixel`,`sunset`, `ring`, `bauhaus` |
53+
| **name** | string |
54+
| size | number or string, `40px` (default) |
55+
| square | boolean: `false` (default) |
56+
| title | boolean: `false` (default) |
57+
| colors | array of colors |
58+
59+
<sub>\* bold means required</sub>
60+
61+
## CDN Service
62+
63+
If you wish to use pretty avatars from a CDN, you can use the [Pretty Avatars API](https://prettyavatars.com/docs). For more information and how to customize your avatars, [check out the docs](https://prettyavatars.com/docs)
64+
65+
To choose a random avatar from a specific user and a color palette, the format follows:
66+
67+
<div align="center">
68+
<img src="https://prettyavatars.com/api/letter/120/Johnny%20Appleseed/264653,2a9d8f,e9c46a,f4a261,e76f51" alt="Johnny Appleseed" width="120" height="120" />
69+
</div>
70+
71+
```url
72+
https://prettyavatars.com/api/letter/120/Johnny%20Appleseed/264653,2a9d8f,e9c46a,f4a261,e76f51
73+
```

src/components/pretty-avatars/_package.json renamed to packages/prettyavatars/package.json

Lines changed: 11 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"name": "pretty-avatars",
3-
"description": "Pretty avatars is a tiny JavaScript React library that generates custom, SVG-based, round avatars from any username and color palette.",
2+
"name": "prettyavatars",
3+
"description": "A collection of pretty default avatars to use in your next project",
44
"homepage": "https://prettyavatars.com/",
5-
"version": "1.0.0",
5+
"version": "0.0.1",
66
"main": "build/index.js",
77
"types": "build/index.d.ts",
88
"repository": {
99
"type": "git",
10-
"url": "https://github.com/ajhenry/pretty-avatars"
10+
"url": "https://github.com/ajhenry/prettyavatars"
1111
},
1212
"bugs": {
13-
"url": "https://github.com/ajhenry/pretty-avatars/issues"
13+
"url": "https://github.com/ajhenry/prettyavatars/issues"
1414
},
1515
"keywords": [
1616
"avatar",
@@ -22,16 +22,17 @@
2222
],
2323
"scripts": {
2424
"dev": "tsc --watch",
25-
"start": "node scripts/start.js",
26-
"build": "tsc -b .",
27-
"demo": "node scripts/demo.js",
28-
"test": "node scripts/test.js"
25+
"build": "tsc -b ."
2926
},
30-
"files": ["build/*", "index.d.ts"],
27+
"files": [
28+
"build/*",
29+
"index.d.ts"
30+
],
3131
"license": "MIT",
3232
"devDependencies": {
3333
"@babel/core": "7.6.0",
3434
"@svgr/webpack": "4.3.2",
35+
"@types/color": "^3.0.3",
3536
"@types/react-html-parser": "^2.0.2",
3637
"@types/text-to-svg": "^3.1.1",
3738
"@typescript-eslint/eslint-plugin": "^2.2.0",
@@ -93,64 +94,7 @@
9394
"webpack-manifest-plugin": "2.1.1",
9495
"workbox-webpack-plugin": "4.3.1"
9596
},
96-
"eslintConfig": {
97-
"extends": "react-app"
98-
},
99-
"browserslist": {
100-
"production": [">0.2%", "not dead", "not op_mini all"],
101-
"development": [
102-
"last 1 chrome version",
103-
"last 1 firefox version",
104-
"last 1 safari version"
105-
]
106-
},
107-
"jest": {
108-
"roots": ["<rootDir>/src"],
109-
"collectCoverageFrom": ["src/**/*.{js,jsx,ts,tsx}", "!src/**/*.d.ts"],
110-
"setupFiles": ["react-app-polyfill/jsdom"],
111-
"setupFilesAfterEnv": [],
112-
"testMatch": [
113-
"<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
114-
"<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"
115-
],
116-
"testEnvironment": "jest-environment-jsdom-fourteen",
117-
"transform": {
118-
"^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest",
119-
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
120-
"^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
121-
},
122-
"transformIgnorePatterns": [
123-
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$",
124-
"^.+\\.module\\.(css|sass|scss)$"
125-
],
126-
"modulePaths": [],
127-
"moduleNameMapper": {
128-
"^react-native$": "react-native-web",
129-
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
130-
},
131-
"moduleFileExtensions": [
132-
"web.js",
133-
"js",
134-
"web.ts",
135-
"ts",
136-
"web.tsx",
137-
"tsx",
138-
"json",
139-
"web.jsx",
140-
"jsx",
141-
"node"
142-
],
143-
"watchPlugins": [
144-
"jest-watch-typeahead/filename",
145-
"jest-watch-typeahead/testname"
146-
]
147-
},
148-
"babel": {
149-
"presets": ["react-app"]
150-
},
15197
"dependencies": {
152-
"color-contrast-checker": "^2.1.0",
153-
"opentype.js": "^1.3.4",
15498
"react-html-parser": "^2.0.2",
15599
"text-to-svg": "^3.1.5"
156100
}

src/components/pretty-avatars/src/components/avatar.tsx renamed to packages/prettyavatars/src/components/avatar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const deprecatedVariants: Record<string, string> = {
2121
abstract: 'bauhaus',
2222
}
2323

24-
export type Variant = typeof variants[number]
24+
export type Variant = (typeof variants)[number]
2525

2626
export interface AvatarProps {
2727
colors: string[]

0 commit comments

Comments
 (0)