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

experimental-prisma-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

experimental-prisma-webpack-plugin - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

20

index.js

@@ -6,12 +6,14 @@ // @ts-check

// if client is bundled this gets its output path
// when client is bundled this gets its output path
// regex works both on escaped and non-escaped code
const prismaDirRegex = /\\?"?output\\?"?:\s*{(?:\\n?|\s)*\\?"?value\\?"?:(?:\\n?|\s)*\\?"(.*?)\\?",(?:\\n?|\s)*\\?"?fromEnvVar\\?"?/g
function getPrismaDir(from) {
try {
return path.dirname(require.resolve('.prisma/client', { paths: [from] }))
} catch (e) {}
async function getPrismaDir(from) {
// if we can find schema.prisma in the path, we are done
if (await fs.stat(path.join(from, 'schema.prisma')).catch(() => false)) {
return from
}
return from
// otherwise we need to find the generated prisma client
return path.dirname(require.resolve('.prisma/client', { paths: [from] }))
}

@@ -21,3 +23,3 @@

async function getPrismaFiles(from) {
const prismaDir = getPrismaDir(from)
const prismaDir = await getPrismaDir(from)
const filterRegex = /schema\.prisma|.*?engine.*?/

@@ -64,3 +66,3 @@ const prismaFiles = await fs.readdir(prismaDir)

for (const match of sourceContents.matchAll(prismaDirRegex)) {
const prismaDir = getPrismaDir(match[1])
const prismaDir = await getPrismaDir(match[1])
const prismaFiles = await getPrismaFiles(match[1])

@@ -132,2 +134,2 @@

module.exports = { PrismaPlugin }
module.exports = { PrismaPlugin }
{
"name": "experimental-prisma-webpack-plugin",
"version": "0.0.2",
"version": "0.0.3",
"description": "Ensures that your Prisma files are copied",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,2 +8,4 @@ # Experimental Prisma Webpack Plugin

```js
const { PrismaPlugin } = require('experimental-prisma-webpack-plugin')
module.exports = {

@@ -24,2 +26,4 @@ output: 'standalone',

```js
const { PrismaPlugin } = require('experimental-prisma-webpack-plugin')
module.exports = {

@@ -26,0 +30,0 @@ plugins: [new PrismaPlugin()]

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