@itee/tasks 1.1.0 → 1.2.0

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 (63) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/configs/docs/doc.conf.mjs +55 -0
  3. package/docs/-_utils.mjs.html +848 -0
  4. package/docs/cleans_clean.task.mjs.html +239 -0
  5. package/docs/fonts/glyphicons-halflings-regular.eot +0 -0
  6. package/docs/fonts/glyphicons-halflings-regular.svg +288 -0
  7. package/docs/fonts/glyphicons-halflings-regular.ttf +0 -0
  8. package/docs/fonts/glyphicons-halflings-regular.woff +0 -0
  9. package/docs/fonts/glyphicons-halflings-regular.woff2 +0 -0
  10. package/docs/global.html +1668 -0
  11. package/docs/helps_help.task.mjs.html +362 -0
  12. package/docs/img/glyphicons-halflings-white.png +0 -0
  13. package/docs/img/glyphicons-halflings.png +0 -0
  14. package/docs/index.html +228 -0
  15. package/docs/lints_lint.task.mjs.html +252 -0
  16. package/docs/patches_patch.task.mjs.html +251 -0
  17. package/docs/quicksearch.html +31 -0
  18. package/docs/releases_release.task.mjs.html +238 -0
  19. package/docs/scripts/docstrap.lib.js +11 -0
  20. package/docs/scripts/fulltext-search-ui.js +89 -0
  21. package/docs/scripts/fulltext-search.js +36 -0
  22. package/docs/scripts/lunr.min.js +6 -0
  23. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  24. package/docs/scripts/prettify/jquery.min.js +6 -0
  25. package/docs/scripts/prettify/lang-css.js +21 -0
  26. package/docs/scripts/prettify/prettify.js +496 -0
  27. package/docs/scripts/sunlight.js +1157 -0
  28. package/docs/scripts/toc.js +203 -0
  29. package/docs/styles/darkstrap.css +960 -0
  30. package/docs/styles/prettify-tomorrow.css +132 -0
  31. package/docs/styles/site.cerulean.css +7008 -0
  32. package/docs/styles/site.cosmo.css +7061 -0
  33. package/docs/styles/site.cyborg.css +7048 -0
  34. package/docs/styles/site.darkly.css +7171 -0
  35. package/docs/styles/site.darkstrap.css +5638 -0
  36. package/docs/styles/site.dibs-bootstrap.css +5899 -0
  37. package/docs/styles/site.flatly.css +7147 -0
  38. package/docs/styles/site.journal.css +6973 -0
  39. package/docs/styles/site.lumen.css +7298 -0
  40. package/docs/styles/site.paper.css +7623 -0
  41. package/docs/styles/site.readable.css +6997 -0
  42. package/docs/styles/site.sandstone.css +7035 -0
  43. package/docs/styles/site.simplex.css +7023 -0
  44. package/docs/styles/site.slate.css +7343 -0
  45. package/docs/styles/site.spacelab.css +7055 -0
  46. package/docs/styles/site.superhero.css +7131 -0
  47. package/docs/styles/site.united.css +6895 -0
  48. package/docs/styles/site.yeti.css +7195 -0
  49. package/docs/styles/sunlight.dark.css +345 -0
  50. package/docs/styles/sunlight.default.css +344 -0
  51. package/docs/tests_benchmarks_compute-benchmarks.task.mjs.html +442 -0
  52. package/docs/tests_benchmarks_run-benchmarks-for-backend.task.mjs.html +249 -0
  53. package/docs/tests_benchmarks_run-benchmarks-for-frontend.task.mjs.html +254 -0
  54. package/docs/tests_bundlings_check-bundling-from-esm-files-direct.task.mjs.html +300 -0
  55. package/docs/tests_bundlings_check-bundling.task.mjs.html +231 -0
  56. package/docs/tests_run-tests.task.mjs.html +228 -0
  57. package/docs/tests_units_compute-unit-tests.task.mjs.html +753 -0
  58. package/docs/tests_units_run-unit-tests-for-backend.task.mjs.html +254 -0
  59. package/docs/tests_units_run-unit-tests-for-frontend.task.mjs.html +254 -0
  60. package/package.json +5 -2
  61. package/sources/_utils.mjs +29 -3
  62. package/sources/patches/patch.task.mjs +45 -0
  63. package/configs/docs/doc.conf.json +0 -1
@@ -0,0 +1,254 @@
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.1.1 Source: tests/units/run-unit-tests-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.1.1</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: tests/units/run-unit-tests-for-backend.task.mjs</h1>
69
+
70
+ <section>
71
+ <article>
72
+ <pre
73
+ class="sunlight-highlight-javascript linenums">import colors from 'ansi-colors'
74
+ import { spawn } from 'child_process'
75
+ import log from 'fancy-log'
76
+ import { existsSync } from 'fs'
77
+ import { basename } from 'node:path'
78
+ import { join } from 'path'
79
+ import {
80
+ logLoadingTask,
81
+ packageName,
82
+ packageNodeModulesDirectory,
83
+ packageTestsUnitsDirectory
84
+ } from '../../_utils.mjs'
85
+
86
+ logLoadingTask( import.meta.filename )
87
+
88
+ const {
89
+ red,
90
+ yellow,
91
+ } = colors
92
+
93
+ /**
94
+ * @description Will run unit tests with node
95
+ */
96
+ const runUnitTestsForBackendTask = ( done ) => {
97
+
98
+ const testsPath = join( packageTestsUnitsDirectory, `/${ packageName }.units.mjs` )
99
+ if ( !existsSync( testsPath ) ) {
100
+ log( yellow( `${ testsPath } does not exist, skip backend unit tests...` ) )
101
+ done()
102
+ return
103
+ }
104
+
105
+ const mochaPath = join( packageNodeModulesDirectory, '/mocha/bin/mocha' )
106
+ const mocha = spawn( 'node', [ mochaPath, testsPath ], { stdio: 'inherit' } )
107
+ mocha.on( 'close', ( code ) => {
108
+
109
+ ( code === 0 )
110
+ ? done()
111
+ : done( red( `mocha exited with code ${ code }` ) )
112
+
113
+ } )
114
+
115
+ }
116
+ runUnitTestsForBackendTask.displayName = basename( import.meta.filename, '.task.mjs' )
117
+ runUnitTestsForBackendTask.description = 'Will run unit tests with node'
118
+ runUnitTestsForBackendTask.flags = null
119
+
120
+ export { runUnitTestsForBackendTask }</pre>
121
+ </article>
122
+ </section>
123
+
124
+
125
+
126
+
127
+
128
+ </div>
129
+ </div>
130
+
131
+ <div class="clearfix"></div>
132
+
133
+
134
+
135
+ </div>
136
+ </div>
137
+
138
+
139
+ <div class="modal fade" id="searchResults">
140
+ <div class="modal-dialog">
141
+ <div class="modal-content">
142
+ <div class="modal-header">
143
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
144
+ <h4 class="modal-title">Search results</h4>
145
+ </div>
146
+ <div class="modal-body"></div>
147
+ <div class="modal-footer">
148
+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
149
+ </div>
150
+ </div><!-- /.modal-content -->
151
+ </div><!-- /.modal-dialog -->
152
+ </div>
153
+
154
+
155
+ <footer>
156
+
157
+
158
+ <span class="copyright">
159
+ Copyright 2015-Present <a href="https://github.com/Itee">Itee</a> (Tristan Valcke)
160
+ </span>
161
+
162
+ <span class="jsdoc-message">
163
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a>
164
+
165
+ using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
166
+ </span>
167
+ </footer>
168
+
169
+ <script src="scripts/docstrap.lib.js"></script>
170
+ <script src="scripts/toc.js"></script>
171
+
172
+ <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
173
+
174
+
175
+ <script>
176
+ $( function () {
177
+ $( "[id*='$']" ).each( function () {
178
+ var $this = $( this );
179
+
180
+ $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
181
+ } );
182
+
183
+ $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
184
+ var $this = $( this );
185
+
186
+ var example = $this.find( "code" );
187
+ exampleText = example.html();
188
+ var lang = /{@lang (.*?)}/.exec( exampleText );
189
+ if ( lang && lang[1] ) {
190
+ exampleText = exampleText.replace( lang[0], "" );
191
+ example.html( exampleText );
192
+ lang = lang[1];
193
+ } else {
194
+ var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
195
+ lang = langClassMatch ? langClassMatch[1] : "javascript";
196
+ }
197
+
198
+ if ( lang ) {
199
+
200
+ $this
201
+ .addClass( "sunlight-highlight-" + lang )
202
+ .addClass( "linenums" )
203
+ .html( example.html() );
204
+
205
+ }
206
+ } );
207
+
208
+ Sunlight.highlightAll( {
209
+ lineNumbers : true,
210
+ showMenu : true,
211
+ enableDoclinks : true
212
+ } );
213
+
214
+ $.catchAnchorLinks( {
215
+ navbarOffset: 10
216
+ } );
217
+ $( "#toc" ).toc( {
218
+ anchorName : function ( i, heading, prefix ) {
219
+ return $( heading ).attr( "id" ) || ( prefix + i );
220
+ },
221
+ selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
222
+ showAndHide : false,
223
+ smoothScrolling: true
224
+ } );
225
+
226
+ $( "#main span[id^='toc']" ).addClass( "toc-shim" );
227
+ $( '.dropdown-toggle' ).dropdown();
228
+
229
+ $( "table" ).each( function () {
230
+ var $this = $( this );
231
+ $this.addClass('table');
232
+ } );
233
+
234
+ } );
235
+ </script>
236
+
237
+
238
+
239
+ <!--Navigation and Symbol Display-->
240
+
241
+
242
+ <!--Google Analytics-->
243
+
244
+
245
+
246
+ <script type="text/javascript">
247
+ $(document).ready(function() {
248
+ SearcherDisplay.init();
249
+ });
250
+ </script>
251
+
252
+
253
+ </body>
254
+ </html>
@@ -0,0 +1,254 @@
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.1.1 Source: tests/units/run-unit-tests-for-frontend.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.1.1</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: tests/units/run-unit-tests-for-frontend.task.mjs</h1>
69
+
70
+ <section>
71
+ <article>
72
+ <pre
73
+ class="sunlight-highlight-javascript linenums">import { startTestRunner } from '@web/test-runner'
74
+ import colors from 'ansi-colors'
75
+ import { basename } from 'node:path'
76
+ import {
77
+ getTaskConfigurationFor,
78
+ logLoadingTask
79
+ } from '../../_utils.mjs'
80
+
81
+ logLoadingTask( import.meta.filename )
82
+
83
+ const { red } = colors
84
+
85
+ /**
86
+ * @description Will run unit tests with web-test-runner
87
+ */
88
+ const runUnitTestsForFrontendTask = () => {
89
+ return new Promise( async ( resolve, reject ) => {
90
+
91
+ const configuration = await getTaskConfigurationFor( import.meta.filename )
92
+ const testRunner = await startTestRunner( {
93
+ config: configuration,
94
+ readCliArgs: false,
95
+ readFileConfig: false,
96
+ autoExitProcess: false,
97
+ } )
98
+
99
+ if ( !testRunner ) {
100
+ reject( red( 'Internal test runner error.' ) )
101
+ return
102
+ }
103
+
104
+ // To ensure that testRunner exit event won't be used by other instance of test runner,
105
+ // we need to be sure that current test runner is ended
106
+ testRunner.on( 'finished', () => {
107
+ testRunner.stop()
108
+ } )
109
+
110
+ testRunner.on( 'stopped', () => {
111
+ resolve()
112
+ } )
113
+
114
+ } )
115
+ }
116
+ runUnitTestsForFrontendTask.displayName = basename( import.meta.filename, '.task.mjs' )
117
+ runUnitTestsForFrontendTask.description = 'Will run unit tests with web-test-runner'
118
+ runUnitTestsForFrontendTask.flags = null
119
+
120
+ export { runUnitTestsForFrontendTask }</pre>
121
+ </article>
122
+ </section>
123
+
124
+
125
+
126
+
127
+
128
+ </div>
129
+ </div>
130
+
131
+ <div class="clearfix"></div>
132
+
133
+
134
+
135
+ </div>
136
+ </div>
137
+
138
+
139
+ <div class="modal fade" id="searchResults">
140
+ <div class="modal-dialog">
141
+ <div class="modal-content">
142
+ <div class="modal-header">
143
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
144
+ <h4 class="modal-title">Search results</h4>
145
+ </div>
146
+ <div class="modal-body"></div>
147
+ <div class="modal-footer">
148
+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
149
+ </div>
150
+ </div><!-- /.modal-content -->
151
+ </div><!-- /.modal-dialog -->
152
+ </div>
153
+
154
+
155
+ <footer>
156
+
157
+
158
+ <span class="copyright">
159
+ Copyright 2015-Present <a href="https://github.com/Itee">Itee</a> (Tristan Valcke)
160
+ </span>
161
+
162
+ <span class="jsdoc-message">
163
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a>
164
+
165
+ using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
166
+ </span>
167
+ </footer>
168
+
169
+ <script src="scripts/docstrap.lib.js"></script>
170
+ <script src="scripts/toc.js"></script>
171
+
172
+ <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
173
+
174
+
175
+ <script>
176
+ $( function () {
177
+ $( "[id*='$']" ).each( function () {
178
+ var $this = $( this );
179
+
180
+ $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
181
+ } );
182
+
183
+ $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
184
+ var $this = $( this );
185
+
186
+ var example = $this.find( "code" );
187
+ exampleText = example.html();
188
+ var lang = /{@lang (.*?)}/.exec( exampleText );
189
+ if ( lang && lang[1] ) {
190
+ exampleText = exampleText.replace( lang[0], "" );
191
+ example.html( exampleText );
192
+ lang = lang[1];
193
+ } else {
194
+ var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
195
+ lang = langClassMatch ? langClassMatch[1] : "javascript";
196
+ }
197
+
198
+ if ( lang ) {
199
+
200
+ $this
201
+ .addClass( "sunlight-highlight-" + lang )
202
+ .addClass( "linenums" )
203
+ .html( example.html() );
204
+
205
+ }
206
+ } );
207
+
208
+ Sunlight.highlightAll( {
209
+ lineNumbers : true,
210
+ showMenu : true,
211
+ enableDoclinks : true
212
+ } );
213
+
214
+ $.catchAnchorLinks( {
215
+ navbarOffset: 10
216
+ } );
217
+ $( "#toc" ).toc( {
218
+ anchorName : function ( i, heading, prefix ) {
219
+ return $( heading ).attr( "id" ) || ( prefix + i );
220
+ },
221
+ selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
222
+ showAndHide : false,
223
+ smoothScrolling: true
224
+ } );
225
+
226
+ $( "#main span[id^='toc']" ).addClass( "toc-shim" );
227
+ $( '.dropdown-toggle' ).dropdown();
228
+
229
+ $( "table" ).each( function () {
230
+ var $this = $( this );
231
+ $this.addClass('table');
232
+ } );
233
+
234
+ } );
235
+ </script>
236
+
237
+
238
+
239
+ <!--Navigation and Symbol Display-->
240
+
241
+
242
+ <!--Google Analytics-->
243
+
244
+
245
+
246
+ <script type="text/javascript">
247
+ $(document).ready(function() {
248
+ SearcherDisplay.init();
249
+ });
250
+ </script>
251
+
252
+
253
+ </body>
254
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itee/tasks",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Allow to manage all commons itee gulp tasks into one place ",
5
5
  "keywords": [
6
6
  "itee",
@@ -28,9 +28,11 @@
28
28
  "node": ">=20"
29
29
  },
30
30
  "scripts": {
31
+ "postinstall": "gulp patch",
31
32
  "default": "gulp --tasks",
32
33
  "refresh": "node ./sources/refresh.mjs",
33
34
  "help": "gulp help",
35
+ "patch": "gulp patch",
34
36
  "clean": "gulp clean",
35
37
  "lint": "gulp lint",
36
38
  "doc": "gulp doc",
@@ -87,7 +89,8 @@
87
89
  "platform": "^1.3.6",
88
90
  "rollup": "^4.55.1",
89
91
  "rollup-plugin-cleanup": "^3.2.1",
90
- "rollup-plugin-re": "^1.0.7"
92
+ "rollup-plugin-re": "^1.0.7",
93
+ "taffydb": "^2.7.3"
91
94
  },
92
95
  "overrides": {
93
96
  "semantic-release-gitmoji": {
@@ -36,7 +36,11 @@ const {
36
36
  cyan
37
37
  } = colors
38
38
 
39
- ///
39
+ /// Debugging
40
+
41
+ const isDebugging = ( process.env.RUNNER_DEBUG && process.env.RUNNER_DEBUG === '1' )
42
+
43
+ /// Package paths and data
40
44
 
41
45
  function _getPackageRootDirectory() {
42
46
 
@@ -63,7 +67,7 @@ const iteePackageConfigurationsDirectory = join( iteePackageRootDirectory, 'conf
63
67
  const iteePackageNodeModulesDirectory = join( iteePackageRootDirectory, 'node_modules' )
64
68
  const iteePackageSourcesDirectory = join( iteePackageRootDirectory, 'sources' )
65
69
 
66
- const packageRootDirectory = iteePackageRootDirectory.includes( 'node_modules' ) ? join( iteePackageRootDirectory, '../../' ) : iteePackageRootDirectory
70
+ const packageRootDirectory = iteePackageRootDirectory.includes( 'node_modules' ) ? join( iteePackageRootDirectory, '../../../' ) : iteePackageRootDirectory
67
71
  const packageTasksDirectory = join( packageRootDirectory, '.tasks' )
68
72
  const packageTasksConfigurationsDirectory = join( packageTasksDirectory, 'configs' )
69
73
  const packageNodeModulesDirectory = join( packageRootDirectory, 'node_modules' )
@@ -250,6 +254,7 @@ function getTaskConfigurationPathFor( filename ) {
250
254
  const replaceValues = [
251
255
  '.conf.json',
252
256
  '.conf.js',
257
+ '.conf.cjs',
253
258
  '.conf.mjs',
254
259
  ]
255
260
 
@@ -394,6 +399,22 @@ function computeIntroFor( requestPackages ) {
394
399
 
395
400
  }
396
401
 
402
+ function getOutputFileExtensionBasedOnFileFormat( format ) {
403
+
404
+ let extension
405
+
406
+ if ( format === 'cjs' ) {
407
+ extension = 'cjs'
408
+ } else if ( format === 'esm' ) {
409
+ extension = 'mjs'
410
+ } else {
411
+ extension = 'js'
412
+ }
413
+
414
+ return extension
415
+
416
+ }
417
+
397
418
  /**
398
419
  * Will create an appropriate configuration object for rollup, related to the given arguments.
399
420
  *
@@ -430,7 +451,8 @@ function createRollupConfigs( options = undefined ) {
430
451
  const env = envs[ envIndex ]
431
452
  const isProd = ( env.includes( 'prod' ) )
432
453
  const format = formats[ formatIndex ]
433
- const outputPath = ( isProd ) ? join( output, `${ fileName }.${ format }.min.js` ) : join( output, `${ fileName }.${ format }.js` )
454
+ const extension = getOutputFileExtensionBasedOnFileFormat( format )
455
+ const outputPath = ( isProd ) ? join( output, `${ fileName }.min.${ extension }` ) : join( output, `${ fileName }.${ extension }` )
434
456
 
435
457
  configs.push( {
436
458
  input: input,
@@ -506,6 +528,10 @@ function createRollupConfigs( options = undefined ) {
506
528
 
507
529
  function logLoadingTask( filename ) {
508
530
 
531
+ if ( !isDebugging ) {
532
+ return
533
+ }
534
+
509
535
  const taskPath = relative( packageRootDirectory, filename )
510
536
  const taskName = basename( filename, '.task.mjs' )
511
537
 
@@ -0,0 +1,45 @@
1
+ import colors from 'ansi-colors'
2
+ import log from 'fancy-log'
3
+ import {
4
+ readFileSync,
5
+ writeFileSync
6
+ } from 'node:fs'
7
+ import { relative } from 'node:path'
8
+ import { packageRootDirectory } from '../_utils.mjs'
9
+
10
+ const {
11
+ green,
12
+ blue
13
+ } = colors
14
+
15
+ /**
16
+ * @method npm run patch
17
+ * @global
18
+ * @description Will apply some patch/replacements in dependencies
19
+ */
20
+ const patchTask = ( done ) => {
21
+
22
+ // patch jsdoc
23
+ {
24
+ const jsdocFilePath = 'node_modules/jsdoc/cli.js'
25
+ const searchValue = 'case \'.js\':'
26
+ const replaceValue = '' +
27
+ 'case \'.mjs\':' + '\n' +
28
+ '\t\t\t\t\t' + 'config = require( path.resolve(confPath) ).default || {};' + '\n' +
29
+ '\t\t\t\t\t' + 'break;' + '\n' +
30
+ '\t\t\t\t' + 'case \'.js\':' + '\n' +
31
+ '\t\t\t\t' + 'case \'.cjs\':'
32
+ const fileContent = readFileSync( jsdocFilePath ).toString()
33
+ const patchedFileContent = fileContent.replace( searchValue, replaceValue )
34
+ writeFileSync( jsdocFilePath, patchedFileContent )
35
+ }
36
+
37
+ done()
38
+ }
39
+ patchTask.displayName = 'patch'
40
+ patchTask.description = 'Will apply some patch/replacements in dependencies'
41
+ patchTask.flags = null
42
+
43
+ log( 'Loading ', green( relative( packageRootDirectory, import.meta.filename ) ), `with task ${ blue( patchTask.displayName ) }` )
44
+
45
+ export { patchTask }
@@ -1 +0,0 @@
1
- {}