@itee/tasks 1.3.0 → 1.3.2
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 +14 -0
- package/docs/-_utils.mjs.html +68 -18
- package/docs/cleans_clean.task.mjs.html +10 -11
- package/docs/global.html +17 -173
- package/docs/helps_help.task.mjs.html +23 -59
- package/docs/index.html +4 -4
- package/docs/lints_lint.task.mjs.html +15 -12
- package/docs/patches_patch.task.mjs.html +14 -12
- package/docs/quicksearch.html +1 -1
- package/docs/releases_release.task.mjs.html +5 -5
- package/docs/tests_benchmarks_compute-benchmarks.task.mjs.html +35 -38
- package/docs/tests_benchmarks_run-benchmarks-for-backend.task.mjs.html +20 -18
- package/docs/tests_benchmarks_run-benchmarks-for-frontend.task.mjs.html +21 -23
- package/docs/tests_bundlings_check-bundling-from-esm-files-direct.task.mjs.html +22 -34
- package/docs/tests_bundlings_check-bundling.task.mjs.html +5 -5
- package/docs/tests_run-tests.task.mjs.html +5 -5
- package/docs/tests_units_compute-unit-tests.task.mjs.html +40 -42
- package/docs/tests_units_run-unit-tests-for-backend.task.mjs.html +21 -19
- package/docs/tests_units_run-unit-tests-for-frontend.task.mjs.html +21 -23
- package/package.json +4 -4
- package/{sources → scripts}/refresh.mjs +10 -12
- package/sources/builds/build.conf.mjs +3 -0
- package/sources/builds/build.task.mjs +11 -13
- package/{configs → sources}/cleans/clean.conf.mjs +1 -1
- package/sources/cleans/clean.task.mjs +6 -7
- package/{configs → sources}/docs/doc.conf.mjs +8 -7
- package/sources/docs/doc.task.mjs +7 -8
- package/sources/helps/help.task.mjs +18 -54
- package/{configs → sources}/lints/lint.conf.mjs +50 -18
- package/sources/lints/lint.task.mjs +11 -8
- package/sources/patches/patch.task.mjs +9 -7
- package/sources/releases/release.task.mjs +1 -1
- package/sources/tasks.js +26 -0
- package/sources/tests/benchmarks/compute-benchmarks.conf.mjs +5 -0
- package/sources/tests/benchmarks/compute-benchmarks.task.mjs +31 -34
- package/sources/tests/benchmarks/run-benchmarks-for-backend.task.mjs +16 -14
- package/{configs → sources}/tests/benchmarks/run-benchmarks-for-frontend.conf.mjs +6 -6
- package/sources/tests/benchmarks/run-benchmarks-for-frontend.task.mjs +17 -19
- package/{configs → sources}/tests/benchmarks/run-benchmarks.conf.mjs +2 -2
- package/sources/tests/benchmarks/run-benchmarks.task.mjs +3 -3
- package/{configs → sources}/tests/bundlings/check-bundling-from-esm-build-import.conf.mjs +12 -10
- package/sources/tests/bundlings/check-bundling-from-esm-build-import.task.mjs +17 -17
- package/{configs → sources}/tests/bundlings/check-bundling-from-esm-files-direct.conf.mjs +20 -14
- package/sources/tests/bundlings/check-bundling-from-esm-files-direct.task.mjs +17 -29
- package/{configs → sources}/tests/bundlings/check-bundling-from-esm-files-import.conf.mjs +15 -13
- package/sources/tests/bundlings/check-bundling-from-esm-files-import.task.mjs +17 -29
- package/sources/tests/bundlings/check-bundling.task.mjs +1 -1
- package/sources/tests/run-tests.task.mjs +1 -1
- package/sources/tests/units/compute-unit-tests.conf.mjs +5 -0
- package/sources/tests/units/compute-unit-tests.task.mjs +36 -38
- package/sources/tests/units/run-unit-tests-for-backend.task.mjs +17 -15
- package/{configs → sources}/tests/units/run-unit-tests-for-frontend.conf.mjs +1 -1
- package/sources/tests/units/run-unit-tests-for-frontend.task.mjs +17 -19
- package/{configs → sources}/tests/units/run-unit-tests.conf.mjs +2 -2
- package/sources/tests/units/run-unit-tests.task.mjs +3 -3
- package/sources/utils/builds.mjs +238 -0
- package/sources/utils/colors.mjs +19 -0
- package/sources/utils/files.mjs +70 -0
- package/sources/utils/loggings.mjs +33 -0
- package/sources/utils/packages.mjs +172 -0
- package/sources/utils/tasks.mjs +170 -0
- package/sources/utils/texts.mjs +98 -0
- package/configs/builds/build.conf.mjs +0 -3
- package/configs/tests/benchmarks/compute-benchmarks.conf.mjs +0 -5
- package/configs/tests/units/compute-unit-tests.conf.mjs +0 -5
- package/sources/_utils.mjs +0 -642
- package/sources/index.mjs +0 -21
- /package/{configs → scripts}/refresh.conf.mjs +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width">
|
|
7
|
-
<title
|
|
7
|
+
<title>Itee Tasks v1.3.1 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"
|
|
23
|
+
<a class="navbar-brand" href="index.html">Itee Tasks v1.3.1</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>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<li class="dropdown">
|
|
34
34
|
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
|
|
35
35
|
<ul class="dropdown-menu inline">
|
|
36
|
-
<li><a href="global.html#checkBundlingFromEsmFilesDirectTask">checkBundlingFromEsmFilesDirectTask</a></li><li><a href="global.html#checkBundlingTask">checkBundlingTask</a></li><li><a href="global.html#computeBenchmarksTask">computeBenchmarksTask</a></li><li><a href="global.html#computeUnitTestsTask">computeUnitTestsTask</a></li><li><a href="global.html#
|
|
36
|
+
<li><a href="global.html#checkBundlingFromEsmFilesDirectTask">checkBundlingFromEsmFilesDirectTask</a></li><li><a href="global.html#checkBundlingTask">checkBundlingTask</a></li><li><a href="global.html#computeBenchmarksTask">computeBenchmarksTask</a></li><li><a href="global.html#computeUnitTestsTask">computeUnitTestsTask</a></li><li><a href="global.html#npmrunclean">npm run clean</a></li><li><a href="global.html#npmrunhelpdefault">npm run help ( default )</a></li><li><a href="global.html#npmrunlint">npm run lint</a></li><li><a href="global.html#npmrunpatch">npm run patch</a></li><li><a href="global.html#npmrunrelease">npm run release</a></li><li><a href="global.html#npmruntest">npm run test</a></li><li><a href="global.html#runBenchmarksForBackendTask">runBenchmarksForBackendTask</a></li><li><a href="global.html#runBenchmarksForFrontendTask">runBenchmarksForFrontendTask</a></li><li><a href="global.html#runUnitTestsForBackendTask">runUnitTestsForBackendTask</a></li><li><a href="global.html#runUnitTestsForFrontendTask">runUnitTestsForFrontendTask</a></li>
|
|
37
37
|
</ul>
|
|
38
38
|
</li>
|
|
39
39
|
|
|
@@ -70,31 +70,28 @@
|
|
|
70
70
|
<section>
|
|
71
71
|
<article>
|
|
72
72
|
<pre
|
|
73
|
-
class="sunlight-highlight-javascript linenums">import { startTestRunner }
|
|
74
|
-
import
|
|
75
|
-
import {
|
|
76
|
-
import {
|
|
77
|
-
|
|
78
|
-
logLoadingTask
|
|
79
|
-
} from '../../_utils.mjs'
|
|
73
|
+
class="sunlight-highlight-javascript linenums">import { startTestRunner } from '@web/test-runner'
|
|
74
|
+
import { basename } from 'node:path'
|
|
75
|
+
import { red } from '../../utils/colors.mjs'
|
|
76
|
+
import { logLoadingTask } from '../../utils/loggings.mjs'
|
|
77
|
+
import { getTaskConfigurationFor } from '../../utils/tasks.mjs'
|
|
80
78
|
|
|
81
79
|
logLoadingTask( import.meta.filename )
|
|
82
80
|
|
|
83
|
-
const { red } = colors
|
|
84
|
-
|
|
85
81
|
/**
|
|
86
82
|
* @description Will run benchmarks with web-test-runner
|
|
87
83
|
*/
|
|
88
|
-
const runBenchmarksForFrontendTask = () => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
84
|
+
const runBenchmarksForFrontendTask = async () => {
|
|
85
|
+
|
|
86
|
+
const configuration = await getTaskConfigurationFor( import.meta.filename )
|
|
87
|
+
const testRunner = await startTestRunner( {
|
|
88
|
+
config: configuration,
|
|
89
|
+
readCliArgs: false,
|
|
90
|
+
readFileConfig: false,
|
|
91
|
+
autoExitProcess: false,
|
|
92
|
+
} )
|
|
93
|
+
|
|
94
|
+
return new Promise( ( resolve, reject ) => {
|
|
98
95
|
|
|
99
96
|
if ( !testRunner ) {
|
|
100
97
|
reject( red( 'Internal test runner error.' ) )
|
|
@@ -112,6 +109,7 @@ const runBenchmarksForFrontendTask = () => {
|
|
|
112
109
|
} )
|
|
113
110
|
|
|
114
111
|
} )
|
|
112
|
+
|
|
115
113
|
}
|
|
116
114
|
runBenchmarksForFrontendTask.displayName = basename( import.meta.filename, '.task.mjs' )
|
|
117
115
|
runBenchmarksForFrontendTask.description = 'Will run benchmarks with web-test-runner.'
|
|
@@ -156,7 +154,7 @@ export { runBenchmarksForFrontendTask }</pre>
|
|
|
156
154
|
|
|
157
155
|
|
|
158
156
|
<span class="copyright">
|
|
159
|
-
Copyright 2015-Present <a href="https://github.com/Itee">Itee
|
|
157
|
+
Copyright 2015-Present <a href="https://github.com/Itee">Itee (Tristan Valcke)</a>
|
|
160
158
|
</span>
|
|
161
159
|
|
|
162
160
|
<span class="jsdoc-message">
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width">
|
|
7
|
-
<title
|
|
7
|
+
<title>Itee Tasks v1.3.1 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"
|
|
23
|
+
<a class="navbar-brand" href="index.html">Itee Tasks v1.3.1</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>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<li class="dropdown">
|
|
34
34
|
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
|
|
35
35
|
<ul class="dropdown-menu inline">
|
|
36
|
-
<li><a href="global.html#checkBundlingFromEsmFilesDirectTask">checkBundlingFromEsmFilesDirectTask</a></li><li><a href="global.html#checkBundlingTask">checkBundlingTask</a></li><li><a href="global.html#computeBenchmarksTask">computeBenchmarksTask</a></li><li><a href="global.html#computeUnitTestsTask">computeUnitTestsTask</a></li><li><a href="global.html#
|
|
36
|
+
<li><a href="global.html#checkBundlingFromEsmFilesDirectTask">checkBundlingFromEsmFilesDirectTask</a></li><li><a href="global.html#checkBundlingTask">checkBundlingTask</a></li><li><a href="global.html#computeBenchmarksTask">computeBenchmarksTask</a></li><li><a href="global.html#computeUnitTestsTask">computeUnitTestsTask</a></li><li><a href="global.html#npmrunclean">npm run clean</a></li><li><a href="global.html#npmrunhelpdefault">npm run help ( default )</a></li><li><a href="global.html#npmrunlint">npm run lint</a></li><li><a href="global.html#npmrunpatch">npm run patch</a></li><li><a href="global.html#npmrunrelease">npm run release</a></li><li><a href="global.html#npmruntest">npm run test</a></li><li><a href="global.html#runBenchmarksForBackendTask">runBenchmarksForBackendTask</a></li><li><a href="global.html#runBenchmarksForFrontendTask">runBenchmarksForFrontendTask</a></li><li><a href="global.html#runUnitTestsForBackendTask">runUnitTestsForBackendTask</a></li><li><a href="global.html#runUnitTestsForFrontendTask">runUnitTestsForFrontendTask</a></li>
|
|
37
37
|
</ul>
|
|
38
38
|
</li>
|
|
39
39
|
|
|
@@ -70,36 +70,35 @@
|
|
|
70
70
|
<section>
|
|
71
71
|
<article>
|
|
72
72
|
<pre
|
|
73
|
-
class="sunlight-highlight-javascript linenums">import
|
|
74
|
-
import log from 'fancy-log'
|
|
75
|
-
import {
|
|
73
|
+
class="sunlight-highlight-javascript linenums">import {
|
|
76
74
|
existsSync,
|
|
77
75
|
rmSync
|
|
78
|
-
}
|
|
79
|
-
import { glob } from 'glob'
|
|
76
|
+
} from 'node:fs'
|
|
80
77
|
import {
|
|
81
78
|
basename,
|
|
82
79
|
dirname,
|
|
83
80
|
extname,
|
|
84
|
-
join
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
import {
|
|
81
|
+
join
|
|
82
|
+
} from 'node:path'
|
|
83
|
+
import { rollup } from 'rollup'
|
|
84
|
+
import {
|
|
85
|
+
green,
|
|
86
|
+
magenta,
|
|
87
|
+
red,
|
|
88
|
+
} from '../../utils/colors.mjs'
|
|
89
|
+
import { getJavascriptSourceFiles } from '../../utils/files.mjs'
|
|
90
|
+
import {
|
|
91
|
+
log,
|
|
92
|
+
logLoadingTask
|
|
93
|
+
} from '../../utils/loggings.mjs'
|
|
88
94
|
import {
|
|
89
|
-
getTaskConfigurationFor,
|
|
90
|
-
logLoadingTask,
|
|
91
95
|
packageSourcesDirectory,
|
|
92
96
|
packageTestsBundlesDirectory
|
|
93
|
-
}
|
|
97
|
+
} from '../../utils/packages.mjs'
|
|
98
|
+
import { getTaskConfigurationFor } from '../../utils/tasks.mjs'
|
|
94
99
|
|
|
95
100
|
logLoadingTask( import.meta.filename )
|
|
96
101
|
|
|
97
|
-
const {
|
|
98
|
-
red,
|
|
99
|
-
green,
|
|
100
|
-
magenta,
|
|
101
|
-
} = colors
|
|
102
|
-
|
|
103
102
|
/**
|
|
104
103
|
* @description In view to detect bundling side effects this task will
|
|
105
104
|
* create intermediary file for each individual export from this package
|
|
@@ -115,18 +114,7 @@ const checkBundlingFromEsmFilesDirectTask = async ( done ) => {
|
|
|
115
114
|
}
|
|
116
115
|
|
|
117
116
|
const configuration = await getTaskConfigurationFor( import.meta.filename )
|
|
118
|
-
|
|
119
|
-
// Get source files to process
|
|
120
|
-
const pattern = join( packageSourcesDirectory, '**' )
|
|
121
|
-
const sourceFiles = glob.sync( pattern )
|
|
122
|
-
.map( filePath => normalize( filePath ) )
|
|
123
|
-
.filter( filePath => {
|
|
124
|
-
const fileName = basename( filePath )
|
|
125
|
-
const isJsFile = fileName.endsWith( '.js' )
|
|
126
|
-
const isNotPrivateFile = !fileName.startsWith( '_' )
|
|
127
|
-
const isNotIgnoredFile = !configuration.ignoredFiles.includes( fileName )
|
|
128
|
-
return isJsFile && isNotPrivateFile && isNotIgnoredFile
|
|
129
|
-
} )
|
|
117
|
+
const sourceFiles = getJavascriptSourceFiles( configuration )
|
|
130
118
|
|
|
131
119
|
for ( let sourceFile of sourceFiles ) {
|
|
132
120
|
|
|
@@ -202,7 +190,7 @@ export { checkBundlingFromEsmFilesDirectTask }</pre>
|
|
|
202
190
|
|
|
203
191
|
|
|
204
192
|
<span class="copyright">
|
|
205
|
-
Copyright 2015-Present <a href="https://github.com/Itee">Itee
|
|
193
|
+
Copyright 2015-Present <a href="https://github.com/Itee">Itee (Tristan Valcke)</a>
|
|
206
194
|
</span>
|
|
207
195
|
|
|
208
196
|
<span class="jsdoc-message">
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width">
|
|
7
|
-
<title
|
|
7
|
+
<title>Itee Tasks v1.3.1 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"
|
|
23
|
+
<a class="navbar-brand" href="index.html">Itee Tasks v1.3.1</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>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<li class="dropdown">
|
|
34
34
|
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
|
|
35
35
|
<ul class="dropdown-menu inline">
|
|
36
|
-
<li><a href="global.html#checkBundlingFromEsmFilesDirectTask">checkBundlingFromEsmFilesDirectTask</a></li><li><a href="global.html#checkBundlingTask">checkBundlingTask</a></li><li><a href="global.html#computeBenchmarksTask">computeBenchmarksTask</a></li><li><a href="global.html#computeUnitTestsTask">computeUnitTestsTask</a></li><li><a href="global.html#
|
|
36
|
+
<li><a href="global.html#checkBundlingFromEsmFilesDirectTask">checkBundlingFromEsmFilesDirectTask</a></li><li><a href="global.html#checkBundlingTask">checkBundlingTask</a></li><li><a href="global.html#computeBenchmarksTask">computeBenchmarksTask</a></li><li><a href="global.html#computeUnitTestsTask">computeUnitTestsTask</a></li><li><a href="global.html#npmrunclean">npm run clean</a></li><li><a href="global.html#npmrunhelpdefault">npm run help ( default )</a></li><li><a href="global.html#npmrunlint">npm run lint</a></li><li><a href="global.html#npmrunpatch">npm run patch</a></li><li><a href="global.html#npmrunrelease">npm run release</a></li><li><a href="global.html#npmruntest">npm run test</a></li><li><a href="global.html#runBenchmarksForBackendTask">runBenchmarksForBackendTask</a></li><li><a href="global.html#runBenchmarksForFrontendTask">runBenchmarksForFrontendTask</a></li><li><a href="global.html#runUnitTestsForBackendTask">runUnitTestsForBackendTask</a></li><li><a href="global.html#runUnitTestsForFrontendTask">runUnitTestsForFrontendTask</a></li>
|
|
37
37
|
</ul>
|
|
38
38
|
</li>
|
|
39
39
|
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
<pre
|
|
73
73
|
class="sunlight-highlight-javascript linenums">import { series } from 'gulp'
|
|
74
74
|
import { basename } from 'node:path'
|
|
75
|
-
import { logLoadingTask } from '../../
|
|
75
|
+
import { logLoadingTask } from '../../utils/loggings.mjs'
|
|
76
76
|
import { checkBundlingFromEsmBuildImportTask } from './check-bundling-from-esm-build-import.task.mjs'
|
|
77
77
|
import { checkBundlingFromEsmFilesDirectTask } from './check-bundling-from-esm-files-direct.task.mjs'
|
|
78
78
|
import { checkBundlingFromEsmFilesImportTask } from './check-bundling-from-esm-files-import.task.mjs'
|
|
@@ -133,7 +133,7 @@ export { checkBundlingTask }
|
|
|
133
133
|
|
|
134
134
|
|
|
135
135
|
<span class="copyright">
|
|
136
|
-
Copyright 2015-Present <a href="https://github.com/Itee">Itee
|
|
136
|
+
Copyright 2015-Present <a href="https://github.com/Itee">Itee (Tristan Valcke)</a>
|
|
137
137
|
</span>
|
|
138
138
|
|
|
139
139
|
<span class="jsdoc-message">
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width">
|
|
7
|
-
<title
|
|
7
|
+
<title>Itee Tasks v1.3.1 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"
|
|
23
|
+
<a class="navbar-brand" href="index.html">Itee Tasks v1.3.1</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>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<li class="dropdown">
|
|
34
34
|
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
|
|
35
35
|
<ul class="dropdown-menu inline">
|
|
36
|
-
<li><a href="global.html#checkBundlingFromEsmFilesDirectTask">checkBundlingFromEsmFilesDirectTask</a></li><li><a href="global.html#checkBundlingTask">checkBundlingTask</a></li><li><a href="global.html#computeBenchmarksTask">computeBenchmarksTask</a></li><li><a href="global.html#computeUnitTestsTask">computeUnitTestsTask</a></li><li><a href="global.html#
|
|
36
|
+
<li><a href="global.html#checkBundlingFromEsmFilesDirectTask">checkBundlingFromEsmFilesDirectTask</a></li><li><a href="global.html#checkBundlingTask">checkBundlingTask</a></li><li><a href="global.html#computeBenchmarksTask">computeBenchmarksTask</a></li><li><a href="global.html#computeUnitTestsTask">computeUnitTestsTask</a></li><li><a href="global.html#npmrunclean">npm run clean</a></li><li><a href="global.html#npmrunhelpdefault">npm run help ( default )</a></li><li><a href="global.html#npmrunlint">npm run lint</a></li><li><a href="global.html#npmrunpatch">npm run patch</a></li><li><a href="global.html#npmrunrelease">npm run release</a></li><li><a href="global.html#npmruntest">npm run test</a></li><li><a href="global.html#runBenchmarksForBackendTask">runBenchmarksForBackendTask</a></li><li><a href="global.html#runBenchmarksForFrontendTask">runBenchmarksForFrontendTask</a></li><li><a href="global.html#runUnitTestsForBackendTask">runUnitTestsForBackendTask</a></li><li><a href="global.html#runUnitTestsForFrontendTask">runUnitTestsForFrontendTask</a></li>
|
|
37
37
|
</ul>
|
|
38
38
|
</li>
|
|
39
39
|
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
<pre
|
|
73
73
|
class="sunlight-highlight-javascript linenums">import { series } from 'gulp'
|
|
74
74
|
import { basename } from 'node:path'
|
|
75
|
-
import { logLoadingTask } from '../
|
|
75
|
+
import { logLoadingTask } from '../utils/loggings.mjs'
|
|
76
76
|
import { runBenchmarksTestsTask } from './benchmarks/run-benchmarks.task.mjs'
|
|
77
77
|
import { runUnitTestsTask } from './units/run-unit-tests.task.mjs'
|
|
78
78
|
|
|
@@ -130,7 +130,7 @@ export { runTestsTask }</pre>
|
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
<span class="copyright">
|
|
133
|
-
Copyright 2015-Present <a href="https://github.com/Itee">Itee
|
|
133
|
+
Copyright 2015-Present <a href="https://github.com/Itee">Itee (Tristan Valcke)</a>
|
|
134
134
|
</span>
|
|
135
135
|
|
|
136
136
|
<span class="jsdoc-message">
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width">
|
|
7
|
-
<title
|
|
7
|
+
<title>Itee Tasks v1.3.1 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"
|
|
23
|
+
<a class="navbar-brand" href="index.html">Itee Tasks v1.3.1</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>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<li class="dropdown">
|
|
34
34
|
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
|
|
35
35
|
<ul class="dropdown-menu inline">
|
|
36
|
-
<li><a href="global.html#checkBundlingFromEsmFilesDirectTask">checkBundlingFromEsmFilesDirectTask</a></li><li><a href="global.html#checkBundlingTask">checkBundlingTask</a></li><li><a href="global.html#computeBenchmarksTask">computeBenchmarksTask</a></li><li><a href="global.html#computeUnitTestsTask">computeUnitTestsTask</a></li><li><a href="global.html#
|
|
36
|
+
<li><a href="global.html#checkBundlingFromEsmFilesDirectTask">checkBundlingFromEsmFilesDirectTask</a></li><li><a href="global.html#checkBundlingTask">checkBundlingTask</a></li><li><a href="global.html#computeBenchmarksTask">computeBenchmarksTask</a></li><li><a href="global.html#computeUnitTestsTask">computeUnitTestsTask</a></li><li><a href="global.html#npmrunclean">npm run clean</a></li><li><a href="global.html#npmrunhelpdefault">npm run help ( default )</a></li><li><a href="global.html#npmrunlint">npm run lint</a></li><li><a href="global.html#npmrunpatch">npm run patch</a></li><li><a href="global.html#npmrunrelease">npm run release</a></li><li><a href="global.html#npmruntest">npm run test</a></li><li><a href="global.html#runBenchmarksForBackendTask">runBenchmarksForBackendTask</a></li><li><a href="global.html#runBenchmarksForFrontendTask">runBenchmarksForFrontendTask</a></li><li><a href="global.html#runUnitTestsForBackendTask">runUnitTestsForBackendTask</a></li><li><a href="global.html#runUnitTestsForFrontendTask">runUnitTestsForFrontendTask</a></li>
|
|
37
37
|
</ul>
|
|
38
38
|
</li>
|
|
39
39
|
|
|
@@ -70,39 +70,43 @@
|
|
|
70
70
|
<section>
|
|
71
71
|
<article>
|
|
72
72
|
<pre
|
|
73
|
-
class="sunlight-highlight-javascript linenums">import
|
|
74
|
-
import childProcess
|
|
75
|
-
import log from 'fancy-log'
|
|
76
|
-
import { glob } from 'glob'
|
|
77
|
-
import { isNotEmptyArray } from 'itee-validators'
|
|
73
|
+
class="sunlight-highlight-javascript linenums">import { isNotEmptyArray } from 'itee-validators'
|
|
74
|
+
import childProcess from 'node:child_process'
|
|
78
75
|
import {
|
|
79
76
|
basename,
|
|
80
77
|
dirname,
|
|
81
78
|
extname,
|
|
82
79
|
join,
|
|
83
|
-
normalize,
|
|
84
80
|
relative
|
|
85
|
-
}
|
|
81
|
+
} from 'node:path'
|
|
82
|
+
import {
|
|
83
|
+
red,
|
|
84
|
+
yellow
|
|
85
|
+
} from '../../utils/colors.mjs'
|
|
86
86
|
import {
|
|
87
87
|
createDirectoryIfNotExist,
|
|
88
88
|
createFile,
|
|
89
|
+
getJavascriptSourceFiles
|
|
90
|
+
} from '../../utils/files.mjs'
|
|
91
|
+
import {
|
|
92
|
+
log,
|
|
93
|
+
logLoadingTask
|
|
94
|
+
} from '../../utils/loggings.mjs'
|
|
95
|
+
import {
|
|
89
96
|
getPrettyPackageName,
|
|
90
|
-
|
|
91
|
-
Indenter,
|
|
92
|
-
logLoadingTask,
|
|
93
|
-
packageName,
|
|
97
|
+
getUnscopedPackageName,
|
|
94
98
|
packageNodeModulesDirectory,
|
|
95
99
|
packageSourcesDirectory,
|
|
96
100
|
packageTestsUnitsDirectory
|
|
97
|
-
}
|
|
101
|
+
} from '../../utils/packages.mjs'
|
|
102
|
+
import { getTaskConfigurationFor } from '../../utils/tasks.mjs'
|
|
103
|
+
import {
|
|
104
|
+
Indenter,
|
|
105
|
+
toCamelCase
|
|
106
|
+
} from '../../utils/texts.mjs'
|
|
98
107
|
|
|
99
108
|
logLoadingTask( import.meta.filename )
|
|
100
109
|
|
|
101
|
-
const {
|
|
102
|
-
red,
|
|
103
|
-
yellow,
|
|
104
|
-
} = colors
|
|
105
|
-
|
|
106
110
|
/**
|
|
107
111
|
* @description Will generate unit test files from source code using type inference from comments
|
|
108
112
|
*/
|
|
@@ -110,20 +114,8 @@ const computeUnitTestsTask = async ( done ) => {
|
|
|
110
114
|
|
|
111
115
|
createDirectoryIfNotExist( packageTestsUnitsDirectory )
|
|
112
116
|
|
|
113
|
-
// Get task configuration
|
|
114
117
|
const filePathsToIgnore = await getTaskConfigurationFor( import.meta.filename )
|
|
115
|
-
|
|
116
|
-
// Get source files to process
|
|
117
|
-
const pattern = join( packageSourcesDirectory, '**' )
|
|
118
|
-
const sourceFiles = glob.sync( pattern )
|
|
119
|
-
.map( filePath => normalize( filePath ) )
|
|
120
|
-
.filter( filePath => {
|
|
121
|
-
const fileName = basename( filePath )
|
|
122
|
-
const isJsFile = fileName.endsWith( '.js' )
|
|
123
|
-
const isNotPrivateFile = !fileName.startsWith( '_' )
|
|
124
|
-
const isNotIgnoredFile = !filePathsToIgnore.includes( fileName )
|
|
125
|
-
return isJsFile && isNotPrivateFile && isNotIgnoredFile
|
|
126
|
-
} )
|
|
118
|
+
const sourceFiles = getJavascriptSourceFiles( filePathsToIgnore )
|
|
127
119
|
|
|
128
120
|
const unitsImportMap = []
|
|
129
121
|
for ( let sourceFile of sourceFiles ) {
|
|
@@ -131,20 +123,26 @@ const computeUnitTestsTask = async ( done ) => {
|
|
|
131
123
|
const specificFilePath = sourceFile.replace( packageSourcesDirectory, '' )
|
|
132
124
|
const specificDir = dirname( specificFilePath )
|
|
133
125
|
|
|
134
|
-
const fileName
|
|
135
|
-
const
|
|
136
|
-
const
|
|
137
|
-
const
|
|
126
|
+
const fileName = basename( sourceFile, extname( sourceFile ) )
|
|
127
|
+
const camelCaseFileName = toCamelCase( fileName )
|
|
128
|
+
const unitFileName = `${ camelCaseFileName }.unit.mjs`
|
|
129
|
+
const unitDirPath = join( packageTestsUnitsDirectory, specificDir )
|
|
130
|
+
const unitFilePath = join( unitDirPath, unitFileName )
|
|
138
131
|
|
|
139
|
-
const nsName = `${
|
|
140
|
-
const unitName = `${
|
|
132
|
+
const nsName = `${ camelCaseFileName }Namespace`
|
|
133
|
+
const unitName = `${ camelCaseFileName }Units`
|
|
141
134
|
const importDirPath = relative( unitDirPath, packageSourcesDirectory )
|
|
142
135
|
const importFilePath = join( importDirPath, specificFilePath ).replace( /\\/g, '/' )
|
|
143
136
|
|
|
144
137
|
try {
|
|
145
138
|
|
|
146
139
|
const jsdocPath = join( packageNodeModulesDirectory, '/jsdoc/jsdoc.js' )
|
|
147
|
-
const jsdocOutput = childProcess.execFileSync( 'node', [ jsdocPath, '
|
|
140
|
+
const jsdocOutput = childProcess.execFileSync( 'node', [ jsdocPath, '--explain', sourceFile ] ).toString()
|
|
141
|
+
|
|
142
|
+
if ( jsdocOutput.includes( 'There are no input files to process' ) ) {
|
|
143
|
+
log( 'Error ', red( `${ sourceFile }, no input files to process` ) )
|
|
144
|
+
continue
|
|
145
|
+
}
|
|
148
146
|
|
|
149
147
|
const classNames = []
|
|
150
148
|
const usedLongnames = []
|
|
@@ -606,7 +604,7 @@ const computeUnitTestsTask = async ( done ) => {
|
|
|
606
604
|
|
|
607
605
|
}
|
|
608
606
|
|
|
609
|
-
const unitsFilePath = join( packageTestsUnitsDirectory, `${
|
|
607
|
+
const unitsFilePath = join( packageTestsUnitsDirectory, `${ getUnscopedPackageName() }.units.mjs` )
|
|
610
608
|
createFile( unitsFilePath, unitsTemplate )
|
|
611
609
|
|
|
612
610
|
done()
|
|
@@ -655,7 +653,7 @@ export { computeUnitTestsTask }</pre>
|
|
|
655
653
|
|
|
656
654
|
|
|
657
655
|
<span class="copyright">
|
|
658
|
-
Copyright 2015-Present <a href="https://github.com/Itee">Itee
|
|
656
|
+
Copyright 2015-Present <a href="https://github.com/Itee">Itee (Tristan Valcke)</a>
|
|
659
657
|
</span>
|
|
660
658
|
|
|
661
659
|
<span class="jsdoc-message">
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width">
|
|
7
|
-
<title
|
|
7
|
+
<title>Itee Tasks v1.3.1 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"
|
|
23
|
+
<a class="navbar-brand" href="index.html">Itee Tasks v1.3.1</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>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<li class="dropdown">
|
|
34
34
|
<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
|
|
35
35
|
<ul class="dropdown-menu inline">
|
|
36
|
-
<li><a href="global.html#checkBundlingFromEsmFilesDirectTask">checkBundlingFromEsmFilesDirectTask</a></li><li><a href="global.html#checkBundlingTask">checkBundlingTask</a></li><li><a href="global.html#computeBenchmarksTask">computeBenchmarksTask</a></li><li><a href="global.html#computeUnitTestsTask">computeUnitTestsTask</a></li><li><a href="global.html#
|
|
36
|
+
<li><a href="global.html#checkBundlingFromEsmFilesDirectTask">checkBundlingFromEsmFilesDirectTask</a></li><li><a href="global.html#checkBundlingTask">checkBundlingTask</a></li><li><a href="global.html#computeBenchmarksTask">computeBenchmarksTask</a></li><li><a href="global.html#computeUnitTestsTask">computeUnitTestsTask</a></li><li><a href="global.html#npmrunclean">npm run clean</a></li><li><a href="global.html#npmrunhelpdefault">npm run help ( default )</a></li><li><a href="global.html#npmrunlint">npm run lint</a></li><li><a href="global.html#npmrunpatch">npm run patch</a></li><li><a href="global.html#npmrunrelease">npm run release</a></li><li><a href="global.html#npmruntest">npm run test</a></li><li><a href="global.html#runBenchmarksForBackendTask">runBenchmarksForBackendTask</a></li><li><a href="global.html#runBenchmarksForFrontendTask">runBenchmarksForFrontendTask</a></li><li><a href="global.html#runUnitTestsForBackendTask">runUnitTestsForBackendTask</a></li><li><a href="global.html#runUnitTestsForFrontendTask">runUnitTestsForFrontendTask</a></li>
|
|
37
37
|
</ul>
|
|
38
38
|
</li>
|
|
39
39
|
|
|
@@ -70,32 +70,34 @@
|
|
|
70
70
|
<section>
|
|
71
71
|
<article>
|
|
72
72
|
<pre
|
|
73
|
-
class="sunlight-highlight-javascript linenums">import
|
|
74
|
-
import {
|
|
75
|
-
import log from 'fancy-log'
|
|
76
|
-
import { existsSync } from 'fs'
|
|
77
|
-
import { basename } from 'node:path'
|
|
78
|
-
import { join } from 'path'
|
|
73
|
+
class="sunlight-highlight-javascript linenums">import { spawn } from 'node:child_process'
|
|
74
|
+
import { existsSync } from 'node:fs'
|
|
79
75
|
import {
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
basename,
|
|
77
|
+
join
|
|
78
|
+
} from 'node:path'
|
|
79
|
+
import {
|
|
80
|
+
red,
|
|
81
|
+
yellow
|
|
82
|
+
} from '../../utils/colors.mjs'
|
|
83
|
+
import {
|
|
84
|
+
log,
|
|
85
|
+
logLoadingTask
|
|
86
|
+
} from '../../utils/loggings.mjs'
|
|
87
|
+
import {
|
|
88
|
+
getUnscopedPackageName,
|
|
82
89
|
packageNodeModulesDirectory,
|
|
83
90
|
packageTestsUnitsDirectory
|
|
84
|
-
} from '../../
|
|
91
|
+
} from '../../utils/packages.mjs'
|
|
85
92
|
|
|
86
93
|
logLoadingTask( import.meta.filename )
|
|
87
94
|
|
|
88
|
-
const {
|
|
89
|
-
red,
|
|
90
|
-
yellow,
|
|
91
|
-
} = colors
|
|
92
|
-
|
|
93
95
|
/**
|
|
94
96
|
* @description Will run unit tests with node
|
|
95
97
|
*/
|
|
96
98
|
const runUnitTestsForBackendTask = ( done ) => {
|
|
97
99
|
|
|
98
|
-
const testsPath = join( packageTestsUnitsDirectory, `/${
|
|
100
|
+
const testsPath = join( packageTestsUnitsDirectory, `/${ getUnscopedPackageName() }.units.mjs` )
|
|
99
101
|
if ( !existsSync( testsPath ) ) {
|
|
100
102
|
log( yellow( `${ testsPath } does not exist, skip backend unit tests...` ) )
|
|
101
103
|
done()
|
|
@@ -156,7 +158,7 @@ export { runUnitTestsForBackendTask }</pre>
|
|
|
156
158
|
|
|
157
159
|
|
|
158
160
|
<span class="copyright">
|
|
159
|
-
Copyright 2015-Present <a href="https://github.com/Itee">Itee
|
|
161
|
+
Copyright 2015-Present <a href="https://github.com/Itee">Itee (Tristan Valcke)</a>
|
|
160
162
|
</span>
|
|
161
163
|
|
|
162
164
|
<span class="jsdoc-message">
|