Skip to content

Commit

Permalink
[#98] Added support to install FE packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Jan 16, 2024
1 parent 26e290c commit 455eab8
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .devtools/build-codebase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ echo "> Symlink module code."
rm -rf "build/web/modules/custom" >/dev/null && mkdir -p "build/web/modules/custom/${module}"
ln -s "$(pwd)"/* "build/web/modules/custom/${module}" && rm "build/web/modules/custom/${module}/build"

# If front-end dependencies are used in the project, package-lock.json is
# expected to be committed to the repository.
if [ -f "build/web/modules/custom/${module}/package-lock.json" ]; then
pushd "build/web/modules/custom/${module}" >/dev/null || exit 1
echo "> Install front-end dependencies."
[ -f ".nvmrc" ] && nvm use || true
[ ! -d "node_modules" ] && npm ci || true
echo "> Build front-end dependencies."
npm run build
popd >/dev/null || exit 1
fi

echo
echo "-------------------------------"
echo " Codebase built 🚀 "
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Alex Skrypnyk",
"email": "alex@drevops.com",
"homepage": "https://www.drupal.org/u/alexskrypnyk",
"name": "Your Name",
"email": "yourproject@yournamespace.com",
"homepage": "https://www.drupal.org/u/yourusername",
"role": "Maintainer"
}
],
Expand Down
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@drupal/drupal_module_scaffold",
"version": "0.1.0",
"description": "Drupal module scaffold FE example used for template testing.",
"license": "GPL-2.0-or-later",
"contributors": [],
"scripts": {
"lint": "echo Would run code lint",
"lint-fix": "echo Would run code lint fix",
"test": "echo Would run tests",
"build": "echo Would run build"
},
"engines" : {
"npm" : ">=8.0.0",
"node" : ">=16.0.0"
},
"dependencies": {}
}

0 comments on commit 455eab8

Please sign in to comment.