itee-validators 5.6.0 → 6.0.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.
- package/.github/workflows/node.js.yml +2 -2
- package/.releaserc.mjs +94 -0
- package/.tasks/.builds/build-benchmarks.task.mjs +16 -0
- package/.tasks/.builds/build-tests.task.mjs +18 -0
- package/.tasks/.builds/build-unit-tests.task.mjs +16 -0
- package/.tasks/.builds/build.task.mjs +46 -0
- package/.tasks/.cleans/clean.task.mjs +23 -0
- package/.tasks/.docs/doc.task.mjs +35 -0
- package/.tasks/.helps/help.task.mjs +151 -0
- package/.tasks/.lints/lint.task.mjs +37 -0
- package/.tasks/.patches/patch.task.mjs +13 -0
- package/.tasks/.releases/release.task.mjs +26 -0
- package/.tasks/.tests/benchmarks/build-benchmarks-backend.task.mjs +42 -0
- package/.tasks/{tests/benchmarks/compute-benchmarks.mjs → .tests/benchmarks/compute-benchmarks.task.mjs} +46 -51
- package/.tasks/.tests/benchmarks/run-benchmarks-for-backend.task.mjs +39 -0
- package/.tasks/.tests/benchmarks/run-benchmarks-for-frontend.task.mjs +41 -0
- package/.tasks/.tests/benchmarks/run-benchmarks.task.mjs +18 -0
- package/.tasks/{tests/bundling/check-bundling-from-esm-build-import.mjs → .tests/bundling/check-bundling-from-esm-build-import.task.mjs} +31 -75
- package/.tasks/.tests/bundling/check-bundling-from-esm-files-direct.task.mjs +77 -0
- package/.tasks/.tests/bundling/check-bundling-from-esm-files-import.task.mjs +95 -0
- package/.tasks/.tests/bundling/check-bundling.task.mjs +20 -0
- package/.tasks/.tests/run-tests.task.mjs +18 -0
- package/.tasks/.tests/unit-tests/build-unit-tests-backend.task.mjs +42 -0
- package/.tasks/{tests/unit-tests/compute-unit-tests.mjs → .tests/unit-tests/compute-unit-tests.task.mjs} +152 -193
- package/.tasks/.tests/unit-tests/run-unit-tests-for-backend.task.mjs +44 -0
- package/.tasks/.tests/unit-tests/run-unit-tests-for-frontend.task.mjs +41 -0
- package/.tasks/.tests/unit-tests/run-unit-tests.task.mjs +18 -0
- package/.tasks/_refresh-gulpfile.task.mjs +65 -0
- package/.tasks/_utils.mjs +159 -33
- package/.tasks/configs/benchmarks.conf.mjs +57 -0
- package/.tasks/configs/build-benchmarks-backend.conf.mjs +51 -0
- package/.tasks/configs/build-unit-tests-backend.conf.mjs +46 -0
- package/.tasks/configs/build.conf.mjs +354 -0
- package/.tasks/configs/check-bundling.conf.mjs +26 -0
- package/.tasks/configs/clean.conf.mjs +9 -0
- package/.tasks/configs/compute-benchmarks.conf.mjs +28 -0
- package/.tasks/configs/compute-unit-tests.conf.mjs +27 -0
- package/.tasks/configs/doc.conf.json +50 -0
- package/.tasks/configs/eslint.conf.mjs +121 -0
- package/.tasks/configs/units.conf.mjs +27 -0
- package/.tasks/itee-benchmarks-framework.js +186 -0
- package/.tasks/itee-reporter.mjs +217 -0
- package/CHANGELOG.md +12 -0
- package/builds/itee-validators.cjs.js +53 -15
- package/builds/itee-validators.cjs.js.map +1 -1
- package/builds/itee-validators.cjs.min.js +36 -35
- package/builds/itee-validators.esm.js +25 -2
- package/builds/itee-validators.esm.js.map +1 -1
- package/builds/itee-validators.esm.min.js +3 -3
- package/builds/itee-validators.iife.js +25 -4
- package/builds/itee-validators.iife.js.map +1 -1
- package/builds/itee-validators.iife.min.js +10 -10
- package/package.json +49 -41
- package/sources/cores/_cores.js +10 -10
- package/sources/cores/arrays/_arrays.js +12 -12
- package/sources/cores/arrays/isArrayOfArray.js +2 -2
- package/sources/cores/arrays/isArrayOfBoolean.js +3 -3
- package/sources/cores/arrays/isArrayOfFunction.js +3 -3
- package/sources/cores/arrays/isArrayOfMultiElement.js +1 -1
- package/sources/cores/arrays/isArrayOfNull.js +3 -3
- package/sources/cores/arrays/isArrayOfNumber.js +3 -3
- package/sources/cores/arrays/isArrayOfObject.js +3 -3
- package/sources/cores/arrays/isArrayOfSingleElement.js +1 -1
- package/sources/cores/arrays/isArrayOfString.js +3 -3
- package/sources/cores/arrays/isArrayOfUndefined.js +3 -3
- package/sources/cores/arrays/isEmptyArray.js +1 -1
- package/sources/cores/booleans/_booleans.js +2 -2
- package/sources/cores/booleans/isTrue.js +1 -1
- package/sources/cores/cores.js +8 -8
- package/sources/cores/functions/_functions.js +1 -1
- package/sources/cores/numbers/_numbers.js +6 -6
- package/sources/cores/numbers/isNumber.js +3 -3
- package/sources/cores/objects/_objects.js +2 -2
- package/sources/cores/objects/isEmptyObject.js +1 -1
- package/sources/cores/objects/isObject.js +1 -1
- package/sources/cores/strings/_strings.js +3 -3
- package/sources/cores/strings/isBlankString.js +2 -2
- package/sources/cores/strings/isEmptyString.js +1 -1
- package/sources/cores/symbols/_symbols.js +1 -1
- package/sources/cores/tests/isTestUnitGenerator.js +5 -6
- package/sources/cores/typed-arrays/_typedArrays.js +12 -12
- package/sources/cores/voids/_voids.js +4 -4
- package/sources/cores/voids/isEmpty.js +4 -4
- package/sources/file-system/_file-system.js +9 -9
- package/sources/file-system/block-devices/_blockDevices.js +3 -3
- package/sources/file-system/block-devices/isBlockDevicePath.js +3 -3
- package/sources/file-system/block-devices/isValidBlockDevicePath.js +2 -2
- package/sources/file-system/character-devices/_characterDevices.js +3 -3
- package/sources/file-system/character-devices/isCharacterDevicePath.js +3 -3
- package/sources/file-system/character-devices/isValidCharacterDevicePath.js +2 -2
- package/sources/file-system/directories/_directories.js +4 -4
- package/sources/file-system/directories/isDirectoryPath.js +3 -3
- package/sources/file-system/directories/isEmptyDirectory.js +2 -2
- package/sources/file-system/directories/isValidDirectoryPath.js +2 -2
- package/sources/file-system/fifo-pipes/_fifoPipes.js +3 -3
- package/sources/file-system/fifo-pipes/isFIFOPath.js +3 -3
- package/sources/file-system/fifo-pipes/isValidFIFOPath.js +2 -2
- package/sources/file-system/files/_files.js +4 -4
- package/sources/file-system/files/isEmptyFile.js +3 -3
- package/sources/file-system/files/isFilePath.js +3 -3
- package/sources/file-system/files/isValidFilePath.js +2 -2
- package/sources/file-system/paths/_paths.js +2 -2
- package/sources/file-system/paths/isValidPath.js +1 -1
- package/sources/file-system/sockets/_sockets.js +3 -3
- package/sources/file-system/sockets/isSocketPath.js +3 -3
- package/sources/file-system/sockets/isValidSocketPath.js +2 -2
- package/sources/file-system/symbolic-links/_symbolicLinks.js +3 -3
- package/sources/file-system/symbolic-links/isSymbolicLinkPath.js +3 -3
- package/sources/file-system/symbolic-links/isValidSymbolicLinkPath.js +2 -2
- package/sources/itee-validators.js +4 -4
- package/sources/maths/_maths.js +1 -1
- package/sources/physics/_physics.js +2 -2
- package/sources/physics/temperatures/_temperatures.js +5 -5
- package/sources/physics/temperatures/isCelsius.js +2 -2
- package/sources/physics/temperatures/isFahrenheit.js +2 -2
- package/sources/physics/temperatures/isKelvin.js +2 -2
- package/sources/physics/temperatures/isTemperature.js +3 -3
- package/.tasks/builds/build.mjs +0 -65
- package/.tasks/cleans/clean.mjs +0 -20
- package/.tasks/docs/doc.mjs +0 -37
- package/.tasks/helps/help.mjs +0 -195
- package/.tasks/lints/lint.mjs +0 -33
- package/.tasks/patches/patch.mjs +0 -9
- package/.tasks/tests/benchmarks/bundle-benchmarks.mjs +0 -33
- package/.tasks/tests/benchmarks/run-benchmarks-for-backend.mjs +0 -24
- package/.tasks/tests/benchmarks/run-benchmarks-for-frontend.mjs +0 -38
- package/.tasks/tests/bundling/check-bundling-from-esm-files-direct.mjs +0 -129
- package/.tasks/tests/bundling/check-bundling-from-esm-files-import.mjs +0 -149
- package/.tasks/tests/unit-tests/bundle-unit-tests.mjs +0 -33
- package/.tasks/tests/unit-tests/run-unit-tests-for-backend.mjs +0 -25
- package/.tasks/tests/unit-tests/run-unit-tests-for-frontend.mjs +0 -41
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author [Tristan Valcke]{@link https://github.com/Itee}
|
|
3
|
+
* @license [BSD-3-Clause]{@link https://opensource.org/licenses/BSD-3-Clause}
|
|
4
|
+
*
|
|
5
|
+
* @module configs/Rollup
|
|
6
|
+
* @description The file manage the rollup configuration for build the library using differents arguments. It allow to build with two type of environment (dev and prod), and differents output format.
|
|
7
|
+
* Use npm run help to display all available build options.
|
|
8
|
+
*
|
|
9
|
+
* @requires {@link module: [rollup-plugin-commonjs]{@link https://github.com/rollup/rollup-plugin-commonjs}}
|
|
10
|
+
* @requires {@link module: [path]{@link https://nodejs.org/api/path.html}}
|
|
11
|
+
* @requires {@link module: [rollup-plugin-re]{@link https://github.com/jetiny/rollup-plugin-re}}
|
|
12
|
+
* @requires {@link module: [rollup-plugin-node-resolve]{@link https://github.com/rollup/rollup-plugin-node-resolve}}
|
|
13
|
+
* @requires {@link module: [rollup-plugin-terser]{@link https://github.com/TrySound/rollup-plugin-terser}}
|
|
14
|
+
*/
|
|
15
|
+
import commonjs from '@rollup/plugin-commonjs'
|
|
16
|
+
import nodeResolve from '@rollup/plugin-node-resolve'
|
|
17
|
+
import terser from '@rollup/plugin-terser'
|
|
18
|
+
import figlet from 'figlet'
|
|
19
|
+
import {
|
|
20
|
+
basename,
|
|
21
|
+
join
|
|
22
|
+
} from 'path'
|
|
23
|
+
import cleanup from 'rollup-plugin-cleanup'
|
|
24
|
+
import replace from 'rollup-plugin-re'
|
|
25
|
+
import {
|
|
26
|
+
getPrettyPackageName,
|
|
27
|
+
getPrettyPackageVersion,
|
|
28
|
+
packageBuildsDirectory,
|
|
29
|
+
packageDescription,
|
|
30
|
+
packageName,
|
|
31
|
+
packageSourcesDirectory
|
|
32
|
+
} from '../_utils.mjs'
|
|
33
|
+
|
|
34
|
+
// Utils
|
|
35
|
+
|
|
36
|
+
function getPrettyFormatForBanner( format ) {
|
|
37
|
+
|
|
38
|
+
let prettyFormat = ''
|
|
39
|
+
|
|
40
|
+
switch ( format ) {
|
|
41
|
+
|
|
42
|
+
case 'cjs':
|
|
43
|
+
prettyFormat = 'CommonJs'
|
|
44
|
+
break
|
|
45
|
+
|
|
46
|
+
case 'esm':
|
|
47
|
+
prettyFormat = 'EsModule'
|
|
48
|
+
break
|
|
49
|
+
|
|
50
|
+
case 'iife':
|
|
51
|
+
prettyFormat = 'Standalone'
|
|
52
|
+
break
|
|
53
|
+
|
|
54
|
+
case 'umd':
|
|
55
|
+
prettyFormat = 'Universal'
|
|
56
|
+
break
|
|
57
|
+
|
|
58
|
+
default:
|
|
59
|
+
throw new RangeError( `Invalid switch parameter: ${ format }` )
|
|
60
|
+
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return prettyFormat
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function _commentarize( banner ) {
|
|
68
|
+
|
|
69
|
+
let bannerCommented = '/**\n'
|
|
70
|
+
bannerCommented += ' * '
|
|
71
|
+
bannerCommented += banner.replaceAll( '\n', '\n * ' )
|
|
72
|
+
bannerCommented += '\n'
|
|
73
|
+
bannerCommented += ` * @desc ${ packageDescription }\n`
|
|
74
|
+
bannerCommented += ' * @author [Tristan Valcke]{@link https://github.com/Itee}\n'
|
|
75
|
+
bannerCommented += ' * @license [BSD-3-Clause]{@link https://opensource.org/licenses/BSD-3-Clause}\n'
|
|
76
|
+
bannerCommented += ' * \n'
|
|
77
|
+
bannerCommented += ' */'
|
|
78
|
+
|
|
79
|
+
return bannerCommented
|
|
80
|
+
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function _computeBanner( format ) {
|
|
84
|
+
|
|
85
|
+
const packageName = getPrettyPackageName( '.' )
|
|
86
|
+
const packageVersion = getPrettyPackageVersion()
|
|
87
|
+
const prettyFormat = getPrettyFormatForBanner( format )
|
|
88
|
+
|
|
89
|
+
const figText = figlet.textSync(
|
|
90
|
+
`${ packageName } ${ packageVersion } - ${ prettyFormat }`,
|
|
91
|
+
{
|
|
92
|
+
font: 'Tmplr',
|
|
93
|
+
horizontalLayout: 'default',
|
|
94
|
+
verticalLayout: 'default',
|
|
95
|
+
whitespaceBreak: true,
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
return _commentarize( figText )
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function _computeIntro() {
|
|
104
|
+
|
|
105
|
+
return ''
|
|
106
|
+
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Will create an appropriate configuration object for rollup, related to the given arguments.
|
|
111
|
+
*
|
|
112
|
+
* @generator
|
|
113
|
+
* @param options
|
|
114
|
+
* @return {Array.<json>} An array of rollup configuration
|
|
115
|
+
*/
|
|
116
|
+
function _createRollupConfigs( options ) {
|
|
117
|
+
'use strict'
|
|
118
|
+
|
|
119
|
+
const {
|
|
120
|
+
input,
|
|
121
|
+
output,
|
|
122
|
+
formats,
|
|
123
|
+
envs,
|
|
124
|
+
treeshake
|
|
125
|
+
} = options
|
|
126
|
+
const name = getPrettyPackageName( '.' )
|
|
127
|
+
const fileName = basename( input, '.js' )
|
|
128
|
+
|
|
129
|
+
const configs = []
|
|
130
|
+
|
|
131
|
+
for ( let formatIndex = 0, numberOfFormats = formats.length ; formatIndex < numberOfFormats ; ++formatIndex ) {
|
|
132
|
+
|
|
133
|
+
for ( let envIndex = 0, numberOfEnvs = envs.length ; envIndex < numberOfEnvs ; envIndex++ ) {
|
|
134
|
+
|
|
135
|
+
const env = envs[ envIndex ]
|
|
136
|
+
const isProd = ( env.includes( 'prod' ) )
|
|
137
|
+
const format = formats[ formatIndex ]
|
|
138
|
+
const outputPath = ( isProd ) ? join( output, `${ fileName }.${ format }.min.js` ) : join( output, `${ fileName }.${ format }.js` )
|
|
139
|
+
|
|
140
|
+
configs.push( {
|
|
141
|
+
input: input,
|
|
142
|
+
external: ( format === 'cjs' ) ? [
|
|
143
|
+
'fs'
|
|
144
|
+
] : [],
|
|
145
|
+
plugins: [
|
|
146
|
+
replace( {
|
|
147
|
+
defines: {
|
|
148
|
+
IS_REMOVE_ON_BUILD: false,
|
|
149
|
+
IS_BACKEND_SPECIFIC: ( format === 'cjs' )
|
|
150
|
+
}
|
|
151
|
+
} ),
|
|
152
|
+
commonjs( {
|
|
153
|
+
include: 'node_modules/**'
|
|
154
|
+
} ),
|
|
155
|
+
nodeResolve( {
|
|
156
|
+
preferBuiltins: true
|
|
157
|
+
} ),
|
|
158
|
+
isProd && terser()
|
|
159
|
+
],
|
|
160
|
+
onwarn: ( {
|
|
161
|
+
loc,
|
|
162
|
+
frame,
|
|
163
|
+
message
|
|
164
|
+
} ) => {
|
|
165
|
+
|
|
166
|
+
// Ignore some errors
|
|
167
|
+
if ( message.includes( 'Circular dependency' ) ) { return }
|
|
168
|
+
if ( message.includes( 'plugin uglify is deprecated' ) ) { return }
|
|
169
|
+
|
|
170
|
+
if ( loc ) {
|
|
171
|
+
process.stderr.write( `/!\\ ${ loc.file } (${ loc.line }:${ loc.column }) ${ frame } ${ message }\n` )
|
|
172
|
+
} else {
|
|
173
|
+
process.stderr.write( `/!\\ ${ message }\n` )
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
},
|
|
177
|
+
treeshake: treeshake,
|
|
178
|
+
output: {
|
|
179
|
+
// core options
|
|
180
|
+
file: outputPath,
|
|
181
|
+
format: format,
|
|
182
|
+
name: name,
|
|
183
|
+
globals: {},
|
|
184
|
+
|
|
185
|
+
// advanced options
|
|
186
|
+
paths: {},
|
|
187
|
+
banner: ( isProd ) ? '' : _computeBanner( format ),
|
|
188
|
+
footer: '',
|
|
189
|
+
intro: ( !isProd && format === 'iife' ) ? _computeIntro() : '',
|
|
190
|
+
outro: '',
|
|
191
|
+
sourcemap: !isProd,
|
|
192
|
+
interop: 'auto',
|
|
193
|
+
|
|
194
|
+
// danger zone
|
|
195
|
+
exports: 'auto',
|
|
196
|
+
amd: {},
|
|
197
|
+
indent: '\t',
|
|
198
|
+
strict: true
|
|
199
|
+
}
|
|
200
|
+
} )
|
|
201
|
+
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return configs
|
|
207
|
+
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Configs
|
|
211
|
+
|
|
212
|
+
const configs = {
|
|
213
|
+
'build': _createRollupConfigs( {
|
|
214
|
+
input: join( packageSourcesDirectory, `${ packageName }.js` ),
|
|
215
|
+
output: packageBuildsDirectory,
|
|
216
|
+
formats: [ 'esm', 'cjs', 'iife' ],
|
|
217
|
+
envs: [ 'dev', 'prod' ],
|
|
218
|
+
sourcemap: true,
|
|
219
|
+
treeshake: true
|
|
220
|
+
} ),
|
|
221
|
+
'check-bundling-from-esm-build-import': {
|
|
222
|
+
input: null,
|
|
223
|
+
external: [ '' ],
|
|
224
|
+
plugins: [
|
|
225
|
+
nodeResolve( {
|
|
226
|
+
preferBuiltins: true
|
|
227
|
+
} ),
|
|
228
|
+
cleanup( {
|
|
229
|
+
comments: 'all' // else remove __PURE__ declaration... -_-'
|
|
230
|
+
} )
|
|
231
|
+
],
|
|
232
|
+
onwarn: ( {
|
|
233
|
+
loc,
|
|
234
|
+
frame,
|
|
235
|
+
message
|
|
236
|
+
} ) => {
|
|
237
|
+
|
|
238
|
+
// Ignore some errors
|
|
239
|
+
if ( message.includes( 'Circular dependency' ) ) { return }
|
|
240
|
+
if ( message.includes( 'Generated an empty chunk' ) ) { return }
|
|
241
|
+
|
|
242
|
+
if ( loc ) {
|
|
243
|
+
process.stderr.write( `/!\\ ${ loc.file } (${ loc.line }:${ loc.column }) ${ frame } ${ message }\n` )
|
|
244
|
+
} else {
|
|
245
|
+
process.stderr.write( `/!\\ ${ message }\n` )
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
},
|
|
249
|
+
treeshake: {
|
|
250
|
+
moduleSideEffects: true,
|
|
251
|
+
annotations: true,
|
|
252
|
+
correctVarValueBeforeDeclaration: true,
|
|
253
|
+
propertyReadSideEffects: true,
|
|
254
|
+
tryCatchDeoptimization: true,
|
|
255
|
+
unknownGlobalSideEffects: true
|
|
256
|
+
},
|
|
257
|
+
output: {
|
|
258
|
+
indent: '\t',
|
|
259
|
+
format: 'esm',
|
|
260
|
+
file: null
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
'check-bundling-from-esm-files-import': {
|
|
264
|
+
input: null,
|
|
265
|
+
plugins: [
|
|
266
|
+
nodeResolve(),
|
|
267
|
+
cleanup( {
|
|
268
|
+
comments: 'all' // else remove __PURE__ declaration... -_-'
|
|
269
|
+
} )
|
|
270
|
+
],
|
|
271
|
+
onwarn: ( {
|
|
272
|
+
loc,
|
|
273
|
+
frame,
|
|
274
|
+
message
|
|
275
|
+
} ) => {
|
|
276
|
+
|
|
277
|
+
// Ignore some errors
|
|
278
|
+
if ( message.includes( 'Circular dependency' ) ) { return }
|
|
279
|
+
if ( message.includes( 'Generated an empty chunk' ) ) { return }
|
|
280
|
+
|
|
281
|
+
if ( loc ) {
|
|
282
|
+
process.stderr.write( `/!\\ ${ loc.file } (${ loc.line }:${ loc.column }) ${ frame } ${ message }\n` )
|
|
283
|
+
} else {
|
|
284
|
+
process.stderr.write( `/!\\ ${ message }\n` )
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
},
|
|
288
|
+
treeshake: {
|
|
289
|
+
moduleSideEffects: true,
|
|
290
|
+
annotations: true,
|
|
291
|
+
correctVarValueBeforeDeclaration: true,
|
|
292
|
+
propertyReadSideEffects: true,
|
|
293
|
+
tryCatchDeoptimization: true,
|
|
294
|
+
unknownGlobalSideEffects: true
|
|
295
|
+
},
|
|
296
|
+
output: {
|
|
297
|
+
indent: '\t',
|
|
298
|
+
format: 'esm',
|
|
299
|
+
file: null
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
'check-bundling-from-esm-files-direct': {
|
|
303
|
+
input: null,
|
|
304
|
+
external: [ '' ],
|
|
305
|
+
plugins: [
|
|
306
|
+
nodeResolve( {
|
|
307
|
+
preferBuiltins: true
|
|
308
|
+
} ),
|
|
309
|
+
cleanup( {
|
|
310
|
+
comments: 'none'
|
|
311
|
+
} )
|
|
312
|
+
],
|
|
313
|
+
onwarn: ( {
|
|
314
|
+
loc,
|
|
315
|
+
frame,
|
|
316
|
+
message
|
|
317
|
+
} ) => {
|
|
318
|
+
|
|
319
|
+
// Ignore some errors
|
|
320
|
+
if ( message.includes( 'Circular dependency' ) ) { return }
|
|
321
|
+
if ( message.includes( 'Generated an empty chunk' ) ) { return }
|
|
322
|
+
|
|
323
|
+
if ( loc ) {
|
|
324
|
+
process.stderr.write( `/!\\ ${ loc.file } (${ loc.line }:${ loc.column }) ${ frame } ${ message }\n` )
|
|
325
|
+
} else {
|
|
326
|
+
process.stderr.write( `/!\\ ${ message }\n` )
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
},
|
|
330
|
+
treeshake: {
|
|
331
|
+
moduleSideEffects: true,
|
|
332
|
+
annotations: true,
|
|
333
|
+
correctVarValueBeforeDeclaration: true,
|
|
334
|
+
propertyReadSideEffects: true,
|
|
335
|
+
tryCatchDeoptimization: true,
|
|
336
|
+
unknownGlobalSideEffects: true
|
|
337
|
+
},
|
|
338
|
+
output: {
|
|
339
|
+
indent: '\t',
|
|
340
|
+
format: 'esm',
|
|
341
|
+
file: null
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
function getRollupConfigurationFor( bundleName ) {
|
|
347
|
+
|
|
348
|
+
return configs[ bundleName ]
|
|
349
|
+
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export {
|
|
353
|
+
getRollupConfigurationFor
|
|
354
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { glob } from 'glob'
|
|
2
|
+
import {
|
|
3
|
+
basename,
|
|
4
|
+
join,
|
|
5
|
+
normalize
|
|
6
|
+
} from 'path'
|
|
7
|
+
import {
|
|
8
|
+
packageName,
|
|
9
|
+
packageSourcesDirectory
|
|
10
|
+
} from '../_utils.mjs'
|
|
11
|
+
|
|
12
|
+
const filePathsToIgnore = [
|
|
13
|
+
`${ packageName }.js`
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
const sourcesFiles = glob.sync( join( packageSourcesDirectory, '**' ) )
|
|
17
|
+
.map( filePath => normalize( filePath ) )
|
|
18
|
+
.filter( filePath => {
|
|
19
|
+
const fileName = basename( filePath )
|
|
20
|
+
const isJsFile = fileName.endsWith( '.js' )
|
|
21
|
+
const isNotPrivateFile = !fileName.startsWith( '_' )
|
|
22
|
+
const isNotIgnoredFile = !filePathsToIgnore.includes( fileName )
|
|
23
|
+
return isJsFile && isNotPrivateFile && isNotIgnoredFile
|
|
24
|
+
} )
|
|
25
|
+
|
|
26
|
+
export { sourcesFiles }
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { glob } from 'glob'
|
|
2
|
+
import {
|
|
3
|
+
basename,
|
|
4
|
+
join,
|
|
5
|
+
normalize
|
|
6
|
+
} from 'path'
|
|
7
|
+
import {
|
|
8
|
+
packageName,
|
|
9
|
+
packageSourcesDirectory
|
|
10
|
+
} from '../_utils.mjs'
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const filePathsToIgnore = [
|
|
14
|
+
`${ packageName }.js`,
|
|
15
|
+
'isTestUnitGenerator.js'
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
const sourcesFiles = glob.sync( join( packageSourcesDirectory, '**' ) )
|
|
19
|
+
.map( filePath => normalize( filePath ) )
|
|
20
|
+
.filter( filePath => {
|
|
21
|
+
const fileName = basename( filePath )
|
|
22
|
+
const isJsFile = fileName.endsWith( '.js' )
|
|
23
|
+
const isNotPrivateFile = !fileName.startsWith( '_' )
|
|
24
|
+
const isNotIgnoredFile = !filePathsToIgnore.includes( fileName )
|
|
25
|
+
return isJsFile && isNotPrivateFile && isNotIgnoredFile
|
|
26
|
+
} )
|
|
27
|
+
|
|
28
|
+
export { sourcesFiles }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { glob } from 'glob'
|
|
2
|
+
import {
|
|
3
|
+
basename,
|
|
4
|
+
join,
|
|
5
|
+
normalize
|
|
6
|
+
} from 'path'
|
|
7
|
+
import {
|
|
8
|
+
packageName,
|
|
9
|
+
packageSourcesDirectory
|
|
10
|
+
} from '../_utils.mjs'
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
const filePathsToIgnore = [
|
|
14
|
+
`${ packageName }.js`
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
const sourcesFiles = 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
|
+
} )
|
|
26
|
+
|
|
27
|
+
export { sourcesFiles }
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tags": {
|
|
3
|
+
"allowUnknownTags": false,
|
|
4
|
+
"dictionaries": [
|
|
5
|
+
"jsdoc",
|
|
6
|
+
"closure"
|
|
7
|
+
]
|
|
8
|
+
},
|
|
9
|
+
"source": {
|
|
10
|
+
"include": [
|
|
11
|
+
"README.md",
|
|
12
|
+
"gulpfile.mjs",
|
|
13
|
+
"./sources"
|
|
14
|
+
],
|
|
15
|
+
"includePattern": ".+\\.(js|mjs|jsx)?$",
|
|
16
|
+
"excludePattern": "(node_modules|docs|builds)",
|
|
17
|
+
"exclude": []
|
|
18
|
+
},
|
|
19
|
+
"sourceType": "module",
|
|
20
|
+
"plugins": [],
|
|
21
|
+
"recurseDepth": 5,
|
|
22
|
+
"opts": {
|
|
23
|
+
"template": "./node_modules/ink-docstrap/template",
|
|
24
|
+
"access": "all",
|
|
25
|
+
"debug": false,
|
|
26
|
+
"encoding": "utf8",
|
|
27
|
+
"destination": "docs",
|
|
28
|
+
"recurse": true,
|
|
29
|
+
"verbose": true,
|
|
30
|
+
"private": true
|
|
31
|
+
},
|
|
32
|
+
"templates": {
|
|
33
|
+
"cleverLinks": false,
|
|
34
|
+
"monospaceLinks": false,
|
|
35
|
+
"navType": "inline",
|
|
36
|
+
"theme": "cyborg",
|
|
37
|
+
"syntaxTheme": "dark",
|
|
38
|
+
"linenums": true,
|
|
39
|
+
"collapseSymbols": false,
|
|
40
|
+
"sort": "longname, version, since",
|
|
41
|
+
"search": true,
|
|
42
|
+
"systemName": "Itee-Validators",
|
|
43
|
+
"footer": "",
|
|
44
|
+
"copyright": "Copyright 2015-Present <a href=\"https://github.com/Itee\">Itee</a> (Tristan Valcke)",
|
|
45
|
+
"includeDate": false,
|
|
46
|
+
"inverseNav": false,
|
|
47
|
+
"outputSourceFiles": true,
|
|
48
|
+
"outputSourcePath": true
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import mocha from 'eslint-plugin-mocha'
|
|
3
|
+
import {
|
|
4
|
+
defineConfig,
|
|
5
|
+
globalIgnores
|
|
6
|
+
} from 'eslint/config'
|
|
7
|
+
import globals from 'globals'
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export default defineConfig( [
|
|
11
|
+
globalIgnores( [
|
|
12
|
+
'.github',
|
|
13
|
+
'.idea',
|
|
14
|
+
'builds',
|
|
15
|
+
'docs',
|
|
16
|
+
'sources/cores/tests/*.js'
|
|
17
|
+
] ),
|
|
18
|
+
{
|
|
19
|
+
linterOptions: {
|
|
20
|
+
noInlineConfig: false,
|
|
21
|
+
reportUnusedDisableDirectives: 'error',
|
|
22
|
+
reportUnusedInlineConfigs: 'error'
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'sources/common',
|
|
27
|
+
files: [ 'sources/**/*.js' ],
|
|
28
|
+
ignores: [
|
|
29
|
+
'sources/dom/',
|
|
30
|
+
'sources/file-system/**'
|
|
31
|
+
],
|
|
32
|
+
plugins: { js },
|
|
33
|
+
extends: [ 'js/recommended' ],
|
|
34
|
+
rules: {
|
|
35
|
+
'no-multiple-empty-lines': [
|
|
36
|
+
'error',
|
|
37
|
+
{
|
|
38
|
+
'max': 2
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
'no-mixed-spaces-and-tabs': 'error',
|
|
42
|
+
'no-console': 'warn',
|
|
43
|
+
'no-unused-vars': 'error',
|
|
44
|
+
'no-multi-spaces': [
|
|
45
|
+
'error',
|
|
46
|
+
{
|
|
47
|
+
'exceptions': {
|
|
48
|
+
'Property': true,
|
|
49
|
+
'ImportDeclaration': true,
|
|
50
|
+
'VariableDeclarator': true,
|
|
51
|
+
'AssignmentExpression': true
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
'key-spacing': [
|
|
56
|
+
'error',
|
|
57
|
+
{
|
|
58
|
+
'align': {
|
|
59
|
+
'beforeColon': false,
|
|
60
|
+
'afterColon': true,
|
|
61
|
+
'on': 'value'
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'sources/frontend',
|
|
69
|
+
files: [ 'sources/dom/*' ],
|
|
70
|
+
ignores: [ 'sources/file-system/**' ],
|
|
71
|
+
plugins: { js },
|
|
72
|
+
extends: [ 'js/recommended' ],
|
|
73
|
+
languageOptions: { globals: globals.browser }
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'sources/backend',
|
|
77
|
+
files: [ 'sources/file-system/**' ],
|
|
78
|
+
ignores: [ 'sources/dom/*' ],
|
|
79
|
+
plugins: { js },
|
|
80
|
+
extends: [ 'js/recommended' ],
|
|
81
|
+
languageOptions: { globals: globals.node }
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'tests/benchmarks',
|
|
85
|
+
files: [ 'tests/benchmarks/**/*.js' ],
|
|
86
|
+
ignores: [ 'tests/benchmarks/builds/*' ],
|
|
87
|
+
plugins: { js },
|
|
88
|
+
extends: [ 'js/recommended' ],
|
|
89
|
+
languageOptions: {
|
|
90
|
+
globals: {
|
|
91
|
+
Benchmark: 'readonly'
|
|
92
|
+
},
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'tests/units',
|
|
97
|
+
files: [ 'tests/units/**/*.mjs' ],
|
|
98
|
+
ignores: [ 'tests/units/builds/*' ],
|
|
99
|
+
plugins: { js },
|
|
100
|
+
extends: [ 'js/recommended' ],
|
|
101
|
+
languageOptions: {
|
|
102
|
+
globals: {
|
|
103
|
+
describe: 'readonly',
|
|
104
|
+
it: 'readonly',
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
files: [ 'tests/units/**/*.mjs' ],
|
|
110
|
+
ignores: [ 'tests/units/builds/*' ],
|
|
111
|
+
...mocha.configs.recommended,
|
|
112
|
+
},
|
|
113
|
+
// Todo: fix
|
|
114
|
+
{
|
|
115
|
+
name: 'to/fix',
|
|
116
|
+
files: [ 'tests/units/cores/tests/isTestUnitGenerator.unit.js' ],
|
|
117
|
+
rules: {
|
|
118
|
+
'no-unused-vars': 'warn',
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
] )
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { playwrightLauncher } from '@web/test-runner-playwright'
|
|
2
|
+
import { iteeReporter } from '../itee-reporter.mjs'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
files: [
|
|
6
|
+
// 'tests/units/builds/itee-validators.units.esm.js',
|
|
7
|
+
// OR
|
|
8
|
+
// 'tests/units/cores/arrays/*.unit.mjs',
|
|
9
|
+
// OR very slow
|
|
10
|
+
'tests/units/**/*.unit.mjs',
|
|
11
|
+
'!tests/units/builds/**',
|
|
12
|
+
'!tests/units/file-system/**',
|
|
13
|
+
],
|
|
14
|
+
debug: false,
|
|
15
|
+
nodeResolve: true,
|
|
16
|
+
browsers: [
|
|
17
|
+
playwrightLauncher( { product: 'chromium' } ),
|
|
18
|
+
playwrightLauncher( { product: 'webkit' } ),
|
|
19
|
+
playwrightLauncher( { product: 'firefox' } ),
|
|
20
|
+
],
|
|
21
|
+
// reporters: [
|
|
22
|
+
// iteeReporter( {
|
|
23
|
+
// reportResults: false,
|
|
24
|
+
// reportProgress: false
|
|
25
|
+
// } )
|
|
26
|
+
// ]
|
|
27
|
+
}
|