dcp-client 4.4.14 → 4.4.15

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.
@@ -0,0 +1,11 @@
1
+ #! /bin/bash
2
+ #
3
+ # @file post-publish
4
+ # Hook which tags the package in git with the package version
5
+ # as it gets published.
6
+ # @author Wes Garland, wes@distributive.network
7
+ # @date Nov 2022
8
+ #
9
+ cd `dirname "$0"`/..
10
+ PACKAGE_VERSION=$(cat package.json | egrep '^\s*"version":' | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]')
11
+ git tag v$PACKAGE_VERSION && git push --tags
@@ -0,0 +1,53 @@
1
+ #! /bin/bash
2
+ # @file prepack
3
+ # Hook which generates the bundle on pack (or publish), and ensures that we only publish
4
+ # release packages.
5
+ # @author Wes Garland, wes@distributive.network
6
+ # @date Oct 2024
7
+
8
+ set -e
9
+ cd `dirname "$0"`/..
10
+ DCP_VERSION=$(node -p "require('./package').dcp.version")
11
+
12
+ if [ $(git rev-parse --abbrev-ref HEAD) != "release" ]; then
13
+ BUILD_TYPE="debug"
14
+ else
15
+ BUILD_TYPE="release"
16
+ fi
17
+
18
+ if [ ! -d node_modules ]; then
19
+ echo "node_modules missing; please run npm ci before packing" >&2
20
+ exit 1
21
+ fi
22
+
23
+ if [ ! "${NPM_PREPACK_SKIP_BUNDLE_REBUILD}" ]; then
24
+ if ! [ -d .dcp-build ]; then
25
+ git clone --filter=blob:none $(node -p "require('./package').dcp.repository") .dcp-build
26
+ else
27
+ git fetch
28
+ fi
29
+
30
+ (
31
+ for var in $(compgen -e | grep '^npm_')
32
+ do
33
+ eval unset ${var}
34
+ done
35
+ set > /tmp/q
36
+ cd .dcp-build
37
+ git checkout "$DCP_VERSION"
38
+ ./configure.sh --with-build="${BUILD_TYPE}" --disable-evaluator
39
+ npm ci
40
+ cd ..
41
+ build/bundle --no-cache --dcp=.dcp-build --build="${BUILD_TYPE}"
42
+ )
43
+ fi
44
+
45
+ if [ "${DCP_VERSION}" != $(node -r ./index -p "require('dcp/build').version") ]; then
46
+ echo "Bundle built from wrong version of DCP repo!" >&2
47
+ exit 1
48
+ fi
49
+
50
+ if [ $(node -r ./index -p "require('dcp/build').config.build") != "${BUILD_TYPE}" ]; then
51
+ echo "Bundle is not a ${BUILD_TYPE} build!" >&2
52
+ exit 1
53
+ fi
@@ -0,0 +1,49 @@
1
+ #! /bin/bash
2
+ #
3
+ # @file pre-publish
4
+ # Hook which prevents package publishing if the repository
5
+ # isn't in a nice, clean state.
6
+ # @author Wes Garland, wes@distributive.network
7
+ # @date Nov 2022
8
+ #
9
+ cd `dirname "$0"`/..
10
+
11
+ yellow='\e[33m'
12
+ normal='\e[0m'
13
+
14
+ git ls-files --error-unmatch `find . -type f | egrep -v '^\./(node_modules|\.git|\.dcp-build|build)'` >/dev/null
15
+ if [ "$?" != "0" ]; then
16
+ echo
17
+ echo -e "${yellow}pre-publish: abort due to files in package which aren't in repo${normal}" >/dev/stderr
18
+ echo
19
+ exit 1
20
+ fi
21
+
22
+ (git status --porcelain; echo DONE DONE) \
23
+ | egrep -v '^ M dist/' \
24
+ | while read status filename
25
+ do
26
+ case "$status" in
27
+ "M")
28
+ echo "${filename} is not checked in"
29
+ EXITCODE=1
30
+ ;;
31
+ "DONE")
32
+ exit $EXITCODE
33
+ ;;
34
+ *)
35
+ ;;
36
+ esac
37
+ done
38
+ if [ "$?" != "0" ]; then
39
+ echo
40
+ echo -e "${yellow}pre-publish: abort due to modified files${normal}" >/dev/stderr
41
+ echo
42
+ exit 1
43
+ fi
44
+
45
+ if [ $(git rev-parse --abbrev-ref HEAD) != "release" ]; then
46
+ echo "${yellow}pre-publish: this is not the release branch!" >&2
47
+ exit 1
48
+ fi
49
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dcp-client",
3
- "version": "4.4.14",
3
+ "version": "4.4.15",
4
4
  "description": "Core libraries for accessing DCP network",
5
5
  "keywords": [
6
6
  "dcp"