-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ const plugins = [ | |
3\. Run the following command in the directory of the Medusa backend to run the migrations: | ||
|
||
```bash | ||
medusa migrations run | ||
npx medusa migrations run | ||
``` | ||
|
||
--- | ||
|
@@ -95,17 +95,17 @@ Below you can find the [plugin development guide](#plugin-development) that will | |
|
||
Follow these step-by-step instructions to run the project locally: | ||
|
||
1. `git clone https://github.com/Agilo/medusa-bundles.git` - clone the monorepo | ||
2. `cd medusa-bundles` - position into the project directory | ||
1. `git clone https://github.com/Agilo/medusa-plugin-bundles.git` - clone the monorepo | ||
2. `cd medusa-plugin-bundles` - position into the project directory | ||
3. `cp .env.example .env` - set up docker-compose environment variables | ||
4. `docker compose up` - start Medusa Docker containers | ||
5. Open a new terminal tab | ||
6. `yarn install && yarn run setup` - install dependencies in all packages | ||
7. `cd dev/medusa && medusa migrations run && cd ../..` - run the migrations | ||
7. `cd dev/medusa && npx medusa migrations run && cd ../..` - run the migrations | ||
8. `cd dev/medusa && yarn run seed:medusa-plugin-bundles && cd ../..` - seed the database | ||
9. `yarn run start` - build the packages and start the Medusa dev server and plugin watcher | ||
|
||
Medusa Admin is now available at http://localhost:7001 and Medusa Storefront at http://localhost:8000 | ||
Medusa Admin is now available at http://localhost:7001 and Medusa Bundles admin screen is available at http://localhost:7001/a/bundles | ||
|
||
Default credentials for Medusa Admin are: | ||
|
||
|
@@ -114,6 +114,11 @@ [email protected] | |
supersecret | ||
``` | ||
|
||
Medusa Storefront is available at http://localhost:8000 | ||
|
||
- http://localhost:8000/bundles - example bundle listing page | ||
- http://localhost:8000/bundles/medusa-winter-outfit - example bundle detail page | ||
|
||
Once you have the project running locally you can start making changes to the plugin in `medusa-plugin-bundles/src` and see them reflected in the Medusa Admin and Storefront. | ||
|
||
#### Generating migrations | ||
|
@@ -124,7 +129,7 @@ Unfortunately DX when generating migrations which extend or relate to core entit | |
2. `cp medusa-plugin-bundles/.env.example medusa-plugin-bundles/.env` - copy and edit environment variables | ||
3. Edit/create migration files in `medusa-plugin-bundles/src/migrations` | ||
4. `npx typeorm migration:generate -d datasource.js src/migrations/BundleUpdate` - this will generate a migration file with a bunch of migrations in `src/migrations/<timestamp>-BundleUpdate.ts`, the migration file will contain migrations for both core medusa entities and your plugin entities. You can now cherry pick the migrations you want to run and delete the rest. | ||
5. In the `dev/medusa` dir run `medusa migrations run` | ||
5. In the `dev/medusa` dir run `npx medusa migrations run` | ||
|
||
#### Available Commands | ||
|
||
|