Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

build test registry

vholikfd69520772c5
diff --git a/packages/registry/r/block-1.json b/packages/registry/r/block-1.json
new file mode 100644
index 000000000..96b74cb08
--- /dev/null
+++ b/packages/registry/r/block-1.json
@@ -0,0 +1,42 @@
+{
+ "$schema": "https://raw.githubusercontent.com/mercurjs/mercur/new/packages/registry/schema/registry-item.json",
+ "name": "block-1",
+ "description": "A block with a test module, product-test link, and API route.",
+ "dependencies": [],
+ "registryDependencies": [],
+ "categories": [
+ "test"
+ ],
+ "files": [
+ {
+ "path": "block-1/modules/test/index.ts",
+ "content": "import { Module } from \"@medusajs/framework/utils\"\nimport TestModuleService from \"./service\"\n\nexport const TEST_MODULE = \"test\"\n\nexport default Module(TEST_MODULE, {\n service: TestModuleService,\n})\n",
+ "type": "registry:module",
+ "target": "src/modules/test/index.ts"
+ },
+ {
+ "path": "block-1/modules/test/service.ts",
+ "content": "import { MedusaService } from \"@medusajs/framework/utils\"\nimport Test from \"./models/test\"\n\nclass TestModuleService extends MedusaService({\n Test,\n}) {}\n\nexport default TestModuleService\n",
+ "type": "registry:module",
+ "target": "src/modules/test/service.ts"
+ },
+ {
+ "path": "block-1/modules/test/models/test.ts",
+ "content": "import { model } from \"@medusajs/framework/utils\"\n\nconst Test = model.define(\"test\", {\n id: model.id().primaryKey(),\n name: model.text(),\n})\n\nexport default Test\n",
+ "type": "registry:module",
+ "target": "src/modules/test/models/test.ts"
+ },
+ {
+ "path": "block-1/links/product-test.ts",
+ "content": "import { defineLink } from \"@medusajs/framework/utils\"\nimport ProductModule from \"@medusajs/medusa/product\"\nimport TestModule from \"../modules/test\"\n\nexport default defineLink(\n ProductModule.linkable.product,\n TestModule.linkable.test\n)\n",
+ "type": "registry:link",
+ "target": "src/links/product-test.ts"
+ },
+ {
+ "path": "block-1/api/hello/test/route.ts",
+ "content": "import type { MedusaRequest, MedusaResponse } from \"@medusajs/framework/http\";\n\nexport const POST = async (req: MedusaRequest, res: MedusaResponse) => {\n res.json({\n test: true\n })\n}",
+ "type": "registry:api",
+ "target": "src/api/hello/test/route.ts"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/packages/registry/r/registry.json b/packages/registry/r/registry.json
new file mode 100644
index 000000000..dcb79c1ae
--- /dev/null
+++ b/packages/registry/r/registry.json
@@ -0,0 +1,43 @@
+{
+ "$schema": "https://raw.githubusercontent.com/mercurjs/mercur/new/packages/registry/public/schema/registry.json",
+ "name": "@mercurjs",
+ "homepage": "https://mercurjs.com",
+ "items": [
+ {
+ "name": "block-1",
+ "description": "A block with a test module, product-test link, and API route.",
+ "dependencies": [],
+ "registryDependencies": [],
+ "files": [
+ {
+ "path": "block-1/modules/test/index.ts",
+ "type": "registry:module",
+ "target": "src/modules/test/index.ts"
+ },
+ {
+ "path": "block-1/modules/test/service.ts",
+ "type": "registry:module",
+ "target": "src/modules/test/service.ts"
+ },
+ {
+ "path": "block-1/modules/test/models/test.ts",
+ "type": "registry:module",
+ "target": "src/modules/test/models/test.ts"
+ },
+ {
+ "path": "block-1/links/product-test.ts",
+ "type": "registry:link",
+ "target": "src/links/product-test.ts"
+ },
+ {
+ "path": "block-1/api/hello/test/route.ts",
+ "type": "registry:api",
+ "target": "src/api/hello/test/route.ts"
+ }
+ ],
+ "categories": [
+ "test"
+ ]
+ }
+ ]
+}
\ No newline at end of file