Cleaned up npm-folders local install

This commit is contained in:
billz 2018-03-09 02:08:40 +00:00
parent 902281294f
commit 376653224d
9929 changed files with 0 additions and 1122463 deletions

1
node_modules/.bin/browser-sync generated vendored
View file

@ -1 +0,0 @@
../browser-sync/dist/bin.js

1
node_modules/.bin/gulp generated vendored
View file

@ -1 +0,0 @@
../gulp/bin/gulp.js

View file

@ -1,358 +0,0 @@
#### 2.23.1 (2018-01-01)
<a name="2.8.2"></a>
## 2.8.2 (2015-07-31)
### Bug Fixes
* **https:** add newly generated ssl self-signed certs that will expire for 10 years - fixes ([45104a7](https://github.com/browsersync/browser-sync/commit/45104a7)), closes [#750](https://github.com/browsersync/browser-sync/issues/750)
<a name="2.8.1"></a>
## 2.8.1 (2015-07-28)
### Bug Fixes
* **web-sockets:** Use separate server for web sockets in proxy mode - fixes #625 ([40017b4](https://github.com/browsersync/browser-sync/commit/40017b4)), closes [#625](https://github.com/browsersync/browser-sync/issues/625)
### Features
* **serve-static:** Added option `serveStatic` to allow proxy/snippet mode to easily serve local fil ([384ef67](https://github.com/browsersync/browser-sync/commit/384ef67))
<a name="2.7.13"></a>
## 2.7.13 (2015-06-28)
### Bug Fixes
* **snippet:** Allow async attribute to be removed from snippet with snippetOptions.async = fal ([c32bec6](https://github.com/browsersync/browser-sync/commit/c32bec6)), closes [#670](https://github.com/browsersync/browser-sync/issues/670)
* **socket-options:** allow socket.domain string|fn for setting domain only on socket path - fixes #69 ([5157432](https://github.com/browsersync/browser-sync/commit/5157432)), closes [#690](https://github.com/browsersync/browser-sync/issues/690)
### Features
* **api:** expose sockets to public api ([985682c](https://github.com/browsersync/browser-sync/commit/985682c))
<a name="2.7.12"></a>
## 2.7.12 (2015-06-17)
### Bug Fixes
* **client-script:** allow proxy to also use client script middleware ([c5fdbbf](https://github.com/browsersync/browser-sync/commit/c5fdbbf))
* **client-script:** serve cached/gzipped client JS file - fixes #657 ([dbe9ffe](https://github.com/browsersync/browser-sync/commit/dbe9ffe)), closes [#657](https://github.com/browsersync/browser-sync/issues/657)
<a name"2.7.11"></a>
### 2.7.11 (2015-06-16)
#### Bug Fixes
* **client-scroll:** add scrollRestoreTechnique option as alternative to cookie for restoring scroll ([7897ea6a](https://github.com/Browsersync/browser-sync/commit/7897ea6a), closes [#630](https://github.com/Browsersync/browser-sync/issues/630))
<a name"2.7.9"></a>
### 2.7.9 (2015-06-11)
#### Bug Fixes
* **cli:** Remove --exclude flag - ([133aa1a6](https://github.com/Browsersync/browser-sync/commit/133aa1a6), closes [#667](https://github.com/Browsersync/browser-sync/issues/667))
* **proxy:** only rewrite domains within attributes (via foxy bump to 11.0.2) - ([d80d9481](https://github.com/Browsersync/browser-sync/commit/d80d9481), closes [#647](https://github.com/Browsersync/browser-sync/issues/647))
<a name"2.7.7"></a>
### 2.7.7 (2015-06-09)
#### Bug Fixes
* **plugins:** Allow plugins to register middleware via server:middleware hook when in proxy mo ([104dbb4a](https://github.com/Browsersync/browser-sync/commit/104dbb4a), closes [#663](https://github.com/Browsersync/browser-sync/issues/663))
<a name"2.7.6"></a>
### 2.7.6 (2015-05-28)
#### Bug Fixes
* **plugins:** allow module references in options.plugins array - ([aabc03c8](https://github.com/Browsersync/browser-sync/commit/aabc03c8), closes [#648](https://github.com/Browsersync/browser-sync/issues/648))
<a name"2.7.5"></a>
### 2.7.5 (2015-05-26)
#### Bug Fixes
* **file-watcher:** defer to default callback should `fn` property be absent from file watching obje ([9f826cbe](https://github.com/Browsersync/browser-sync/commit/9f826cbe), closes [#643](https://github.com/Browsersync/browser-sync/issues/643))
<a name"2.7.3"></a>
### 2.7.3 (2015-05-24)
#### Bug Fixes
* **file-watching:** bind public running instance to watch callbacks given in options - ([d7c96e4f](https://github.com/Browsersync/browser-sync/commit/d7c96e4f), closes [#631](https://github.com/Browsersync/browser-sync/issues/631))
* **snippet:** Bump resp-modifier to allow more flexible whitelist/blacklist paths for snippet ([f09c2797](https://github.com/Browsersync/browser-sync/commit/f09c2797), closes [#553](https://github.com/Browsersync/browser-sync/issues/553))
#### Features
* **rewrite-rules:** enable live updating of rewrite rules for both static server & proxy ([a4e2bf6f](https://github.com/Browsersync/browser-sync/commit/a4e2bf6f))
<a name"2.7.1"></a>
### 2.7.1 (2015-05-06)
#### Bug Fixes
* **web-sockets:** revert handling upgrade event on proxy as it causes regression fix #606 ([1c6b1c03](https://github.com/Browsersync/browser-sync/commit/1c6b1c03))
<a name"2.6.8"></a>
### 2.6.8 (2015-04-29)
#### Bug Fixes
* **cli:** Allow absolute paths for config file - ([8fcd9048](https://github.com/Browsersync/browser-sync/commit/8fcd9048), closes [#583](https://github.com/Browsersync/browser-sync/issues/583))
<a name"2.6.5"></a>
### 2.6.5 (2015-04-25)
#### Bug Fixes
* **file-watching:** use canLogFileChange() to determine whether file:reload, stream:changed & browse ([164154ea](https://github.com/Browsersync/browser-sync/commit/164154ea), closes [#479](https://github.com/Browsersync/browser-sync/issues/479))
<a name"2.6.1"></a>
### 2.6.1 (2015-04-13)
#### Bug Fixes
* **stream:** Allow deprecated .reload({stream: true}) when no instance running, closes [#573](https://github.com/Browsersync/browser-sync/issues/573)
<a name"2.6.0"></a>
## 2.6.0 (2015-04-12)
#### Bug Fixes
* **open:** Allow open: 'ui' and open: 'ui-external' when in snippet mode - ([d0333582](https://github.com/Browsersync/browser-sync/commit/d0333582), closes [#571](https://github.com/Browsersync/browser-sync/issues/571))
* **server:** set index correctly if serveStaticOptions: {index: <path>} given ([34816a76](https://github.com/Browsersync/browser-sync/commit/34816a76))
#### Features
* **cli:** allow 'browser' option from cli - ([ca517d03](https://github.com/Browsersync/browser-sync/commit/ca517d03), closes [#552](https://github.com/Browsersync/browser-sync/issues/552))
* **client:** Bump client to allow wildcards in reload method - ([1e4de8f7](https://github.com/Browsersync/browser-sync/commit/1e4de8f7), closes [#572](https://github.com/Browsersync/browser-sync/issues/572))
* **commands:** Add reload command for http-protocol comms ([c0fe70dc](https://github.com/Browsersync/browser-sync/commit/c0fe70dc))
* **file-watcher:** Add `.watch()` to public api ([6a2609f0](https://github.com/Browsersync/browser-sync/commit/6a2609f0))
* **http-protocol:**
* Add support for https comms ([efd4f39c](https://github.com/Browsersync/browser-sync/commit/efd4f39c))
* Add reload method to http protocol ([f6a3601f](https://github.com/Browsersync/browser-sync/commit/f6a3601f))
* **plugins:** Accept object literal as plugin + options ([757f492e](https://github.com/Browsersync/browser-sync/commit/757f492e))
* **reload:** Add reload-delay and reload-debounce to cli -, ([38d62c96](https://github.com/Browsersync/browser-sync/commit/38d62c96), closes [#329](https://github.com/Browsersync/browser-sync/issues/329), [#562](https://github.com/Browsersync/browser-sync/issues/562))
* **stream:** Implement dedicated `.stream()` method for better handling streams & to pave the ([2581e7a1](https://github.com/Browsersync/browser-sync/commit/2581e7a1))
* **watchers:**
* Allow per-watcher options hash. ([3c069fba](https://github.com/Browsersync/browser-sync/commit/3c069fba))
* switch to chokidar for file-watching, implement callback interface on per-patter ([14afddfc](https://github.com/Browsersync/browser-sync/commit/14afddfc))
<a name"2.5.1"></a>
### 2.5.1 (2015-03-31)
#### Bug Fixes
* **proxy:** Bump foxy dep to ensure middlewares work correctly for old IEs ([104e9dd1](https://github.com/Browsersync/browser-sync/commit/104e9dd1))
* **snippet:** Log UI access urls when in snippet mode ([c448fa0b](https://github.com/Browsersync/browser-sync/commit/c448fa0b))
<a name"2.5.0"></a>
## 2.5.0 (2015-03-29)
#### Bug Fixes
* **proxy:** Bump Foxy to stop cookies being altered when parsed ([ff3c46bd](https://github.com/Browsersync/browser-sync/commit/ff3c46bd))
#### Features
* **options:** Allow any serve-static specific configuration under new property - ([4c58541f](https://github.com/Browsersync/browser-sync/commit/4c58541f), closes [#539](https://github.com/Browsersync/browser-sync/issues/539))
* **throttle:** Bump UI for network throttle ([7e2f588e](https://github.com/Browsersync/browser-sync/commit/7e2f588e))
<a name"2.4.0"></a>
## 2.4.0 (2015-03-21)
#### Features
* **rewrite:** Allow addtional HTML rewrite rules through server + proxy modes to help with #51 ([76ae686d](https://github.com/Browsersync/browser-sync/commit/76ae686d))
<a name"2.3.2"></a>
### 2.3.2 (2015-03-21)
#### Bug Fixes
* **client:** Bump UI to fix safari deprecated error messages - fix #445 ([6bb7513c](https://github.com/Browsersync/browser-sync/commit/6bb7513c))
<a name"2.2.5"></a>
### 2.2.5 (2015-03-17)
#### Features
* **plugins:** Allow plugins to be given inline within options hash ([fd4ccd9e](https://github.com/Browsersync/browser-sync/commit/fd4ccd9e))
### 2.2.4 (2015-03-13)
#### Bug Fixes
* **reload:** Allow multiple instances to call their own `.reload()` method - ([da53dc21](https://github.com/Browsersync/browser-sync/commit/da53dc21c6f7afd801a9f00489a6df2ab46156bb), closes [#511](https://github.com/Browsersync/browser-sync/issues/511))
### 2.2.3 (2015-03-08)
#### Bug Fixes
* **socket:** Set heartbeat interval correctly - ([7621c0de](https://github.com/Browsersync/browser-sync/commit/7621c0dece1fea6c170ffdc117bd7c67be2138ed), closes [#499](https://github.com/Browsersync/browser-sync/issues/499))
### 2.2.2 (2015-03-04)
#### Bug Fixes
* **paths:** Fix regression with absolute/relative paths to scripts/sockets/https etc - ([2386fe1b](https://github.com/Browsersync/browser-sync/commit/2386fe1bbde175b18211ef9b242b6af0bf11128c), closes [#463](https://github.com/Browsersync/browser-sync/issues/463))
* **snippet:** Allow serving the client js over https when in snippet mode - ([196bafbe](https://github.com/Browsersync/browser-sync/commit/196bafbee2b09c2a1e8b09a988a2c8aa43bac2b9), closes [#459](https://github.com/Browsersync/browser-sync/issues/459))
* **socket:** Bump socket io + client to fix #477 & https://github.com/Browsersync/browser-syn ([659c281e](https://github.com/Browsersync/browser-sync/commit/659c281eac8ab8343a7ba7b13fa532560dc1bd9c))
### 2.1.4 (2015-02-18)
#### Bug Fixes
* **cli:** allow disable injection via cli - ([12ffbd79](https://github.com/Browsersync/browser-sync/commit/12ffbd793443c7ede191aad55bcd530e566f0947), closes [#444](https://github.com/Browsersync/browser-sync/issues/444))
* **snippet:**
* Allow serving the client js over https when in snippet mode - ([196bafbe](https://github.com/Browsersync/browser-sync/commit/196bafbee2b09c2a1e8b09a988a2c8aa43bac2b9), closes [#459](https://github.com/Browsersync/browser-sync/issues/459))
* Allow serving the snippet on secure server + base url - re: #437 ([96d689c0](https://github.com/Browsersync/browser-sync/commit/96d689c0830975dbf2baee5aaaaa396415052512))
* Always use full url path for scripts - ([14bd6f51](https://github.com/Browsersync/browser-sync/commit/14bd6f5126c52228a0ed306a118feac0e65c50db), closes [#437](https://github.com/Browsersync/browser-sync/issues/437))
## 2.1.0 (2015-02-16)
#### Features
* **https:** Add HTTPS proxying - re: #399 ([09dbca6e](https://github.com/Browsersync/browser-sync/commit/09dbca6e3e60fa699ca2519d56ada3cbd5a2237b))
* **proxy:** Allow user-specified proxy request headers ([0c303a7e](https://github.com/Browsersync/browser-sync/commit/0c303a7e4a8bafa554d42c6895698b7338d036f4), closes [#430](https://github.com/Browsersync/browser-sync/issues/430))
### 2.0.1 (2015-02-10)
#### Bug Fixes
* **cli:**
* Ensure server options are merged from command line ([8d677328](https://github.com/Browsersync/browser-sync/commit/8d677328a779502ba6f6e16b74f125dc2caeaf92))
* explode files args when given on command line., ([18324f0a](https://github.com/Browsersync/browser-sync/commit/18324f0a7b4d3c49bd16800a7ba77cf13ea2449a), closes [#425](https://github.com/Browsersync/browser-sync/issues/425), [#426](https://github.com/Browsersync/browser-sync/issues/426))
* Don't double-merge cli options, re: #417 ([057d97f3](https://github.com/Browsersync/browser-sync/commit/057d97f35786f120bc2057c884c80c5ce95aaf79))
* **https:** Ensure HTTPS option is used in legacy mode + top level, re: #427 ([799c0a59](https://github.com/Browsersync/browser-sync/commit/799c0a59cd152eb11e6f8e66a1d3adcf082624f7))
* **proxy:**
* use path as startPath if given as proxy option ([f4ac4c59](https://github.com/Browsersync/browser-sync/commit/f4ac4c595a479b44676824cdbdaa34cc1dc9d966))
* Bump Foxy module to fix issues with redirects, ([e5d8fe18](https://github.com/Browsersync/browser-sync/commit/e5d8fe180bfd46f1380ec1f532d81f62f2f6ab11), closes [#381](https://github.com/Browsersync/browser-sync/issues/381))
* **reload:** Bump browser-sync-client fix ##369 ([9bcf1086](https://github.com/Browsersync/browser-sync/commit/9bcf108694f0e51bafc3bd6d0a584781e2950f68))
* **stream:** Don't log file info when once: true - fixes https://github.com/google/web-starter-kit/issues/593 ([8f4d7275](https://github.com/Browsersync/browser-sync/commit/8f4d7275d4dfa6e22dec4b87d19b3be51bab8af3))
#### Features
* **core:** Use immutable data internally to enable advanced features needed in upcoming UI ([b5d6d9c1](https://github.com/Browsersync/browser-sync/commit/b5d6d9c1866cf8451cf235dc3bca674af9e6d767))
* **options:**
* Allow silent setting of options ([31e196a0](https://github.com/Browsersync/browser-sync/commit/31e196a0e900356cf5cbb9b1e8a4c3202011d01e))
* added reloadOnRestart option - https://github.com/shakyShane/browser-sync/issues ([b1bcfa81](https://github.com/Browsersync/browser-sync/commit/b1bcfa81638b1f99fed7d71ee051c00ceebaf8f9))
* **server:** add serveFile method for plugin use ([c5007871](https://github.com/Browsersync/browser-sync/commit/c50078717f291f3cb301b0bc315eac1b42f6d7b6))
* **snippet:** Add black/white lists - ([6a2a296e](https://github.com/Browsersync/browser-sync/commit/6a2a296ee05312d56de3ae47f5dfb6e04f877692), closes [#373](https://github.com/Browsersync/browser-sync/issues/373))
* **tunnel:** Switch to ngrok - re: #192 ([7359435c](https://github.com/Browsersync/browser-sync/commit/7359435ca4efd429c9421aa912a036f82d022d82))
### 1.8.2 (2014-12-22)
#### Bug Fixes
* **proxy:** Bump foxy to fix #376 ([fe6c73db](https://github.com/shakyShane/browser-sync/commit/fe6c73db47f82d10ea25b0b8c58b032e972a4663))
#### Features
* **server:** allow to inject browser-sync client.js in custom middlewares ([841c6c31](https://github.com/shakyShane/browser-sync/commit/841c6c31015955ff92cffd937f19f2c78ce27e8d))
### 1.8.1 (2014-12-19)
#### Bug Fixes
* **proxy:** Bump foxy to fix #376 ([284cf84a](https://github.com/shakyShane/browser-sync/commit/284cf84a0390a07d9824972c8ab67ec95cf8109f))
### 1.7.3 (2014-12-16)
#### Features
* **files:** pause/resume ([a3c697f6](https://github.com/shakyShane/browser-sync/commit/a3c697f66b4fcec3966ed77a841e55aafb70f69a))
### 1.6.5 (2014-11-16)
#### Bug Fixes
* **snippet:** Add snippet.ignorePaths option - ([dd9b284b](https://github.com/shakyShane/browser-sync/commit/dd9b284b47f01884996619c012f134c982639b8c), closes [#330](https://github.com/shakyShane/browser-sync/issues/330))
#### Features
* **snippet:** Allow user-provided rule for writing the snippet ([33c4586d](https://github.com/shakyShane/browser-sync/commit/33c4586dce26a4c9672b99d14d29adb064dac6ec))
### 1.6.4 (2014-11-08)
#### Bug Fixes
* **proxy:** Bump Foxy to fix issues with redirects ([e2f30be2](https://github.com/shakyShane/browser-sync/commit/e2f30be2269629a96503ea487b5248ab3b6918ab))
### 1.6.2 (2014-11-02)
#### Bug Fixes
* **options:** Ignore cli options from public api usage fix #314 ([1de4a3b0](https://github.com/shakyShane/browser-sync/commit/1de4a3b06cd888345aa5130a03cad070b1f5b466))

202
node_modules/browser-sync/LICENSE generated vendored
View file

@ -1,202 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [2015] [Shane Osbourne]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

73
node_modules/browser-sync/README.md generated vendored
View file

@ -1,73 +0,0 @@
<p align="center">
<a href="https://ci.appveyor.com/project/shakyShane/browser-sync" title="AppVeyor branch">
<img src="https://img.shields.io/appveyor/ci/shakyshane/browser-sync/master.svg?style=flat-square&label=windows" />
</a><a href="https://travis-ci.org/BrowserSync/browser-sync" title="Travis branch">
<img src="https://img.shields.io/travis/BrowserSync/browser-sync/master.svg?style=flat-square&label=linux" />
</a><a href="https://www.npmjs.com/package/browser-sync">
<img src="https://img.shields.io/npm/dm/browser-sync.svg?style=flat-square" />
</a>
</p>
<p align="center">
<a href="https://www.npmjs.com/package/browser-sync" title="NPM version">
<img src="https://img.shields.io/npm/v/browser-sync.svg?style=flat-square" />
</a><a href="https://david-dm.org/Browsersync/browser-sync" title="Dependency Status">
<img src="https://img.shields.io/david/Browsersync/browser-sync.svg?style=flat-square&label=deps" />
</a>
<a href="https://david-dm.org/Browsersync/browser-sync#info=devDependencies" title="devDependency Status">
<img src="https://img.shields.io/david/dev/Browsersync/browser-sync.svg?style=flat-square&label=devDeps" />
</a>
</p>
<p align="center"><a href="http://www.browsersync.io"><img src="https://raw.githubusercontent.com/BrowserSync/browsersync.github.io/master/public/img/logo-gh.png" /></a></p>
<p align="center">Keep multiple browsers & devices in sync when building websites.</p>
<p align="center">Browsersync is developed and maintained internally at <a href="http://www.wearejh.com">JH</a></p>
<p align="center">Follow <a href="https://twitter.com/browsersync">@Browsersync</a> on twitter for news & updates.</p>
<p align="center">Community <a href="https://browsersync.herokuapp.com"><img src="https://browsersync.herokuapp.com/badge.svg" /></a></p>
## Features
Please visit [browsersync.io](http://browsersync.io) for a full run-down of features
## Requirements
Browsersync works by injecting an asynchronous script tag (`<script async>...</script>`) right after the `<body>` tag
during initial request. In order for this to work properly the `<body>` tag must be present. Alternatively you
can provide a custom rule for the snippet using [snippetOptions](http://www.browsersync.io/docs/options/#option-snippetOptions)
## Upgrading from 1.x to 2.x ?
Providing you haven't accessed any internal properties, everything will just work as
there are no breaking changes to the public API. Internally however, we now use an
immutable data structure for storing/retrieving options. So whereas before you could access urls like this...
```js
browserSync({server: true}, function(err, bs) {
console.log(bs.options.urls.local);
});
```
... you now access them in the following way:
```js
browserSync({server: true}, function(err, bs) {
console.log(bs.options.getIn(["urls", "local"]));
});
```
## Install and trouble shooting
[browsersync.io docs](http://browsersync.io)
## Integrations / recipes
[Browsersync recipes](https://github.com/Browsersync/recipes)
## Support
If you've found Browser-sync useful and would like to contribute to its continued development & support, please feel free to send a donation of any size - it would be greatly appreciated!
[![Support via Gittip](https://rawgithub.com/chris---/Donation-Badges/master/gittip.jpeg)](https://www.gittip.com/shakyshane)
[![Support via PayPal](https://rawgithub.com/chris---/Donation-Badges/master/paypal.jpeg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=shakyshane%40gmail%2ecom&lc=US&item_name=browser%2dsync)
Apache 2
Copyright (c) 2016 Shane Osbourne

Binary file not shown.

View file

@ -1,6 +0,0 @@
openssl genrsa -des3 -out server.key 2048
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt
cp server.key server.key.copy
openssl rsa -in server.key.copy -out server.key
rm server.key.copy

View file

@ -1,19 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIDBjCCAe4CCQCir/8eGDIE/jANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJH
QjETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
cyBQdHkgTHRkMB4XDTE3MDQxMDExNDcyNloXDTI3MDQwODExNDcyNlowRTELMAkG
A1UEBhMCR0IxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0
IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
AMRLR2crKB4X/9pM3gR641iDscZWW3aqo70nUDxzo5Bhk8uupqz0EfdRoCLCUeQi
xVp3HJ1HqnilMW7dETGGkDHKdxJRjrkBrYHhE3Kw/LCC4tEb400F6Ikm6OudVPIB
P+CuwfNAw70KHSx/CtIrbTz0HhDC6XN0azp39pDLRBnWWluz3iU+rFLMx7YT2Q8k
1nQAwcXkzLjeU7txAt2pYGQUgvBQETO5RI7QQ0CmwaV4gfHWGABBTX34WQun7g1Q
YukrG3/4fVeNLzGW787FKCvL07BTymJTwXXbTTPXg4chw9p+YkLLPrr+AOVe/PF1
MJppDT3gKdKMHFo3vMycUf0CAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAEVmUYRrT
fCQmBDox3evqj4n8dJVStjgdw/7BPkm49SmGtaxsST/eUSGwT7dTvZBLov6BK/OW
+arhHZIvUY/DXlsV4NfCM4TK8KVefrwgd8ZsfQJW73L+FB0IOAY/6s+YKHm/wQGF
ptSOycJvEltsqfIegtYcvvD6c6SkSOvqApaF+Ai10+yiLe20KyOvM3PefZLV7mFE
0zCNyglZ75HftvHHV0wh82T2Et/R+txH+6dTwh065Dd6rrDzljtcAd2HC7B26ERK
dA2zJd9Y4eMz8osacmG/afVuR9rqtFGwdyZ1Kb5xQRzGWlrjvSmAFUx9W9iA4Ilv
3+56a5njSTFYKw==
-----END CERTIFICATE-----

View file

@ -1,17 +0,0 @@
-----BEGIN CERTIFICATE REQUEST-----
MIICoTCCAYkCAQAwRTELMAkGA1UEBhMCR0IxEzARBgNVBAgMClNvbWUtU3RhdGUx
ITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcN
AQEBBQADggEPADCCAQoCggEBAMRLR2crKB4X/9pM3gR641iDscZWW3aqo70nUDxz
o5Bhk8uupqz0EfdRoCLCUeQixVp3HJ1HqnilMW7dETGGkDHKdxJRjrkBrYHhE3Kw
/LCC4tEb400F6Ikm6OudVPIBP+CuwfNAw70KHSx/CtIrbTz0HhDC6XN0azp39pDL
RBnWWluz3iU+rFLMx7YT2Q8k1nQAwcXkzLjeU7txAt2pYGQUgvBQETO5RI7QQ0Cm
waV4gfHWGABBTX34WQun7g1QYukrG3/4fVeNLzGW787FKCvL07BTymJTwXXbTTPX
g4chw9p+YkLLPrr+AOVe/PF1MJppDT3gKdKMHFo3vMycUf0CAwEAAaAXMBUGCSqG
SIb3DQEJBzEIDAYxMjM0NTYwDQYJKoZIhvcNAQELBQADggEBABlVUaWK/UUovgPZ
+rqNG8/j6aggSCCye9CkauLB/WqhQ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oumECgYEA6CSkLiKcRLlTfec3LkjqkWtXR5ibL33g/H1fsZEQKFOyMbIXpUkX
Hybpku8NGeetjKynO3yRirp+NiBHGPn3cHc9WJ5GGG1ew9hRQ9QzyC3Tit15TDbu
J8i50/MaQHZSiUCnPQ/ceIZCNz8STcsEz87o/7utRLJKOvIIAPj+/8kCgYEA2Hd/
v5oUroMRbtzPtMJDMHiGEQyNxEGDNqcuxgXSmiEEqPLfk2qR3yLffzA9UQOg4wkX
/dSXsyomPriKWTvADXu1lNdkPGmW/1tk+onnHu6qgOalva30ZKhtteVjUqxEJEke
mHhNHyIVuj6lExLw9LZhVvzoOi+aj4AD+DRS4pUCgYBEtuveOCJ3eUAMiY9c5PqB
9vsL11FAOouJUXcs8VqOBVA+w4+aPktYzkTfWGFRZLGLbWPHCPVv0gof7Wf+Laef
o7wF6junaWBeqj5LzJlTTLVMaohIFg5iuli/Mzt3D08ZD4kxWuuQxXT+M24wlsKi
3IU9hYkhR4EPd6sE1q9seQKBgEpQRBAgModywbJgpgH1SyHBzqzdtXGx1/0USg97
gkCdoz7pGm4+gNOs4jOE+Rft+fbXcWAX8vh0OOsBaaWWyKkYVk9B3syKp2cFFlaY
rzrETs6v4CiNJsDDvd5bYMzKDR6z54gKjNdqWTE2Pm+c6hHo5uP5MTSAkTxAg5xb
QjU9AoGAaYPXlm3IKVO12FgNg/ffduooi0PKa1yRNJGnhpQKNvBQXs8eV+CQ83aK
kQHUExuJDrOfsC2iwF/2ZywXhEfbhL7ar0aw5zrhV+r7qvYFWxu/YoLoNVMDByw5
wAN0oIbsGWYmtIIti8+b9IcacTbAZ79ctlTLb1HCyPMosHxDkv8=
-----END RSA PRIVATE KEY-----

View file

@ -1,58 +0,0 @@
const {execSync} = require('child_process');
let [start, end] = process.argv.slice(2);
if (!start || !end) {
console.error('Must provide start and end tags');
console.error(' eg: v1.0 HEAD');
console.error(' eg: v1.0 v2.0');
process.exit(1);
}
const separator = `===END===`;
const res = execSync(`git log -E --format=%H%n%s%b===END=== ${start}..${end}`);
const sep = res.toString().split(separator);
const output = sep
.map((item, i) => {
const [hash, ...body] = getParts(item, i);
const bodyJoined = body.join('\n');
return [hash, bodyJoined];
})
// .filter(([, body]) => )
.map(([hash, bodyJoined]) => {
const hasSection = /^[\w]+: [^ ]/.test(bodyJoined);
if (hasSection) {
const [section, body] = bodyJoined.split(/: /);
return [hash, section, body];
}
return [hash, 'misc', bodyJoined];
})
.reduce((acc, item) => {
const [, section] = item;
if (!acc[section]) {
acc[section] = [item];
} else {
acc[section].push(item);
}
return acc;
}, {});
if (process.argv.indexOf('--json') > -1) {
console.log(JSON.stringify(output, null, 2));
} else {
Object.keys(output)
.map(x => [x, output[x]])
.forEach(([section, items]) => {
const header = `**${section}**`;
console.log(header);
items.forEach(([hash, section, body]) => {
console.log(`- ${body} ${hash}`)
});
console.log('')
});
}
function getParts(item, index) {
const segs = item.split('\n');
if (index === 0) return segs;
return segs.slice(1);
}

View file

@ -1 +0,0 @@
{}

View file

@ -1,6 +0,0 @@
{
"output": {
"alias": "o",
"desc": "Specify an output directory"
}
}

View file

@ -1,16 +0,0 @@
{
"files": {
"desc": "File paths to reload",
"type": "array",
"alias": "f"
},
"port": {
"alias": "p",
"type": "number",
"desc": "Target a running instance by port number"
},
"url": {
"alias": "u",
"desc": "Provide the full the url to the running Browsersync instance"
}
}

View file

@ -1,137 +0,0 @@
{
"server": {
"alias": "s",
"desc": "Run a Local server (uses your cwd as the web root)"
},
"cwd": {
"type": "string",
"desc": "Working directory"
},
"serveStatic": {
"type": "array",
"alias": "ss",
"desc": "Directories to serve static files from"
},
"port": {
"type": "number",
"desc": "Specify a port to use"
},
"proxy": {
"alias": "p",
"desc": "Proxy an existing server",
"example": "$0 shane is cool"
},
"ws": {
"type": "boolean",
"desc": "Proxy mode only - enable websocket proxying"
},
"browser": {
"type": "array",
"alias": "b",
"desc": "Choose which browser should be auto-opened"
},
"watch": {
"type": "boolean",
"alias": "w",
"desc": "Watch files"
},
"ignore": {
"type": "array",
"desc": "Ignore patterns for file watchers"
},
"files": {
"type": "array",
"alias": "f",
"desc": "File paths to watch"
},
"index": {
"type": "string",
"desc": "Specify which file should be used as the index page"
},
"plugins": {
"type": "array",
"desc": "Load Browsersync plugins"
},
"extensions": {
"type": "array",
"desc": "Specify file extension fallbacks"
},
"startPath": {
"type": "string",
"desc": "Specify the start path for the opened browser"
},
"single": {
"type": "boolean",
"desc": "If true, the connect-history-api-fallback middleware will be added"
},
"https": {
"desc": "Enable SSL for local development"
},
"directory": {
"type": "boolean",
"desc": "Show a directory listing for the server"
},
"xip": {
"type": "boolean",
"desc": "Use xip.io domain routing"
},
"tunnel": {
"desc": "Use a public URL"
},
"open": {
"type": "string",
"desc": "Choose which URL is auto-opened (local, external or tunnel), or provide a url"
},
"cors": {
"type": "boolean",
"desc": "Add Access Control headers to every request"
},
"config": {
"type": "string",
"alias": "c",
"desc": "Specify a path to a configuration file"
},
"host": {
"desc": "Specify a hostname to use"
},
"logLevel": {
"desc": "Set the logger output level (silent, info or debug)"
},
"reload-delay": {
"type": "number",
"desc": "Time in milliseconds to delay the reload event following file changes"
},
"reload-debounce": {
"type": "number",
"desc": "Restrict the frequency in which browser:reload events can be emitted to connected clients"
},
"ui-port": {
"type": "number",
"desc": "Specify a port for the UI to use"
},
"watchEvents": {
"type": "array",
"desc": "Specify which file events to respond to"
},
"no-notify": {
"desc": "Disable the notify element in browsers"
},
"no-open": {
"desc": "Don't open a new browser window"
},
"no-online": {
"desc": "Force offline usage"
},
"no-ui": {
"desc": "Don't start the user interface"
},
"no-ghost-mode": {
"desc": "Disable Ghost Mode"
},
"no-inject-changes": {
"desc": "Reload on every file change"
},
"no-reload-on-restart": {
"desc": "Don't auto-reload all browsers following a restart"
}
}

View file

@ -1,19 +0,0 @@
# browser-sync-client [![Build Status](https://travis-ci.org/BrowserSync/browser-sync-client.svg)](https://travis-ci.org/BrowserSync/browser-sync-client)
Client-side script for BrowserSync
## Contributors
```
177 Shane Osbourne
2 Sergey Slipchenko
1 Hugo Dias
1 Shinnosuke Watanabe
1 Tim Schaub
1 Shane Daniel
1 Matthieu Vachon
```
## License
Copyright (c) 2014 Shane Osbourne
Licensed under the MIT license.

View file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,62 +0,0 @@
"use strict";
/**
* The purpose of this function is
* to handle back-backwards compatibility
* @param {Object} args
* @returns {{config: {}, cb: *}}
*/
module.exports = function (args) {
var config = {};
var cb;
switch (args.length) {
case 1:
if (isFilesArg(args[0])) {
config.files = args[0];
}
else if (typeof args[0] === "function") {
cb = args[0];
}
else {
config = args[0];
}
break;
case 2:
// if second is a function, first MUST be config
if (typeof args[1] === "function") {
config = args[0] || {};
cb = args[1];
}
else {
if (args[1] === null || args[1] === undefined) {
config = args[0];
}
else {
// finally, second arg could be a plain object for config
config = args[1] || {};
if (!config.files) {
config.files = args[0];
}
}
}
break;
case 3:
config = args[1] || {};
if (!config.files) {
config.files = args[0];
}
cb = args[2];
}
return {
config: config,
cb: cb
};
};
/**
* Files args were only ever strings or arrays
* @param arg
* @returns {*|boolean}
*/
function isFilesArg(arg) {
return Array.isArray(arg) || typeof arg === "string";
}
//# sourceMappingURL=args.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"args.js","sourceRoot":"","sources":["../lib/args.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;;;GAKG;AACH,MAAM,CAAC,OAAO,GAAG,UAAS,IAAI;IAC1B,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,EAAE,CAAC;IAEP,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAClB,KAAK,CAAC;YACF,EAAE,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACtB,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAC3B,CAAC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AAI,CAAC,CAAC,CAAC,CAAC;IACrB,CAAC;IAED,MAAM,CAAC;QACH,MAAM,EAAE,MAAM;QACd,EAAE,EAAE,EAAE;KACT,CAAC;AACN,CAAC,CAAC;AAEF;;;;GAIG;AACH,oBAAoB,GAAG;IACnB,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC;AACzD,CAAC"}

View file

@ -1,60 +0,0 @@
var async = require("./async");
module.exports = [
{
step: "Finding an empty port",
fn: async.getEmptyPort
},
{
step: "Getting an extra port for Proxy",
fn: async.getExtraPortForProxy
},
{
step: "Checking online status",
fn: async.getOnlineStatus
},
{
step: "Resolve user plugins from options",
fn: async.resolveInlineUserPlugins
},
{
step: "Set Urls and other options that rely on port/online status",
fn: async.setOptions
},
{
step: "Setting Internal Events",
fn: async.setInternalEvents
},
{
step: "Setting file watchers",
fn: async.setFileWatchers
},
{
step: "Merging middlewares from core + plugins",
fn: async.mergeMiddlewares
},
{
step: "Starting the Server",
fn: async.startServer
},
{
step: "Starting the HTTPS Tunnel",
fn: async.startTunnel
},
{
step: "Starting the web-socket server",
fn: async.startSockets
},
{
step: "Starting the UI",
fn: async.startUi
},
{
step: "Merge UI settings",
fn: async.mergeUiSettings
},
{
step: "Init user plugins",
fn: async.initUserPlugins
}
];
//# sourceMappingURL=async-tasks.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"async-tasks.js","sourceRoot":"","sources":["../lib/async-tasks.js"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAE/B,MAAM,CAAC,OAAO,GAAG;IACb;QACI,IAAI,EAAE,uBAAuB;QAC7B,EAAE,EAAE,KAAK,CAAC,YAAY;KACzB;IACD;QACI,IAAI,EAAE,iCAAiC;QACvC,EAAE,EAAE,KAAK,CAAC,oBAAoB;KACjC;IACD;QACI,IAAI,EAAE,wBAAwB;QAC9B,EAAE,EAAE,KAAK,CAAC,eAAe;KAC5B;IACD;QACI,IAAI,EAAE,mCAAmC;QACzC,EAAE,EAAE,KAAK,CAAC,wBAAwB;KACrC;IACD;QACI,IAAI,EAAE,4DAA4D;QAClE,EAAE,EAAE,KAAK,CAAC,UAAU;KACvB;IACD;QACI,IAAI,EAAE,yBAAyB;QAC/B,EAAE,EAAE,KAAK,CAAC,iBAAiB;KAC9B;IACD;QACI,IAAI,EAAE,uBAAuB;QAC7B,EAAE,EAAE,KAAK,CAAC,eAAe;KAC5B;IACD;QACI,IAAI,EAAE,yCAAyC;QAC/C,EAAE,EAAE,KAAK,CAAC,gBAAgB;KAC7B;IACD;QACI,IAAI,EAAE,qBAAqB;QAC3B,EAAE,EAAE,KAAK,CAAC,WAAW;KACxB;IACD;QACI,IAAI,EAAE,2BAA2B;QACjC,EAAE,EAAE,KAAK,CAAC,WAAW;KACxB;IACD;QACI,IAAI,EAAE,gCAAgC;QACtC,EAAE,EAAE,KAAK,CAAC,YAAY;KACzB;IACD;QACI,IAAI,EAAE,iBAAiB;QACvB,EAAE,EAAE,KAAK,CAAC,OAAO;KACpB;IACD;QACI,IAAI,EAAE,mBAAmB;QACzB,EAAE,EAAE,KAAK,CAAC,eAAe;KAC5B;IACD;QACI,IAAI,EAAE,mBAAmB;QACzB,EAAE,EAAE,KAAK,CAAC,eAAe;KAC5B;CACJ,CAAC"}

View file

@ -1,291 +0,0 @@
"use strict";
var _ = require("./lodash.custom");
var Immutable = require("immutable");
var utils = require("./utils");
var pluginUtils = require("./plugins");
var connectUtils = require("./connect-utils");
module.exports = {
/**
* BrowserSync needs at least 1 free port.
* It will check the one provided in config
* and keep incrementing until an available one is found.
* @param {BrowserSync} bs
* @param {Function} done
*/
getEmptyPort: function (bs, done) {
utils.getPorts(bs.options, function (err, port) {
if (err) {
return utils.fail(true, err, bs.cb);
}
bs.debug("Found a free port: {magenta:%s", port);
done(null, {
options: {
port: port
}
});
});
},
/**
* If the running mode is proxy, we'll use a separate port
* for the Browsersync web-socket server. This is to eliminate any issues
* with trying to proxy web sockets through to the users server.
* @param bs
* @param done
*/
getExtraPortForProxy: function (bs, done) {
/**
* An extra port is not needed in snippet/server mode
*/
if (bs.options.get("mode") !== "proxy") {
return done();
}
/**
* Web socket support is disabled by default
*/
if (!bs.options.getIn(["proxy", "ws"])) {
return done();
}
/**
* Use 1 higher than server port by default...
*/
var socketPort = bs.options.get("port") + 1;
/**
* Or use the user-defined socket.port option instead
*/
if (bs.options.hasIn(["socket", "port"])) {
socketPort = bs.options.getIn(["socket", "port"]);
}
utils.getPort(socketPort, null, function (err, port) {
if (err) {
return utils.fail(true, err, bs.cb);
}
done(null, {
optionsIn: [
{
path: ["socket", "port"],
value: port
}
]
});
});
},
/**
* Some features require an internet connection.
* If the user did not provide either `true` or `false`
* for the online option, we will attempt to resolve www.google.com
* as a way of determining network connectivity
* @param {BrowserSync} bs
* @param {Function} done
*/
getOnlineStatus: function (bs, done) {
if (_.isUndefined(bs.options.get("online")) &&
_.isUndefined(process.env.TESTING)) {
require("dns").resolve("www.google.com", function (err) {
var online = false;
if (err) {
bs.debug("Could not resolve www.google.com, setting {magenta:online: false}");
}
else {
bs.debug("Resolved www.google.com, setting {magenta:online: true}");
online = true;
}
done(null, {
options: {
online: online
}
});
});
}
else {
done();
}
},
/**
* Try to load plugins that were given in options
* @param {BrowserSync} bs
* @param {Function} done
*/
resolveInlineUserPlugins: function (bs, done) {
var plugins = bs.options
.get("plugins")
.map(pluginUtils.resolvePlugin)
.map(pluginUtils.requirePlugin);
plugins.forEach(function (plugin) {
if (plugin.get("errors").size) {
return logPluginError(plugin);
}
var jsPlugin = plugin.toJS();
jsPlugin.options = jsPlugin.options || {};
jsPlugin.options.moduleName = jsPlugin.moduleName;
bs.registerPlugin(jsPlugin.module, jsPlugin.options);
});
function logPluginError(plugin) {
utils.fail(true, plugin.getIn(["errors", 0]), bs.cb);
}
done();
},
/**
*
* @param {BrowserSync} bs
* @param {Function} done
*/
setOptions: function (bs, done) {
done(null, {
options: {
urls: utils.getUrlOptions(bs.options),
snippet: connectUtils.scriptTags(bs.options),
scriptPaths: Immutable.fromJS(connectUtils.clientScript(bs.options, true)),
files: bs.pluginManager.hook("files:watch", bs.options.get("files"), bs.pluginManager.pluginOptions)
}
});
},
/**
* @param {BrowserSync} bs
* @param {Function} done
*/
setInternalEvents: function (bs, done) {
require("./internal-events")(bs);
done();
},
/**
* @param {BrowserSync} bs
* @param {Function} done
*/
setFileWatchers: function (bs, done) {
done(null, {
instance: {
watchers: bs.pluginManager.get("file:watcher")(bs)
}
});
},
/**
* @param {BrowserSync} bs
* @param {Function} done
*/
mergeMiddlewares: function (bs, done) {
done(null, {
options: {
middleware: bs.pluginManager.hook("server:middleware", bs.options.get("middleware"))
}
});
},
/**
* @param {BrowserSync} bs
* @param {Function} done
*/
startServer: function (bs, done) {
var server = bs.pluginManager.get("server")(bs);
done(null, {
instance: {
server: server.server,
app: server.app
}
});
},
/**
* @param {BrowserSync} bs
* @param {Function} done
*/
startTunnel: function (bs, done) {
if (bs.options.get("tunnel") && bs.options.get("online")) {
var localTunnel = require("./tunnel");
localTunnel(bs, function (err, tunnel) {
if (err) {
return done(err);
}
else {
return done(null, {
optionsIn: [
{
path: ["urls", "tunnel"],
value: tunnel.url
}
],
instance: {
tunnel: tunnel
}
});
}
});
}
else {
done();
}
},
/**
* @param {BrowserSync} bs
* @param {Function} done
*/
startSockets: function (bs, done) {
var clientEvents = bs.pluginManager.hook("client:events", bs.options.get("clientEvents").toJS());
// Start the socket, needs an existing server.
var io = bs.pluginManager.get("socket")(bs.server, clientEvents, bs);
done(null, {
instance: {
io: io
},
options: {
clientEvents: Immutable.fromJS(clientEvents)
}
});
},
/**
*
* @param {BrowserSync} bs
* @param {Function} done
*/
startUi: function (bs, done) {
var PLUGIN_NAME = "UI";
var userPlugins = bs.getUserPlugins();
var ui = bs.pluginManager.get(PLUGIN_NAME);
var uiOpts = bs.options.get("ui");
if (!uiOpts || uiOpts.get("enabled") === false) {
return done();
}
// if user provided a UI, use it instead
if (userPlugins.some(function (item) {
return item.name === PLUGIN_NAME;
})) {
uiOpts = bs.options
.get("ui")
.mergeDeep(Immutable.fromJS(bs.pluginManager.pluginOptions[PLUGIN_NAME]));
}
return ui(uiOpts.toJS(), bs, function (err, ui) {
if (err) {
return done(err);
}
done(null, {
instance: {
ui: ui
}
});
});
},
/**
* @param {BrowserSync} bs
* @param {Function} done
*/
mergeUiSettings: function (bs, done) {
if (!bs.ui) {
return done();
}
done(null, {
options: {
urls: bs.options.get("urls").merge(bs.ui.options.get("urls"))
}
});
},
/**
* @param {BrowserSync} bs
* @param {Function} done
*/
initUserPlugins: function (bs, done) {
bs.pluginManager.initUserPlugins(bs);
done(null, {
options: {
userPlugins: bs.getUserPlugins()
}
});
}
};
//# sourceMappingURL=async.js.map

File diff suppressed because one or more lines are too long

235
node_modules/browser-sync/dist/bin.js generated vendored
View file

@ -1,235 +0,0 @@
#!/usr/bin/env node
"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
var startOpts = require("../cli-options/opts.start.json");
var reloadOpts = require("../cli-options/opts.reload.json");
var recipeOpts = require("../cli-options/opts.recipe.json");
var pkg = require("../package.json");
var utils = require("./utils");
var path_1 = require("path");
var fs_1 = require("fs");
var logger_1 = require("./logger");
var eazy_logger_1 = require("eazy-logger");
var BsErrorLevels;
(function (BsErrorLevels) {
BsErrorLevels["Fatal"] = "Fatal";
})(BsErrorLevels = exports.BsErrorLevels || (exports.BsErrorLevels = {}));
var BsErrorTypes;
(function (BsErrorTypes) {
BsErrorTypes["PathNotFound"] = "PathNotFound";
})(BsErrorTypes = exports.BsErrorTypes || (exports.BsErrorTypes = {}));
/**
* Handle cli input
*/
if (!module.parent) {
runFromCli();
}
function runFromCli() {
var yargs = require("yargs")
.command("start", "Start the server")
.command("init", "Create a configuration file")
.command("reload", "Send a reload event over HTTP protocol")
.command("recipe", "Generate the files for a recipe")
.version(function () { return pkg.version; })
.epilogue([
"For help running a certain command, type <command> --help",
" $0 start --help",
"",
"You can run a static server by providing a path(s) directly",
" $0 app/src app/tmp",
"",
"If the directory contains a 'index.html' file, you can omit any input",
" $0",
"",
"You can run the proxy in this manner too",
" $0 https://example.com",
"",
"To run a proxy, whilst also serving static files",
eazy_logger_1.compile(" $0 https://example.com htdocs/themes/example")
].join("\n"));
var argv = yargs.argv;
var input = argv._;
var command = input[0];
var valid = ["start", "init", "reload", "recipe"];
if (valid.indexOf(command) > -1) {
return handleIncoming(command, yargs.reset());
}
if (input.length) {
return handleNoCommand(argv, input, yargs);
}
if (fs_1.existsSync("index.html")) {
return handleNoCommand(argv, ["."], yargs);
}
yargs.showHelp();
}
/**
* Feature: If no command was specified, try to do the 'right thing'
*
* If paths were given, start the server
* eg: browser-sync app/code app/design
* is equal to: browser-sync start --server app/code app/design
*
* eg: browser-sync http://example.com
* is equal to: browser-sync start --proxy http://example.com
*
* eg: browser-sync http://example.com themes/example
* is equal to: browser-sync start --proxy http://example.com --ss themes/example
*
* @param argv
* @param input
* @returns {any}
*/
function handleNoCommand(argv, input, yargs) {
var processed = processStart(yargs);
var paths = input.map(function (path) {
var resolved = path_1.resolve(path);
var isUrl = /^https?:\/\//.test(path);
return {
isUrl: isUrl,
userInput: path,
resolved: resolved,
errors: isUrl ? [] : pathErrors(path, resolved)
};
});
var withErrors = paths.filter(function (item) { return item.errors.length; });
var withoutErrors = paths.filter(function (item) { return item.errors.length === 0; });
if (withErrors.length) {
withErrors.forEach(function (item) {
logger_1.logger.unprefixed("error", printErrors(item.errors));
});
return process.exit(1);
}
var serveStaticPaths = withoutErrors
.filter(function (item) { return item.isUrl === false; })
.map(function (item) { return item.resolved; });
var urls = withoutErrors
.filter(function (item) { return item.isUrl === true; })
.map(function (item) { return item.userInput; });
/**
* If a URL was given, switch to proxy mode and use
* any other paths as serveStatic options
*/
if (urls.length) {
var proxy = urls[0];
var config_1 = __assign({}, processed, { proxy: proxy, serveStatic: serveStaticPaths });
return handleCli({ cli: { flags: config_1, input: ["start"] } });
}
/**
* if NO urls were given switch directly to server mode
* @type {{server: {baseDir: any}}}
*/
var config = __assign({}, processed, { server: { baseDir: serveStaticPaths } });
return handleCli({ cli: { flags: config, input: ["start"] } });
}
/**
* @param {{cli: object, [whitelist]: array, [cb]: function}} opts
* @returns {*}
*/
function handleCli(opts) {
opts.cb = opts.cb || utils.defaultCallback;
var m = require("./cli/command." + opts.cli.input[0]);
if (m.default) {
return m.default(opts);
}
return m(opts);
}
exports.default = handleCli;
function processStart(yargs) {
return yargs
.usage("Usage: $0 start [options]")
.options(startOpts)
.example("$0 start -s app", "- Use the App directory to serve files")
.example("$0 start -p www.bbc.co.uk", "- Proxy an existing website")
.default('cwd', function () { return process.cwd(); })
.help().argv;
}
/**
* @param {string} command
* @param {object} yargs
* @param cwd
*/
function handleIncoming(command, yargs) {
var out;
if (command === "start") {
out = processStart(yargs);
}
if (command === "init") {
out = yargs
.usage("Usage: $0 init")
.example("$0 init")
.default('cwd', function () { return process.cwd(); })
.help().argv;
}
if (command === "reload") {
out = yargs
.usage("Usage: $0 reload")
.options(reloadOpts)
.example("$0 reload")
.example("$0 reload --port 4000")
.default('cwd', function () { return process.cwd(); })
.help().argv;
}
if (command === "recipe") {
out = yargs
.usage("Usage: $0 recipe <recipe-name>")
.option(recipeOpts)
.example("$0 recipe ls", "list the recipes")
.example("$0 recipe gulp.sass", "use the gulp.sass recipe")
.default('cwd', function () { return process.cwd(); })
.help().argv;
}
if (out.help) {
return yargs.showHelp();
}
handleCli({ cli: { flags: out, input: out._ } });
}
function pathErrors(input, resolved) {
if (!fs_1.existsSync(resolved)) {
return [
{
type: BsErrorTypes.PathNotFound,
level: BsErrorLevels.Fatal,
errors: [
{
error: new Error("Path not found: " + input),
meta: function () {
return [
"Your Input: {yellow:" + input + "}",
"CWD: {yellow:" + process.cwd() + "}",
"Resolved to: {yellow:" + resolved + "}"
];
}
}
]
}
];
}
return [];
}
function printErrors(errors) {
return errors
.map(function (error) {
return [
"Error Type: {bold:" + error.type + "}",
"Error Level: {bold:" + error.level + "}",
error.errors.map(function (item) {
return [
"Error Message: " + item.error.message,
item.meta ? item.meta().join("\n") : ""
]
.filter(Boolean)
.join("\n");
})
].join("\n");
})
.join("\n\n");
}
//# sourceMappingURL=bin.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,565 +0,0 @@
"use strict";
var hooks = require("./hooks");
var asyncTasks = require("./async-tasks");
var config = require("./config");
var connectUtils = require("./connect-utils");
var utils = require("./utils");
var logger = require("./logger");
var eachSeries = utils.eachSeries;
var _ = require("./lodash.custom");
var EE = require("easy-extender");
/**
* Required internal plugins.
* Any of these can be overridden by deliberately
* causing a name-clash.
*/
var defaultPlugins = {
logger: logger,
socket: require("./sockets"),
"file:watcher": require("./file-watcher"),
server: require("./server"),
tunnel: require("./tunnel"),
"client:script": require("./client"),
UI: require("browser-sync-ui")
};
/**
* @constructor
*/
var BrowserSync = function (emitter) {
var bs = this;
bs.cwd = process.cwd();
bs.active = false;
bs.paused = false;
bs.config = config;
bs.utils = utils;
bs.events = bs.emitter = emitter;
bs._userPlugins = [];
bs._reloadQueue = [];
bs._cleanupTasks = [];
bs._browserReload = false;
// Plugin management
bs.pluginManager = new EE(defaultPlugins, hooks);
};
/**
* Call a user-options provided callback
* @param name
*/
BrowserSync.prototype.callback = function (name) {
var bs = this;
var cb = bs.options.getIn(["callbacks", name]);
if (_.isFunction(cb)) {
cb.apply(bs.publicInstance, _.toArray(arguments).slice(1));
}
};
/**
* @param {Map} options
* @param {Function} cb
* @returns {BrowserSync}
*/
BrowserSync.prototype.init = function (options, cb) {
/**
* Safer access to `this`
* @type {BrowserSync}
*/
var bs = this;
/**
* Set user-provided callback, or assign a noop
* @type {Function}
*/
bs.cb = cb || utils.defaultCallback;
/**
* Verify provided config.
* Some options are not compatible and will cause us to
* end the process.
*/
if (!utils.verifyConfig(options, bs.cb)) {
return;
}
/**
* Save a reference to the original options
* @type {Map}
* @private
*/
bs._options = options;
/**
* Set additional options that depend on what the
* user may of provided
* @type {Map}
*/
bs.options = options;
/**
* Kick off default plugins.
*/
bs.pluginManager.init();
/**
* Create a base logger & debugger.
*/
bs.logger = bs.pluginManager.get("logger")(bs.events, bs);
bs.debugger = bs.logger.clone({ useLevelPrefixes: true });
bs.debug = bs.debugger.debug;
/**
* Run each setup task in sequence
*/
eachSeries(asyncTasks, taskRunner(bs), tasksComplete(bs));
return this;
};
/**
* Run 1 setup task.
* Each task is a pure function.
* They can return options or instance properties to set,
* but they cannot set them directly.
* @param {BrowserSync} bs
* @returns {Function}
*/
function taskRunner(bs) {
return function (item, cb) {
bs.debug("-> {yellow:Starting Step: " + item.step);
/**
* Execute the current task.
*/
item.fn(bs, executeTask);
function executeTask(err, out) {
/**
* Exit early if any task returned an error.
*/
if (err) {
return cb(err);
}
/**
* Act on return values (such as options to be set,
* or instance properties to be set
*/
if (out) {
handleOut(bs, out);
}
bs.debug("+ {green:Step Complete: " + item.step);
cb();
}
};
}
/**
* @param bs
* @param out
*/
function handleOut(bs, out) {
/**
* Set a single/many option.
*/
if (out.options) {
setOptions(bs, out.options);
}
/**
* Any options returned that require path access?
*/
if (out.optionsIn) {
out.optionsIn.forEach(function (item) {
bs.setOptionIn(item.path, item.value);
});
}
/**
* Any instance properties returned?
*/
if (out.instance) {
Object.keys(out.instance).forEach(function (key) {
bs[key] = out.instance[key];
});
}
}
/**
* Update the options Map
* @param bs
* @param options
*/
function setOptions(bs, options) {
/**
* If multiple options were set, act on the immutable map
* in an efficient way
*/
if (Object.keys(options).length > 1) {
bs.setMany(function (item) {
Object.keys(options).forEach(function (key) {
item.set(key, options[key]);
return item;
});
});
}
else {
Object.keys(options).forEach(function (key) {
bs.setOption(key, options[key]);
});
}
}
/**
* At this point, ALL async tasks have completed
* @param {BrowserSync} bs
* @returns {Function}
*/
function tasksComplete(bs) {
return function (err) {
if (err) {
bs.logger.setOnce("useLevelPrefixes", true).error(err.message);
}
/**
* Set active flag
*/
bs.active = true;
/**
* @deprecated
*/
bs.events.emit("init", bs);
/**
* This is no-longer needed as the Callback now only resolves
* when everything (including slow things, like the tunnel) is ready.
* It's here purely for backwards compatibility.
* @deprecated
*/
bs.events.emit("service:running", {
options: bs.options,
baseDir: bs.options.getIn(["server", "baseDir"]),
type: bs.options.get("mode"),
port: bs.options.get("port"),
url: bs.options.getIn(["urls", "local"]),
urls: bs.options.get("urls").toJS(),
tunnel: bs.options.getIn(["urls", "tunnel"])
});
/**
* Call any option-provided callbacks
*/
bs.callback("ready", null, bs);
/**
* Finally, call the user-provided callback given as last arg
*/
bs.cb(null, bs);
};
}
/**
* @param module
* @param opts
* @param cb
*/
BrowserSync.prototype.registerPlugin = function (module, opts, cb) {
var bs = this;
bs.pluginManager.registerPlugin(module, opts, cb);
if (module["plugin:name"]) {
bs._userPlugins.push(module);
}
};
/**
* Get a plugin by name
* @param name
*/
BrowserSync.prototype.getUserPlugin = function (name) {
var bs = this;
var items = bs.getUserPlugins(function (item) {
return item["plugin:name"] === name;
});
if (items && items.length) {
return items[0];
}
return false;
};
/**
* @param {Function} [filter]
*/
BrowserSync.prototype.getUserPlugins = function (filter) {
var bs = this;
filter =
filter ||
function () {
return true;
};
/**
* Transform Plugins option
*/
bs.userPlugins = bs._userPlugins.filter(filter).map(function (plugin) {
return {
name: plugin["plugin:name"],
active: plugin._enabled,
opts: bs.pluginManager.pluginOptions[plugin["plugin:name"]]
};
});
return bs.userPlugins;
};
/**
* Get middleware
* @returns {*}
*/
BrowserSync.prototype.getMiddleware = function (type) {
var types = {
connector: connectUtils.socketConnector(this.options)
};
if (type in types) {
return function (req, res) {
res.setHeader("Content-Type", "text/javascript");
res.end(types[type]);
};
}
};
/**
* Shortcut for pushing a file-serving middleware
* onto the stack
* @param {String} path
* @param {{type: string, content: string}} props
*/
var _serveFileCount = 0;
BrowserSync.prototype.serveFile = function (path, props) {
var bs = this;
var mode = bs.options.get("mode");
var entry = {
handle: function (req, res) {
res.setHeader("Content-Type", props.type);
res.end(props.content);
},
id: "Browsersync - " + _serveFileCount++,
route: path
};
bs._addMiddlewareToStack(entry);
};
/**
* Add middlewares on the fly
*/
BrowserSync.prototype._addMiddlewareToStack = function (entry) {
var bs = this;
/**
* additional middlewares are always appended -1,
* this is to allow the proxy middlewares to remain,
* and the directory index to remain in serveStatic/snippet modes
*/
bs.app.stack.splice(bs.app.stack.length - 1, 0, entry);
};
var _addMiddlewareCount = 0;
BrowserSync.prototype.addMiddleware = function (route, handle, opts) {
var bs = this;
if (!bs.app) {
return;
}
opts = opts || {};
if (!opts.id) {
opts.id = "bs-mw-" + _addMiddlewareCount++;
}
if (route === "*") {
route = "";
}
var entry = {
id: opts.id,
route: route,
handle: handle
};
if (opts.override) {
entry.override = true;
}
bs.options = bs.options.update("middleware", function (mw) {
if (bs.options.get("mode") === "proxy") {
return mw.insert(mw.size - 1, entry);
}
return mw.concat(entry);
});
bs.resetMiddlewareStack();
};
/**
* Remove middlewares on the fly
* @param {String} id
* @returns {Server}
*/
BrowserSync.prototype.removeMiddleware = function (id) {
var bs = this;
if (!bs.app) {
return;
}
bs.options = bs.options.update("middleware", function (mw) {
return mw.filter(function (mw) {
return mw.id !== id;
});
});
bs.resetMiddlewareStack();
};
/**
* Middleware for socket connection (external usage)
* @param opts
* @returns {*}
*/
BrowserSync.prototype.getSocketConnector = function (opts) {
var bs = this;
return function (req, res) {
res.setHeader("Content-Type", "text/javascript");
res.end(bs.getExternalSocketConnector(opts));
};
};
/**
* Socket connector as a string
* @param {Object} opts
* @returns {*}
*/
BrowserSync.prototype.getExternalSocketConnector = function (opts) {
var bs = this;
return connectUtils.socketConnector(bs.options.withMutations(function (item) {
item.set("socket", item.get("socket").merge(opts));
if (!bs.options.getIn(["proxy", "ws"])) {
item.set("mode", "snippet");
}
}));
};
/**
* Callback helper
* @param name
*/
BrowserSync.prototype.getOption = function (name) {
this.debug("Getting option: {magenta:%s", name);
return this.options.get(name);
};
/**
* Callback helper
* @param path
*/
BrowserSync.prototype.getOptionIn = function (path) {
this.debug("Getting option via path: {magenta:%s", path);
return this.options.getIn(path);
};
/**
* @returns {BrowserSync.options}
*/
BrowserSync.prototype.getOptions = function () {
return this.options;
};
/**
* @returns {BrowserSync.options}
*/
BrowserSync.prototype.getLogger = logger.getLogger;
/**
* @param {String} name
* @param {*} value
* @returns {BrowserSync.options|*}
*/
BrowserSync.prototype.setOption = function (name, value, opts) {
var bs = this;
opts = opts || {};
bs.debug("Setting Option: {cyan:%s} - {magenta:%s", name, value.toString());
bs.options = bs.options.set(name, value);
if (!opts.silent) {
bs.events.emit("options:set", {
path: name,
value: value,
options: bs.options
});
}
return this.options;
};
/**
* @param path
* @param value
* @param opts
* @returns {Map|*|BrowserSync.options}
*/
BrowserSync.prototype.setOptionIn = function (path, value, opts) {
var bs = this;
opts = opts || {};
bs.debug("Setting Option: {cyan:%s} - {magenta:%s", path.join("."), value.toString());
bs.options = bs.options.setIn(path, value);
if (!opts.silent) {
bs.events.emit("options:set", {
path: path,
value: value,
options: bs.options
});
}
return bs.options;
};
/**
* Set multiple options with mutations
* @param fn
* @param opts
* @returns {Map|*}
*/
BrowserSync.prototype.setMany = function (fn, opts) {
var bs = this;
opts = opts || {};
bs.debug("Setting multiple Options");
bs.options = bs.options.withMutations(fn);
if (!opts.silent) {
bs.events.emit("options:set", { options: bs.options.toJS() });
}
return this.options;
};
BrowserSync.prototype.addRewriteRule = function (rule) {
var bs = this;
bs.options = bs.options.update("rewriteRules", function (rules) {
return rules.concat(rule);
});
bs.resetMiddlewareStack();
};
BrowserSync.prototype.removeRewriteRule = function (id) {
var bs = this;
bs.options = bs.options.update("rewriteRules", function (rules) {
return rules.filter(function (rule) {
return rule.id !== id;
});
});
bs.resetMiddlewareStack();
};
BrowserSync.prototype.setRewriteRules = function (rules) {
var bs = this;
bs.options = bs.options.update("rewriteRules", function (_) {
return rules;
});
bs.resetMiddlewareStack();
};
/**
* Add a new rewrite rule to the stack
* @param {Object} rule
*/
BrowserSync.prototype.resetMiddlewareStack = function () {
var bs = this;
var middlewares = require("./server/utils").getMiddlewares(bs, bs.options);
bs.app.stack = middlewares;
};
/**
* @param fn
*/
BrowserSync.prototype.registerCleanupTask = function (fn) {
this._cleanupTasks.push(fn);
};
/**
* Instance Cleanup
*/
BrowserSync.prototype.cleanup = function (cb) {
var bs = this;
if (!bs.active) {
return;
}
// Remove all event listeners
if (bs.events) {
bs.debug("Removing event listeners...");
bs.events.removeAllListeners();
}
// Close any core file watchers
if (bs.watchers) {
Object.keys(bs.watchers).forEach(function (key) {
bs.watchers[key].watchers.forEach(function (watcher) {
watcher.close();
});
});
}
// Run any additional clean up tasks
bs._cleanupTasks.forEach(function (fn) {
if (_.isFunction(fn)) {
fn(bs);
}
});
// Reset the flag
bs.debug("Setting {magenta:active: false");
bs.active = false;
bs.paused = false;
bs.pluginManager.plugins = {};
bs.pluginManager.pluginOptions = {};
bs.pluginManager.defaultPlugins = defaultPlugins;
bs._userPlugins = [];
bs.userPlugins = [];
bs._reloadTimer = undefined;
bs._reloadQueue = [];
bs._cleanupTasks = [];
if (_.isFunction(cb)) {
cb(null, bs);
}
};
module.exports = BrowserSync;
//# sourceMappingURL=browser-sync.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,49 +0,0 @@
"use strict";
var config = require("../config");
var logger = require("../logger").logger;
var fs = require("fs");
var _ = require("../lodash.custom");
var path = require("path");
var info = {
/**
* Version info
* @param {Object} pjson
* @returns {String}
*/
getVersion: function (pjson) {
console.log(pjson.version);
return pjson.version;
},
/**
* Retrieve the config file
* @returns {*}
* @private
* @param filePath
*/
getConfigFile: function (filePath) {
return require(path.resolve(filePath));
},
/**
* Generate an example Config file.
*/
makeConfig: function (cwd, cb) {
var opts = require(path.join(__dirname, "..", config.configFile));
var userOpts = {};
var ignore = ["excludedFileTypes", "injectFileTypes", "snippetOptions"];
Object.keys(opts).forEach(function (key) {
if (!_.includes(ignore, key)) {
userOpts[key] = opts[key];
}
});
var file = fs.readFileSync(config.template, "utf8");
file = file.replace("//OPTS", JSON.stringify(userOpts, null, 4));
fs.writeFile(path.resolve(cwd, config.userFile), file, function () {
logger.info("Config file created {magenta:%s}", config.userFile);
logger.info("To use it, in the same directory run: " +
"{cyan:browser-sync start --config bs-config.js}");
cb();
});
}
};
module.exports = info;
//# sourceMappingURL=cli-info.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"cli-info.js","sourceRoot":"","sources":["../../lib/cli/cli-info.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,IAAI,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAClC,IAAI,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC;AAEzC,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,IAAI,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACpC,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE3B,IAAI,IAAI,GAAG;IACP;;;;OAIG;IACH,UAAU,EAAE,UAAS,KAAK;QACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;IACzB,CAAC;IACD;;;;;OAKG;IACH,aAAa,EAAE,UAAS,QAAQ;QAC5B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3C,CAAC;IACD;;OAEG;IACH,UAAU,EAAE,UAAS,GAAG,EAAE,EAAE;QACxB,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;QAClE,IAAI,QAAQ,GAAG,EAAE,CAAC;QAElB,IAAI,MAAM,GAAG,CAAC,mBAAmB,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;QAExE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAS,GAAG;YAClC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;gBAC3B,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9B,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACpD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAEjE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE;YACnD,MAAM,CAAC,IAAI,CAAC,kCAAkC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;YACjE,MAAM,CAAC,IAAI,CACP,wCAAwC;gBACpC,iDAAiD,CACxD,CAAC;YACF,EAAE,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC"}

View file

@ -1,95 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var immutable_1 = require("immutable");
var addToFilesOption_1 = require("./transforms/addToFilesOption");
var addDefaultIgnorePatterns_1 = require("./transforms/addDefaultIgnorePatterns");
var copyCLIIgnoreToWatchOptions_1 = require("./transforms/copyCLIIgnoreToWatchOptions");
var handleExtensionsOption_1 = require("./transforms/handleExtensionsOption");
var handleFilesOption_1 = require("./transforms/handleFilesOption");
var handleGhostModeOption_1 = require("./transforms/handleGhostModeOption");
var handlePortsOption_1 = require("./transforms/handlePortsOption");
var handleProxyOption_1 = require("./transforms/handleProxyOption");
var handleServerOption_1 = require("./transforms/handleServerOption");
var appendServerIndexOption_1 = require("./transforms/appendServerIndexOption");
var appendServerDirectoryOption_1 = require("./transforms/appendServerDirectoryOption");
var addCwdToWatchOptions_1 = require("./transforms/addCwdToWatchOptions");
var options_1 = require("../options");
var _ = require("../lodash.custom");
var defaultConfig = require("../default-config");
var immDefs = immutable_1.fromJS(defaultConfig);
/**
* @param {Object} input
* @returns {Map}
*/
function merge(input) {
var merged = immDefs.mergeDeep(input);
var transforms = [
addToFilesOption_1.addToFilesOption,
addCwdToWatchOptions_1.addCwdToWatchOptions,
addDefaultIgnorePatterns_1.addDefaultIgnorePatterns,
copyCLIIgnoreToWatchOptions_1.copyCLIIgnoreToWatchOptions,
handleServerOption_1.handleServerOption,
appendServerIndexOption_1.appendServerIndexOption,
appendServerDirectoryOption_1.appendServerDirectoryOption,
handleProxyOption_1.handleProxyOption,
handlePortsOption_1.handlePortsOption,
handleGhostModeOption_1.handleGhostModeOption,
handleFilesOption_1.handleFilesOption,
handleExtensionsOption_1.handleExtensionsOption,
options_1.setMode,
options_1.setScheme,
options_1.setStartPath,
options_1.setProxyWs,
options_1.setServerOpts,
options_1.liftExtensionsOptionFromCli,
options_1.setNamespace,
options_1.fixSnippetIgnorePaths,
options_1.fixSnippetIncludePaths,
options_1.fixRewriteRules,
options_1.setMiddleware,
options_1.setOpen,
options_1.setUiPort
];
var output = transforms.reduce(function (acc, item) {
return item.call(null, acc);
}, merged);
// console.log(output.toJSON());
return output;
}
exports.merge = merge;
/**
* @param string
*/
function explodeFilesArg(string) {
return string.split(",").map(function (item) { return item.trim(); });
}
exports.explodeFilesArg = explodeFilesArg;
/**
* @param value
* @returns {{globs: Array, objs: Array}}
*/
function makeFilesArg(value) {
var globs = [];
var objs = [];
if (_.isString(value)) {
globs = globs.concat(explodeFilesArg(value));
}
if (immutable_1.List.isList(value) && value.size) {
value.forEach(function (value) {
if (_.isString(value)) {
globs.push(value);
}
else {
if (immutable_1.Map.isMap(value)) {
objs.push(value);
}
}
});
}
return {
globs: globs,
objs: objs
};
}
exports.makeFilesArg = makeFilesArg;
//# sourceMappingURL=cli-options.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"cli-options.js","sourceRoot":"","sources":["../../lib/cli/cli-options.ts"],"names":[],"mappings":";;AAAA,uCAA8C;AAC9C,kEAAiE;AACjE,kFAAiF;AACjF,wFAAuF;AACvF,8EAA6E;AAC7E,oEAAmE;AACnE,4EAA2E;AAC3E,oEAAmE;AACnE,oEAAmE;AACnE,sEAAqE;AACrE,gFAA+E;AAC/E,wFAAuF;AACvF,0EAAyE;AACzE,sCAcoB;AAEpB,IAAM,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACtC,IAAM,aAAa,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACnD,IAAM,OAAO,GAAG,kBAAM,CAAC,aAAa,CAAC,CAAC;AAEtC;;;GAGG;AACH,eAAsB,KAAK;IACvB,IAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACxC,IAAM,UAAU,GAAG;QACf,mCAAgB;QAChB,2CAAoB;QACpB,mDAAwB;QACxB,yDAA2B;QAC3B,uCAAkB;QAClB,iDAAuB;QACvB,yDAA2B;QAC3B,qCAAiB;QACjB,qCAAiB;QACjB,6CAAqB;QACrB,qCAAiB;QACjB,+CAAsB;QACtB,iBAAO;QACP,mBAAS;QACT,sBAAY;QACZ,oBAAU;QACV,uBAAa;QACb,qCAA2B;QAC3B,sBAAY;QACZ,+BAAqB;QACrB,gCAAsB;QACtB,yBAAe;QACf,uBAAa;QACb,iBAAO;QACP,mBAAS;KACZ,CAAC;IAEF,IAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,IAAI;QACvC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,G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require("./cli-info");
/**
* $ browser-sync init
*
* This command will generate a configuration
* file in the current directory
*
* @param opts
*/
module.exports = function (opts) {
info.makeConfig(process.cwd(), opts.cb);
};
//# sourceMappingURL=command.init.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"command.init.js","sourceRoot":"","sources":["../../lib/cli/command.init.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,IAAI,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAEjC;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,GAAG,UAAS,IAAI;IAC1B,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,CAAC,CAAC"}

View file

@ -1,61 +0,0 @@
"use strict";
var logger = require("../logger").logger;
/**
* $ browser-sync recipe <name> <options>
*
* This command will copy a recipe into either the current directory
* or one given with the --output flag
*
* @param opts
* @returns {Function}
*/
module.exports = function (opts) {
var path = require("path");
var fs = require("fs-extra");
var input = opts.cli.input.slice(1);
var resolved = require.resolve("bs-recipes");
var dir = path.dirname(resolved);
var logRecipes = function () {
var dirs = fs.readdirSync(path.join(dir, "recipes"));
logger.info("Install one of the following with {cyan:browser-sync recipe <name>\n");
dirs.forEach(function (name) {
console.log(" " + name);
});
};
if (!input.length) {
logger.info("No recipe name provided!");
logRecipes();
return opts.cb();
}
if (opts.cli.input[1] === "ls") {
logRecipes();
return opts.cb();
}
input = input[0];
var flags = opts.cli.flags;
var output = flags.output
? path.resolve(flags.output)
: path.join(process.cwd(), input);
var targetDir = path.join(dir, "recipes", input);
if (fs.existsSync(output)) {
return opts.cb(new Error("Target folder exists remove it first and then try again"));
}
if (fs.existsSync(targetDir)) {
fs.copy(targetDir, output, function (err) {
if (err) {
opts.cb(err);
}
else {
logger.info("Recipe copied into {cyan:%s}", output);
logger.info("Next, inside that folder, run {cyan:npm i && npm start}");
opts.cb(null);
}
});
}
else {
logger.info("Recipe {cyan:%s} not found. The following are available though", input);
logRecipes();
opts.cb();
}
};
//# sourceMappingURL=command.recipe.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"command.recipe.js","sourceRoot":"","sources":["../../lib/cli/command.recipe.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,IAAI,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC;AAEzC;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,GAAG,UAAS,IAAI;IAC1B,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3B,IAAI,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7B,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpC,IAAI,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7C,IAAI,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEjC,IAAI,UAAU,GAAG;QACb,IAAI,IAAI,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;QACrD,MAAM,CAAC,IAAI,CACP,sEAAsE,CACzE,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,UAAS,IAAI;YACtB,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAChB,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACxC,UAAU,EAAE,CAAC;QACb,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;IACrB,CAAC;IAED,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KA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,EAChE,KAAK,CACR,CAAC;QACF,UAAU,EAAE,CAAC;QACb,IAAI,CAAC,EAAE,EAAE,CAAC;IACd,CAAC;AACL,CAAC,CAAC"}

View file

@ -1,41 +0,0 @@
"use strict";
/**
* $ browser-sync reload <options>
*
* This commands starts the Browsersync servers
* & Optionally UI.
*
* @param opts
* @returns {Function}
*/
module.exports = function (opts) {
var flags = opts.cli.flags;
if (!flags.url) {
flags.url = "http://localhost:" + (flags.port || 3000);
}
var proto = require("../http-protocol");
var scheme = flags.url.match(/^https/) ? "https" : "http";
var args = { method: "reload" };
if (flags.files) {
args.args = flags.files;
}
var url = proto.getUrl(args, flags.url);
if (scheme === "https") {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
}
require(scheme)
.get(url, function (res) {
res.on("data", function () {
if (res.statusCode === 200) {
opts.cb(null, res);
}
});
})
.on("error", function (err) {
if (err.code === "ECONNREFUSED") {
err.message = "Browsersync not running at " + flags.url;
}
return opts.cb(err);
});
};
//# sourceMappingURL=command.reload.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"command.reload.js","sourceRoot":"","sources":["../../lib/cli/command.reload.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,GAAG,UAAS,IAAI;IAC1B,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;IAC3B,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QACb,KAAK,CAAC,GAAG,GAAG,mBAAmB,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,KAAK,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACxC,IAAI,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;IAC1D,IAAI,IAAI,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAEhC,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC;IAC5B,CAAC;IAED,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAExC,EAAE,CAAC,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,4BAA4B,GAAG,GAAG,CAAC;IACnD,CAAC;IAED,OAAO,CAAC,MAAM,CAAC;SACV,GAAG,CAAC,GAAG,EAAE,UAAS,GAAG;QAClB,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE;YACX,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,CAAC,CAAC;gBACzB,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YACvB,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;SACD,EAAE,CAAC,OAAO,EAAE,UAAS,GAAG;QACrB,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC;YAC9B,GAAG,CAAC,OAAO,GAAG,6BAA6B,GAAG,KAAK,CAAC,GAAG,CAAC;QAC5D,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACX,CAAC,CAAC"}

View file

@ -1,79 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var path = require("path");
var fs_1 = require("fs");
var utils = require("../utils");
var cli_options_1 = require("./cli-options");
var _ = require("../lodash.custom");
/**
* $ browser-sync start <options>
*
* This commands starts the Browsersync servers
* & Optionally UI.
*
* @param opts
* @returns {Function}
*/
function default_1(opts) {
var flags = preprocessFlags(opts.cli.flags);
var cwd = flags.cwd || process.cwd();
var maybepkg = path.resolve(cwd, "package.json");
var input = flags;
if (flags.config) {
var maybeconf = path.resolve(cwd, flags.config);
if (fs_1.existsSync(maybeconf)) {
var conf = require(maybeconf);
input = _.merge({}, conf, flags);
}
else {
utils.fail(true, new Error("Configuration file '" + flags.config + "' not found"), opts.cb);
}
}
else {
if (fs_1.existsSync(maybepkg)) {
var pkg = require(maybepkg);
if (pkg["browser-sync"]) {
console.log("> Configuration obtained from package.json");
input = _.merge({}, pkg["browser-sync"], flags);
}
}
}
return require("../")
.create("cli")
.init(input, opts.cb);
}
exports.default = default_1;
/**
* @param flags
* @returns {*}
*/
function preprocessFlags(flags) {
return [stripUndefined, legacyFilesArgs].reduce(function (flags, fn) { return fn.call(null, flags); }, flags);
}
/**
* Incoming undefined values are problematic as
* they interfere with Immutable.Map.mergeDeep
* @param subject
* @returns {*}
*/
function stripUndefined(subject) {
return Object.keys(subject).reduce(function (acc, key) {
var value = subject[key];
if (typeof value === "undefined") {
return acc;
}
acc[key] = value;
return acc;
}, {});
}
/**
* @param flags
* @returns {*}
*/
function legacyFilesArgs(flags) {
if (flags.files && flags.files.length) {
flags.files = flags.files.reduce(function (acc, item) { return acc.concat(cli_options_1.explodeFilesArg(item)); }, []);
}
return flags;
}
//# sourceMappingURL=command.start.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"command.start.js","sourceRoot":"","sources":["../../lib/cli/command.start.ts"],"names":[],"mappings":";;AAAA,2BAA6B;AAC7B,yBAAgC;AAChC,gCAAkC;AAClC,6CAAgD;AAChD,IAAM,CAAC,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEtC;;;;;;;;GAQG;AACH,mBAAwB,IAAI;IACxB,IAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACvC,I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ACH,yBAAyB,KAAK;IAC1B,MAAM,CAAC,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC,MAAM,CAC3C,UAAC,KAAK,EAAE,EAAE,IAAK,OAAA,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAApB,CAAoB,EACnC,KAAK,CACR,CAAC;AACN,CAAC;AAED;;;;;GAKG;AACH,wBAAwB,OAAO;IAC3B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,GAAG;QACxC,IAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC3B,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC;YAC/B,MAAM,CAAC,GAAG,CAAC;QACf,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACjB,MAAM,CAAC,GAAG,CAAC;IACf,CAAC,EAAE,EAAE,CAAC,CAAC;AACX,CAAC;AAED;;;GAGG;AACH,yBAAyB,KAAK;IAC1B,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QACpC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAC5B,UAAC,GAAG,EAAE,IAAI,IAAK,OAAA,GAAG,CAAC,MAAM,CAAC,6BAAe,CAAC,IAAI,CAAC,CAAC,EAAjC,CAAiC,EAChD,EAAE,CACL,CAAC;IACN,CAAC;IACD,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC"}

View file

@ -1,9 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function addCwdToWatchOptions(incoming) {
return incoming.updateIn(['watchOptions', 'cwd'], function (watchCwd) {
return watchCwd || incoming.get('cwd');
});
}
exports.addCwdToWatchOptions = addCwdToWatchOptions;
//# sourceMappingURL=addCwdToWatchOptions.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"addCwdToWatchOptions.js","sourceRoot":"","sources":["../../../lib/cli/transforms/addCwdToWatchOptions.ts"],"names":[],"mappings":";;AAAA,8BAAqC,QAAQ;IACzC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,cAAc,EAAE,KAAK,CAAC,EAAE,UAAC,QAAQ;QACvD,MAAM,CAAC,QAAQ,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAA;AACN,CAAC;AAJD,oDAIC"}

View file

@ -1,25 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var immutable_1 = require("immutable");
var defaultIgnorePatterns = [
/node_modules/,
/bower_components/,
'.sass-cache',
'.vscode',
'.git',
'.idea',
];
function addDefaultIgnorePatterns(incoming) {
return incoming.update("watchOptions", function (watchOptions) {
var userIgnored = immutable_1.List([])
.concat(watchOptions.get("ignored"))
.filter(Boolean)
.toSet();
var merged = userIgnored.merge(defaultIgnorePatterns);
return watchOptions.merge({
ignored: merged.toList(),
});
});
}
exports.addDefaultIgnorePatterns = addDefaultIgnorePatterns;
//# sourceMappingURL=addDefaultIgnorePatterns.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"addDefaultIgnorePatterns.js","sourceRoot":"","sources":["../../../lib/cli/transforms/addDefaultIgnorePatterns.ts"],"names":[],"mappings":";;AAAA,uCAA+B;AAE/B,IAAM,qBAAqB,GAAG;IAC1B,cAAc;IACd,kBAAkB;IAClB,aAAa;IACb,SAAS;IACT,MAAM;IACN,OAAO;CACV,CAAC;AAEF,kCAAyC,QAAQ;IAC7C,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,UAAA,YAAY;QAC/C,IAAM,WAAW,GAAG,gBAAI,CAAC,EAAE,CAAC;aACvB,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;aACnC,MAAM,CAAC,OAAO,CAAC;aACf,KAAK,EAAE,CAAC;QAEb,IAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAExD,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC;YACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;SAC3B,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAbD,4DAaC"}

View file

@ -1,49 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var immutable_1 = require("immutable");
function addToFilesOption(incoming) {
if (!incoming.get("watch")) {
return incoming;
}
var serverPaths = [];
var fromServeStatic = incoming
.get("serveStatic", immutable_1.List([]))
.toArray();
var ssPaths = fromServeStatic
.reduce(function (acc, ss) {
if (typeof ss === "string") {
return acc.concat(ss);
}
if (ss.dir && typeof ss.dir === "string") {
return acc.concat(ss);
}
return acc;
}, []);
ssPaths.forEach(function (p) { return serverPaths.push(p); });
var server = incoming.get("server");
if (server) {
if (server === true) {
serverPaths.push(".");
}
if (typeof server === "string") {
serverPaths.push(server);
}
if (immutable_1.List.isList(server) &&
server.every(function (x) { return typeof x === "string"; })) {
server.forEach(function (s) { return serverPaths.push(s); });
}
if (immutable_1.Map.isMap(server)) {
var baseDirProp = server.get("baseDir");
var baseDirs = immutable_1.List([]).concat(baseDirProp).filter(Boolean);
baseDirs.forEach(function (s) { return serverPaths.push(s); });
}
}
var output = incoming.update("files", function (files) {
return immutable_1.List([])
.concat(files, serverPaths)
.filter(Boolean);
});
return output;
}
exports.addToFilesOption = addToFilesOption;
//# sourceMappingURL=addToFilesOption.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"addToFilesOption.js","sourceRoot":"","sources":["../../../lib/cli/transforms/addToFilesOption.ts"],"names":[],"mappings":";;AAAA,uCAAoC;AAEpC,0BAAiC,QAAQ;IACrC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,QAA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AAC,KAAK,QAAQ,EAArB,CAAqB,CAC3C,CAAC,CAAC,CAAC;YACC,MAAM,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAnB,CAAmB,CAAC,CAAC;QAC7C,CAAC;QACD,EAAE,CAAC,CAAC,eAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACpB,IAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAC1C,IAAM,QAAQ,GAAG,gBAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC9D,QAAQ,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAnB,CAAmB,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC;IAED,IAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,UAAA,KAAK;QACzC,MAAM,CAAC,gBAAI,CAAC,EAAE,CAAC;aACV,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC;aAC1B,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,MAAM,CAAC;AAClB,CAAC;AAlDD,4CAkDC"}

View file

@ -1,12 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function appendServerDirectoryOption(incoming) {
if (!incoming.get('server'))
return incoming;
if (incoming.get('directory')) {
return incoming.setIn(['server', 'directory'], incoming.has('directory'));
}
return incoming;
}
exports.appendServerDirectoryOption = appendServerDirectoryOption;
//# sourceMappingURL=appendServerDirectoryOption.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"appendServerDirectoryOption.js","sourceRoot":"","sources":["../../../lib/cli/transforms/appendServerDirectoryOption.ts"],"names":[],"mappings":";;AAAA,qCAA4C,QAAQ;IAChD,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAAC,MAAM,CAAC,QAAQ,CAAC;IAC7C,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAC5B,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,WAAW,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;IAC9E,CAAC;IACD,MAAM,CAAC,QAAQ,CAAC;AACpB,CAAC;AAND,kEAMC"}

View file

@ -1,13 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function appendServerIndexOption(incoming) {
if (!incoming.get('server'))
return incoming;
var value = incoming.get('index');
if (value) {
return incoming.setIn(['server', 'index'], value);
}
return incoming;
}
exports.appendServerIndexOption = appendServerIndexOption;
//# sourceMappingURL=appendServerIndexOption.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"appendServerIndexOption.js","sourceRoot":"","sources":["../../../lib/cli/transforms/appendServerIndexOption.ts"],"names":[],"mappings":";;AAAA,iCAAwC,QAAQ;IAC5C,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAAC,MAAM,CAAC,QAAQ,CAAC;IAC7C,IAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAEpC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QACR,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC;AACpB,CAAC;AATD,0DASC"}

View file

@ -1,14 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var immutable_1 = require("immutable");
function copyCLIIgnoreToWatchOptions(incoming) {
if (!incoming.get("ignore")) {
return incoming;
}
return incoming.updateIn(["watchOptions", "ignored"], function (ignored) {
var userIgnore = immutable_1.List([]).concat(incoming.get("ignore"));
return ignored.concat(userIgnore);
});
}
exports.copyCLIIgnoreToWatchOptions = copyCLIIgnoreToWatchOptions;
//# sourceMappingURL=copyCLIIgnoreToWatchOptions.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"copyCLIIgnoreToWatchOptions.js","sourceRoot":"","sources":["../../../lib/cli/transforms/copyCLIIgnoreToWatchOptions.ts"],"names":[],"mappings":";;AAAA,uCAA+B;AAE/B,qCAA4C,QAAQ;IAChD,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC1B,MAAM,CAAC,QAAQ,CAAC;IACpB,CAAC;IACD,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE,UAAA,OAAO;QACzD,IAAM,UAAU,GAAG,gBAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC3D,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC;AARD,kEAQC"}

View file

@ -1,20 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var immutable_1 = require("immutable");
var cli_options_1 = require("../cli-options");
var _ = require("../../lodash.custom");
function handleExtensionsOption(incoming) {
var value = incoming.get('extensions');
if (_.isString(value)) {
var split = cli_options_1.explodeFilesArg(value);
if (split.length) {
return incoming.set('extensions', immutable_1.List(split));
}
}
if (immutable_1.List.isList(value)) {
return incoming.set('extensions', value);
}
return incoming;
}
exports.handleExtensionsOption = handleExtensionsOption;
//# sourceMappingURL=handleExtensionsOption.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"handleExtensionsOption.js","sourceRoot":"","sources":["../../../lib/cli/transforms/handleExtensionsOption.ts"],"names":[],"mappings":";;AAAA,uCAA+B;AAC/B,8CAA+C;AAE/C,IAAM,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEzC,gCAAuC,QAAQ;IAC3C,IAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACzC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACpB,IAAM,KAAK,GAAG,6BAAe,CAAC,KAAK,CAAC,CAAC;QACrC,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;YACf,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,EAAE,gBAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;IACD,EAAE,CAAC,CAAC,gBAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrB,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;IACD,MAAM,CAAC,QAAQ,CAAC;AACpB,CAAC;AAZD,wDAYC"}

View file

@ -1,23 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var immutable_1 = require("immutable");
var cli_options_1 = require("../cli-options");
function handleFilesOption(incoming) {
var value = incoming.get('files');
var namespaces = {
core: {
globs: [],
objs: []
}
};
var processed = cli_options_1.makeFilesArg(value);
if (processed.globs.length) {
namespaces.core.globs = processed.globs;
}
if (processed.objs.length) {
namespaces.core.objs = processed.objs;
}
return incoming.set('files', immutable_1.fromJS(namespaces));
}
exports.handleFilesOption = handleFilesOption;
//# sourceMappingURL=handleFilesOption.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"handleFilesOption.js","sourceRoot":"","sources":["../../../lib/cli/transforms/handleFilesOption.ts"],"names":[],"mappings":";;AAAA,uCAAiC;AACjC,8CAA4C;AAG5C,2BAAkC,QAAQ;IACtC,IAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpC,IAAM,UAAU,GAAoB;QAChC,IAAI,EAAE;YACF,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,EAAE;SACX;KACJ,CAAC;IAEF,IAAM,SAAS,GAAG,0BAAY,CAAC,KAAK,CAAC,CAAC;IAEtC,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QACzB,UAAU,CAAC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC;IAC5C,CAAC;IAED,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACxB,UAAU,CAAC,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,kBAAM,CAAC,UAAU,CAAC,CAAC,CAAC;AACrD,CAAC;AApBD,8CAoBC"}

View file

@ -1,53 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var immutable_1 = require("immutable");
function handleGhostModeOption(incoming) {
var value = incoming.get('ghostMode');
var trueAll = {
clicks: true,
scroll: true,
forms: {
submit: true,
inputs: true,
toggles: true
}
};
var falseAll = {
clicks: false,
scroll: false,
forms: {
submit: false,
inputs: false,
toggles: false
}
};
if (value === false ||
value === "false") {
return incoming.set('ghostMode', immutable_1.fromJS(falseAll));
}
if (value === true ||
value === "true") {
return incoming.set('ghostMode', immutable_1.fromJS(trueAll));
}
if (value.get("forms") === false) {
return incoming.set('ghostMode', value.withMutations(function (map) {
map.set("forms", immutable_1.fromJS({
submit: false,
inputs: false,
toggles: false
}));
}));
}
if (value.get("forms") === true) {
return incoming.set('ghostMode', value.withMutations(function (map) {
map.set("forms", immutable_1.fromJS({
submit: true,
inputs: true,
toggles: true
}));
}));
}
return incoming;
}
exports.handleGhostModeOption = handleGhostModeOption;
//# sourceMappingURL=handleGhostModeOption.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"handleGhostModeOption.js","sourceRoot":"","sources":["../../../lib/cli/transforms/handleGhostModeOption.ts"],"names":[],"mappings":";;AAAA,uCAAiC;AAEjC,+BAAsC,QAAQ;IAC1C,IAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACxC,IAAI,OAAO,GAAG;QACV,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE;YACH,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,IAAI;SAChB;KACJ,CAAC;IAEF,IAAI,QAAQ,GAAG;QACX,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,KAAK;QACb,KAAK,EAAE;YACH,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,KAAK;SACjB;KACJ,CAAC;IAEF,EAAE,CAAC,CACC,KAAK,KAAK,KAAK;QACf,KAAK,KAAK,OACd,CAAC,CAAC,CAAC;QACC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,kBAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,EAAE,CAAC,CACC,KAAK,KAAK,IAAI;QACd,KAAK,KAAK,MACd,CAAC,CAAC,CAAC;QACC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,kBAAM,CAAC,OAAO,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;QAC/B,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,GAAG;YAC9D,GAAG,CAAC,GAAG,CACH,OAAO,EACP,kBAAM,CAAC;gBACH,MAAM,EAAE,KAAK;gBACb,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE,KAAK;aACjB,CAAC,CACL,CAAC;QACN,CAAC,CAAC,CAAC,CAAC;IACR,CAAC;IAED,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;QAC9B,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,UAAU,GAAG;YAC9D,GAAG,CAAC,GAAG,CACH,OAAO,EACP,kBAAM,CAAC;gBACH,MAAM,EAAE,IAAI;gBACZ,MAAM,EAAE,IAAI;gBACZ,OAAO,EAAE,IAAI;aAChB,CAAC,CACL,CAAC;QACN,CAAC,CAAC,CAAC,CAAC;IACR,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC;AACpB,CAAC;AA/DD,sDA+DC"}

View file

@ -1,27 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var immutable_1 = require("immutable");
function handlePortsOption(incoming) {
var value = incoming.get('ports');
if (!value)
return incoming;
var obj = { min: null, max: null };
if (typeof value === "string") {
if (~value.indexOf(",")) {
var segs = value.split(",");
obj.min = parseInt(segs[0], 10);
obj.max = parseInt(segs[1], 10);
}
else {
obj.min = parseInt(value, 10);
obj.max = null;
}
}
else {
obj.min = value.get("min");
obj.max = value.get("max") || null;
}
return incoming.set('ports', immutable_1.Map(obj));
}
exports.handlePortsOption = handlePortsOption;
//# sourceMappingURL=handlePortsOption.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"handlePortsOption.js","sourceRoot":"","sources":["../../../lib/cli/transforms/handlePortsOption.ts"],"names":[],"mappings":";;AAAA,uCAA8B;AAG9B,2BAAkC,QAAQ;IACtC,IAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACpC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QAAC,MAAM,CAAC,QAAQ,CAAC;IAE5B,IAAM,GAAG,GAAgB,EAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAC,CAAC;IAEhD,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC;QAC5B,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACtB,IAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC9B,GAAG,CAAC,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAChC,GAAG,CAAC,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACpC,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,GAAG,CAAC,GAAG,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC9B,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC;QACnB,CAAC;IACL,CAAC;IAAC,IAAI,CAAC,CAAC;QACJ,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC3B,GAAG,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,eAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3C,CAAC;AArBD,8CAqBC"}

View file

@ -1,38 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var url = require("url");
var immutable_1 = require("immutable");
function handleProxyOption(incoming) {
var value = incoming.get('proxy');
var mw;
var target;
if (!value || value === true) {
return incoming;
}
if (typeof value !== "string") {
target = value.get("target");
mw = value.get("middleware");
}
else {
target = value;
value = immutable_1.Map({});
}
if (!target.match(/^(https?):\/\//)) {
target = "http://" + target;
}
var parsedUrl = url.parse(target);
if (!parsedUrl.port) {
parsedUrl.port = "80";
}
var out = {
target: parsedUrl.protocol + "//" + parsedUrl.host,
url: immutable_1.Map(parsedUrl)
};
if (mw) {
out.middleware = mw;
}
var proxyOutput = value.mergeDeep(out);
return incoming.set('proxy', proxyOutput);
}
exports.handleProxyOption = handleProxyOption;
//# sourceMappingURL=handleProxyOption.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"handleProxyOption.js","sourceRoot":"","sources":["../../../lib/cli/transforms/handleProxyOption.ts"],"names":[],"mappings":";;AAAA,yBAA2B;AAC3B,uCAA8B;AAG9B,2BAAkC,QAAQ;IACtC,IAAI,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,EAAE,CAAC;IACP,IAAI,MAAM,CAAC;IAEX,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC;QAC3B,MAAM,CAAC,QAAQ,CAAC;IACpB,CAAC;IAED,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC;QAC5B,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACjC,CAAC;IAAC,IAAI,CAAC,CAAC;QACJ,MAAM,GAAG,KAAK,CAAC;QACf,KAAK,GAAG,eAAG,CAAC,EAAE,CAAC,CAAC;IACpB,CAAC;IAED,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;QAClC,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;IAChC,CAAC;IAED,IAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAEpC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QAClB,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;IAC1B,CAAC;IAED,IAAM,GAAG,GAAqB;QAC1B,MAAM,EAAE,SAAS,CAAC,QAAQ,GAAG,IAAI,GAAG,SAAS,CAAC,IAAI;QAClD,GAAG,EAAE,eAAG,CAAC,SAAS,CAAC;KACtB,CAAC;IAEF,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACL,GAAG,CAAC,UAAU,GAAG,EAAE,CAAC;IACxB,CAAC;IAED,IAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAEzC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAC9C,CAAC;AAvCD,8CAuCC"}

View file

@ -1,39 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var immutable_1 = require("immutable");
function handleServerOption(incoming) {
var value = incoming.get('server');
if (value === false) {
return incoming;
}
// server: true
if (value === true) {
var obj = {
baseDir: ["./"]
};
return incoming.set('server', immutable_1.fromJS(obj));
}
// server: "./app"
if (typeof value === "string") {
var obj = {
baseDir: [value]
};
return incoming.set('server', immutable_1.fromJS(obj));
}
if (immutable_1.List.isList(value)) {
var obj = {
baseDir: value
};
return incoming.set('server', immutable_1.fromJS(obj));
}
if (immutable_1.Map.isMap(value)) {
var dirs = immutable_1.List([])
.concat(value.get("baseDir", "./"))
.filter(Boolean);
var merged = value.merge({ baseDir: dirs });
return incoming.set('server', merged);
}
return incoming;
}
exports.handleServerOption = handleServerOption;
//# sourceMappingURL=handleServerOption.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"handleServerOption.js","sourceRoot":"","sources":["../../../lib/cli/transforms/handleServerOption.ts"],"names":[],"mappings":";;AACA,uCAA4C;AAE5C,4BAAmC,QAAQ;IACvC,IAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,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C,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC;AACpB,CAAC;AAxCD,gDAwCC"}

View file

@ -1,106 +0,0 @@
"use strict";
var etag = require("etag");
var fresh = require("fresh");
var fs = require("fs");
var path = require("path");
var zlib = require("zlib");
var minifiedScript = path.join(__dirname, "..", "..", "/dist/index.min.js");
var unminifiedScript = path.join(__dirname, "..", "..", "/dist/index.js");
/**
* Does the current request support compressed encoding?
* @param {Object} req
* @returns {boolean}
*/
function supportsGzip(req) {
var accept = req.headers["accept-encoding"];
return accept && accept.indexOf("gzip") > -1;
}
/**
* Set headers on the response
* @param {Object} res
* @param {String} body
*/
function setHeaders(res, body) {
res.setHeader("Cache-Control", "public, max-age=0");
res.setHeader("Content-Type", "text/javascript");
res.setHeader("ETag", etag(body));
}
/**
* @param {Object} req
* @returns {String}
*/
function isConditionalGet(req) {
return req.headers["if-none-match"] || req.headers["if-modified-since"];
}
/**
* Return a not-modified response
* @param {Object} res
*/
function notModified(res) {
res.removeHeader("Content-Type");
res.statusCode = 304;
res.end();
}
/**
* Public method for returning either a middleware fn
* or the content as a string
* @param {Object} options
* @param requestBody
* @param {String} type - either `file` or `middleware`
* @returns {*}
*/
function init(options, requestBody, type) {
var gzipCached;
/**
* If the user asked for a file, simply return the string.
*/
if (type && type === "file") {
return requestBody;
}
/**
* Otherwise return a function to be used a middleware
*/
return function (req, res) {
/**
* default to using the uncompressed string
* @type {String}
*/
var output = requestBody;
/**
* Set the appropriate headers for caching
*/
setHeaders(res, output);
if (isConditionalGet(req) && fresh(req.headers, res._headers)) {
return notModified(res);
}
/**
* If gzip is supported, compress the string once
* and save for future requests
*/
if (supportsGzip(req)) {
res.setHeader("Content-Encoding", "gzip");
if (!gzipCached) {
var buf = new Buffer(output, "utf-8");
zlib.gzip(buf, function (_, result) {
gzipCached = result;
res.end(result);
});
}
else {
res.end(gzipCached);
}
}
else {
res.end(output);
}
};
}
module.exports.middleware = init;
module.exports.plugin = init;
module.exports.minified = function () {
return fs.readFileSync(minifiedScript, "utf8");
};
module.exports.unminified = function () {
return fs.readFileSync(unminifiedScript, "utf8");
};
//# sourceMappingURL=client.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"client.js","sourceRoot":"","sources":["../lib/client.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3B,IAAI,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7B,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3B,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE3B,IAAI,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,oBAAoB,CAAC,CAAC;AAC5E,IAAI,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC;AAE1E;;;;GAIG;AACH,sBAAsB,GAAG;IACrB,IAAI,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC5C,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,oBAAoB,GAAG,EAAE,IAAI;IACzB,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC;IACpD,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;IACjD,GAAG,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,0BAA0B,GAAG;IACzB,MAAM,CAAC,GAAG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AAC,MAAM,CAAC,CAAC;gBACpB,CAAC,CAAC,CAAC;YACP,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YACxB,CAAC;QACL,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACpB,CAAC;IACL,CAAC,CAAC;AACN,CAAC;AAED,MAAM,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;AACjC,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;AAC7B,MAAM,CAAC,OAAO,CAAC,QAAQ,GAAG;IACtB,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC,CAAC;AACF,MAAM,CAAC,OAAO,CAAC,UAAU,GAAG;IACxB,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC,CAAC"}

View file

@ -1,31 +0,0 @@
"use strict";
var path = require("path");
/**
* @type {{controlPanel: {jsFile: string, baseDir: *}, socketIoScript: string, configFile: string, client: {shims: string}}}
*/
module.exports = {
controlPanel: {
jsFile: "/js/app.js",
baseDir: path.join(__dirname, "control-panel")
},
templates: {
scriptTag: path.join(__dirname, "..", "templates/script-tags.tmpl"),
scriptTagSimple: path.join(__dirname, "..", "templates/script-tags-simple.tmpl"),
connector: path.join(__dirname, "..", "templates/connector.tmpl")
},
socketIoScript: "/public/socket.io.min.1.6.0.js",
configFile: "default-config.js",
userFile: "bs-config.js",
template: path.join(__dirname, "..", "templates/cli-template.js"),
httpProtocol: {
path: "/__browser_sync__"
},
client: {
shims: "/client/client-shims.js"
},
errors: {
"server+proxy": "Invalid config. You cannot specify both server & proxy options.",
"proxy+https": "Invalid config. You set https: true, but your proxy target doesn't reflect this."
}
};
//# sourceMappingURL=config.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"config.js","sourceRoot":"","sources":["../lib/config.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3B;;GAEG;AACH,MAAM,CAAC,OAAO,GAAG;IACb,YAAY,EAAE;QACV,MAAM,EAAE,YAAY;QACpB,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC;KACjD;IACD,SAAS,EAAE;QACP,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,4BAA4B,CAAC;QACnE,eAAe,EAAE,IAAI,CAAC,IAAI,CACtB,SAAS,EACT,IAAI,EACJ,mCAAmC,CACtC;QACD,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,0BAA0B,CAAC;KACpE;IACD,cAAc,EAAE,gCAAgC;IAChD,UAAU,EAAE,mBAAmB;IAC/B,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,2BAA2B,CAAC;IACjE,YAAY,EAAE;QACV,IAAI,EAAE,mBAAmB;KAC5B;IACD,MAAM,EAAE;QACJ,KAAK,EAAE,yBAAyB;KACnC;IACD,MAAM,EAAE;QACJ,cAAc,EACV,iEAAiE;QACrE,aAAa,EACT,kFAAkF;KACzF;CACJ,CAAC"}

View file

@ -1,213 +0,0 @@
"use strict";
var _ = require("./lodash.custom");
var fs = require("fs");
var config = require("./config");
function getPath(options, relative, port) {
if (options.get("mode") === "snippet") {
return options.get("scheme") + "://HOST:" + port + relative;
}
else {
return "//HOST:" + port + relative;
}
}
var connectUtils = {
/**
* @param {Immutable.Map} options
* @returns {String}
*/
scriptTags: function (options) {
var scriptPath = this.clientScript(options);
var async = options.getIn(["snippetOptions", "async"]);
var scriptDomain = options.getIn(["script", "domain"]);
/**
* Generate the [src] attribute based on user options
*/
var scriptSrc = (function () {
if (options.get("localOnly")) {
return [
options.get("scheme"),
"://localhost:",
options.get("port"),
scriptPath
].join("");
}
/**
* First, was "scriptPath" set? if so the user wanted full control over the
* script tag output
*
*/
if (_.isFunction(options.get("scriptPath"))) {
return options
.get("scriptPath")
.apply(null, getScriptArgs(options, scriptPath));
}
/**
* Next, if "script.domain" was given, allow that + the path to the JS file
* eg:
* script.domain=localhost:3000
* -> localhost:3000/browser-sync/browser-sync-client.js
*/
if (scriptDomain) {
if (_.isFunction(scriptDomain)) {
return scriptDomain.call(null, options) + scriptPath;
}
if (scriptDomain.match(/\{port\}/)) {
return (scriptDomain.replace("{port}", options.get("port")) +
scriptPath);
}
return scriptDomain + scriptPath;
}
/**
* Now if server or proxy, use dynamic script
* eg:
* browser-sync start --server
* ->
* "HOST:3000/browser-sync/browser-sync-client.js".replace("HOST", location.hostname)
*/
if (options.get("server") || options.get("proxy")) {
return scriptPath;
}
/**
* Final use case is snippet mode
* -> "http://HOST:3000/browser-sync/browser-sync-client.js".replace("HOST", location.hostname)
* -> "//HOST:3000/browser-sync/browser-sync-client.js".replace("HOST", location.hostname)"
*/
return getPath(options, scriptPath, options.get("port"));
})();
/**
* Decide which template shall be used to generate the script tags
*/
var template = (function () {
if (scriptDomain || options.get("localOnly")) {
return config.templates.scriptTagSimple;
}
return config.templates.scriptTag;
})();
/**
* Finally read the template file from disk and replace
* the dynamic values.
*/
return fs
.readFileSync(template, "utf8")
.replace("%script%", scriptSrc)
.replace("%async%", async ? "async" : "");
},
/**
* @param {Map} options
* @returns {String}
*/
socketConnector: function (options) {
var socket = options.get("socket");
var template = fs.readFileSync(config.templates.connector, "utf-8");
var url = connectUtils.getConnectionUrl(options);
/**
* ***Backwards compatibility***. While `socket.path` is technically a
* socketIoClientConfig property, it's been documented previously
* as a top-level option, so must stay.
*/
var clientConfig = socket.get("socketIoClientConfig").merge({
path: socket.get("path")
});
template = template
.replace("%config%", JSON.stringify(clientConfig.toJS()))
.replace("%url%", url);
return template;
},
/**
* @param {Object} socketOpts
* @param {Map} options
* @returns {String|Function}
*/
getNamespace: function (socketOpts, options) {
var namespace = socketOpts.namespace;
if (typeof namespace === "function") {
return namespace(options);
}
if (!namespace.match(/^\//)) {
namespace = "/" + namespace;
}
return namespace;
},
/**
* @param {Map} options
* @returns {string}
*/
getConnectionUrl: function (options) {
var socketOpts = options.get("socket").toJS();
var namespace = connectUtils.getNamespace(socketOpts, options);
var protocol = "";
var withHostnamePort = "'{protocol}' + location.hostname + ':{port}{ns}'";
var withHost = "'{protocol}' + location.host + '{ns}'";
var withDomain = "'{domain}{ns}'";
var port = options.get("port");
// default use-case is server/proxy
var string = withHost;
if (options.get("mode") !== "server") {
protocol = options.get("scheme") + "://";
string = withHostnamePort;
}
if (options.get("mode") === "proxy" && options.getIn(["proxy", "ws"])) {
port = options.getIn(["socket", "port"]);
}
/**
* Ensure socket.domain is always a string (for noop replacements later)
*/
socketOpts.domain = (function () {
if (options.get("localOnly")) {
string = withDomain;
return [
options.get("scheme"),
"://localhost:",
options.get("port")
].join("");
}
if (socketOpts.domain) {
string = withDomain;
/**
* User provided a function
*/
if (_.isFunction(socketOpts.domain)) {
return socketOpts.domain.call(null, options);
}
/**
* User provided a string
*/
if (_.isString(socketOpts.domain)) {
return socketOpts.domain;
}
}
return "";
})();
return string
.replace("{protocol}", protocol)
.replace("{port}", port)
.replace("{domain}", socketOpts.domain.replace("{port}", port))
.replace("{ns}", namespace);
},
/**
* @param {Object} [options]
* @param {Boolean} [both]
*/
clientScript: function (options, both) {
var prefix = options.getIn(["socket", "clientPath"]);
var script = prefix + "/browser-sync-client.js";
var versioned = prefix + "/browser-sync-client.js?v=" + options.get("version");
if (both) {
return {
path: script,
versioned: versioned
};
}
return versioned;
}
};
/**
* @param options
* @returns {*[]}
*/
function getScriptArgs(options, scriptPath) {
var abspath = options.get("scheme") + "://HOST:" + options.get("port") + scriptPath;
return [scriptPath, options.get("port"), options.set("absolute", abspath)];
}
module.exports = connectUtils;
//# sourceMappingURL=connect-utils.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,522 +0,0 @@
/**
* @module BrowserSync.options
*/
module.exports = {
/**
* @property cwd
* @type string
* @since 2.23.0
*/
/**
* Browsersync includes a user-interface that is accessed via a separate port.
* The UI allows to controls all devices, push sync updates and much more.
* @property ui
* @type Object
* @param {Number} [port=3001]
* @since 2.0.0
* @default false
*/
ui: {
port: 3001
},
/**
* Browsersync can watch your files as you work. Changes you make will either
* be injected into the page (CSS & images) or will cause all browsers to do
* a full-page refresh.
* @property files
* @type Array|String
* @default false
*/
files: false,
/**
* Specify which file events to respond to.
* Available events: `add`, `change`, `unlink`, `addDir`, `unlinkDir`
* @property watchEvents
* @type Array
* @default ["change"]
* @since 2.18.8
*/
watchEvents: ["change"],
/**
* Watch files automatically
* @property watch
* @type Boolean
* @default false
* @since 2.23.0
*/
watch: false,
/**
* Patterns for any watchers to ignore. Anything provided here
* will end up inside `watchOptions.ignored`
* @property ignore
* @type Array
* @default []
* @since 2.23.0
*/
ignore: [],
/**
* Serve an index.html file for all non-asset routes. Useful
* when using client-routers
* @property single
* @type Boolean
* @default false
* @since 2.23.0
*/
single: false,
/**
* File watching options that get passed along to [Chokidar](https://github.com/paulmillr/chokidar).
* Check their docs for available options
* @property watchOptions
* @type Object
* @default undefined
* @since 2.6.0
*/
watchOptions: {
ignoreInitial: true
/*
persistent: true,
ignored: '*.txt',
followSymlinks: true,
cwd: '.',
usePolling: true,
alwaysStat: false,
depth: undefined,
interval: 100,
ignorePermissionErrors: false,
atomic: true
*/
},
/**
* Use the built-in static server for basic HTML/JS/CSS websites.
* @property server
* @type Object|Boolean
* @default false
*/
server: false,
/**
* Proxy an EXISTING vhost. Browsersync will wrap your vhost with a proxy URL to view your site.
* @property proxy
* @type String|Object|Boolean
* @param {String} [target]
* @param {Boolean} [ws] - Enable websocket proxying
* @param {Function|Array} [middleware]
* @param {Function} [reqHeaders]
* @param {Array} [proxyReq]
* @param {Array} [proxyRes]
* @default false
*/
proxy: false,
/**
* @property port
* @type Number
* @default 3000
*/
port: 3000,
/**
* @property middleware
* @type Function|Array
* @default false
*/
middleware: false,
/**
* Add additional directories from which static
* files should be served. Should only be used in `proxy` or `snippet`
* mode.
* @property serveStatic
* @type Array
* @default []
* @since 2.8.0
*/
serveStatic: [],
/**
* Options that are passed to the serve-static middleware
* when you use the string[] syntax: eg: `serveStatic: ['./app']`. Please see
* [serve-static](https://github.com/expressjs/serve-static) for details
*
* @property serveStaticOptions
* @type Object
* @since 2.17.0
*/
/**
* Enable https for localhost development. **Note** - this is not needed for proxy
* option as it will be inferred from your target url.
* @property https
* @type Boolean
* @default undefined
* @since 1.3.0
*/
/**
* Override http module to allow using 3rd party server modules (such as http2)
* @property httpModule
* @type string
* @default undefined
* @since 2.18.0
*/
/**
* Clicks, Scrolls & Form inputs on any device will be mirrored to all others.
* @property ghostMode
* @param {Boolean} [clicks=true]
* @param {Boolean} [scroll=true]
* @param {Boolean} [location=true]
* @param {Boolean} [forms=true]
* @param {Boolean} [forms.submit=true]
* @param {Boolean} [forms.inputs=true]
* @param {Boolean} [forms.toggles=true]
* @type Object
*/
ghostMode: {
clicks: true,
scroll: true,
location: true,
forms: {
submit: true,
inputs: true,
toggles: true
}
},
/**
* Can be either "info", "debug", "warn", or "silent"
* @property logLevel
* @type String
* @default info
*/
logLevel: "info",
/**
* Change the console logging prefix. Useful if you're creating your
* own project based on Browsersync
* @property logPrefix
* @type String
* @default Browsersync
* @since 1.5.1
*/
logPrefix: "Browsersync",
/**
* @property logConnections
* @type Boolean
* @default false
*/
logConnections: false,
/**
* @property logFileChanges
* @type Boolean
* @default true
*/
logFileChanges: true,
/**
* Log the snippet to the console when you're in snippet mode (no proxy/server)
* @property logSnippet
* @type: Boolean
* @default true
* @since 1.5.2
*/
logSnippet: true,
/**
* You can control how the snippet is injected
* onto each page via a custom regex + function.
* You can also provide patterns for certain urls
* that should be ignored from the snippet injection.
* @property snippetOptions
* @since 2.0.0
* @param {Boolean} [async] - should the script tags have the async attribute?
* @param {Array} [blacklist]
* @param {Array} [whitelist]
* @param {RegExp} [rule.match=/$/]
* @param {Function} [rule.fn=Function]
* @type Object
*/
snippetOptions: {
async: true,
whitelist: [],
blacklist: [],
rule: {
match: /<body[^>]*>/i,
fn: function (snippet, match) {
return match + snippet;
}
}
},
/**
* Add additional HTML rewriting rules.
* @property rewriteRules
* @since 2.4.0
* @type Array
* @default false
*/
rewriteRules: [],
/**
* @property tunnel
* @type String|Boolean
* @default null
*/
/**
* Some features of Browsersync (such as `xip` & `tunnel`) require an internet connection, but if you're
* working offline, you can reduce start-up time by setting this option to `false`
* @property online
* @type Boolean
* @default undefined
*/
/**
* Decide which URL to open automatically when Browsersync starts. Defaults to "local" if none set.
* Can be `true`, `local`, `external`, `ui`, `ui-external`, `tunnel` or `false`
* @property open
* @type Boolean|String
* @default true
*/
open: "local",
/**
* @property browser
* @type String|Array
* @default default
*/
browser: "default",
/**
* Add HTTP access control (CORS) headers to assets served by Browsersync.
* @property cors
* @type boolean
* @default false
* @since 2.16.0
*/
cors: false,
/**
* Requires an internet connection - useful for services such as [Typekit](https://typekit.com/)
* as it allows you to configure domains such as `*.xip.io` in your kit settings
* @property xip
* @type Boolean
* @default false
*/
xip: false,
hostnameSuffix: false,
/**
* Reload each browser when Browsersync is restarted.
* @property reloadOnRestart
* @type Boolean
* @default false
*/
reloadOnRestart: false,
/**
* The small pop-over notifications in the browser are not always needed/wanted.
* @property notify
* @type Boolean
* @default true
*/
notify: true,
/**
* @property scrollProportionally
* @type Boolean
* @default true
*/
scrollProportionally: true,
/**
* @property scrollThrottle
* @type Number
* @default 0
*/
scrollThrottle: 0,
/**
* Decide which technique should be used to restore
* scroll position following a reload.
* Can be `window.name` or `cookie`
* @property scrollRestoreTechnique
* @type String
* @default 'window.name'
*/
scrollRestoreTechnique: "window.name",
/**
* Sync the scroll position of any element
* on the page. Add any amount of CSS selectors
* @property scrollElements
* @type Array
* @default []
* @since 2.9.0
*/
scrollElements: [],
/**
* Sync the scroll position of any element
* on the page - where any scrolled element
* will cause all others to match scroll position.
* This is helpful when a breakpoint alters which element
* is actually scrolling
* @property scrollElementMapping
* @type Array
* @default []
* @since 2.9.0
*/
scrollElementMapping: [],
/**
* Time, in milliseconds, to wait before
* instructing the browser to reload/inject following a
* file change event
* @property reloadDelay
* @type Number
* @default 0
*/
reloadDelay: 0,
/**
* Wait for a specified window of event-silence before
* sending any reload events.
* @property reloadDebounce
* @type Number
* @default 0
* @since 2.6.0
*/
reloadDebounce: 500,
/**
* Emit only the first event during sequential time windows
* of a specified duration.
* @property reloadThrottle
* @type Number
* @default 0
* @since 2.13.0
*/
reloadThrottle: 0,
/**
* User provided plugins
* @property plugins
* @type Array
* @default []
* @since 2.6.0
*/
plugins: [],
/**
* @property injectChanges
* @type Boolean
* @default true
*/
injectChanges: true,
/**
* @property startPath
* @type String|Null
* @default null
*/
startPath: null,
/**
* Whether to minify client script, or not.
* @property minify
* @type Boolean
* @default true
*/
minify: true,
/**
* @property host
* @type String
* @default null
*/
host: null,
/**
* Support environments where dynamic hostnames are not required
* (ie: electron)
* @property localOnly
* @type Boolean
* @default false
* @since 2.14.0
*/
localOnly: false,
/**
* @property codeSync
* @type Boolean
* @default true
*/
codeSync: true,
/**
* @property timestamps
* @type Boolean
* @default true
*/
timestamps: true,
clientEvents: [
"scroll",
"scroll:element",
"input:text",
"input:toggles",
"form:submit",
"form:reset",
"click"
],
/**
* Alter the script path for complete control over where the Browsersync
* Javascript is served from. Whatever you return from this function
* will be used as the script path.
* @property scriptPath
* @default undefined
* @since 1.5.0
* @type Function
*/
/**
* Configure the Socket.IO path and namespace & domain to avoid collisions.
* @property socket
* @param {String} [path="/browser-sync/socket.io"]
* @param {String} [clientPath="/browser-sync"]
* @param {String|Function} [namespace="/browser-sync"]
* @param {String|Function} [domain=undefined]
* @param {String|Function} [port=undefined]
* @param {Object} [clients.heartbeatTimeout=5000]
* @since 1.6.2
* @type Object
*/
socket: {
socketIoOptions: {
log: false
},
socketIoClientConfig: {
reconnectionAttempts: 50
},
path: "/browser-sync/socket.io",
clientPath: "/browser-sync",
namespace: "/browser-sync",
clients: {
heartbeatTimeout: 5000
}
},
/**
* Configure the script domain
* @property script
* @param {String|Function} [domain=undefined]
* @since 2.14.0
* @type Object
*/
tagNames: {
less: "link",
scss: "link",
css: "link",
jpg: "img",
jpeg: "img",
png: "img",
svg: "img",
gif: "img",
js: "script"
},
injectFileTypes: ["css", "png", "jpg", "jpeg", "svg", "gif", "webp", "map"],
excludedFileTypes: [
"js",
"css",
"pdf",
"map",
"svg",
"ico",
"woff",
"json",
"eot",
"ttf",
"png",
"jpg",
"jpeg",
"webp",
"gif",
"mp4",
"mp3",
"3gp",
"ogg",
"ogv",
"webm",
"m4a",
"flv",
"wmv",
"avi",
"swf",
"scss"
]
};
//# sourceMappingURL=default-config.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"default-config.js","sourceRoot":"","sources":["../lib/default-config.js"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,GAAG;IAEb;;;;OAIG;IAEH;;;;;;;;OAQG;IACH,EAAE,EAAE;QACA,IAAI,EAAE,IAAI;KACb;IAED;;;;;;;OAOG;IACH,KAAK,EAAE,KAAK;IAEZ;;;;;;;OAOG;IACH,WAAW,EAAE,CAAC,QAAQ,CAAC;IAEvB;;;;;;OAMG;IACH,KAAK,EAAE,KAAK;IAEZ;;;;;;;OAOG;IACH,MAAM,EAAE,EAAE;IAEV;;;;;;;OAOG;IACH,MAAM,EAAE,KAAK;IAEb;;;;;;;OAOG;IACH,YAAY,EAAE;QACV,aAAa,EAAE,IAAI;QACnB;;;;;;;;;;;;;;WAcG;KACN;IAED;;;;;OAKG;IACH,MAAM,EAAE,KAAK;IAEb;;;;;;;;;;;OAWG;IACH,KAAK,EAAE,KAAK;IAEZ;;;;OAIG;IACH,IAAI,EAAE,IAAI;IAEV;;;;OAIG;IACH,UAAU,EAAE,KAAK;IAEjB;;;;;;;;OAQG;IACH,WAAW,EAAE,E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AAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;IAC3E,iBAAiB,EAAE;QACf,IAAI;QACJ,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,MAAM;QACN,MAAM;QACN,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,MAAM;QACN,MAAM;QACN,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,MAAM;QACN,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,MAAM;KACT;CACJ,CAAC"}

View file

@ -1,91 +0,0 @@
var utils = require("./utils");
/**
* Apply the operators that apply to the 'file:changed' event
* @param {Rx.Observable} subject
* @param options
* @return {Rx.Observable<{type: string, files: Array<any>}>}
*/
function fileChanges(subject, options) {
var operators = [
{
option: "reloadThrottle",
fnName: "throttle"
},
{
option: "reloadDelay",
fnName: "delay"
}
];
var scheduler = options.getIn(["debug", "scheduler"]);
/**
* Create a stream buffered/debounced stream of events
*/
var initial = getAggregatedDebouncedStream(subject, options, scheduler);
return applyOperators(operators, initial, options, scheduler)
.map(function (items) {
var paths = items.map(function (x) { return x.path; });
if (utils.willCauseReload(paths, options.get("injectFileTypes").toJS())) {
return {
type: "reload",
files: items
};
}
return {
type: "inject",
files: items
};
});
}
module.exports.fileChanges = fileChanges;
/**
* Apply the operators that apply to the 'browser:reload' event
* @param {Rx.Observable} subject
* @param options
* @returns {Rx.Observable}
*/
function applyReloadOperators(subject, options) {
var operators = [
{
option: "reloadDebounce",
fnName: "debounce"
},
{
option: "reloadThrottle",
fnName: "throttle"
},
{
option: "reloadDelay",
fnName: "delay"
}
];
return applyOperators(operators, subject, options, options.getIn(["debug", "scheduler"]));
}
module.exports.applyReloadOperators = applyReloadOperators;
/**
* @param items
* @param subject
* @param options
* @param scheduler
*/
function applyOperators(items, subject, options, scheduler) {
return items.reduce(function (subject, item) {
var value = options.get(item.option);
if (value > 0) {
return subject[item.fnName].call(subject, value, scheduler);
}
return subject;
}, subject);
}
/**
* @param subject
* @param options
* @param scheduler
*/
function getAggregatedDebouncedStream(subject, options, scheduler) {
return subject
.filter(function (x) {
return options.get("watchEvents").indexOf(x.event) > -1;
})
.buffer(subject.debounce(options.get("reloadDebounce"), scheduler));
}
//# sourceMappingURL=file-event-handler.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"file-event-handler.js","sourceRoot":"","sources":["../lib/file-event-handler.js"],"names":[],"mappings":"AAAA,IAAI,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAE/B;;;;;GAKG;AACH,qBAAqB,OAAO,EAAE,OAAO;IACjC,IAAM,SAAS,GAAG;QACd;YACI,MAAM,EAAE,gBAAgB;YACxB,MAAM,EAAE,UAAU;SACrB;QACD;YACI,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE,OAAO;SAClB;KACJ,CAAC;IAEF,IAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;IAExD;;OAEG;IACH,IAAM,OAAO,GAAG,4BAA4B,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAE1E,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC;SACxD,GAAG,CAAC,UAAS,KAAK;QACf,IAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,IAAI,EAAN,CAAM,CAAC,CAAC;QAErC,EAAE,CAAC,CACC,KAAK,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,IAAI,EAAE,CACtE,CAAC,CAAC,CAAC;YACC,MAAM,CAAC;gBACH,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,KAAK;aACf,CAAC;QACN,CAAC;QACD,MAAM,CAAC;YACH,IAAI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CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE,SAAS,CAAC,CAAC,CAAA;AAC3E,CAAC"}

View file

@ -1,56 +0,0 @@
"use strict";
var _ = require("./lodash.custom");
var fileUtils = {
/**
* React to file-change events that occur on "core" namespace only
* @param bs
* @param data
*/
changedFile: function (bs, data) {
/**
* If the event property is undefined, infer that it's a 'change'
* event due the fact this handler is for emitter.emit("file:changed")
*/
if (_.isUndefined(data.event)) {
data.event = "change";
}
/**
* Chokidar always sends an 'event' property - which could be
* `add` `unlink` etc etc so we need to check for that and only
* respond to 'change', for now.
*/
if (bs.options.get("watchEvents").indexOf(data.event) > -1) {
if (!bs.paused && data.namespace === "core") {
bs.events.emit("file:reload", fileUtils.getFileInfo(data, bs.options));
}
}
},
/**
* @param data
* @param options
* @returns {{assetFileName: *, fileExtension: String}}
*/
getFileInfo: function (data, options) {
data.ext = require("path")
.extname(data.path)
.slice(1);
data.basename = require("path").basename(data.path);
var obj = {
ext: data.ext,
path: data.path,
basename: data.basename,
event: data.event,
type: "inject"
};
// RELOAD page
if (!_.includes(options.get("injectFileTypes").toJS(), obj.ext)) {
obj.url = obj.path;
obj.type = "reload";
}
obj.path = data.path;
obj.log = data.log;
return obj;
}
};
module.exports = fileUtils;
//# sourceMappingURL=file-utils.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"file-utils.js","sourceRoot":"","sources":["../lib/file-utils.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,IAAI,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEnC,IAAI,SAAS,GAAG;IACZ;;;;OAIG;IACH,WAAW,EAAE,UAAS,EAAE,EAAE,IAAI;QAC1B;;;WAGG;QACH,EAAE,CAAC,CAAC,CAAC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,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC;YACnB,GAAG,CAAC,IAAI,GAAG,QAAQ,CAAC;QACxB,CAAC;QAED,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QAEnB,MAAM,CAAC,GAAG,CAAC;IACf,CAAC;CACJ,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC"}

View file

@ -1,73 +0,0 @@
"use strict";
var _ = require("./lodash.custom");
var utils = require("./utils");
var Rx = require("rx");
/**
* Plugin interface
* @returns {*|function(this:exports)}
*/
module.exports.plugin = function (bs) {
var options = bs.options;
var emitter = bs.emitter;
var defaultWatchOptions = options.get("watchOptions").toJS();
return options.get("files").reduce(function (map, glob, namespace) {
/**
* Default CB when not given
* @param event
* @param path
*/
var fn = function (event, path) {
emitter.emit("file:changed", {
event: event,
path: path,
namespace: namespace
});
};
var jsItem = glob.toJS();
if (jsItem.globs.length) {
var watcher = watch(jsItem.globs, defaultWatchOptions, fn);
map[namespace] = {
watchers: [watcher]
};
}
if (jsItem.objs.length) {
jsItem.objs.forEach(function (item) {
if (!_.isFunction(item.fn)) {
item.fn = fn;
}
var watcher = watch(item.match, item.options || defaultWatchOptions, item.fn.bind(bs.publicInstance));
if (!map[namespace]) {
map[namespace] = {
watchers: [watcher]
};
}
else {
map[namespace].watchers.push(watcher);
}
});
}
return map;
}, {});
};
/**
* @param patterns
* @param opts
* @param cb
* @returns {*}
*/
function watch(patterns, opts, cb) {
if (typeof opts === "function") {
cb = opts;
opts = {};
}
var watcher = require("chokidar").watch(patterns, opts);
if (_.isFunction(cb)) {
watcher.on("all", cb);
}
// watcher.on('ready', () => {
// console.log(watcher.getWatched());
// });
return watcher;
}
module.exports.watch = watch;
//# sourceMappingURL=file-watcher.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"file-watcher.js","sourceRoot":"","sources":["../lib/file-watcher.js"],"names":[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B,CAAC;AAED,MAAM,CAAC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC"}

View file

@ -1,81 +0,0 @@
"use strict";
var _ = require("./lodash.custom");
var Immutable = require("immutable");
var snippetUtils = require("./snippet").utils;
module.exports = {
/**
*
* @this {BrowserSync}
* @returns {String}
*/
"client:js": function (hooks, data) {
var js = snippetUtils.getClientJs(data.port, data.options);
return hooks.reduce(function (joined, hook) {
return joined + hook;
}, js);
},
/**
* @this {BrowserSync}
* @returns {Array}
*/
"client:events": function (hooks, clientEvents) {
hooks.forEach(function (hook) {
var result = hook(this);
if (Array.isArray(result)) {
clientEvents = _.union(clientEvents, result);
}
else {
clientEvents.push(result);
}
}, this);
return clientEvents;
},
/**
* @returns {Array}
*/
"server:middleware": function (hooks, initial) {
initial = initial || [];
_.each(hooks, function (hook) {
var result = hook(this);
if (Array.isArray(result)) {
result.forEach(function (res) {
if (_.isFunction(res)) {
initial = initial.push(res);
}
});
}
else {
if (_.isFunction(result)) {
initial = initial.push(result);
}
}
}, this);
return initial;
},
/**
* @param {Array} hooks
* @param {Map|List} initial
* @param pluginOptions
* @returns {any}
*/
"files:watch": function (hooks, initial, pluginOptions) {
var opts;
if (pluginOptions) {
opts = Immutable.fromJS(pluginOptions);
opts.forEach(function (value, key) {
if (!value) {
return;
}
var files = value.get("files");
if (files) {
var fileArg = require("./cli/cli-options").makeFilesArg(files);
if (fileArg) {
initial = initial.set(key, Immutable.fromJS(fileArg));
}
}
});
}
return initial;
}
};
//# sourceMappingURL=hooks.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../lib/hooks.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,IAAI,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACnC,IAAI,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACrC,IAAI,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;AAE9C,MAA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"notify", "pause", "resume"];
/**
* Does the requested method expect an instance of BrowserSync
* or raw access to the emitter?
* @param method
* @returns {boolean}
*/
function methodRequiresInstance(method) {
return instanceMethods.indexOf(method) > -1;
}
/**
* Use BrowserSync options + querystring to create a
* full HTTP/HTTTPS url.
*
* Eg. http://localhost:3000/__browser_sync__?method=reload
* Eg. http://localhost:3000/__browser_sync__?method=reload&args=core.css
* Eg. http://localhost:3000/__browser_sync__?method=reload&args=core.css&args=core.min
*
* @param args
* @param url
* @returns {string}
*/
proto.getUrl = function (args, url) {
return [
url,
require("./config").httpProtocol.path,
"?",
queryString.stringify(args)
].join("");
};
/**
* Return a middleware for handling the requests
* @param {BrowserSync} bs
* @returns {Function}
*/
proto.middleware = function (bs) {
return function (req, res) {
var params = queryString.parse(req.url.replace(/^.*\?/, ""));
var output;
if (!Object.keys(params).length) {
output = [
"Error: No Parameters were provided.",
"Example: http://localhost:3000/__browser_sync__?method=reload&args=core.css"
];
res.writeHead(500, { "Content-Type": "text/plain" });
res.end(output.join("\n"));
return;
}
try {
var bsOrEmitter = methodRequiresInstance(params.method)
? bs
: bs.events;
require("./public/" + params.method)(bsOrEmitter).apply(null, [
params.args
]);
output = [
"Called public API method `.%s()`".replace("%s", params.method),
"With args: " + JSON.stringify(params.args)
];
res.end(output.join("\n"));
}
catch (e) {
res.writeHead(404, { "Content-Type": "text/plain" });
res.write("Public API method `" + params.method + "` not found.");
res.end();
return;
}
};
};
//# sourceMappingURL=http-protocol.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"http-protocol.js","sourceRoot":"","sources":["../lib/http-protocol.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,IAAI,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAChC,IAAI,KAAK,GAAG,OAAO,CAAC;AACpB,IAAI,eAAe,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAE5D;;;;;GAKG;AACH,gCAAgC,MAA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AI;aACd,CAAC,CAAC;YAEH,MAAM,GAAG;gBACL,kCAAkC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC;gBAC/D,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;aAC9C,CAAC;YAEF,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/B,CAAC;QAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACT,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,CAAC;YACrD,GAAG,CAAC,KAAK,CAAC,qBAAqB,GAAG,MAAM,CAAC,MAAM,GAAG,cAAc,CAAC,CAAC;YAClE,GAAG,CAAC,GAAG,EAAE,CAAC;YAEV,MAAM,CAAC;QACX,CAAC;IACL,CAAC,CAAC;AACN,CAAC,CAAC"}

View file

@ -1,348 +0,0 @@
#! /usr/bin/env node
"use strict";
/**
* @module BrowserSync
*/
var pjson = require("../package.json");
var BrowserSync = require("./browser-sync");
var publicUtils = require("./public/public-utils");
var events = require("events");
var PassThrough = require("stream").PassThrough;
var logger = require("eazy-logger").Logger({
useLevelPrefixes: true
});
var singleton = false;
var singletonPlugins = [];
var instances = [];
/**
* @type {boolean|EventEmitter}
*/
var singletonEmitter = false;
module.exports = initSingleton;
/**
* Create a Browsersync instance
* @method create
* @param {String} name an identifier that can used for retrieval later
*/
/**
* Get a single instance by name. This is useful if you have your
* build scripts in separate files
* @method get
* @param {String} name
* @returns {Object|Boolean}
*/
module.exports.get = function (name) {
var instance = getSingle(name);
if (instance) {
return instance;
}
throw new Error("An instance with the name `%s` was not found.".replace("%s", name));
};
/**
* Check if an instance has been created.
* @method has
* @param {String} name
* @returns {Boolean}
*/
module.exports.has = function (name) {
var instance = getSingle(name);
if (instance) {
return true;
}
return false;
};
/**
* Start the Browsersync service. This will launch a server, proxy or start the snippet
* mode depending on your use-case.
* @method init
* @param {Object} [config] This is the main configuration for your Browsersync instance and can contain any of the [available options]({{site.links.options}})
* If you do not pass a config an argument for configuration, Browsersync will still run; but it will be in the `snippet` mode
* @param {Function} [cb] If you pass a callback function, it will be called when Browsersync has completed all setup tasks and is ready to use. This
* is useful when you need to wait for information (for example: urls, port etc) or perform other tasks synchronously.
* @returns {BrowserSync}
*/
module.exports.init = initSingleton;
/**
* Register a plugin. Must implement at least a 'plugin' method that returns a
* callable function.
*
* @method use
* @param {String} name The name of the plugin
* @param {Object} module The object to be `required`.
* @param {Function} [cb] A callback function that will return any errors.
*/
module.exports.use = function () {
var args = Array.prototype.slice.call(arguments);
singletonPlugins.push({
args: args
});
};
/**
* The `reload` method will inform all browsers about changed files and will either cause the browser to refresh, or inject the files where possible.
*
* @method reload
* @param {String|Array|Object} [arg] The file or files to be reloaded.
* @returns {*}
*/
module.exports.reload = noop("reload");
/**
* The `stream` method returns a transform stream and can act once or on many files.
*
* @method stream
* @param {Object} [opts] Configuration for the stream method
* @param {Object} [opts.match] Resulting files to reload. The path is from the
* root of the site (not the root of your project). You can use '**' to recurse
* directories.
* @param {Object} [opts.once] Only reload on the first changed file in teh stream.
* @since 2.6.0
* @returns {*}
*/
module.exports.stream = noop("stream");
/**
* Helper method for browser notifications
*
* @method notify
* @param {String|HTML} msg Can be a simple message such as 'Connected' or HTML
* @param {Number} [timeout] How long the message will remain in the browser. @since 1.3.0
*/
module.exports.notify = noop("notify");
/**
* This method will close any running server, stop file watching & exit the current process.
*
* @method exit
*/
module.exports.exit = noop("exit");
/**
* Stand alone file-watcher. Use this along with Browsersync to create your own, minimal build system
* @method watch
* @param {string} patterns Glob patterns for files to watch
* @param {object} [opts] Options to be passed to Chokidar - check what's available in [their docs](https://github.com/paulmillr/chokidar#getting-started)
* @param {function} [fn] Callback function for each event.
* @since 2.6.0
*/
module.exports.watch = noop("watch");
/**
* Method to pause file change events
*
* @method pause
*/
module.exports.pause = noop("pause");
/**
* Method to resume paused watchers
*
* @method resume
*/
module.exports.resume = noop("resume");
/**
* Add properties fo
*/
Object.defineProperties(module.exports, {
/**
* The internal Event Emitter used by the running Browsersync instance (if there is one).
* You can use this to emit your own events, such as changed files, logging etc.
*
* @property emitter
*/
emitter: {
get: function () {
if (!singletonEmitter) {
singletonEmitter = newEmitter();
return singletonEmitter;
}
return singletonEmitter;
}
},
/**
* A simple true/false flag that you can use to determine if there's a currently-running Browsersync instance.
*
* @property active
*/
active: {
get: getSingletonValue.bind(null, "active")
},
/**
* A simple true/false flag to determine if the current instance is paused
*
* @property paused
*/
paused: {
get: getSingletonValue.bind(null, "paused")
}
});
/**
* Event emitter factory
* @returns {EventEmitter}
*/
function newEmitter() {
var emitter = new events.EventEmitter();
emitter.setMaxListeners(20);
return emitter;
}
/**
* Get the singleton's emitter, or a new one.
* @returns {EventEmitter}
*/
function getSingletonEmitter() {
if (singletonEmitter) {
return singletonEmitter;
}
singletonEmitter = newEmitter();
return singletonEmitter;
}
/**
* Helper to allow methods to be called on the module export
* before there's a running instance
* @param {String} name
* @returns {Function}
*/
function noop(name) {
return function () {
var args = Array.prototype.slice.call(arguments);
if (singleton) {
return singleton[name].apply(singleton, args);
}
else {
if (publicUtils.isStreamArg(name, args)) {
return new PassThrough({ objectMode: true });
}
}
};
}
/**
* Create a single instance when module export is used directly via browserSync({});
* This is mostly for back-compatibility, for also for the nicer api.
* This will never be removed to ensure we never break user-land, but
* we should discourage it's use.
* @returns {*}
*/
function initSingleton() {
var instance;
if (instances.length) {
instance = instances.filter(function (item) {
return item.name === "singleton";
});
if (instance.length) {
logger.error("{yellow:You tried to start Browsersync twice!} To create multiple instances, use {cyan:browserSync.create().init()");
return instance;
}
}
var args = Array.prototype.slice.call(arguments);
singleton = create("singleton", getSingletonEmitter());
if (singletonPlugins.length) {
singletonPlugins.forEach(function (obj) {
singleton.instance.registerPlugin.apply(singleton.instance, obj.args);
});
}
singleton.init.apply(null, args);
return singleton;
}
/**
* @param {String} prop
* @returns {Object|Boolean}
*/
function getSingletonValue(prop) {
var single = getSingle("singleton");
if (single) {
return single[prop];
}
return false;
}
/**
* Get a single instance by name
* @param {String} name
* @returns {Object|Boolean}
*/
function getSingle(name) {
if (instances.length) {
var match = instances.filter(function (item) {
return item.name === name;
});
if (match.length) {
return match[0];
}
}
return false;
}
/**
* Create an instance of Browsersync
* @param {String} [name]
* @param {EventEmitter} [emitter]
* @returns {{init: *, exit: (exit|exports), notify: *, reload: *, cleanup: *, emitter: (Browsersync.events|*), use: *}}
*/
/**
* Reset the state of the module.
* (should only be needed for test environments)
*/
module.exports.reset = function () {
instances.forEach(function (item) {
item.cleanup();
});
instances = [];
singletonPlugins = [];
singletonEmitter = false;
singleton = false;
};
/**
* @type {Array}
*/
module.exports.instances = instances;
/**
* Create an instance of Browsersync
* @param {String} [name]
* @param {EventEmitter} [emitter]
* @returns {{init: *, exit: (exit|exports), notify: *, reload: *, cleanup: *, emitter: (Browsersync.events|*), use: *}}
*/
module.exports.create = create;
function create(name, emitter) {
name = name || new Date().getTime();
emitter = emitter || newEmitter();
var browserSync = new BrowserSync(emitter);
var instance = {
name: name,
instance: browserSync,
exit: require("./public/exit")(browserSync),
notify: require("./public/notify")(browserSync),
pause: require("./public/pause")(browserSync),
resume: require("./public/resume")(browserSync),
reload: require("./public/reload")(emitter),
stream: require("./public/stream")(emitter),
cleanup: browserSync.cleanup.bind(browserSync),
use: browserSync.registerPlugin.bind(browserSync),
getOption: browserSync.getOption.bind(browserSync),
emitter: browserSync.events,
watch: require("./file-watcher").watch
};
browserSync.publicInstance = instance;
instance.init = require("./public/init")(browserSync, name, pjson);
Object.defineProperty(instance, "active", {
get: function () {
return browserSync.active;
}
});
Object.defineProperty(instance, "paused", {
get: function () {
return browserSync.paused;
}
});
/**
* Access to client-side socket for emitting events
*
* @property sockets
*/
Object.defineProperty(instance, "sockets", {
get: function () {
if (!browserSync.active) {
return {
emit: function () { },
on: function () { }
};
}
else {
return browserSync.io.sockets;
}
}
});
instances.push(instance);
return instance;
}
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,110 +0,0 @@
"use strict";
var utils = require("./utils");
var fileUtils = require("./file-utils");
var Rx = require("rx");
var fromEvent = Rx.Observable.fromEvent;
var fileHandler = require("./file-event-handler");
module.exports = function (bs) {
var events = {
/**
* File reloads
* @param data
*/
"file:reload": function (data) {
bs.io.sockets.emit("file:reload", data);
},
/**
* Browser Reloads
*/
"browser:reload": function () {
bs.io.sockets.emit("browser:reload");
},
/**
* Browser Notify
* @param data
*/
"browser:notify": function (data) {
bs.io.sockets.emit("browser:notify", data);
},
/**
* Things that happened after the service is running
* @param data
*/
"service:running": function (data) {
var mode = bs.options.get("mode");
var open = bs.options.get("open");
if (mode === "proxy" ||
mode === "server" ||
open === "ui" ||
open === "ui-external") {
utils.openBrowser(data.url, bs.options, bs);
}
// log about any file watching
if (bs.watchers) {
bs.events.emit("file:watching", bs.watchers);
}
},
/**
* Option setting
* @param data
*/
"options:set": function (data) {
if (bs.io) {
bs.io.sockets.emit("options:set", data);
}
},
/**
* Plugin configuration setting
* @param data
*/
"plugins:configure": function (data) {
if (data.active) {
bs.pluginManager.enablePlugin(data.name);
}
else {
bs.pluginManager.disablePlugin(data.name);
}
bs.setOption("userPlugins", bs.getUserPlugins());
},
"plugins:opts": function (data) {
if (bs.pluginManager.pluginOptions[data.name]) {
bs.pluginManager.pluginOptions[data.name] = data.opts;
bs.setOption("userPlugins", bs.getUserPlugins());
}
}
};
Object.keys(events).forEach(function (event) {
bs.events.on(event, events[event]);
});
var reloader = fileHandler
.applyReloadOperators(fromEvent(bs.events, "_browser:reload"), bs.options)
.subscribe(function () {
bs.events.emit("browser:reload");
});
var coreNamespacedWatchers = fromEvent(bs.events, "file:changed")
.filter(function () {
return bs.options.get("codeSync");
})
.filter(function (x) {
return x.namespace === "core";
});
var handler = fileHandler
.fileChanges(coreNamespacedWatchers, bs.options)
.subscribe(function (x) {
if (x.type === "reload") {
bs.events.emit("browser:reload", x);
}
if (x.type === "inject") {
x.files.forEach(function (data) {
if (!bs.paused && data.namespace === "core") {
bs.events.emit("file:reload", fileUtils.getFileInfo(data, bs.options));
}
});
}
});
bs.registerCleanupTask(function () {
handler.dispose();
reloader.dispose();
});
};
//# sourceMappingURL=internal-events.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"internal-events.js","sourceRoot":"","sources":["../lib/internal-events.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,IAAI,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAC/B,IAAI,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AACxC,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,IAAI,SAAS,GAAG,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC;AACxC,IAAI,WAAW,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAElD,MAAM,CAAC,OAAO,GAAG,UAAS,EAAE;IACxB,IAAI,MAAM,GAAG;QACT;;;WAGG;QACH,aAAa,EAAE,UAAS,IAAI;YACxB,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QAC5C,CAAC;QACD;;WAEG;QACH,gBAAgB,EAAE;YACd,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACzC,CAAC;QACD;;;WAGG;QACH,gBAAgB,EAAE,UAAS,IAAI;YAC3B,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;QAC/C,CAAC;QACD;;;WAGG;QACH,iBAAiB,EAAE,UAAS,IAAI;YAC5B,IAAI,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAClC,IAAI,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC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AAO,CAAC,UAAS,IAAI;gBACzB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC;oBAC1C,EAAE,CAAC,MAAM,CAAC,IAAI,CACV,aAAa,EACb,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,CAC1C,CAAC;gBACN,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC;IACL,CAAC,CAAC,CAAC;IAEP,EAAE,CAAC,mBAAmB,CAAC;QACnB,OAAO,CAAC,OAAO,EAAE,CAAC;QAClB,QAAQ,CAAC,OAAO,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -1,240 +0,0 @@
"use strict";
var messages = require("./connect-utils");
var utils = require("./utils");
var _ = require("./lodash.custom");
var template = "[{blue:%s}] ";
var logger = require("eazy-logger").Logger({
prefix: template.replace("%s", "BS"),
useLevelPrefixes: false
});
module.exports.logger = logger;
/**
* @param name
* @returns {*}
*/
module.exports.getLogger = function (name) {
return logger.clone(function (config) {
config.prefix = config.prefix + template.replace("%s", name);
return config;
});
};
/**
* Logging Callbacks
*/
module.exports.callbacks = {
/**
* Log when file-watching has started
* @param {BrowserSync} bs
* @param data
*/
"file:watching": function (bs, data) {
if (Object.keys(data).length) {
logger.info("Watching files...");
}
},
/**
* Log when a file changes
* @param {BrowserSync} bs
* @param data
*/
"file:reload": function (bs, data) {
if (canLogFileChange(bs, data)) {
if (data.path[0] === "*") {
return logger.info("{cyan:Reloading files that match: {magenta:%s", data.path);
}
logger.info("{cyan:File event [" + data.event + "] : {magenta:%s", data.path);
}
},
/**
*
*/
"service:exit": function () {
logger.debug("Exiting...");
},
/**
*
*/
"browser:reload": function (bs, data) {
if (data === void 0) { data = {}; }
if (canLogFileChange(bs)) {
if (data.files && data.files.length > 1) {
return logger.info("{cyan:Reloading Browsers... (buffered " + data.files.length + " events)");
}
logger.info("{cyan:Reloading Browsers...");
}
},
/**
*
*/
"browser:error": function () {
logger.error("Couldn't open browser (if you are using BrowserSync in a headless environment, you might want to set the {cyan:open} option to {cyan:false})");
},
/**
* @param {BrowserSync} bs
* @param data
*/
"stream:changed": function (bs, data) {
if (canLogFileChange(bs)) {
var changed = data.changed;
logger.info("{cyan:%s %s changed} ({magenta:%s})", changed.length, changed.length > 1 ? "files" : "file", changed.join(", "));
}
},
/**
* Client connected logging
* @param {BrowserSync} bs
* @param data
*/
"client:connected": function (bs, data) {
var uaString = utils.getUaString(data.ua);
var msg = "{cyan:Browser Connected: {magenta:%s, version: %s}";
var method = "info";
if (!bs.options.get("logConnections")) {
method = "debug";
}
logger.log(method, msg, uaString.name, uaString.version);
},
/**
* Main logging when the service is running
* @param {BrowserSync} bs
* @param data
*/
"service:running": function (bs, data) {
var type = data.type;
if (type === "server") {
var baseDir = bs.options.getIn(["server", "baseDir"]);
logUrls(bs.options.get("urls").toJS());
if (baseDir) {
if (utils.isList(baseDir)) {
baseDir.forEach(serveFiles);
}
else {
serveFiles(baseDir);
}
}
}
if (type === "proxy") {
logger.info("Proxying: {cyan:%s}", bs.options.getIn(["proxy", "target"]));
logUrls(bs.options.get("urls").toJS());
}
if (type === "snippet") {
if (bs.options.get("logSnippet")) {
logger.info("{bold:Copy the following snippet into your website, " +
"just before the closing {cyan:</body>} tag");
logger.unprefixed("info", messages.scriptTags(bs.options));
}
logUrls(bs.options
.get("urls")
.filter(function (value, key) {
return key.slice(0, 2) === "ui";
})
.toJS());
}
function serveFiles(base) {
logger.info("Serving files from: {magenta:%s}", base);
}
}
};
/**
* Plugin interface for BrowserSync
* @param {EventEmitter} emitter
* @param {BrowserSync} bs
* @returns {Object}
*/
module.exports.plugin = function (emitter, bs) {
var logPrefix = bs.options.get("logPrefix");
var logLevel = bs.options.get("logLevel");
// Should set logger level here!
logger.setLevel(logLevel);
if (logPrefix) {
if (_.isFunction(logPrefix)) {
logger.setPrefix(logPrefix);
}
else {
logger.setPrefix(template.replace("%s", logPrefix));
}
}
_.each(exports.callbacks, function (func, event) {
emitter.on(event, func.bind(this, bs));
});
return logger;
};
/**
*
* @param urls
*/
function logUrls(urls) {
var keys = Object.keys(urls);
var longestName = 0;
var longesturl = 0;
var offset = 2;
if (!keys.length) {
return;
}
var names = keys.map(function (key) {
if (key.length > longestName) {
longestName = key.length;
}
if (urls[key].length > longesturl) {
longesturl = urls[key].length;
}
return key;
});
var underline = getChars(longestName + offset + longesturl + 1, "-");
var underlined = false;
logger.info("{bold:Access URLs:");
logger.unprefixed("info", "{grey: %s", underline);
keys.forEach(function (key, i) {
var keyname = getKeyName(key);
logger.unprefixed("info", " %s: {magenta:%s}", getPadding(key.length, longestName + offset) + keyname, urls[key]);
if (!underlined && names[i + 1] && names[i + 1].indexOf("ui") > -1) {
underlined = true;
logger.unprefixed("info", "{grey: %s}", underline);
}
});
logger.unprefixed("info", "{grey: %s}", underline);
}
/**
* @param {Number} len
* @param {Number} max
* @returns {string}
*/
function getPadding(len, max) {
return new Array(max - (len + 1)).join(" ");
}
/**
* @param {Number} len
* @param {String} char
* @returns {string}
*/
function getChars(len, char) {
return new Array(len).join(char);
}
/**
* Transform url-key names into something more presentable
* @param key
* @returns {string}
*/
function getKeyName(key) {
if (key.indexOf("ui") > -1) {
if (key === "ui") {
return "UI";
}
if (key === "ui-external") {
return "UI External";
}
}
return key.substr(0, 1).toUpperCase() + key.substring(1);
}
/**
* Determine if file changes should be logged
* @param bs
* @param data
* @returns {boolean}
*/
function canLogFileChange(bs, data) {
if (data && data.log === false) {
return false;
}
return bs.options.get("logFileChanges");
}
//# sourceMappingURL=logger.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,223 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var _ = require("./lodash.custom");
var Immutable = require("immutable");
var defaultConfig = require("./default-config");
/**
* Move top-level ws options to proxy.ws
* This is to allow it to be set from the CLI
* @param incoming
*/
function setProxyWs(incoming) {
if (incoming.get("ws") && incoming.get("mode") === "proxy") {
return incoming.setIn(["proxy", "ws"], true);
}
return incoming;
}
exports.setProxyWs = setProxyWs;
/**
* @param item
*/
function setOpen(item) {
return item.update('open', function (open) {
if (item.get("mode") === "snippet") {
if (open !== "ui" && open !== "ui-external") {
return false;
}
}
return open;
});
}
exports.setOpen = setOpen;
/**
* Set the running mode
* @param incoming
*/
function setMode(incoming) {
return incoming.set("mode", (function () {
if (incoming.get("server")) {
return "server";
}
if (incoming.get("proxy")) {
return "proxy";
}
return "snippet";
})());
}
exports.setMode = setMode;
/**
* @param incoming
*/
function setScheme(incoming) {
var scheme = "http";
if (incoming.getIn(["server", "https"])) {
scheme = "https";
}
if (incoming.get("https")) {
scheme = "https";
}
if (incoming.getIn(["proxy", "url", "protocol"])) {
if (incoming.getIn(["proxy", "url", "protocol"]) === "https:") {
scheme = "https";
}
}
return incoming.set("scheme", scheme);
}
exports.setScheme = setScheme;
/**
* @param incoming
*/
function setStartPath(incoming) {
if (incoming.get("proxy")) {
var path = incoming.getIn(["proxy", "url", "path"]);
if (path !== "/") {
return incoming.set("startPath", path);
}
}
return incoming;
}
exports.setStartPath = setStartPath;
/**
* @param item
*/
function setNamespace(item) {
var namespace = item.getIn(["socket", "namespace"]);
if (_.isFunction(namespace)) {
return item.setIn(["socket", "namespace"], namespace(defaultConfig.socket.namespace));
}
return item;
}
exports.setNamespace = setNamespace;
/**
* @param item
*/
function setServerOpts(item) {
if (!item.get("server")) {
return item;
}
var indexarg = item.getIn(["server", "index"]) ||
"index.html";
var optPath = ["server", "serveStaticOptions"];
if (!item.getIn(optPath)) {
return item.setIn(optPath, Immutable.Map({
index: indexarg
}));
}
if (!item.hasIn(optPath.concat(["index"]))) {
return item.setIn(optPath.concat(["index"]), indexarg);
}
return item;
}
exports.setServerOpts = setServerOpts;
function liftExtensionsOptionFromCli(item) {
// cli extensions
var optPath = ["server", "serveStaticOptions"];
if (item.get("extensions")) {
return item.setIn(optPath.concat(["extensions"]), item.get("extensions"));
}
return item;
}
exports.liftExtensionsOptionFromCli = liftExtensionsOptionFromCli;
/**
* Back-compat fixes for rewriteRules being set to a boolean
*/
function fixRewriteRules(item) {
return item.update("rewriteRules", function (rr) {
return Immutable.List([])
.concat(rr)
.filter(Boolean);
});
}
exports.fixRewriteRules = fixRewriteRules;
function fixSnippetIgnorePaths(item) {
var ignorePaths = item.getIn(["snippetOptions", "ignorePaths"]);
if (ignorePaths) {
if (_.isString(ignorePaths)) {
ignorePaths = [ignorePaths];
}
ignorePaths = ignorePaths.map(ensureSlash);
return item.setIn(["snippetOptions", "blacklist"], Immutable.List(ignorePaths));
}
return item;
}
exports.fixSnippetIgnorePaths = fixSnippetIgnorePaths;
function fixSnippetIncludePaths(item) {
var includePaths = item.getIn(["snippetOptions", "whitelist"]);
if (includePaths) {
includePaths = includePaths.map(ensureSlash);
return item.setIn(["snippetOptions", "whitelist"], Immutable.List(includePaths));
}
return item;
}
exports.fixSnippetIncludePaths = fixSnippetIncludePaths;
/**
* Enforce paths to begin with a forward slash
*/
function ensureSlash(item) {
if (item[0] !== "/") {
return "/" + item;
}
return item;
}
/**
*
*/
function setMiddleware(item) {
var mw = getMiddlwares(item);
return item.set("middleware", mw);
}
exports.setMiddleware = setMiddleware;
/**
* top-level option, or given as part of the proxy/server option
* @param item
* @returns {*}
*/
function getMiddlwares(item) {
var mw = item.get("middleware");
var serverMw = item.getIn(["server", "middleware"]);
var proxyMw = item.getIn(["proxy", "middleware"]);
var list = Immutable.List([]);
if (mw) {
return listMerge(list, mw);
}
if (serverMw) {
return listMerge(list, serverMw);
}
if (proxyMw) {
return listMerge(list, proxyMw);
}
return list;
}
/**
* @param item
* @returns {*}
*/
function isList(item) {
return Immutable.List.isList(item);
}
/**
* @param list
* @param item
* @returns {*}
*/
function listMerge(list, item) {
if (_.isFunction(item)) {
list = list.push(item);
}
if (isList(item) && item.size) {
list = list.merge(item);
}
return list;
}
/**
* @param item
* @returns {*}
*/
function setUiPort(item) {
if (item.get("uiPort")) {
return item.setIn(["ui", "port"], item.get("uiPort"));
}
return item;
}
exports.setUiPort = setUiPort;
//# sourceMappingURL=options.js.map

File diff suppressed because one or more lines are too long

View file

@ -1,171 +0,0 @@
var Immutable = require("immutable");
var Map = Immutable.Map;
var isMap = Immutable.Map.isMap;
var List = Immutable.List;
var qs = require("qs");
var path = require("path");
var fs = require("fs");
var Plugin = Immutable.Record({
moduleName: "",
name: "",
active: true,
module: undefined,
options: Map({}),
via: "inline",
dir: process.cwd(),
init: undefined,
errors: List([])
});
/**
* Accept a string/object
* and resolve it into the plugin format above
* @param item
* @returns {*}
*/
function resolvePlugin(item) {
/**
* Handle when string was given, such as plugins: ['bs-html-injector']
*/
if (typeof item === "string") {
return getFromString(item);
}
if (!isMap(item)) {
return new Plugin().mergeDeep({
errors: [new Error("Plugin not supported in this format")]
});
}
if (item.has("module")) {
var nameOrObj = item.get("module");
var options = item.get("options");
/**
* The 'module' key can be a string, this allows
* inline plugin references, but with options
* eg:
*
* bs.init({
* plugins: [
* {
* module: './myjs-file.js'
* options: {
* files: "*.html"
* }
* }
* ]
* });
*/
if (typeof nameOrObj === "string") {
return getFromString(nameOrObj).mergeDeep({
options: options
});
}
/**
* If the plugin was given completely inline (because it needs options)
* eg:
*
* bs.init({
* plugins: [
* {
* module: {
* plugin: function() {
* console.log('My plugin code')
* }
* },
* options: {
* files: "*.html"
* }
* }
* ]
* })
*/
if (Immutable.Map.isMap(nameOrObj)) {
return new Plugin({
module: nameOrObj,
options: options
});
}
}
/**
* If a module was given directly. For example, ater calling require.
*
* eg:
* var myplugin = require('./some-js');
* bs.init({plugins: [myplugin]});
*/
if (item.has("plugin")) {
return new Plugin({
module: item
});
}
/**
* If we reach here, the plugin option was used incorrectly
*/
return new Plugin().mergeDeep({
errors: [new Error("Plugin was not configured correctly")]
});
}
module.exports.resolvePlugin = resolvePlugin;
/**
* Load a plugin from disk
* @param item
* @returns {*}
*/
function requirePlugin(item) {
/**
* if the "module" property already exists and
* is not a string, then we bail and don't bother looking
* for the file
*/
if (item.get("module") && typeof item.get("module") !== "string") {
return item;
}
try {
/**
* Try a raw node require() call - this will be how
* regular "npm installed" plugins wil work
*/
var maybe = path.resolve(process.cwd(), "node_modules", item.get("name"));
return item.set("module", require(maybe));
}
catch (e) {
/**
* If require threw an MODULE_NOT_FOUND error, try again
* by resolving from cwd. This is needed since cli
* users will not add ./ to the front of a path (which
* node requires to resolve from cwd)
*/
if (e.code === "MODULE_NOT_FOUND") {
var maybe = path.resolve(process.cwd(), item.get("name"));
if (fs.existsSync(maybe)) {
return item.set("module", require(maybe));
}
else {
/**
* Finally return a plugin that contains the error
* this will be picked up later and discarded
*/
return item.update("errors", function (errors) {
return errors.concat(e);
});
}
}
throw e;
}
}
module.exports.requirePlugin = requirePlugin;
function getFromString(string) {
/**
* We allow query strings for plugins, so always split on ?
*/
var split = string.split("?");
var outGoing = new Plugin({
moduleName: split[0],
name: split[0]
});
if (split.length > 1) {
return outGoing.update("options", function (opts) {
return opts.mergeDeep(qs.parse(split[1]));
});
}
return outGoing;
}
//# sourceMappingURL=plugins.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../lib/plugins.js"],"names":[],"mappings":"AAAA,IAAI,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACrC,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC;AACxB,IAAI,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC;AAChC,IAAI,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;AAC1B,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACvB,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3B,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEvB,IAAI,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;IAC1B,UAAU,EA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,CAAC,MAAM,CAAC,CAAC,CAAC;YAC1D,EAAE,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACvB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;YAC9C,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ;;;mBAGG;gBACH,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAS,MAAM;oBACxC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC5B,CAAC,CAAC,CAAC;YACP,CAAC;QACL,CAAC;QACD,MAAM,CAAC,CAAC;IACZ,CAAC;AACL,CAAC;AACD,MAAM,CAAC,OAAO,CAAC,aAAa,GAAG,aAAa,CAAC;AAE7C,uBAAuB,MAAM;IACzB;;OAEG;IACH,IAAI,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE9B,IAAI,QAAQ,GAAG,IAAI,MAAM,CAAC;QACtB,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;QACpB,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;KACjB,CAAC,CAAC;IAEH,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;QACnB,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,UAAS,IAAI;YAC3C,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC;AACpB,CAAC"}

View file

@ -1,15 +0,0 @@
"use strict";
/**
* @param {BrowserSync} browserSync
* @returns {Function}
*/
module.exports = function (browserSync) {
function exit() {
if (browserSync.active) {
browserSync.events.emit("service:exit");
browserSync.cleanup();
}
}
return exit;
};
//# sourceMappingURL=exit.js.map

View file

@ -1 +0,0 @@
{"version":3,"file":"exit.js","sourceRoot":"","sources":["../../lib/public/exit.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;GAGG;AACH,MAAM,CAAC,OAAO,GAAG,UAAS,WAAW;IACjC;QACI,EAAE,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;YACrB,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YACxC,WAAW,CAAC,OAAO,EAAE,CAAC;QAC1B,CAAC;IACL,CAAC;IAED,MAAM,CAAC,IAAI,CAAC;AAChB,CAAC,CAAC"}

View file

@ -1,28 +0,0 @@
"use strict";
var _ = require("../lodash.custom");
var merge = require("../cli/cli-options").merge;
/**
* @param {BrowserSync} browserSync
* @param {String} [name] - instance name
* @param {Object} pjson
* @returns {Function}
*/
module.exports = function (browserSync, name, pjson) {
return function () {
/**
* Handle new + old signatures for init.
*/
var args = require("../args")(_.toArray(arguments));
/**
* If the current instance is already running, just return an error
*/
if (browserSync.active) {
return args.cb(new Error("Instance: " + name + " is already running!"));
}
// Env specific items
args.config.version = pjson.version;
args.config.cwd = args.config.cwd || process.cwd();
return browserSync.init(merge(args.config), args.cb);
};
};
//# sourceMappingURL=init.js.map

Some files were not shown because too many files have changed in this diff Show more