@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
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
# [v1.3.1](https://github.com/Itee/tasks/compare/v1.3.0...v1.3.1) (2026-01-19)
|
|
2
|
+
|
|
3
|
+
## 🐛 Bug Fixes
|
|
4
|
+
- [`4a4d051`](https://github.com/Itee/tasks/commit/4a4d051) (lint) fix lint conf files minimatch patterns and log
|
|
5
|
+
- [`46637b7`](https://github.com/Itee/tasks/commit/46637b7) (lint) apply global lint fix
|
|
6
|
+
|
|
7
|
+
# [v1.3.0](https://github.com/Itee/tasks/compare/v1.2.1...v1.3.0) (2026-01-19)
|
|
8
|
+
|
|
9
|
+
## ✨ New Features
|
|
10
|
+
- [`ce7b1e6`](https://github.com/Itee/tasks/commit/ce7b1e6) (lint) add new configurator system for lint config
|
|
11
|
+
|
|
1
12
|
# [v1.2.1](https://github.com/Itee/tasks/compare/v1.2.0...v1.2.1) (2026-01-19)
|
|
2
13
|
|
|
3
14
|
## 🐛 Bug Fixes
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
packageBuildsDirectory,
|
|
3
|
+
packageDocsDirectory,
|
|
4
|
+
packageTestsBenchmarksDirectory,
|
|
5
|
+
packageTestsBundlesDirectory,
|
|
6
|
+
packageTestsUnitsDirectory,
|
|
7
|
+
} from '../../sources/_utils.mjs'
|
|
8
|
+
|
|
9
|
+
export default [
|
|
10
|
+
packageBuildsDirectory,
|
|
11
|
+
packageDocsDirectory,
|
|
12
|
+
packageTestsBenchmarksDirectory,
|
|
13
|
+
packageTestsBundlesDirectory,
|
|
14
|
+
packageTestsUnitsDirectory,
|
|
15
|
+
]
|
|
@@ -1,91 +1,280 @@
|
|
|
1
|
-
import js
|
|
2
|
-
import mocha
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import mocha from 'eslint-plugin-mocha'
|
|
3
3
|
import {
|
|
4
4
|
defineConfig,
|
|
5
5
|
globalIgnores
|
|
6
|
-
}
|
|
6
|
+
} from 'eslint/config'
|
|
7
|
+
import globals from 'globals'
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
class RulesSet {
|
|
10
|
+
|
|
11
|
+
constructor( parameters = {} ) {
|
|
12
|
+
|
|
13
|
+
const _parameters = {
|
|
14
|
+
...{
|
|
15
|
+
name: '',
|
|
16
|
+
files: [],
|
|
17
|
+
ignores: [],
|
|
18
|
+
plugins: {},
|
|
19
|
+
extends: [],
|
|
20
|
+
rules: {},
|
|
21
|
+
languageOptions: {},
|
|
22
|
+
},
|
|
23
|
+
...parameters
|
|
20
24
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
|
|
26
|
+
this.name = _parameters.name
|
|
27
|
+
this.files = _parameters.files
|
|
28
|
+
this.ignores = _parameters.ignores
|
|
29
|
+
this.plugins = _parameters.plugins
|
|
30
|
+
this.extends = _parameters.extends
|
|
31
|
+
this.rules = _parameters.rules
|
|
32
|
+
this.languageOptions = _parameters.languageOptions
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
getConfig() {
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
name: this.name,
|
|
40
|
+
files: this.files,
|
|
41
|
+
ignores: this.ignores,
|
|
42
|
+
plugins: this.plugins,
|
|
43
|
+
extends: this.extends,
|
|
44
|
+
rules: this.rules,
|
|
45
|
+
languageOptions: this.languageOptions
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const sourceRulesSet = new RulesSet( {
|
|
53
|
+
name: 'sources',
|
|
54
|
+
files: [
|
|
55
|
+
'sources/**/*.js',
|
|
56
|
+
'sources/**/*.cjs',
|
|
57
|
+
'sources/**/*.mjs',
|
|
58
|
+
],
|
|
59
|
+
ignores: [],
|
|
60
|
+
plugins: { js },
|
|
61
|
+
extends: [ 'js/recommended' ],
|
|
62
|
+
rules: {
|
|
63
|
+
'no-multiple-empty-lines': [
|
|
64
|
+
'error',
|
|
65
|
+
{
|
|
66
|
+
'max': 2
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
'no-mixed-spaces-and-tabs': 'error',
|
|
70
|
+
'no-console': 'warn',
|
|
71
|
+
'no-unused-vars': 'error',
|
|
72
|
+
'no-multi-spaces': [
|
|
73
|
+
'error',
|
|
74
|
+
{
|
|
75
|
+
'exceptions': {
|
|
76
|
+
'Property': true,
|
|
77
|
+
'ImportDeclaration': true,
|
|
78
|
+
'VariableDeclarator': true,
|
|
79
|
+
'AssignmentExpression': true
|
|
33
80
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
'
|
|
38
|
-
|
|
39
|
-
'
|
|
40
|
-
|
|
41
|
-
'
|
|
42
|
-
|
|
43
|
-
'ImportDeclaration': true,
|
|
44
|
-
'VariableDeclarator': true,
|
|
45
|
-
'AssignmentExpression': true
|
|
46
|
-
}
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
'key-spacing': [
|
|
84
|
+
'error',
|
|
85
|
+
{
|
|
86
|
+
'align': {
|
|
87
|
+
'beforeColon': false,
|
|
88
|
+
'afterColon': true,
|
|
89
|
+
'on': 'value'
|
|
47
90
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
} )
|
|
95
|
+
|
|
96
|
+
const sourceCommonRulesSet = new RulesSet( {
|
|
97
|
+
name: 'sources/common',
|
|
98
|
+
files: [
|
|
99
|
+
'sources/common/**/*.js',
|
|
100
|
+
'sources/common/**/*.cjs',
|
|
101
|
+
'sources/common/**/*.mjs',
|
|
102
|
+
],
|
|
103
|
+
ignores: [],
|
|
104
|
+
plugins: { js },
|
|
105
|
+
extends: [ 'js/recommended' ],
|
|
106
|
+
rules: {
|
|
107
|
+
'no-multiple-empty-lines': [
|
|
108
|
+
'error',
|
|
109
|
+
{
|
|
110
|
+
'max': 2
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
'no-mixed-spaces-and-tabs': 'error',
|
|
114
|
+
'no-console': 'warn',
|
|
115
|
+
'no-unused-vars': 'error',
|
|
116
|
+
'no-multi-spaces': [
|
|
117
|
+
'error',
|
|
118
|
+
{
|
|
119
|
+
'exceptions': {
|
|
120
|
+
'Property': true,
|
|
121
|
+
'ImportDeclaration': true,
|
|
122
|
+
'VariableDeclarator': true,
|
|
123
|
+
'AssignmentExpression': true
|
|
57
124
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
'key-spacing': [
|
|
128
|
+
'error',
|
|
129
|
+
{
|
|
130
|
+
'align': {
|
|
131
|
+
'beforeColon': false,
|
|
132
|
+
'afterColon': true,
|
|
133
|
+
'on': 'value'
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
} )
|
|
139
|
+
|
|
140
|
+
const sourceFrontendRulesSet = new RulesSet( {
|
|
141
|
+
name: 'sources/frontend',
|
|
142
|
+
files: [
|
|
143
|
+
'sources/frontend/**/*.js',
|
|
144
|
+
'sources/frontend/**/*.mjs',
|
|
145
|
+
],
|
|
146
|
+
ignores: [],
|
|
147
|
+
plugins: { js },
|
|
148
|
+
extends: [ 'js/recommended' ],
|
|
149
|
+
languageOptions: { globals: globals.browser }
|
|
150
|
+
} )
|
|
151
|
+
|
|
152
|
+
const sourceBackendRulesSet = new RulesSet( {
|
|
153
|
+
name: 'sources/backend',
|
|
154
|
+
files: [
|
|
155
|
+
'sources/frontend/**/*.js',
|
|
156
|
+
'sources/frontend/**/*.cjs',
|
|
157
|
+
'sources/frontend/**/*.mjs',
|
|
158
|
+
],
|
|
159
|
+
ignores: [],
|
|
160
|
+
plugins: { js },
|
|
161
|
+
extends: [ 'js/recommended' ],
|
|
162
|
+
languageOptions: { globals: globals.node }
|
|
163
|
+
} )
|
|
164
|
+
|
|
165
|
+
const testBenchmarksRulesSet = new RulesSet( {
|
|
166
|
+
name: 'tests/benchmarks',
|
|
167
|
+
files: [
|
|
168
|
+
'tests/benchmarks/**/*.js',
|
|
169
|
+
'tests/benchmarks/**/*.cjs',
|
|
170
|
+
'tests/benchmarks/**/*.mjs',
|
|
171
|
+
],
|
|
172
|
+
ignores: [],
|
|
173
|
+
plugins: { js },
|
|
174
|
+
extends: [ 'js/recommended' ],
|
|
175
|
+
languageOptions: {
|
|
176
|
+
globals: {
|
|
177
|
+
Benchmark: 'readonly'
|
|
178
|
+
},
|
|
179
|
+
}
|
|
180
|
+
} )
|
|
181
|
+
|
|
182
|
+
const testUnitsRulesSet = new RulesSet( {
|
|
183
|
+
name: 'tests/units',
|
|
184
|
+
files: [
|
|
185
|
+
'tests/units/**/*.js',
|
|
186
|
+
'tests/units/**/*.cjs',
|
|
187
|
+
'tests/units/**/*.mjs',
|
|
188
|
+
],
|
|
189
|
+
ignores: [],
|
|
190
|
+
plugins: { js },
|
|
191
|
+
extends: [ 'js/recommended' ],
|
|
192
|
+
languageOptions: {
|
|
193
|
+
globals: {
|
|
194
|
+
describe: 'readonly',
|
|
195
|
+
it: 'readonly',
|
|
196
|
+
},
|
|
197
|
+
}
|
|
198
|
+
} )
|
|
199
|
+
|
|
200
|
+
const mochaRecommendedRulesSet = new RulesSet( {
|
|
201
|
+
files: [
|
|
202
|
+
'tests/units/**/*.js',
|
|
203
|
+
'tests/units/**/*.cjs',
|
|
204
|
+
'tests/units/**/*.mjs',
|
|
205
|
+
],
|
|
206
|
+
ignores: [],
|
|
207
|
+
...mocha.configs.recommended,
|
|
208
|
+
} )
|
|
209
|
+
|
|
210
|
+
class Configurator {
|
|
211
|
+
|
|
212
|
+
constructor( parameters = {} ) {
|
|
213
|
+
|
|
214
|
+
const _parameters = {
|
|
215
|
+
...{
|
|
216
|
+
globalIgnores: [],
|
|
217
|
+
linterOptions: {},
|
|
218
|
+
rulesSets: []
|
|
70
219
|
},
|
|
220
|
+
...parameters
|
|
71
221
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
222
|
+
|
|
223
|
+
this.globalIgnores = _parameters.globalIgnores
|
|
224
|
+
this.linterOptions = _parameters.linterOptions
|
|
225
|
+
this.rulesSets = _parameters.rulesSets
|
|
226
|
+
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
getConfig() {
|
|
230
|
+
|
|
231
|
+
const rulesSets = this.rulesSets.map( rulesSet => rulesSet.getConfig() )
|
|
232
|
+
|
|
233
|
+
return defineConfig( [
|
|
234
|
+
globalIgnores( this.globalIgnores ),
|
|
235
|
+
{
|
|
236
|
+
linterOptions: this.linterOptions
|
|
83
237
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
files: [ 'tests/units/**/*.mjs' ],
|
|
88
|
-
ignores: [ 'tests/units/builds/*' ],
|
|
89
|
-
...mocha.configs.recommended,
|
|
238
|
+
...rulesSets
|
|
239
|
+
] )
|
|
240
|
+
|
|
90
241
|
}
|
|
91
|
-
|
|
242
|
+
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const defaultConfigurator = new Configurator( {
|
|
246
|
+
globalIgnores: [
|
|
247
|
+
'.github',
|
|
248
|
+
'.idea',
|
|
249
|
+
'.reports',
|
|
250
|
+
'builds',
|
|
251
|
+
'docs',
|
|
252
|
+
'node_modules',
|
|
253
|
+
],
|
|
254
|
+
linterOptions: {
|
|
255
|
+
noInlineConfig: false,
|
|
256
|
+
reportUnusedDisableDirectives: 'error',
|
|
257
|
+
reportUnusedInlineConfigs: 'error'
|
|
258
|
+
},
|
|
259
|
+
rulesSets: [
|
|
260
|
+
sourceRulesSet,
|
|
261
|
+
testBenchmarksRulesSet,
|
|
262
|
+
testUnitsRulesSet,
|
|
263
|
+
mochaRecommendedRulesSet
|
|
264
|
+
]
|
|
265
|
+
} )
|
|
266
|
+
|
|
267
|
+
const defaultConfiguration = defaultConfigurator.getConfig()
|
|
268
|
+
|
|
269
|
+
export {
|
|
270
|
+
defaultConfiguration as default,
|
|
271
|
+
defaultConfigurator as Configurator,
|
|
272
|
+
sourceRulesSet as SourceRulesSet,
|
|
273
|
+
sourceCommonRulesSet as SourceCommonRulesSet,
|
|
274
|
+
sourceFrontendRulesSet as SourceFrontendRulesSet,
|
|
275
|
+
sourceBackendRulesSet as SourceBackendRulesSet,
|
|
276
|
+
testBenchmarksRulesSet as TestBenchmarksRulesSet,
|
|
277
|
+
testUnitsRulesSet as TestUnitsRulesSet,
|
|
278
|
+
mochaRecommendedRulesSet as MochaRecommendedRulesSet,
|
|
279
|
+
RulesSet
|
|
280
|
+
}
|
package/docs/-_utils.mjs.html
CHANGED
|
@@ -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: _utils.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>
|
|
@@ -105,12 +105,13 @@ const {
|
|
|
105
105
|
yellow,
|
|
106
106
|
blue,
|
|
107
107
|
magenta,
|
|
108
|
-
cyan
|
|
108
|
+
cyan,
|
|
109
|
+
unstyle
|
|
109
110
|
} = colors
|
|
110
111
|
|
|
111
112
|
/// Debugging
|
|
112
|
-
|
|
113
|
-
const isDebugging = ( process.env.RUNNER_DEBUG && process.env.RUNNER_DEBUG === '1' )
|
|
113
|
+
/* global process */
|
|
114
|
+
const isDebugging = ( process && process.env && process.env.RUNNER_DEBUG && process.env.RUNNER_DEBUG === '1' )
|
|
114
115
|
|
|
115
116
|
/// Package paths and data
|
|
116
117
|
|
|
@@ -250,7 +251,7 @@ function createFile( filePath, fileContent ) {
|
|
|
250
251
|
|
|
251
252
|
}
|
|
252
253
|
|
|
253
|
-
function getFilesFrom( globPattern, filter = ( any ) => true ) {
|
|
254
|
+
function getFilesFrom( globPattern, filter = ( /*any*/ ) => true ) {
|
|
254
255
|
|
|
255
256
|
return glob.sync( globPattern )
|
|
256
257
|
.map( filePath => normalize( filePath ) )
|
|
@@ -465,9 +466,15 @@ function computeBannerFor( format ) {
|
|
|
465
466
|
|
|
466
467
|
}
|
|
467
468
|
|
|
468
|
-
function computeIntroFor( requestPackages ) {
|
|
469
|
+
function computeIntroFor( requestPackages = [] ) {
|
|
470
|
+
|
|
471
|
+
let intro = ''
|
|
472
|
+
|
|
473
|
+
for ( const requestPackage of requestPackages ) {
|
|
474
|
+
intro += `if( ${ requestPackage } === undefined ) { throw new Error('${ getPrettyPackageName() } need ${ requestPackage } to be defined first. Please check your scripts loading order.') }` + '\n'
|
|
475
|
+
}
|
|
469
476
|
|
|
470
|
-
return
|
|
477
|
+
return intro
|
|
471
478
|
|
|
472
479
|
}
|
|
473
480
|
|
|
@@ -527,11 +534,11 @@ function createRollupConfigs( options = undefined ) {
|
|
|
527
534
|
const outputPath = ( isProd ) ? join( output, `${ fileName }.min.${ extension }` ) : join( output, `${ fileName }.${ extension }` )
|
|
528
535
|
|
|
529
536
|
configs.push( {
|
|
530
|
-
input:
|
|
531
|
-
external:
|
|
537
|
+
input: input,
|
|
538
|
+
external: ( format === 'cjs' ) ? [
|
|
532
539
|
'fs'
|
|
533
540
|
] : [],
|
|
534
|
-
plugins:
|
|
541
|
+
plugins: [
|
|
535
542
|
replace( {
|
|
536
543
|
defines: {
|
|
537
544
|
IS_REMOVE_ON_BUILD: false,
|
|
@@ -546,7 +553,7 @@ function createRollupConfigs( options = undefined ) {
|
|
|
546
553
|
} ),
|
|
547
554
|
isProd && terser()
|
|
548
555
|
],
|
|
549
|
-
onwarn:
|
|
556
|
+
onwarn: ( {
|
|
550
557
|
loc,
|
|
551
558
|
frame,
|
|
552
559
|
message
|
|
@@ -556,11 +563,11 @@ function createRollupConfigs( options = undefined ) {
|
|
|
556
563
|
if ( message.includes( 'Circular dependency' ) ) { return }
|
|
557
564
|
if ( message.includes( 'plugin uglify is deprecated' ) ) { return }
|
|
558
565
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
566
|
+
let errorMessage = ( loc )
|
|
567
|
+
? `/!\\ ${ loc.file } (${ loc.line }:${ loc.column }) ${ frame } ${ message }\n`
|
|
568
|
+
: `/!\\ ${ message }\n`
|
|
569
|
+
|
|
570
|
+
log( red( errorMessage ) )
|
|
564
571
|
|
|
565
572
|
},
|
|
566
573
|
treeshake: treeshake,
|
|
@@ -611,7 +618,47 @@ function logLoadingTask( filename ) {
|
|
|
611
618
|
|
|
612
619
|
}
|
|
613
620
|
|
|
614
|
-
///
|
|
621
|
+
/// Text Management
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
function alignTextCenter( text, width ) {
|
|
625
|
+
|
|
626
|
+
const unstyledText = unstyle( text.repeat( 1 ) )
|
|
627
|
+
const marginLength = ( width - unstyledText.length ) / 2
|
|
628
|
+
|
|
629
|
+
let leftMargin, rightMargin
|
|
630
|
+
if ( Number.isInteger( marginLength ) ) {
|
|
631
|
+
leftMargin = marginLength
|
|
632
|
+
rightMargin = marginLength
|
|
633
|
+
} else {
|
|
634
|
+
const flooredMargin = Math.floor( marginLength )
|
|
635
|
+
leftMargin = flooredMargin
|
|
636
|
+
rightMargin = flooredMargin + 1
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
return ' '.repeat( leftMargin ) + text + ' '.repeat( rightMargin )
|
|
640
|
+
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
function alignTextLeft( text, width ) {
|
|
644
|
+
|
|
645
|
+
const unstyledText = unstyle( text.repeat( 1 ) )
|
|
646
|
+
let repeatTime = width - unstyledText.length
|
|
647
|
+
repeatTime = ( repeatTime > 0 ) ? repeatTime : 0
|
|
648
|
+
|
|
649
|
+
return text + ' '.repeat( repeatTime )
|
|
650
|
+
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
function alignTextRight( text, width ) {
|
|
654
|
+
|
|
655
|
+
const unstyledText = unstyle( text.repeat( 1 ) )
|
|
656
|
+
let repeatTime = width - unstyledText.length
|
|
657
|
+
repeatTime = ( repeatTime > 0 ) ? repeatTime : 0
|
|
658
|
+
|
|
659
|
+
return ' '.repeat( repeatTime ) + text
|
|
660
|
+
|
|
661
|
+
}
|
|
615
662
|
|
|
616
663
|
function IndenterFactory( indentationChar = '\t', indentationLevel = 5 ) {
|
|
617
664
|
|
|
@@ -710,6 +757,9 @@ export {
|
|
|
710
757
|
|
|
711
758
|
logLoadingTask,
|
|
712
759
|
|
|
760
|
+
alignTextCenter,
|
|
761
|
+
alignTextLeft,
|
|
762
|
+
alignTextRight,
|
|
713
763
|
IndenterFactory as Indenter
|
|
714
764
|
}</pre>
|
|
715
765
|
</article>
|
|
@@ -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: cleans/clean.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>
|
package/docs/global.html
CHANGED
|
@@ -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 Global</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>
|
|
@@ -589,7 +589,7 @@ Todo: Check for different target env like next task below this one
|
|
|
589
589
|
<ul class="dummy">
|
|
590
590
|
<li>
|
|
591
591
|
<a href="-_utils.mjs.html">_utils.mjs</a>,
|
|
592
|
-
<a href="-_utils.mjs.html#sunlight-1-line-
|
|
592
|
+
<a href="-_utils.mjs.html#sunlight-1-line-432">line 432</a>
|
|
593
593
|
</li>
|
|
594
594
|
</ul>
|
|
595
595
|
</dd>
|
|
@@ -789,7 +789,7 @@ Todo: Check for different target env like next task below this one
|
|
|
789
789
|
<ul class="dummy">
|
|
790
790
|
<li>
|
|
791
791
|
<a href="helps_help.task.mjs.html">helps/help.task.mjs</a>,
|
|
792
|
-
<a href="helps_help.task.mjs.html#sunlight-1-line-
|
|
792
|
+
<a href="helps_help.task.mjs.html#sunlight-1-line-26">line 26</a>
|
|
793
793
|
</li>
|
|
794
794
|
</ul>
|
|
795
795
|
</dd>
|
|
@@ -965,7 +965,7 @@ Todo: Check for different target env like next task below this one
|
|
|
965
965
|
<ul class="dummy">
|
|
966
966
|
<li>
|
|
967
967
|
<a href="patches_patch.task.mjs.html">patches/patch.task.mjs</a>,
|
|
968
|
-
<a href="patches_patch.task.mjs.html#sunlight-1-line-
|
|
968
|
+
<a href="patches_patch.task.mjs.html#sunlight-1-line-10">line 10</a>
|
|
969
969
|
</li>
|
|
970
970
|
</ul>
|
|
971
971
|
</dd>
|
|
@@ -1262,7 +1262,7 @@ Todo: Check for different target env like next task below this one
|
|
|
1262
1262
|
|
|
1263
1263
|
<hr>
|
|
1264
1264
|
<dt>
|
|
1265
|
-
<h4 class="name" id="runBenchmarksForFrontendTask"><span class="type-signature"
|
|
1265
|
+
<h4 class="name" id="runBenchmarksForFrontendTask"><span class="type-signature"><async> </span>runBenchmarksForFrontendTask()</h4>
|
|
1266
1266
|
|
|
1267
1267
|
|
|
1268
1268
|
</dt>
|
|
@@ -1438,7 +1438,7 @@ Todo: Check for different target env like next task below this one
|
|
|
1438
1438
|
|
|
1439
1439
|
<hr>
|
|
1440
1440
|
<dt>
|
|
1441
|
-
<h4 class="name" id="runUnitTestsForFrontendTask"><span class="type-signature"
|
|
1441
|
+
<h4 class="name" id="runUnitTestsForFrontendTask"><span class="type-signature"><async> </span>runUnitTestsForFrontendTask()</h4>
|
|
1442
1442
|
|
|
1443
1443
|
|
|
1444
1444
|
</dt>
|