merge 1.3.0 with 1.3.1

This commit is contained in:
Shahed Nasser
2022-06-01 19:16:26 +03:00
parent a20261b319
commit b75867b119
3 changed files with 39 additions and 49 deletions

View File

@@ -1,43 +0,0 @@
# v1.3.0
Version 1.3.0 of Medusa introduces new features and enhancements to Medusa's core.
This version introduces a change in loading environment variables into your Medusa server.
## Environment Variables
In previous versions of Medusa, The server automatically loads all environment variables in the `.env` file at the root of the Medusa server.
This new update removes loading it automatically and gives developers the freedom in how to load their environment variables. All environment variables will be loaded by default from the systems environment variables.
### Actions Required
If you use a `.env` file to load environment variables on your server, you need to load the variables manually in `medusa-config.js`.
You can add the following code snippet at the top of the file which uses the [dotenv](https://www.npmjs.com/package/dotenv) package to load the environment variables based on the current Node environment:
```jsx
const dotenv = require('dotenv')
let ENV_FILE_NAME = '';
switch (process.env.NODE_ENV) {
case 'production':
ENV_FILE_NAME = '.env.production';
break;
case 'staging':
ENV_FILE_NAME = '.env.staging';
break;
case 'test':
ENV_FILE_NAME = '.env.test';
break;
case 'development':
default:
ENV_FILE_NAME = '.env';
break;
}
try {
dotenv.config({ path: process.cwd() + '/' + ENV_FILE_NAME });
} catch (e) {
}
```

View File

@@ -1,6 +1,6 @@
# v1.3.1
Version 1.3.1 of Medusa introduces new features including the addition of Line Item Adjustments and a more advanced Promotions API. The changes do not affect the public APIs and require only running necessary data migrations.
Version 1.3.1 of Medusa introduces new features including the addition of Line Item Adjustments and a more advanced Promotions API, as well as a change in loading environment variables into your Medusa server. The changes do not affect the public APIs and require only running necessary data migrations.
## Prerequisites
@@ -16,6 +16,44 @@ TYPEORM_MIGRATIONS=./node_modules/@medusajs/medusa/dist/migrations/*.js
These environment variables are used in the data migration scripts in this upgrade. Make sure to replace `<DATABASE_URL>` with your PostgreSQL database URL.
## Environment Variables
In previous versions of Medusa, The server automatically loads all environment variables in the `.env` file at the root of the Medusa server.
This new update removes loading it automatically and gives developers the freedom in how to load their environment variables. All environment variables will be loaded by default from the systems environment variables.
### Actions Required
If you use a `.env` file to load environment variables on your server, you need to load the variables manually in `medusa-config.js`.
You can add the following code snippet at the top of the file which uses the [dotenv](https://www.npmjs.com/package/dotenv) package to load the environment variables based on the current Node environment:
```jsx
const dotenv = require('dotenv')
let ENV_FILE_NAME = '';
switch (process.env.NODE_ENV) {
case 'production':
ENV_FILE_NAME = '.env.production';
break;
case 'staging':
ENV_FILE_NAME = '.env.staging';
break;
case 'test':
ENV_FILE_NAME = '.env.test';
break;
case 'development':
default:
ENV_FILE_NAME = '.env';
break;
}
try {
dotenv.config({ path: process.cwd() + '/' + ENV_FILE_NAME });
} catch (e) {
}
```
## Line Item Adjustments
This new version of Medusa allows store operators to adjust line items in an order or a swap which provides more customization capabilities.

View File

@@ -214,11 +214,6 @@ module.exports = {
label: 'Upgrade Guides',
collapsed: true,
items: [
{
type: "doc",
id: "advanced/backend/upgrade-guides/1-3-0",
label: "v1.3.0"
},
{
type: "doc",
id: "advanced/backend/upgrade-guides/1-3-1",