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

Commit

Permalink
v2.0.1 - Injectable Formatting Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisCates committed Jun 23, 2023
1 parent ac24d83 commit fd38d3a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 🛠️ CHANGELOG

## v2.0.1

- Fix injectable formatting issues

## v2.0.0

- Complete refactor to Next App Directories, review new documentation
Expand Down
4 changes: 2 additions & 2 deletions dist/src/generators/inject.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/inject.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.0.0",
"version": "2.0.1",
"private": false,
"preferGlobal": true,
"repository": "https://github.com/PrinterFramework/CLI.git",
Expand Down
4 changes: 2 additions & 2 deletions src/generators/inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ export async function inject (slice: string, component: string, opts: OptsType)
if (findMatches(newContents, DispatchMatcher).length === 0) {
const injectionLine = findMatches(newContents, functionMatcher(fileName))[0]
const tempContents = newContents.split('\n')
tempContents[injectionLine] = tempContents[injectionLine] + '\n const dispatch = useDispatch()'
tempContents[injectionLine] = tempContents[injectionLine] + '\n const dispatch = useAppDispatch()'
newContents = tempContents.join('\n')
}

if (findMatches(newContents, actionMatcher(actionInjections)).length > 0) {
newContents = newContents.replace(actionMatcher(actionInjections), `import { ${actionInjections.join(', ')} } from 'redux/slice/${slice}'`)
} else {
const tempContents = newContents.split('\n')
tempContents[0] = tempContents[0] + `\nimport { ${actionInjections.join(', ')} } from 'redux/slice/${slice}'`
tempContents[0] = tempContents[0] + `\nimport { ${actionInjections.join(', ').replaceAll(':', '')} } from 'redux/slice/${slice}'`
newContents = tempContents.join('\n')
}

Expand Down
2 changes: 1 addition & 1 deletion src/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { SuperagentTypes, injectSupergent } from './generators/superagent'
export const Printer = new Command('🖨️ Printer')

Printer
.version('2.0.0')
.version('2.0.1')
.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 fd38d3a

Please sign in to comment.