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

feat: shopper add navigation to context #94

Merged
merged 8 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions .changeset/fuzzy-buckets-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@elasticpath/composable-integration-hub-deployer": patch
"@elasticpath/react-shopper-hooks": patch
"@elasticpath/composable-common": patch
"composable-cli": patch
"@elasticpath/d2c-schematics": patch
"@elasticpath/shopper-common": patch
---

### migrated from yarn to pnpm

- Having issue managing the yarn workspace moved to pnpm
6 changes: 6 additions & 0 deletions .changeset/tough-bugs-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@elasticpath/react-shopper-hooks": minor
"@elasticpath/shopper-common": minor
---

add navigation to shopper store context
23 changes: 14 additions & 9 deletions .github/workflows/generate-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm

- name: Make .env.examples file (used in examples configuration.ts)
run: |
Expand All @@ -48,13 +53,13 @@ jobs:
cat ./packages/composable-cli/.env

- name: Install Dependencies
run: yarn install
run: pnpm install

- name: Build schematic schema types
run: yarn generate
run: pnpm generate

- name: Build packages/*
run: yarn build:packages
run: pnpm build:packages

- name: Report "Run packages unit and Integration tests" starting
uses: dflydev/check-runs-action@v1
Expand All @@ -64,7 +69,7 @@ jobs:
status: in_progress

- name: Run packages unit and Integration tests
run: yarn test:packages
run: pnpm test:packages
id: packages-unit-int-tests
continue-on-error: true

Expand All @@ -86,7 +91,7 @@ jobs:

- name: Generate latest examples using script
id: generate-examples
run: yarn scaffold:local
run: pnpm scaffold:local
continue-on-error: true

- name: Report "Generate latest examples using script" conclusion
Expand All @@ -109,7 +114,7 @@ jobs:
add: '*'

- name: Install additional dependencies
run: yarn install
run: pnpm install

- name: Report "Run examples unit/integration tests" starting
uses: dflydev/check-runs-action@v1
Expand All @@ -120,7 +125,7 @@ jobs:

- name: Run examples unit/integration tests
id: examples-unit-int-tests
run: yarn test
run: pnpm test
continue-on-error: true

- name: Report "Run examples unit/integration tests" conclusion
Expand All @@ -139,7 +144,7 @@ jobs:
echo NEXT_PUBLIC_CI=true >> ./examples/basic/.env.test

- name: Build everything
run: yarn build:e2e
run: pnpm build:e2e

- name: Install playwright browsers
run: npx playwright install --with-deps
Expand All @@ -152,7 +157,7 @@ jobs:
status: in_progress

- name: Run e2e tests for latest examples
run: yarn test:e2e
run: pnpm test:e2e
id: examples-e2e-tests
continue-on-error: true

Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js 16.x
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'pnpm'

- name: Make .env file for composable-cli package
run: |
Expand All @@ -27,14 +32,14 @@ jobs:
cat ./packages/composable-cli/.env

- name: Install Dependencies
run: yarn
run: pnpm install

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

## Setup

Run `yarn generate` to generate the types for schematic schemas during development
Run `pnpm generate` to generate the types for schematic schemas during development

## What's inside?

This turborepo uses [Yarn](https://classic.yarnpkg.com/lang/en/) as a package manager.
This turborepo uses [PNPM](https://pnpm.io/) as a package manager.

### Build

To build all apps and packages, run the following command:

```
yarn build
pnpm build
```
5 changes: 4 additions & 1 deletion examples/algolia/.composablerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"version": 1
"version": 1,
"cli": {
"packageManager": "pnpm"
}
}
27 changes: 14 additions & 13 deletions examples/algolia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"test:watch": "vitest",
"test:ci:e2e": "NODE_ENV=test yarn build && (yarn start & (sleep 5 && npx playwright install --with-deps && yarn test:e2e && kill $(lsof -t -i tcp:3000)))",
"test:ci:e2e": "NODE_ENV=test pnpm build && (pnpm start & (sleep 5 && npx playwright install --with-deps && pnpm test:e2e && kill $(lsof -t -i tcp:3000)))",
"test:e2e": "NODE_ENV=test playwright test",
"build:e2e": "NODE_ENV=test next build",
"start:e2e": "NODE_ENV=test next start"
},
"dependencies": {
"@algolia/react-instantsearch-widget-color-refinement-list": "^1.4.7",
"@elasticpath/react-shopper-hooks": "^0.4.0",
"@elasticpath/react-shopper-hooks": "0.4.0",
"@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.0.18",
"@moltin/sdk": "^25.0.2",
Expand All @@ -46,30 +46,31 @@
"devDependencies": {
"@babel/core": "^7.18.10",
"@next/bundle-analyzer": "13.0.4",
"@playwright/test": "^1.28.1",
"@svgr/webpack": "^6.3.1",
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "^14.0.0",
"@types/node": "18.7.3",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"@types/react-toastify": "^4.1.0",
"@vitest/coverage-istanbul": "^0.34.5",
"autoprefixer": "^10.4.14",
"babel-loader": "^8.2.5",
"eslint": "^8.49.0",
"eslint-config-next": "^13.5.2",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-react": "^7.33.2",
"vite": "^4.2.1",
"vitest": "^0.34.5",
"@vitest/coverage-istanbul": "^0.34.5",
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "^14.0.0",
"@playwright/test": "^1.28.1",
"instantsearch.js": "4.56.8",
"lint-staged": "^13.0.3",
"postcss": "^8.4.30",
"prettier": "^3.0.3",
"prettier-eslint": "^15.0.1",
"prettier-eslint-cli": "^7.1.0",
"typescript": "^5.2.2",
"tailwindcss": "^3.3.3",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.30",
"prettier-plugin-tailwindcss": "^0.5.4",
"@types/react-toastify": "^4.1.0"
"tailwindcss": "^3.3.3",
"typescript": "^5.2.2",
"vite": "^4.2.1",
"vitest": "^0.34.5"
}
}
3 changes: 0 additions & 3 deletions examples/algolia/src/components/search/MobileFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ export default function MobileFilters({
<InstantSearch
searchClient={searchClient}
indexName={algoliaEnvData.indexName}
future={{
preserveSharedStateOnUnmount: false,
}}
>
<VirtualSearchBox />
<VirtualPagination />
Expand Down
3 changes: 0 additions & 3 deletions examples/algolia/src/components/search/SearchModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ export const SearchModal = (): JSX.Element => {
<InstantSearch
searchClient={searchClient}
indexName={algoliaEnvData.indexName}
future={{
preserveSharedStateOnUnmount: false,
}}
>
<button className="flex cursor-pointer justify-start" onClick={openModal}>
<MagnifyingGlassIcon
Expand Down
3 changes: 0 additions & 3 deletions examples/algolia/src/components/search/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ export const Search: NextPageWithLayout<ISearch> = ({
indexName={algoliaEnvData.indexName}
initialUiState={initialUiState}
key={node.join("-")}
future={{
preserveSharedStateOnUnmount: false,
}}
>
{/*
* The NextRouterHandler is a workaround for a current limitation in algolia instantsearch.js
Expand Down
5 changes: 4 additions & 1 deletion examples/basic/.composablerc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"version": 1
"version": 1,
"cli": {
"packageManager": "pnpm"
}
}
4 changes: 2 additions & 2 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"test": "vitest run",
"test:coverage": "vitest run --coverage",
"test:watch": "vitest",
"test:ci:e2e": "NODE_ENV=test yarn build && (yarn start & (sleep 5 && npx playwright install --with-deps && yarn test:e2e && kill $(lsof -t -i tcp:3000)))",
"test:ci:e2e": "NODE_ENV=test pnpm build && (pnpm start & (sleep 5 && npx playwright install --with-deps && pnpm test:e2e && kill $(lsof -t -i tcp:3000)))",
"test:e2e": "NODE_ENV=test playwright test",
"build:e2e": "NODE_ENV=test next build",
"start:e2e": "NODE_ENV=test next start"
},
"dependencies": {
"@elasticpath/react-shopper-hooks": "^0.4.0",
"@elasticpath/react-shopper-hooks": "0.4.0",
"@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.0.18",
"@moltin/sdk": "^25.0.2",
Expand Down
24 changes: 16 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
"name": "@elasticpath/composable-frontend",
"version": "0.0.0",
"private": true,
"workspaces": [
"packages/*",
"examples/*"
],
"scripts": {
"build": "turbo run build",
"build:e2e": "turbo run build --filter='./packages/*' && turbo run build:e2e --filter='./examples/*'",
Expand All @@ -21,21 +17,33 @@
"test:packages": "turbo run test --filter='./packages/*'",
"test:watch": "turbo run test:watch",
"start:e2e": "turbo run start:e2e --filter='./examples/basic'",
"test:e2e": "NODE_ENV=test yarn start:e2e & (sleep 5 && turbo run test:e2e --filter='./examples/basic' && kill $(lsof -t -i tcp:3000))",
"test:e2e": "NODE_ENV=test pnpm start:e2e & (sleep 5 && turbo run test:e2e --filter='./examples/basic' && kill $(lsof -t -i tcp:3000))",
"build:cli": "turbo run build --filter=composable-cli...",
"build:packages": "turbo run build --filter='./packages/*'",
"examples": "turbo run build --filter=composable-cli... && yarn run scaffold:local",
"scaffold:local": "yarn ts-node ./scripts/generate-examples.ts"
"examples": "turbo run build --filter=composable-cli... && pnpm run scaffold:local",
"scaffold:local": "pnpm ts-node ./scripts/generate-examples.ts"
},
"devDependencies": {
"@angular-devkit/core": "^16.2.7",
"@changesets/cli": "^2.24.1",
"@playwright/test": "^1.28.1",
"@types/fs-extra": "^9.0.13",
"@types/glob": "^7.2.0",
"@types/jest": "^29.1.2",
"@types/node": "18.7.3",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"app-root-path": "^3.1.0",
"chalk": "^4.1.2",
"concurrently": "^7.6.0",
"dotenv": "^16.3.1",
"dotenv-cli": "^7.1.0",
"eslint-config-custom": "*",
"fs-extra": "^10.1.0",
"glob": "^7.2.3",
"globby": "^11.1.0",
"jest-extended": "^3.1.0",
"json-schema-to-typescript": "^11.0.1",
"kebab-case": "^1.0.2",
"mkdirp": "2.1.5",
"prettier": "latest",
Expand All @@ -50,7 +58,7 @@
"dependencies": {
"@moltin/sdk": "^25.0.2"
},
"packageManager": "[email protected]",
"packageManager": "[email protected]",
"volta": {
"node": "16.20.2"
}
Expand Down
Loading
Loading