Skip to content

Commit

Permalink
fix: rename MAGENTO_BACKEND_DOMAIN to MAGENTO_BACKEND_URL
Browse files Browse the repository at this point in the history
More accurately reflects the contents of the variable. Fixes #337.
  • Loading branch information
zetlen committed Oct 9, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent f47e992 commit eb96392
Showing 10 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ Follow these steps to install the dependencies for all the packages in the proje
2. Navigate to the root of the repository from the command line
3. Run `npm install`
4. Copy `packages/venia-concept/example.env` to `packages/venia-concept/.env`
5. Uncomment the line for `MAGENTO_BACKEND_DOMAIN` in `packages/venia-concept/.env`, and set `MAGENTO_BACKEND_DOMAIN` to the fully-qualified URL of a Magento store running `2.3`.
5. Uncomment the line for `MAGENTO_BACKEND_URL` in `packages/venia-concept/.env`, and set `MAGENTO_BACKEND_URL` to the fully-qualified URL of a Magento store running `2.3`.
6. On your first install, run `npm run build` from package root.
7. To run the Venia storefront development experience, run `npm run watch:venia` from package root.

6 changes: 3 additions & 3 deletions packages/pwa-buildpack/README.md
Original file line number Diff line number Diff line change
@@ -123,7 +123,7 @@ which reads an ini-formatted file to set the environment.
in it:
```sh
MAGENTO_BACKEND_DOMAIN=https://localhost.magento:8008
MAGENTO_BACKEND_URL=https://localhost.magento:8008
# change the above to your local Magento store's host (with port)
MAGENTO_PATH=~/path/to/magento/rootdir
@@ -189,7 +189,7 @@ which reads an ini-formatted file to set the environment.
`process.env`.
_If you like, you can prove this is working by adding another line that says
`console.log(process.env.MAGENTO_BACKEND_DOMAIN)`. Save the file and then run
`console.log(process.env.MAGENTO_BACKEND_URL)`. Save the file and then run
`node webpack.config.js`._
1. Add the following lines to `webpack.config.js`:
@@ -307,7 +307,7 @@ which reads an ini-formatted file to set the environment.
if (env.mode === "development") {
config.devServer = await PWADevServer.configure({
publicPath: process.env.MAGENTO_BACKEND_PUBLIC_PATH,
backendDomain: process.env.MAGENTO_BACKEND_DOMAIN,
backendDomain: process.env.MAGENTO_BACKEND_URL,
serviceWorkerFileName: process.env.SERVICE_WORKER_FILE_NAME,
paths: themePaths,
id: 'magento-my-theme'
Original file line number Diff line number Diff line change
@@ -43,15 +43,15 @@ In general, these plugins provide convenience and produce cleaner code in your p

Create a `.env` file and assign values to the following environment variables:

* `MAGENTO_BACKEND_DOMAIN` - Your local Magento store’s host and port.
* `MAGENTO_BACKEND_URL` - Your local Magento store’s host and port.
* `MAGENTO_BACKEND_PUBLIC_PATH` - PWA files are served from root during development, but
this environment variable can later be used to simulate a deployed static path.
* `SERVICE_WORKER_FILE_NAME` - Set this value to `"sw.js"`.

Your file should look like the following:

``` text
MAGENTO_BACKEND_DOMAIN=https://localhost.magento:8008
MAGENTO_BACKEND_URL=https://localhost.magento:8008
MAGENTO_BACKEND_PUBLIC_PATH=/
@@ -77,10 +77,10 @@ require('dotenv').config();
This imports the the contents of the `.env` file as environment variables using the `dotenv` module.
These environment variables are accessed using the `process.env` global object.

For example, the following code outputs the value of the `MAGENTO_BACKEND_DOMAIN` environment variable:
For example, the following code outputs the value of the `MAGENTO_BACKEND_URL` environment variable:

``` javascript
console.log(process.env.MAGENTO_BACKEND_DOMAIN);
console.log(process.env.MAGENTO_BACKEND_URL);
```

### Import Webpack and pwa-buildpack libraries
@@ -195,7 +195,7 @@ Add the following development mode configuration before returning the `config` o
if (env.phase === "development") {
config.devServer = await PWADevServer.configure({
publicPath: process.env.MAGENTO_BACKEND_PUBLIC_PATH,
backendDomain: process.env.MAGENTO_BACKEND_DOMAIN,
backendDomain: process.env.MAGENTO_BACKEND_URL,
serviceWorkerFileName: process.env.SERVICE_WORKER_FILE_NAME,
paths: themePaths,
id: path.basename(__dirname) // Defaults to theme directory name
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ module.exports = async function(env) {
if (env.phase === "development") {
config.devServer = await PWADevServer.configure({
publicPath: process.env.MAGENTO_BACKEND_PUBLIC_PATH,
backendDomain: process.env.MAGENTO_BACKEND_DOMAIN,
backendDomain: process.env.MAGENTO_BACKEND_URL,
serviceWorkerFileName: process.env.SERVICE_WORKER_FILE_NAME,
paths: themePaths,
id: path.basename(__dirname) // Defaults to theme directory name
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ feature to replace components and stylesheets inline.
The `devServer` acts as a proxy server for API and media requests to Magento. It
is configured using environment variables.

The `MAGENTO_BACKEND_DOMAIN` environment variable configures the proxy server
The `MAGENTO_BACKEND_URL` environment variable configures the proxy server
to accept GraphQL, REST, and media requests and passes them to Magento.

The `MAGENTO_BACKEND_PUBLIC_PATH` environment variable allows the proxy server
4 changes: 2 additions & 2 deletions packages/pwa-devdocs/src/venia-pwa-concept/setup/index.md
Original file line number Diff line number Diff line change
@@ -160,11 +160,11 @@ cd /Users/magedev/pwa-studio/packages/venia-concept
cp .env.dist .env
```

In the `.env` file set the value of `MAGENTO_BACKEND_DOMAIN` to the URL of your Magento development store.
In the `.env` file set the value of `MAGENTO_BACKEND_URL` to the URL of your Magento development store.

**Example:**
``` text
MAGENTO_BACKEND_DOMAIN="https://magento.test/"
MAGENTO_BACKEND_URL="https://magento.test/"
```

## Step 5. Start the server
2 changes: 1 addition & 1 deletion packages/upward-spec/README.md
Original file line number Diff line number Diff line change
@@ -944,7 +944,7 @@ A ProxyResolver is an important part of the UPWARD philosophy: a PWA's UPWARD fi
```yaml
proxy:
target: env.MAGENTO_BACKEND_DOMAIN
target: env.MAGENTO_BACKEND_URL
ignoreSSLErrors: true
```
2 changes: 1 addition & 1 deletion packages/venia-concept/example.env
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
#
# Connect to an instance of Magento 2.3 by specifying its public
# domain name. **REQUIRED.** Example:
# MAGENTO_BACKEND_DOMAIN="https://magento2.local"
# MAGENTO_BACKEND_URL="https://magento2.local"
#
# Use a particular website code when making API calls. Defaults to 'base',
# but for your PWA to act as a different "website" in the Magento admin,
2 changes: 1 addition & 1 deletion packages/venia-concept/validate-queries.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require('dotenv').config();
process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0;
const magentoDomainVarName = 'MAGENTO_BACKEND_DOMAIN';
const magentoDomainVarName = 'MAGENTO_BACKEND_URL';
const magentoDomain = process.env[magentoDomainVarName];
if (!magentoDomain) {
console.error(
4 changes: 2 additions & 2 deletions packages/venia-concept/venia-upward.yml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ response:
default: static

proxy:
target: env.MAGENTO_BACKEND_DOMAIN
target: env.MAGENTO_BACKEND_URL
ignoreSSLErrors:
inline: true

@@ -79,7 +79,7 @@ urlResolverResult:
magentoGQL:
engine: mustache
template:
inline: '{{env.MAGENTO_BACKEND_DOMAIN}}/graphql'
inline: '{{env.MAGENTO_BACKEND_URL}}/graphql'
provide:
- env

0 comments on commit eb96392

Please sign in to comment.