Compare commits
129 Commits
Author | SHA1 | Date | |
---|---|---|---|
d0e6bbd162 | |||
9b27ed9e7f | |||
93ed4fbbf9 | |||
8aa5ce6a5d | |||
2992f54f11 | |||
c9929963d7 | |||
5ea199e470 | |||
e729dd8e6f | |||
54335338ab | |||
3109585d30 | |||
b28b79cae6 | |||
a7d0bfc63f | |||
f436fffecd | |||
77b5949a81 | |||
ad9dde6fb6 | |||
e928510886 | |||
7065094a84 | |||
7e210d473f | |||
e3aa4cbbcc | |||
4a7ffa1caf | |||
872eef5de8 | |||
7d464df932 | |||
712000b688 | |||
e2ed8c5f4c | |||
245449ee13 | |||
7cd695fc92 | |||
80223dc038 | |||
7b1df4148d | |||
e81288a9dd | |||
1734a2030b | |||
65b96af6a8 | |||
eec824e959 | |||
d28634a865 | |||
540d9a9b56 | |||
65c70eec98 | |||
1622715a51 | |||
2d063f1fe4 | |||
bc87a24ae8 | |||
dd2f410fdb | |||
acde823f08 | |||
6edd270a92 | |||
be43477dca | |||
03a931a9d3 | |||
f05b790e4d | |||
61dc3347c7 | |||
2de34d9928 | |||
2c69bdd39c | |||
130f8b00d7 | |||
a87263888c | |||
802a348123 | |||
74bbd71ef4 | |||
86f7e0631b | |||
0657edac50 | |||
01a89ecad1 | |||
213cd764d8 | |||
244048fccb | |||
aee39d4a33 | |||
f5f1d59c79 | |||
895063ec65 | |||
ba29214eea | |||
5fe7d563d0 | |||
29534a3c6d | |||
e5cbefd195 | |||
83ddb95968 | |||
7afda4e508 | |||
f459bd5537 | |||
53dba94a78 | |||
47b5d718ee | |||
e0902b9f6c | |||
5ee39fc04d | |||
40254e394e | |||
9306dcf0a1 | |||
9b6609a2e5 | |||
943fcf8634 | |||
6de689a766 | |||
774269da57 | |||
6a884cda78 | |||
3e46c8c927 | |||
31d1fae5a2 | |||
95e874c8e8 | |||
6594932cbd | |||
9457f3ce8a | |||
eb636603ab | |||
6e2797cd65 | |||
8de47822e4 | |||
cd867e1d6c | |||
d0445361eb | |||
d580d486fa | |||
8053a34581 | |||
2b6a95a45a | |||
c4e8ce846d | |||
462d11da27 | |||
92ad03fc65 | |||
50dd2b193a | |||
fb3e693f2a | |||
92841c1715 | |||
07b6fea447 | |||
809a1f7450 | |||
9e1716cba5 | |||
66ac210e5e | |||
663e8f1984 | |||
f29bb7ea44 | |||
a3584988f7 | |||
338e1c8497 | |||
0667889820 | |||
8e6f59865e | |||
ad301a55a8 | |||
67826ea04b | |||
1644c3541d | |||
e81fa449bb | |||
56027509b1 | |||
9d19892849 | |||
9b082c6b1e | |||
a1fc66316e | |||
9387db780b | |||
0d2d49bfce | |||
b2aba691e2 | |||
df3e7faed7 | |||
22dde42901 | |||
f99b7dad41 | |||
d456dc45eb | |||
f3c0a766c9 | |||
6b6baee746 | |||
01cfcb556c | |||
11656abc3f | |||
b016b4a709 | |||
2069fb92f9 | |||
cf31174c11 | |||
1242d56d40 |
11
.gitignore
vendored
11
.gitignore
vendored
@ -1,6 +1,7 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
.settings/
|
npm-debug.log
|
||||||
.idea/
|
test/result/
|
||||||
|
coverage/
|
||||||
ts/*.js
|
docs/
|
||||||
ts/*.js.map
|
pages/
|
||||||
|
public
|
||||||
|
59
.gitlab-ci.yml
Normal file
59
.gitlab-ci.yml
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
image: hosttoday/ht-docker-node:npmts
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- test
|
||||||
|
- release
|
||||||
|
- trigger
|
||||||
|
- pages
|
||||||
|
|
||||||
|
testLEGACY:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci test legacy
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
testLTS:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci test lts
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
testSTABLE:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci test stable
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
release:
|
||||||
|
stage: release
|
||||||
|
script:
|
||||||
|
- npmci publish
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
stage: trigger
|
||||||
|
script:
|
||||||
|
- npmci trigger
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
pages:
|
||||||
|
image: hosttoday/ht-docker-node:npmpage
|
||||||
|
stage: pages
|
||||||
|
script:
|
||||||
|
- npmci command npmpage --publish gitlab
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 week
|
||||||
|
paths:
|
||||||
|
- public
|
1
.idea/.name
generated
1
.idea/.name
generated
@ -1 +0,0 @@
|
|||||||
gulp-browser
|
|
6
.idea/encodings.xml
generated
6
.idea/encodings.xml
generated
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="Encoding">
|
|
||||||
<file url="PROJECT" charset="UTF-8" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
8
.idea/gulp-browser.iml
generated
8
.idea/gulp-browser.iml
generated
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="WEB_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$" />
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
13
.idea/misc.xml
generated
13
.idea/misc.xml
generated
@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
|
||||||
<OptionsSetting value="true" id="Add" />
|
|
||||||
<OptionsSetting value="true" id="Remove" />
|
|
||||||
<OptionsSetting value="true" id="Checkout" />
|
|
||||||
<OptionsSetting value="true" id="Update" />
|
|
||||||
<OptionsSetting value="true" id="Status" />
|
|
||||||
<OptionsSetting value="true" id="Edit" />
|
|
||||||
<ConfirmationsSetting value="0" id="Add" />
|
|
||||||
<ConfirmationsSetting value="0" id="Remove" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/gulp-browser.iml" filepath="$PROJECT_DIR$/.idea/gulp-browser.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
395
.idea/workspace.xml
generated
395
.idea/workspace.xml
generated
@ -1,395 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ChangeListManager">
|
|
||||||
<list default="true" id="b850c661-13d4-478c-951c-1a06c2a6f1db" name="Default" comment="">
|
|
||||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
|
|
||||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/index.js" afterPath="$PROJECT_DIR$/index.js" />
|
|
||||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/package.json" afterPath="$PROJECT_DIR$/package.json" />
|
|
||||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/ts/index.ts" afterPath="$PROJECT_DIR$/ts/index.ts" />
|
|
||||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/ts/modulebrowserify.ts" afterPath="$PROJECT_DIR$/ts/modulebrowserify.ts" />
|
|
||||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/ts/tsd.json" afterPath="$PROJECT_DIR$/ts/tsd.json" />
|
|
||||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/ts/typings/node/node.d.ts" afterPath="$PROJECT_DIR$/ts/typings/node/node.d.ts" />
|
|
||||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/ts/typings/tsd.d.ts" afterPath="$PROJECT_DIR$/ts/typings/tsd.d.ts" />
|
|
||||||
</list>
|
|
||||||
<ignored path="gulp-browser.iws" />
|
|
||||||
<ignored path=".idea/workspace.xml" />
|
|
||||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
|
||||||
<option name="TRACKING_ENABLED" value="true" />
|
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
||||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
||||||
</component>
|
|
||||||
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
|
|
||||||
<component name="CreatePatchCommitExecutor">
|
|
||||||
<option name="PATCH_PATH" value="" />
|
|
||||||
</component>
|
|
||||||
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
|
||||||
<component name="FavoritesManager">
|
|
||||||
<favorites_list name="gulp-browser" />
|
|
||||||
</component>
|
|
||||||
<component name="FileEditorManager">
|
|
||||||
<leaf>
|
|
||||||
<file leaf-file-name="index.ts" pinned="false" current-in-tab="false">
|
|
||||||
<entry file="file://$PROJECT_DIR$/ts/index.ts">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="0.0">
|
|
||||||
<caret line="12" column="54" selection-start-line="12" selection-start-column="54" selection-end-line="12" selection-end-column="54" />
|
|
||||||
<folding>
|
|
||||||
<element signature="n#!!doc" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</file>
|
|
||||||
<file leaf-file-name="modulebrowserify.ts" pinned="false" current-in-tab="true">
|
|
||||||
<entry file="file://$PROJECT_DIR$/ts/modulebrowserify.ts">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="0.4">
|
|
||||||
<caret line="11" column="59" selection-start-line="11" selection-start-column="59" selection-end-line="11" selection-end-column="59" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</file>
|
|
||||||
<file leaf-file-name="index.js" pinned="false" current-in-tab="false">
|
|
||||||
<entry file="file://$PROJECT_DIR$/index.js">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="0.0">
|
|
||||||
<caret line="28" column="29" selection-start-line="28" selection-start-column="29" selection-end-line="28" selection-end-column="29" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</file>
|
|
||||||
<file leaf-file-name="README.md" pinned="false" current-in-tab="false">
|
|
||||||
<entry file="file://$PROJECT_DIR$/README.md">
|
|
||||||
<provider editor-type-id="MarkdownPreviewEditor">
|
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="-0.32142857">
|
|
||||||
<caret line="1" column="45" selection-start-line="1" selection-start-column="45" selection-end-line="1" selection-end-column="45" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
<provider editor-type-id="MultiMarkdownFxPreviewEditor">
|
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
<provider editor-type-id="MultiMarkdownFxHtmlEditor">
|
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</file>
|
|
||||||
<file leaf-file-name="package.json" pinned="false" current-in-tab="false">
|
|
||||||
<entry file="file://$PROJECT_DIR$/package.json">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="-20.0">
|
|
||||||
<caret line="32" column="4" selection-start-line="32" selection-start-column="4" selection-end-line="32" selection-end-column="4" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</file>
|
|
||||||
<file leaf-file-name=".gitignore" pinned="false" current-in-tab="false">
|
|
||||||
<entry file="file://$PROJECT_DIR$/.gitignore">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="-0.8181818">
|
|
||||||
<caret line="6" column="0" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</file>
|
|
||||||
<file leaf-file-name=".travis.yml" pinned="false" current-in-tab="false">
|
|
||||||
<entry file="file://$PROJECT_DIR$/.travis.yml">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="0.0">
|
|
||||||
<caret line="19" column="0" selection-start-line="19" selection-start-column="0" selection-end-line="19" selection-end-column="0" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</file>
|
|
||||||
</leaf>
|
|
||||||
</component>
|
|
||||||
<component name="Git.Settings">
|
|
||||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
||||||
</component>
|
|
||||||
<component name="IdeDocumentHistory">
|
|
||||||
<option name="CHANGED_PATHS">
|
|
||||||
<list>
|
|
||||||
<option value="$PROJECT_DIR$/README.md" />
|
|
||||||
<option value="$PROJECT_DIR$/.gitignore" />
|
|
||||||
<option value="$PROJECT_DIR$/.travis.yml" />
|
|
||||||
<option value="$PROJECT_DIR$/ts/browserify.ts" />
|
|
||||||
<option value="$PROJECT_DIR$/package.json" />
|
|
||||||
<option value="$PROJECT_DIR$/ts/index.ts" />
|
|
||||||
<option value="$PROJECT_DIR$/ts/modulebrowserify.ts" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="JsBuildToolGruntFileManager" detection-done="true" />
|
|
||||||
<component name="JsBuildToolPackageJson" detection-done="true" />
|
|
||||||
<component name="JsGulpfileManager">
|
|
||||||
<detection-done>true</detection-done>
|
|
||||||
</component>
|
|
||||||
<component name="ProjectFrameBounds">
|
|
||||||
<option name="y" value="23" />
|
|
||||||
<option name="width" value="1440" />
|
|
||||||
<option name="height" value="873" />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
|
||||||
<OptionsSetting value="true" id="Add" />
|
|
||||||
<OptionsSetting value="true" id="Remove" />
|
|
||||||
<OptionsSetting value="true" id="Checkout" />
|
|
||||||
<OptionsSetting value="true" id="Update" />
|
|
||||||
<OptionsSetting value="true" id="Status" />
|
|
||||||
<OptionsSetting value="true" id="Edit" />
|
|
||||||
<ConfirmationsSetting value="0" id="Add" />
|
|
||||||
<ConfirmationsSetting value="0" id="Remove" />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectView">
|
|
||||||
<navigator currentView="ProjectPane" proportions="" version="1">
|
|
||||||
<flattenPackages />
|
|
||||||
<showMembers />
|
|
||||||
<showModules />
|
|
||||||
<showLibraryContents />
|
|
||||||
<hideEmptyPackages />
|
|
||||||
<abbreviatePackageNames />
|
|
||||||
<autoscrollToSource />
|
|
||||||
<autoscrollFromSource />
|
|
||||||
<sortByType />
|
|
||||||
<manualOrder />
|
|
||||||
<foldersAlwaysOnTop value="true" />
|
|
||||||
</navigator>
|
|
||||||
<panes>
|
|
||||||
<pane id="ProjectPane">
|
|
||||||
<subPane>
|
|
||||||
<PATH>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="gulp-browser" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
</PATH>
|
|
||||||
<PATH>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="gulp-browser" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="gulp-browser" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
</PATH>
|
|
||||||
<PATH>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="gulp-browser" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="gulp-browser" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
<PATH_ELEMENT>
|
|
||||||
<option name="myItemId" value="ts" />
|
|
||||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
|
||||||
</PATH_ELEMENT>
|
|
||||||
</PATH>
|
|
||||||
</subPane>
|
|
||||||
</pane>
|
|
||||||
<pane id="Scope" />
|
|
||||||
<pane id="Scratches" />
|
|
||||||
</panes>
|
|
||||||
</component>
|
|
||||||
<component name="PropertiesComponent">
|
|
||||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/../gulp-makejson" />
|
|
||||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
|
||||||
<property name="js-jscs-nodeInterpreter" value="/usr/local/bin/node" />
|
|
||||||
<property name="HbShouldOpenHtmlAsHb" value="" />
|
|
||||||
</component>
|
|
||||||
<component name="RunManager">
|
|
||||||
<configuration default="true" type="BashConfigurationType" factoryName="Bash">
|
|
||||||
<option name="INTERPRETER_OPTIONS" value="" />
|
|
||||||
<option name="INTERPRETER_PATH" value="/bin/bash" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="" />
|
|
||||||
<option name="PARENT_ENVS" value="true" />
|
|
||||||
<option name="SCRIPT_NAME" value="" />
|
|
||||||
<option name="PARAMETERS" value="" />
|
|
||||||
<module name="" />
|
|
||||||
<envs />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="DartUnitRunConfigurationType" factoryName="DartUnit">
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma" config-file="">
|
|
||||||
<envs />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" working-dir="">
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="cucumber.js" factoryName="Cucumber.js">
|
|
||||||
<option name="cucumberJsArguments" value="" />
|
|
||||||
<option name="executablePath" />
|
|
||||||
<option name="filePath" />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="js.build_tools.npm" factoryName="npm">
|
|
||||||
<command value="run-script" />
|
|
||||||
<scripts />
|
|
||||||
<envs />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
<configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha">
|
|
||||||
<node-options />
|
|
||||||
<working-directory>$PROJECT_DIR$</working-directory>
|
|
||||||
<pass-parent-env>true</pass-parent-env>
|
|
||||||
<envs />
|
|
||||||
<ui>bdd</ui>
|
|
||||||
<extra-mocha-options />
|
|
||||||
<test-kind>DIRECTORY</test-kind>
|
|
||||||
<test-directory />
|
|
||||||
<recursive>false</recursive>
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
||||||
<component name="ShelveChangesManager" show_recycled="false" />
|
|
||||||
<component name="SvnConfiguration">
|
|
||||||
<configuration />
|
|
||||||
</component>
|
|
||||||
<component name="TaskManager">
|
|
||||||
<task active="true" id="Default" summary="Default task">
|
|
||||||
<changelist id="b850c661-13d4-478c-951c-1a06c2a6f1db" name="Default" comment="" />
|
|
||||||
<created>1445697437394</created>
|
|
||||||
<option name="number" value="Default" />
|
|
||||||
<updated>1445697437394</updated>
|
|
||||||
</task>
|
|
||||||
<servers />
|
|
||||||
</component>
|
|
||||||
<component name="ToolWindowManager">
|
|
||||||
<frame x="0" y="23" width="1440" height="873" extended-state="0" />
|
|
||||||
<editor active="true" />
|
|
||||||
<layout>
|
|
||||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24947146" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="TypeScript Compiler" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.33034572" sideWeight="0.5024665" order="7" side_tool="true" content_ui="tabs" />
|
|
||||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="8" side_tool="true" content_ui="tabs" />
|
|
||||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.33034572" sideWeight="0.49753347" order="10" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
|
||||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
|
||||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
|
||||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
|
||||||
</layout>
|
|
||||||
</component>
|
|
||||||
<component name="VcsContentAnnotationSettings">
|
|
||||||
<option name="myLimit" value="2678400000" />
|
|
||||||
</component>
|
|
||||||
<component name="XDebuggerManager">
|
|
||||||
<breakpoint-manager />
|
|
||||||
<watches-manager />
|
|
||||||
</component>
|
|
||||||
<component name="editorHistoryManager">
|
|
||||||
<entry file="file://$PROJECT_DIR$/README.md">
|
|
||||||
<provider editor-type-id="MarkdownPreviewEditor">
|
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="-0.32142857">
|
|
||||||
<caret line="1" column="45" selection-start-line="1" selection-start-column="45" selection-end-line="1" selection-end-column="45" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
<provider editor-type-id="MultiMarkdownFxPreviewEditor">
|
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
<provider editor-type-id="MultiMarkdownFxHtmlEditor">
|
|
||||||
<state />
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/.gitignore">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="-0.8181818">
|
|
||||||
<caret line="6" column="0" selection-start-line="6" selection-start-column="0" selection-end-line="6" selection-end-column="0" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/.travis.yml">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="0.0">
|
|
||||||
<caret line="19" column="0" selection-start-line="19" selection-start-column="0" selection-end-line="19" selection-end-column="0" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/ts/compile/gulpfile.js">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="0.0">
|
|
||||||
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/index.js">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="0.0">
|
|
||||||
<caret line="28" column="29" selection-start-line="28" selection-start-column="29" selection-end-line="28" selection-end-column="29" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/ts/tsd.json">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="0.0">
|
|
||||||
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/package.json">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="-20.0">
|
|
||||||
<caret line="32" column="4" selection-start-line="32" selection-start-column="4" selection-end-line="32" selection-end-column="4" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/ts/index.ts">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="0.0">
|
|
||||||
<caret line="12" column="54" selection-start-line="12" selection-start-column="54" selection-end-line="12" selection-end-column="54" />
|
|
||||||
<folding>
|
|
||||||
<element signature="n#!!doc" expanded="true" />
|
|
||||||
</folding>
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
<entry file="file://$PROJECT_DIR$/ts/modulebrowserify.ts">
|
|
||||||
<provider selected="true" editor-type-id="text-editor">
|
|
||||||
<state vertical-scroll-proportion="0.4">
|
|
||||||
<caret line="11" column="59" selection-start-line="11" selection-start-column="59" selection-end-line="11" selection-end-column="59" />
|
|
||||||
<folding />
|
|
||||||
</state>
|
|
||||||
</provider>
|
|
||||||
</entry>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
4
.npmignore
Normal file
4
.npmignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
node_modules
|
||||||
|
test
|
||||||
|
ts
|
||||||
|
coverage/
|
19
.travis.yml
19
.travis.yml
@ -1,19 +0,0 @@
|
|||||||
language: node_js
|
|
||||||
before_install:
|
|
||||||
- nvm install stable
|
|
||||||
- node -v
|
|
||||||
- npm -v
|
|
||||||
- npm install -g gulp
|
|
||||||
- npm install gulp
|
|
||||||
- npm install gulp-typescript
|
|
||||||
deploy:
|
|
||||||
provider: npm
|
|
||||||
email: npm@smart-coordination.com
|
|
||||||
api_key:
|
|
||||||
secure: y7l1JyBDihAYxbqfuPAUXJfY+PC7RSSCkAtXtBIjPA6wytSBnz55te/Vdy8RFgVty6O/k4hHzrhgUJMSoWKmPuGQ5bMBgkyV9OI5PPp4uEUyy5UdcJZv3cZYpGGDRjLjCHP4pF7AHdRcDUMEiE5ZrDtmUH1SBLoRswieO0TKsiMr3u45yR6rHFoPnnw1YlatoAPpiuP3SLnCrIjQeSOS7y9SL6PpakiquJNtpseVOr60sp39L6vLAeqJ7xTjjNJk23LF/60lfiKtM7QFg9qqE7cxFUWJs7Zmgfg4/hGcU9XRfDfZQgSNntcdFczPejO5juv2KOb1tzH7EhXrWlcF1yd70RBdJbcOn7O6ctHjMCGrCSn6IQPzcNWNErFELfMLsjVQUxbfHSc0iA1JxcYWeXUivrStwVOa9ufuG2KZCQZyEjra3zPdCu9yrE30c/mTace7eJXPYTsNn2tmxvTnFoTWmeQ0xL9Iyz9zceADpxjYJoJ8r4XMDWxWga5G9OPaqCINHxjKhOX0C36YEjYTaeNMNHv6F6BPLdKwQ9SmklMtcyC312nJsXwKy+KYJSoY6WqMef9Zk3ez0o09W0UkSr0qiQkyYCoNm8b1L7VrYuccPH24GE0fn8QMWmeE5TBThYbEIdt6NBoYCDeocflUm5KBrImFGo1peeYS1aQnpoQ=
|
|
||||||
on:
|
|
||||||
tags: true
|
|
||||||
repo: pushrocks/gulp-bootstrap
|
|
||||||
notifications:
|
|
||||||
slack:
|
|
||||||
secure: f5Uss0z9RPl/QcA/DroB8loyE93aOYI6bqCkrsiUscmZtlv/TVQtT4dxqGA6uvcG6iTQDBi3Ul88dQxWkRm4IqbhY35/iMaV2dHW4FVYMAh8GQMbsfL2sALCcufxD9blw47awv3iFcwhV1EeyesscjgL0JIjduk96v/7G/6QIO2838M1lzlgtj+kRUkim8qkaEs1je3gRrhMUIjLuAdscMXyUKYFMjWo9ACSjVUl30R/ZNemb18itIja6i92GotreBgcfEMczvy58ovDC7xdJUsY8LjMI01DwY+WPRnI0tAhsuI8moBwwcdM4e3bAjKjucQRjO33O5bMWRZ6QCiYd0DnCEFyCPQLJ4GSy/tkD00n8ijLHAOSV3AH1zNbdK1EAdSPQXDvlI36KJn/2hyQLoitGHVUPr76ujJWP82ypO2tgIp3XQU0dJVCxDuHnwJO2+hjdI+gCPqxNTpjeujHx3UdkTGNRjuuf9dlZ/D08fApjYxy2fxItTqo3QjP/nrqvBXUOPP8yPHpjIT4H2t5Pr4SJjBGI6X4qhKyFj6s9rA/Xu1rL+45zu1C3uC3z+u3T9UwrbzJ/cZM6r6UQvQmUvIfBNaMlg4I/diQCDIPL+Rhop2nylY3IcHmJnk2itn7kOqj1tohCpFEml5pRuSZy4udWywkdtyBAsHWFLF7oiQ=
|
|
50
README.md
50
README.md
@ -1,2 +1,50 @@
|
|||||||
# gulp-browser
|
# gulp-browser
|
||||||
bundles browserify and other goodies for gulp
|
browserify and other goodies for gulp
|
||||||
|
|
||||||
|
## Availabililty
|
||||||
|
[](https://www.npmjs.com/package/gulp-browser)
|
||||||
|
[](https://GitLab.com/pushrocks/gulp-browser)
|
||||||
|
[](https://github.com/pushrocks/gulp-browser)
|
||||||
|
[](https://pushrocks.gitlab.io/gulp-browser/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
|
[](https://GitLab.com/pushrocks/gulp-browser/commits/master)
|
||||||
|
[](https://GitLab.com/pushrocks/gulp-browser/commits/master)
|
||||||
|
[](https://www.npmjs.com/package/gulp-browser)
|
||||||
|
[](https://david-dm.org/pushrocks/gulp-browser)
|
||||||
|
[](https://www.bithound.io/github/pushrocks/gulp-browser/master/dependencies/npm)
|
||||||
|
[](https://www.bithound.io/github/pushrocks/gulp-browser)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||||
|
[](http://standardjs.com/)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
Use TypeScript for best in class instellisense.
|
||||||
|
|
||||||
|
#### Browserify:
|
||||||
|
```javascript
|
||||||
|
let gulp = require("gulp");
|
||||||
|
let gulpBrowser = require("gulp-browser");
|
||||||
|
|
||||||
|
let transforms = [
|
||||||
|
{
|
||||||
|
transform: "babelify",
|
||||||
|
options: {presets: ["es2015"]}
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
gulp.task('gulpBrowserTest',function() {
|
||||||
|
var stream = gulp.src('./test/*.js')
|
||||||
|
.pipe(gulpBrowser.browserify(transforms)) // gulp.browserify() accepts an optional array of tansforms
|
||||||
|
.pipe(gulp.dest("./test/browserifiedJS/"));
|
||||||
|
return stream;
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Note:** Be aware of how gulp.src creates values of file.base and file.path since that is important to the require statements.
|
||||||
|
|
||||||
|
### Contributors
|
||||||
|
* [Phil Kunz](https://github.com/philkunz)
|
||||||
|
* [Steffan Donal](https://github.com/SteffanDonal)
|
||||||
|
|
||||||
|
[](https://push.rocks)
|
||||||
|
4
dist/gulpbrowser.browserify.d.ts
vendored
Normal file
4
dist/gulpbrowser.browserify.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/// <reference types="node" />
|
||||||
|
import * as stream from 'stream';
|
||||||
|
declare let browserify: (transforms?: any[]) => stream.Transform;
|
||||||
|
export = browserify;
|
43
dist/gulpbrowser.browserify.js
vendored
Normal file
43
dist/gulpbrowser.browserify.js
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
"use strict";
|
||||||
|
const plugins = require("./gulpbrowser.plugins");
|
||||||
|
let browserify = function (transforms = []) {
|
||||||
|
if (!Array.isArray(transforms)) {
|
||||||
|
transforms = [transforms];
|
||||||
|
}
|
||||||
|
let forEach = function (file, enc, cb) {
|
||||||
|
let bundleCallback = function (err, bufferedContent) {
|
||||||
|
if (Buffer.isBuffer(bufferedContent)) {
|
||||||
|
file.contents = bufferedContent;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.log('gulp-browser: .browserify() ' + err.message);
|
||||||
|
cb(new Error(err.message), file);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
cb(null, file);
|
||||||
|
};
|
||||||
|
if (file.contents.length > 0) {
|
||||||
|
let browserified = plugins.browserify(file, { basedir: file.base });
|
||||||
|
transforms.forEach(function (transform) {
|
||||||
|
if (typeof transform === 'function') {
|
||||||
|
browserified.transform(transform);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
browserified.transform(transform.transform, transform.options);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
browserified.bundle(bundleCallback);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.warn('gulp-browser: .browserify() file.contents appears to be empty');
|
||||||
|
cb(null, file);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
};
|
||||||
|
let atEnd = function (cb) {
|
||||||
|
cb();
|
||||||
|
}; // no need to clean up after ourselves
|
||||||
|
return plugins.through2.obj(forEach, atEnd); // this is the through object that gets returned by gulpBrowser.browserify();
|
||||||
|
};
|
||||||
|
module.exports = browserify;
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3VscGJyb3dzZXIuYnJvd3NlcmlmeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2d1bHBicm93c2VyLmJyb3dzZXJpZnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLGlEQUFpRDtBQUdqRCxJQUFJLFVBQVUsR0FBRyxVQUFVLFVBQVUsR0FBRyxFQUFFO0lBRXRDLEVBQUUsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDN0IsVUFBVSxHQUFHLENBQUMsVUFBVSxDQUFDLENBQUE7SUFDN0IsQ0FBQztJQUVELElBQUksT0FBTyxHQ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LFNBQVMsQ0FBQyxTQUFTLEVBQUUsU0FBUyxDQUFDLE9BQU8sQ0FBQyxDQUFBO2dCQUNsRSxDQUFDO1lBQ0wsQ0FBQyxDQUFDLENBQUE7WUFFRixZQUFZLENBQUMsTUFBTSxDQUFDLGNBQWMsQ0FBQyxDQUFBO1FBQ3ZDLENBQUM7UUFBQyxJQUFJLENBQUMsQ0FBQztZQUNKLE9BQU8sQ0FBQyxJQUFJLENBQUMsK0RBQStELENBQUMsQ0FBQTtZQUM3RSxFQUFFLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxDQUFBO1FBQ2xCLENBQUM7UUFBQSxDQUFDO0lBQ04sQ0FBQyxDQUFBO0lBRUQsSUFBSSxLQUFLLEdBQUcsVUFBVSxFQUFFO1FBQ3BCLEVBQUUsRUFBRSxDQUFBO0lBQ1IsQ0FBQyxDQUFBLENBQUMsc0NBQXNDO0lBRXhDLE1BQU0sQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxPQUFPLEVBQUUsS0FBSyxDQUFDLENBQUEsQ0FBQyw2RUFBNkU7QUFDN0gsQ0FBQyxDQUFBO0FBRUQsaUJBQVMsVUFBVSxDQUFBIn0=
|
4
dist/gulpbrowser.plugins.d.ts
vendored
Normal file
4
dist/gulpbrowser.plugins.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import 'typings-global';
|
||||||
|
export import through2 = require('through2');
|
||||||
|
export import path = require('path');
|
||||||
|
export import browserify = require('browserify');
|
6
dist/gulpbrowser.plugins.js
vendored
Normal file
6
dist/gulpbrowser.plugins.js
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
"use strict";
|
||||||
|
require("typings-global");
|
||||||
|
exports.through2 = require("through2");
|
||||||
|
exports.path = require("path");
|
||||||
|
exports.browserify = require("browserify");
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3VscGJyb3dzZXIucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2d1bHBicm93c2VyLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDBCQUF1QjtBQUN2Qix1Q0FBNEM7QUFDNUMsK0JBQW9DO0FBQ3BDLDJDQUFnRCJ9
|
1
dist/index.d.ts
vendored
Normal file
1
dist/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export import browserify = require("./gulpbrowser.browserify");
|
3
dist/index.js
vendored
Normal file
3
dist/index.js
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
"use strict";
|
||||||
|
exports.browserify = require("./gulpbrowser.browserify");
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEseURBQStEIn0=
|
29
index.js
29
index.js
@ -1,29 +0,0 @@
|
|||||||
/// <reference path="./index.ts" />
|
|
||||||
var GulpBrowserBrowserify;
|
|
||||||
(function (GulpBrowserBrowserify) {
|
|
||||||
function init() {
|
|
||||||
return function () {
|
|
||||||
//this is the trough object that gets returned by gulpBrowser.browserify();
|
|
||||||
return through.obj(function (file, enc, cb) {
|
|
||||||
var content = String(file.contents);
|
|
||||||
var basedir = file.base;
|
|
||||||
var bundleCallback = function (err, bundledBuffer) {
|
|
||||||
};
|
|
||||||
browserify(content).bundle(bundleCallback);
|
|
||||||
//run callback function to signal end of plugin process.
|
|
||||||
return cb(null, file);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
GulpBrowserBrowserify.init = init;
|
|
||||||
})(GulpBrowserBrowserify || (GulpBrowserBrowserify = {}));
|
|
||||||
/// <reference path="./typings/tsd.d.ts" />
|
|
||||||
/// <reference path="./modulebrowserify.ts" />
|
|
||||||
var through = require("through2");
|
|
||||||
var path = require("path");
|
|
||||||
var browserify = require("browserify");
|
|
||||||
var pr = require("pushrocks");
|
|
||||||
//create the return object
|
|
||||||
var gulpBrowser = {};
|
|
||||||
gulpBrowser.browserify = GulpBrowserBrowserify.init();
|
|
||||||
module.exports = gulpBrowser;
|
|
4
npmts.json
Normal file
4
npmts.json
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"mode":"default",
|
||||||
|
"coveralls":true
|
||||||
|
}
|
49
package.json
49
package.json
@ -1,37 +1,52 @@
|
|||||||
{
|
{
|
||||||
"name": "gulp-browser",
|
"name": "gulp-browser",
|
||||||
"version": "0.0.3",
|
"version": "3.0.4",
|
||||||
"description": "bundles browserify and other goodies for gulp",
|
"description": "browserify and other goodies for gulp",
|
||||||
"main": "index.js",
|
"main": "dist/index.js",
|
||||||
|
"typings": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(cd ts/compile && gulp)",
|
"test": "(npmts)",
|
||||||
"reinstall": "(rm -r node_modules && npm install)",
|
"reinstall": "(rm -r node_modules && npm install)",
|
||||||
"release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)",
|
"release": "(git pull origin master && npm version patch && git push origin master && git checkout release && git merge master && git push origin release && git checkout master)",
|
||||||
"startdev": "(git checkout master && git pull origin master)"
|
"update": "(git checkout master && git pull origin master && npm install)",
|
||||||
|
"upgrade": "(npm run update) && (ncu upgradeAll && npm install)"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/pushrocks/gulp-browser.git"
|
"url": "https://gitlab.com/pushrocks/gulp-browser.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"json",
|
"gulpplugin",
|
||||||
"jade",
|
"browserify",
|
||||||
"template"
|
"browser",
|
||||||
|
"TypeScript",
|
||||||
|
"typed"
|
||||||
],
|
],
|
||||||
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
|
"author": "Smart Coordination GmbH <office@push.rocks> (https://push.rocks)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/pushrocks/gulp-browser/issues"
|
"url": "https://gitlab.com/pushrocks/gulp-browser/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/pushrocks/gulp-browser",
|
"homepage": "https://gitlab.com/pushrocks/gulp-browser",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"browserify": "^11.2.0",
|
"@types/browserify": "^12.0.30",
|
||||||
"gutil": "^1.6.4",
|
"@types/q": "0.0.32",
|
||||||
"pushrocks": "^1.0.18",
|
"@types/through2": "^2.0.32",
|
||||||
"through2": "^2.0.0"
|
"browserify": "^13.1.1",
|
||||||
|
"q": "^1.4.1",
|
||||||
|
"through2": "^2.0.3",
|
||||||
|
"typings-global": "^1.0.14"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp": "3.9.0",
|
"@types/gulp": "^3.8.32",
|
||||||
"gulp-typescript": "2.9.2"
|
"@types/should": "^8.1.30",
|
||||||
|
"babel-preset-es2015": "^6.18.0",
|
||||||
|
"babelify": "^7.3.0",
|
||||||
|
"beautylog": "^6.0.0",
|
||||||
|
"gulp": "^3.9.1",
|
||||||
|
"gulp-function": "^2.2.3",
|
||||||
|
"npmts-g": "^5.2.10",
|
||||||
|
"should": "^11.1.2",
|
||||||
|
"typings-test": "^1.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1
test/test.d.ts
vendored
Normal file
1
test/test.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
import 'typings-test';
|
56
test/test.js
Normal file
56
test/test.js
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
"use strict";
|
||||||
|
require("typings-test");
|
||||||
|
const gulp = require("gulp");
|
||||||
|
const gulpBrowser = require("../dist/index.js");
|
||||||
|
const gulpFunction = require("gulp-function");
|
||||||
|
const q = require("q");
|
||||||
|
describe('gulpBrowser', function () {
|
||||||
|
describe('.browserify', function () {
|
||||||
|
it('should run through smoothly', function (done) {
|
||||||
|
this.timeout(30000);
|
||||||
|
let stream = gulp.src('./test/testBrowserifyNormal.js')
|
||||||
|
.pipe(gulpBrowser.browserify())
|
||||||
|
.pipe(gulp.dest('./test/result/'))
|
||||||
|
.pipe(gulpFunction.atEnd(() => {
|
||||||
|
let done2 = q.defer();
|
||||||
|
done();
|
||||||
|
done2.resolve();
|
||||||
|
return done2.promise;
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
it('should throw an error, when a module is not found', function (done) {
|
||||||
|
let d = require('domain').create();
|
||||||
|
let doneCalled = false;
|
||||||
|
d.on('error', function (error) {
|
||||||
|
if (!doneCalled) {
|
||||||
|
done();
|
||||||
|
doneCalled = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
d.run(function () {
|
||||||
|
let stream = gulp.src('./test/testBrowserifyError.js')
|
||||||
|
.pipe(gulpBrowser.browserify());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('should run through with an empty file', function (done) {
|
||||||
|
let stream = gulp.src('./test/testBrowserifyEmpty.js')
|
||||||
|
.pipe(gulpBrowser.browserify())
|
||||||
|
.pipe(gulp.dest('./test/result/'))
|
||||||
|
.pipe(gulpFunction.atEnd(done));
|
||||||
|
});
|
||||||
|
it('should run through work with transforms', function (done) {
|
||||||
|
this.timeout(30000);
|
||||||
|
let transforms = [
|
||||||
|
{
|
||||||
|
transform: 'babelify',
|
||||||
|
options: { presets: ['es2015'] }
|
||||||
|
}
|
||||||
|
];
|
||||||
|
let stream = gulp.src('./test/testBrowserifyNormal.js')
|
||||||
|
.pipe(gulpBrowser.browserify(transforms))
|
||||||
|
.pipe(gulp.dest('./test/result/'))
|
||||||
|
.pipe(gulpFunction.atEnd(done));
|
||||||
|
});
|
||||||
|
});
|
||||||
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-test'
|
||||||
|
|
||||||
|
import * as beautylog from 'beautylog'
|
||||||
|
import * as gulp from 'gulp'
|
||||||
|
import * as gulpBrowser from '../dist/index.js'
|
||||||
|
import * as gulpFunction from 'gulp-function'
|
||||||
|
|
||||||
|
import * as should from 'should'
|
||||||
|
import * as q from 'q'
|
||||||
|
|
||||||
|
|
||||||
|
describe('gulpBrowser', function () {
|
||||||
|
describe('.browserify', function () {
|
||||||
|
it('should run through smoothly', function (done) {
|
||||||
|
this.timeout(30000)
|
||||||
|
let stream = gulp.src('./test/testBrowserifyNormal.js')
|
||||||
|
.pipe(gulpBrowser.browserify())
|
||||||
|
.pipe(gulp.dest('./test/result/'))
|
||||||
|
.pipe(gulpFunction.atEnd(() => {
|
||||||
|
let done2 = q.defer()
|
||||||
|
done()
|
||||||
|
done2.resolve()
|
||||||
|
return done2.promise
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should throw an error, when a module is not found', function (done) {
|
||||||
|
let d = require('domain').create()
|
||||||
|
let doneCalled = false
|
||||||
|
d.on('error',function(error){
|
||||||
|
if (!doneCalled) {
|
||||||
|
done()
|
||||||
|
doneCalled = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
d.run(function() {
|
||||||
|
let stream = gulp.src('./test/testBrowserifyError.js')
|
||||||
|
.pipe(gulpBrowser.browserify())
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should run through with an empty file', function (done) {
|
||||||
|
let stream = gulp.src('./test/testBrowserifyEmpty.js')
|
||||||
|
.pipe(gulpBrowser.browserify())
|
||||||
|
.pipe(gulp.dest('./test/result/'))
|
||||||
|
.pipe(gulpFunction.atEnd(done))
|
||||||
|
})
|
||||||
|
it('should run through work with transforms', function (done) {
|
||||||
|
this.timeout(30000)
|
||||||
|
let transforms = [
|
||||||
|
{
|
||||||
|
transform: 'babelify',
|
||||||
|
options: {presets: ['es2015']}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
let stream = gulp.src('./test/testBrowserifyNormal.js')
|
||||||
|
.pipe(gulpBrowser.browserify(transforms))
|
||||||
|
.pipe(gulp.dest('./test/result/'))
|
||||||
|
.pipe(gulpFunction.atEnd(done))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
0
test/testBrowserifyEmpty.js
Normal file
0
test/testBrowserifyEmpty.js
Normal file
1
test/testBrowserifyError.js
Normal file
1
test/testBrowserifyError.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var myError = require("my-error");
|
2
test/testBrowserifyNormal.js
Normal file
2
test/testBrowserifyNormal.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
var beautylog = require("beautylog");
|
||||||
|
beautylog.log("it works");
|
@ -1,2 +0,0 @@
|
|||||||
nvm use v0.12.7
|
|
||||||
gulp
|
|
@ -1,16 +0,0 @@
|
|||||||
// import gulp
|
|
||||||
var gulp = require("gulp"),
|
|
||||||
gulpTypescript = require("gulp-typescript");
|
|
||||||
|
|
||||||
gulp.task('compileTS', function() {
|
|
||||||
var stream = gulp.src('../index.ts')
|
|
||||||
.pipe(gulpTypescript({
|
|
||||||
out: "index.js"
|
|
||||||
}))
|
|
||||||
.pipe(gulp.dest("../../"));
|
|
||||||
return stream;
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('default',['compileTS'], function() {
|
|
||||||
console.log('Typescript compiled');
|
|
||||||
});
|
|
@ -1,2 +0,0 @@
|
|||||||
# How to compile.
|
|
||||||
Make sure gulp and gulp-taypescript from npm are available. Then run the gulpfile in this directory.
|
|
49
ts/gulpbrowser.browserify.ts
Normal file
49
ts/gulpbrowser.browserify.ts
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
import * as stream from 'stream'
|
||||||
|
import plugins = require('./gulpbrowser.plugins')
|
||||||
|
import * as q from 'q'
|
||||||
|
|
||||||
|
let browserify = function (transforms = []) {
|
||||||
|
|
||||||
|
if (!Array.isArray(transforms)) {
|
||||||
|
transforms = [transforms]
|
||||||
|
}
|
||||||
|
|
||||||
|
let forEach = function (file, enc, cb) { // do this with every chunk (file in gulp terms)
|
||||||
|
|
||||||
|
let bundleCallback = function (err, bufferedContent) { // our bundle callback for when browserify is finished
|
||||||
|
if (Buffer.isBuffer(bufferedContent)) {
|
||||||
|
file.contents = bufferedContent
|
||||||
|
} else {
|
||||||
|
console.log('gulp-browser: .browserify() ' + err.message)
|
||||||
|
cb(new Error(err.message), file)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
cb(null, file)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file.contents.length > 0) {
|
||||||
|
let browserified = plugins.browserify(file, { basedir: file.base })
|
||||||
|
|
||||||
|
transforms.forEach(function (transform) {
|
||||||
|
if (typeof transform === 'function') {
|
||||||
|
browserified.transform(transform)
|
||||||
|
} else {
|
||||||
|
browserified.transform(transform.transform, transform.options)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
browserified.bundle(bundleCallback)
|
||||||
|
} else {
|
||||||
|
console.warn('gulp-browser: .browserify() file.contents appears to be empty')
|
||||||
|
cb(null, file)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
let atEnd = function (cb) {
|
||||||
|
cb()
|
||||||
|
} // no need to clean up after ourselves
|
||||||
|
|
||||||
|
return plugins.through2.obj(forEach, atEnd) // this is the through object that gets returned by gulpBrowser.browserify();
|
||||||
|
}
|
||||||
|
|
||||||
|
export = browserify
|
4
ts/gulpbrowser.plugins.ts
Normal file
4
ts/gulpbrowser.plugins.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import 'typings-global'
|
||||||
|
export import through2 = require('through2')
|
||||||
|
export import path = require('path')
|
||||||
|
export import browserify = require('browserify')
|
16
ts/index.ts
16
ts/index.ts
@ -1,15 +1 @@
|
|||||||
/// <reference path="./typings/tsd.d.ts" />
|
export import browserify = require("./gulpbrowser.browserify");
|
||||||
/// <reference path="./modulebrowserify.ts" />
|
|
||||||
|
|
||||||
var through = require("through2");
|
|
||||||
var gutil = require("gulp-util");
|
|
||||||
var path = require("path");
|
|
||||||
var browserify = require("browserify");
|
|
||||||
var pr = require("pushrocks");
|
|
||||||
|
|
||||||
//create the return object
|
|
||||||
var gulpBrowser:any = {};
|
|
||||||
|
|
||||||
gulpBrowser.browserify = GulpBrowserBrowserify.init();
|
|
||||||
|
|
||||||
module.exports = gulpBrowser;
|
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
/// <reference path="./index.ts" />
|
|
||||||
module GulpBrowserBrowserify {
|
|
||||||
export function init() {
|
|
||||||
return function() {
|
|
||||||
return through.obj((file, enc, cb) => { //this is the trough object that gets returned by gulpBrowser.browserify();
|
|
||||||
var content = String(file.contents); // get the content of the file
|
|
||||||
var bundleCallback = (err,bundledBuffer) => { //gets called by browserify, arrow function (TS) preserves this
|
|
||||||
file.contents = bundledBuffer;
|
|
||||||
this.push(file);
|
|
||||||
cb();
|
|
||||||
};
|
|
||||||
browserify(content).bundle(bundleCallback);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
15
ts/tsd.json
15
ts/tsd.json
@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "v4",
|
|
||||||
"repo": "borisyankov/DefinitelyTyped",
|
|
||||||
"ref": "master",
|
|
||||||
"path": "typings",
|
|
||||||
"bundle": "typings/tsd.d.ts",
|
|
||||||
"installed": {
|
|
||||||
"node/node.d.ts": {
|
|
||||||
"commit": "3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9"
|
|
||||||
},
|
|
||||||
"browserify/browserify.d.ts": {
|
|
||||||
"commit": "3191f6e0088eee07c4d8fd24e4d27a40a60d9eb9"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
41
ts/typings/browserify/browserify.d.ts
vendored
41
ts/typings/browserify/browserify.d.ts
vendored
@ -1,41 +0,0 @@
|
|||||||
// Type definitions for Browserify
|
|
||||||
// Project: http://browserify.org/
|
|
||||||
// Definitions by: Andrew Gaspar <https://github.com/AndrewGaspar/>
|
|
||||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
||||||
|
|
||||||
/// <reference path="../node/node.d.ts" />
|
|
||||||
|
|
||||||
interface BrowserifyObject extends NodeJS.EventEmitter {
|
|
||||||
add(file:string, opts?:any): BrowserifyObject;
|
|
||||||
require(file:string, opts?:{
|
|
||||||
expose: string;
|
|
||||||
}): BrowserifyObject;
|
|
||||||
bundle(opts?:{
|
|
||||||
insertGlobals?: boolean;
|
|
||||||
detectGlobals?: boolean;
|
|
||||||
debug?: boolean;
|
|
||||||
standalone?: string;
|
|
||||||
insertGlobalVars?: any;
|
|
||||||
}, cb?:(err:any, src:any) => void): NodeJS.ReadableStream;
|
|
||||||
|
|
||||||
external(file:string, opts?:any): BrowserifyObject;
|
|
||||||
ignore(file:string, opts?:any): BrowserifyObject;
|
|
||||||
transform(tr:string, opts?:any): BrowserifyObject;
|
|
||||||
transform(tr:Function, opts?:any): BrowserifyObject;
|
|
||||||
plugin(plugin:string, opts?:any): BrowserifyObject;
|
|
||||||
plugin(plugin:Function, opts?:any): BrowserifyObject;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Browserify {
|
|
||||||
(): BrowserifyObject;
|
|
||||||
(files:string[]): BrowserifyObject;
|
|
||||||
(opts:{
|
|
||||||
entries?: string[];
|
|
||||||
noParse?: string[];
|
|
||||||
}): BrowserifyObject;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module "browserify" {
|
|
||||||
var browserify: Browserify;
|
|
||||||
export = browserify;
|
|
||||||
}
|
|
2092
ts/typings/node/node.d.ts
vendored
2092
ts/typings/node/node.d.ts
vendored
File diff suppressed because it is too large
Load Diff
2
ts/typings/tsd.d.ts
vendored
2
ts/typings/tsd.d.ts
vendored
@ -1,2 +0,0 @@
|
|||||||
/// <reference path="node/node.d.ts" />
|
|
||||||
/// <reference path="browserify/browserify.d.ts" />
|
|
3
tslint.json
Normal file
3
tslint.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"extends": "tslint-config-standard"
|
||||||
|
}
|
Reference in New Issue
Block a user