Skip to content

Commit

Permalink
Merge branch 'main' into fix/readonly-address-error
Browse files Browse the repository at this point in the history
  • Loading branch information
csandru-plenty authored Dec 6, 2024
2 parents c02f43d + 29a6df6 commit 34bd5af
Show file tree
Hide file tree
Showing 12 changed files with 7,529 additions and 7,882 deletions.
21 changes: 3 additions & 18 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,8 @@ runs:
cache: 'yarn'
registry-url: 'https://npm.pkg.github.com'

- name: Set yarn version
run: |
yarn set version stable
yarn set version 3.6.4
shell: bash

- name: Setup .yarnrc.yml
run: |
yarn config set nodeLinker node-modules
yarn config set npmScopes.plentymarkets.npmRegistryServer "https://npm.pkg.github.com"
yarn config set npmScopes.plentymarkets.npmAlwaysAuth true
yarn config set npmScopes.plentymarkets.npmAuthToken $NODE_AUTH_TOKEN
yarn plugin import workspace-tools
- name: Setup yarn
run: chmod +x ${{ github.workspace }}/yarn.sh && ${{ github.workspace }}/yarn.sh
shell: bash
env:
NODE_AUTH_TOKEN: ${{ inputs.npm-auth-token }}

- name: Install Dependencies
run: yarn --frozen-lockfile
shell: bash
NPM_AUTH_TOKEN: ${{ inputs.npm-auth-token }}
541 changes: 0 additions & 541 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

28 changes: 0 additions & 28 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.4.cjs

This file was deleted.

934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.5.3.cjs

Large diffs are not rendered by default.

50 changes: 28 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,47 @@ Welcome to the plentysystems integration for Alokai.

This section describes how to run the project locally with the preconfigured demo system.

### Prerequisites

- `Node.js` 20+
- `Yarn` 3
- [Personal Access Token](https://github.com/settings/tokens/new) with the scope **read:packages**

Download Node.js from the [official website](https://nodejs.org/) or use [nvm](https://github.com/nvm-sh/nvm) to switch to a compatible version. For installation instructions for Yarn, refer to the [Yarn documentation](https://yarnpkg.com/getting-started/install).

### Repository fork
### Fork repository

We recommend working with a fork of this repository. A fork allows you to easily incorporate updates from this boilerplate into your own codebase.

1. [Create a fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo).
2. [Clone the forked repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository).

### Authentication
### Create authentication token

This project queries data from plentysystems by using other NPM packages as middleware. These packages are published on the GitHub registry. To download packages from GitHub's registry, you have to authenticate.

To enable authentication, create a [Personal Access Token](https://github.com/settings/tokens/new) (PAT) with the scope **read:packages**.

### Set up environment

Create an environment file under `apps/web/.env`. The minimum required configuration includes your PAT, the [API endpoint](https://pwa-docs.plentymarkets.com/guide/how-to/middleware#api-endpoint) of your PlentyONE system and the corresponding [API security token](https://pwa-docs.plentymarkets.com/guide/how-to/middleware#api-security-token):

```properties
# apps/web/.env

This project queries data from plentysystems by using other NPM packages as middleware. These packages are published on the GitHub registry. To download packages from GitHub's registry, you have to authenticate. To enable authentication, carry out the following steps:
NPM_AUTH_TOKEN=
API_ENDPOINT=
API_SECURITY_TOKEN=
```

1. In the root directory, create a new file called `.yarnrc.yml`.
2. Copy the contents of `.yarnrc.yml.example` to `.yarnrc.yml`.
3. In `.yarnrc.yml`, replace `<TOKEN>` with the Personal Access Token you created earlier.
Download Node.js from the [official website](https://nodejs.org/). We recommend using [nvm](https://github.com/nvm-sh/nvm) to easily stay compatible with new versions. Then install all dependencies using Yarn.

Git doesn't track `.yarnrc.yml`, so you don't have to worry about exposing your token.
```bash
# installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

### Setup environment
# downloads and installs Node.js according to the project version in .nvmrc
nvm install

1. Add your [API endpoint](https://pwa-docs.plentymarkets.com/guide/how-to/middleware#api-endpoint)
2. Add your [API security token](https://pwa-docs.plentymarkets.com/guide/how-to/middleware#api-security-token)
# downloads and installs Yarn according to the project version, and downloads, installs, and builds all dependencies
npm run setup:unix
```

### Starting the app
### Start the app

1. Open the repository in your command line interface.
2. Run `yarn` to install all dependencies.
3. Run `yarn dev` to start the development server. The app will be served with hot reload at [localhost:3000](http://localhost:3000/).
Run `yarn dev` to start the development server. The app will be served with hot reload at [localhost:3000](http://localhost:3000/).

## Resources

Expand Down
1 change: 1 addition & 0 deletions apps/web/.env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
NPM_AUTH_TOKEN=
API_ENDPOINT=
API_SECURITY_TOKEN=
TURNSTILESITEKEY="0x4AAAAAAANx3aXDh7UR35x0"
Expand Down
15 changes: 15 additions & 0 deletions docs/changelog/changelog_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ The **Upload** action now supports deploying the PWA to different environments:

Each client supports two PWA instances. With this change, you can designate the live instance as the production environment and the preview instance as the staging environment. The production environment uses the GitHub Actions Secret `URL_ENDPOINT_TOKEN`; the staging environment uses the GitHub Actions Secret `URL_ENDPOINT_TOKEN_STAGING`.

### NPM Authentication Token

Instead of creating a `.yarnrc.yml` file manually, you can now use one of the following scripts depending on your operating system:

- Linux/MacOS: `yarn.sh` | `npm run setup:unix`
- Windows: `yarn.ps1` | `npm run setup:windows`

To run the script, you have to add your GitHub Token with `read:packages` permissions to the environment.

```properties
# apps/web/.env

NPM_AUTH_TOKEN="<TOKEN>"
```

### 🩹 Fixed

- Addressed a scenario where deleting the checkout address as a guest triggered an unknown error.
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"scripts": {
"prepare": "is-ci || husky install",
"update:sdk": "yarn up @plentymarkets/shop-api",
"setup": "yarn && yarn build && yarn dev",
"setup:unix": "chmod +x yarn.sh && ./yarn.sh && yarn build",
"setup:windows": "powershell -Command \"Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process; ./yarn.ps1\" && yarn build",
"turbo:disable-telemetry": "turbo telemetry disable",
"build": "yarn turbo:disable-telemetry && turbo run build",
"build:analyze": "yarn turbo:disable-telemetry && turbo run build:analyze",
Expand Down Expand Up @@ -78,7 +79,7 @@
"yarn": ">=3.6.1",
"node": ">=20.0.0"
},
"packageManager": "yarn@3.6.4",
"packageManager": "yarn@4.5.3",
"config": {
"commitizen": {
"path": "cz-conventional-changelog",
Expand Down
Loading

0 comments on commit 34bd5af

Please sign in to comment.