Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amplication/plugin-db-mongo

Package Overview
Dependencies
Maintainers
7
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplication/plugin-db-mongo - npm Package Compare versions

Comparing version 1.2.8 to 1.2.9

1

dist/src/index.d.ts

@@ -7,2 +7,3 @@ import { AmplicationPlugin, CreatePrismaSchemaParams, CreateServerDockerComposeDBParams, CreateServerDockerComposeParams, CreateServerDotEnvParams, CreateServerPackageJsonParams, CreateServerParams, DsgContext, Entity, Events, LoadStaticFilesParams, Module } from "@amplication/code-gen-types";

beforeCreateServerDotEnv(context: DsgContext, eventParams: CreateServerDotEnvParams): CreateServerDotEnvParams;
afterCreateServerDockerCompose(dsgContext: DsgContext, eventParams: CreateServerDockerComposeParams, modules: Module[]): Module[];
beforeCreateServerDockerCompose(context: DsgContext, eventParams: CreateServerDockerComposeParams): CreateServerDockerComposeParams;

@@ -9,0 +10,0 @@ beforeCreateServerDockerComposeDB(context: DsgContext, eventParams: CreateServerDockerComposeDBParams): CreateServerDockerComposeDBParams;

7

package.json
{
"name": "@amplication/plugin-db-mongo",
"version": "1.2.8",
"version": "1.2.9",
"description": "Use a Mongo database in a service generated by Amplication",

@@ -35,3 +35,4 @@ "main": "dist/index.js",

"webpack": "^5.75.0",
"webpack-cli": "^5.0.1"
"webpack-cli": "^5.0.1",
"yaml": "^2.2.1"
},

@@ -54,2 +55,2 @@ "jest": {

}
}
}
import { CreateServerDockerComposeParams } from "@amplication/code-gen-types";
import { DataSource, DataSourceProvider } from "prisma-schema-dsl-types";
const mongodbVolumeName = "mongodb";
export const updateDockerComposeProperties: CreateServerDockerComposeParams["updateProperties"] =

@@ -20,21 +22,7 @@ [

},
volumes: ["mongodb:/var/lib/mongosql/data"],
healthcheck: {
test: [
"CMD",
"pg_isready",
"-q",
"-d",
"${DB_DB_NAME}",
"-U",
"${DB_USER}",
],
timeout: "45s",
interval: "10s",
retries: 10,
},
volumes: [`${mongodbVolumeName}:/var/lib/mongosql/data`],
},
},
volumes: {
mongo: null,
[mongodbVolumeName]: null,
},

@@ -41,0 +29,0 @@ },

@@ -30,2 +30,3 @@ import {

import { dataSource, updateDockerComposeProperties } from "./constants";
import YAML from "yaml";

@@ -43,2 +44,3 @@ class MongoPlugin implements AmplicationPlugin {

before: this.beforeCreateServerDockerCompose,
after: this.afterCreateServerDockerCompose,
},

@@ -129,2 +131,19 @@ CreateServerDockerComposeDB: {

afterCreateServerDockerCompose(
dsgContext: DsgContext,
eventParams: CreateServerDockerComposeParams,
modules: Module[]
): Module[] {
const dockerCompose = modules[0];
const dockerComposeObject: { services: { migrate: { depends_on: any } } } =
YAML.parse(dockerCompose.code);
try {
dockerComposeObject.services.migrate.depends_on = undefined;
} catch (error) {}
const updatedDockerCompose = YAML.stringify(dockerComposeObject, {
nullStr: "~",
});
modules[0] = { ...dockerCompose, code: updatedDockerCompose };
return modules;
}
beforeCreateServerDockerCompose(

@@ -131,0 +150,0 @@ context: DsgContext,

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc