@itee/tasks 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/configs/cleans/clean.conf.mjs +15 -1
- package/configs/lints/lint.conf.mjs +268 -79
- package/docs/-_utils.mjs.html +68 -18
- package/docs/cleans_clean.task.mjs.html +2 -2
- package/docs/global.html +7 -7
- package/docs/helps_help.task.mjs.html +7 -45
- package/docs/index.html +2 -2
- package/docs/lints_lint.task.mjs.html +6 -5
- package/docs/patches_patch.task.mjs.html +8 -15
- package/docs/quicksearch.html +1 -1
- package/docs/releases_release.task.mjs.html +2 -2
- package/docs/tests_benchmarks_compute-benchmarks.task.mjs.html +2 -2
- package/docs/tests_benchmarks_run-benchmarks-for-backend.task.mjs.html +2 -2
- package/docs/tests_benchmarks_run-benchmarks-for-frontend.task.mjs.html +14 -12
- package/docs/tests_bundlings_check-bundling-from-esm-files-direct.task.mjs.html +2 -2
- package/docs/tests_bundlings_check-bundling.task.mjs.html +2 -2
- package/docs/tests_run-tests.task.mjs.html +2 -2
- package/docs/tests_units_compute-unit-tests.task.mjs.html +3 -3
- package/docs/tests_units_run-unit-tests-for-backend.task.mjs.html +2 -2
- package/docs/tests_units_run-unit-tests-for-frontend.task.mjs.html +14 -12
- package/package.json +1 -1
- package/sources/_utils.mjs +66 -16
- package/sources/builds/build.task.mjs +1 -1
- package/sources/helps/help.task.mjs +5 -43
- package/sources/index.mjs +17 -17
- package/sources/lints/lint.task.mjs +4 -3
- package/sources/patches/patch.task.mjs +5 -12
- package/sources/tests/benchmarks/run-benchmarks-for-frontend.task.mjs +12 -10
- package/sources/tests/units/compute-unit-tests.task.mjs +1 -1
- package/sources/tests/units/run-unit-tests-for-frontend.task.mjs +12 -10
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width">
|
|
7
|
-
<title>@itee/tasks v1.
|
|
7
|
+
<title>@itee/tasks v1.3.0 Source: tests/benchmarks/run-benchmarks-for-backend.task.mjs</title>
|
|
8
8
|
|
|
9
9
|
<!--[if lt IE 9]>
|
|
10
10
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<div class="navbar navbar-default navbar-fixed-top ">
|
|
21
21
|
<div class="container">
|
|
22
22
|
<div class="navbar-header">
|
|
23
|
-
<a class="navbar-brand" href="index.html">@itee/tasks v1.
|
|
23
|
+
<a class="navbar-brand" href="index.html">@itee/tasks v1.3.0</a>
|
|
24
24
|
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
|
|
25
25
|
<span class="icon-bar"></span>
|
|
26
26
|
<span class="icon-bar"></span>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width">
|
|
7
|
-
<title>@itee/tasks v1.
|
|
7
|
+
<title>@itee/tasks v1.3.0 Source: tests/benchmarks/run-benchmarks-for-frontend.task.mjs</title>
|
|
8
8
|
|
|
9
9
|
<!--[if lt IE 9]>
|
|
10
10
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<div class="navbar navbar-default navbar-fixed-top ">
|
|
21
21
|
<div class="container">
|
|
22
22
|
<div class="navbar-header">
|
|
23
|
-
<a class="navbar-brand" href="index.html">@itee/tasks v1.
|
|
23
|
+
<a class="navbar-brand" href="index.html">@itee/tasks v1.3.0</a>
|
|
24
24
|
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
|
|
25
25
|
<span class="icon-bar"></span>
|
|
26
26
|
<span class="icon-bar"></span>
|
|
@@ -85,16 +85,17 @@ const { red } = colors
|
|
|
85
85
|
/**
|
|
86
86
|
* @description Will run benchmarks with web-test-runner
|
|
87
87
|
*/
|
|
88
|
-
const runBenchmarksForFrontendTask
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
88
|
+
const runBenchmarksForFrontendTask = async () => {
|
|
89
|
+
|
|
90
|
+
const configuration = await getTaskConfigurationFor( import.meta.filename )
|
|
91
|
+
const testRunner = await startTestRunner( {
|
|
92
|
+
config: configuration,
|
|
93
|
+
readCliArgs: false,
|
|
94
|
+
readFileConfig: false,
|
|
95
|
+
autoExitProcess: false,
|
|
96
|
+
} )
|
|
97
|
+
|
|
98
|
+
return new Promise( ( resolve, reject ) => {
|
|
98
99
|
|
|
99
100
|
if ( !testRunner ) {
|
|
100
101
|
reject( red( 'Internal test runner error.' ) )
|
|
@@ -112,6 +113,7 @@ const runBenchmarksForFrontendTask = () => {
|
|
|
112
113
|
} )
|
|
113
114
|
|
|
114
115
|
} )
|
|
116
|
+
|
|
115
117
|
}
|
|
116
118
|
runBenchmarksForFrontendTask.displayName = basename( import.meta.filename, '.task.mjs' )
|
|
117
119
|
runBenchmarksForFrontendTask.description = 'Will run benchmarks with web-test-runner.'
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width">
|
|
7
|
-
<title>@itee/tasks v1.
|
|
7
|
+
<title>@itee/tasks v1.3.0 Source: tests/bundlings/check-bundling-from-esm-files-direct.task.mjs</title>
|
|
8
8
|
|
|
9
9
|
<!--[if lt IE 9]>
|
|
10
10
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<div class="navbar navbar-default navbar-fixed-top ">
|
|
21
21
|
<div class="container">
|
|
22
22
|
<div class="navbar-header">
|
|
23
|
-
<a class="navbar-brand" href="index.html">@itee/tasks v1.
|
|
23
|
+
<a class="navbar-brand" href="index.html">@itee/tasks v1.3.0</a>
|
|
24
24
|
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
|
|
25
25
|
<span class="icon-bar"></span>
|
|
26
26
|
<span class="icon-bar"></span>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width">
|
|
7
|
-
<title>@itee/tasks v1.
|
|
7
|
+
<title>@itee/tasks v1.3.0 Source: tests/bundlings/check-bundling.task.mjs</title>
|
|
8
8
|
|
|
9
9
|
<!--[if lt IE 9]>
|
|
10
10
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<div class="navbar navbar-default navbar-fixed-top ">
|
|
21
21
|
<div class="container">
|
|
22
22
|
<div class="navbar-header">
|
|
23
|
-
<a class="navbar-brand" href="index.html">@itee/tasks v1.
|
|
23
|
+
<a class="navbar-brand" href="index.html">@itee/tasks v1.3.0</a>
|
|
24
24
|
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
|
|
25
25
|
<span class="icon-bar"></span>
|
|
26
26
|
<span class="icon-bar"></span>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width">
|
|
7
|
-
<title>@itee/tasks v1.
|
|
7
|
+
<title>@itee/tasks v1.3.0 Source: tests/run-tests.task.mjs</title>
|
|
8
8
|
|
|
9
9
|
<!--[if lt IE 9]>
|
|
10
10
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<div class="navbar navbar-default navbar-fixed-top ">
|
|
21
21
|
<div class="container">
|
|
22
22
|
<div class="navbar-header">
|
|
23
|
-
<a class="navbar-brand" href="index.html">@itee/tasks v1.
|
|
23
|
+
<a class="navbar-brand" href="index.html">@itee/tasks v1.3.0</a>
|
|
24
24
|
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
|
|
25
25
|
<span class="icon-bar"></span>
|
|
26
26
|
<span class="icon-bar"></span>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width">
|
|
7
|
-
<title>@itee/tasks v1.
|
|
7
|
+
<title>@itee/tasks v1.3.0 Source: tests/units/compute-unit-tests.task.mjs</title>
|
|
8
8
|
|
|
9
9
|
<!--[if lt IE 9]>
|
|
10
10
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<div class="navbar navbar-default navbar-fixed-top ">
|
|
21
21
|
<div class="container">
|
|
22
22
|
<div class="navbar-header">
|
|
23
|
-
<a class="navbar-brand" href="index.html">@itee/tasks v1.
|
|
23
|
+
<a class="navbar-brand" href="index.html">@itee/tasks v1.3.0</a>
|
|
24
24
|
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
|
|
25
25
|
<span class="icon-bar"></span>
|
|
26
26
|
<span class="icon-bar"></span>
|
|
@@ -84,11 +84,11 @@ import {
|
|
|
84
84
|
relative
|
|
85
85
|
} from 'path'
|
|
86
86
|
import {
|
|
87
|
+
Indenter,
|
|
87
88
|
createDirectoryIfNotExist,
|
|
88
89
|
createFile,
|
|
89
90
|
getPrettyPackageName,
|
|
90
91
|
getTaskConfigurationFor,
|
|
91
|
-
Indenter,
|
|
92
92
|
logLoadingTask,
|
|
93
93
|
packageName,
|
|
94
94
|
packageNodeModulesDirectory,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width">
|
|
7
|
-
<title>@itee/tasks v1.
|
|
7
|
+
<title>@itee/tasks v1.3.0 Source: tests/units/run-unit-tests-for-backend.task.mjs</title>
|
|
8
8
|
|
|
9
9
|
<!--[if lt IE 9]>
|
|
10
10
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<div class="navbar navbar-default navbar-fixed-top ">
|
|
21
21
|
<div class="container">
|
|
22
22
|
<div class="navbar-header">
|
|
23
|
-
<a class="navbar-brand" href="index.html">@itee/tasks v1.
|
|
23
|
+
<a class="navbar-brand" href="index.html">@itee/tasks v1.3.0</a>
|
|
24
24
|
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
|
|
25
25
|
<span class="icon-bar"></span>
|
|
26
26
|
<span class="icon-bar"></span>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width">
|
|
7
|
-
<title>@itee/tasks v1.
|
|
7
|
+
<title>@itee/tasks v1.3.0 Source: tests/units/run-unit-tests-for-frontend.task.mjs</title>
|
|
8
8
|
|
|
9
9
|
<!--[if lt IE 9]>
|
|
10
10
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<div class="navbar navbar-default navbar-fixed-top ">
|
|
21
21
|
<div class="container">
|
|
22
22
|
<div class="navbar-header">
|
|
23
|
-
<a class="navbar-brand" href="index.html">@itee/tasks v1.
|
|
23
|
+
<a class="navbar-brand" href="index.html">@itee/tasks v1.3.0</a>
|
|
24
24
|
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
|
|
25
25
|
<span class="icon-bar"></span>
|
|
26
26
|
<span class="icon-bar"></span>
|
|
@@ -85,16 +85,17 @@ const { red } = colors
|
|
|
85
85
|
/**
|
|
86
86
|
* @description Will run unit tests with web-test-runner
|
|
87
87
|
*/
|
|
88
|
-
const runUnitTestsForFrontendTask = () => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
88
|
+
const runUnitTestsForFrontendTask = async () => {
|
|
89
|
+
|
|
90
|
+
const configuration = await getTaskConfigurationFor( import.meta.filename )
|
|
91
|
+
const testRunner = await startTestRunner( {
|
|
92
|
+
config: configuration,
|
|
93
|
+
readCliArgs: false,
|
|
94
|
+
readFileConfig: false,
|
|
95
|
+
autoExitProcess: false,
|
|
96
|
+
} )
|
|
97
|
+
|
|
98
|
+
return new Promise( ( resolve, reject ) => {
|
|
98
99
|
|
|
99
100
|
if ( !testRunner ) {
|
|
100
101
|
reject( red( 'Internal test runner error.' ) )
|
|
@@ -112,6 +113,7 @@ const runUnitTestsForFrontendTask = () => {
|
|
|
112
113
|
} )
|
|
113
114
|
|
|
114
115
|
} )
|
|
116
|
+
|
|
115
117
|
}
|
|
116
118
|
runUnitTestsForFrontendTask.displayName = basename( import.meta.filename, '.task.mjs' )
|
|
117
119
|
runUnitTestsForFrontendTask.description = 'Will run unit tests with web-test-runner'
|
package/package.json
CHANGED
package/sources/_utils.mjs
CHANGED
|
@@ -33,12 +33,13 @@ const {
|
|
|
33
33
|
yellow,
|
|
34
34
|
blue,
|
|
35
35
|
magenta,
|
|
36
|
-
cyan
|
|
36
|
+
cyan,
|
|
37
|
+
unstyle
|
|
37
38
|
} = colors
|
|
38
39
|
|
|
39
40
|
/// Debugging
|
|
40
|
-
|
|
41
|
-
const isDebugging = ( process.env.RUNNER_DEBUG && process.env.RUNNER_DEBUG === '1' )
|
|
41
|
+
/* global process */
|
|
42
|
+
const isDebugging = ( process && process.env && process.env.RUNNER_DEBUG && process.env.RUNNER_DEBUG === '1' )
|
|
42
43
|
|
|
43
44
|
/// Package paths and data
|
|
44
45
|
|
|
@@ -178,7 +179,7 @@ function createFile( filePath, fileContent ) {
|
|
|
178
179
|
|
|
179
180
|
}
|
|
180
181
|
|
|
181
|
-
function getFilesFrom( globPattern, filter = ( any ) => true ) {
|
|
182
|
+
function getFilesFrom( globPattern, filter = ( /*any*/ ) => true ) {
|
|
182
183
|
|
|
183
184
|
return glob.sync( globPattern )
|
|
184
185
|
.map( filePath => normalize( filePath ) )
|
|
@@ -393,9 +394,15 @@ function computeBannerFor( format ) {
|
|
|
393
394
|
|
|
394
395
|
}
|
|
395
396
|
|
|
396
|
-
function computeIntroFor( requestPackages ) {
|
|
397
|
+
function computeIntroFor( requestPackages = [] ) {
|
|
398
|
+
|
|
399
|
+
let intro = ''
|
|
400
|
+
|
|
401
|
+
for ( const requestPackage of requestPackages ) {
|
|
402
|
+
intro += `if( ${ requestPackage } === undefined ) { throw new Error('${ getPrettyPackageName() } need ${ requestPackage } to be defined first. Please check your scripts loading order.') }` + '\n'
|
|
403
|
+
}
|
|
397
404
|
|
|
398
|
-
return
|
|
405
|
+
return intro
|
|
399
406
|
|
|
400
407
|
}
|
|
401
408
|
|
|
@@ -455,11 +462,11 @@ function createRollupConfigs( options = undefined ) {
|
|
|
455
462
|
const outputPath = ( isProd ) ? join( output, `${ fileName }.min.${ extension }` ) : join( output, `${ fileName }.${ extension }` )
|
|
456
463
|
|
|
457
464
|
configs.push( {
|
|
458
|
-
input:
|
|
459
|
-
external:
|
|
465
|
+
input: input,
|
|
466
|
+
external: ( format === 'cjs' ) ? [
|
|
460
467
|
'fs'
|
|
461
468
|
] : [],
|
|
462
|
-
plugins:
|
|
469
|
+
plugins: [
|
|
463
470
|
replace( {
|
|
464
471
|
defines: {
|
|
465
472
|
IS_REMOVE_ON_BUILD: false,
|
|
@@ -474,7 +481,7 @@ function createRollupConfigs( options = undefined ) {
|
|
|
474
481
|
} ),
|
|
475
482
|
isProd && terser()
|
|
476
483
|
],
|
|
477
|
-
onwarn:
|
|
484
|
+
onwarn: ( {
|
|
478
485
|
loc,
|
|
479
486
|
frame,
|
|
480
487
|
message
|
|
@@ -484,11 +491,11 @@ function createRollupConfigs( options = undefined ) {
|
|
|
484
491
|
if ( message.includes( 'Circular dependency' ) ) { return }
|
|
485
492
|
if ( message.includes( 'plugin uglify is deprecated' ) ) { return }
|
|
486
493
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
494
|
+
let errorMessage = ( loc )
|
|
495
|
+
? `/!\\ ${ loc.file } (${ loc.line }:${ loc.column }) ${ frame } ${ message }\n`
|
|
496
|
+
: `/!\\ ${ message }\n`
|
|
497
|
+
|
|
498
|
+
log( red( errorMessage ) )
|
|
492
499
|
|
|
493
500
|
},
|
|
494
501
|
treeshake: treeshake,
|
|
@@ -539,7 +546,47 @@ function logLoadingTask( filename ) {
|
|
|
539
546
|
|
|
540
547
|
}
|
|
541
548
|
|
|
542
|
-
///
|
|
549
|
+
/// Text Management
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
function alignTextCenter( text, width ) {
|
|
553
|
+
|
|
554
|
+
const unstyledText = unstyle( text.repeat( 1 ) )
|
|
555
|
+
const marginLength = ( width - unstyledText.length ) / 2
|
|
556
|
+
|
|
557
|
+
let leftMargin, rightMargin
|
|
558
|
+
if ( Number.isInteger( marginLength ) ) {
|
|
559
|
+
leftMargin = marginLength
|
|
560
|
+
rightMargin = marginLength
|
|
561
|
+
} else {
|
|
562
|
+
const flooredMargin = Math.floor( marginLength )
|
|
563
|
+
leftMargin = flooredMargin
|
|
564
|
+
rightMargin = flooredMargin + 1
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
return ' '.repeat( leftMargin ) + text + ' '.repeat( rightMargin )
|
|
568
|
+
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
function alignTextLeft( text, width ) {
|
|
572
|
+
|
|
573
|
+
const unstyledText = unstyle( text.repeat( 1 ) )
|
|
574
|
+
let repeatTime = width - unstyledText.length
|
|
575
|
+
repeatTime = ( repeatTime > 0 ) ? repeatTime : 0
|
|
576
|
+
|
|
577
|
+
return text + ' '.repeat( repeatTime )
|
|
578
|
+
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
function alignTextRight( text, width ) {
|
|
582
|
+
|
|
583
|
+
const unstyledText = unstyle( text.repeat( 1 ) )
|
|
584
|
+
let repeatTime = width - unstyledText.length
|
|
585
|
+
repeatTime = ( repeatTime > 0 ) ? repeatTime : 0
|
|
586
|
+
|
|
587
|
+
return ' '.repeat( repeatTime ) + text
|
|
588
|
+
|
|
589
|
+
}
|
|
543
590
|
|
|
544
591
|
function IndenterFactory( indentationChar = '\t', indentationLevel = 5 ) {
|
|
545
592
|
|
|
@@ -638,5 +685,8 @@ export {
|
|
|
638
685
|
|
|
639
686
|
logLoadingTask,
|
|
640
687
|
|
|
688
|
+
alignTextCenter,
|
|
689
|
+
alignTextLeft,
|
|
690
|
+
alignTextRight,
|
|
641
691
|
IndenterFactory as Indenter
|
|
642
692
|
}
|
|
@@ -2,12 +2,14 @@ import colors from 'ansi-colors'
|
|
|
2
2
|
import log from 'fancy-log'
|
|
3
3
|
import { basename } from 'node:path'
|
|
4
4
|
import {
|
|
5
|
+
Indenter,
|
|
6
|
+
alignTextCenter,
|
|
7
|
+
alignTextLeft,
|
|
5
8
|
getPrettyNodeVersion,
|
|
6
9
|
getPrettyNpmVersion,
|
|
7
10
|
getPrettyPackageName,
|
|
8
11
|
getPrettyPackageVersion,
|
|
9
|
-
|
|
10
|
-
logLoadingTask
|
|
12
|
+
logLoadingTask,
|
|
11
13
|
} from '../_utils.mjs'
|
|
12
14
|
|
|
13
15
|
logLoadingTask( import.meta.filename )
|
|
@@ -18,49 +20,9 @@ const {
|
|
|
18
20
|
blue,
|
|
19
21
|
cyan,
|
|
20
22
|
yellow,
|
|
21
|
-
magenta
|
|
22
|
-
unstyle
|
|
23
|
+
magenta
|
|
23
24
|
} = colors
|
|
24
25
|
|
|
25
|
-
function alignTextCenter( text, width ) {
|
|
26
|
-
|
|
27
|
-
const unstyledText = unstyle( text.repeat( 1 ) )
|
|
28
|
-
const marginLength = ( width - unstyledText.length ) / 2
|
|
29
|
-
|
|
30
|
-
let leftMargin, rightMargin
|
|
31
|
-
if ( Number.isInteger( marginLength ) ) {
|
|
32
|
-
leftMargin = marginLength
|
|
33
|
-
rightMargin = marginLength
|
|
34
|
-
} else {
|
|
35
|
-
const flooredMargin = Math.floor( marginLength )
|
|
36
|
-
leftMargin = flooredMargin
|
|
37
|
-
rightMargin = flooredMargin + 1
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return ' '.repeat( leftMargin ) + text + ' '.repeat( rightMargin )
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function alignTextLeft( text, width ) {
|
|
45
|
-
|
|
46
|
-
const unstyledText = unstyle( text.repeat( 1 ) )
|
|
47
|
-
let repeatTime = width - unstyledText.length
|
|
48
|
-
repeatTime = ( repeatTime > 0 ) ? repeatTime : 0
|
|
49
|
-
|
|
50
|
-
return text + ' '.repeat( repeatTime )
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function alignTextRight( text, width ) {
|
|
55
|
-
|
|
56
|
-
const unstyledText = unstyle( text.repeat( 1 ) )
|
|
57
|
-
let repeatTime = width - unstyledText.length
|
|
58
|
-
repeatTime = ( repeatTime > 0 ) ? repeatTime : 0
|
|
59
|
-
|
|
60
|
-
return ' '.repeat( repeatTime ) + text
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
26
|
/**
|
|
65
27
|
* @method npm run help ( default )
|
|
66
28
|
* @global
|
package/sources/index.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export { buildTask }
|
|
2
|
-
export { cleanTask }
|
|
3
|
-
export { docTask }
|
|
4
|
-
export { helpTask }
|
|
5
|
-
export { lintTask }
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export { computeUnitTestsTask } from './tests/units/compute-unit-tests.task.mjs'
|
|
9
|
-
export { runUnitTestsTask } from './tests/units/run-unit-tests.task.mjs'
|
|
10
|
-
export { runUnitTestsForBackendTask } from './tests/units/run-unit-tests-for-backend.task.mjs'
|
|
11
|
-
export { runUnitTestsForFrontendTask } from './tests/units/run-unit-tests-for-frontend.task.mjs'
|
|
1
|
+
export { buildTask } from './builds/build.task.mjs'
|
|
2
|
+
export { cleanTask } from './cleans/clean.task.mjs'
|
|
3
|
+
export { docTask } from './docs/doc.task.mjs'
|
|
4
|
+
export { helpTask } from './helps/help.task.mjs'
|
|
5
|
+
export { lintTask } from './lints/lint.task.mjs'
|
|
6
|
+
export { runUnitTestsForBackendTask } from './tests/units/run-unit-tests-for-backend.task.mjs'
|
|
7
|
+
export { runUnitTestsForFrontendTask } from './tests/units/run-unit-tests-for-frontend.task.mjs'
|
|
12
8
|
export { checkBundlingFromEsmBuildImportTask } from './tests/bundlings/check-bundling-from-esm-build-import.task.mjs'
|
|
13
9
|
export { checkBundlingFromEsmFilesDirectTask } from './tests/bundlings/check-bundling-from-esm-files-direct.task.mjs'
|
|
14
10
|
export { checkBundlingFromEsmFilesImportTask } from './tests/bundlings/check-bundling-from-esm-files-import.task.mjs'
|
|
15
|
-
export { checkBundlingTask }
|
|
16
|
-
export { computeBenchmarksTask }
|
|
17
|
-
export { runBenchmarksTestsTask }
|
|
18
|
-
export { runBenchmarksForBackendTask }
|
|
19
|
-
export { runBenchmarksForFrontendTask }
|
|
11
|
+
export { checkBundlingTask } from './tests/bundlings/check-bundling.task.mjs'
|
|
12
|
+
export { computeBenchmarksTask } from './tests/benchmarks/compute-benchmarks.task.mjs'
|
|
13
|
+
export { runBenchmarksTestsTask } from './tests/benchmarks/run-benchmarks.task.mjs'
|
|
14
|
+
export { runBenchmarksForBackendTask } from './tests/benchmarks/run-benchmarks-for-backend.task.mjs'
|
|
15
|
+
export { runBenchmarksForFrontendTask } from './tests/benchmarks/run-benchmarks-for-frontend.task.mjs'
|
|
16
|
+
export { releaseTask } from './releases/release.task.mjs'
|
|
17
|
+
export { runTestsTask } from './tests/run-tests.task.mjs'
|
|
18
|
+
export { computeUnitTestsTask } from './tests/units/compute-unit-tests.task.mjs'
|
|
19
|
+
export { runUnitTestsTask } from './tests/units/run-unit-tests.task.mjs'
|
|
20
20
|
|
|
21
|
-
export * from './_utils.mjs'
|
|
21
|
+
export * from './_utils.mjs'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import colors
|
|
2
|
-
import log
|
|
1
|
+
import colors from 'ansi-colors'
|
|
2
|
+
import log from 'fancy-log'
|
|
3
3
|
import child_process from 'node:child_process'
|
|
4
4
|
import { basename } from 'node:path'
|
|
5
5
|
import { promisify } from 'node:util'
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
logLoadingTask( import.meta.filename )
|
|
12
12
|
|
|
13
13
|
const execFile = promisify( child_process.execFile )
|
|
14
|
-
const { red } = colors
|
|
14
|
+
const { red, cyan } = colors
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @method npm run lint
|
|
@@ -23,6 +23,7 @@ const lintTask = async ( done ) => {
|
|
|
23
23
|
try {
|
|
24
24
|
|
|
25
25
|
const configurationPath = getTaskConfigurationPathFor( import.meta.filename )
|
|
26
|
+
log( `Loading configuration from ${ cyan( configurationPath ) }` )
|
|
26
27
|
|
|
27
28
|
const { stdout } = await execFile( 'npx', [ 'eslint', '--config', configurationPath, '--fix' ] )
|
|
28
29
|
if ( stdout !== '' ) {
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import colors from 'ansi-colors'
|
|
2
|
-
import log from 'fancy-log'
|
|
3
1
|
import {
|
|
4
2
|
readFileSync,
|
|
5
3
|
writeFileSync
|
|
6
|
-
}
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
} from 'node:fs'
|
|
5
|
+
import { basename } from 'node:path'
|
|
6
|
+
import { logLoadingTask } from '../_utils.mjs'
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
green,
|
|
12
|
-
blue
|
|
13
|
-
} = colors
|
|
8
|
+
logLoadingTask( import.meta.filename )
|
|
14
9
|
|
|
15
10
|
/**
|
|
16
11
|
* @method npm run patch
|
|
@@ -36,10 +31,8 @@ const patchTask = ( done ) => {
|
|
|
36
31
|
|
|
37
32
|
done()
|
|
38
33
|
}
|
|
39
|
-
patchTask.displayName = '
|
|
34
|
+
patchTask.displayName = basename( import.meta.filename, '.task.mjs' )
|
|
40
35
|
patchTask.description = 'Will apply some patch/replacements in dependencies'
|
|
41
36
|
patchTask.flags = null
|
|
42
37
|
|
|
43
|
-
log( 'Loading ', green( relative( packageRootDirectory, import.meta.filename ) ), `with task ${ blue( patchTask.displayName ) }` )
|
|
44
|
-
|
|
45
38
|
export { patchTask }
|
|
@@ -13,16 +13,17 @@ const { red } = colors
|
|
|
13
13
|
/**
|
|
14
14
|
* @description Will run benchmarks with web-test-runner
|
|
15
15
|
*/
|
|
16
|
-
const runBenchmarksForFrontendTask
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
const runBenchmarksForFrontendTask = async () => {
|
|
17
|
+
|
|
18
|
+
const configuration = await getTaskConfigurationFor( import.meta.filename )
|
|
19
|
+
const testRunner = await startTestRunner( {
|
|
20
|
+
config: configuration,
|
|
21
|
+
readCliArgs: false,
|
|
22
|
+
readFileConfig: false,
|
|
23
|
+
autoExitProcess: false,
|
|
24
|
+
} )
|
|
25
|
+
|
|
26
|
+
return new Promise( ( resolve, reject ) => {
|
|
26
27
|
|
|
27
28
|
if ( !testRunner ) {
|
|
28
29
|
reject( red( 'Internal test runner error.' ) )
|
|
@@ -40,6 +41,7 @@ const runBenchmarksForFrontendTask = () => {
|
|
|
40
41
|
} )
|
|
41
42
|
|
|
42
43
|
} )
|
|
44
|
+
|
|
43
45
|
}
|
|
44
46
|
runBenchmarksForFrontendTask.displayName = basename( import.meta.filename, '.task.mjs' )
|
|
45
47
|
runBenchmarksForFrontendTask.description = 'Will run benchmarks with web-test-runner.'
|
|
@@ -13,16 +13,17 @@ const { red } = colors
|
|
|
13
13
|
/**
|
|
14
14
|
* @description Will run unit tests with web-test-runner
|
|
15
15
|
*/
|
|
16
|
-
const runUnitTestsForFrontendTask = () => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
const runUnitTestsForFrontendTask = async () => {
|
|
17
|
+
|
|
18
|
+
const configuration = await getTaskConfigurationFor( import.meta.filename )
|
|
19
|
+
const testRunner = await startTestRunner( {
|
|
20
|
+
config: configuration,
|
|
21
|
+
readCliArgs: false,
|
|
22
|
+
readFileConfig: false,
|
|
23
|
+
autoExitProcess: false,
|
|
24
|
+
} )
|
|
25
|
+
|
|
26
|
+
return new Promise( ( resolve, reject ) => {
|
|
26
27
|
|
|
27
28
|
if ( !testRunner ) {
|
|
28
29
|
reject( red( 'Internal test runner error.' ) )
|
|
@@ -40,6 +41,7 @@ const runUnitTestsForFrontendTask = () => {
|
|
|
40
41
|
} )
|
|
41
42
|
|
|
42
43
|
} )
|
|
44
|
+
|
|
43
45
|
}
|
|
44
46
|
runUnitTestsForFrontendTask.displayName = basename( import.meta.filename, '.task.mjs' )
|
|
45
47
|
runUnitTestsForFrontendTask.description = 'Will run unit tests with web-test-runner'
|