Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnysideup committed Apr 28, 2021
2 parents de7789d + efba845 commit 560869e
Show file tree
Hide file tree
Showing 8 changed files with 333 additions and 102 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.js]
[*.js, *.json, *.scss]
charset = utf-8
end_of_line = lf
indent_size = 2
Expand Down
65 changes: 65 additions & 0 deletions bin/webpack-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
WORKING_DIR=$(pwd)


help_and_exit() {
echo " ---------------------------------";
echo " Available settings:";
echo " ---------------------------------";
echo " NONE"
echo " ---------------------------------";
echo " Example usage:"
echo " ---------------------------------";
echo " webpack-build themes/my-theme";
echo " webpack-build vendor/my-vendor/my-package";
echo " ---------------------------------";
echo " NB. Make sure to run this from "
echo " the base folder of your project."
echo " ---------------------------------";
echo " "
echo " "
echo " "
exit;
}

dir='./'

while (( $# )); do
case $1 in
-*) printf 'Unknown option: %q\n\n' "$1";
help_and_exit 1 ;;
*) dir=$1;;
esac
shift
done

echo " "
echo " "
echo " ---------------------------------";
echo " Running webpack-build";
echo " ---------------------------------";
echo " Directory of script: $SCRIPT_DIR";
echo " Directory of webpack: $WORKING_DIR/themes/sswebpack_engine_only";
echo " Directory of project modules: $dir/my_node_modules/ "
echo " Distilled director: $dir/dist"
echo " ---------------------------------";
echo " "
echo " "

echo " ---------------------------"
echo " Changing directory to $dir "
echo " ---------------------------"
cd $dir
echo " "

echo "-----------------------------"
echo "start build"
echo "-----------------------------"
cd themes/sswebpack_engine_only/
npm run build --theme_dir=$dir --dist_dir=$dir/dist


echo " ################################################"
echo " ################################################"
echo " ################################################"
65 changes: 65 additions & 0 deletions bin/webpack-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
WORKING_DIR=$(pwd)


help_and_exit() {
echo " ---------------------------------";
echo " Available settings:";
echo " ---------------------------------";
echo " NONE"
echo " ---------------------------------";
echo " Example usage:"
echo " ---------------------------------";
echo " webpack-dev themes/my-theme";
echo " webpack-dev vendor/my-vendor/my-package";
echo " ---------------------------------";
echo " NB. Make sure to run this from "
echo " the base folder of your project."
echo " ---------------------------------";
echo " "
echo " "
echo " "
exit;
}

dir='./'

while (( $# )); do
case $1 in
-*) printf 'Unknown option: %q\n\n' "$1";
help_and_exit 1 ;;
*) dir=$1;;
esac
shift
done

echo " "
echo " "
echo " ---------------------------------";
echo " Running webpack-dev";
echo " ---------------------------------";
echo " Directory of script: $SCRIPT_DIR";
echo " Directory of webpack: $WORKING_DIR/themes/sswebpack_engine_only";
echo " Directory of project modules: $dir/my_node_modules/ "
echo " Distilled director: $dir/dist"
echo " ---------------------------------";
echo " "
echo " "

echo " ---------------------------"
echo " Changing directory to $dir "
echo " ---------------------------"
cd $dir
echo " "

echo "-----------------------------"
echo "start dev"
echo "-----------------------------"
cd themes/sswebpack_engine_only/
npm run dev --theme_dir=$dir --dist_dir=$dir/dist


echo " ################################################"
echo " ################################################"
echo " ################################################"
64 changes: 64 additions & 0 deletions bin/webpack-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
WORKING_DIR=$(pwd)


help_and_exit() {
echo " ---------------------------------";
echo " Available settings:";
echo " ---------------------------------";
echo " NONE"
echo " ---------------------------------";
echo " Example usage:"
echo " ---------------------------------";
echo " webpack-install themes/my-theme";
echo " webpack-install vendor/my-vendor/my-package";
echo " ---------------------------------";
echo " NB. Make sure to run this from "
echo " the base folder of your project."
echo " ---------------------------------";
echo " "
echo " "
echo " "
exit;
}

dir='./'

while (( $# )); do
case $1 in
-*) printf 'Unknown option: %q\n\n' "$1";
help_and_exit 1 ;;
*) dir=$1;;
esac
shift
done

echo " "
echo " "
echo " ---------------------------------";
echo " Running install";
echo " ---------------------------------";
echo " Directory of script: $SCRIPT_DIR";
echo " Directory of webpack: $WORKING_DIR/themes/sswebpack_engine_only";
echo " Directory of project modules: $dir/my_node_modules/ "
echo " ---------------------------------";
echo " "
echo " "

echo " ---------------------------"
echo " Changing directory to $dir "
echo " ---------------------------"
cd $dir
echo " "

cd themes/sswebpack_engine_only/
npm install
cd -
cd $dir/my_node_modules/
npm install
cd -

echo " ################################################"
echo " ################################################"
echo " ################################################"
65 changes: 65 additions & 0 deletions bin/webpack-watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
WORKING_DIR=$(pwd)


help_and_exit() {
echo " ---------------------------------";
echo " Available settings:";
echo " ---------------------------------";
echo " NONE"
echo " ---------------------------------";
echo " Example usage:"
echo " ---------------------------------";
echo " webpack-watch themes/my-theme";
echo " webpack-watch vendor/my-vendor/my-package";
echo " ---------------------------------";
echo " NB. Make sure to run this from "
echo " the base folder of your project."
echo " ---------------------------------";
echo " "
echo " "
echo " "
exit;
}

dir='./'

while (( $# )); do
case $1 in
-*) printf 'Unknown option: %q\n\n' "$1";
help_and_exit 1 ;;
*) dir=$1;;
esac
shift
done

echo " "
echo " "
echo " ---------------------------------";
echo " Running webpack-watch";
echo " ---------------------------------";
echo " Directory of script: $SCRIPT_DIR";
echo " Directory of webpack: $WORKING_DIR/themes/sswebpack_engine_only";
echo " Directory of project modules: $dir/my_node_modules/ "
echo " Distilled director: $dir/dist"
echo " ---------------------------------";
echo " "
echo " "

echo " ---------------------------"
echo " Changing directory to $dir "
echo " ---------------------------"
cd $dir
echo " "

echo "-----------------------------"
echo "start watch"
echo "-----------------------------"
cd themes/sswebpack_engine_only/
npm run watch --theme_dir=$dir --dist_dir=$dir/dist


echo " ################################################"
echo " ################################################"
echo " ################################################"
58 changes: 32 additions & 26 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
{
"name": "sunnysideup/sswebpack_engine_only",
"type": "silverstripe-theme",
"description": "Webpack engine for Silverstripe without any theme at all. Inspired and HUGE THANK YOU to: andrewhaine/silverstripe-webpack-theme",
"keywords": [
"Silverstripe-CMS",
"CMS",
"Silverstripe",
"webpack",
"webpack theme",
"silverstripe webpack",
"blank theme",
"front-end framework"
],
"license": "BSD-3-Clause",
"authors": [
{
"name": "Nicolaas Francken",
"email": "modules@sunnysideup.co.nz",
"role": "lead developer"
}
],
"require": {
"silverstripe/framework": "~4.0"
},
"suggest": {
"sunnysideup/webpack_requirements_backend": "Make it work with Silvertripe"
"name": "sunnysideup/sswebpack_engine_only",
"type": "silverstripe-theme",
"description": "Webpack engine for Silverstripe without any theme at all. Inspired and HUGE THANK YOU to: andrewhaine/silverstripe-webpack-theme",
"keywords": [
"Silverstripe-CMS",
"CMS",
"Silverstripe",
"webpack",
"webpack theme",
"silverstripe webpack",
"blank theme",
"front-end framework"
],
"license": "BSD-3-Clause",
"authors": [
{
"name": "Nicolaas Francken",
"email": "modules@sunnysideup.co.nz",
"role": "lead developer"
}
],
"require": {
"silverstripe/framework": "~4.0"
},
"suggest": {
"sunnysideup/webpack_requirements_backend": "Make it work with Silvertripe"
},
"bin": [
"bin/webpack-install",
"bin/webpack-dev",
"bin/webpack-watch",
"bin/webpack-build"
]
}
Loading

0 comments on commit 560869e

Please sign in to comment.