itee-validators 6.0.0 → 6.1.1
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/publish.yml +61 -0
- package/.tasks/configs/lints/lint.conf.mjs +42 -0
- package/.tasks/configs/tests/benchmarks/compute-benchmarks.conf.mjs +5 -0
- package/.tasks/configs/tests/benchmarks/run-benchmarks-for-frontend.conf.mjs +5 -0
- package/.tasks/configs/tests/units/run-unit-tests-for-frontend.conf.mjs +5 -0
- package/CHANGELOG.md +15 -0
- package/builds/{itee-validators.cjs.js → validators.cjs} +7 -7
- package/builds/validators.cjs.map +1 -0
- package/builds/{itee-validators.iife.js → validators.js} +7 -7
- package/builds/validators.js.map +1 -0
- package/builds/{itee-validators.esm.js → validators.mjs} +7 -7
- package/builds/validators.mjs.map +1 -0
- package/package.json +8 -48
- package/.github/workflows/node.js.yml +0 -53
- package/.tasks/.builds/build-benchmarks.task.mjs +0 -16
- package/.tasks/.builds/build-tests.task.mjs +0 -18
- package/.tasks/.builds/build-unit-tests.task.mjs +0 -16
- package/.tasks/.builds/build.task.mjs +0 -46
- package/.tasks/.cleans/clean.task.mjs +0 -23
- package/.tasks/.docs/doc.task.mjs +0 -35
- package/.tasks/.helps/help.task.mjs +0 -151
- package/.tasks/.lints/lint.task.mjs +0 -37
- package/.tasks/.patches/patch.task.mjs +0 -13
- package/.tasks/.releases/release.task.mjs +0 -26
- package/.tasks/.tests/benchmarks/build-benchmarks-backend.task.mjs +0 -42
- package/.tasks/.tests/benchmarks/compute-benchmarks.task.mjs +0 -210
- package/.tasks/.tests/benchmarks/run-benchmarks-for-backend.task.mjs +0 -39
- package/.tasks/.tests/benchmarks/run-benchmarks-for-frontend.task.mjs +0 -41
- package/.tasks/.tests/benchmarks/run-benchmarks.task.mjs +0 -18
- package/.tasks/.tests/bundling/check-bundling-from-esm-build-import.task.mjs +0 -123
- package/.tasks/.tests/bundling/check-bundling-from-esm-files-direct.task.mjs +0 -77
- package/.tasks/.tests/bundling/check-bundling-from-esm-files-import.task.mjs +0 -95
- package/.tasks/.tests/bundling/check-bundling.task.mjs +0 -20
- package/.tasks/.tests/run-tests.task.mjs +0 -18
- package/.tasks/.tests/unit-tests/build-unit-tests-backend.task.mjs +0 -42
- package/.tasks/.tests/unit-tests/compute-unit-tests.task.mjs +0 -537
- package/.tasks/.tests/unit-tests/run-unit-tests-for-backend.task.mjs +0 -44
- package/.tasks/.tests/unit-tests/run-unit-tests-for-frontend.task.mjs +0 -41
- package/.tasks/.tests/unit-tests/run-unit-tests.task.mjs +0 -18
- package/.tasks/_refresh-gulpfile.task.mjs +0 -65
- package/.tasks/_utils.mjs +0 -192
- package/.tasks/configs/benchmarks.conf.mjs +0 -57
- package/.tasks/configs/build-benchmarks-backend.conf.mjs +0 -51
- package/.tasks/configs/build-unit-tests-backend.conf.mjs +0 -46
- package/.tasks/configs/build.conf.mjs +0 -354
- package/.tasks/configs/check-bundling.conf.mjs +0 -26
- package/.tasks/configs/clean.conf.mjs +0 -9
- package/.tasks/configs/compute-benchmarks.conf.mjs +0 -28
- package/.tasks/configs/compute-unit-tests.conf.mjs +0 -27
- package/.tasks/configs/doc.conf.json +0 -50
- package/.tasks/configs/eslint.conf.mjs +0 -121
- package/.tasks/configs/units.conf.mjs +0 -27
- package/.tasks/itee-benchmarks-framework.js +0 -186
- package/.tasks/itee-reporter.mjs +0 -217
- package/builds/itee-validators.cjs.js.map +0 -1
- package/builds/itee-validators.esm.js.map +0 -1
- package/builds/itee-validators.iife.js.map +0 -1
- /package/builds/{itee-validators.cjs.min.js → validators.min.cjs} +0 -0
- /package/builds/{itee-validators.iife.min.js → validators.min.js} +0 -0
- /package/builds/{itee-validators.esm.min.js → validators.min.mjs} +0 -0
- /package/sources/{itee-validators.js → validators.js} +0 -0
|
@@ -1,354 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,26 +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 '../_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 }
|
|
@@ -1,28 +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 '../_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 }
|
|
@@ -1,27 +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 '../_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 }
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
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
|
-
] )
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
}
|