@itee/tasks 1.4.4 → 1.4.6

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 (61) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +5 -5
  3. package/sources/utils/testing.js +1 -1
  4. package/docs/-_utils.mjs.html +0 -898
  5. package/docs/cleans_clean.task.mjs.html +0 -238
  6. package/docs/fonts/glyphicons-halflings-regular.eot +0 -0
  7. package/docs/fonts/glyphicons-halflings-regular.svg +0 -288
  8. package/docs/fonts/glyphicons-halflings-regular.ttf +0 -0
  9. package/docs/fonts/glyphicons-halflings-regular.woff +0 -0
  10. package/docs/fonts/glyphicons-halflings-regular.woff2 +0 -0
  11. package/docs/global.html +0 -2200
  12. package/docs/helps_help.task.mjs.html +0 -326
  13. package/docs/img/glyphicons-halflings-white.png +0 -0
  14. package/docs/img/glyphicons-halflings.png +0 -0
  15. package/docs/index.html +0 -228
  16. package/docs/lints_lint.task.mjs.html +0 -255
  17. package/docs/patches_patch.task.mjs.html +0 -252
  18. package/docs/quicksearch.html +0 -31
  19. package/docs/releases_release.task.mjs.html +0 -238
  20. package/docs/scripts/docstrap.lib.js +0 -11
  21. package/docs/scripts/fulltext-search-ui.js +0 -89
  22. package/docs/scripts/fulltext-search.js +0 -36
  23. package/docs/scripts/lunr.min.js +0 -6
  24. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
  25. package/docs/scripts/prettify/jquery.min.js +0 -6
  26. package/docs/scripts/prettify/lang-css.js +0 -21
  27. package/docs/scripts/prettify/prettify.js +0 -496
  28. package/docs/scripts/sunlight.js +0 -1157
  29. package/docs/scripts/toc.js +0 -203
  30. package/docs/styles/darkstrap.css +0 -960
  31. package/docs/styles/prettify-tomorrow.css +0 -132
  32. package/docs/styles/site.cerulean.css +0 -7008
  33. package/docs/styles/site.cosmo.css +0 -7061
  34. package/docs/styles/site.cyborg.css +0 -7048
  35. package/docs/styles/site.darkly.css +0 -7171
  36. package/docs/styles/site.darkstrap.css +0 -5638
  37. package/docs/styles/site.dibs-bootstrap.css +0 -5899
  38. package/docs/styles/site.flatly.css +0 -7147
  39. package/docs/styles/site.journal.css +0 -6973
  40. package/docs/styles/site.lumen.css +0 -7298
  41. package/docs/styles/site.paper.css +0 -7623
  42. package/docs/styles/site.readable.css +0 -6997
  43. package/docs/styles/site.sandstone.css +0 -7035
  44. package/docs/styles/site.simplex.css +0 -7023
  45. package/docs/styles/site.slate.css +0 -7343
  46. package/docs/styles/site.spacelab.css +0 -7055
  47. package/docs/styles/site.superhero.css +0 -7131
  48. package/docs/styles/site.united.css +0 -6895
  49. package/docs/styles/site.yeti.css +0 -7195
  50. package/docs/styles/sunlight.dark.css +0 -345
  51. package/docs/styles/sunlight.default.css +0 -344
  52. package/docs/tests_benchmarks_compute-benchmarks.task.mjs.html +0 -438
  53. package/docs/tests_benchmarks_run-benchmarks-for-backend.task.mjs.html +0 -251
  54. package/docs/tests_benchmarks_run-benchmarks-for-frontend.task.mjs.html +0 -252
  55. package/docs/tests_bundlings_check-bundling-from-esm-files-direct.task.mjs.html +0 -288
  56. package/docs/tests_bundlings_check-bundling.task.mjs.html +0 -231
  57. package/docs/tests_run-tests.task.mjs.html +0 -228
  58. package/docs/tests_units_compute-unit-tests.task.mjs.html +0 -758
  59. package/docs/tests_units_run-unit-tests-for-backend.task.mjs.html +0 -256
  60. package/docs/tests_units_run-unit-tests-for-frontend.task.mjs.html +0 -252
  61. package/docs/utils_texts.mjs.html +0 -328
@@ -1,898 +0,0 @@
1
- <!DOCTYPE html>
2
-
3
- <html lang="en">
4
- <head>
5
- <meta charset="utf-8">
6
- <meta name="viewport" content="width=device-width">
7
- <title>@itee/tasks v1.3.0 Source: _utils.mjs</title>
8
-
9
- <!--[if lt IE 9]>
10
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11
- <![endif]-->
12
- <link type="text/css" rel="stylesheet" href="styles/sunlight.dark.css">
13
-
14
- <link type="text/css" rel="stylesheet" href="styles/site.cyborg.css">
15
-
16
- </head>
17
-
18
- <body>
19
-
20
- <div class="navbar navbar-default navbar-fixed-top ">
21
- <div class="container">
22
- <div class="navbar-header">
23
- <a class="navbar-brand" href="index.html">@itee/tasks v1.3.0</a>
24
- <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
25
- <span class="icon-bar"></span>
26
- <span class="icon-bar"></span>
27
- <span class="icon-bar"></span>
28
- </button>
29
- </div>
30
- <div class="navbar-collapse collapse" id="topNavigation">
31
- <ul class="nav navbar-nav">
32
-
33
- <li class="dropdown">
34
- <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
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#createRollupConfigs">createRollupConfigs</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
- </ul>
38
- </li>
39
-
40
- </ul>
41
-
42
- <div class="col-sm-3 col-md-3">
43
- <form class="navbar-form" role="search">
44
- <div class="input-group">
45
- <input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
46
- <div class="input-group-btn">
47
- <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
48
- </div>
49
- </div>
50
- </form>
51
- </div>
52
-
53
- </div>
54
-
55
- </div>
56
- </div>
57
-
58
-
59
- <div class="container" id="toc-content">
60
- <div class="row">
61
-
62
-
63
- <div class="col-md-12">
64
-
65
- <div id="main">
66
-
67
-
68
- <h1 class="page-title">Source: _utils.mjs</h1>
69
-
70
- <section>
71
- <article>
72
- <pre
73
- class="sunlight-highlight-javascript linenums">import commonjs from '@rollup/plugin-commonjs'
74
- import nodeResolve from '@rollup/plugin-node-resolve'
75
- import terser from '@rollup/plugin-terser'
76
- import colors from 'ansi-colors'
77
- import childProcess from 'child_process'
78
- import log from 'fancy-log'
79
- import figlet from 'figlet'
80
- import { glob } from 'glob'
81
- import {
82
- parallel,
83
- series
84
- } from 'gulp'
85
- import {
86
- existsSync,
87
- mkdirSync,
88
- readFileSync,
89
- writeFileSync
90
- } from 'node:fs'
91
- import {
92
- basename,
93
- dirname,
94
- extname,
95
- join,
96
- normalize,
97
- relative,
98
- } from 'node:path'
99
- import { fileURLToPath } from 'node:url'
100
- import replace from 'rollup-plugin-re'
101
-
102
- const {
103
- red,
104
- green,
105
- yellow,
106
- blue,
107
- magenta,
108
- cyan,
109
- unstyle
110
- } = colors
111
-
112
- /// Debugging
113
- /* global process */
114
- const isDebugging = ( process &amp;&amp; process.env &amp;&amp; process.env.RUNNER_DEBUG &amp;&amp; process.env.RUNNER_DEBUG === '1' )
115
-
116
- /// Package paths and data
117
-
118
- function _getPackageRootDirectory() {
119
-
120
- let __dirname
121
-
122
- if ( import.meta.dirname ) {
123
- __dirname = import.meta.dirname
124
- } else if ( import.meta.filename ) {
125
- __dirname = dirname( import.meta.filename )
126
- } else if ( import.meta.url ) {
127
- const __filename = fileURLToPath( import.meta.url )
128
- __dirname = dirname( __filename )
129
- } else {
130
- throw new Error( 'Unable to retrieve module dirname.' )
131
- }
132
-
133
- return join( __dirname, '..' )
134
-
135
- }
136
-
137
- const iteePackageRootDirectory = _getPackageRootDirectory()
138
- const iteePackageJsonPath = join( iteePackageRootDirectory, 'package.json' )
139
- const iteePackageConfigurationsDirectory = join( iteePackageRootDirectory, 'configs' )
140
- const iteePackageNodeModulesDirectory = join( iteePackageRootDirectory, 'node_modules' )
141
- const iteePackageSourcesDirectory = join( iteePackageRootDirectory, 'sources' )
142
-
143
- const packageRootDirectory = iteePackageRootDirectory.includes( 'node_modules' ) ? join( iteePackageRootDirectory, '../../../' ) : iteePackageRootDirectory
144
- const packageTasksDirectory = join( packageRootDirectory, '.tasks' )
145
- const packageTasksConfigurationsDirectory = join( packageTasksDirectory, 'configs' )
146
- const packageNodeModulesDirectory = join( packageRootDirectory, 'node_modules' )
147
- const packageBuildsDirectory = join( packageRootDirectory, 'builds' )
148
- const packageSourcesDirectory = join( packageRootDirectory, 'sources' )
149
- const packageSourcesBackendDirectory = join( packageSourcesDirectory, 'backend' )
150
- const packageSourcesCommonDirectory = join( packageSourcesDirectory, 'common' )
151
- const packageSourcesFrontendDirectory = join( packageSourcesDirectory, 'frontend' )
152
- const packageTestsDirectory = join( packageRootDirectory, 'tests' )
153
- const packageTestsBenchmarksDirectory = join( packageTestsDirectory, 'benchmarks' )
154
- const packageTestsBundlesDirectory = join( packageTestsDirectory, 'bundles' )
155
- const packageTestsUnitsDirectory = join( packageTestsDirectory, 'units' )
156
- const packageDocsDirectory = join( packageRootDirectory, 'docs' )
157
- const packageTutorialsDirectory = join( packageRootDirectory, 'tutorials' )
158
- const packageJsonPath = join( packageRootDirectory, 'package.json' )
159
-
160
- ///
161
-
162
- const packageJson = getJsonFrom( packageJsonPath )
163
- const packageName = packageJson.name
164
- const packageVersion = packageJson.version
165
- const packageDescription = packageJson.description
166
- const packageAuthor = packageJson.author
167
- const packageLicense = packageJson.license
168
-
169
- function getPrettyPackageName( separator = ' ' ) {
170
-
171
- let prettyPackageName = ''
172
-
173
- const nameSplits = packageName.split( '-' )
174
- for ( const nameSplit of nameSplits ) {
175
- prettyPackageName += nameSplit.charAt( 0 ).toUpperCase() + nameSplit.slice( 1 ) + separator
176
- }
177
- prettyPackageName = prettyPackageName.slice( 0, -1 )
178
-
179
- return prettyPackageName
180
-
181
- }
182
-
183
- function getPrettyPackageVersion() {
184
-
185
- return 'v' + packageVersion
186
-
187
- }
188
-
189
- function getPrettyNodeVersion() {
190
-
191
- let nodeVersion = 'vX.x.ₓ'
192
-
193
- try {
194
- nodeVersion = childProcess.execFileSync( 'node', [ '--version' ] )
195
- .toString()
196
- .replace( /(\r\n|\n|\r)/gm, '' )
197
- } catch ( e ) {
198
- log( red( e ) )
199
-
200
- if ( e.message.includes( 'ENOENT' ) ) {
201
- nodeVersion += yellow( ' Not seems to be accessible from the path environment.' )
202
- }
203
- }
204
-
205
- return ' node: ' + nodeVersion
206
-
207
- }
208
-
209
- function getPrettyNpmVersion() {
210
-
211
- let npmVersion = 'X.x.ₓ'
212
-
213
- try {
214
- npmVersion = childProcess.execFileSync( 'npm', [ '--version' ] )
215
- .toString()
216
- .replace( /(\r\n|\n|\r)/gm, '' )
217
- } catch ( e ) {
218
- log( red( e ) )
219
-
220
- if ( e.message.includes( 'ENOENT' ) ) {
221
- npmVersion += yellow( ' Not seems to be accessible from the path environment.' )
222
- }
223
- }
224
-
225
- return ' npm: v' + npmVersion
226
-
227
- }
228
-
229
- /// File system Management
230
-
231
- function createDirectoryIfNotExist( directoryPath ) {
232
-
233
- if ( !existsSync( directoryPath ) ) {
234
- log( 'Creating', green( directoryPath ) )
235
- mkdirSync( directoryPath, { recursive: true } )
236
- }
237
-
238
- }
239
-
240
- function getJsonFrom( path ) {
241
-
242
- const buffer = readFileSync( path )
243
- return JSON.parse( buffer.toString() )
244
-
245
- }
246
-
247
- function createFile( filePath, fileContent ) {
248
-
249
- log( 'Creating', green( filePath ) )
250
- writeFileSync( filePath, fileContent )
251
-
252
- }
253
-
254
- function getFilesFrom( globPattern, filter = ( /*any*/ ) => true ) {
255
-
256
- return glob.sync( globPattern )
257
- .map( filePath => normalize( filePath ) )
258
- .filter( filter )
259
-
260
- }
261
-
262
- /// Task Management
263
-
264
- async function getTasksFrom( taskFiles = [] ) {
265
-
266
- const tasks = []
267
- for ( const taskFile of taskFiles ) {
268
- const relativeTaskFile = relative( packageRootDirectory, taskFile )
269
-
270
- try {
271
-
272
- const module = await import(taskFile)
273
-
274
- const exportStrings = []
275
- for ( const moduleKey in module ) {
276
- const task = module[ moduleKey ]
277
- tasks.push( task )
278
-
279
- const name = task.name ?? null
280
- const displayName = task.displayName ?? null
281
- const fullName = ( moduleKey !== name ) ? `${ blue( moduleKey ) }( ${ magenta( name ) } )` : `${ blue( name ) }`
282
- const exportAs = ( displayName ) ? ` as ${ cyan( displayName ) }` : ''
283
- const exportString = fullName + exportAs
284
- exportStrings.push( exportString )
285
- }
286
-
287
- //log( 'Process ', green( relativeTaskFile ), `with task${ ( exportStrings.length > 1 ) ? 's' : '' }`, exportStrings.join( ', ' ) )
288
-
289
- } catch ( error ) {
290
-
291
- log( 'Error ', red( relativeTaskFile ), error.message )
292
-
293
- }
294
-
295
- }
296
-
297
- return tasks
298
-
299
- }
300
-
301
- async function serializeTasksFrom( taskFiles = [] ) {
302
-
303
- const tasks = await getTasksFrom( taskFiles )
304
- return series( ...tasks )
305
-
306
- }
307
-
308
- async function parallelizeTasksFrom( taskFiles = [] ) {
309
-
310
- const tasks = await getTasksFrom( taskFiles )
311
- return parallel( ...tasks )
312
-
313
- }
314
-
315
- /// Task configuration management
316
-
317
- function getTaskConfigurationPathFor( filename ) {
318
-
319
- // Get relative path of the task between internal or user defined
320
- let relativeTaskPath = filename.includes( iteePackageSourcesDirectory )
321
- ? relative( iteePackageSourcesDirectory, filename )
322
- : relative( packageTasksDirectory, filename )
323
-
324
- // Generate all possible config file path depending on file extension and default or user defined
325
- const terminalExtension = extname( relativeTaskPath )
326
- const searchValue = relativeTaskPath.includes( '.task.' ) ? `.task${ terminalExtension }` : terminalExtension
327
- const replaceValues = [
328
- '.conf.json',
329
- '.conf.js',
330
- '.conf.cjs',
331
- '.conf.mjs',
332
- ]
333
-
334
- const packageConfigurationPaths = []
335
- const defaultConfigurationPaths = []
336
-
337
- for ( const replaceValue of replaceValues ) {
338
- const configurationLocation = relativeTaskPath.replace( searchValue, replaceValue )
339
- const packageConfigurationPath = join( packageTasksConfigurationsDirectory, configurationLocation )
340
- const defaultConfigurationPath = join( iteePackageConfigurationsDirectory, configurationLocation )
341
-
342
- packageConfigurationPaths.push( packageConfigurationPath )
343
- defaultConfigurationPaths.push( defaultConfigurationPath )
344
- }
345
-
346
- // Take care of the configuration search order (package first then default !)
347
- const configurationPaths = [ ...packageConfigurationPaths, ...defaultConfigurationPaths ]
348
- let configurationPath = undefined
349
-
350
- // Looking for existing configuration file
351
- for ( const packageConfigurationPath of configurationPaths ) {
352
-
353
- if ( existsSync( packageConfigurationPath ) ) {
354
- configurationPath = packageConfigurationPath
355
- break
356
- }
357
-
358
- }
359
-
360
- // Else throw an error
361
- if ( !configurationPath ) {
362
- throw new Error( `Unable to find configuration in package configuration paths ${ configurationPaths.join( ', ' ) }.` )
363
- }
364
-
365
- return configurationPath
366
-
367
- }
368
-
369
- async function getTaskConfigurationFor( filename ) {
370
-
371
- const configurationFilePath = getTaskConfigurationPathFor( filename )
372
-
373
- log( `Loading configuration from ${ cyan( configurationFilePath ) }` )
374
-
375
- let configuration = null
376
-
377
- try {
378
-
379
- if ( extname( configurationFilePath ) === '.json' ) {
380
-
381
- configuration = getJsonFrom( configurationFilePath )
382
-
383
- } else {
384
-
385
- const moduleData = await import( configurationFilePath )
386
- configuration = moduleData.default
387
-
388
- }
389
-
390
- } catch ( e ) {
391
-
392
- log( red( e ) )
393
-
394
- }
395
-
396
- return configuration
397
-
398
- }
399
-
400
- /// Build management
401
-
402
- function getPrettyFormatForBanner( format ) {
403
-
404
- let prettyFormat = ''
405
-
406
- switch ( format ) {
407
-
408
- case 'cjs':
409
- prettyFormat = 'CommonJs'
410
- break
411
-
412
- case 'esm':
413
- prettyFormat = 'EsModule'
414
- break
415
-
416
- case 'iife':
417
- prettyFormat = 'Standalone'
418
- break
419
-
420
- case 'umd':
421
- prettyFormat = 'Universal'
422
- break
423
-
424
- default:
425
- throw new RangeError( `Invalid switch parameter: ${ format }` )
426
-
427
- }
428
-
429
- return prettyFormat
430
-
431
- }
432
-
433
- function convertBannerIntoComment( banner ) {
434
-
435
- let bannerCommented = '/**\n'
436
- bannerCommented += ' * '
437
- bannerCommented += banner.replaceAll( '\n', '\n * ' )
438
- bannerCommented += '\n'
439
- bannerCommented += ` * @desc ${ packageDescription }\n`
440
- bannerCommented += ' * @author [Tristan Valcke]{@link https://github.com/Itee}\n'
441
- bannerCommented += ' * @license [BSD-3-Clause]{@link https://opensource.org/licenses/BSD-3-Clause}\n'
442
- bannerCommented += ' * \n'
443
- bannerCommented += ' */'
444
-
445
- return bannerCommented
446
-
447
- }
448
-
449
- function computeBannerFor( format ) {
450
-
451
- const packageName = getPrettyPackageName( '.' )
452
- const packageVersion = getPrettyPackageVersion()
453
- const prettyFormat = getPrettyFormatForBanner( format )
454
-
455
- const figText = figlet.textSync(
456
- `${ packageName } ${ packageVersion } - ${ prettyFormat }`,
457
- {
458
- font: 'Tmplr',
459
- horizontalLayout: 'default',
460
- verticalLayout: 'default',
461
- whitespaceBreak: true,
462
- }
463
- )
464
-
465
- return convertBannerIntoComment( figText )
466
-
467
- }
468
-
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
- }
476
-
477
- return intro
478
-
479
- }
480
-
481
- function getOutputFileExtensionBasedOnFileFormat( format ) {
482
-
483
- let extension
484
-
485
- if ( format === 'cjs' ) {
486
- extension = 'cjs'
487
- } else if ( format === 'esm' ) {
488
- extension = 'mjs'
489
- } else {
490
- extension = 'js'
491
- }
492
-
493
- return extension
494
-
495
- }
496
-
497
- /**
498
- * Will create an appropriate configuration object for rollup, related to the given arguments.
499
- *
500
- * @generator
501
- * @param options
502
- * @return {Array.&lt;json>} An array of rollup configuration
503
- */
504
- function createRollupConfigs( options = undefined ) {
505
-
506
- const _options = options ? options : {
507
- input: join( packageSourcesDirectory, `${ packageName }.js` ),
508
- output: packageBuildsDirectory,
509
- formats: [ 'esm', 'cjs', 'iife' ],
510
- envs: [ 'dev', 'prod' ],
511
- treeshake: true
512
- }
513
-
514
- const {
515
- input,
516
- output,
517
- formats,
518
- envs,
519
- treeshake
520
- } = _options
521
- const name = getPrettyPackageName( '.' )
522
- const fileName = basename( input, '.js' )
523
-
524
- const configs = []
525
-
526
- for ( let formatIndex = 0, numberOfFormats = formats.length ; formatIndex &lt; numberOfFormats ; ++formatIndex ) {
527
-
528
- for ( let envIndex = 0, numberOfEnvs = envs.length ; envIndex &lt; numberOfEnvs ; envIndex++ ) {
529
-
530
- const env = envs[ envIndex ]
531
- const isProd = ( env.includes( 'prod' ) )
532
- const format = formats[ formatIndex ]
533
- const extension = getOutputFileExtensionBasedOnFileFormat( format )
534
- const outputPath = ( isProd ) ? join( output, `${ fileName }.min.${ extension }` ) : join( output, `${ fileName }.${ extension }` )
535
-
536
- configs.push( {
537
- input: input,
538
- external: ( format === 'cjs' ) ? [
539
- 'fs'
540
- ] : [],
541
- plugins: [
542
- replace( {
543
- defines: {
544
- IS_REMOVE_ON_BUILD: false,
545
- IS_BACKEND_SPECIFIC: ( format === 'cjs' )
546
- }
547
- } ),
548
- commonjs( {
549
- include: 'node_modules/**'
550
- } ),
551
- nodeResolve( {
552
- preferBuiltins: true
553
- } ),
554
- isProd &amp;&amp; terser()
555
- ],
556
- onwarn: ( {
557
- loc,
558
- frame,
559
- message
560
- } ) => {
561
-
562
- // Ignore some errors
563
- if ( message.includes( 'Circular dependency' ) ) { return }
564
- if ( message.includes( 'plugin uglify is deprecated' ) ) { return }
565
-
566
- let errorMessage = ( loc )
567
- ? `/!\\ ${ loc.file } (${ loc.line }:${ loc.column }) ${ frame } ${ message }\n`
568
- : `/!\\ ${ message }\n`
569
-
570
- log( red( errorMessage ) )
571
-
572
- },
573
- treeshake: treeshake,
574
- output: {
575
- // core options
576
- file: outputPath,
577
- format: format,
578
- name: name,
579
- globals: {},
580
-
581
- // advanced options
582
- paths: {},
583
- banner: ( isProd ) ? '' : computeBannerFor( format ),
584
- footer: '',
585
- intro: ( !isProd &amp;&amp; format === 'iife' ) ? computeIntroFor() : '',
586
- outro: '',
587
- sourcemap: !isProd,
588
- interop: 'auto',
589
-
590
- // danger zone
591
- exports: 'auto',
592
- amd: {},
593
- indent: '\t',
594
- strict: true
595
- }
596
- } )
597
-
598
- }
599
-
600
- }
601
-
602
- return configs
603
-
604
- }
605
-
606
- /// Log Management
607
-
608
- function logLoadingTask( filename ) {
609
-
610
- if ( !isDebugging ) {
611
- return
612
- }
613
-
614
- const taskPath = relative( packageRootDirectory, filename )
615
- const taskName = basename( filename, '.task.mjs' )
616
-
617
- log( `Loading ${ green( taskPath ) } with task ${ blue( taskName ) }` )
618
-
619
- }
620
-
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
- }
662
-
663
- function IndenterFactory( indentationChar = '\t', indentationLevel = 5 ) {
664
-
665
- const indentationLevels = {}
666
- let currentProperty = 'I_'
667
- for ( let currentIndentationLevel = 1 ; currentIndentationLevel &lt;= indentationLevel ; currentIndentationLevel++ ) {
668
- indentationLevels[ currentProperty ] = indentationChar.repeat( currentIndentationLevel )
669
- currentProperty += '_'
670
- }
671
-
672
- return {
673
- I: new Indenter( indentationChar ),
674
- ...indentationLevels
675
- }
676
-
677
- }
678
-
679
- class Indenter {
680
-
681
- constructor( indentationChar = '\t' ) {
682
-
683
- this.indentationChar = indentationChar
684
- this.currentIndentationLevel = 0
685
-
686
- }
687
-
688
- _( indentationLevel = null ) {
689
- return this.indentationChar.repeat( indentationLevel ?? this.currentIndentationLevel )
690
- }
691
-
692
- deeper( level = 1 ) {
693
- this.currentIndentationLevel += level
694
- }
695
-
696
- shallower( level = 1 ) {
697
- this.currentIndentationLevel -= level
698
- }
699
-
700
- }
701
-
702
- ///
703
-
704
- export {
705
- iteePackageRootDirectory,
706
- iteePackageJsonPath,
707
- iteePackageConfigurationsDirectory,
708
- iteePackageNodeModulesDirectory,
709
- iteePackageSourcesDirectory,
710
-
711
- packageRootDirectory,
712
- packageTasksDirectory,
713
- packageTasksConfigurationsDirectory,
714
- packageNodeModulesDirectory,
715
- packageBuildsDirectory,
716
- packageSourcesDirectory,
717
- packageSourcesBackendDirectory,
718
- packageSourcesCommonDirectory,
719
- packageSourcesFrontendDirectory,
720
- packageTestsDirectory,
721
- packageTestsBenchmarksDirectory,
722
- packageTestsBundlesDirectory,
723
- packageTestsUnitsDirectory,
724
- packageDocsDirectory,
725
- packageTutorialsDirectory,
726
- packageJsonPath,
727
-
728
- packageJson,
729
- packageName,
730
- packageVersion,
731
- packageDescription,
732
- packageAuthor,
733
- packageLicense,
734
- getPrettyPackageName,
735
- getPrettyPackageVersion,
736
- getPrettyNodeVersion,
737
- getPrettyNpmVersion,
738
-
739
-
740
- createDirectoryIfNotExist,
741
- getJsonFrom,
742
- createFile,
743
- getFilesFrom,
744
-
745
- getTasksFrom,
746
- serializeTasksFrom,
747
- parallelizeTasksFrom,
748
-
749
- getTaskConfigurationPathFor,
750
- getTaskConfigurationFor,
751
-
752
- getPrettyFormatForBanner,
753
- convertBannerIntoComment,
754
- computeBannerFor,
755
- computeIntroFor,
756
- createRollupConfigs,
757
-
758
- logLoadingTask,
759
-
760
- alignTextCenter,
761
- alignTextLeft,
762
- alignTextRight,
763
- IndenterFactory as Indenter
764
- }</pre>
765
- </article>
766
- </section>
767
-
768
-
769
-
770
-
771
-
772
- </div>
773
- </div>
774
-
775
- <div class="clearfix"></div>
776
-
777
-
778
-
779
- </div>
780
- </div>
781
-
782
-
783
- <div class="modal fade" id="searchResults">
784
- <div class="modal-dialog">
785
- <div class="modal-content">
786
- <div class="modal-header">
787
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
788
- <h4 class="modal-title">Search results</h4>
789
- </div>
790
- <div class="modal-body"></div>
791
- <div class="modal-footer">
792
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
793
- </div>
794
- </div><!-- /.modal-content -->
795
- </div><!-- /.modal-dialog -->
796
- </div>
797
-
798
-
799
- <footer>
800
-
801
-
802
- <span class="copyright">
803
- Copyright 2015-Present <a href="https://github.com/Itee">Itee</a> (Tristan Valcke)
804
- </span>
805
-
806
- <span class="jsdoc-message">
807
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a>
808
-
809
- using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
810
- </span>
811
- </footer>
812
-
813
- <script src="scripts/docstrap.lib.js"></script>
814
- <script src="scripts/toc.js"></script>
815
-
816
- <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
817
-
818
-
819
- <script>
820
- $( function () {
821
- $( "[id*='$']" ).each( function () {
822
- var $this = $( this );
823
-
824
- $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
825
- } );
826
-
827
- $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
828
- var $this = $( this );
829
-
830
- var example = $this.find( "code" );
831
- exampleText = example.html();
832
- var lang = /{@lang (.*?)}/.exec( exampleText );
833
- if ( lang && lang[1] ) {
834
- exampleText = exampleText.replace( lang[0], "" );
835
- example.html( exampleText );
836
- lang = lang[1];
837
- } else {
838
- var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
839
- lang = langClassMatch ? langClassMatch[1] : "javascript";
840
- }
841
-
842
- if ( lang ) {
843
-
844
- $this
845
- .addClass( "sunlight-highlight-" + lang )
846
- .addClass( "linenums" )
847
- .html( example.html() );
848
-
849
- }
850
- } );
851
-
852
- Sunlight.highlightAll( {
853
- lineNumbers : true,
854
- showMenu : true,
855
- enableDoclinks : true
856
- } );
857
-
858
- $.catchAnchorLinks( {
859
- navbarOffset: 10
860
- } );
861
- $( "#toc" ).toc( {
862
- anchorName : function ( i, heading, prefix ) {
863
- return $( heading ).attr( "id" ) || ( prefix + i );
864
- },
865
- selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
866
- showAndHide : false,
867
- smoothScrolling: true
868
- } );
869
-
870
- $( "#main span[id^='toc']" ).addClass( "toc-shim" );
871
- $( '.dropdown-toggle' ).dropdown();
872
-
873
- $( "table" ).each( function () {
874
- var $this = $( this );
875
- $this.addClass('table');
876
- } );
877
-
878
- } );
879
- </script>
880
-
881
-
882
-
883
- <!--Navigation and Symbol Display-->
884
-
885
-
886
- <!--Google Analytics-->
887
-
888
-
889
-
890
- <script type="text/javascript">
891
- $(document).ready(function() {
892
- SearcherDisplay.init();
893
- });
894
- </script>
895
-
896
-
897
- </body>
898
- </html>