Skip to content

Commit

Permalink
fix prettier codemods and CLI failing test; revert glob v8 PR (redwoo…
Browse files Browse the repository at this point in the history
…djs#5295)

* Revert "fix(deps): update dependency glob to v8 (redwoodjs#5181)"

This reverts commit 2b2fcf3.

* update test parser config

* fix lint warning

* cleanup fixture in CLI test
  • Loading branch information
thedavidprice authored Apr 22, 2022
1 parent db1bb11 commit fec7f0c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ describe('editable columns', () => {
tests: true,
nestScaffoldByModel: true,
})
form = files[
path.normalize(
'/path/to/project/web/src/components/ExcludeDefault/ExcludeDefaultForm/ExcludeDefaultForm.js'
)
]
form =
files[
path.normalize(
'/path/to/project/web/src/components/ExcludeDefault/ExcludeDefaultForm/ExcludeDefaultForm.js'
)
]
})

test('includes String fields with a default string', async () => {
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/lib/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,7 @@ describe('usingVSCode', () => {
const output = index.usingVSCode()

expect(output).toEqual(true)

fs.rmdirSync(path.join(BASE_PATH, '.vscode'))
})
})
6 changes: 5 additions & 1 deletion packages/codemods/src/testUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ import fs from 'fs'
import path from 'path'

import { format } from 'prettier'
import parserBabel from 'prettier/parser-babel'
import tempy from 'tempy'

export const formatCode = (code: string) => {
return format(code, { parser: 'babel-ts' })
return format(code, {
parser: 'babel-ts',
plugins: [parserBabel],
})
}

export const createProjectMock = () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"fast-glob": "3.2.11",
"findup-sync": "5.0.0",
"fs-extra": "10.1.0",
"glob": "8.0.1",
"glob": "7.2.0",
"graphql": "16.3.0",
"kill-port": "1.6.1",
"prettier": "2.6.2",
Expand Down
18 changes: 2 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6194,7 +6194,7 @@ __metadata:
fast-glob: 3.2.11
findup-sync: 5.0.0
fs-extra: 10.1.0
glob: 8.0.1
glob: 7.2.0
graphql: 16.3.0
graphql-tag: 2.12.6
jest: 27.5.1
Expand Down Expand Up @@ -17260,21 +17260,7 @@ __metadata:
languageName: node
linkType: hard

"glob@npm:8.0.1":
version: 8.0.1
resolution: "glob@npm:8.0.1"
dependencies:
fs.realpath: ^1.0.0
inflight: ^1.0.4
inherits: 2
minimatch: ^5.0.1
once: ^1.3.0
path-is-absolute: ^1.0.0
checksum: 5886928f2a2797c6109670c18750a67b8f99b398aa2f029f0b92dec2fb8b8cdc92c57b6410cf8998e75a18d2ffee38d918f9060a5dbc82d9cc34059b2de72f1f
languageName: node
linkType: hard

"glob@npm:^7.0.0, glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.2.0":
"glob@npm:7.2.0, glob@npm:^7.0.0, glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.2.0":
version: 7.2.0
resolution: "glob@npm:7.2.0"
dependencies:
Expand Down

0 comments on commit fec7f0c

Please sign in to comment.