Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
v2.1.2 - improve import definition coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisCates committed Jun 29, 2023
1 parent 4852bc9 commit 7f6b4ae
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 🛠️ CHANGELOG

## 2.1.2

- Fix `prisma` import definitions to cover all types

## 2.1.1

- Fix for `prisma` circular import definitions
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Automation Tooling for Next, Redux and Prisma

![license](https://img.shields.io/badge/license-AGPLv3-blue.svg)
![version](https://img.shields.io/badge/version-2.1.1-blue.svg)
![version](https://img.shields.io/badge/version-2.1.2-blue.svg)
[![CircleCI](https://circleci.com/gh/PrinterFramework/CLI.svg?style=svg)](https://circleci.com/gh/PrinterFramework/CLI)

**Printer v1.x.x** is compatible with the old Next patterns. You can review the documentation on the v1 website: [v1.prntr.click/docs](https://v1.prntr.click/docs)
Expand Down
6 changes: 3 additions & 3 deletions dist/src/generators/prisma.js

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

2 changes: 1 addition & 1 deletion dist/src/generators/prisma.js.map

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

2 changes: 1 addition & 1 deletion dist/src/printer.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@printerframework/cli",
"description": "🖨️ Automation Tooling for Next, Redux and Prisma.",
"version": "2.1.0",
"version": "2.1.2",
"private": false,
"preferGlobal": true,
"repository": "https://github.com/PrinterFramework/CLI.git",
Expand Down
6 changes: 3 additions & 3 deletions src/generators/prisma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ function formatModel (models: ModelType[]): ModelType[] {

if (newType === 'any' && names.includes(model.name.toUpperCase())) {
for (const model of models) {
if (type === model.type.toUpperCase().trim()) {
newType = (model.type[0].toUpperCase() + model.type.substring(1) + 'Type').replaceAll('[', '').replaceAll(']', '')
if (type.replaceAll('[]', '').replaceAll('?', '') === model.type.replaceAll('[]', '').replaceAll('?', '').toUpperCase().trim()) {
newType = (model.type[0].toUpperCase() + model.type.substring(1) + 'Type').replaceAll('[', '').replaceAll(']', '').replaceAll('?', '')
imported = true
}
}
Expand All @@ -75,7 +75,7 @@ export function generateImports (name: string, models: ModelType[]): string {
for (const model of models) {
const circularCheck = model.original.replaceAll('[]', '').replaceAll('?', '').toUpperCase()
if (model.imported && circularCheck !== name.toUpperCase()) {
const name = (model.original[0].toUpperCase() + model.original.substring(1)).replaceAll('[', '').replaceAll(']', '')
const name = (model.original[0].toUpperCase() + model.original.substring(1)).replaceAll('[', '').replaceAll(']', '').replaceAll('?', '')
output += `import ${name}Type from 'types/prisma/${name}'\n`
hasImports = true
}
Expand Down
2 changes: 1 addition & 1 deletion src/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { SuperagentTypes, injectSupergent } from './generators/superagent'
export const Printer = new Command('🖨️ Printer')

Printer
.version('2.1.1')
.version('2.1.2')
.description('🖨️ Printer: Automation Tooling for Next, Redux and Prisma.')
.option('-a, --no-action', 'do not inject actions', false)
.option('-s, --no-state', 'do not inject state', false)
Expand Down

0 comments on commit 7f6b4ae

Please sign in to comment.