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
a4ff1329
Commit
a4ff1329
authored
Sep 03, 2024
by
Janka Uryga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci: enable typescript in some CI scripts
parent
8eba6007
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
repo-setup.js
.github/actions/next-stats-action/src/prepare/repo-setup.js
+5
-2
run-tests.js
run-tests.js
+15
-2
create-next-install.js
test/lib/create-next-install.js
+2
-0
No files found.
.github/actions/next-stats-action/src/prepare/repo-setup.js
View file @
a4ff1329
// @ts-check
const
path
=
require
(
'path'
)
const
path
=
require
(
'path'
)
const
fs
=
require
(
'fs'
)
const
fs
=
require
(
'fs'
)
const
{
existsSync
}
=
require
(
'fs'
)
const
{
existsSync
}
=
require
(
'fs'
)
...
@@ -102,7 +103,9 @@ module.exports = (actionInfo) => {
...
@@ -102,7 +103,9 @@ module.exports = (actionInfo) => {
continue
continue
}
}
const
packageJson
=
JSON
.
parse
(
fs
.
readFileSync
(
packageJsonPath
))
const
packageJson
=
JSON
.
parse
(
fs
.
readFileSync
(
packageJsonPath
,
'utf-8'
)
)
const
{
name
:
packageName
}
=
packageJson
const
{
name
:
packageName
}
=
packageJson
pkgDatas
.
set
(
packageName
,
{
pkgDatas
.
set
(
packageName
,
{
...
@@ -196,7 +199,7 @@ module.exports = (actionInfo) => {
...
@@ -196,7 +199,7 @@ module.exports = (actionInfo) => {
return
packingSpan
return
packingSpan
.
traceChild
(
'handle-package'
,
{
packageName
})
.
traceChild
(
'handle-package'
,
{
packageName
})
.
traceAsyncFn
(
async
(
handlePackageSpan
)
=>
{
.
traceAsyncFn
(
async
(
handlePackageSpan
)
=>
{
/** @type {null | (
) => Promise<void>
} */
/** @type {null | (
() => Promise<void>)
} */
let
cleanup
=
null
let
cleanup
=
null
if
(
packageName
===
'@next/swc'
)
{
if
(
packageName
===
'@next/swc'
)
{
...
...
run-tests.js
View file @
a4ff1329
// @ts-check
const
os
=
require
(
'os'
)
const
os
=
require
(
'os'
)
const
path
=
require
(
'path'
)
const
path
=
require
(
'path'
)
const
_glob
=
require
(
'glob'
)
const
_glob
=
require
(
'glob'
)
...
@@ -5,7 +6,12 @@ const { existsSync } = require('fs')
...
@@ -5,7 +6,12 @@ const { existsSync } = require('fs')
const
fsp
=
require
(
'fs/promises'
)
const
fsp
=
require
(
'fs/promises'
)
const
nodeFetch
=
require
(
'node-fetch'
)
const
nodeFetch
=
require
(
'node-fetch'
)
const
vercelFetch
=
require
(
'@vercel/fetch'
)
const
vercelFetch
=
require
(
'@vercel/fetch'
)
const
fetch
=
vercelFetch
(
nodeFetch
)
/** @type {import('@vercel/fetch').Fetch} */
const
fetch
=
// @ts-expect-error: TS doesn't understand default exports
vercelFetch
(
nodeFetch
)
const
{
promisify
}
=
require
(
'util'
)
const
{
promisify
}
=
require
(
'util'
)
const
{
Sema
}
=
require
(
'async-sema'
)
const
{
Sema
}
=
require
(
'async-sema'
)
const
{
spawn
,
exec
:
execOrig
}
=
require
(
'child_process'
)
const
{
spawn
,
exec
:
execOrig
}
=
require
(
'child_process'
)
...
@@ -16,6 +22,7 @@ const core = require('@actions/core')
...
@@ -16,6 +22,7 @@ const core = require('@actions/core')
const
{
getTestFilter
}
=
require
(
'./test/get-test-filter'
)
const
{
getTestFilter
}
=
require
(
'./test/get-test-filter'
)
const
mockSpan
=
require
(
'./.github/actions/next-stats-action/src/util/mock-trace'
)
const
mockSpan
=
require
(
'./.github/actions/next-stats-action/src/util/mock-trace'
)
// @ts-expect-error: missing type declarations for yargs
let
argv
=
require
(
'yargs/yargs'
)(
process
.
argv
.
slice
(
2
))
let
argv
=
require
(
'yargs/yargs'
)(
process
.
argv
.
slice
(
2
))
.
string
(
'type'
)
.
string
(
'type'
)
.
string
(
'test-pattern'
)
.
string
(
'test-pattern'
)
...
@@ -313,6 +320,7 @@ async function main() {
...
@@ -313,6 +320,7 @@ async function main() {
const
groupTotal
=
parseInt
(
groupParts
[
1
],
10
)
const
groupTotal
=
parseInt
(
groupParts
[
1
],
10
)
if
(
prevTimings
)
{
if
(
prevTimings
)
{
/** @type {TestFile[][]} */
const
groups
=
[[]]
const
groups
=
[[]]
const
groupTimes
=
[
0
]
const
groupTimes
=
[
0
]
...
@@ -459,7 +467,9 @@ ${ENDGROUP}`)
...
@@ -459,7 +467,9 @@ ${ENDGROUP}`)
// Format the output of junit report to include the test name
// Format the output of junit report to include the test name
// For the debugging purpose to compare actual run list to the generated reports
// For the debugging purpose to compare actual run list to the generated reports
// [NOTE]: This won't affect if junit reporter is not enabled
// [NOTE]: This won't affect if junit reporter is not enabled
JEST_JUNIT_OUTPUT_NAME
:
test
.
file
.
replaceAll
(
'/'
,
'_'
),
JEST_JUNIT_OUTPUT_NAME
:
// @ts-expect-error missing lib: es2021
test
.
file
.
replaceAll
(
'/'
,
'_'
),
// Specify suite name for the test to avoid unexpected merging across different env / grouped tests
// Specify suite name for the test to avoid unexpected merging across different env / grouped tests
// This is not individual suites name (corresponding 'describe'), top level suite name which have redundant names by default
// This is not individual suites name (corresponding 'describe'), top level suite name which have redundant names by default
// [NOTE]: This won't affect if junit reporter is not enabled
// [NOTE]: This won't affect if junit reporter is not enabled
...
@@ -546,9 +556,12 @@ ${ENDGROUP}`)
...
@@ -546,9 +556,12 @@ ${ENDGROUP}`)
}
}
outputSema.release()
outputSema.release()
}
}
const err = new Error(
const err = new Error(
code ? `
failed
with
code
:
$
{
code
}
` : `
failed
with
signal
:
$
{
signal
}
`
code ? `
failed
with
code
:
$
{
code
}
` : `
failed
with
signal
:
$
{
signal
}
`
)
)
// @ts-expect-error
err
.
output
=
outputChunks
err
.
output
=
outputChunks
.
map
(({
chunk
})
=>
chunk
.
toString
())
.
map
(({
chunk
})
=>
chunk
.
toString
())
.
join
(
''
)
.
join
(
''
)
...
...
test/lib/create-next-install.js
View file @
a4ff1329
// @ts-check
const
os
=
require
(
'os'
)
const
os
=
require
(
'os'
)
const
path
=
require
(
'path'
)
const
path
=
require
(
'path'
)
const
execa
=
require
(
'execa'
)
const
execa
=
require
(
'execa'
)
...
@@ -117,6 +118,7 @@ async function createNextInstall({
...
@@ -117,6 +118,7 @@ async function createNextInstall({
.
traceAsyncFn
((
span
)
=>
.
traceAsyncFn
((
span
)
=>
linkPackages
({
linkPackages
({
repoDir
:
tmpRepoDir
,
repoDir
:
tmpRepoDir
,
nextSwcVersion
:
null
,
parentSpan
:
span
,
parentSpan
:
span
,
})
})
)
)
...
...
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