Skip to content

Commit f3d9d04

Browse files
committed
Move examples
1 parent 390976c commit f3d9d04

File tree

6 files changed

+14
-17
lines changed

6 files changed

+14
-17
lines changed

custom.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict'
22

33
// See `index.js` for an alternative to this file
4-
// eslint-disable-next-line import/no-internal-modules
5-
module.exports = require('./dist/src')
4+
module.exports = require('./dist')

gulp/files.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"CHECK": [
33
"{index,custom,gulpfile}.js",
4-
"{src,gulp,test,examples}/*.js",
5-
"{src,gulp,test,examples}/**/*.js",
4+
"{src,gulp,test,helpers}/*.js",
5+
"{src,gulp,test,helpers}/**/*.js",
66
"*.md"
77
],
88
"UNIT": ["{index,custom}.js", "src", "test"],
@@ -11,7 +11,7 @@
1111
"src",
1212
"gulp",
1313
"test",
14-
"examples",
14+
"helpers",
1515
"*.md"
1616
],
1717
"BUILD_SRC": ["src"],
@@ -22,7 +22,6 @@
2222
"gulp",
2323
"test",
2424
"helpers",
25-
"examples",
2625
"*.md"
2726
]
2827
}

gulp/tasks/emit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ const { argv } = require('process')
44

55
const gulpExeca = require('../exec')
66

7+
const EMIT_PATH = './helpers/emit/fire.js'
8+
79
const emitEvent = function(flags) {
810
const eventName = getEventName()
911
return gulpExeca(`node --no-warnings ${flags}${EMIT_PATH} ${eventName}`)
1012
}
1113

1214
const getEventName = function() {
1315
const [, , , eventName] = argv
14-
return eventName.replace('--', '')
16+
return eventName.replace(/^--?/u, '')
1517
}
1618

17-
const EMIT_PATH = './examples/emit.js'
18-
1919
const emit = emitEvent.bind(null, '')
2020

2121
// eslint-disable-next-line fp/no-mutation

examples/emit.js renamed to helpers/emit/fire.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
const { argv } = require('process')
44

5-
const logProcessErrors = require('../custom')
6-
const { ALL_EVENTS } = require('../helpers')
5+
const logProcessErrors = require('../../custom')
6+
7+
const { ALL_EVENTS } = require('./main')
78

89
// Emit one of the process events using its name (or a shortcut) as argument
910
// Used for development debugging
10-
const emit = async function(typeName) {
11+
const fireEvent = async function(typeName) {
1112
const emitEvent = getEmitEvent(typeName)
1213

1314
const stopLogging = logProcessErrors({ exitOn: [] })
@@ -31,4 +32,4 @@ const getEmitEvent = function(name) {
3132
)
3233
}
3334

34-
emit(argv[2])
35+
fireEvent(argv[2])

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict'
22

3-
// eslint-disable-next-line import/no-internal-modules
4-
const setup = require('./dist/src')
3+
const setup = require('./dist')
54

65
// Logging setup is automatically performed by `node -r log-process-errors` or
76
// `require('log-process-errors')`.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
"directories": {
4242
"doc": "docs",
4343
"lib": "src",
44-
"test": "test",
45-
"example": "examples"
44+
"test": "test"
4645
},
4746
"dependencies": {
4847
"@babel/runtime": "^7.1.5",

0 commit comments

Comments
 (0)