Skip to content
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

Update penny to use the app folder #204

Merged
merged 88 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
29acc7c
basic cleanup
mshick Mar 12, 2024
b469873
basic dep bumps
mshick Mar 12, 2024
18001ce
most deps updated, fixing typecheck
mshick Mar 12, 2024
a8a3c95
msw and ts at latest reasonable
mshick Mar 12, 2024
7b19915
bump codegen
mshick Mar 12, 2024
b5d2f73
sentry configured for app router
mshick Mar 12, 2024
f629184
use NEXT_PUBLIC var
mshick Mar 12, 2024
e8b4d70
config cleanup and sentry update
mshick Mar 13, 2024
41fc8e1
clean up error page
mshick Mar 13, 2024
7013bca
fix up sentry etc
mshick Mar 13, 2024
859f30a
add worker-src to CSP
mshick Mar 13, 2024
b13f82d
Conforming tsconfig more
mshick Mar 13, 2024
10d366c
update all paths, pass typecheck
mshick Mar 13, 2024
f63afda
convert codegen to ts for better typecheck, fix err
mshick Mar 13, 2024
632e258
Merge branch 'sc-12854/feature/update-penny-to-use-next-js-14' into s…
mshick Mar 13, 2024
1c7ad7f
Fix lint rules and fix
mshick Mar 13, 2024
4e132bc
Final lint removed
mshick Mar 13, 2024
3016200
fix preval issues (temporary)
mshick Mar 13, 2024
847644b
fix typechecks and lint
mshick Mar 13, 2024
e2eafab
fix typecheck and scope it better
mshick Mar 13, 2024
c7fe2fd
jest config
mshick Mar 14, 2024
71e0cfb
First round migrations
mshick Mar 15, 2024
82b35b7
account pages migrated
mshick Mar 15, 2024
d6dc53f
Delete replaced pages
mshick Mar 15, 2024
e87ca67
migrating product and collection pages
mshick Mar 15, 2024
22c7ae1
cleanup, remove last pages
mshick Mar 15, 2024
cca6e2d
remove unused deps
mshick Mar 15, 2024
b4a768c
update config and readme
mshick Mar 15, 2024
86ce19c
remove unused layouts and preval
mshick Mar 15, 2024
eaaa47f
fix type errs
mshick Mar 15, 2024
fa00cbf
remove PWA
mshick Mar 15, 2024
838ccc0
replace unbound uses of router
mshick Mar 15, 2024
eb0fe3f
use suspense for QuickAdd
mshick Mar 15, 2024
aa5da62
fix lint
mshick Mar 15, 2024
d11e45b
auth updated and refined
mshick Mar 18, 2024
e7ccc37
move to lib folder as is more the next.js convention
mshick Mar 18, 2024
30e8ca2
update session maxAge
mshick Mar 18, 2024
bba276b
clean up apollo client use
mshick Mar 18, 2024
1e263d4
cleanup lighthouse
mshick Mar 18, 2024
279c01b
switch to vitest
mshick Mar 18, 2024
6b3c4b9
fix jest-dom issue
mshick Mar 18, 2024
562e71e
cleanup
mshick Mar 18, 2024
f10604f
fix next config types
mshick Mar 18, 2024
c095498
fix lighthouse artifact name
mshick Mar 18, 2024
64b680c
remove pwa from profiles
mshick Mar 18, 2024
4b31f5b
test native sitemap, fix some types
mshick Mar 18, 2024
229fccb
native sitemaps
mshick Mar 18, 2024
331d35a
add try/catch to sitemaps
mshick Mar 18, 2024
e7377cf
fix params
mshick Mar 18, 2024
42e41d7
use native robots.txt gen
mshick Mar 18, 2024
97ee432
bumping workflows
mshick Mar 18, 2024
b44cb2d
update dep
mshick Mar 18, 2024
0f5730a
new icons
mshick Mar 18, 2024
af26e0b
add og image
mshick Mar 18, 2024
784e572
try sharded playwright
mshick Mar 18, 2024
4e5fbdd
fix signin urls
mshick Mar 18, 2024
eb9d870
again
mshick Mar 18, 2024
af03230
install
mshick Mar 18, 2024
6fbb171
debug
mshick Mar 18, 2024
63e4090
fix playwright tests
mshick Mar 18, 2024
eb6a1ae
move reports better
mshick Mar 18, 2024
728ea90
fix merging
mshick Mar 18, 2024
ed2de1c
fix paths
mshick Mar 19, 2024
a0d05e9
remove node cache
mshick Mar 19, 2024
afc5447
fixing signin error logic and redirects
mshick Mar 19, 2024
40c367f
clean up multipass errors
mshick Mar 19, 2024
4fe725c
disable reviews e2e
mshick Mar 19, 2024
023fb96
update e2e
mshick Mar 19, 2024
de564ec
add note about checkout to readme
mshick Mar 19, 2024
2401f88
remove old playwright
mshick Mar 19, 2024
208acc7
Merge branch 'main' into sc-12962/feature/update-penny-to-use-the-app…
mshick Mar 19, 2024
081ae10
fix conflicts
mshick Mar 19, 2024
c0868e8
Merge branch 'main' into sc-12962/feature/update-penny-to-use-the-app…
mshick Mar 19, 2024
8840b67
fix accessibility lighthouse
mshick Mar 19, 2024
7119fe9
try tightening tailwind
mshick Mar 19, 2024
e39132e
gray text
mshick Mar 19, 2024
7319c91
remove SENTRY_DSN
mshick Mar 19, 2024
8409cc9
update budgets
mshick Mar 19, 2024
8cb7474
clean up folder structure
mshick Mar 19, 2024
07b3ed6
update readme
mshick Mar 19, 2024
553d631
use custom error
mshick Mar 19, 2024
c60b9df
fix sign in issues, fix quick add render loop
mshick Mar 20, 2024
9411e91
update lockfile
mshick Mar 20, 2024
323e286
fix key error
mshick Mar 20, 2024
4b8f465
fixsignout redirect issues
mshick Mar 20, 2024
bb855b5
remove redirect
mshick Mar 20, 2024
166522b
playwright tweaks
mshick Mar 21, 2024
7de3f50
update pw spec
mshick Mar 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ NEXT_PUBLIC_CONTACT_PROVIDER='gorgias'
NEXT_PUBLIC_RECAPTCHA_SITE_KEY='6LdArl4gAAAAADf30J5nPO2hStNG8_IYrnl43RlT'

# Sentry
NEXT_PUBLIC_SENTRY_DSN='https://b3dadbce4879487b90076bf1350f8534@o4504254488313856.ingest.sentry.io/4504254630461440'
SENTRY_ORG='penny-bz'
asprouse marked this conversation as resolved.
Show resolved Hide resolved
SENTRY_PROJECT='penny'
SENTRY_IGNORE_API_RESOLUTION_ERROR='1'
1 change: 0 additions & 1 deletion .env-example
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ NEXT_PUBLIC_DEFAULT_KLAVIYO_LIST_ID=''
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=''

# Sentry
NEXT_PUBLIC_SENTRY_DSN=''
SENTRY_ORG=''
SENTRY_PROJECT=''
SENTRY_IGNORE_API_RESOLUTION_ERROR='1'
10 changes: 4 additions & 6 deletions .env.local-example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NextAuth
NEXTAUTH_URL='http://localhost:3000'
NEXTAUTH_URL='http://localhost:3000/api/auth'
# Linux: `openssl rand -hex 32` or go to https://generate-secret.now.sh/32
NEXTAUTH_SECRET=''

Expand All @@ -10,17 +10,15 @@ ALLACCESS_PRIVATE_KEY=''
GOOGLE_CLIENT_ID=''
GOOGLE_CLIENT_SECRET=''

# If you want to disable Sentry for local dev redefine this here
# Enable Sentry logging per-environment (set up here and in your hosting provider)
NEXT_PUBLIC_SENTRY_DSN=''
SENTRY_AUTH_TOKEN=''

# Shopify Multipass
SHOPIFY_MULTIPASS_SECRET=''

# Sentry
SENTRY_AUTH_TOKEN=''

# Playwright URL for local runs
PLAYWRIGHT_TEST_BASE_URL='http://127.0.0.1:3000'
PLAYWRIGHT_TEST_BASE_URL='http://localhost:3000'
# Set a product name to use in your own tests
PLAYWRIGHT_PRODUCT_NAME_INSTOCK=''
PLAYWRIGHT_PRODUCT_SIZE_INSTOCK=''
Expand Down
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ countries.json
!.takeshape
!.storybook
!.lighthouse
!.jest
!.vitest
worker
mocks
7 changes: 4 additions & 3 deletions .github/actions/run-lighthouse/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ runs:
steps:
- name: Get audit urls
id: audit-urls
uses: actions/github-script@v6.3.3
uses: actions/github-script@v7
with:
script: |
const targetUrl = '${{ github.event.deployment_status.target_url }}';
Expand All @@ -24,17 +24,18 @@ runs:

- name: Audit URLs using Lighthouse
id: audit
uses: treosh/lighthouse-ci-action@v9
uses: treosh/lighthouse-ci-action@v11
with:
urls: ${{ steps.audit-urls.outputs.urls }}
configPath: ./.lighthouse/profiles/${{ inputs.profile }}.js
uploadArtifacts: true
artifactName: lighthouse-results-${{ inputs.profile }}
temporaryPublicStorage: true
runs: 5

- name: Format Lighthouse score
id: format
uses: actions/github-script@v6.3.3
uses: actions/github-script@v7
with:
script: |
const lighthouseCommentMaker = require('./.lighthouse/lighthouseCommentMaker.js');
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to retrieve git history

- name: setup node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'npm'

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.npm
Expand Down
65 changes: 44 additions & 21 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,39 @@ env:
HUSKY: 0

jobs:
playwright-test:
name: Test
Run:
name: Shard ${{ matrix.shardIndex }}
if: github.event.deployment_status.state == 'success' && github.event.deployment_status.environment == 'Preview'
timeout-minutes: 60
runs-on: ubuntu-latest
env:
asprouse marked this conversation as resolved.
Show resolved Hide resolved
SHARD_INDEX: ${{ matrix.shardIndex }}
SHARD_TOTAL: 3
strategy:
fail-fast: false
matrix:
shardIndex:
- 1
- 2
- 3

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

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Install Playwright browsers
- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: Run Playwright tests
run: npx playwright test
run: npx playwright test --shard=$SHARD_INDEX/$SHARD_TOTAL
env:
PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }}
PLAYWRIGHT_PRODUCT_NAME_INSTOCK: ${{ vars.PLAYWRIGHT_PRODUCT_NAME_INSTOCK }}
Expand All @@ -44,34 +53,48 @@ jobs:
PLAYWRIGHT_USER_EMAIL: ${{ vars.PLAYWRIGHT_USER_EMAIL }}
PLAYWRIGHT_USER_PASSWORD: ${{ vars.PLAYWRIGHT_USER_PASSWORD }}

- name: Move Playwright report
if: ${{ success() || failure() }}
shell: bash
run: |
mkdir blob-reports
mv blob-report blob-reports/blob-report-$SHARD_INDEX

- name: Upload artifact
uses: actions/upload-artifact@v3
if: always()
uses: actions/upload-artifact@v4
if: ${{ success() || failure() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30

# If configured, host your playwright report on S3
name: blob-report-${{ matrix.shardIndex }}
path: blob-reports
retention-days: 1

report:
name: Report
if: ${{ vars.PLAYWRIGHT_S3_URL != '' && (success() || failure()) }}
runs-on: ubuntu-latest
needs:
- playwright-test
- Run
env:
HTML_REPORT_URL_PATH: reports/${{ github.sha }}/${{ github.run_attempt }}
steps:
- name: Download results
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: playwright-report
path: playwright/${{ env.HTML_REPORT_URL_PATH }}
path: blob-reports
pattern: blob-report-*
merge-multiple: true

- name: Merge reports
shell: bash
run: |
mv ./blob-reports/**/*.zip ./blob-reports
npx playwright merge-reports --reporter html ./blob-reports
mkdir -p ./playwright-report-upload/$HTML_REPORT_URL_PATH
mv ./playwright-report/* ./playwright-report-upload/$HTML_REPORT_URL_PATH

- name: Upload to S3
run: |
aws s3 sync playwright s3://$S3_BUCKET
aws s3 sync ./playwright-report-upload s3://$S3_BUCKET
env:
S3_BUCKET: ${{ vars.PLAYWRIGHT_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.PLAYWRIGHT_AWS_ACCESS_KEY_ID }}
Expand All @@ -87,10 +110,10 @@ jobs:

- name: Post status
if: ${{ success() || failure() }}
uses: Sibz/github-status-action@v1
uses: guibranco/github-status-action-v2@v1.1.13
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
context: Playwright Report
state: ${{ needs.playwright-test.result }}
state: ${{ needs.Run.result }}
sha: ${{ github.sha }}
target_url: ${{ vars.PLAYWRIGHT_S3_URL }}${{ env.HTML_REPORT_URL_PATH }}/index.html
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ jobs:
# Required for API access during typechecking
TAKESHAPE_API_KEY: ${{ secrets.TAKESHAPE_API_KEY }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'npm'

- name: Cache node_modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~/.npm
Expand Down
1 change: 0 additions & 1 deletion .jest/jest.setup.js

This file was deleted.

1 change: 0 additions & 1 deletion .lighthouse/lighthouseCommentMaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ ${scoreRow('Performance', summary.performance)}
${scoreRow('Accessibility', summary.accessibility)}
${scoreRow('Best practices', summary['best-practices'])}
${scoreRow('SEO', summary.seo)}
asprouse marked this conversation as resolved.
Show resolved Hide resolved
${scoreRow('PWA', summary.pwa)}
`;
}

Expand Down
58 changes: 0 additions & 58 deletions .lighthouse/lighthouseConfig.js

This file was deleted.

10 changes: 5 additions & 5 deletions .lighthouse/profiles/desktop.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const constants = require('../constants');
module.exports = {
ci: {
collect: {
extends: 'lighthouse:default',
extends: 'lighthouse:no-pwa',
settings: {
formFactor: 'desktop',
throttling: constants.throttling.desktopFIOS,
Expand All @@ -18,7 +18,7 @@ module.exports = {
'maskable-icon', // not helpful
'unsized-images' // not helpful
],
onlyCategories: ['accessibility', 'best-practices', 'performance', 'seo', 'pwa'],
onlyCategories: ['accessibility', 'best-practices', 'performance', 'seo'],
budgets: [
{
path: '/*',
Expand All @@ -33,13 +33,13 @@ module.exports = {
},
{
metric: 'speed-index',
budget: 300 // 0.3s
budget: 500 // 0.5s
asprouse marked this conversation as resolved.
Show resolved Hide resolved
}
],
resourceSizes: [
{
resourceType: 'script',
budget: 300 // 300k
budget: 600 // 600k
},
{
resourceType: 'total',
Expand All @@ -49,7 +49,7 @@ module.exports = {
resourceCounts: [
{
resourceType: 'third-party',
budget: 10
budget: 15
}
]
}
Expand Down
Loading
Loading