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
1 parent
148c151
commit cdbcabd
Showing
30 changed files
with
371 additions
and
290 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
6 changes: 3 additions & 3 deletions
6
packages/browser-sync/lib/cli/transforms/addCwdToWatchOptions.ts
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
15 changes: 10 additions & 5 deletions
15
packages/browser-sync/lib/cli/transforms/appendServerDirectoryOption.ts
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,9 +1,14 @@ | ||
import {BsTempOptions, TransformResult} from "../cli-options"; | ||
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')), []]; | ||
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, []]; | ||
} |
12 changes: 7 additions & 5 deletions
12
packages/browser-sync/lib/cli/transforms/appendServerIndexOption.ts
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
18 changes: 12 additions & 6 deletions
18
packages/browser-sync/lib/cli/transforms/copyCLIIgnoreToWatchOptions.ts
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,13 +1,19 @@ | ||
import {List} from "immutable"; | ||
import {BsTempOptions, TransformResult} from "../cli-options"; | ||
import { List } from "immutable"; | ||
import { BsTempOptions, TransformResult } from "../cli-options"; | ||
|
||
export function copyCLIIgnoreToWatchOptions(incoming: BsTempOptions): TransformResult { | ||
export function copyCLIIgnoreToWatchOptions( | ||
incoming: BsTempOptions | ||
): TransformResult { | ||
if (!incoming.get("ignore")) { | ||
return [incoming, []]; | ||
} | ||
const output = incoming.updateIn(["watchOptions", "ignored"], List([]), ignored => { | ||
return List([]).concat(ignored, incoming.get("ignore")); | ||
}); | ||
const output = incoming.updateIn( | ||
["watchOptions", "ignored"], | ||
List([]), | ||
ignored => { | ||
return List([]).concat(ignored, incoming.get("ignore")); | ||
} | ||
); | ||
|
||
return [output, []]; | ||
} |
18 changes: 12 additions & 6 deletions
18
packages/browser-sync/lib/cli/transforms/handleExtensionsOption.ts
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,24 @@ | ||
import {List} from "immutable"; | ||
import {BsTempOptions, explodeFilesArg, TransformResult} from "../cli-options"; | ||
import { List } from "immutable"; | ||
import { | ||
BsTempOptions, | ||
explodeFilesArg, | ||
TransformResult | ||
} from "../cli-options"; | ||
|
||
const _ = require("../../lodash.custom"); | ||
|
||
export function handleExtensionsOption(incoming: BsTempOptions): TransformResult { | ||
const value = incoming.get('extensions'); | ||
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, []]; | ||
} |
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.