docs: shorten npx commands (#4652)
This commit is contained in:
@@ -111,7 +111,7 @@ npm run seed
|
||||
|
||||
This directory holds the transpiled Medusa backend customizations. This directory may not be available when you first install the Medusa backend. It’ll be available when you run the `build` command or start your Medusa backend with the `dev` command.
|
||||
|
||||
The files under this directory are the files that are used in your Medusa backend. So, when you make any changes under `src`, make sure the changes are transpiled into the `dist` directory. If you’re using the `dev` or `@medusajs/medusa-cli develop` commands, this is handled automatically whenever changes occur under the `src` directory.
|
||||
The files under this directory are the files that are used in your Medusa backend. So, when you make any changes under `src`, make sure the changes are transpiled into the `dist` directory. If you’re using the `dev` or `medusa develop` commands, this is handled automatically whenever changes occur under the `src` directory.
|
||||
|
||||
### node_modules
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ Make sure your PostgreSQL server is running before you run the Medusa backend.
|
||||
|
||||
```bash noReport
|
||||
cd my-medusa-store
|
||||
medusa develop # or npx @medusajs/medusa-cli develop
|
||||
medusa develop # or npx medusa develop
|
||||
```
|
||||
|
||||
After these three steps and in only a couple of minutes, you now have a complete commerce engine running locally. You can test it out by sending a request using a tool like Postman or through the command line:
|
||||
@@ -121,7 +121,7 @@ For better testing, you can add demo data to your Medusa backend by running the
|
||||
|
||||
```bash
|
||||
medusa seed --seed-file=data/seed.json
|
||||
# or npx @medusajs/medusa-cli seed --seed-file=data/seed.json
|
||||
# or npx medusa seed --seed-file=data/seed.json
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -279,7 +279,7 @@ npm run build
|
||||
This section covers how to test and use your batch job strategy. Make sure to start your backend first:
|
||||
|
||||
```bash
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
You must also use an authenticated user to send batch job requests. You can refer to the [authentication guide in the API reference](/api/admin/#section/Authentication) for more details.
|
||||
|
||||
2
docs/content/development/cache/create.md
vendored
2
docs/content/development/cache/create.md
vendored
@@ -253,7 +253,7 @@ You can also add any necessary options to the module. The options added in the e
|
||||
Then, to test the module, run the Medusa backend which also runs your module:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -64,7 +64,7 @@ This registers the in-memory cache module as the main cache service to use. You
|
||||
To test the module, run the following command to start the Medusa backend:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
The backend should then start with no errors, indicating that the module was installed successfully.
|
||||
|
||||
@@ -82,7 +82,7 @@ Other available options include:
|
||||
To test the module, run the following command to start the Medusa backend:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
If the module was installed successfully, you should see the following message in the logs:
|
||||
|
||||
@@ -360,7 +360,7 @@ The `productService` has a `count` method that returns a Promise. This Promi
|
||||
|
||||
## Building Files
|
||||
|
||||
Custom endpoints must be transpiled and moved to the `dist` directory before you can start consuming them. When you run your backend using either the `medusa develop` or `npx @medusajs/medusa-cli develop` commands, it watches the files under `src` for any changes, then triggers the `build` command and restarts the server.
|
||||
Custom endpoints must be transpiled and moved to the `dist` directory before you can start consuming them. When you run your backend using either the `medusa develop` or `npx medusa develop` commands, it watches the files under `src` for any changes, then triggers the `build` command and restarts the server.
|
||||
|
||||
The build isn't triggered though when the backend first starts running. So, make sure to run the `build` command before starting the backend:
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ npm run build
|
||||
Then, run your backend with the following command:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
If you try accessing the endpoints you added the middleware to, you should see your implementation working as expected.
|
||||
|
||||
@@ -77,7 +77,7 @@ To test out your extended validator, build and start your Medusa backend:
|
||||
|
||||
```bash npm2yarn
|
||||
npm run build
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
Then, send a request to the endpoint you extended passing it your custom fields. To test out the example in this guide, send an [authenticated request](/api/admin#section/Authentication) to the [Create Product endpoint](https://docs.medusajs.com/api/admin#tag/Products/operation/PostProducts) and pass it the `custom_field` body parameter. The request should execute with no errors.
|
||||
|
||||
@@ -123,7 +123,7 @@ npm run build
|
||||
Then, run the `migration` command:
|
||||
|
||||
```bash
|
||||
npx @medusajs/medusa-cli migrations run
|
||||
npx medusa migrations run
|
||||
```
|
||||
|
||||
You should see that your migration have executed.
|
||||
|
||||
@@ -109,7 +109,7 @@ npm run build
|
||||
Then, run the following command to migrate your changes to the database:
|
||||
|
||||
```bash
|
||||
npx @medusajs/medusa-cli migrations run
|
||||
npx medusa migrations run
|
||||
```
|
||||
|
||||
You should see that your migration was executed, which means your changes were reflected in the database schema.
|
||||
|
||||
@@ -125,7 +125,7 @@ npm run build
|
||||
Then, run the following command to start your backend:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
You should see your custom implementation working as expected.
|
||||
|
||||
@@ -90,7 +90,7 @@ npm run build
|
||||
The last step is to run the migration with the command detailed earlier
|
||||
|
||||
```bash
|
||||
npx @medusajs/medusa-cli migrations run
|
||||
npx medusa migrations run
|
||||
```
|
||||
|
||||
If you check your database now you should see that the change defined by the migration has been applied successfully.
|
||||
|
||||
@@ -32,7 +32,7 @@ Migrations are used to apply changes to the database schema. However, there are
|
||||
Using the Medusa CLI tool, you can run migrations with the following command:
|
||||
|
||||
```bash
|
||||
npx @medusajs/medusa-cli migrations run
|
||||
npx medusa migrations run
|
||||
```
|
||||
|
||||
This will check for any migrations that contain changes to your database schema that aren't applied yet and run them on your backend.
|
||||
|
||||
@@ -248,7 +248,7 @@ You can also add any necessary options to the module.
|
||||
Then, to test the module, run the Medusa backend which also runs your module:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -58,7 +58,7 @@ This registers the local events module as the main events service to use. This m
|
||||
To test the module, run the following command to start the Medusa backend:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
If the module was installed successfully, you should see the following message in the logs:
|
||||
|
||||
@@ -85,7 +85,7 @@ Other available options include:
|
||||
To test the module, run the following command to start the Medusa backend:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
If the module was installed successfully, you should see the following message in the logs:
|
||||
|
||||
@@ -59,7 +59,7 @@ For example, if the value of the environment variable is set to `false`, but the
|
||||
As feature flags generally include adding new entities or making changes to entities in the database, you must run the migrations after enabling the feature flag:
|
||||
|
||||
```bash
|
||||
npx @medusajs/medusa-cli migrations run
|
||||
npx medusa migrations run
|
||||
```
|
||||
|
||||
:::info
|
||||
|
||||
@@ -397,7 +397,7 @@ This section explains how to test out your implementation if the file service wa
|
||||
Run your backend to test it out:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
Then, try uploading a file, for example, using the [Upload File endpoint](/api/admin#tag/Uploads/operation/PostUploads). The file should be uploaded based on the logic you’ve implemented.
|
||||
|
||||
@@ -80,7 +80,7 @@ This section explains how to test out the loader if it’s created in the Medusa
|
||||
Run the following command to start the Medusa backend:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
Your loader script should run on the Medusa backend startup. If you logged a message in the console, similar to the example above, you should see it in the console.
|
||||
|
||||
@@ -293,7 +293,7 @@ The `resources` property can have one of the following values:
|
||||
Finally, to test your module, run the following command:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
This starts the Medusa backend and runs your module as part of it.
|
||||
|
||||
@@ -306,7 +306,7 @@ npm run build
|
||||
Next, start your Medusa backend:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
Try now to place an order either using the [REST APIs](/api/store) or using the storefront.
|
||||
|
||||
@@ -146,7 +146,7 @@ npm run build
|
||||
Then, run the following command to start your Medusa backend:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
If the scheduled job was registered successfully, you should see a message similar to this logged on your Medusa backend:
|
||||
|
||||
@@ -403,7 +403,7 @@ This section explains how to test out your implementation if the search service
|
||||
Run your backend to test it out:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
You can then send a request to the [Search Products endpoint](/api/store#tag/Products/operation/PostProductsSearch) to see if your search service returns any results.
|
||||
|
||||
@@ -83,7 +83,7 @@ npm run build
|
||||
Then, start the backend:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
You should see the customizations you made in effect.
|
||||
|
||||
@@ -73,7 +73,7 @@ npm run build
|
||||
Run your backend to test it out:
|
||||
|
||||
```bash npm2yarn
|
||||
npx @medusajs/medusa-cli develop
|
||||
npx medusa develop
|
||||
```
|
||||
|
||||
You can test now whether your strategy is working by performing the actions that run your strategy.
|
||||
|
||||
Reference in New Issue
Block a user