@itee/tasks 1.4.4 → 1.4.5

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 +5 -0
  2. package/package.json +3 -3
  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,438 +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.4.3 Source: tests/benchmarks/compute-benchmarks.task.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.4.3</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#alignTextCenter">alignTextCenter</a></li><li><a href="global.html#alignTextLeft">alignTextLeft</a></li><li><a href="global.html#alignTextRight">alignTextRight</a></li><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><li><a href="global.html#toCamelCase">toCamelCase</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: tests/benchmarks/compute-benchmarks.task.mjs</h1>
69
-
70
- <section>
71
- <article>
72
- <pre
73
- class="sunlight-highlight-javascript linenums">import childProcess from 'node:child_process'
74
- import {
75
- basename,
76
- dirname,
77
- extname,
78
- join,
79
- relative
80
- } from 'node:path'
81
- import {
82
- red,
83
- yellow
84
- } from '../../utils/colors.mjs'
85
- import {
86
- createDirectoryIfNotExist,
87
- createFile,
88
- getJavascriptSourceFiles,
89
- } from '../../utils/files.mjs'
90
- import {
91
- log,
92
- logLoadingTask
93
- } from '../../utils/loggings.mjs'
94
- import {
95
- getUnscopedPackageName,
96
- iteePackageSourcesDirectory,
97
- packageNodeModulesDirectory,
98
- packageSourcesDirectory,
99
- packageTestsBenchmarksDirectory
100
- } from '../../utils/packages.mjs'
101
- import { getTaskConfigurationFor } from '../../utils/tasks.mjs'
102
- import { toCamelCase } from '../../utils/texts.mjs'
103
-
104
- logLoadingTask( import.meta.filename )
105
-
106
- /**
107
- * @description Will generate benchmarks files from source code against provided alternatives
108
- */
109
- const computeBenchmarksTask = async ( done ) => {
110
-
111
- createDirectoryIfNotExist( packageTestsBenchmarksDirectory )
112
-
113
- // Get task configuration
114
- const filePathsToIgnore = await getTaskConfigurationFor( import.meta.filename )
115
- const sourceFiles = getJavascriptSourceFiles( filePathsToIgnore )
116
-
117
- const benchRootImports = []
118
- for ( let sourceFile of sourceFiles ) {
119
-
120
- const specificFilePath = sourceFile.replace( packageSourcesDirectory, '' )
121
- const specificDir = dirname( specificFilePath )
122
-
123
- const fileName = basename( sourceFile, extname( sourceFile ) )
124
- const camelCaseFileName = toCamelCase( fileName )
125
- const benchFileName = `${ camelCaseFileName }.bench.js`
126
- const benchDirPath = join( packageTestsBenchmarksDirectory, specificDir )
127
- const benchFilePath = join( benchDirPath, benchFileName )
128
-
129
- const nsName = `${ camelCaseFileName }Namespace`
130
- const importDirPath = relative( benchDirPath, packageSourcesDirectory )
131
- const importFilePath = join( importDirPath, specificFilePath ).replace( /\\/g, '/' )
132
-
133
- try {
134
-
135
- const jsdocPath = join( packageNodeModulesDirectory, '/jsdoc/jsdoc.js' )
136
- const jsdocOutput = childProcess.execFileSync( 'node', [ jsdocPath, '--explain', sourceFile ] ).toString()
137
-
138
- if ( jsdocOutput.includes( 'There are no input files to process' ) ) {
139
- log( 'Error ', red( `${ sourceFile }, no input files to process` ) )
140
- continue
141
- }
142
-
143
- const classNames = []
144
- const usedLongnames = []
145
- const jsonData = JSON.parse( jsdocOutput ).filter( data => {
146
-
147
- const longName = data.longname
148
-
149
- const kind = data.kind
150
- if ( kind !== 'function' ) {
151
- if ( kind === 'class' &amp;&amp; !classNames.includes( longName ) ) {
152
- classNames.push( longName )
153
- }
154
- return false
155
- }
156
-
157
- const scope = data.scope
158
- if ( ![ 'global', 'static' ].includes( scope ) ) {
159
- return false
160
- }
161
-
162
- if ( longName.startsWith( '_' ) || longName.includes( ' ' ) || longName.includes( '~' ) || usedLongnames.includes( longName ) ) {
163
- return false
164
- }
165
-
166
- const memberOf = data.memberof || ''
167
- if ( memberOf.includes( '.' ) ) {
168
- return false
169
- }
170
-
171
- for ( let className of classNames ) {
172
- if ( longName.includes( className ) ) {
173
- return false
174
- }
175
- }
176
-
177
- usedLongnames.push( longName )
178
-
179
- return true
180
-
181
- } )
182
-
183
- if ( jsonData.length === 0 ) {
184
- log( 'Ignoring', yellow( `${ sourceFile }, no usable exports found` ) )
185
- continue
186
- }
187
-
188
- // Compute benchmark suites by grouping logically function by name[_x]
189
- const suiteGroups = {}
190
- for ( let docData of jsonData ) {
191
-
192
- try {
193
-
194
- const functionName = docData.name
195
- const nameSplits = functionName.split( '_' )
196
- const rootName = nameSplits[ 0 ]
197
-
198
- if ( !( rootName in suiteGroups ) ) {
199
- suiteGroups[ rootName ] = []
200
- }
201
-
202
- suiteGroups[ rootName ].push( functionName )
203
-
204
- } catch ( error ) {
205
-
206
- log( red( error.message ) )
207
-
208
- }
209
-
210
- }
211
-
212
- // Generate suites
213
- let benchSuites = ''
214
- const suitesToExports = []
215
- for ( let suiteGroupName in suiteGroups ) {
216
- suitesToExports.push( `${ suiteGroupName }Suite` )
217
- benchSuites += `const ${ suiteGroupName }Suite = Benchmark.Suite( '${ nsName }.${ suiteGroupName }', Testing.createSuiteOptions() )` + '\n'
218
-
219
- for ( let suiteGroupValue of suiteGroups[ suiteGroupName ] ) {
220
- benchSuites += ` .add( '${ suiteGroupValue }()', Testing.iterateOverDataMap( ${ nsName }.${ suiteGroupValue } ), Testing.createBenchmarkOptions() )` + '\n'
221
- }
222
-
223
- benchSuites += '\n'
224
- }
225
-
226
- // compute relative level to get import wrappers
227
- const wrapperDirPath = relative( benchDirPath, iteePackageSourcesDirectory )
228
- const importBenchmarkFilePath = join( wrapperDirPath, 'utils', 'benchmarks.js' )
229
- const importTestingFilePath = join( wrapperDirPath, 'utils', 'testing.js' )
230
-
231
- const template = '' +
232
- `import * as ${ nsName } from '${ importFilePath }'` + '\n' +
233
- `import { getBenchmarkPackage } from '${ importBenchmarkFilePath }'` + '\n' +
234
- `import { getTestingPackage } from '${ importTestingFilePath }'` + '\n' +
235
- '\n' +
236
- `const Benchmark = await getBenchmarkPackage()` + '\n' +
237
- `const Testing = await getTestingPackage()` + '\n' +
238
- '\n' +
239
- `${ benchSuites }` +
240
- // '\n' +
241
- `export { ${ suitesToExports } }` + '\n' +
242
- '\n'
243
-
244
- const importBenchFilePath = relative( packageTestsBenchmarksDirectory, benchFilePath ).replace( /\\/g, '/' )
245
- benchRootImports.push( {
246
- path: importBenchFilePath,
247
- exports: suitesToExports
248
- } )
249
-
250
- createDirectoryIfNotExist( benchDirPath )
251
- createFile( benchFilePath, template )
252
-
253
- } catch ( error ) {
254
-
255
- log( red( error.message ) )
256
-
257
- }
258
-
259
- }
260
-
261
- let templateImports = ''
262
- let suites = []
263
- for ( let i = 0 ; i &lt; benchRootImports.length ; i++ ) {
264
-
265
- const currentBench = benchRootImports[ i ]
266
- const namedExports = currentBench.exports
267
- const imports = namedExports.join( ', ' )
268
- suites.push( ...namedExports )
269
-
270
- templateImports += `import {${ imports }} from './${ currentBench.path }'` + '\n'
271
-
272
- }
273
-
274
- // Use a fallback in case no benches were found at all
275
- if ( benchRootImports.length === 0 ) {
276
- log( 'Warning ', yellow( 'No usable exports found, generate default file to avoid frontend breakage.' ) )
277
- const defaultBenchesDir = join( packageTestsBenchmarksDirectory, 'default' )
278
- const defaultBenchesPath = join( defaultBenchesDir, 'default.bench.js' )
279
-
280
- createDirectoryIfNotExist( defaultBenchesDir )
281
- createFile( defaultBenchesPath, '// Avoid web test runner crash on empty benches' )
282
- }
283
-
284
- const benchesTemplate = '' +
285
- `${ templateImports }` + '\n' +
286
- 'const suites = [' + '\n' +
287
- `${ suites.map( suite => `\t${ suite }` ).join( ',\n' ) }` + '\n' +
288
- ']' + '\n' +
289
- '\n' +
290
- `for ( const suite of suites ) {` + '\n' +
291
- `\tsuite.run()` + '\n' +
292
- `}` + '\n'
293
-
294
- const benchesFilePath = join( packageTestsBenchmarksDirectory, `${ getUnscopedPackageName() }.benchmarks.js` )
295
- createFile( benchesFilePath, benchesTemplate )
296
-
297
- done()
298
-
299
- }
300
- computeBenchmarksTask.displayName = basename( import.meta.filename, '.task.mjs' )
301
- computeBenchmarksTask.description = 'Will generate benchmarks files from source code against provided alternatives.'
302
- computeBenchmarksTask.flags = null
303
-
304
- export { computeBenchmarksTask }</pre>
305
- </article>
306
- </section>
307
-
308
-
309
-
310
-
311
-
312
- </div>
313
- </div>
314
-
315
- <div class="clearfix"></div>
316
-
317
-
318
-
319
- </div>
320
- </div>
321
-
322
-
323
- <div class="modal fade" id="searchResults">
324
- <div class="modal-dialog">
325
- <div class="modal-content">
326
- <div class="modal-header">
327
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
328
- <h4 class="modal-title">Search results</h4>
329
- </div>
330
- <div class="modal-body"></div>
331
- <div class="modal-footer">
332
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
333
- </div>
334
- </div><!-- /.modal-content -->
335
- </div><!-- /.modal-dialog -->
336
- </div>
337
-
338
-
339
- <footer>
340
-
341
-
342
- <span class="copyright">
343
- Copyright 2015-Present <a href="https://github.com/Itee">Itee (Tristan Valcke)</a>
344
- </span>
345
-
346
- <span class="jsdoc-message">
347
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a>
348
-
349
- using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
350
- </span>
351
- </footer>
352
-
353
- <script src="scripts/docstrap.lib.js"></script>
354
- <script src="scripts/toc.js"></script>
355
-
356
- <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
357
-
358
-
359
- <script>
360
- $( function () {
361
- $( "[id*='$']" ).each( function () {
362
- var $this = $( this );
363
-
364
- $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
365
- } );
366
-
367
- $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
368
- var $this = $( this );
369
-
370
- var example = $this.find( "code" );
371
- exampleText = example.html();
372
- var lang = /{@lang (.*?)}/.exec( exampleText );
373
- if ( lang && lang[1] ) {
374
- exampleText = exampleText.replace( lang[0], "" );
375
- example.html( exampleText );
376
- lang = lang[1];
377
- } else {
378
- var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
379
- lang = langClassMatch ? langClassMatch[1] : "javascript";
380
- }
381
-
382
- if ( lang ) {
383
-
384
- $this
385
- .addClass( "sunlight-highlight-" + lang )
386
- .addClass( "linenums" )
387
- .html( example.html() );
388
-
389
- }
390
- } );
391
-
392
- Sunlight.highlightAll( {
393
- lineNumbers : true,
394
- showMenu : true,
395
- enableDoclinks : true
396
- } );
397
-
398
- $.catchAnchorLinks( {
399
- navbarOffset: 10
400
- } );
401
- $( "#toc" ).toc( {
402
- anchorName : function ( i, heading, prefix ) {
403
- return $( heading ).attr( "id" ) || ( prefix + i );
404
- },
405
- selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
406
- showAndHide : false,
407
- smoothScrolling: true
408
- } );
409
-
410
- $( "#main span[id^='toc']" ).addClass( "toc-shim" );
411
- $( '.dropdown-toggle' ).dropdown();
412
-
413
- $( "table" ).each( function () {
414
- var $this = $( this );
415
- $this.addClass('table');
416
- } );
417
-
418
- } );
419
- </script>
420
-
421
-
422
-
423
- <!--Navigation and Symbol Display-->
424
-
425
-
426
- <!--Google Analytics-->
427
-
428
-
429
-
430
- <script type="text/javascript">
431
- $(document).ready(function() {
432
- SearcherDisplay.init();
433
- });
434
- </script>
435
-
436
-
437
- </body>
438
- </html>
@@ -1,251 +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.4.3 Source: tests/benchmarks/run-benchmarks-for-backend.task.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.4.3</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#alignTextCenter">alignTextCenter</a></li><li><a href="global.html#alignTextLeft">alignTextLeft</a></li><li><a href="global.html#alignTextRight">alignTextRight</a></li><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><li><a href="global.html#toCamelCase">toCamelCase</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: tests/benchmarks/run-benchmarks-for-backend.task.mjs</h1>
69
-
70
- <section>
71
- <article>
72
- <pre
73
- class="sunlight-highlight-javascript linenums">import { existsSync } from 'node:fs'
74
- import {
75
- basename,
76
- join
77
- } from 'node:path'
78
- import {
79
- red,
80
- yellow
81
- } from '../../utils/colors.mjs'
82
- import {
83
- log,
84
- logLoadingTask
85
- } from '../../utils/loggings.mjs'
86
- import {
87
- getUnscopedPackageName,
88
- packageTestsBenchmarksDirectory
89
- } from '../../utils/packages.mjs'
90
-
91
- logLoadingTask( import.meta.filename )
92
-
93
- /**
94
- * @description Will run benchmarks with node
95
- */
96
- const runBenchmarksForBackendTask = async ( done ) => {
97
-
98
- const benchesPath = join( packageTestsBenchmarksDirectory, `/${ getUnscopedPackageName() }.benchmarks.js` )
99
- if ( !existsSync( benchesPath ) ) {
100
- log( yellow( `${ benchesPath } does not exist, skip backend benchmarks...` ) )
101
- done()
102
- return
103
- }
104
-
105
- try {
106
- await import(benchesPath)
107
- done()
108
- } catch ( error ) {
109
- done( red( error ) )
110
- }
111
-
112
- }
113
- runBenchmarksForBackendTask.displayName = basename( import.meta.filename, '.task.mjs' )
114
- runBenchmarksForBackendTask.description = 'Will run benchmarks with node'
115
- runBenchmarksForBackendTask.flags = null
116
-
117
- export { runBenchmarksForBackendTask }</pre>
118
- </article>
119
- </section>
120
-
121
-
122
-
123
-
124
-
125
- </div>
126
- </div>
127
-
128
- <div class="clearfix"></div>
129
-
130
-
131
-
132
- </div>
133
- </div>
134
-
135
-
136
- <div class="modal fade" id="searchResults">
137
- <div class="modal-dialog">
138
- <div class="modal-content">
139
- <div class="modal-header">
140
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
141
- <h4 class="modal-title">Search results</h4>
142
- </div>
143
- <div class="modal-body"></div>
144
- <div class="modal-footer">
145
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
146
- </div>
147
- </div><!-- /.modal-content -->
148
- </div><!-- /.modal-dialog -->
149
- </div>
150
-
151
-
152
- <footer>
153
-
154
-
155
- <span class="copyright">
156
- Copyright 2015-Present <a href="https://github.com/Itee">Itee (Tristan Valcke)</a>
157
- </span>
158
-
159
- <span class="jsdoc-message">
160
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a>
161
-
162
- using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
163
- </span>
164
- </footer>
165
-
166
- <script src="scripts/docstrap.lib.js"></script>
167
- <script src="scripts/toc.js"></script>
168
-
169
- <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
170
-
171
-
172
- <script>
173
- $( function () {
174
- $( "[id*='$']" ).each( function () {
175
- var $this = $( this );
176
-
177
- $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
178
- } );
179
-
180
- $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
181
- var $this = $( this );
182
-
183
- var example = $this.find( "code" );
184
- exampleText = example.html();
185
- var lang = /{@lang (.*?)}/.exec( exampleText );
186
- if ( lang && lang[1] ) {
187
- exampleText = exampleText.replace( lang[0], "" );
188
- example.html( exampleText );
189
- lang = lang[1];
190
- } else {
191
- var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
192
- lang = langClassMatch ? langClassMatch[1] : "javascript";
193
- }
194
-
195
- if ( lang ) {
196
-
197
- $this
198
- .addClass( "sunlight-highlight-" + lang )
199
- .addClass( "linenums" )
200
- .html( example.html() );
201
-
202
- }
203
- } );
204
-
205
- Sunlight.highlightAll( {
206
- lineNumbers : true,
207
- showMenu : true,
208
- enableDoclinks : true
209
- } );
210
-
211
- $.catchAnchorLinks( {
212
- navbarOffset: 10
213
- } );
214
- $( "#toc" ).toc( {
215
- anchorName : function ( i, heading, prefix ) {
216
- return $( heading ).attr( "id" ) || ( prefix + i );
217
- },
218
- selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
219
- showAndHide : false,
220
- smoothScrolling: true
221
- } );
222
-
223
- $( "#main span[id^='toc']" ).addClass( "toc-shim" );
224
- $( '.dropdown-toggle' ).dropdown();
225
-
226
- $( "table" ).each( function () {
227
- var $this = $( this );
228
- $this.addClass('table');
229
- } );
230
-
231
- } );
232
- </script>
233
-
234
-
235
-
236
- <!--Navigation and Symbol Display-->
237
-
238
-
239
- <!--Google Analytics-->
240
-
241
-
242
-
243
- <script type="text/javascript">
244
- $(document).ready(function() {
245
- SearcherDisplay.init();
246
- });
247
- </script>
248
-
249
-
250
- </body>
251
- </html>