Skip to content

Commit

Permalink
feat: Bump @prisma/prisma-fmt-wasm to 3.8.0. (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
avocadowastaken authored Jan 11, 2022
1 parent 448d166 commit 48586cb
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 40 deletions.
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
. "$(dirname "$0")/_/husky.sh"

npm run lint
npx tsc
16 changes: 13 additions & 3 deletions lib/plugin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

/** @type { import("prettier").Plugin<{ text: string }> } */
/** @type {import("prettier").Plugin<{ text: string }>} */
module.exports = {
languages: [
{
Expand All @@ -27,10 +27,20 @@ module.exports = {

printers: {
"prisma-ast": {
print(path) {
print(path, options) {
const { format } = require("@prisma/prisma-fmt-wasm");
const { text } = path.getValue();
return format(text);
const params = JSON.stringify({
textDocument: {
uri: new URL(`file://${options.filepath}`),
},
options: {
tabSize: options.tabWidth,
insertSpaces: !options.useTabs,
},
});

return format(text, params);
},
},
},
Expand Down
64 changes: 32 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"scripts": {
"lint": "prettier . --check",
"prepare": "husky install",
"prerelease": "npm i && npm run lint && npx tsc",
"prerelease": "npm ci && npm run lint && npx tsc",
"release": "np --no-2fa",
"tdd": "jest --watch",
"test": "jest"
Expand All @@ -25,15 +25,15 @@
"*": "prettier --write --ignore-unknown"
},
"dependencies": {
"@prisma/prisma-fmt-wasm": "3.7.0-31.8746e055198f517658c08a0c426c7eec87f5a85f"
"@prisma/prisma-fmt-wasm": "3.8.0-43.34df67547cf5598f5a6cd3eb45f14ee70c3fb86f"
},
"devDependencies": {
"@types/jest": "27.0.3",
"@types/jest": "27.4.0",
"@types/prettier": "2.4.2",
"@umidbekk/configs": "0.1.0",
"husky": "7.0.4",
"jest": "27.4.5",
"lint-staged": "12.1.4",
"jest": "27.4.7",
"lint-staged": "12.1.7",
"np": "7.6.0",
"prettier": "2.5.1",
"prettier-plugin-packagejson": "2.2.15",
Expand Down

0 comments on commit 48586cb

Please sign in to comment.