Skip to content

Commit

Permalink
Merge pull request #9 from dangchinh25/cle/fix/support-newer-node
Browse files Browse the repository at this point in the history
Cle/fix/support newer node
  • Loading branch information
dangchinh25 authored Nov 4, 2023
2 parents ea81962 + 2c8ac6e commit 322d94e
Show file tree
Hide file tree
Showing 33 changed files with 315 additions and 690 deletions.
File renamed without changes.
6 changes: 2 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
node-version:
- 16.x
- 18.x
os:
- ubuntu-latest
steps:
Expand All @@ -32,7 +32,6 @@ jobs:
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Run Tests 🧪
working-directory: ./packages/generator
run: pnpm run test
Publish:
runs-on: ubuntu-latest
Expand All @@ -44,7 +43,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 18.x
registry-url: https://registry.npmjs.org
- name: Setup PNPM
uses: pnpm/[email protected]
Expand All @@ -57,7 +56,6 @@ jobs:
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Publish 🚀
working-directory: ./packages/generator
run: npx semantic-release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ npm install prisma-models-graph

```prisma
generator jsonSchema {
provider = "npx prisma-models-graph"
provider = "prisma-models-graph"
}
```

Expand All @@ -35,7 +35,7 @@ generator jsonSchema {

- Add custom relation annotation next to the field you want annotate relationship.
- Format: `/// [[<Relation Model>.<Relation Model Attribute>]]`
<img src='packages/generator/assets/annotation.png'>
<img src='./assets/annotation.png'>

- With the above annotation, the generated models graph will be like this:
<img src='packages/generator/assets/output.png'>
<img src='./assets/output.png'>
File renamed without changes
File renamed without changes
1 change: 0 additions & 1 deletion packages/generator/jest.config.js → jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
Expand Down
77 changes: 75 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,81 @@
{
"devDependencies": {
"husky": "7.0.4"
"name": "prisma-models-graph",
"description": "Generates a bi-directional models graph for schema without strict relationship",
"version": "1.1.6",
"license": "MIT",
"bin": "./dist/generator.js",
"engines": {
"node": ">=14.0"
},
"scripts": {
"start": "node dist/bin.js",
"dev": "npx tsc -w",
"build": "npx tsc",
"prepack": "yarn build",
"test": "jest",
"lint": "eslint --fix .",
"prepare": "husky install"
},
"dependencies": {
"@prisma/client": "^5.2.0",
"@prisma/generator-helper": "^5.2.0",
"@prisma/internals": "^5.2.0",
"prisma": "^5.2.0",
"prettier": "3.0.3"
},
"devDependencies": {
"@types/jest": "^29.5.2",
"@types/node": "^20.4.0",
"jest": "^29.6.1",
"ts-jest": "^29.1.1",
"typescript": "^5.1.6",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"semantic-release": "^18.0.1",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"@typescript-eslint/typescript-estree": "^5.61.0",
"eslint": "^8.44.0",
"eslint-plugin-jest": "^27.2.2",
"eslint-plugin-jest-formatting": "^3.1.0",
"husky": "7.0.4"
},
"homepage": "https://github.com/dangchinh25/prisma-models-graph",
"repository": {
"type": "git",
"url": "https://github.com/dangchinh25/prisma-models-graph"
},
"author": "Chinh Le [email protected]",
"keywords": [
"prisma",
"prisma2",
"generator"
],
"release": {
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json"
],
"message": "chore(release): set `package.json` to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
}
41 changes: 0 additions & 41 deletions packages/generator/README.md

This file was deleted.

82 changes: 0 additions & 82 deletions packages/generator/package.json

This file was deleted.

This file was deleted.

34 changes: 0 additions & 34 deletions packages/generator/tsconfig.json

This file was deleted.

3 changes: 0 additions & 3 deletions packages/usage/index.ts

This file was deleted.

20 changes: 0 additions & 20 deletions packages/usage/package.json

This file was deleted.

Loading

0 comments on commit 322d94e

Please sign in to comment.