Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: change API of option transforms
- Loading branch information
1 parent
cf0febd
commit ef12e9a
Showing
36 changed files
with
336 additions
and
249 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
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,5 +1,9 @@ | ||
export function addCwdToWatchOptions(incoming) { | ||
return incoming.updateIn(['watchOptions', 'cwd'], (watchCwd) => { | ||
import {BsTempOptions, TransformResult} from "../cli-options"; | ||
|
||
export function addCwdToWatchOptions(incoming: BsTempOptions): TransformResult { | ||
const output = incoming.updateIn(['watchOptions', 'cwd'], (watchCwd) => { | ||
return watchCwd || incoming.get('cwd'); | ||
}) | ||
} | ||
}); | ||
|
||
return [output, []]; | ||
} |
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
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,9 @@ | ||
export function appendServerDirectoryOption(incoming) { | ||
if (!incoming.get('server')) return incoming; | ||
import {BsTempOptions, TransformResult} from "../cli-options"; | ||
|
||
export function appendServerDirectoryOption(incoming: BsTempOptions): TransformResult { | ||
if (!incoming.get('server')) return [incoming, []]; | ||
if (incoming.get('directory')) { | ||
return incoming.setIn(['server', 'directory'], incoming.has('directory')); | ||
return [incoming.setIn(['server', 'directory'], incoming.has('directory')), []]; | ||
} | ||
return incoming; | ||
return [incoming, []]; | ||
} |
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,10 +1,12 @@ | ||
export function appendServerIndexOption(incoming) { | ||
if (!incoming.get('server')) return incoming; | ||
import {BsTempOptions, TransformResult} from "../cli-options"; | ||
|
||
export function appendServerIndexOption(incoming: BsTempOptions): TransformResult { | ||
if (!incoming.get('server')) return [incoming, []]; | ||
const value = incoming.get('index'); | ||
|
||
if (value) { | ||
return incoming.setIn(['server', 'index'], value); | ||
return [incoming.setIn(['server', 'index'], value), []]; | ||
} | ||
|
||
return incoming; | ||
return [incoming, []]; | ||
} |
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,10 +1,13 @@ | ||
import {List} from "immutable"; | ||
import {BsTempOptions, TransformResult} from "../cli-options"; | ||
|
||
export function copyCLIIgnoreToWatchOptions(incoming) { | ||
export function copyCLIIgnoreToWatchOptions(incoming: BsTempOptions): TransformResult { | ||
if (!incoming.get("ignore")) { | ||
return incoming; | ||
return [incoming, []]; | ||
} | ||
return incoming.updateIn(["watchOptions", "ignored"], List([]), ignored => { | ||
const output = incoming.updateIn(["watchOptions", "ignored"], List([]), ignored => { | ||
return List([]).concat(ignored, incoming.get("ignore")); | ||
}); | ||
|
||
return [output, []]; | ||
} |
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,18 +1,18 @@ | ||
import {List} from "immutable"; | ||
import {explodeFilesArg} from "../cli-options"; | ||
import {BsTempOptions, explodeFilesArg, TransformResult} from "../cli-options"; | ||
|
||
const _ = require("../../lodash.custom"); | ||
|
||
export function handleExtensionsOption(incoming) { | ||
export function handleExtensionsOption(incoming: BsTempOptions): TransformResult { | ||
const value = incoming.get('extensions'); | ||
if (_.isString(value)) { | ||
const split = explodeFilesArg(value); | ||
if (split.length) { | ||
return incoming.set('extensions', List(split)); | ||
return [incoming.set('extensions', List(split)), []]; | ||
} | ||
} | ||
if (List.isList(value)) { | ||
return incoming.set('extensions', value); | ||
return [incoming.set('extensions', value), []]; | ||
} | ||
return incoming; | ||
return [incoming, []]; | ||
} |
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
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
Oops, something went wrong.