@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.
Files changed (31) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/configs/cleans/clean.conf.mjs +15 -1
  3. package/configs/lints/lint.conf.mjs +268 -79
  4. package/docs/-_utils.mjs.html +68 -18
  5. package/docs/cleans_clean.task.mjs.html +2 -2
  6. package/docs/global.html +7 -7
  7. package/docs/helps_help.task.mjs.html +7 -45
  8. package/docs/index.html +2 -2
  9. package/docs/lints_lint.task.mjs.html +6 -5
  10. package/docs/patches_patch.task.mjs.html +8 -15
  11. package/docs/quicksearch.html +1 -1
  12. package/docs/releases_release.task.mjs.html +2 -2
  13. package/docs/tests_benchmarks_compute-benchmarks.task.mjs.html +2 -2
  14. package/docs/tests_benchmarks_run-benchmarks-for-backend.task.mjs.html +2 -2
  15. package/docs/tests_benchmarks_run-benchmarks-for-frontend.task.mjs.html +14 -12
  16. package/docs/tests_bundlings_check-bundling-from-esm-files-direct.task.mjs.html +2 -2
  17. package/docs/tests_bundlings_check-bundling.task.mjs.html +2 -2
  18. package/docs/tests_run-tests.task.mjs.html +2 -2
  19. package/docs/tests_units_compute-unit-tests.task.mjs.html +3 -3
  20. package/docs/tests_units_run-unit-tests-for-backend.task.mjs.html +2 -2
  21. package/docs/tests_units_run-unit-tests-for-frontend.task.mjs.html +14 -12
  22. package/package.json +1 -1
  23. package/sources/_utils.mjs +66 -16
  24. package/sources/builds/build.task.mjs +1 -1
  25. package/sources/helps/help.task.mjs +5 -43
  26. package/sources/index.mjs +17 -17
  27. package/sources/lints/lint.task.mjs +4 -3
  28. package/sources/patches/patch.task.mjs +5 -12
  29. package/sources/tests/benchmarks/run-benchmarks-for-frontend.task.mjs +12 -10
  30. package/sources/tests/units/compute-unit-tests.task.mjs +1 -1
  31. 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.2.0 Source: tests/benchmarks/run-benchmarks-for-backend.task.mjs</title>
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.2.0</a>
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.2.0 Source: tests/benchmarks/run-benchmarks-for-frontend.task.mjs</title>
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.2.0</a>
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
- return new Promise( async ( resolve, reject ) => {
90
-
91
- const configuration = await getTaskConfigurationFor( import.meta.filename )
92
- const testRunner = await startTestRunner( {
93
- config: configuration,
94
- readCliArgs: false,
95
- readFileConfig: false,
96
- autoExitProcess: false,
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.2.0 Source: tests/bundlings/check-bundling-from-esm-files-direct.task.mjs</title>
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.2.0</a>
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.2.0 Source: tests/bundlings/check-bundling.task.mjs</title>
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.2.0</a>
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.2.0 Source: tests/run-tests.task.mjs</title>
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.2.0</a>
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.2.0 Source: tests/units/compute-unit-tests.task.mjs</title>
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.2.0</a>
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.2.0 Source: tests/units/run-unit-tests-for-backend.task.mjs</title>
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.2.0</a>
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.2.0 Source: tests/units/run-unit-tests-for-frontend.task.mjs</title>
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.2.0</a>
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
- return new Promise( async ( resolve, reject ) => {
90
-
91
- const configuration = await getTaskConfigurationFor( import.meta.filename )
92
- const testRunner = await startTestRunner( {
93
- config: configuration,
94
- readCliArgs: false,
95
- readFileConfig: false,
96
- autoExitProcess: false,
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itee/tasks",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "description": "Allow to manage all commons itee gulp tasks into one place ",
5
5
  "keywords": [
6
6
  "itee",
@@ -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: input,
459
- external: ( format === 'cjs' ) ? [
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
- if ( loc ) {
488
- process.stderr.write( `/!\\ ${ loc.file } (${ loc.line }:${ loc.column }) ${ frame } ${ message }\n` )
489
- } else {
490
- process.stderr.write( `/!\\ ${ message }\n` )
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
  }
@@ -4,7 +4,7 @@ import { basename } from 'node:path'
4
4
  import { rollup } from 'rollup'
5
5
  import {
6
6
  getTaskConfigurationFor,
7
- logLoadingTask
7
+ logLoadingTask,
8
8
  } from '../_utils.mjs'
9
9
 
10
10
  logLoadingTask( import.meta.filename )
@@ -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
- Indenter,
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 } 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 { releaseTask } from './releases/release.task.mjs'
7
- export { runTestsTask } from './tests/run-tests.task.mjs'
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 } from './tests/bundlings/check-bundling.task.mjs'
16
- export { computeBenchmarksTask } from './tests/benchmarks/compute-benchmarks.task.mjs'
17
- export { runBenchmarksTestsTask } from './tests/benchmarks/run-benchmarks.task.mjs'
18
- export { runBenchmarksForBackendTask } from './tests/benchmarks/run-benchmarks-for-backend.task.mjs'
19
- export { runBenchmarksForFrontendTask } from './tests/benchmarks/run-benchmarks-for-frontend.task.mjs'
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 from 'ansi-colors'
2
- import log from 'fancy-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
- } from 'node:fs'
7
- import { relative } from 'node:path'
8
- import { packageRootDirectory } from '../_utils.mjs'
4
+ } from 'node:fs'
5
+ import { basename } from 'node:path'
6
+ import { logLoadingTask } from '../_utils.mjs'
9
7
 
10
- const {
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 = 'patch'
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
- return new Promise( async ( resolve, reject ) => {
18
-
19
- const configuration = await getTaskConfigurationFor( import.meta.filename )
20
- const testRunner = await startTestRunner( {
21
- config: configuration,
22
- readCliArgs: false,
23
- readFileConfig: false,
24
- autoExitProcess: false,
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.'
@@ -12,11 +12,11 @@ import {
12
12
  relative
13
13
  } from 'path'
14
14
  import {
15
+ Indenter,
15
16
  createDirectoryIfNotExist,
16
17
  createFile,
17
18
  getPrettyPackageName,
18
19
  getTaskConfigurationFor,
19
- Indenter,
20
20
  logLoadingTask,
21
21
  packageName,
22
22
  packageNodeModulesDirectory,
@@ -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
- return new Promise( async ( resolve, reject ) => {
18
-
19
- const configuration = await getTaskConfigurationFor( import.meta.filename )
20
- const testRunner = await startTestRunner( {
21
- config: configuration,
22
- readCliArgs: false,
23
- readFileConfig: false,
24
- autoExitProcess: false,
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'