@leverege/build-tools 2.2.14 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -80,7 +80,7 @@ var Packleator = /*#__PURE__*/function () {
80
80
 
81
81
  var args = options.args;
82
82
  this.privatePackages = new Set();
83
- this.args = args ? _objectSpread({}, args, {
83
+ this.args = args ? _objectSpread(_objectSpread({}, args), {}, {
84
84
  output: args.output.substr(-1) === '/' ? args.output.substr(0, args.output.length) : args.output
85
85
  }) : {}; // args || {}
86
86
 
@@ -125,7 +125,7 @@ function _main() {
125
125
  break;
126
126
 
127
127
  case 4:
128
- packleator = new Packleator(_objectSpread({}, defaultConfig, {
128
+ packleator = new Packleator(_objectSpread(_objectSpread({}, defaultConfig), {}, {
129
129
  args: args
130
130
  }));
131
131
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.2.14",
3
+ "version": "2.3.0",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,6 +29,8 @@
29
29
  "helminit-scaler": "src/helminit-scaler",
30
30
  "helmup": "src/helmup",
31
31
  "k8x": "src/k8x",
32
+ "npm-link": "src/npm-link",
33
+ "npm-unlink": "src/npm-unlink",
32
34
  "overwhelm": "src/overwhelm",
33
35
  "packleate": "lib/web/packleate/index.js",
34
36
  "pkgck": "src/pkgck",
package/src/helmup CHANGED
@@ -340,7 +340,7 @@ EOK8S
340
340
  exit 1
341
341
  fi
342
342
 
343
- npm run ahoy
343
+ overwhelm
344
344
  [ $? -ne 0 ] && printf "\n\n***Aborting helmup...\n\n" && exit 1
345
345
 
346
346
  helm repo update &> /dev/null # && helm search leverege
package/src/npm-link ADDED
@@ -0,0 +1,102 @@
1
+ #!/bin/bash
2
+
3
+ # Simple ANSI color coded string generator.
4
+ function color() {
5
+ local color=
6
+ case "$1" in
7
+ 'g') color="92m" ;; # green
8
+ 'c') color="96m" ;; # lt blue
9
+ 'y') color="93m" ;; # yellow
10
+ 'r') color="91m" ;; # red
11
+ 'toast') color="1;3;7;91;103;5m" ;;
12
+ esac
13
+ printf "\e[$color$2\e[0m"
14
+ }
15
+
16
+ # Set LEVEREGE_MODULES to point to the directory containing the various
17
+ # local @leverege repositories that you want to link to for local testing.
18
+ #
19
+ [ -z "$LEVEREGE_MODULES" ] \
20
+ && cat<<EXPECT && exit 1
21
+
22
+ Expecting the `color g "LEVEREGE_MODULES"` variable to be set to the location of the
23
+ directory containing the local `color y "@leverege"` git repositories to link to.
24
+
25
+ `color g "export LEVEREGE_MODULES=\""``color y "<your core @leverege repo directory>"``color g \"`
26
+
27
+ EXPECT
28
+
29
+ GITTOP=`git rev-parse --show-toplevel` && cd $GITTOP
30
+ HOLDING_CELL=".holding-cell"
31
+
32
+ MODULES="node_modules/@leverege"
33
+ [ ! -d $MODULES ] && \
34
+ cat<<NO_NODE_MODULES && exit 1
35
+
36
+ Missing $MODULES - maybe do an npm install first?
37
+
38
+ NO_NODE_MODULES
39
+
40
+ function linkTheModules() {
41
+ [ -z "$1" ] && return
42
+ MOVE_COUNT=0
43
+ for TARGET in $(find $MODULES -not \( -path \*$HOLDING_CELL -prune \) \
44
+ -type d -name $1)
45
+ do
46
+ # printf "`color y \"DEBUG: Linking $TARGET\"`\n"
47
+
48
+ LIBRARY=`basename $TARGET`
49
+ DUNGEON="`dirname $TARGET`/$HOLDING_CELL"
50
+ LOCALIB="$LEVEREGE_MODULES/$LIBRARY"
51
+
52
+ [ ! -d $LOCALIB ] && \
53
+ cat<<MISSING_LIB && continue
54
+
55
+ Skipping missing local library => $LOCALIB
56
+ You may need git clone it to link it.
57
+
58
+ MISSING_LIB
59
+
60
+ mkdir -p $DUNGEON
61
+ mv $TARGET $DUNGEON
62
+ ln -sf $LOCALIB $TARGET
63
+ MOVE_COUNT=$((MOVE_COUNT + 1 ))
64
+ done
65
+ }
66
+
67
+ function showTheModules() {
68
+ if [ ! -d $MODULES/$HOLDING_CELL ];
69
+ then
70
+ cat<<NO_HOLDING_CELL
71
+
72
+ `color y "Zero linked libraries found."` Try using: `color g "npm-link <thing>"`
73
+
74
+ NO_HOLDING_CELL
75
+ return 1
76
+ fi
77
+
78
+ cat<<IN_THE_CELLS
79
+
80
+ `color g "@leverege modules currently linked"`:
81
+
82
+ IN_THE_CELLS
83
+
84
+ for HELD in $(/bin/ls $MODULES/$HOLDING_CELL)
85
+ do
86
+ printf " => `color y $HELD`\n"
87
+ done
88
+ echo ""
89
+ }
90
+
91
+ echo ""
92
+ for LIBRARY in "$@"
93
+ do
94
+ if [ ! -d "$LEVEREGE_MODULES/$LIBRARY" ];
95
+ then
96
+ printf " Unknown library: `color r $LEVEREGE_MODULES/$LIBRARY`\n"
97
+ continue
98
+ fi
99
+ linkTheModules $LIBRARY
100
+ done
101
+
102
+ showTheModules
package/src/npm-unlink ADDED
@@ -0,0 +1,54 @@
1
+ #!/bin/bash
2
+
3
+ # Simple ANSI color coded string generator.
4
+ function color() {
5
+ local color=
6
+ case "$1" in
7
+ 'g') color="92m" ;; # green
8
+ 'c') color="96m" ;; # lt blue
9
+ 'y') color="93m" ;; # yellow
10
+ 'r') color="91m" ;; # red
11
+ 'toast') color="1;3;7;91;103;5m" ;;
12
+ esac
13
+ printf "\e[$color$2\e[0m"
14
+ }
15
+
16
+ # Set LEVEREGE_MODULES to point to the directory containing the various
17
+ # local @leverege repositories that you want to link to for local testing.
18
+ #
19
+ [ -z "$LEVEREGE_MODULES" ] \
20
+ && cat<<EXPECT && exit 1
21
+
22
+ Expecting LEVEREGE_MODULES variable to be set to the directory containing
23
+ the local @leverege repositories to test with
24
+
25
+ export LEVEREGE_MODULES="<your @leverege subdir>".
26
+
27
+ EXPECT
28
+
29
+ GITTOP=`git rev-parse --show-toplevel` && cd $GITTOP
30
+ HOLDING_CELL=".holding-cell"
31
+
32
+ MODULES="node_modules/@leverege"
33
+ [ ! -d "$MODULES/$HOLDING_CELL" ] && exit 1
34
+
35
+ for CELLS in $(find $MODULES -type d -depth -name $HOLDING_CELL)
36
+ do
37
+ printf "\n Cleaning out cell: `color g $CELLS`\n"
38
+ for LIB in $CELLS/*
39
+ do
40
+ LIBRARY=`basename $LIB`
41
+ DUNGEON=`dirname $LIB`
42
+ [ ! -L "$DUNGEON/../$LIBRARY" ] && \
43
+ cat<<MISSING_LIB && continue
44
+
45
+ Not seeing a symlink for $LIBRARY - are you certain you linked it?
46
+
47
+ MISSING_LIB
48
+ printf " Unlinking library: `color y $LIB`\n"
49
+ rm -f "$DUNGEON/../$LIBRARY"
50
+ mv $LIB "$DUNGEON/.."
51
+ done
52
+ rmdir $DUNGEON
53
+ done
54
+ echo ""