Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
5276321a
Unverified
Commit
5276321a
authored
Oct 07, 2024
by
Jiachi Liu
Committed by
GitHub
Oct 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codemod: extend ignore pattern list (#70906)
parent
8b347b63
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
run-jscodeshift.ts
packages/next-codemod/lib/run-jscodeshift.ts
+14
-1
index.ts
...es/next-codemod/transforms/lib/async-request-api/index.ts
+0
-5
No files found.
packages/next-codemod/lib/run-jscodeshift.ts
View file @
5276321a
...
@@ -9,7 +9,20 @@ export default function runJscodeshift(
...
@@ -9,7 +9,20 @@ export default function runJscodeshift(
// we run jscodeshift in the same process to be able to
// we run jscodeshift in the same process to be able to
// share state between the main CRA transform and sub-transforms
// share state between the main CRA transform and sub-transforms
return
Runner
.
run
(
transformerPath
,
files
,
{
return
Runner
.
run
(
transformerPath
,
files
,
{
ignorePattern
:
[
'**/node_modules/**'
,
'**/.next/**'
,
'**/build/**'
],
ignorePattern
:
[
'**/node_modules/**'
,
'**/.next/**'
,
'**/build/**'
,
// type files
'**/*.d.ts'
,
'**/*.d.cts'
,
'**/*.d.mts'
,
// test files
'**/*.test.*'
,
'**/*.spec.*'
,
'**/__tests__/**'
,
'**/__mocks__/**'
,
],
extensions
:
'tsx,ts,jsx,js'
,
extensions
:
'tsx,ts,jsx,js'
,
parser
:
'tsx'
,
parser
:
'tsx'
,
verbose
:
2
,
verbose
:
2
,
...
...
packages/next-codemod/transforms/lib/async-request-api/index.ts
View file @
5276321a
...
@@ -3,11 +3,6 @@ import { transformDynamicProps } from './next-async-dynamic-prop'
...
@@ -3,11 +3,6 @@ import { transformDynamicProps } from './next-async-dynamic-prop'
import
{
transformDynamicAPI
}
from
'./next-async-dynamic-api'
import
{
transformDynamicAPI
}
from
'./next-async-dynamic-api'
export
default
function
transform
(
file
:
FileInfo
,
api
:
API
)
{
export
default
function
transform
(
file
:
FileInfo
,
api
:
API
)
{
const
filePath
=
file
.
path
// if it's node_modules or types file, skip
if
(
/node_modules/
.
test
(
filePath
)
||
/
\.
d
\.(
m|c
)?
ts$/
.
test
(
filePath
))
{
return
file
.
source
}
const
transforms
=
[
transformDynamicProps
,
transformDynamicAPI
]
const
transforms
=
[
transformDynamicProps
,
transformDynamicAPI
]
return
transforms
.
reduce
<
string
>
((
source
,
transformFn
)
=>
{
return
transforms
.
reduce
<
string
>
((
source
,
transformFn
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment