-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
⬆️ Upgrade DaisyUI v4 #405
Merged
Merged
Changes from 15 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f44c087
🔧 Moved build-only deps to dev-deps list
KemingHe cb7cc89
📝 Updated changeset with info on latest commit.
KemingHe ab70456
✅ Added Playwright test to main user story, updated scripts
KemingHe 6b28377
📝 Updated changeset following last playwright commit
KemingHe c961e3b
⬆️ Bumped DaisyUI to v4, maintained app behavior
KemingHe f255cb4
💄 Proposed new landing page ui (DaisyUI v4)
KemingHe 7eac1fb
💄 Fully bumped (rewrite) to DaisyUI v4
KemingHe 2075d55
✅ Added full UI Playwright test suite
KemingHe 8038d66
📝 Updated changeset per latest commit
KemingHe 0059b68
💄 Updated landing input box color closer to original
KemingHe 652a119
📝 Updated changeset per latest commit
KemingHe ec313db
🎨 Used daisyui color config instead of hard-code
KemingHe 9b182b5
📝 Updated changeset to reflect latest commit
KemingHe b9e24c1
✅ Enforced 100% Playwright consistency
KemingHe d749aba
📝 Updated changeset per latest commit (patch)
KemingHe 53367ac
Merge remote-tracking branch 'upstream/master' into fix-bumptodaisyui…
wei 718e1fc
Merge remote-tracking branch 'upstream/master' into fix-bumptodaisyui…
wei ccb88bf
📄 Update changeset
wei 65bb644
💄 Improve heading gradient color
wei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"socialify": patch | ||
--- | ||
|
||
moved strictly build-time deps to dev-deps list in package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"socialify": patch | ||
--- | ||
|
||
used daisyui color config instead of hard-code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"socialify": patch | ||
--- | ||
|
||
Updated landing input box bg color to closer match the original DaisyUI v2 app. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"socialify": patch | ||
--- | ||
|
||
Enforced 100% Playwright snapshot consistency; updated snapshots. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"socialify": minor | ||
--- | ||
|
||
Bumped DaisyUI to v4 with full Playwright UI + user story test suite. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"socialify": minor | ||
--- | ||
|
||
Added playwright e2e testing to workflow. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { type Page, expect, test } from '@playwright/test' | ||
|
||
// Give navigation expects a generous timeout of 60 seconds. | ||
const customPageLoadTimeout = { timeout: 60000 } | ||
|
||
// Give component transition/animation expects a generous timeout of 1 second(s). | ||
const customTransitionTimeout = { timeout: 1000 } | ||
|
||
// Testing constants. | ||
const repoPreviewURL: string = | ||
'/wei/socialify?language=1&owner=1&name=1&stargazers=1&theme=Light' | ||
|
||
test.describe('Socialify UI:', () => { | ||
test('is consistent for landing page', async ({ | ||
page, | ||
}: { page: Page }): Promise<void> => { | ||
await page.goto('/', customPageLoadTimeout) | ||
|
||
// Wait for the page to load/hydrate completely. | ||
await page.waitForLoadState('networkidle', customPageLoadTimeout) | ||
|
||
const image = await page.screenshot() | ||
expect(image).toMatchSnapshot() | ||
}) | ||
|
||
test('is consistent for error (404) page', async ({ | ||
page, | ||
}: { page: Page }): Promise<void> => { | ||
await page.goto('/404', customPageLoadTimeout) | ||
|
||
// Wait for the page to load/hydrate completely. | ||
await page.waitForLoadState('networkidle', customPageLoadTimeout) | ||
|
||
const image = await page.screenshot() | ||
expect(image).toMatchSnapshot() | ||
}) | ||
|
||
test('is consistent for preview config page', async ({ | ||
page, | ||
}: { page: Page }): Promise<void> => { | ||
await page.goto(repoPreviewURL, customPageLoadTimeout) | ||
|
||
// Wait for the page to load/hydrate completely. | ||
await page.waitForLoadState('networkidle', customPageLoadTimeout) | ||
|
||
// To maintain consistency, de-select the 'Stars' checkbox, | ||
// and selects the 'Description' checkbox. | ||
await page.click('input[name="stargazers"]') | ||
await page.click('input[name="description"]') | ||
|
||
// Wait for the component transition/animation to finish completely. | ||
await page.waitForTimeout(customTransitionTimeout.timeout) | ||
|
||
const image = await page.screenshot() | ||
expect(image).toMatchSnapshot() | ||
|
||
// Also check the toaster UI consistency. | ||
await page.click('button:has-text("URL")') | ||
await page.waitForSelector('[role="alert"]', customPageLoadTimeout) | ||
|
||
// Wait for the component transition/animation to finish completely. | ||
await page.waitForTimeout(customTransitionTimeout.timeout) | ||
|
||
const toastImage = await page.screenshot() | ||
expect(toastImage).toMatchSnapshot() | ||
}) | ||
}) |
Binary file added
BIN
+293 KB
...apshots/Socialify-UI-is-consistent-for-error-404-page-1-Google-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+293 KB
...pshots/Socialify-UI-is-consistent-for-error-404-page-1-Microsoft-Edge-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+543 KB
...apshots/Socialify-UI-is-consistent-for-error-404-page-1-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+293 KB
...ts-snapshots/Socialify-UI-is-consistent-for-error-404-page-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+141 KB
....ts-snapshots/Socialify-UI-is-consistent-for-error-404-page-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+280 KB
...snapshots/Socialify-UI-is-consistent-for-landing-page-1-Google-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+280 KB
...napshots/Socialify-UI-is-consistent-for-landing-page-1-Microsoft-Edge-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+493 KB
...snapshots/Socialify-UI-is-consistent-for-landing-page-1-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+280 KB
...c.ts-snapshots/Socialify-UI-is-consistent-for-landing-page-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+134 KB
...ec.ts-snapshots/Socialify-UI-is-consistent-for-landing-page-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+200 KB
...ts/Socialify-UI-is-consistent-for-preview-config-page-1-Google-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+201 KB
...s/Socialify-UI-is-consistent-for-preview-config-page-1-Microsoft-Edge-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+199 KB
...ts/Socialify-UI-is-consistent-for-preview-config-page-1-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+200 KB
...apshots/Socialify-UI-is-consistent-for-preview-config-page-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+139 KB
...napshots/Socialify-UI-is-consistent-for-preview-config-page-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+199 KB
...ts/Socialify-UI-is-consistent-for-preview-config-page-2-Google-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+200 KB
...s/Socialify-UI-is-consistent-for-preview-config-page-2-Microsoft-Edge-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+208 KB
...ts/Socialify-UI-is-consistent-for-preview-config-page-2-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+199 KB
...apshots/Socialify-UI-is-consistent-for-preview-config-page-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+145 KB
...napshots/Socialify-UI-is-consistent-for-preview-config-page-2-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { type Page, expect, test } from '@playwright/test' | ||
|
||
// Give each expect a generous timeout of 60 seconds. | ||
const customTimeout = { timeout: 60000 } | ||
|
||
// Testing constants. | ||
const repo: string = 'wei/socialify' | ||
const expectedConfigURL: string = | ||
'/wei/socialify?language=1&owner=1&name=1&stargazers=1&theme=Light' | ||
const expectedImageURLRegExp: RegExp = | ||
/\/wei\/socialify\/image\?description=1&language=1&name=1&owner=1&theme=Light$/ | ||
|
||
async function getClipboardText(page: Page): Promise<string> { | ||
return await page.evaluate(async () => { | ||
return await navigator.clipboard.readText() | ||
}) | ||
} | ||
|
||
test.beforeEach(async ({ page }: { page: Page }): Promise<void> => { | ||
await page.goto('/', customTimeout) | ||
|
||
// Wait for the page to load/hydrate completely. | ||
await page.waitForLoadState('networkidle', customTimeout) | ||
}) | ||
|
||
test.describe('A simple user story:', () => { | ||
test(`user can enter a GitHub repo ("username/repo"), click submit button, click "URL", and get the social preview image`, async ({ | ||
page, | ||
}: { page: Page }): Promise<void> => { | ||
// Input and submit the repo following accessibility best practices. | ||
await page.fill('input[name="repo-input"]', repo) | ||
await page.click('button[type="submit"]') | ||
|
||
// Wait for navigation to the preview config page. | ||
await page.waitForSelector('button:has-text("URL")', customTimeout) | ||
|
||
// Wait for the page to load/hydrate completely. | ||
await page.waitForLoadState('networkidle', customTimeout) | ||
await expect(page).toHaveURL(expectedConfigURL) | ||
|
||
// To maintain consistency, de-select the 'Stars' checkbox, | ||
// and selects the 'Description' checkbox. | ||
await page.click('input[name="stargazers"]') | ||
await page.click('input[name="description"]') | ||
|
||
// Obtain the consistent preview image URL. | ||
await page.click('button:has-text("URL")') | ||
|
||
// Compare the clipboard content to the expected image URL. | ||
// (Only check the end of the URL due to dynamic localhost port allocation.) | ||
const url: string = await getClipboardText(page) | ||
expect(url).toMatch(expectedImageURLRegExp) | ||
|
||
// Visit the image URL and snapshot the image. | ||
await page.goto(url, customTimeout) | ||
|
||
// Wait for the page to load/hydrate completely. | ||
await page.waitForLoadState('networkidle', customTimeout) | ||
|
||
const image = await page.screenshot() | ||
expect(image).toMatchSnapshot() | ||
}) | ||
}) |
Binary file added
BIN
+42.1 KB
...ub-r-50b6f-click-URL-and-get-the-social-preview-image-1-Google-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42 KB
...b-r-50b6f-click-URL-and-get-the-social-preview-image-1-Microsoft-Edge-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+52 KB
...ub-r-50b6f-click-URL-and-get-the-social-preview-image-1-Mobile-Chrome-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42 KB
...-GitHub-r-50b6f-click-URL-and-get-the-social-preview-image-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+69.3 KB
...a-GitHub-r-50b6f-click-URL-and-get-the-social-preview-image-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,25 @@ | |
"version": "2.12.1", | ||
"description": "Socialify your project. Share with the world!", | ||
"author": "@CryogenicPlanet, @wei", | ||
"contributors": [ | ||
{ | ||
"name": "Keming He", | ||
"email": "[email protected]", | ||
"url": "https://linkedin.com/in/keminghe" | ||
} | ||
], | ||
"license": "MIT", | ||
"repository": "https://github.com/wei/socialify.git", | ||
"scripts": { | ||
"dev": "next dev", | ||
"debug": "NODE_OPTIONS='--inspect' next", | ||
"build": "next build", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"test:update-snapshot": "jest -u", | ||
"test:unit": "jest", | ||
"test:unit:watch": "jest --watch", | ||
"test:unit:update-snapshot": "jest -u", | ||
"test:e2e": "playwright test", | ||
"test:e2e:update-snapshot": "playwright test --update-snapshots", | ||
"test": "yarn test:unit && yarn test:e2e", | ||
"start": "next start", | ||
"lint": "biome ci --max-diagnostics=999 .", | ||
"lint:fix": "biome check --write --verbose --max-diagnostics=999 .", | ||
|
@@ -27,15 +37,12 @@ | |
}, | ||
"dependencies": { | ||
"@resvg/resvg-wasm": "^2.6.2", | ||
"autoprefixer": "^10.4.20", | ||
"badgen": "^3.2.3", | ||
"clsx": "^2.1.1", | ||
"copee": "^1.0.6", | ||
"daisyui": "^2.52.0", | ||
"hero-patterns": "^2.1.0", | ||
"is-ci": "^3.0.1", | ||
"next": "^14.2.8", | ||
"postcss": "^8.4.49", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"react-error-boundary": "^4.1.2", | ||
|
@@ -44,25 +51,29 @@ | |
"satori": "^0.10.14", | ||
"simple-icons": "^13.17.0", | ||
"styled-jsx": "^5.1.6", | ||
"tailwindcss": "^3.4.15", | ||
"typescript": "~5.7.2", | ||
"use-debounce": "^10.0.4", | ||
"yoga-wasm-web": "^0.3.3" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.9.4", | ||
"@changesets/cli": "^2.27.10", | ||
"@playwright/test": "^1.49.0", | ||
"@testing-library/dom": "^10.4.0", | ||
"@testing-library/jest-dom": "^6.6.3", | ||
"@testing-library/react": "^16.0.1", | ||
"@types/jest": "^29.5.14", | ||
"@types/react": "18.3.12", | ||
"autoprefixer": "^10.4.20", | ||
"daisyui": "^4.12.14", | ||
"graphql": "^16.9.0", | ||
"graphql-compiler": "^1.7.0", | ||
"husky": "^9.1.7", | ||
"identity-obj-proxy": "^3.0.0", | ||
"jest": "^29.7.0", | ||
"jest-environment-jsdom": "^29.7.0" | ||
"jest-environment-jsdom": "^29.7.0", | ||
"postcss": "^8.4.49", | ||
"tailwindcss": "^3.4.15", | ||
"typescript": "^5.7.2" | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like your email address hehe! Great idea~ What do you think about using all contributors spec or similar in
README.md
so it's easier to maintain and more visible, instead of ballooning thepackage.json
?