forked from reactioncommerce/reaction
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plugin loader (reactioncommerce#1162)
* convert register.js to json for plugins * build base of plugin/registry loader * add tag and navbar ui register.json * fix missing import for theme registerTheme * write imports to plugins.js on client and server * stop saving imports to database * clarify variable naming * update gitignore * automatically import any plugins that exist * add warning message to plugin imports files * switch registry files back to js * add bash version of plugin loader for Docker build * refactor development plugin loader to use JS registry files * remove manual plugin imports * only use JS plugin loader in development * setup plugin imports in CircleCI * make Docker scripts executable * less specific NODE_ENV for plugin loader * remove unnecessary plugin loader script from CI * put plugin loader script back in CI
- Loading branch information
1 parent
2b3df21
commit 6ab0e6b
Showing
27 changed files
with
236 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
node_modules | ||
lib-cov | ||
*.seed | ||
*.log | ||
.DS_Store | ||
.fileStorage/ | ||
.idea | ||
*.csv | ||
*.dat | ||
*.gz | ||
*.log | ||
*.out | ||
*.pid | ||
*.gz | ||
*.seed | ||
*.sublime-project | ||
*.sublime-workspace | ||
.idea | ||
.DS_Store | ||
|
||
pids | ||
jsdoc.json | ||
lib-cov | ||
logs | ||
results | ||
node_modules | ||
npm-debug.log | ||
.fileStorage/ | ||
packages/reaction-core/lib/bower | ||
pids | ||
results | ||
|
||
jsdoc.json | ||
client/plugins.js | ||
server/plugins.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# set the plugin import file paths | ||
CLIENT_PLUGINS_FILE=./client/plugins.js | ||
SERVER_PLUGINS_FILE=./server/plugins.js | ||
|
||
# clear any contents in the import files | ||
> ./client/plugins.js | ||
> ./server/plugins.js | ||
|
||
# define plugin subdirectories | ||
PLUGIN_SUB_DIRS=("core" "custom" "included") | ||
|
||
# generate plugin import files on client and server | ||
for plugins in "${PLUGIN_SUB_DIRS[@]}"; do | ||
for dir in $(find ./imports/plugins/$plugins -mindepth 1 -maxdepth 1 -type d); do | ||
if [[ -f "$dir/client/index.js" ]]; then | ||
IMPORT_PATH=$(echo "$dir/client/index.js" | cut -c2-) | ||
echo "import \"$IMPORT_PATH\"" >> $CLIENT_PLUGINS_FILE | ||
fi | ||
if [[ -f "$dir/server/index.js" ]]; then | ||
IMPORT_PATH=$(echo "$dir/server/index.js" | cut -c2-) | ||
echo "import \"$IMPORT_PATH\"" >> $SERVER_PLUGINS_FILE | ||
fi | ||
if [[ -f "$dir/register.js" ]]; then | ||
IMPORT_PATH=$(echo "$dir/register.js" | cut -c2-) | ||
echo "import \"$IMPORT_PATH\"" >> $SERVER_PLUGINS_FILE | ||
fi | ||
done | ||
done |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "./theme"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { Reaction } from "/server/api"; | ||
|
||
// Register Themes | ||
Reaction.registerTheme(Assets.getText("themes/notFound.css")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
import { Reaction } from "/server/api"; | ||
|
||
Reaction.registerTheme(Assets.getText("themes/navbar.css")); | ||
Reaction.registerPackage({ | ||
label: "UI Navbar", | ||
name: "reaction-ui-navbar", | ||
autoEnable: true | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Reaction } from "/server/api"; | ||
|
||
Reaction.registerTheme(Assets.getText("themes/navbar.css")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Reaction } from "/server/api"; | ||
|
||
Reaction.registerPackage({ | ||
label: "UI TagNav", | ||
name: "reaction-ui-tagnav", | ||
autoEnable: true | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,5 +41,3 @@ Reaction.registerPackage({ | |
} | ||
}] | ||
}); | ||
|
||
Reaction.registerTheme(Assets.getText("themes/button.css")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Reaction } from "/server/api"; | ||
|
||
Reaction.registerTheme(Assets.getText("themes/button.css")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,7 @@ export const Registry = new SimpleSchema({ | |
} | ||
}); | ||
|
||
|
||
/** | ||
* PackageConfig Schema | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.