Skip to content

Commit

Permalink
v1.5.4 (#28)
Browse files Browse the repository at this point in the history
* deps/update

* fix/binary-target-native

* docs
  • Loading branch information
Nicolae-Rares Ailincai authored Jun 9, 2023
1 parent 848adf6 commit d231fdf
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 165 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# prisma-mapper
# @raresail/prisma-mapper

[![CodeQL](https://github.com/RaresAil/prisma-mapper/actions/workflows/codeql.yml/badge.svg?branch=master)](https://github.com/RaresAil/prisma-mapper/actions/workflows/codeql.yml)
[![Node.js CI](https://github.com/RaresAil/prisma-mapper/actions/workflows/node.js.yml/badge.svg)](https://github.com/RaresAil/prisma-mapper/actions/workflows/node.js.yml)
[![Yarn Audit CI](https://github.com/RaresAil/prisma-mapper/actions/workflows/audit.yml/badge.svg)](https://github.com/RaresAil/prisma-mapper/actions/workflows/audit.yml)

<center>

Downloads on old package naming

![NPM Package Downloads](https://badgen.net/npm/dm/prisma-mapper)

Downloads on new package naming

![NPM Package Downloads](https://badgen.net/npm/dm/@raresail/prisma-mapper
)
![NPM Package Downloads](https://badgen.net/npm/dm/@raresail/prisma-mapper)

</center>

A CLI that adds @map and @@map based on a json

Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@raresail/prisma-mapper",
"version": "1.5.3",
"version": "1.5.4",
"description": "A CLI that adds @Map, @@Map, @updatedAt based on a json or camel case for the prisma schema",
"main": "bin/index.js",
"preferGlobal": true,
Expand Down Expand Up @@ -41,27 +41,27 @@
"test": "jest"
},
"dependencies": {
"@prisma/internals": "^4.14.1",
"@prisma/internals": "^4.15.0",
"colors": "^1.4.0",
"commander": "^10.0.1",
"inquirer": "^9.2.6"
"inquirer": "^9.2.7"
},
"resolutions": {},
"devDependencies": {
"@types/inquirer": "^9.0.3",
"@types/jest": "^29.5.1",
"@types/jest": "^29.5.2",
"@types/node": "^20.2.5",
"@typescript-eslint/eslint-plugin": "^5.59.7",
"@typescript-eslint/parser": "^5.59.7",
"eslint": "^8.41.0",
"eslint-config-standard": "^17.0.0",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"eslint": "^8.42.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-security": "^1.7.1",
"jest": "^29.5.0",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"typescript": "5.0.4"
"typescript": "5.1.3"
}
}
2 changes: 1 addition & 1 deletion src/__tests__/expected-multi-schema.prisma
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
generator client {
provider = "mock"
previewFeatures = ["metrics", "multiSchema"]
binaryTargets = [env("mock"), "mock"]
binaryTargets = [env("mock"), "darwin-arm64", "debian-openssl-3.0.x"]
engineType = "mock"
output = env("mock")
}
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/expected.prisma
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
generator client {
provider = "mock"
previewFeatures = ["metrics"]
binaryTargets = [env("mock"), "mock"]
binaryTargets = ["native"]
engineType = "mock"
output = env("mock")
}
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/mock-multi-schema.prisma
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
generator client {
provider = "mock"
previewFeatures = ["metrics", "multiSchema"]
binaryTargets = [env("mock"), "mock"]
binaryTargets = [env("mock"), "darwin-arm64", "debian-openssl-3.0.x"]
engineType = "mock"
output = env("mock")
}
Expand Down
1 change: 0 additions & 1 deletion src/__tests__/mock.prisma
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
generator client {
provider = "mock"
previewFeatures = ["metrics"]
binaryTargets = [env("mock"), "mock"]
engineType = "mock"
output = env("mock")
}
Expand Down
6 changes: 5 additions & 1 deletion src/functions/deserialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,18 @@ function customPrintGeneratorConfig({

let binaryTargetsValue = '';
if (binaryTargets.length) {
const targets = binaryTargets.map((target) => {
let targets = binaryTargets.map((target) => {
if (target.fromEnvVar) {
return `env("${target.fromEnvVar}")`;
}

return `"${target.value}"`;
});

if (binaryTargets[0].native && binaryTargets.length === 1) {
targets = ['"native"'];
}

binaryTargetsValue = `binaryTargets = [${targets.join(', ')}]`;
}

Expand Down
Loading

0 comments on commit d231fdf

Please sign in to comment.