Skip to content

Commit

Permalink
fix: Improve logging for arm64 macos users. Force version 5 prisma to…
Browse files Browse the repository at this point in the history
… match prisma generator helper
  • Loading branch information
keonik committed Jul 17, 2023
1 parent 1034a9f commit 872d6a2
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 109 deletions.
191 changes: 88 additions & 103 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@
"@babel/preset-env": "^7.22.9",
"@babel/preset-typescript": "^7.22.5",
"@semantic-release/commit-analyzer": "^10.0.1",
"@semantic-release/github": "^9.0.3",
"@semantic-release/github": "^9.0.4",
"@semantic-release/npm": "^10.0.4",
"@semantic-release/release-notes-generator": "^11.0.4",
"@types/jest": "^29.5.3",
"all-contributors-cli": "^6.26.1",
"babel-jest": "^29.6.1",
"concurrently": "^8.2.0",
"jest": "^29.6.1",
"prettier": "2.8.8",
"prisma": "^4.0.0 || ^5.0.0",
"prettier": "3.0.0",
"prisma": "^5.0.0",
"puppeteer": "^20.8.2",
"semantic-release": "^21.0.7",
"standard-version": "^9.5.0",
Expand All @@ -119,7 +119,7 @@
},
"dependencies": {
"@mermaid-js/mermaid-cli": "^10.2.4",
"@prisma/generator-helper": "^4.0.0 || ^5.0.0",
"@prisma/generator-helper": "^5.0.0",
"dotenv": "^16.3.1"
},
"peerDependencies": {
Expand Down
5 changes: 3 additions & 2 deletions src/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,12 @@ export default async (options: GeneratorOptions) => {
const tempPuppeteerConfigFile = path.resolve(
path.join(tmpDir, 'puppeteerConfig.json')
);
const executablePath = '/usr/bin/chromium-browser';
let puppeteerConfigJson: PuppeteerConfiguration & {
args: string[];
} = {
logLevel: debug ? 'warn' : 'error',
executablePath: '/usr/bin/chromium-browser',
executablePath,
args: ['--no-sandbox'],
};
// if MacOS M1/M2, provide your own path to chromium
Expand All @@ -499,7 +500,7 @@ export default async (options: GeneratorOptions) => {
} catch (error) {
console.error(error);
console.log(
'\n\nUnable to find chromium path for you MacOS arm64 machine. Attempting to use the default.\n\n'
`\nPrisma ERD Generator: Unable to find chromium path for you MacOS arm64 machine. Attempting to use the default at ${executablePath}. To learn more visit https://github.com/keonik/prisma-erd-generator#-arm64-users-\n`
);
}
}
Expand Down

0 comments on commit 872d6a2

Please sign in to comment.