itee-tasks 1.0.3 → 1.0.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.
@@ -10,7 +10,7 @@ on:
10
10
  branches: [ master ]
11
11
 
12
12
  jobs:
13
- build:
13
+ test:
14
14
  runs-on: ubuntu-latest
15
15
  env:
16
16
  MOZ_HEADLESS: 1
@@ -19,38 +19,41 @@ jobs:
19
19
  node-version: [ 20.x, 22.x, 24.x ]
20
20
  firefox: [ 'latest' ]
21
21
  steps:
22
- - name: Use Node.js ${{ matrix.node-version }}
23
- uses: actions/setup-node@v2
22
+ - name: Checkout ${{ env.GITHUB_REPOSITORY }}
23
+ uses: actions/checkout@v4
24
+ with:
25
+ fetch-depth: 0
26
+ - name: Setup Node.js ${{ matrix.node-version }}
27
+ uses: actions/setup-node@v4
24
28
  with:
25
29
  node-version: ${{ matrix.node-version }}
26
30
  - name: Setup Firefox ${{ matrix.firefox }}
27
31
  uses: browser-actions/setup-firefox@latest
28
32
  with:
29
33
  firefox-version: ${{ matrix.firefox }}
30
- - name: Checkout ${{ env.GITHUB_REPOSITORY }}
31
- uses: actions/checkout@v2
32
34
  - name: Install dependencies
33
- run: npm ci
34
- - name: Release
35
+ run: npm clean-install
36
+ - name: Tests
35
37
  run: npm run build && npm run lint && npm run tests:run
36
38
 
37
39
  publish:
38
- needs: build
40
+ needs: test
39
41
  runs-on: ubuntu-latest
40
42
  permissions:
41
43
  id-token: write
42
44
  contents: write
43
- env:
44
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
46
45
  steps:
47
- - name: Use Node.js ${{ matrix.node-version }}
48
- uses: actions/setup-node@v2
46
+ - name: Checkout ${{ env.GITHUB_REPOSITORY }}
47
+ uses: actions/checkout@v4
48
+ - name: Setup Node.js ${{ matrix.node-version }}
49
+ uses: actions/setup-node@v4
49
50
  with:
50
51
  node-version: "lts/*"
51
- - name: Checkout ${{ env.GITHUB_REPOSITORY }}
52
- uses: actions/checkout@v2
53
52
  - name: Install dependencies
54
- run: npm ci
53
+ run: npm clean-install
54
+ - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
55
+ run: npm audit signatures
55
56
  - name: Semantic Release
56
- run: npm run clean && npm run lint && npm run doc && npm run build && npx semantic-release
57
+ env:
58
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59
+ run: npm run lint && npm run doc && npm run build && npx semantic-release
package/.releaserc.mjs CHANGED
@@ -84,7 +84,11 @@ function getCIConfig() {
84
84
  return {
85
85
  branch: 'master',
86
86
  plugins: [
87
- getGitmojiPlugin(), getChangelogPlugin(), getNpmPlugin(), getGithubPlugin(), getGitPlugin()
87
+ getGitmojiPlugin(),
88
+ getChangelogPlugin(),
89
+ getNpmPlugin(),
90
+ getGithubPlugin(),
91
+ getGitPlugin()
88
92
  ]
89
93
  }
90
94
  }
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # [v1.0.5](https://github.com/Itee/itee-tasks/compare/v1.0.4...v1.0.5) (2026-01-14)
2
+
3
+ ## 🐛 Bug Fixes
4
+ - [`d46c8f8`](https://github.com/Itee/itee-tasks/commit/d46c8f8) (check-bundling) fix wrong package import path
5
+ - [`6bd2598`](https://github.com/Itee/itee-tasks/commit/6bd2598) (compute-benchmarks) fix wrong package import path
6
+
7
+ # [v1.0.4](https://github.com/Itee/itee-tasks/compare/v1.0.3...v1.0.4) (2026-01-13)
8
+
1
9
  # [v1.0.3](https://github.com/Itee/itee-tasks/compare/v1.0.2...v1.0.3) (2026-01-13)
2
10
 
3
11
  # [v1.0.2](https://github.com/Itee/itee-tasks/compare/v1.0.1...v1.0.2) (2026-01-13)
@@ -1,25 +1,5 @@
1
- import { glob } from 'glob'
2
- import {
3
- basename,
4
- join,
5
- normalize
6
- } from 'path'
7
- import {
8
- packageName,
9
- packageSourcesDirectory
10
- } from '../../../sources/_utils.mjs'
1
+ import { packageName } from '../../../sources/_utils.mjs'
11
2
 
12
-
13
- const filePathsToIgnore = [
3
+ export default [
14
4
  `${ packageName }.js`
15
- ]
16
-
17
- export default glob.sync( join( packageSourcesDirectory, '**' ) )
18
- .map( filePath => normalize( filePath ) )
19
- .filter( filePath => {
20
- const fileName = basename( filePath )
21
- const isJsFile = fileName.endsWith( '.js' )
22
- const isNotPrivateFile = !fileName.startsWith( '_' )
23
- const isNotIgnoredFile = !filePathsToIgnore.includes( fileName )
24
- return isJsFile && isNotPrivateFile && isNotIgnoredFile
25
- } )
5
+ ]
@@ -1,45 +1,51 @@
1
- import nodeResolve from '@rollup/plugin-node-resolve'
2
- import cleanup from 'rollup-plugin-cleanup'
1
+ import nodeResolve from '@rollup/plugin-node-resolve'
2
+ import cleanup from 'rollup-plugin-cleanup'
3
+ import { packageName } from '../../../sources/index.mjs'
3
4
 
4
5
  export default {
5
- input: null,
6
- external: [ '' ],
7
- plugins: [
8
- nodeResolve( {
9
- preferBuiltins: true
10
- } ),
11
- cleanup( {
12
- comments: 'none'
13
- } )
6
+ ignoredFiles: [
7
+ `${ packageName }.js`
14
8
  ],
15
- onwarn: ( {
16
- loc,
17
- frame,
18
- message
19
- } ) => {
9
+ buildOptions: {
10
+ input: null,
11
+ external: [ '' ],
12
+ plugins: [
13
+ nodeResolve( {
14
+ preferBuiltins: true
15
+ } ),
16
+ cleanup( {
17
+ comments: 'none'
18
+ } )
19
+ ],
20
+ onwarn: ( {
21
+ loc,
22
+ frame,
23
+ message
24
+ } ) => {
20
25
 
21
- // Ignore some errors
22
- if ( message.includes( 'Circular dependency' ) ) { return }
23
- if ( message.includes( 'Generated an empty chunk' ) ) { return }
26
+ // Ignore some errors
27
+ if ( message.includes( 'Circular dependency' ) ) { return }
28
+ if ( message.includes( 'Generated an empty chunk' ) ) { return }
24
29
 
25
- if ( loc ) {
26
- process.stderr.write( `/!\\ ${ loc.file } (${ loc.line }:${ loc.column }) ${ frame } ${ message }\n` )
27
- } else {
28
- process.stderr.write( `/!\\ ${ message }\n` )
29
- }
30
+ if ( loc ) {
31
+ process.stderr.write( `/!\\ ${ loc.file } (${ loc.line }:${ loc.column }) ${ frame } ${ message }\n` )
32
+ } else {
33
+ process.stderr.write( `/!\\ ${ message }\n` )
34
+ }
30
35
 
31
- },
32
- treeshake: {
33
- moduleSideEffects: true,
34
- annotations: true,
35
- correctVarValueBeforeDeclaration: true,
36
- propertyReadSideEffects: true,
37
- tryCatchDeoptimization: true,
38
- unknownGlobalSideEffects: true
39
- },
40
- output: {
41
- indent: '\t',
42
- format: 'esm',
43
- file: null
36
+ },
37
+ treeshake: {
38
+ moduleSideEffects: true,
39
+ annotations: true,
40
+ correctVarValueBeforeDeclaration: true,
41
+ propertyReadSideEffects: true,
42
+ tryCatchDeoptimization: true,
43
+ unknownGlobalSideEffects: true
44
+ },
45
+ output: {
46
+ indent: '\t',
47
+ format: 'esm',
48
+ file: null
49
+ }
44
50
  }
45
51
  }
@@ -1,42 +1,48 @@
1
- import nodeResolve from '@rollup/plugin-node-resolve'
2
- import cleanup from 'rollup-plugin-cleanup'
1
+ import nodeResolve from '@rollup/plugin-node-resolve'
2
+ import cleanup from 'rollup-plugin-cleanup'
3
+ import { packageName } from '../../../sources/index.mjs'
3
4
 
4
5
  export default {
5
- input: null,
6
- plugins: [
7
- nodeResolve(),
8
- cleanup( {
9
- comments: 'all' // else remove __PURE__ declaration... -_-'
10
- } )
6
+ ignoredFiles: [
7
+ `${ packageName }.js`
11
8
  ],
12
- onwarn: ( {
13
- loc,
14
- frame,
15
- message
16
- } ) => {
9
+ buildOptions: {
10
+ input: null,
11
+ plugins: [
12
+ nodeResolve(),
13
+ cleanup( {
14
+ comments: 'all' // else remove __PURE__ declaration... -_-'
15
+ } )
16
+ ],
17
+ onwarn: ( {
18
+ loc,
19
+ frame,
20
+ message
21
+ } ) => {
17
22
 
18
- // Ignore some errors
19
- if ( message.includes( 'Circular dependency' ) ) { return }
20
- if ( message.includes( 'Generated an empty chunk' ) ) { return }
23
+ // Ignore some errors
24
+ if ( message.includes( 'Circular dependency' ) ) { return }
25
+ if ( message.includes( 'Generated an empty chunk' ) ) { return }
21
26
 
22
- if ( loc ) {
23
- process.stderr.write( `/!\\ ${ loc.file } (${ loc.line }:${ loc.column }) ${ frame } ${ message }\n` )
24
- } else {
25
- process.stderr.write( `/!\\ ${ message }\n` )
26
- }
27
+ if ( loc ) {
28
+ process.stderr.write( `/!\\ ${ loc.file } (${ loc.line }:${ loc.column }) ${ frame } ${ message }\n` )
29
+ } else {
30
+ process.stderr.write( `/!\\ ${ message }\n` )
31
+ }
27
32
 
28
- },
29
- treeshake: {
30
- moduleSideEffects: true,
31
- annotations: true,
32
- correctVarValueBeforeDeclaration: true,
33
- propertyReadSideEffects: true,
34
- tryCatchDeoptimization: true,
35
- unknownGlobalSideEffects: true
36
- },
37
- output: {
38
- indent: '\t',
39
- format: 'esm',
40
- file: null
33
+ },
34
+ treeshake: {
35
+ moduleSideEffects: true,
36
+ annotations: true,
37
+ correctVarValueBeforeDeclaration: true,
38
+ propertyReadSideEffects: true,
39
+ tryCatchDeoptimization: true,
40
+ unknownGlobalSideEffects: true
41
+ },
42
+ output: {
43
+ indent: '\t',
44
+ format: 'esm',
45
+ file: null
46
+ }
41
47
  }
42
48
  }
@@ -1,25 +1,5 @@
1
- import { glob } from 'glob'
2
- import {
3
- basename,
4
- join,
5
- normalize
6
- } from 'path'
7
- import {
8
- packageName,
9
- packageSourcesDirectory
10
- } from '../../../sources/_utils.mjs'
1
+ import { packageName } from '../../../sources/_utils.mjs'
11
2
 
12
-
13
- const filePathsToIgnore = [
3
+ export default [
14
4
  `${ packageName }.js`
15
5
  ]
16
-
17
- export default glob.sync( join( packageSourcesDirectory, '**' ) )
18
- .map( filePath => normalize( filePath ) )
19
- .filter( filePath => {
20
- const fileName = basename( filePath )
21
- const isJsFile = fileName.endsWith( '.js' )
22
- const isNotPrivateFile = !fileName.startsWith( '_' )
23
- const isNotIgnoredFile = !filePathsToIgnore.includes( fileName )
24
- return isJsFile && isNotPrivateFile && isNotIgnoredFile
25
- } )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "itee-tasks",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Allow to manage all commons itee gulp tasks into one place ",
5
5
  "keywords": [
6
6
  "itee",
@@ -24,11 +24,13 @@
24
24
  "bugs": {
25
25
  "url": "https://github.com/Itee/itee-tasks/issues"
26
26
  },
27
+ "engines": {
28
+ "node": ">=20"
29
+ },
27
30
  "scripts": {
28
31
  "default": "gulp --tasks",
29
32
  "refresh": "node ./sources/refresh.mjs",
30
33
  "help": "gulp help",
31
- "patch": "gulp patch",
32
34
  "clean": "gulp clean",
33
35
  "lint": "gulp lint",
34
36
  "doc": "gulp doc",
@@ -51,8 +53,12 @@
51
53
  "postversion": "gulp build"
52
54
  },
53
55
  "devDependencies": {
56
+ "@semantic-release/changelog": "^6.0.3",
57
+ "@semantic-release/git": "^10.0.1",
58
+ "@semantic-release/github": "^12.0.2",
59
+ "@semantic-release/npm": "^13.1.3",
54
60
  "cz-emoji": "^1.3.2-canary.2",
55
- "semantic-release": "^24.2.9",
61
+ "semantic-release": "^25.0.2",
56
62
  "semantic-release-gitmoji": "^1.6.8"
57
63
  },
58
64
  "dependencies": {
@@ -62,10 +68,6 @@
62
68
  "@rollup/plugin-commonjs": "^28.0.9",
63
69
  "@rollup/plugin-node-resolve": "^16.0.3",
64
70
  "@rollup/plugin-terser": "^0.4.4",
65
- "@semantic-release/changelog": "^6.0.3",
66
- "@semantic-release/git": "^10.0.1",
67
- "@semantic-release/github": "^11.0.6",
68
- "@semantic-release/npm": "^12.0.2",
69
71
  "@web/test-runner": "^0.20.2",
70
72
  "@web/test-runner-playwright": "^0.11.1",
71
73
  "ansi-colors": "^4.1.3",
@@ -87,5 +89,12 @@
87
89
  "rollup": "^4.55.1",
88
90
  "rollup-plugin-cleanup": "^3.2.1",
89
91
  "rollup-plugin-re": "^1.0.7"
92
+ },
93
+ "overrides": {
94
+ "semantic-release-gitmoji": {
95
+ "semantic-release": "<26",
96
+ "@semantic-release/github": "12.0.1",
97
+ "@semantic-release/npm": "13.1.1"
98
+ }
90
99
  }
91
100
  }
@@ -1,11 +1,13 @@
1
1
  import colors from 'ansi-colors'
2
2
  import childProcess from 'child_process'
3
3
  import log from 'fancy-log'
4
+ import { glob } from 'glob'
4
5
  import {
5
6
  basename,
6
7
  dirname,
7
8
  extname,
8
9
  join,
10
+ normalize,
9
11
  relative
10
12
  } from 'path'
11
13
  import {
@@ -16,8 +18,8 @@ import {
16
18
  logLoadingTask,
17
19
  packageName,
18
20
  packageNodeModulesDirectory,
19
- packageSourcesDirectory as sourcesDir,
20
- packageTestsBenchmarksDirectory as benchesDir,
21
+ packageSourcesDirectory,
22
+ packageTestsBenchmarksDirectory,
21
23
  packageTestsDirectory
22
24
  } from '../../_utils.mjs'
23
25
 
@@ -35,21 +37,36 @@ const configuration = await getConfigurationFrom( configurationPath )
35
37
  */
36
38
  const computeBenchmarksTask = ( done ) => {
37
39
 
38
- createDirectoryIfNotExist( benchesDir )
40
+ createDirectoryIfNotExist( packageTestsBenchmarksDirectory )
41
+
42
+ // Get task configuration
43
+ const filePathsToIgnore = configuration
44
+
45
+ // Get source files to process
46
+ const pattern = join( packageSourcesDirectory, '**' )
47
+ const sourceFiles = glob.sync( pattern )
48
+ .map( filePath => normalize( filePath ) )
49
+ .filter( filePath => {
50
+ const fileName = basename( filePath )
51
+ const isJsFile = fileName.endsWith( '.js' )
52
+ const isNotPrivateFile = !fileName.startsWith( '_' )
53
+ const isNotIgnoredFile = !filePathsToIgnore.includes( fileName )
54
+ return isJsFile && isNotPrivateFile && isNotIgnoredFile
55
+ } )
39
56
 
40
57
  const benchRootImports = []
41
- for ( let sourceFile of configuration ) {
58
+ for ( let sourceFile of sourceFiles ) {
42
59
 
43
- const specificFilePath = sourceFile.replace( sourcesDir, '' )
60
+ const specificFilePath = sourceFile.replace( packageSourcesDirectory, '' )
44
61
  const specificDir = dirname( specificFilePath )
45
62
 
46
63
  const fileName = basename( sourceFile, extname( sourceFile ) )
47
64
  const benchFileName = `${ fileName }.bench.js`
48
- const benchDirPath = join( benchesDir, specificDir )
65
+ const benchDirPath = join( packageTestsBenchmarksDirectory, specificDir )
49
66
  const benchFilePath = join( benchDirPath, benchFileName )
50
67
 
51
68
  const nsName = `${ fileName }Namespace`
52
- const importDirPath = relative( benchDirPath, sourcesDir )
69
+ const importDirPath = relative( benchDirPath, packageSourcesDirectory )
53
70
  const importFilePath = join( importDirPath, specificFilePath ).replace( /\\/g, '/' )
54
71
 
55
72
  try {
@@ -159,7 +176,7 @@ const computeBenchmarksTask = ( done ) => {
159
176
  `export { ${ suitesToExports } }` + '\n' +
160
177
  '\n'
161
178
 
162
- const importBenchFilePath = relative( benchesDir, benchFilePath ).replace( /\\/g, '/' )
179
+ const importBenchFilePath = relative( packageTestsBenchmarksDirectory, benchFilePath ).replace( /\\/g, '/' )
163
180
  benchRootImports.push( {
164
181
  path: importBenchFilePath,
165
182
  exports: suitesToExports
@@ -192,7 +209,7 @@ const computeBenchmarksTask = ( done ) => {
192
209
  // Use a fallback in case no benches were found at all
193
210
  if ( benchRootImports.length === 0 ) {
194
211
  log( 'Warning ', yellow( 'No usable exports found, generate default file to avoid frontend breakage.' ) )
195
- const defaultBenchesDir = join( benchesDir, 'default' )
212
+ const defaultBenchesDir = join( packageTestsBenchmarksDirectory, 'default' )
196
213
  const defaultBenchesPath = join( defaultBenchesDir, 'default.bench.js' )
197
214
 
198
215
  createDirectoryIfNotExist( defaultBenchesDir )
@@ -209,7 +226,7 @@ const computeBenchmarksTask = ( done ) => {
209
226
  `\tsuite.run()` + '\n' +
210
227
  `}` + '\n'
211
228
 
212
- const benchesFilePath = join( benchesDir, `${ packageName }.benchmarks.js` )
229
+ const benchesFilePath = join( packageTestsBenchmarksDirectory, `${ packageName }.benchmarks.js` )
213
230
  createFile( benchesFilePath, benchesTemplate )
214
231
 
215
232
  done()
@@ -4,12 +4,14 @@ import {
4
4
  existsSync,
5
5
  rmSync
6
6
  } from 'fs'
7
+ import { glob } from 'glob'
7
8
  import {
8
9
  basename,
9
10
  dirname,
10
11
  extname,
11
- join
12
- } from 'path'
12
+ join,
13
+ normalize
14
+ } from 'path'
13
15
  import { rollup } from 'rollup'
14
16
  import {
15
17
  getConfigurationFrom,
@@ -25,9 +27,6 @@ const {
25
27
  magenta,
26
28
  } = colors
27
29
 
28
- const sourcesFilesLocation = join( 'tests', 'bundlings', 'check-bundling.conf.mjs' )
29
- const sourcesFilesPath = getConfigurationPathFor( sourcesFilesLocation )
30
-
31
30
  const configurationLocation = join( 'tests', 'bundlings', 'check-bundling-from-esm-files-direct.conf.mjs' )
32
31
  const configurationPath = getConfigurationPathFor( configurationLocation )
33
32
 
@@ -45,10 +44,21 @@ const checkBundlingFromEsmFilesDirectTask = async ( done ) => {
45
44
  rmSync( outputDir, { recursive: true } )
46
45
  }
47
46
 
48
- const sourcesFiles = await getConfigurationFrom( sourcesFilesPath )
49
47
  const configuration = await getConfigurationFrom( configurationPath )
50
48
 
51
- for ( let sourceFile of sourcesFiles ) {
49
+ // Get source files to process
50
+ const pattern = join( packageSourcesDirectory, '**' )
51
+ const sourceFiles = glob.sync( pattern )
52
+ .map( filePath => normalize( filePath ) )
53
+ .filter( filePath => {
54
+ const fileName = basename( filePath )
55
+ const isJsFile = fileName.endsWith( '.js' )
56
+ const isNotPrivateFile = !fileName.startsWith( '_' )
57
+ const isNotIgnoredFile = !configuration.ignoredFiles.includes( fileName )
58
+ return isJsFile && isNotPrivateFile && isNotIgnoredFile
59
+ } )
60
+
61
+ for ( let sourceFile of sourceFiles ) {
52
62
 
53
63
  const specificFilePath = sourceFile.replace( packageSourcesDirectory, '' )
54
64
  const specificDir = dirname( specificFilePath )
@@ -57,16 +67,16 @@ const checkBundlingFromEsmFilesDirectTask = async ( done ) => {
57
67
  const bundleFileName = `${ fileName }.bundle.js`
58
68
  const bundleFilePath = join( outputDir, specificDir, bundleFileName )
59
69
 
60
- configuration.input = sourceFile
61
- configuration.output.file = bundleFilePath
70
+ configuration.buildOptions.input = sourceFile
71
+ configuration.buildOptions.output.file = bundleFilePath
62
72
 
63
73
  try {
64
74
 
65
- log( 'Bundling', green( configuration.output.file ) )
75
+ log( 'Bundling', green( configuration.buildOptions.output.file ) )
66
76
 
67
- const bundle = await rollup( configuration )
68
- await bundle.generate( configuration.output )
69
- await bundle.write( configuration.output )
77
+ const bundle = await rollup( configuration.buildOptions )
78
+ await bundle.generate( configuration.buildOptions.output )
79
+ await bundle.write( configuration.buildOptions.output )
70
80
 
71
81
  } catch ( error ) {
72
82
 
@@ -6,9 +6,12 @@ import {
6
6
  rmSync,
7
7
  writeFileSync
8
8
  } from 'fs'
9
+ import { glob } from 'glob'
9
10
  import {
11
+ basename,
10
12
  dirname,
11
13
  join,
14
+ normalize,
12
15
  parse,
13
16
  relative
14
17
  } from 'path'
@@ -17,8 +20,8 @@ import {
17
20
  getConfigurationFrom,
18
21
  getConfigurationPathFor,
19
22
  logLoadingTask,
20
- packageSourcesDirectory as sourcesDir,
21
- packageTestsBundlesDirectory as bundleDir
23
+ packageSourcesDirectory,
24
+ packageTestsBundlesDirectory
22
25
  } from '../../_utils.mjs'
23
26
 
24
27
  const {
@@ -27,15 +30,12 @@ const {
27
30
  magenta,
28
31
  } = colors
29
32
 
30
- const sourcesFilesLocation = join( 'tests', 'bundlings', 'check-bundling.conf.mjs' )
31
- const sourcesFilesPath = getConfigurationPathFor( sourcesFilesLocation )
32
-
33
33
  const configurationLocation = join( 'tests', 'bundlings', 'check-bundling-from-esm-files-import.conf.mjs' )
34
34
  const configurationPath = getConfigurationPathFor( configurationLocation )
35
35
 
36
36
  const checkBundlingFromEsmFilesImportTask = async ( done ) => {
37
37
 
38
- const outputDir = join( bundleDir, 'from_files_import' )
38
+ const outputDir = join( packageTestsBundlesDirectory, 'from_files_import' )
39
39
  const temporariesDir = join( outputDir, '.tmp' )
40
40
 
41
41
  if ( existsSync( outputDir ) ) {
@@ -43,17 +43,28 @@ const checkBundlingFromEsmFilesImportTask = async ( done ) => {
43
43
  rmSync( outputDir, { recursive: true } )
44
44
  }
45
45
 
46
- const sourcesFiles = await getConfigurationFrom( sourcesFilesPath )
47
46
  const configuration = await getConfigurationFrom( configurationPath )
48
47
 
49
- for ( let sourceFile of sourcesFiles ) {
48
+ // Get source files to process
49
+ const pattern = join( packageSourcesDirectory, '**' )
50
+ const sourceFiles = glob.sync( pattern )
51
+ .map( filePath => normalize( filePath ) )
52
+ .filter( filePath => {
53
+ const fileName = basename( filePath )
54
+ const isJsFile = fileName.endsWith( '.js' )
55
+ const isNotPrivateFile = !fileName.startsWith( '_' )
56
+ const isNotIgnoredFile = !configuration.ignoredFiles.includes( fileName )
57
+ return isJsFile && isNotPrivateFile && isNotIgnoredFile
58
+ } )
59
+
60
+ for ( let sourceFile of sourceFiles ) {
50
61
 
51
62
  const {
52
63
  dir: sourceDir,
53
64
  base: sourceBase,
54
65
  name: sourceName
55
66
  } = parse( sourceFile )
56
- const specificFilePath = sourceFile.replace( sourcesDir, '' )
67
+ const specificFilePath = sourceFile.replace( packageSourcesDirectory, '' )
57
68
  const specificDir = dirname( specificFilePath )
58
69
 
59
70
  // Create temp import file per file in package
@@ -68,8 +79,8 @@ const checkBundlingFromEsmFilesImportTask = async ( done ) => {
68
79
  const bundleFileName = `${ sourceName }.bundle.js`
69
80
  const bundleFilePath = join( outputDir, specificDir, bundleFileName )
70
81
 
71
- configuration.input = temporaryFile
72
- configuration.output.file = bundleFilePath
82
+ configuration.buildOptions.input = temporaryFile
83
+ configuration.buildOptions.output.file = bundleFilePath
73
84
 
74
85
  // create tmp file
75
86
  try {
@@ -77,13 +88,13 @@ const checkBundlingFromEsmFilesImportTask = async ( done ) => {
77
88
  mkdirSync( temporaryDir, { recursive: true } )
78
89
  writeFileSync( temporaryFile, temporaryFileData )
79
90
 
80
- const bundle = await rollup( configuration )
81
- const { output } = await bundle.generate( configuration.output )
91
+ const bundle = await rollup( configuration.buildOptions )
92
+ const { output } = await bundle.generate( configuration.buildOptions.output )
82
93
 
83
94
  let code = output[ 0 ].code
84
95
  if ( code.length > 1 ) {
85
96
  log( red( `[${ specificFilePath }] contain side-effects !` ) )
86
- await bundle.write( configuration.output )
97
+ await bundle.write( configuration.buildOptions.output )
87
98
  } else {
88
99
  log( green( `[${ specificFilePath }] is side-effect free.` ) )
89
100
  }
@@ -1,14 +1,16 @@
1
1
  import colors from 'ansi-colors'
2
2
  import childProcess from 'child_process'
3
3
  import log from 'fancy-log'
4
+ import { glob } from 'glob'
4
5
  import { isNotEmptyArray } from 'itee-validators'
5
6
  import {
6
7
  basename,
7
8
  dirname,
8
9
  extname,
9
10
  join,
11
+ normalize,
10
12
  relative
11
- } from 'path'
13
+ } from 'path'
12
14
  import {
13
15
  createDirectoryIfNotExist,
14
16
  createFile,
@@ -19,9 +21,9 @@ import {
19
21
  logLoadingTask,
20
22
  packageName,
21
23
  packageNodeModulesDirectory,
22
- packageSourcesDirectory as sourcesDir,
23
- packageTestsUnitsDirectory as unitsDir
24
- } from '../../_utils.mjs'
24
+ packageSourcesDirectory,
25
+ packageTestsUnitsDirectory
26
+ } from '../../_utils.mjs'
25
27
 
26
28
  const configurationLocation = join( 'tests', 'units', 'compute-unit-tests.conf.mjs' )
27
29
  const configurationPath = getConfigurationPathFor( configurationLocation )
@@ -37,22 +39,37 @@ const {
37
39
  */
38
40
  const computeUnitTestsTask = ( done ) => {
39
41
 
40
- createDirectoryIfNotExist( unitsDir )
42
+ createDirectoryIfNotExist( packageTestsUnitsDirectory )
43
+
44
+ // Get task configuration
45
+ const filePathsToIgnore = configuration
46
+
47
+ // Get source files to process
48
+ const pattern = join( packageSourcesDirectory, '**' )
49
+ const sourceFiles = glob.sync( pattern )
50
+ .map( filePath => normalize( filePath ) )
51
+ .filter( filePath => {
52
+ const fileName = basename( filePath )
53
+ const isJsFile = fileName.endsWith( '.js' )
54
+ const isNotPrivateFile = !fileName.startsWith( '_' )
55
+ const isNotIgnoredFile = !filePathsToIgnore.includes( fileName )
56
+ return isJsFile && isNotPrivateFile && isNotIgnoredFile
57
+ } )
41
58
 
42
59
  const unitsImportMap = []
43
- for ( let sourceFile of configuration ) {
60
+ for ( let sourceFile of sourceFiles ) {
44
61
 
45
- const specificFilePath = sourceFile.replace( sourcesDir, '' )
62
+ const specificFilePath = sourceFile.replace( packageSourcesDirectory, '' )
46
63
  const specificDir = dirname( specificFilePath )
47
64
 
48
65
  const fileName = basename( sourceFile, extname( sourceFile ) )
49
66
  const unitFileName = `${ fileName }.unit.mjs`
50
- const unitDirPath = join( unitsDir, specificDir )
67
+ const unitDirPath = join( packageTestsUnitsDirectory, specificDir )
51
68
  const unitFilePath = join( unitDirPath, unitFileName )
52
69
 
53
70
  const nsName = `${ fileName }Namespace`
54
71
  const unitName = `${ fileName }Units`
55
- const importDirPath = relative( unitDirPath, sourcesDir )
72
+ const importDirPath = relative( unitDirPath, packageSourcesDirectory )
56
73
  const importFilePath = join( importDirPath, specificFilePath ).replace( /\\/g, '/' )
57
74
 
58
75
  try {
@@ -477,7 +494,7 @@ const computeUnitTestsTask = ( done ) => {
477
494
  '' +
478
495
  `} )` + '\n'
479
496
 
480
- const importUnitFilePath = relative( unitsDir, unitFilePath )
497
+ const importUnitFilePath = relative( packageTestsUnitsDirectory, unitFilePath )
481
498
  unitsImportMap.push( {
482
499
  exportName: unitName,
483
500
  path: importUnitFilePath.replace( /\\/g, '/' )
@@ -509,7 +526,7 @@ const computeUnitTestsTask = ( done ) => {
509
526
  } else {
510
527
 
511
528
  log( 'Warning ', yellow( 'No tests were generated. Create fallback global root import file.' ) )
512
- const defaultUnitsDir = join( unitsDir, 'default' )
529
+ const defaultUnitsDir = join( packageTestsUnitsDirectory, 'default' )
513
530
  const defaultUnitsPath = join( defaultUnitsDir, 'default.unit.mjs' )
514
531
 
515
532
  createDirectoryIfNotExist( defaultUnitsDir )
@@ -520,7 +537,7 @@ const computeUnitTestsTask = ( done ) => {
520
537
 
521
538
  }
522
539
 
523
- const unitsFilePath = join( unitsDir, `${ packageName }.units.mjs` )
540
+ const unitsFilePath = join( packageTestsUnitsDirectory, `${ packageName }.units.mjs` )
524
541
  createFile( unitsFilePath, unitsTemplate )
525
542
 
526
543
  done()
@@ -1,25 +0,0 @@
1
- import { glob } from 'glob'
2
- import {
3
- basename,
4
- join,
5
- normalize
6
- } from 'path'
7
- import {
8
- packageName,
9
- packageSourcesDirectory
10
- } from '../../../sources/_utils.mjs'
11
-
12
- const pattern = join( packageSourcesDirectory, '**' )
13
- const filePathsToIgnore = [
14
- `${ packageName }.js`
15
- ]
16
-
17
- export default glob.sync( pattern )
18
- .map( filePath => normalize( filePath ) )
19
- .filter( filePath => {
20
- const fileName = basename( filePath )
21
- const isJsFile = fileName.endsWith( '.js' )
22
- const isNotPrivateFile = !fileName.startsWith( '_' )
23
- const isNotIgnoredFile = !filePathsToIgnore.includes( fileName )
24
- return isJsFile && isNotPrivateFile && isNotIgnoredFile
25
- } )