Skip to content

Commit 3a5a45d

Browse files
committed
add easy syntax for building/testing certain elements
1 parent f2462c4 commit 3a5a45d

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"scripts": {
44
"start": "npm run doc-listing-inject && spandx",
55
"lerna": "lerna",
6-
"test": "npm run build && wct --configFile wct.conf.json test/index.html",
6+
"test": "bash scripts/test.sh",
77
"dev": "bash scripts/dev.sh",
8-
"build": "lerna run build",
8+
"build": "bash scripts/build.sh",
99
"clean": "rm -rf node_modules package-lock.json {elements,themes}/*/{node_modules,package-lock.json}",
1010
"bootstrap": "lerna bootstrap --hoist",
1111
"postinstall": "npm run bootstrap",

scripts/build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
CMD="npm run lerna -- run build --parallel --no-bail --include-filtered-dependencies"
4+
5+
for el in "$@"; do
6+
CMD="$CMD --scope \"*/$el\""
7+
done
8+
9+
eval $CMD

scripts/test.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
CMD="npm run build $@; ./node_modules/.bin/wct --configFile wct.conf.json"
4+
5+
for el in "$@"; do
6+
if [[ "$el" == "-p" ]]; then
7+
CMD="$CMD -p"
8+
else
9+
CMD="$CMD \"elements/$el/test/\""
10+
fi
11+
done
12+
13+
eval $CMD

0 commit comments

Comments
 (0)