Skip to content

Commit c5d6439

Browse files
committed
Merge branch 'dev'
2 parents df392b6 + d96e97e commit c5d6439

35 files changed

Lines changed: 3553 additions & 2279 deletions

.czrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"path": "./node_modules/cz-emoji",
3+
"config": {
4+
"cz-emoji": {}
5+
}
6+
}

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Install dependencies
3333
run: npm ci
3434
- name: Release
35-
run: npm run clean && npm run lint && npm run doc && npm run build-test && npm run test
35+
run: npm run build && npm run build-test && npm run lint && npm run test
3636

3737
publish:
3838
needs: build

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.idea/
22
/node_modules/
33
/tests/units/builds/
4-
/tests/benchmarks/builds/
4+
/tests/benchmarks/builds/
5+
/tests/bundles/

.releaserc

Lines changed: 98 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,101 @@
11
{
2-
"branch": "master",
3-
"plugins": [
4-
"@semantic-release/commit-analyzer",
5-
"@semantic-release/release-notes-generator",
6-
"@semantic-release/changelog",
7-
"@semantic-release/npm",
8-
"@semantic-release/github",
9-
[
10-
"@semantic-release/git",
11-
{
12-
"assets": [
13-
"builds/**",
14-
"docs/**",
15-
"package.json",
16-
"CHANGELOG.md"
17-
],
18-
"message": "chore(release): v${nextRelease.version}"
19-
}
20-
]
2+
"branch": "master",
3+
"plugins": [
4+
[
5+
"semantic-release-gitmoji",
6+
{
7+
"releaseRules": {
8+
"major": [
9+
":boom:"
10+
],
11+
"minor": [
12+
":sparkles:"
13+
],
14+
"patch": [
15+
":art:",
16+
":zap:",
17+
":fire:",
18+
":bug:",
19+
":ambulance:",
20+
":pencil:",
21+
":rocket:",
22+
":lipstick:",
23+
":white_check_mark:",
24+
":lock:",
25+
":apple:",
26+
":penguin:",
27+
":checkered_flag:",
28+
":robot:",
29+
":green_apple:",
30+
":rotating_light:",
31+
":green_heart:",
32+
":arrow_down:",
33+
":pushpin:",
34+
":construction_worker:",
35+
":chart_with_upwards_trend:",
36+
":recycle:",
37+
":whale:",
38+
":heavy_plus_sign:",
39+
":heavy_minus_sign:",
40+
":wrench:",
41+
":globe_with_meridians:",
42+
":pencil2:",
43+
":poop:",
44+
":rewind:",
45+
":package:",
46+
":alien:",
47+
":truck:",
48+
":page_facing_up:",
49+
":bento:",
50+
":ok_hand:",
51+
":wheelchair:",
52+
":bulb:",
53+
":beers:",
54+
":speech_balloon:",
55+
":card_file_box:",
56+
":loud_sound:",
57+
":mute:",
58+
":busts_in_silhouette:",
59+
":children_crossing:",
60+
":building_construction:",
61+
":iphone:",
62+
":clown_face:",
63+
":see_no_evil:",
64+
":camera_flash:",
65+
":alembic:",
66+
":mag:",
67+
":wheel_of_dharma:",
68+
":label:",
69+
":seedling:",
70+
":dizzy:",
71+
":wastebasket:",
72+
":passport_control:",
73+
":adhesive_bandage:",
74+
":monocle_face:",
75+
":coffin:",
76+
":test_tube:",
77+
":necktie:",
78+
":stethoscope:",
79+
":bricks:",
80+
":technologist:"
81+
]
82+
}
83+
}
84+
],
85+
"@semantic-release/changelog",
86+
"@semantic-release/npm",
87+
"@semantic-release/github",
88+
[
89+
"@semantic-release/git",
90+
{
91+
"assets": [
92+
"builds/**",
93+
"docs/**",
94+
"package.json",
95+
"CHANGELOG.md"
96+
],
97+
"message": "chore(release): v${nextRelease.version}"
98+
}
2199
]
100+
]
22101
}

.tasks/_utils.mjs

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import {
2+
join,
3+
dirname
4+
} from 'path'
5+
import { readFileSync } from 'fs'
6+
import { fileURLToPath } from 'url'
7+
8+
// We cannot use directly the import.meta.dirname or filename because all IDE usage do not produce them
9+
// We use
10+
function getDirname() {
11+
12+
let __dirname
13+
14+
if ( import.meta.dirname ) {
15+
__dirname = import.meta.dirname
16+
} else if ( import.meta.filename ) {
17+
__dirname = dirname( import.meta.filename )
18+
} else if ( import.meta.url ) {
19+
const __filename = fileURLToPath( import.meta.url )
20+
__dirname = dirname( __filename )
21+
} else {
22+
throw new Error( 'Unable to retrieve module dirname.' )
23+
}
24+
25+
// Todo: distinguish between dirname and packageRootFolder to avoid misusing
26+
__dirname = join( __dirname, '..' )
27+
28+
return __dirname
29+
30+
}
31+
32+
const __dirname = getDirname()
33+
const packagePath = join( __dirname, 'package.json' )
34+
const packageData = readFileSync( packagePath )
35+
const packageInfos = JSON.parse( packageData )
36+
37+
class Indenter {
38+
39+
_ = ''
40+
__ = ''
41+
___ = ''
42+
____ = ''
43+
_____ = ''
44+
______ = ''
45+
_______ = ''
46+
________ = ''
47+
_________ = ''
48+
__________ = ''
49+
50+
constructor( indentationChar = '\t', maxIndentationLevel = 10 ) {
51+
52+
let currentProperty = '_'
53+
for ( let currentIndentationLevel = 1 ; currentIndentationLevel <= maxIndentationLevel ; currentIndentationLevel++ ) {
54+
this[ currentProperty ] = indentationChar.repeat( currentIndentationLevel )
55+
currentProperty += '_'
56+
}
57+
58+
}
59+
60+
}
61+
62+
export {
63+
packageInfos,
64+
Indenter,
65+
getDirname
66+
}

.tasks/builds/build.mjs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import rollupConfigurator from '../../configs/rollup.conf.js'
2+
import { rollup } from 'rollup'
3+
import log from 'fancy-log'
4+
import { getGulpConfigForTask } from '../../configs/gulp.conf.mjs'
5+
6+
function build( done ) {
7+
8+
const options = getGulpConfigForTask('builds')
9+
const configs = rollupConfigurator( options )
10+
11+
nextBuild()
12+
13+
function nextBuild( error ) {
14+
'use strict'
15+
16+
if ( error ) {
17+
18+
done( error )
19+
20+
} else if ( configs.length === 0 ) {
21+
22+
done()
23+
24+
} else {
25+
26+
const config = configs.pop()
27+
log( `Building ${ config.output.file }` )
28+
29+
rollup( config )
30+
.then( ( bundle ) => { return bundle.write( config.output ) } )
31+
.then( () => { nextBuild() } )
32+
.catch( nextBuild )
33+
34+
}
35+
36+
}
37+
38+
}
39+
40+
export { build }

.tasks/cleans/clean.mjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { getGulpConfigForTask } from '../../configs/gulp.conf.mjs'
2+
import { deleteAsync } from 'del'
3+
import log from 'fancy-log'
4+
import colors from 'ansi-colors'
5+
6+
const red = colors.red
7+
8+
function clean( done ) {
9+
10+
const filesToClean = getGulpConfigForTask( 'clean' )
11+
12+
for ( let fileIndex = 0, numberOfFiles = filesToClean.length ; fileIndex < numberOfFiles ; fileIndex++ ) {
13+
log( red( `[${ fileIndex + 1 }/${ numberOfFiles }] Delete ${ filesToClean[ fileIndex ] }` ) )
14+
}
15+
16+
return deleteAsync( filesToClean )
17+
18+
}
19+
20+
export { clean }

.tasks/docs/doc.mjs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import log from 'fancy-log'
2+
import jsdocConfiguration from '../../configs/jsdoc.conf.js'
3+
import { getGulpConfigForTask } from '../../configs/gulp.conf.mjs'
4+
import gulp from 'gulp'
5+
import jsdoc from 'gulp-jsdoc3'
6+
7+
8+
async function doc( done ) {
9+
10+
const config = jsdocConfiguration
11+
const filesToDoc = getGulpConfigForTask( 'doc' )
12+
13+
for ( let fileIndex = 0, numberOfFiles = filesToDoc.length ; fileIndex < numberOfFiles ; fileIndex++ ) {
14+
log( `[${ fileIndex + 1 }/${ numberOfFiles }] Documenting ${ filesToDoc[ fileIndex ] }` )
15+
}
16+
17+
// gulp
18+
// .src( filesToDoc, {
19+
// read: false,
20+
// allowEmpty: true
21+
// } )
22+
// .pipe( jsdoc( config, done ) )
23+
// .on( 'error', done )
24+
25+
await new Promise( ( ( resolve, reject ) => {
26+
gulp.src( filesToDoc, {
27+
read: false,
28+
allowEmpty: true
29+
} )
30+
.pipe( jsdoc( config, resolve ) )
31+
.on( 'error', reject )
32+
} ) )
33+
done()
34+
35+
}
36+
37+
export { doc }

0 commit comments

Comments
 (0)