Skip to content

Commit

Permalink
Merge pull request #5 from Automattic/add/hovercards-package
Browse files Browse the repository at this point in the history
Add hovercards package
  • Loading branch information
wellyshen authored Jun 6, 2024
2 parents 8b04b81 + 4ed7ba0 commit 6e53436
Show file tree
Hide file tree
Showing 52 changed files with 19,908 additions and 5 deletions.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: "\U0001F41B Bug Report"
about: Create a bug report
---

# Bug Report

## Description / Observed Behavior

What kind of issues did you encounter?

## Expected Behavior

How did you expect the component or service to behave here?

## Repro Steps / Code Example

Share the steps to reproduce the issue, screenshots, or a [CodeSandbox](https://codesandbox.io) link is also appreciated!

## Your Environment

- Component/Service Name and Version: [e.g. library-name v1.0.0]
- Platform: [e.g. Android, iOS, Web]
- Operating System / Browser: [e.g. Windows, MacOS, iOS, Android / Chrome, Safari]

## Additional Information

Any other information about the problem here.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: ❓ Ask Question
url: https://github.com/Automattic/gravatar/discussions
about: Ask questions and discuss with other community members
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: "\U0001F4A1 Feature Request"
about: Suggest an idea!
---

# Feature Request

## Description / Use Case

Describe the feature you'd like to see added. Include the potential use case(s) to help us understand its impact.

## Proposed Solution

Have an idea on how to implement this feature? Please share your thoughts or possible approaches.

## Alternatives

Did you consider any alternative solutions or features? Kindly share that information as it helps in thorough understanding and evaluation.

## Additional Information

Feel free to add any other context, like screenshots, examples, or additional comments that could help us understand your feature request better.
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!--
Link a related issue to this PR. If there is no related issue, please create one first.
-->

Related to #

## Proposed Changes

*

## Testing Instructions

<!--
Add as many details as possible to help others reproduce the issue and test the fix.
"Before / After" screenshots can also be very helpful when the change is visual.
-->

*
42 changes: 42 additions & 0 deletions .github/workflows/hovercards-build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Hovercards Type check / Lint / Build

on:
pull_request:
paths:
- 'web/packages/hovercards/**'

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: web/packages/hovercards
strategy:
matrix:
node-version: [20]

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install dependencies
working-directory: web/packages/hovercards
run: yarn

- name: Type check
working-directory: web/packages/hovercards
run: yarn type-check

- name: Lint
working-directory: web/packages/hovercards
run: yarn lint

- name: Build
working-directory: web/packages/hovercards
run: yarn build
16 changes: 16 additions & 0 deletions .github/workflows/hovercards-compressed-size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Hovercards Package Size

on:
pull_request:
paths:
- 'web/packages/hovercards/**'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: preactjs/compressed-size-action@v2
with:
cwd: web/packages/hovercards
55 changes: 55 additions & 0 deletions .github/workflows/hovercards-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Hovercards Release & Publish to NPM

on:
workflow_dispatch:
inputs:
increment:
type: choice
description: 'Version type'
required: true
options:
- patch
- minor
- major

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GRAVATAR_GITHUB_TOKEN }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'

- name: Install dependencies
working-directory: web/packages/hovercards
run: yarn

- name: Initialize Git user
working-directory: web/packages/hovercards
run: |
git config user.name "gravatar-automattic"
git config user.email "[email protected]"
- name: Initialize the NPM config
working-directory: web/packages/hovercards
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Release
working-directory: web/packages/hovercards
run: yarn release ${{ github.event.inputs.increment }} --ci
env:
GITHUB_TOKEN: ${{ secrets.GRAVATAR_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
node_modules
*.local
.npmrc

# Logs
logs
*.log
npm-debug.log*

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
cd web/packages/hovercards
npx lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Easily integrate Gravatar into your Android applications. With our SDK, you can
### [Gravatar iOS SDK](https://github.com/Automattic/Gravatar-SDK-iOS)
Bring Gravatar to your iOS apps with minimal effort. Our iOS SDK provides tools to fetch and display Gravatar avatars and profiles, helping you create personalized and consistent user experiences.

### [Gravatar Hovercards](https://github.com/gravatar/hovercards)
### [Gravatar Hovercards](blob/trunk/web/packages/hovercards)
Enhance your web applications with Gravatar Hovercards. Display user avatars and profiles on hover, providing quick access to user information without cluttering your UI.

## Join Our Community
Expand Down
29 changes: 29 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
{
"name": "gravatar-monorepo",
"author": "Automattic Inc.",
"version": "1.0.0",
"description": "Welcome to the parent repo for all things Gravatar!",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"prepare": "husky"
},
"keywords": [ "gravatar", "profile", "hovercards", "ios sdk", "android sdk" ],
"license": "GPL-2.0-or-later"
"keywords": [
"gravatar",
"profile",
"hovercards",
"ios sdk",
"android sdk"
],
"license": "GPL-2.0-or-later",
"devDependencies": {
"husky": "^9.0.11"
}
}
6 changes: 6 additions & 0 deletions web/packages/hovercards/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist
release

# Yarn
.pnp.*
.yarn/*
10 changes: 10 additions & 0 deletions web/packages/hovercards/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
extends: [ 'plugin:@wordpress/eslint-plugin/recommended' ],
rules: {
'@wordpress/i18n-no-variables': 'off',
},
};
33 changes: 33 additions & 0 deletions web/packages/hovercards/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
node_modules
dist
release
package-lock.json
*.local
.npmrc

# Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Empty file removed web/packages/hovercards/.gitkeep
Empty file.
21 changes: 21 additions & 0 deletions web/packages/hovercards/.markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"default": true,
"MD003": {
"style": "atx"
},
"MD007": {
"indent": 4
},
"MD013": {
"line_length": 9999
},
"MD024": {
"allow_different_nesting": true
},
"MD033": {
"allowed_elements": [ "img" ]
},
"MD041": false,
"no-hard-tabs": false,
"whitespace": false
}
33 changes: 33 additions & 0 deletions web/packages/hovercards/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
node_modules
dist
release
package-lock.json
*.local

# Yarn
.pnp.*
.yarn/*
.yarnrc.*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
4 changes: 4 additions & 0 deletions web/packages/hovercards/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
...require( '@wordpress/prettier-config' ),
printWidth: 120,
};
Loading

0 comments on commit 6e53436

Please sign in to comment.