Commit Graph

42 Commits

Author SHA1 Message Date
Kasper Fabricius Kristensen f1a05f4725 feat(admin, admin-ui, medusa-js, medusa-react, medusa): Support Admin Extensions (#4761)
Co-authored-by: Rares Stefan <948623+StephixOne@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-08-17 12:14:45 +00:00
Oliver Windall Juhl 85eb12883e feat(medusa): Improve error messaging in plugin loader (#4410)
* feat(medusa): Improve error messaging in plugin loader

* Create fair-kids-tease.md

* pr comments

* pr comments
2023-06-26 13:33:40 +02:00
Adrien de Peretti 13294fff3f fix(medusa): medusa develop does not take execArgv into account properly (#4338) 2023-06-17 15:43:05 +02:00
Liam Cooper ca477c86af feat(medusa): Preserve node flags in develop command (#1860) 2023-06-14 15:26:16 +02:00
Shahed Nasser 8676ee7a2e feat(medusa,medusa-cli): Added an invite option to the create user command, and allow seeding publishable api keys (#4192)
* feat(medusa,medusa-cli): Added an invite option to the create user command

* ensure process exits for invites

* addressed PR comments

* allow seeding publishable api keys
2023-06-07 20:34:27 +02:00
Derek Wene e3cfbcd4a7 fix(medusa): migrations cli should also pull from ${plugin}/dist (#3956)
* fix(medusa): migrations should also pull from dist

* chore: add changeset
2023-05-28 12:18:42 +02:00
Oliver Windall Juhl a91987fab3 feat(medusa): Remove sqlite support (#4026) 2023-05-17 12:13:36 +02:00
Adrien de Peretti 4488ec6852 fix(medusa): Ignore categories seeding for sqlite (#3713) 2023-04-04 17:33:49 +02:00
Carlos R. L. Rodrigues 0e8b3c8efb fix stdio (#3633) 2023-03-29 19:19:18 +02:00
Carlos R. L. Rodrigues 4e9d257d3b Chore(medusa,utils,types,inventory,stock-location): remove core dependency modules (#3531) 2023-03-23 08:07:32 -03:00
Riqwan Thamir 7f2223b650 fix(medusa): fix bug with parent not being saved correctly (#3534)
What:

- Parent was being updated incorrectly because of a weird typeorm issue, making the rank pick up the wrong entity's rank. This PR fixes that issue by passing in an ID and letting the service take care of fetching the parent.

RESOLVES CORE-1274
2023-03-21 08:37:13 +00:00
Riqwan Thamir 98cad6d731 feat(medusa): seed command can create product categories (#3528)
* chore: seed command can create product categories

* chore: lint fixes

* chore: add a default value for categories
2023-03-20 19:08:52 +01:00
Carlos R. L. Rodrigues aa690beed7 feat(medusa): Modules initializer (#3352) 2023-03-17 12:18:52 -03:00
Carlos R. L. Rodrigues 77d46220c2 Feat(modules-sdk,inventory,stock-location): modules isolated connection (#3329)
* feat: scoped container for modules
2023-03-15 12:09:45 -03:00
Carlos R. L. Rodrigues 54dcc1871c feat(medusa,medusa-core-utils): graceful shutdown server (#3408)
* feat: graceful shutdown
2023-03-10 09:11:45 -03:00
Carlos R. L. Rodrigues ad7f56506f Feat(medusa,modules-sdk): Modules SDK package (#3294) 2023-02-23 13:09:35 -03:00
Riqwan Thamir 121b42acfe chore(medusa): Typeorm upgrade to 0.3.11 (#3041) 2023-02-15 16:25:30 +01:00
Carlos R. L. Rodrigues f776ed234f feat(medusa): Run shared module migrations (#3109) 2023-02-01 08:10:59 -03:00
Oliver Windall Juhl d2c692aa96 fix(medusa): Add default sales channel to product in seeding (#3013) 2023-01-13 10:01:30 +01:00
Sebastian Rindom a93d5d437c chore: star prompt (#2955)
Shows a prompt to star Medusa after killing the develop server the first time:
![CleanShot 2023-01-06 at 2 30 19](https://user-images.githubusercontent.com/7554214/211022169-8a0d753e-1628-485e-9037-0e817adf5d3f.png)

The prompt will not reappear on subsequent kills.
2023-01-06 15:12:47 +00:00
josetr 2e5ceb7950 feat(medusa): Allow custom database schema (#2819) 2022-12-20 10:04:47 +01:00
Philip Korsholm ea3d738823 Feat(medusa): config error handling in loaders (#2514)
**What**
- add error handling when loading project config

**How**
- Add error parameter to get-medusa-config result if an error was thrown (previously we returned an empty config)
- Discussion: 
A different, but equally valid approach could be just throwing the error rather than creating an error parameter. This causes a more ugly output without warnings and changes the api a bit but it would force error handling. wdyt?

**Why**
- cli would fail with database error `databaseMissingDriverError` if config was invalid, ex. missing a comma


### example (missing `,` in config)
**old output**
```
Successfully compiled 2 files with Babel (143ms).
[medusa-config] ⚠️ redis_url not found. A fake redis instance will be used.
[medusa-config] ⚠️ database_type not found. fallback to default sqlite.
info:    Using flag MEDUSA_FF_ORDER_EDITING from environment with value true
info:    Using flag MEDUSA_FF_SALES_CHANNELS from environment with value true
info:    Using flag MEDUSA_FF_TAX_INCLUSIVE_PRICING from environment with value true
info:    Using fake Redis
✔ Models initialized – 13ms
✔ Plugin models initialized – 0ms
✔ Repositories initialized – 17ms
⠋ Initializing databaseMissingDriverError: Wrong driver: "undefined" given. Supported drivers are: "aurora-data-api", "aurora-data-api-pg", "better-sqlite3", "capacitor", "cockroachdb", "cordova", "expo", "mariadb", "mongodb", "mssql", "mysql", "nativescript", "oracle", "postgres", "react-native", "sap", "sqlite", "sqljs".
```

**new output** 
```
Successfully compiled 2 files with Babel (185ms).
error:    Error in loading config: Unexpected identifier
error:    /Users/phko/projects/community/my-medusa-store/medusa-config.js:129
  plugins,
  ^^^^^^^

SyntaxError: Unexpected identifier
    at compileFunction (<anonymous>)
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1033:15)
    at Module._compile (node:internal/modules/cjs/loader:1069:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at getConfigFile (/Users/phko/projects/community/my-medusa-store/node_modules/medusa-core-utils/dist/get-config-file.js:26:20)
```
2022-11-02 18:58:02 +00:00
Carlos R. L. Rodrigues eb8034502b chore: initial commit fix linting issues (#2169)
* chore: lint fixes
2022-09-21 12:19:03 -03:00
Carlos R. L. Rodrigues 846ae637e2 fix(medusa): Hot reloading on Windows (#2105) 2022-08-29 15:46:15 +02:00
Philip Korsholm 41681b45b1 Feat(medusa): implement feature flags (#1768)
* feat: add feature flag loading in projects

* fix: make feature flag consume itself

* fix: rename container registration to featureFlagRouter

* fix: refactor

* behavioral feature flags

* add environment to server

* limit "useTemplateDb" to non feature flagged migrations

* filter migrations and entities according to those which are enabled in the environment

* run only migrations that are enabled when running 'medusa migrations run'

* add logging to the featureflag loader

* initial implementation of featureFlagEntity

* column descriptors

* initial startServerWithEnv (to be refactored)

* update commands

* final touches

* update loaders to fix unit tests

* enable all batch job tests

* update seed method

* add api test capabilities

* revert batch job test

* revert formatting changes

* pr feedback

* pr feedback

* remove unused imports

* rename feature flag decorators

* pr feedback

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2022-07-04 15:39:30 +02:00
Sebastian Rindom cffb03d197 fix(medusa): update cron schedule to be every 6 hours (#1658) 2022-06-14 14:52:27 +02:00
Adrien de Peretti 012513b6a1 feat(medusa-cli): Allow to revert migrations from the CLI (#1353) 2022-06-13 14:15:09 +02:00
Sebastian Rindom ad9cfedf04 chore: add telemetry ping (#1509)
* chore: add telemetry ping

* fix: add track and 6th hour
2022-05-28 13:58:48 +02:00
Philip Korsholm 2260c2d09e fix(medusa-cli): allow spaces in develop command (#1430) 2022-05-04 08:44:37 +02:00
Scuro Guardiano d3104bf6ac Added compiling typescript files to develop command (#1307)
Issue1281
2022-04-14 10:09:40 +02:00
Sebastian Rindom d8e531890d fix: update seeder to product published (#423) 2021-09-29 14:07:39 +02:00
Sebastian Rindom 8f60f430cc fix: add cross-spawn (#341) 2021-08-17 13:18:25 +02:00
Sebastian Rindom 1039d040e9 Add SQLite support for easy setup (#336)
* Modifies schema to allow SQLite as a DB driver. SQLite is preinstalled in most OSes allowing for minimal prerequisites in the installation process.

* Removes Redis dependency and replaces "real" redis instance with ioredis-mock this is not feature complete and errors are expected.

* Updates medusa new command to only ask for Postgres credentials if the starter template has database_type === "postgres" in medusa-config.js

* Small improvements to bin resolution

* Improvements to endpoint stability
2021-08-16 15:45:26 +02:00
Sebastian Rindom cfe19f7f9d feat: medusa-telemetry (#328)
* feat: adds a telemetry package to collect anonymous usage data

* fix: update telemetry host

* fix: adds medusa telemetry --disable

* fix: add tracking of link,login,new

* fix: interactively collect db credentials

* fix: require seed file

* fix: removes tracking from reporter
2021-08-05 12:23:05 +02:00
Sebastian Rindom f4a7138a58 feat: CLI + local linking (#313)
* fix: allow local cmd without exiting process

* fix: improves cli experience

* fix: allow running link with --develop

* test: adds snapshot testing of error logs

* chore: cleanup

* feat(medusa-cli): new command (#320)

* adds: new command

* fix: creates  command for easy project setup

* chore: deps

* chore: deps

* fix: loggin

* fix: logging

* fix: adds cli as dependency in core

* fix: consolidates CLI in medusa

* fix: use project deps medusa bin

* fix: use project deps medusa bin

* fix: use cli path

* fix: new command setup db + env vars

* fix: new command with db seed

* fix: cleanup
2021-07-26 10:09:55 +02:00
Sebastian Rindom 57a2de64b2 fix: migration dirs 2021-06-03 14:37:07 +02:00
Sebastian Rindom e764d8e465 fix: migration dirs 2021-06-03 14:29:52 +02:00
Sebastian Rindom 5136c77401 feat(cli): adds seed script 2021-06-03 10:03:44 +02:00
Sebastian Rindom 42d9a487ff fix: wip 2021-06-02 13:44:25 +02:00
Sebastian Rindom bbd2f02d54 fix: setup to allow login to Medusa Cloud 2021-04-22 18:44:55 +02:00
Sebastian Rindom f1baca3cbd Replaces MongoDB support with PostgreSQL (#151)
- All schemas have been rewritten to a relational model
- All services have been rewritten to accommodate the new data model
- Adds idempotency keys to core endpoints allowing you to retry requests with no additional side effects
- Adds staged jobs to avoid putting jobs in the queue when transactions abort
- Adds atomic transactions to all methods with access to the data layer

Co-authored-by: Oliver Windall Juhl <oliver@mrbltech.com>
2021-01-26 10:26:14 +01:00
Sebastian Rindom 4c2aec2838 Adds publish/subscribe pattern to allow plugins and projects to hook into events (#55)
Also adds CLI to ease development.
2020-05-07 13:47:27 +02:00