-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
2,837 additions
and
2,097 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env node | ||
'use strict' | ||
|
||
const { runCli } = require('../src') | ||
const { runCli } = require('../dist') | ||
|
||
runCli() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,59 @@ | ||
'use strict' | ||
|
||
const { series } = require('gulp') | ||
const { src, dest, series, parallel } = require('gulp') | ||
const { include } = require('gulp-ignore') | ||
const del = require('del') | ||
const yamlToJson = require('gulp-yaml') | ||
|
||
const { BUILD, BUILD_DIST } = require('../files') | ||
const { getWatchTask } = require('../utils') | ||
const { BUILD_SRC, BUILD_DIST } = require('../files') | ||
const gulpExeca = require('../exec') | ||
|
||
const clean = () => del(BUILD_DIST) | ||
|
||
// eslint-disable-next-line fp/no-mutation | ||
clean.description = 'Remove build directory' | ||
|
||
const copy = () => | ||
src([`${BUILD}/**`, `!${BUILD}/**/*.{y{,a}ml,js,ts,jsx,tsx}`], { | ||
dot: true, | ||
}).pipe(dest(BUILD_DIST)) | ||
|
||
// eslint-disable-next-line fp/no-mutation | ||
copy.description = 'Copy all sources files to build directories' | ||
|
||
const babel = () => | ||
gulpExeca( | ||
`babel ${BUILD_SRC} --out-dir ${BUILD_DIST} --copy-files --delete-dir-on-start --source-maps --no-comments --minified --retain-lines`, | ||
`babel ${BUILD} --out-dir ${BUILD_DIST} --source-maps --no-comments --minified --retain-lines`, | ||
) | ||
|
||
const build = series(babel) | ||
// eslint-disable-next-line fp/no-mutation | ||
babel.description = 'Transpile JavaScript files with Babel' | ||
|
||
const yaml = () => | ||
src(`${BUILD}/**`, { dot: true }) | ||
.pipe(include(/\.ya?ml$/u)) | ||
.pipe(yamlToJson({ schema: 'JSON_SCHEMA', space: 2 })) | ||
.pipe(dest(BUILD_DIST)) | ||
|
||
// eslint-disable-next-line fp/no-mutation | ||
yaml.description = 'Convert YAML files to JSON' | ||
|
||
const build = series(clean, parallel(copy, babel, yaml)) | ||
|
||
// eslint-disable-next-line fp/no-mutation | ||
build.description = 'Build source files' | ||
build.description = 'Build the application' | ||
|
||
const buildwatch = getWatchTask({ BUILD: build }, build) | ||
|
||
// eslint-disable-next-line fp/no-mutation | ||
buildwatch.description = 'Build source files in watch mode' | ||
buildwatch.description = 'Build the application in watch mode' | ||
|
||
module.exports = { | ||
build, | ||
buildwatch, | ||
clean, | ||
copy, | ||
babel, | ||
yaml, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
'use strict' | ||
|
||
module.exports = { | ||
...require('./src'), | ||
...require('./dist'), | ||
// eslint-disable-next-line import/no-internal-modules | ||
...require('./src/core/spec'), | ||
...require('./dist/core/spec'), | ||
} |
Oops, something went wrong.