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

Adds Hydrogen 2.0 (via Remix) Adapter #126

Closed
wants to merge 55 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
d1e5b5f
feat(hydrogen-edge-adapter): the adapter to run Hydrogen projects on …
zachleat Jun 29, 2023
6f8e5bf
Merge branch 'main' into zl/hydrogen-adapter
zachleat Jun 29, 2023
e692460
chore: copy tweaks to hydrogen edge adapter readme
zachleat Jun 30, 2023
1f84c92
chore: removes rogue package-lock file
zachleat Jun 30, 2023
1dbc4d5
chore: update root package-lock file
zachleat Jun 30, 2023
a9cba64
Apply @LekoArts suggestions from code review
zachleat Jul 5, 2023
c7ef7c2
chore: remove sourcemaps from build output
zachleat Jul 5, 2023
ada91aa
chore: resolve pull request feedback
zachleat Jul 6, 2023
6a8a257
chore: pull request feedback
zachleat Jul 6, 2023
8b4ad85
chore: one more types removal
zachleat Jul 6, 2023
4cb49ff
chore: update server file to use TypeScript
zachleat Jul 11, 2023
edd4e0f
chore: fix missing context info
zachleat Jul 11, 2023
1d61d2b
Merge branch 'main' into zl/hydrogen-adapter
zachleat Jul 11, 2023
423c60c
feat: adds hydrogen-demo-store to the repo
zachleat Jul 11, 2023
5f33c14
Merge remote-tracking branch 'origin/main' into zl/hydrogen-adapter
nickytonline Jul 18, 2023
fa9acac
Merge remote-tracking branch 'origin/main' into zl/hydrogen-adapter
nickytonline Jul 19, 2023
26b754f
chore: trigger build
nickytonline Jul 19, 2023
bcd6baf
chore: renamed hydrogen Netlify plugin to @netlify/hydrogen-integration
nickytonline Jul 19, 2023
1969749
chore: added Hydrogen build integration to release please
nickytonline Jul 19, 2023
115d746
Merge remote-tracking branch 'origin/main' into zl/hydrogen-adapter
nickytonline Jul 20, 2023
12c87d1
chore: using build constants for paths now
nickytonline Jul 20, 2023
cb8f3d2
chore: testing build with no plugin for git push
nickytonline Jul 20, 2023
411635c
Revert "chore: testing build with no plugin for git push"
nickytonline Jul 21, 2023
71bdda9
Merge remote-tracking branch 'origin/main' into zl/hydrogen-adapter
nickytonline Jul 21, 2023
9080b3f
chore: testing out config for git push deploy
nickytonline Jul 21, 2023
a29557d
chore: trying framework autodetect for hydrogen
nickytonline Jul 21, 2023
eadb61a
chore: trying another build integration file copy config
nickytonline Jul 21, 2023
82d0422
chore: trying another build integration file copy config #2
nickytonline Jul 21, 2023
1583441
chore: trying another build integration file copy config #3
nickytonline Jul 21, 2023
f7d6c15
chore: move edge function inline to demo site server.js
nickytonline Jul 25, 2023
552ff0b
Merge remote-tracking branch 'origin/main' into zl/hydrogen-adapter
nickytonline Jul 25, 2023
7fff63f
chore: added workaround for local deploy/serve vs/ git push deploy
nickytonline Jul 25, 2023
4aca7ae
chore: trigger build
nickytonline Jul 25, 2023
4cdf787
chore: trigger build
nickytonline Jul 25, 2023
d4545f3
chore: added logging to Hydrogen integration to see where files copy …
nickytonline Jul 25, 2023
2d82368
chore: trigger build
nickytonline Jul 26, 2023
3317984
chore: fixed missing CacheStorage crash issue
nickytonline Jul 26, 2023
2b27ff2
test: added e2e tests for the demo store
nickytonline Jul 26, 2023
365db81
test: added missing projectId for Cypress
nickytonline Jul 26, 2023
261a351
chore: removed unused destructured constant
nickytonline Jul 27, 2023
3269443
chore: added some types
nickytonline Jul 27, 2023
787a89e
chore: upgraded to @shopify/hydrogen 2023.7.0
nickytonline Jul 27, 2023
9f33921
Merge remote-tracking branch 'origin' into zl/hydrogen-adapter
nickytonline Aug 21, 2023
39e9bbc
chore: trigger build
nickytonline Aug 21, 2023
f28bc48
Merge remote-tracking branch 'origin' into zl/hydrogen-adapter
nickytonline Aug 22, 2023
5c93624
Merge remote-tracking branch 'origin' into zl/hydrogen-adapter
nickytonline Aug 22, 2023
bd1b37d
chore: updated Netlify config with dev and build commands
nickytonline Aug 22, 2023
aeafdbf
chore: removed Netlify Hydrogen build plugin
nickytonline Aug 22, 2023
fed6f0e
chore: added back package builds for hydrogen-edge-adapter
nickytonline Aug 22, 2023
9acdae2
Revert "chore: removed Netlify Hydrogen build plugin"
nickytonline Aug 22, 2023
e2ba401
chore: removed a console.dir
nickytonline Aug 23, 2023
2fd5e6f
Merge remote-tracking branch 'origin' into zl/hydrogen-adapter
nickytonline Aug 23, 2023
7a18fff
Merge remote-tracking branch 'origin' into zl/hydrogen-adapter
nickytonline Aug 25, 2023
97d40d3
chore: trigger build
nickytonline Aug 25, 2023
d4f5b50
Merge remote-tracking branch 'origin' into zl/hydrogen-adapter
nickytonline Aug 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/cypress-demo-store.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Run e2e (Remix Hydrogen Store Demo)
on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main
jobs:
cypress:
name: Cypress
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
containers: [1]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Generate Github token
uses: navikt/github-app-token-generator@v1
id: get-token
with:
private-key: ${{ secrets.TOKENS_PRIVATE_KEY }}
app-id: ${{ secrets.TOKENS_APP_ID }}

- name: Checkout @netlify/wait-for-deploy-action
uses: actions/checkout@v3
with:
repository: netlify/wait-for-deploy-action
token: ${{ steps.get-token.outputs.token }}
path: ./.github/actions/wait-for-netlify-deploy

- name: Wait for Netlify Deploy
id: deploy
uses: ./.github/actions/wait-for-netlify-deploy
with:
site-name: hydrogen-demo-site
timeout: 300

- name: Deploy successful
if: ${{ steps.deploy.outputs.origin-url }}
run: echo ${{ steps.deploy.outputs.origin-url }}

- name: Node
uses: actions/setup-node@v3
with:
node-version: '16'

- run: npm install

- name: Cypress run
if: ${{ steps.deploy.outputs.origin-url }}
id: cypress
uses: cypress-io/github-action@v2
with:
browser: chrome
headless: true
record: true
parallel: true
config-file: cypress/config/demo-store-cypress.config.ts
group: 'Remix Hydrogen Store Demo'
env:
DEBUG: '@cypress/github-action'
CYPRESS_baseUrl: ${{ steps.deploy.outputs.origin-url }}
CYPRESS_NETLIFY_CONTEXT: ${{ steps.deploy.outputs.context }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CYPRESS_RECORD_KEY: ${{ secrets.REMIX_EDGE_CYPRESS_RECORD_KEY }}
4 changes: 4 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ jobs:
if: ${{ steps.release.outputs['packages/remix-adapter--version'] }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- run: npm publish packages/hydrogen-integration/
if: ${{ steps.release.outputs['packages/hydrogen-integration--version'] }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"packages/remix-edge-adapter":"2.0.0","packages/remix-runtime":"1.1.0","packages/remix-adapter":"1.0.0"}
{ "packages/remix-edge-adapter": "2.0.0", "packages/remix-runtime": "1.1.0", "packages/remix-adapter": "1.0.0" }
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ The project is a monorepo. Packages are located in the `packages` directory. The
- `remix-demo-site` - A demo site for testing the remix-adapter
- `@netlify/remix-runtime` - The Remix runtime for Netlify Edge Functions
- `@netlify/remix-edge-adapter` - The Remix adapter for Netlify Edge Functions
- `remix-edge-demo-site` - A demo site for testing the remix-edge-adapter
- `remix-edge-demo-site` - A demo site for testing the packages
- `@netlify/hydrogen-edge-adapter` - The Hydrogen/Remix adapter for Netlify Edge Functions
- `@netlify/hydrogen-integration` - The Netlify build integration for Hydrogen projects on Netlify
Comment on lines -14 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: Should hydrogen-demo-site be added to this list?


## Installation

Expand Down
12 changes: 12 additions & 0 deletions cypress/config/demo-store-cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from 'cypress'

export default defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
specPattern: 'cypress/e2e/demo-store/**/*.spec.ts',
projectId: 'k847hv',
setupNodeEvents(on, config) {

Check warning on line 8 in cypress/config/demo-store-cypress.config.ts

View workflow job for this annotation

GitHub Actions / Unit tests (ubuntu-latest)

'on' is defined but never used

Check warning on line 8 in cypress/config/demo-store-cypress.config.ts

View workflow job for this annotation

GitHub Actions / Unit tests (ubuntu-latest)

'config' is defined but never used

Check warning on line 8 in cypress/config/demo-store-cypress.config.ts

View workflow job for this annotation

GitHub Actions / Unit tests (macOS-latest)

'on' is defined but never used

Check warning on line 8 in cypress/config/demo-store-cypress.config.ts

View workflow job for this annotation

GitHub Actions / Unit tests (macOS-latest)

'config' is defined but never used

Check warning on line 8 in cypress/config/demo-store-cypress.config.ts

View workflow job for this annotation

GitHub Actions / Unit tests (windows-latest)

'on' is defined but never used

Check warning on line 8 in cypress/config/demo-store-cypress.config.ts

View workflow job for this annotation

GitHub Actions / Unit tests (windows-latest)

'config' is defined but never used
// implement node event listeners here
},
},
})
2 changes: 1 addition & 1 deletion cypress/config/edge-cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
export default defineConfig({
e2e: {
baseUrl: 'http://localhost:3000',
specPattern: 'cypress/e2e/**/*.spec.ts',
specPattern: 'cypress/e2e/remix-demo/**/*.spec.ts',
projectId: 'k847hv',
setupNodeEvents(on, config) {

Check warning on line 8 in cypress/config/edge-cypress.config.ts

View workflow job for this annotation

GitHub Actions / Unit tests (ubuntu-latest)

'on' is defined but never used

Check warning on line 8 in cypress/config/edge-cypress.config.ts

View workflow job for this annotation

GitHub Actions / Unit tests (ubuntu-latest)

'config' is defined but never used

Check warning on line 8 in cypress/config/edge-cypress.config.ts

View workflow job for this annotation

GitHub Actions / Unit tests (macOS-latest)

'on' is defined but never used

Check warning on line 8 in cypress/config/edge-cypress.config.ts

View workflow job for this annotation

GitHub Actions / Unit tests (macOS-latest)

'config' is defined but never used

Check warning on line 8 in cypress/config/edge-cypress.config.ts

View workflow job for this annotation

GitHub Actions / Unit tests (windows-latest)

'on' is defined but never used

Check warning on line 8 in cypress/config/edge-cypress.config.ts

View workflow job for this annotation

GitHub Actions / Unit tests (windows-latest)

'config' is defined but never used
// implement node event listeners here
},
},
Expand Down
41 changes: 41 additions & 0 deletions cypress/e2e/demo-store/smoke.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
describe('Demo Store Smoke Test', () => {
it('Should load the demo store', () => {
cy.visit('/')
cy.findByRole('heading', { name: /Hydrogen/i }).should('exist')
// Using \s here because there is an   in the text and checking for that doesn't work
cy.findByRole('heading', { name: /All Mountain All\sSeason/i }).should('exist')
cy.findByRole('link', { name: /Collections/i }).should('exist')
cy.findByRole('link', { name: /Products/i }).should('exist')
cy.findByRole('link', { name: /Journal/i }).should('exist')
})

it('Should load a product collection', () => {
Cypress.on('uncaught:exception', (err) => {
// returning false here prevents Cypress from
// failing the test
console.log('Cypress detected uncaught exception: ', err)
return false
})

cy.visit('/collections')
cy.findByRole('heading', { name: /Freestyle Collection/i }).should('exist')
// forcing the click as another element is covering the image in the DOM
cy.findByRole('img', {
name: /A snowboarder stands atop a snowy mountain holding his snowboard with the back facing the camera. The snowboard artwork reads Hydrogen, in a script font/i,
}).click({ force: true })
cy.findByRole('heading', { name: /Freestyle Collection/i }).should('exist')
})

it('Should load a product page', () => {
cy.visit('/products/')
cy.findByRole('link', { name: /The Hydrogen Snowboard/i }).click()
cy.findByRole('heading', { name: /The Hydrogen Snowboard/i }).should('exist')
})

it('Should load a journal', () => {
cy.visit('/journal')
cy.findByRole('heading', { name: /The Best Places for Backcountry Snowboarding/i }).click()
cy.findByRole('heading', { name: /The Best Places for Backcountry Snowboarding/i }).should('exist')
cy.findAllByRole('img', { name: /Model sits on a red brick wall in front of the ocean/i }).should('exist')
})
})
File renamed without changes.
Loading
Loading