Explorar el Código

Merge branch 'master' into patch-1

Oliver Windall Juhl hace 3 años
padre
commit
876f9eb41b
Se han modificado 10 ficheros con 698 adiciones y 628 borrados
  1. 4 0
      .dockerignore
  2. 1 1
      .gitignore
  3. 4 2
      Dockerfile
  4. 9 4
      README.md
  5. 24 0
      medusa-config.js
  6. 7 8
      package.json
  7. 1 1
      src/services/README.md
  8. 1 1
      src/subscribers/README.md
  9. 5 0
      tsconfig.json
  10. 642 611
      yarn.lock

+ 4 - 0
.dockerignore

@@ -0,0 +1,4 @@
+dist
+node_modules
+
+npm-debug.log

+ 1 - 1
.gitignore

@@ -4,4 +4,4 @@
 /uploads
 /node_modules
 yarn-error.log
-
+/.idea

+ 4 - 2
Dockerfile

@@ -4,7 +4,7 @@ WORKDIR /app/medusa
 
 COPY package.json .
 COPY develop.sh .
-COPY yarn.lock .
+COPY yarn.* .
 
 RUN apt-get update
 
@@ -16,4 +16,6 @@ RUN npm install -g @medusajs/medusa-cli@latest
 
 RUN npm install
 
-ENTRYPOINT ["./develop.sh"]
+COPY . .
+
+ENTRYPOINT ["./develop.sh"]

+ 9 - 4
README.md

@@ -1,6 +1,6 @@
 <p align="center">
   <a href="https://www.medusa-commerce.com">
-    <img alt="Medusa" src="https://user-images.githubusercontent.com/7554214/129161578-19b83dc8-fac5-4520-bd48-53cba676edd2.png" width="100" />
+    <img alt="Medusa" src="https://i.imgur.com/USubGVY.png" width="100" />
   </a>
 </p>
 <h1 align="center">
@@ -22,6 +22,11 @@ This repo provides the skeleton to get you started with using <a href="https://g
   <a href="https://twitter.com/intent/follow?screen_name=medusajs">
     <img src="https://img.shields.io/twitter/follow/medusajs.svg?label=Follow%20@medusajs" alt="Follow @medusajs" />
   </a>
+  <p align="center">
+    <a href="https://heroku.com/deploy?template=https://github.com/medusajs/medusa-starter-default/tree/feat/deploy-heroku">
+      <img src="https://www.herokucdn.com/deploy/button.svg" alt="Deploy">
+    </a>
+  </p>
 </p>
 
 ## Prerequisites
@@ -61,7 +66,7 @@ To seed your medusa store run the following command:
 medusa seed -f ./data/seed.json
 ```
 
-This command seeds your database with some sample datal to get you started, including a store, an administrator account, a region and a product with variants. What the data looks like precisely you can see in the `./data/seed.json` file.
+This command seeds your database with some sample data to get you started, including a store, an administrator account, a region and a product with variants. What the data looks like precisely you can see in the `./data/seed.json` file.
 
 ## Setting up your store with Docker
 
@@ -90,7 +95,7 @@ This command seeds your database with some sample datal to get you started, incl
 
 - Run your project
 
-  When running your project the first time `docker-compose` should be run with the `build` flag to build your contianer locally:
+  When running your project the first time `docker compose` should be run with the `build` flag to build your container locally:
 
   ```
   docker-compose up --build
@@ -108,7 +113,7 @@ Your local Medusa server is now running on port **9000**.
 
 ---
 
-To add seed data to your medusa store runnign with Docker, run this command in a seperate terminal:
+To add seed data to your medusa store running with Docker, run this command in a seperate terminal:
 
 ```
 docker exec medusa-server medusa seed -f ./data/seed.json

+ 24 - 0
medusa-config.js

@@ -1,3 +1,27 @@
+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) {
+}
+
 // CORS when consuming Medusa from admin
 const ADMIN_CORS = process.env.ADMIN_CORS || "http://localhost:7000,http://localhost:7001";
 

+ 7 - 8
package.json

@@ -10,13 +10,12 @@
     "start": "medusa develop"
   },
   "dependencies": {
-    "@medusajs/medusa": "^1.1.49",
-    "@medusajs/medusa-cli": "^1.1.22",
-    "medusa-fulfillment-manual": "^1.1.26",
-    "medusa-interfaces": "^1.1.27",
-    "medusa-payment-manual": "^1.0.8",
-    "medusa-payment-stripe": "^1.1.30",
-    "mongoose": "^5.13.3",
+    "@medusajs/medusa": "^1.3.4",
+    "@medusajs/medusa-cli": "^1.3.1",
+    "medusa-fulfillment-manual": "^1.1.31",
+    "medusa-interfaces": "^1.3.1",
+    "medusa-payment-manual": "^1.0.16",
+    "medusa-payment-stripe": "^1.1.41",
     "typeorm": "^0.2.36"
   },
   "repository": "https://github.com/medusajs/medusa-starter-default.git",
@@ -30,6 +29,6 @@
     "@babel/cli": "^7.14.3",
     "@babel/core": "^7.14.3",
     "@babel/preset-typescript": "^7.14.5",
-    "babel-preset-medusa-package": "^1.1.13"
+    "babel-preset-medusa-package": "^1.1.19"
   }
 }

+ 1 - 1
src/services/README.md

@@ -24,7 +24,7 @@ class MyService extends BaseService {
 export default MyService;
 ```
 
-The first argument to the `constructor` is the global giving you access to easy dependency injection. The container holds all registered services from the core, installed plugins and from other files in the `/services` directory. The registration name is a camelCased version of the file name with the type appended i.e.: `my.js` is registered as `myService`, `custom-thing.js` is registerd as `customThingService`.
+The first argument to the `constructor` is the global giving you access to easy dependency injection. The container holds all registered services from the core, installed plugins and from other files in the `/services` directory. The registration name is a camelCased version of the file name with the type appended i.e.: `my.js` is registered as `myService`, `custom-thing.js` is registered as `customThingService`.
 
 You may use the services you define here in custom endpoints by resolving the services defined.
 

+ 1 - 1
src/subscribers/README.md

@@ -22,4 +22,4 @@ A subscriber is defined as a `class` which is registered as a subscriber by invo
 
 The type of event that the subscriber subscribes to is passed as the first parameter to the `eventBusService.subscribe` and the eventhandler is passed as the second parameter. The types of events a service can emmit are described in the individual service.
 
-An eventhandler has one paramenter; a data `object` which contain information relating to the event, including relevant `id's`. The `id` can be used to fetch the appropriate entity in the eventhandler.
+An eventhandler has one parameter; a data `object` which contain information relating to the event, including relevant `id's`. The `id` can be used to fetch the appropriate entity in the eventhandler.

+ 5 - 0
tsconfig.json

@@ -0,0 +1,5 @@
+{
+  "compilerOptions": {
+    "experimentalDecorators": true
+  },
+}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 642 - 611
yarn.lock


Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio