@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/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"
|
|
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 unit tests with web-test-runner
|
|
87
83
|
*/
|
|
88
|
-
const runUnitTestsForFrontendTask = () => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
84
|
+
const runUnitTestsForFrontendTask = 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 runUnitTestsForFrontendTask = () => {
|
|
|
112
109
|
} )
|
|
113
110
|
|
|
114
111
|
} )
|
|
112
|
+
|
|
115
113
|
}
|
|
116
114
|
runUnitTestsForFrontendTask.displayName = basename( import.meta.filename, '.task.mjs' )
|
|
117
115
|
runUnitTestsForFrontendTask.description = 'Will run unit tests with web-test-runner'
|
|
@@ -156,7 +154,7 @@ export { runUnitTestsForFrontendTask }</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">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itee/tasks",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Allow to manage all commons itee gulp tasks into one place ",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"itee",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"url": "git+https://github.com/Itee/tasks.git"
|
|
20
20
|
},
|
|
21
21
|
"type": "module",
|
|
22
|
-
"main": "sources/
|
|
22
|
+
"main": "sources/tasks.js",
|
|
23
23
|
"homepage": "https://github.com/Itee/tasks#readme",
|
|
24
24
|
"bugs": {
|
|
25
25
|
"url": "https://github.com/Itee/tasks/issues"
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"node": ">=20"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"postinstall": "node ./
|
|
31
|
+
"postinstall": "node ./scripts/refresh.mjs && gulp patch",
|
|
32
|
+
"refresh": "node ./scripts/refresh.mjs",
|
|
32
33
|
"default": "gulp --tasks",
|
|
33
|
-
"refresh": "node ./sources/refresh.mjs",
|
|
34
34
|
"help": "gulp help",
|
|
35
35
|
"patch": "gulp patch",
|
|
36
36
|
"clean": "gulp clean",
|
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import log from 'fancy-log'
|
|
3
|
-
import { writeFileSync } from 'fs'
|
|
1
|
+
import { writeFileSync } from 'node:fs'
|
|
4
2
|
import {
|
|
5
3
|
basename,
|
|
6
4
|
join,
|
|
7
5
|
relative
|
|
8
|
-
}
|
|
6
|
+
} from 'node:path'
|
|
7
|
+
import {
|
|
8
|
+
green,
|
|
9
|
+
yellow
|
|
10
|
+
} from '../sources/utils/colors.mjs'
|
|
11
|
+
import { getFilesFrom } from '../sources/utils/files.mjs'
|
|
12
|
+
import { log } from '../sources/utils/loggings.mjs'
|
|
9
13
|
import {
|
|
10
|
-
getFilesFrom,
|
|
11
|
-
getTaskConfigurationFor,
|
|
12
14
|
iteePackageRootDirectory,
|
|
13
15
|
iteePackageSourcesDirectory,
|
|
14
16
|
packageNodeModulesDirectory,
|
|
15
17
|
packageRootDirectory,
|
|
16
18
|
packageTasksDirectory
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const {
|
|
20
|
-
green,
|
|
21
|
-
yellow
|
|
22
|
-
} = colors
|
|
19
|
+
} from '../sources/utils/packages.mjs'
|
|
20
|
+
import { getTaskConfigurationFor } from '../sources/utils/tasks.mjs'
|
|
23
21
|
|
|
24
22
|
const configuration = await getTaskConfigurationFor( import.meta.filename )
|
|
25
23
|
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { basename } from 'node:path'
|
|
4
|
-
import { rollup } from 'rollup'
|
|
1
|
+
import { basename } from 'node:path'
|
|
2
|
+
import { rollup } from 'rollup'
|
|
5
3
|
import {
|
|
6
|
-
|
|
4
|
+
green,
|
|
5
|
+
red,
|
|
6
|
+
yellow,
|
|
7
|
+
} from '../utils/colors.mjs'
|
|
8
|
+
import {
|
|
9
|
+
log,
|
|
7
10
|
logLoadingTask
|
|
8
|
-
}
|
|
11
|
+
} from '../utils/loggings.mjs'
|
|
12
|
+
import { getTaskConfigurationFor } from '../utils/tasks.mjs'
|
|
9
13
|
|
|
10
14
|
logLoadingTask( import.meta.filename )
|
|
11
15
|
|
|
12
|
-
const {
|
|
13
|
-
red,
|
|
14
|
-
green,
|
|
15
|
-
yellow,
|
|
16
|
-
} = colors
|
|
17
|
-
|
|
18
16
|
const buildTask = async ( done ) => {
|
|
19
17
|
|
|
20
18
|
const configuration = await getTaskConfigurationFor( import.meta.filename )
|
|
@@ -46,7 +44,7 @@ const buildTask = async ( done ) => {
|
|
|
46
44
|
|
|
47
45
|
}
|
|
48
46
|
buildTask.displayName = basename( import.meta.filename, '.task.mjs' )
|
|
49
|
-
buildTask.description = '
|
|
47
|
+
buildTask.description = 'Will generate build package files based on input config.'
|
|
50
48
|
buildTask.flags = null
|
|
51
49
|
|
|
52
50
|
export { buildTask }
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { basename } from 'node:path'
|
|
1
|
+
import { deleteAsync } from 'del'
|
|
2
|
+
import { basename } from 'node:path'
|
|
3
|
+
import { red } from '../utils/colors.mjs'
|
|
5
4
|
import {
|
|
6
|
-
|
|
5
|
+
log,
|
|
7
6
|
logLoadingTask
|
|
8
|
-
}
|
|
7
|
+
} from '../utils/loggings.mjs'
|
|
8
|
+
import { getTaskConfigurationFor } from '../utils/tasks.mjs'
|
|
9
9
|
|
|
10
10
|
logLoadingTask( import.meta.filename )
|
|
11
11
|
|
|
12
|
-
const { red } = colors
|
|
13
12
|
const configuration = await getTaskConfigurationFor( import.meta.filename )
|
|
14
13
|
|
|
15
14
|
/**
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getPrettyPackageName,
|
|
3
|
-
getPrettyPackageVersion
|
|
4
|
-
|
|
3
|
+
getPrettyPackageVersion,
|
|
4
|
+
packageAuthor
|
|
5
|
+
} from '../utils/packages.mjs'
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
|
-
tags:
|
|
8
|
+
tags: {
|
|
8
9
|
allowUnknownTags: false,
|
|
9
10
|
dictionaries: [
|
|
10
11
|
'jsdoc',
|
|
11
12
|
'closure'
|
|
12
13
|
]
|
|
13
14
|
},
|
|
14
|
-
source:
|
|
15
|
-
include:
|
|
15
|
+
source: {
|
|
16
|
+
include: [
|
|
16
17
|
'README.md',
|
|
17
18
|
'gulpfile.mjs',
|
|
18
19
|
'./sources'
|
|
@@ -34,7 +35,7 @@ export default {
|
|
|
34
35
|
verbose: true,
|
|
35
36
|
private: true
|
|
36
37
|
},
|
|
37
|
-
templates:
|
|
38
|
+
templates: {
|
|
38
39
|
cleverLinks: false,
|
|
39
40
|
monospaceLinks: false,
|
|
40
41
|
navType: 'inline',
|
|
@@ -46,7 +47,7 @@ export default {
|
|
|
46
47
|
search: true,
|
|
47
48
|
systemName: `${ getPrettyPackageName() } ${ getPrettyPackageVersion() }`,
|
|
48
49
|
footer: '',
|
|
49
|
-
copyright:
|
|
50
|
+
copyright: `Copyright 2015-Present <a href="${packageAuthor.url}">${packageAuthor.name}</a>`,
|
|
50
51
|
includeDate: false,
|
|
51
52
|
inverseNav: false,
|
|
52
53
|
outputSourceFiles: true,
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { promisify } from 'node:util'
|
|
1
|
+
import child_process from 'node:child_process'
|
|
2
|
+
import { basename } from 'node:path'
|
|
3
|
+
import { promisify } from 'node:util'
|
|
4
|
+
import { red } from '../utils/colors.mjs'
|
|
6
5
|
import {
|
|
7
|
-
|
|
6
|
+
log,
|
|
8
7
|
logLoadingTask
|
|
9
|
-
}
|
|
8
|
+
} from '../utils/loggings.mjs'
|
|
9
|
+
import { getTaskConfigurationPathFor } from '../utils/tasks.mjs'
|
|
10
10
|
|
|
11
11
|
logLoadingTask( import.meta.filename )
|
|
12
12
|
|
|
13
13
|
const execFile = promisify( child_process.execFile )
|
|
14
|
-
const { red } = colors
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
16
|
* @method npm run doc
|
|
@@ -1,66 +1,30 @@
|
|
|
1
|
-
import colors from 'ansi-colors'
|
|
2
|
-
import log from 'fancy-log'
|
|
3
1
|
import { basename } from 'node:path'
|
|
2
|
+
import {
|
|
3
|
+
blue,
|
|
4
|
+
cyan,
|
|
5
|
+
green,
|
|
6
|
+
magenta,
|
|
7
|
+
red,
|
|
8
|
+
yellow
|
|
9
|
+
} from '../utils/colors.mjs'
|
|
10
|
+
import {
|
|
11
|
+
log,
|
|
12
|
+
logLoadingTask
|
|
13
|
+
} from '../utils/loggings.mjs'
|
|
4
14
|
import {
|
|
5
15
|
getPrettyNodeVersion,
|
|
6
16
|
getPrettyNpmVersion,
|
|
7
17
|
getPrettyPackageName,
|
|
8
|
-
getPrettyPackageVersion
|
|
18
|
+
getPrettyPackageVersion
|
|
19
|
+
} from '../utils/packages.mjs'
|
|
20
|
+
import {
|
|
21
|
+
alignTextCenter,
|
|
22
|
+
alignTextLeft,
|
|
9
23
|
Indenter,
|
|
10
|
-
|
|
11
|
-
} from '../_utils.mjs'
|
|
24
|
+
} from '../utils/texts.mjs'
|
|
12
25
|
|
|
13
26
|
logLoadingTask( import.meta.filename )
|
|
14
27
|
|
|
15
|
-
const {
|
|
16
|
-
red,
|
|
17
|
-
green,
|
|
18
|
-
blue,
|
|
19
|
-
cyan,
|
|
20
|
-
yellow,
|
|
21
|
-
magenta,
|
|
22
|
-
unstyle
|
|
23
|
-
} = colors
|
|
24
|
-
|
|
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
28
|
/**
|
|
65
29
|
* @method npm run help ( default )
|
|
66
30
|
* @global
|
|
@@ -50,13 +50,17 @@ class RulesSet {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
const sourceRulesSet = new RulesSet( {
|
|
53
|
-
name:
|
|
54
|
-
files:
|
|
53
|
+
name: 'sources',
|
|
54
|
+
files: [
|
|
55
|
+
'sources/**/*.js',
|
|
56
|
+
'sources/**/*.cjs',
|
|
57
|
+
'sources/**/*.mjs',
|
|
58
|
+
],
|
|
55
59
|
ignores: [],
|
|
56
60
|
plugins: { js },
|
|
57
61
|
extends: [ 'js/recommended' ],
|
|
58
62
|
rules: {
|
|
59
|
-
'no-multiple-empty-lines':
|
|
63
|
+
'no-multiple-empty-lines': [
|
|
60
64
|
'error',
|
|
61
65
|
{
|
|
62
66
|
'max': 2
|
|
@@ -76,7 +80,7 @@ const sourceRulesSet = new RulesSet( {
|
|
|
76
80
|
}
|
|
77
81
|
}
|
|
78
82
|
],
|
|
79
|
-
'key-spacing':
|
|
83
|
+
'key-spacing': [
|
|
80
84
|
'error',
|
|
81
85
|
{
|
|
82
86
|
'align': {
|
|
@@ -90,13 +94,17 @@ const sourceRulesSet = new RulesSet( {
|
|
|
90
94
|
} )
|
|
91
95
|
|
|
92
96
|
const sourceCommonRulesSet = new RulesSet( {
|
|
93
|
-
name:
|
|
94
|
-
files:
|
|
97
|
+
name: 'sources/common',
|
|
98
|
+
files: [
|
|
99
|
+
'sources/common/**/*.js',
|
|
100
|
+
'sources/common/**/*.cjs',
|
|
101
|
+
'sources/common/**/*.mjs',
|
|
102
|
+
],
|
|
95
103
|
ignores: [],
|
|
96
104
|
plugins: { js },
|
|
97
105
|
extends: [ 'js/recommended' ],
|
|
98
106
|
rules: {
|
|
99
|
-
'no-multiple-empty-lines':
|
|
107
|
+
'no-multiple-empty-lines': [
|
|
100
108
|
'error',
|
|
101
109
|
{
|
|
102
110
|
'max': 2
|
|
@@ -116,7 +124,7 @@ const sourceCommonRulesSet = new RulesSet( {
|
|
|
116
124
|
}
|
|
117
125
|
}
|
|
118
126
|
],
|
|
119
|
-
'key-spacing':
|
|
127
|
+
'key-spacing': [
|
|
120
128
|
'error',
|
|
121
129
|
{
|
|
122
130
|
'align': {
|
|
@@ -130,8 +138,11 @@ const sourceCommonRulesSet = new RulesSet( {
|
|
|
130
138
|
} )
|
|
131
139
|
|
|
132
140
|
const sourceFrontendRulesSet = new RulesSet( {
|
|
133
|
-
name:
|
|
134
|
-
files:
|
|
141
|
+
name: 'sources/frontend',
|
|
142
|
+
files: [
|
|
143
|
+
'sources/frontend/**/*.js',
|
|
144
|
+
'sources/frontend/**/*.mjs',
|
|
145
|
+
],
|
|
135
146
|
ignores: [],
|
|
136
147
|
plugins: { js },
|
|
137
148
|
extends: [ 'js/recommended' ],
|
|
@@ -139,8 +150,12 @@ const sourceFrontendRulesSet = new RulesSet( {
|
|
|
139
150
|
} )
|
|
140
151
|
|
|
141
152
|
const sourceBackendRulesSet = new RulesSet( {
|
|
142
|
-
name:
|
|
143
|
-
files:
|
|
153
|
+
name: 'sources/backend',
|
|
154
|
+
files: [
|
|
155
|
+
'sources/frontend/**/*.js',
|
|
156
|
+
'sources/frontend/**/*.cjs',
|
|
157
|
+
'sources/frontend/**/*.mjs',
|
|
158
|
+
],
|
|
144
159
|
ignores: [],
|
|
145
160
|
plugins: { js },
|
|
146
161
|
extends: [ 'js/recommended' ],
|
|
@@ -148,8 +163,12 @@ const sourceBackendRulesSet = new RulesSet( {
|
|
|
148
163
|
} )
|
|
149
164
|
|
|
150
165
|
const testBenchmarksRulesSet = new RulesSet( {
|
|
151
|
-
name:
|
|
152
|
-
files:
|
|
166
|
+
name: 'tests/benchmarks',
|
|
167
|
+
files: [
|
|
168
|
+
'tests/benchmarks/**/*.js',
|
|
169
|
+
'tests/benchmarks/**/*.cjs',
|
|
170
|
+
'tests/benchmarks/**/*.mjs',
|
|
171
|
+
],
|
|
153
172
|
ignores: [],
|
|
154
173
|
plugins: { js },
|
|
155
174
|
extends: [ 'js/recommended' ],
|
|
@@ -161,8 +180,12 @@ const testBenchmarksRulesSet = new RulesSet( {
|
|
|
161
180
|
} )
|
|
162
181
|
|
|
163
182
|
const testUnitsRulesSet = new RulesSet( {
|
|
164
|
-
name:
|
|
165
|
-
files:
|
|
183
|
+
name: 'tests/units',
|
|
184
|
+
files: [
|
|
185
|
+
'tests/units/**/*.js',
|
|
186
|
+
'tests/units/**/*.cjs',
|
|
187
|
+
'tests/units/**/*.mjs',
|
|
188
|
+
],
|
|
166
189
|
ignores: [],
|
|
167
190
|
plugins: { js },
|
|
168
191
|
extends: [ 'js/recommended' ],
|
|
@@ -175,7 +198,11 @@ const testUnitsRulesSet = new RulesSet( {
|
|
|
175
198
|
} )
|
|
176
199
|
|
|
177
200
|
const mochaRecommendedRulesSet = new RulesSet( {
|
|
178
|
-
files:
|
|
201
|
+
files: [
|
|
202
|
+
'tests/units/**/*.js',
|
|
203
|
+
'tests/units/**/*.cjs',
|
|
204
|
+
'tests/units/**/*.mjs',
|
|
205
|
+
],
|
|
179
206
|
ignores: [],
|
|
180
207
|
...mocha.configs.recommended,
|
|
181
208
|
} )
|
|
@@ -229,7 +256,12 @@ const defaultConfigurator = new Configurator( {
|
|
|
229
256
|
reportUnusedDisableDirectives: 'error',
|
|
230
257
|
reportUnusedInlineConfigs: 'error'
|
|
231
258
|
},
|
|
232
|
-
rulesSets:
|
|
259
|
+
rulesSets: [
|
|
260
|
+
sourceRulesSet,
|
|
261
|
+
testBenchmarksRulesSet,
|
|
262
|
+
testUnitsRulesSet,
|
|
263
|
+
mochaRecommendedRulesSet
|
|
264
|
+
]
|
|
233
265
|
} )
|
|
234
266
|
|
|
235
267
|
const defaultConfiguration = defaultConfigurator.getConfig()
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { basename } from 'node:path'
|
|
5
|
-
import { promisify } from 'node:util'
|
|
1
|
+
import child_process from 'node:child_process'
|
|
2
|
+
import { basename } from 'node:path'
|
|
3
|
+
import { promisify } from 'node:util'
|
|
6
4
|
import {
|
|
7
|
-
|
|
5
|
+
cyan,
|
|
6
|
+
red
|
|
7
|
+
} from '../utils/colors.mjs'
|
|
8
|
+
import {
|
|
9
|
+
log,
|
|
8
10
|
logLoadingTask
|
|
9
|
-
}
|
|
11
|
+
} from '../utils/loggings.mjs'
|
|
12
|
+
import { getTaskConfigurationPathFor } from '../utils/tasks.mjs'
|
|
10
13
|
|
|
11
14
|
logLoadingTask( import.meta.filename )
|
|
12
15
|
|
|
13
16
|
const execFile = promisify( child_process.execFile )
|
|
14
|
-
const { red } = colors
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
19
|
* @method npm run lint
|
|
@@ -23,6 +25,7 @@ const lintTask = async ( done ) => {
|
|
|
23
25
|
try {
|
|
24
26
|
|
|
25
27
|
const configurationPath = getTaskConfigurationPathFor( import.meta.filename )
|
|
28
|
+
log( `Loading configuration from ${ cyan( configurationPath ) }` )
|
|
26
29
|
|
|
27
30
|
const { stdout } = await execFile( 'npx', [ 'eslint', '--config', configurationPath, '--fix' ] )
|
|
28
31
|
if ( stdout !== '' ) {
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import colors from 'ansi-colors'
|
|
2
1
|
import {
|
|
3
2
|
readFileSync,
|
|
4
3
|
writeFileSync
|
|
5
4
|
} from 'node:fs'
|
|
6
5
|
import { basename } from 'node:path'
|
|
7
|
-
import { logLoadingTask } from '../
|
|
6
|
+
import { logLoadingTask } from '../utils/loggings.mjs'
|
|
8
7
|
|
|
9
8
|
logLoadingTask( import.meta.filename )
|
|
10
9
|
|
|
11
|
-
const {
|
|
12
|
-
green,
|
|
13
|
-
blue
|
|
14
|
-
} = colors
|
|
15
|
-
|
|
16
10
|
/**
|
|
17
11
|
* @method npm run patch
|
|
18
12
|
* @global
|
|
@@ -34,6 +28,14 @@ const patchTask = ( done ) => {
|
|
|
34
28
|
const patchedFileContent = fileContent.replace( searchValue, replaceValue )
|
|
35
29
|
writeFileSync( jsdocFilePath, patchedFileContent )
|
|
36
30
|
}
|
|
31
|
+
{
|
|
32
|
+
const jsdocFilePath = 'node_modules/jsdoc/conf.json.EXAMPLE'
|
|
33
|
+
const searchValue = '.js(doc|x)?'
|
|
34
|
+
const replaceValue = '.(js|mjs|cjs|jsdoc|jsx)?'
|
|
35
|
+
const fileContent = readFileSync( jsdocFilePath ).toString()
|
|
36
|
+
const patchedFileContent = fileContent.replace( searchValue, replaceValue )
|
|
37
|
+
writeFileSync( jsdocFilePath, patchedFileContent )
|
|
38
|
+
}
|
|
37
39
|
|
|
38
40
|
done()
|
|
39
41
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { series } from 'gulp'
|
|
2
2
|
import { basename } from 'node:path'
|
|
3
|
-
import { logLoadingTask } from '../_utils.mjs'
|
|
4
3
|
import { buildTask } from '../builds/build.task.mjs'
|
|
5
4
|
import { cleanTask } from '../cleans/clean.task.mjs'
|
|
6
5
|
import { docTask } from '../docs/doc.task.mjs'
|
|
@@ -8,6 +7,7 @@ import { lintTask } from '../lints/lint.task.mjs'
|
|
|
8
7
|
import { computeBenchmarksTask } from '../tests/benchmarks/compute-benchmarks.task.mjs'
|
|
9
8
|
import { runTestsTask } from '../tests/run-tests.task.mjs'
|
|
10
9
|
import { computeUnitTestsTask } from '../tests/units/compute-unit-tests.task.mjs'
|
|
10
|
+
import { logLoadingTask } from '../utils/loggings.mjs'
|
|
11
11
|
|
|
12
12
|
logLoadingTask( import.meta.filename )
|
|
13
13
|
|
package/sources/tasks.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
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'
|
|
8
|
+
export { checkBundlingFromEsmBuildImportTask } from './tests/bundlings/check-bundling-from-esm-build-import.task.mjs'
|
|
9
|
+
export { checkBundlingFromEsmFilesDirectTask } from './tests/bundlings/check-bundling-from-esm-files-direct.task.mjs'
|
|
10
|
+
export { checkBundlingFromEsmFilesImportTask } from './tests/bundlings/check-bundling-from-esm-files-import.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
|
+
export * from './utils/packages.mjs'
|
|
21
|
+
export * from './utils/loggings.mjs'
|
|
22
|
+
export * from './utils/tasks.mjs'
|
|
23
|
+
export * from './utils/files.mjs'
|
|
24
|
+
export * from './utils/texts.mjs'
|
|
25
|
+
export * from './utils/builds.mjs'
|
|
26
|
+
export * from './utils/colors.mjs'
|