@itee/tasks 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/docs/cleans_clean.task.mjs.html +10 -11
  3. package/docs/global.html +14 -170
  4. package/docs/helps_help.task.mjs.html +24 -22
  5. package/docs/index.html +4 -4
  6. package/docs/lints_lint.task.mjs.html +14 -12
  7. package/docs/patches_patch.task.mjs.html +13 -5
  8. package/docs/quicksearch.html +1 -1
  9. package/docs/releases_release.task.mjs.html +5 -5
  10. package/docs/tests_benchmarks_compute-benchmarks.task.mjs.html +35 -38
  11. package/docs/tests_benchmarks_run-benchmarks-for-backend.task.mjs.html +20 -18
  12. package/docs/tests_benchmarks_run-benchmarks-for-frontend.task.mjs.html +10 -14
  13. package/docs/tests_bundlings_check-bundling-from-esm-files-direct.task.mjs.html +22 -34
  14. package/docs/tests_bundlings_check-bundling.task.mjs.html +5 -5
  15. package/docs/tests_run-tests.task.mjs.html +5 -5
  16. package/docs/tests_units_compute-unit-tests.task.mjs.html +40 -42
  17. package/docs/tests_units_run-unit-tests-for-backend.task.mjs.html +21 -19
  18. package/docs/tests_units_run-unit-tests-for-frontend.task.mjs.html +9 -13
  19. package/package.json +4 -4
  20. package/{sources → scripts}/refresh.mjs +10 -12
  21. package/sources/builds/build.conf.mjs +3 -0
  22. package/sources/builds/build.task.mjs +12 -14
  23. package/{configs → sources}/cleans/clean.conf.mjs +1 -1
  24. package/sources/cleans/clean.task.mjs +6 -7
  25. package/{configs → sources}/docs/doc.conf.mjs +8 -7
  26. package/sources/docs/doc.task.mjs +7 -8
  27. package/sources/helps/help.task.mjs +19 -17
  28. package/{configs → sources}/lints/lint.conf.mjs +18 -18
  29. package/sources/lints/lint.task.mjs +10 -8
  30. package/sources/patches/patch.task.mjs +9 -1
  31. package/sources/releases/release.task.mjs +1 -1
  32. package/sources/{index.mjs → tasks.js} +7 -2
  33. package/sources/tests/benchmarks/compute-benchmarks.conf.mjs +5 -0
  34. package/sources/tests/benchmarks/compute-benchmarks.task.mjs +31 -34
  35. package/sources/tests/benchmarks/run-benchmarks-for-backend.task.mjs +16 -14
  36. package/{configs → sources}/tests/benchmarks/run-benchmarks-for-frontend.conf.mjs +6 -6
  37. package/sources/tests/benchmarks/run-benchmarks-for-frontend.task.mjs +6 -10
  38. package/{configs → sources}/tests/benchmarks/run-benchmarks.conf.mjs +2 -2
  39. package/sources/tests/benchmarks/run-benchmarks.task.mjs +3 -3
  40. package/{configs → sources}/tests/bundlings/check-bundling-from-esm-build-import.conf.mjs +12 -10
  41. package/sources/tests/bundlings/check-bundling-from-esm-build-import.task.mjs +17 -17
  42. package/{configs → sources}/tests/bundlings/check-bundling-from-esm-files-direct.conf.mjs +20 -14
  43. package/sources/tests/bundlings/check-bundling-from-esm-files-direct.task.mjs +17 -29
  44. package/{configs → sources}/tests/bundlings/check-bundling-from-esm-files-import.conf.mjs +15 -13
  45. package/sources/tests/bundlings/check-bundling-from-esm-files-import.task.mjs +17 -29
  46. package/sources/tests/bundlings/check-bundling.task.mjs +1 -1
  47. package/sources/tests/run-tests.task.mjs +1 -1
  48. package/sources/tests/units/compute-unit-tests.conf.mjs +5 -0
  49. package/sources/tests/units/compute-unit-tests.task.mjs +36 -38
  50. package/sources/tests/units/run-unit-tests-for-backend.task.mjs +17 -15
  51. package/{configs → sources}/tests/units/run-unit-tests-for-frontend.conf.mjs +1 -1
  52. package/sources/tests/units/run-unit-tests-for-frontend.task.mjs +5 -9
  53. package/{configs → sources}/tests/units/run-unit-tests.conf.mjs +2 -2
  54. package/sources/tests/units/run-unit-tests.task.mjs +3 -3
  55. package/sources/utils/builds.mjs +238 -0
  56. package/sources/utils/colors.mjs +19 -0
  57. package/sources/utils/files.mjs +70 -0
  58. package/sources/utils/loggings.mjs +33 -0
  59. package/sources/utils/packages.mjs +172 -0
  60. package/sources/utils/tasks.mjs +170 -0
  61. package/sources/utils/texts.mjs +98 -0
  62. package/configs/builds/build.conf.mjs +0 -3
  63. package/configs/tests/benchmarks/compute-benchmarks.conf.mjs +0 -5
  64. package/configs/tests/units/compute-unit-tests.conf.mjs +0 -5
  65. package/sources/_utils.mjs +0 -692
  66. /package/{configs → scripts}/refresh.conf.mjs +0 -0
@@ -4,7 +4,7 @@
4
4
  <head>
5
5
  <meta charset="utf-8">
6
6
  <meta name="viewport" content="width=device-width">
7
- <title>@itee/tasks v1.3.0 Source: tests/units/run-unit-tests-for-frontend.task.mjs</title>
7
+ <title>Itee Tasks v1.3.1 Source: tests/units/run-unit-tests-for-frontend.task.mjs</title>
8
8
 
9
9
  <!--[if lt IE 9]>
10
10
  <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
@@ -20,7 +20,7 @@
20
20
  <div class="navbar navbar-default navbar-fixed-top ">
21
21
  <div class="container">
22
22
  <div class="navbar-header">
23
- <a class="navbar-brand" href="index.html">@itee/tasks v1.3.0</a>
23
+ <a class="navbar-brand" href="index.html">Itee Tasks v1.3.1</a>
24
24
  <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
25
25
  <span class="icon-bar"></span>
26
26
  <span class="icon-bar"></span>
@@ -33,7 +33,7 @@
33
33
  <li class="dropdown">
34
34
  <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
35
35
  <ul class="dropdown-menu inline">
36
- <li><a href="global.html#checkBundlingFromEsmFilesDirectTask">checkBundlingFromEsmFilesDirectTask</a></li><li><a href="global.html#checkBundlingTask">checkBundlingTask</a></li><li><a href="global.html#computeBenchmarksTask">computeBenchmarksTask</a></li><li><a href="global.html#computeUnitTestsTask">computeUnitTestsTask</a></li><li><a href="global.html#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>
36
+ <li><a href="global.html#checkBundlingFromEsmFilesDirectTask">checkBundlingFromEsmFilesDirectTask</a></li><li><a href="global.html#checkBundlingTask">checkBundlingTask</a></li><li><a href="global.html#computeBenchmarksTask">computeBenchmarksTask</a></li><li><a href="global.html#computeUnitTestsTask">computeUnitTestsTask</a></li><li><a href="global.html#npmrunclean">npm run clean</a></li><li><a href="global.html#npmrunhelpdefault">npm run help ( default )</a></li><li><a href="global.html#npmrunlint">npm run lint</a></li><li><a href="global.html#npmrunpatch">npm run patch</a></li><li><a href="global.html#npmrunrelease">npm run release</a></li><li><a href="global.html#npmruntest">npm run test</a></li><li><a href="global.html#runBenchmarksForBackendTask">runBenchmarksForBackendTask</a></li><li><a href="global.html#runBenchmarksForFrontendTask">runBenchmarksForFrontendTask</a></li><li><a href="global.html#runUnitTestsForBackendTask">runUnitTestsForBackendTask</a></li><li><a href="global.html#runUnitTestsForFrontendTask">runUnitTestsForFrontendTask</a></li>
37
37
  </ul>
38
38
  </li>
39
39
 
@@ -70,18 +70,14 @@
70
70
  <section>
71
71
  <article>
72
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'
73
+ class="sunlight-highlight-javascript linenums">import { startTestRunner } from '@web/test-runner'
74
+ import { basename } from 'node:path'
75
+ import { red } from '../../utils/colors.mjs'
76
+ import { logLoadingTask } from '../../utils/loggings.mjs'
77
+ import { getTaskConfigurationFor } from '../../utils/tasks.mjs'
80
78
 
81
79
  logLoadingTask( import.meta.filename )
82
80
 
83
- const { red } = colors
84
-
85
81
  /**
86
82
  * @description Will run unit tests with web-test-runner
87
83
  */
@@ -158,7 +154,7 @@ export { runUnitTestsForFrontendTask }</pre>
158
154
 
159
155
 
160
156
  <span class="copyright">
161
- Copyright 2015-Present <a href="https://github.com/Itee">Itee</a> (Tristan Valcke)
157
+ Copyright 2015-Present <a href="https://github.com/Itee">Itee (Tristan Valcke)</a>
162
158
  </span>
163
159
 
164
160
  <span class="jsdoc-message">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itee/tasks",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Allow to manage all commons itee gulp tasks into one place ",
5
5
  "keywords": [
6
6
  "itee",
@@ -19,7 +19,7 @@
19
19
  "url": "git+https://github.com/Itee/tasks.git"
20
20
  },
21
21
  "type": "module",
22
- "main": "sources/index.mjs",
22
+ "main": "sources/tasks.js",
23
23
  "homepage": "https://github.com/Itee/tasks#readme",
24
24
  "bugs": {
25
25
  "url": "https://github.com/Itee/tasks/issues"
@@ -28,9 +28,9 @@
28
28
  "node": ">=20"
29
29
  },
30
30
  "scripts": {
31
- "postinstall": "node ./sources/refresh.mjs && gulp patch",
31
+ "postinstall": "node ./scripts/refresh.mjs && gulp patch",
32
+ "refresh": "node ./scripts/refresh.mjs",
32
33
  "default": "gulp --tasks",
33
- "refresh": "node ./sources/refresh.mjs",
34
34
  "help": "gulp help",
35
35
  "patch": "gulp patch",
36
36
  "clean": "gulp clean",
@@ -1,25 +1,23 @@
1
- import colors from 'ansi-colors'
2
- import log from 'fancy-log'
3
- import { writeFileSync } from 'fs'
1
+ import { writeFileSync } from 'node:fs'
4
2
  import {
5
3
  basename,
6
4
  join,
7
5
  relative
8
- } from 'path'
6
+ } from 'node:path'
7
+ import {
8
+ green,
9
+ yellow
10
+ } from '../sources/utils/colors.mjs'
11
+ import { getFilesFrom } from '../sources/utils/files.mjs'
12
+ import { log } from '../sources/utils/loggings.mjs'
9
13
  import {
10
- getFilesFrom,
11
- getTaskConfigurationFor,
12
14
  iteePackageRootDirectory,
13
15
  iteePackageSourcesDirectory,
14
16
  packageNodeModulesDirectory,
15
17
  packageRootDirectory,
16
18
  packageTasksDirectory
17
- } from './_utils.mjs'
18
-
19
- const {
20
- green,
21
- yellow
22
- } = colors
19
+ } from '../sources/utils/packages.mjs'
20
+ import { getTaskConfigurationFor } from '../sources/utils/tasks.mjs'
23
21
 
24
22
  const configuration = await getTaskConfigurationFor( import.meta.filename )
25
23
 
@@ -0,0 +1,3 @@
1
+ import { createRollupConfigs } from '../utils/builds.mjs'
2
+
3
+ export default createRollupConfigs()
@@ -1,20 +1,18 @@
1
- import colors from 'ansi-colors'
2
- import log from 'fancy-log'
3
- import { basename } from 'node:path'
4
- import { rollup } from 'rollup'
1
+ import { basename } from 'node:path'
2
+ import { rollup } from 'rollup'
5
3
  import {
6
- getTaskConfigurationFor,
7
- logLoadingTask,
8
- } from '../_utils.mjs'
4
+ green,
5
+ red,
6
+ yellow,
7
+ } from '../utils/colors.mjs'
8
+ import {
9
+ log,
10
+ logLoadingTask
11
+ } from '../utils/loggings.mjs'
12
+ import { getTaskConfigurationFor } from '../utils/tasks.mjs'
9
13
 
10
14
  logLoadingTask( import.meta.filename )
11
15
 
12
- const {
13
- red,
14
- green,
15
- yellow,
16
- } = colors
17
-
18
16
  const buildTask = async ( done ) => {
19
17
 
20
18
  const configuration = await getTaskConfigurationFor( import.meta.filename )
@@ -46,7 +44,7 @@ const buildTask = async ( done ) => {
46
44
 
47
45
  }
48
46
  buildTask.displayName = basename( import.meta.filename, '.task.mjs' )
49
- buildTask.description = 'Todo...'
47
+ buildTask.description = 'Will generate build package files based on input config.'
50
48
  buildTask.flags = null
51
49
 
52
50
  export { buildTask }
@@ -4,7 +4,7 @@ import {
4
4
  packageTestsBenchmarksDirectory,
5
5
  packageTestsBundlesDirectory,
6
6
  packageTestsUnitsDirectory,
7
- } from '../../sources/_utils.mjs'
7
+ } from '../utils/packages.mjs'
8
8
 
9
9
  export default [
10
10
  packageBuildsDirectory,
@@ -1,15 +1,14 @@
1
- import colors from 'ansi-colors'
2
- import { deleteAsync } from 'del'
3
- import log from 'fancy-log'
4
- import { basename } from 'node:path'
1
+ import { deleteAsync } from 'del'
2
+ import { basename } from 'node:path'
3
+ import { red } from '../utils/colors.mjs'
5
4
  import {
6
- getTaskConfigurationFor,
5
+ log,
7
6
  logLoadingTask
8
- } from '../_utils.mjs'
7
+ } from '../utils/loggings.mjs'
8
+ import { getTaskConfigurationFor } from '../utils/tasks.mjs'
9
9
 
10
10
  logLoadingTask( import.meta.filename )
11
11
 
12
- const { red } = colors
13
12
  const configuration = await getTaskConfigurationFor( import.meta.filename )
14
13
 
15
14
  /**
@@ -1,18 +1,19 @@
1
1
  import {
2
2
  getPrettyPackageName,
3
- getPrettyPackageVersion
4
- } from '../../sources/_utils.mjs'
3
+ getPrettyPackageVersion,
4
+ packageAuthor
5
+ } from '../utils/packages.mjs'
5
6
 
6
7
  export default {
7
- tags: {
8
+ tags: {
8
9
  allowUnknownTags: false,
9
10
  dictionaries: [
10
11
  'jsdoc',
11
12
  'closure'
12
13
  ]
13
14
  },
14
- source: {
15
- include: [
15
+ source: {
16
+ include: [
16
17
  'README.md',
17
18
  'gulpfile.mjs',
18
19
  './sources'
@@ -34,7 +35,7 @@ export default {
34
35
  verbose: true,
35
36
  private: true
36
37
  },
37
- templates: {
38
+ templates: {
38
39
  cleverLinks: false,
39
40
  monospaceLinks: false,
40
41
  navType: 'inline',
@@ -46,7 +47,7 @@ export default {
46
47
  search: true,
47
48
  systemName: `${ getPrettyPackageName() } ${ getPrettyPackageVersion() }`,
48
49
  footer: '',
49
- copyright: 'Copyright 2015-Present <a href="https://github.com/Itee">Itee</a> (Tristan Valcke)',
50
+ copyright: `Copyright 2015-Present <a href="${packageAuthor.url}">${packageAuthor.name}</a>`,
50
51
  includeDate: false,
51
52
  inverseNav: false,
52
53
  outputSourceFiles: true,
@@ -1,17 +1,16 @@
1
- import colors from 'ansi-colors'
2
- import log from 'fancy-log'
3
- import child_process from 'node:child_process'
4
- import { basename } from 'node:path'
5
- import { promisify } from 'node:util'
1
+ import child_process from 'node:child_process'
2
+ import { basename } from 'node:path'
3
+ import { promisify } from 'node:util'
4
+ import { red } from '../utils/colors.mjs'
6
5
  import {
7
- getTaskConfigurationPathFor,
6
+ log,
8
7
  logLoadingTask
9
- } from '../_utils.mjs'
8
+ } from '../utils/loggings.mjs'
9
+ import { getTaskConfigurationPathFor } from '../utils/tasks.mjs'
10
10
 
11
11
  logLoadingTask( import.meta.filename )
12
12
 
13
13
  const execFile = promisify( child_process.execFile )
14
- const { red } = colors
15
14
 
16
15
  /**
17
16
  * @method npm run doc
@@ -1,28 +1,30 @@
1
- import colors from 'ansi-colors'
2
- import log from 'fancy-log'
3
1
  import { basename } from 'node:path'
4
2
  import {
5
- Indenter,
6
- alignTextCenter,
7
- alignTextLeft,
3
+ blue,
4
+ cyan,
5
+ green,
6
+ magenta,
7
+ red,
8
+ yellow
9
+ } from '../utils/colors.mjs'
10
+ import {
11
+ log,
12
+ logLoadingTask
13
+ } from '../utils/loggings.mjs'
14
+ import {
8
15
  getPrettyNodeVersion,
9
16
  getPrettyNpmVersion,
10
17
  getPrettyPackageName,
11
- getPrettyPackageVersion,
12
- logLoadingTask,
13
- } from '../_utils.mjs'
18
+ getPrettyPackageVersion
19
+ } from '../utils/packages.mjs'
20
+ import {
21
+ alignTextCenter,
22
+ alignTextLeft,
23
+ Indenter,
24
+ } from '../utils/texts.mjs'
14
25
 
15
26
  logLoadingTask( import.meta.filename )
16
27
 
17
- const {
18
- red,
19
- green,
20
- blue,
21
- cyan,
22
- yellow,
23
- magenta
24
- } = colors
25
-
26
28
  /**
27
29
  * @method npm run help ( default )
28
30
  * @global
@@ -50,8 +50,8 @@ class RulesSet {
50
50
  }
51
51
 
52
52
  const sourceRulesSet = new RulesSet( {
53
- name: 'sources',
54
- files: [
53
+ name: 'sources',
54
+ files: [
55
55
  'sources/**/*.js',
56
56
  'sources/**/*.cjs',
57
57
  'sources/**/*.mjs',
@@ -60,7 +60,7 @@ const sourceRulesSet = new RulesSet( {
60
60
  plugins: { js },
61
61
  extends: [ 'js/recommended' ],
62
62
  rules: {
63
- 'no-multiple-empty-lines': [
63
+ 'no-multiple-empty-lines': [
64
64
  'error',
65
65
  {
66
66
  'max': 2
@@ -80,7 +80,7 @@ const sourceRulesSet = new RulesSet( {
80
80
  }
81
81
  }
82
82
  ],
83
- 'key-spacing': [
83
+ 'key-spacing': [
84
84
  'error',
85
85
  {
86
86
  'align': {
@@ -94,8 +94,8 @@ const sourceRulesSet = new RulesSet( {
94
94
  } )
95
95
 
96
96
  const sourceCommonRulesSet = new RulesSet( {
97
- name: 'sources/common',
98
- files: [
97
+ name: 'sources/common',
98
+ files: [
99
99
  'sources/common/**/*.js',
100
100
  'sources/common/**/*.cjs',
101
101
  'sources/common/**/*.mjs',
@@ -104,7 +104,7 @@ const sourceCommonRulesSet = new RulesSet( {
104
104
  plugins: { js },
105
105
  extends: [ 'js/recommended' ],
106
106
  rules: {
107
- 'no-multiple-empty-lines': [
107
+ 'no-multiple-empty-lines': [
108
108
  'error',
109
109
  {
110
110
  'max': 2
@@ -124,7 +124,7 @@ const sourceCommonRulesSet = new RulesSet( {
124
124
  }
125
125
  }
126
126
  ],
127
- 'key-spacing': [
127
+ 'key-spacing': [
128
128
  'error',
129
129
  {
130
130
  'align': {
@@ -138,8 +138,8 @@ const sourceCommonRulesSet = new RulesSet( {
138
138
  } )
139
139
 
140
140
  const sourceFrontendRulesSet = new RulesSet( {
141
- name: 'sources/frontend',
142
- files: [
141
+ name: 'sources/frontend',
142
+ files: [
143
143
  'sources/frontend/**/*.js',
144
144
  'sources/frontend/**/*.mjs',
145
145
  ],
@@ -150,8 +150,8 @@ const sourceFrontendRulesSet = new RulesSet( {
150
150
  } )
151
151
 
152
152
  const sourceBackendRulesSet = new RulesSet( {
153
- name: 'sources/backend',
154
- files: [
153
+ name: 'sources/backend',
154
+ files: [
155
155
  'sources/frontend/**/*.js',
156
156
  'sources/frontend/**/*.cjs',
157
157
  'sources/frontend/**/*.mjs',
@@ -163,8 +163,8 @@ const sourceBackendRulesSet = new RulesSet( {
163
163
  } )
164
164
 
165
165
  const testBenchmarksRulesSet = new RulesSet( {
166
- name: 'tests/benchmarks',
167
- files: [
166
+ name: 'tests/benchmarks',
167
+ files: [
168
168
  'tests/benchmarks/**/*.js',
169
169
  'tests/benchmarks/**/*.cjs',
170
170
  'tests/benchmarks/**/*.mjs',
@@ -180,8 +180,8 @@ const testBenchmarksRulesSet = new RulesSet( {
180
180
  } )
181
181
 
182
182
  const testUnitsRulesSet = new RulesSet( {
183
- name: 'tests/units',
184
- files: [
183
+ name: 'tests/units',
184
+ files: [
185
185
  'tests/units/**/*.js',
186
186
  'tests/units/**/*.cjs',
187
187
  'tests/units/**/*.mjs',
@@ -198,7 +198,7 @@ const testUnitsRulesSet = new RulesSet( {
198
198
  } )
199
199
 
200
200
  const mochaRecommendedRulesSet = new RulesSet( {
201
- files: [
201
+ files: [
202
202
  'tests/units/**/*.js',
203
203
  'tests/units/**/*.cjs',
204
204
  'tests/units/**/*.mjs',
@@ -256,7 +256,7 @@ const defaultConfigurator = new Configurator( {
256
256
  reportUnusedDisableDirectives: 'error',
257
257
  reportUnusedInlineConfigs: 'error'
258
258
  },
259
- rulesSets: [
259
+ rulesSets: [
260
260
  sourceRulesSet,
261
261
  testBenchmarksRulesSet,
262
262
  testUnitsRulesSet,
@@ -1,17 +1,19 @@
1
- import colors from 'ansi-colors'
2
- import log from 'fancy-log'
3
- import child_process from 'node:child_process'
4
- import { basename } from 'node:path'
5
- import { promisify } from 'node:util'
1
+ import child_process from 'node:child_process'
2
+ import { basename } from 'node:path'
3
+ import { promisify } from 'node:util'
6
4
  import {
7
- getTaskConfigurationPathFor,
5
+ cyan,
6
+ red
7
+ } from '../utils/colors.mjs'
8
+ import {
9
+ log,
8
10
  logLoadingTask
9
- } from '../_utils.mjs'
11
+ } from '../utils/loggings.mjs'
12
+ import { getTaskConfigurationPathFor } from '../utils/tasks.mjs'
10
13
 
11
14
  logLoadingTask( import.meta.filename )
12
15
 
13
16
  const execFile = promisify( child_process.execFile )
14
- const { red, cyan } = colors
15
17
 
16
18
  /**
17
19
  * @method npm run lint
@@ -3,7 +3,7 @@ import {
3
3
  writeFileSync
4
4
  } from 'node:fs'
5
5
  import { basename } from 'node:path'
6
- import { logLoadingTask } from '../_utils.mjs'
6
+ import { logLoadingTask } from '../utils/loggings.mjs'
7
7
 
8
8
  logLoadingTask( import.meta.filename )
9
9
 
@@ -28,6 +28,14 @@ const patchTask = ( done ) => {
28
28
  const patchedFileContent = fileContent.replace( searchValue, replaceValue )
29
29
  writeFileSync( jsdocFilePath, patchedFileContent )
30
30
  }
31
+ {
32
+ const jsdocFilePath = 'node_modules/jsdoc/conf.json.EXAMPLE'
33
+ const searchValue = '.js(doc|x)?'
34
+ const replaceValue = '.(js|mjs|cjs|jsdoc|jsx)?'
35
+ const fileContent = readFileSync( jsdocFilePath ).toString()
36
+ const patchedFileContent = fileContent.replace( searchValue, replaceValue )
37
+ writeFileSync( jsdocFilePath, patchedFileContent )
38
+ }
31
39
 
32
40
  done()
33
41
  }
@@ -1,6 +1,5 @@
1
1
  import { series } from 'gulp'
2
2
  import { basename } from 'node:path'
3
- import { logLoadingTask } from '../_utils.mjs'
4
3
  import { buildTask } from '../builds/build.task.mjs'
5
4
  import { cleanTask } from '../cleans/clean.task.mjs'
6
5
  import { docTask } from '../docs/doc.task.mjs'
@@ -8,6 +7,7 @@ import { lintTask } from '../lints/lint.task.mjs'
8
7
  import { computeBenchmarksTask } from '../tests/benchmarks/compute-benchmarks.task.mjs'
9
8
  import { runTestsTask } from '../tests/run-tests.task.mjs'
10
9
  import { computeUnitTestsTask } from '../tests/units/compute-unit-tests.task.mjs'
10
+ import { logLoadingTask } from '../utils/loggings.mjs'
11
11
 
12
12
  logLoadingTask( import.meta.filename )
13
13
 
@@ -17,5 +17,10 @@ export { releaseTask } from './releases/release.task.mjs'
17
17
  export { runTestsTask } from './tests/run-tests.task.mjs'
18
18
  export { computeUnitTestsTask } from './tests/units/compute-unit-tests.task.mjs'
19
19
  export { runUnitTestsTask } from './tests/units/run-unit-tests.task.mjs'
20
-
21
- export * from './_utils.mjs'
20
+ export * from './utils/packages.mjs'
21
+ export * from './utils/loggings.mjs'
22
+ export * from './utils/tasks.mjs'
23
+ export * from './utils/files.mjs'
24
+ export * from './utils/texts.mjs'
25
+ export * from './utils/builds.mjs'
26
+ export * from './utils/colors.mjs'
@@ -0,0 +1,5 @@
1
+ import { getUnscopedPackageName } from '../../utils/packages.mjs'
2
+
3
+ export default [
4
+ `${ getUnscopedPackageName() }.js`
5
+ ]
@@ -1,34 +1,36 @@
1
- import colors from 'ansi-colors'
2
- import childProcess from 'child_process'
3
- import log from 'fancy-log'
4
- import { glob } from 'glob'
1
+ import childProcess from 'node:child_process'
5
2
  import {
6
3
  basename,
7
4
  dirname,
8
5
  extname,
9
6
  join,
10
- normalize,
11
7
  relative
12
- } from 'path'
8
+ } from 'node:path'
9
+ import {
10
+ red,
11
+ yellow
12
+ } from '../../utils/colors.mjs'
13
13
  import {
14
14
  createDirectoryIfNotExist,
15
15
  createFile,
16
- getTaskConfigurationFor,
17
- logLoadingTask,
18
- packageName,
16
+ getJavascriptSourceFiles,
17
+ } from '../../utils/files.mjs'
18
+ import {
19
+ log,
20
+ logLoadingTask
21
+ } from '../../utils/loggings.mjs'
22
+ import {
23
+ getUnscopedPackageName,
19
24
  packageNodeModulesDirectory,
20
25
  packageSourcesDirectory,
21
26
  packageTestsBenchmarksDirectory,
22
27
  packageTestsDirectory
23
- } from '../../_utils.mjs'
28
+ } from '../../utils/packages.mjs'
29
+ import { getTaskConfigurationFor } from '../../utils/tasks.mjs'
30
+ import { toCamelCase } from '../../utils/texts.mjs'
24
31
 
25
32
  logLoadingTask( import.meta.filename )
26
33
 
27
- const {
28
- red,
29
- yellow,
30
- } = colors
31
-
32
34
  /**
33
35
  * @description Will generate benchmarks files from source code against provided alternatives
34
36
  */
@@ -38,18 +40,7 @@ const computeBenchmarksTask = async ( done ) => {
38
40
 
39
41
  // Get task configuration
40
42
  const filePathsToIgnore = await getTaskConfigurationFor( import.meta.filename )
41
-
42
- // Get source files to process
43
- const pattern = join( packageSourcesDirectory, '**' )
44
- const sourceFiles = glob.sync( pattern )
45
- .map( filePath => normalize( filePath ) )
46
- .filter( filePath => {
47
- const fileName = basename( filePath )
48
- const isJsFile = fileName.endsWith( '.js' )
49
- const isNotPrivateFile = !fileName.startsWith( '_' )
50
- const isNotIgnoredFile = !filePathsToIgnore.includes( fileName )
51
- return isJsFile && isNotPrivateFile && isNotIgnoredFile
52
- } )
43
+ const sourceFiles = getJavascriptSourceFiles( filePathsToIgnore )
53
44
 
54
45
  const benchRootImports = []
55
46
  for ( let sourceFile of sourceFiles ) {
@@ -57,19 +48,25 @@ const computeBenchmarksTask = async ( done ) => {
57
48
  const specificFilePath = sourceFile.replace( packageSourcesDirectory, '' )
58
49
  const specificDir = dirname( specificFilePath )
59
50
 
60
- const fileName = basename( sourceFile, extname( sourceFile ) )
61
- const benchFileName = `${ fileName }.bench.js`
62
- const benchDirPath = join( packageTestsBenchmarksDirectory, specificDir )
63
- const benchFilePath = join( benchDirPath, benchFileName )
51
+ const fileName = basename( sourceFile, extname( sourceFile ) )
52
+ const camelCaseFileName = toCamelCase( fileName )
53
+ const benchFileName = `${ camelCaseFileName }.bench.js`
54
+ const benchDirPath = join( packageTestsBenchmarksDirectory, specificDir )
55
+ const benchFilePath = join( benchDirPath, benchFileName )
64
56
 
65
- const nsName = `${ fileName }Namespace`
57
+ const nsName = `${ camelCaseFileName }Namespace`
66
58
  const importDirPath = relative( benchDirPath, packageSourcesDirectory )
67
59
  const importFilePath = join( importDirPath, specificFilePath ).replace( /\\/g, '/' )
68
60
 
69
61
  try {
70
62
 
71
63
  const jsdocPath = join( packageNodeModulesDirectory, '/jsdoc/jsdoc.js' )
72
- const jsdocOutput = childProcess.execFileSync( 'node', [ jsdocPath, '-X', sourceFile ] ).toString()
64
+ const jsdocOutput = childProcess.execFileSync( 'node', [ jsdocPath, '--explain', sourceFile ] ).toString()
65
+
66
+ if ( jsdocOutput.includes( 'There are no input files to process' ) ) {
67
+ log( 'Error ', red( `${ sourceFile }, no input files to process` ) )
68
+ continue
69
+ }
73
70
 
74
71
  const classNames = []
75
72
  const usedLongnames = []
@@ -223,7 +220,7 @@ const computeBenchmarksTask = async ( done ) => {
223
220
  `\tsuite.run()` + '\n' +
224
221
  `}` + '\n'
225
222
 
226
- const benchesFilePath = join( packageTestsBenchmarksDirectory, `${ packageName }.benchmarks.js` )
223
+ const benchesFilePath = join( packageTestsBenchmarksDirectory, `${ getUnscopedPackageName() }.benchmarks.js` )
227
224
  createFile( benchesFilePath, benchesTemplate )
228
225
 
229
226
  done()