2222DIST_PKG_DIRS ?= NODE_PATH="$(NODE_PATH ) " $(NODE ) \
2323 $(DIST_DIR ) /scripts/bundle_dirs.js
2424
25- # Define the command for listing build scripts for generating distributable bundles:
26- DIST_BUILD_SCRIPTS ?= NODE_PATH="$(NODE_PATH ) " $(NODE ) \
27- $(DIST_DIR ) /scripts/bundle_scripts.js
28-
2925# Define the command for updating distributable package versions:
3026DIST_UPDATE_VERSIONS ?= NODE_PATH="$(NODE_PATH ) " $(NODE ) \
3127 $(DIST_DIR ) /scripts/update_versions.js
@@ -43,13 +39,13 @@ DIST_VERIFY_VERSIONS ?= NODE_PATH="$(NODE_PATH)" $(NODE) \
4339# @example
4440# make dist-bundles
4541# /
46- dist-bundles : $(NODE_MODULES ) clean-dist
42+ dist-bundles : $(NODE_MODULES )
4743 $(QUIET ) echo ' Generating bundles...'
48- $(QUIET ) $(DIST_BUILD_SCRIPTS ) | grep ' ^[\/]\|^[a-zA-Z]:[/\]' | while read -r file ; do \
44+ $(QUIET ) $(DIST_PKG_DIRS ) | grep ' ^[\/]\|^[a-zA-Z]:[/\]' | while read -r pkg ; do \
4945 echo " " ; \
50- echo " Running build script : $$ file " ; \
51- NODE_PATH= " $( NODE_PATH ) " \
52- $(NODE ) $$ file || exit 1; \
46+ echo " Building : $$ pkg " ; \
47+ cd $$ pkg ; \
48+ $(MAKE ) NODE_PATH= " $( NODE_PATH ) " || exit 1; \
5349 done
5450 $(QUIET ) echo ' Compressing bundles...'
5551 $(QUIET ) for file in $( DIST_DIR) /* /build/* .min.js; do \
@@ -61,12 +57,12 @@ dist-bundles: $(NODE_MODULES) clean-dist
6157.PHONY : dist-bundles
6258
6359# /
64- # Publishes distributable bundles to the npm package registry.
60+ # Publishes packages containing distributable bundles to the npm package registry.
6561#
6662# @example
67- # make publish- dist-bundles
63+ # make dist-bundles-publish
6864# /
69- publish- dist-bundles : $(NODE_MODULES ) dist-bundles
65+ dist-bundles-publish : $(NODE_MODULES ) dist-bundles
7066 $(QUIET ) echo ' Updating package versions...'
7167 $(QUIET ) $(DIST_UPDATE_VERSIONS )
7268 $(QUIET ) echo ' Verifying package versions...'
@@ -76,11 +72,31 @@ publish-dist-bundles: $(NODE_MODULES) dist-bundles
7672 echo " " ; \
7773 echo " Publishing package: $$ pkg" ; \
7874 cd $$ pkg; \
79- $(NPM ) publish --access public || exit 1; \
75+ $(NPM ) publish --access public --dry-run || exit 1; \
8076 done
8177 $(QUIET ) echo ' Finished publishing packages.'
8278
83- .PHONY : publish-dist-bundles
79+ .PHONY : dist-bundles-publish
80+
81+ # /
82+ # Performs a dry run of publishing packages containing distributable bundles to the npm package registry.
83+ #
84+ # @example
85+ # make dist-bundles-publish-dry-run
86+ # /
87+ dist-bundles-publish-dry-run : $(NODE_MODULES )
88+ $(QUIET ) echo ' (dry run) Verifying package versions...'
89+ $(QUIET ) $(DIST_VERIFY_VERSIONS )
90+ $(QUIET ) echo ' (dry run) Publishing packages...'
91+ $(QUIET ) $(DIST_PKG_DIRS ) | grep ' ^[\/]\|^[a-zA-Z]:[/\]' | while read -r pkg; do \
92+ echo " " ; \
93+ echo " (dry run) Publishing package: $$ pkg" ; \
94+ cd $$ pkg; \
95+ $(NPM ) publish --access public --dry-run || exit 1; \
96+ done
97+ $(QUIET ) echo ' (dry run) Finished publishing packages.'
98+
99+ .PHONY : dist-bundles-publish-dry-run
84100
85101# /
86102# Removes distributable bundle build artifacts.
@@ -93,7 +109,8 @@ clean-dist:
93109 $(QUIET ) $(DIST_PKG_DIRS ) | grep ' ^[\/]\|^[a-zA-Z]:[/\]' | while read -r pkg; do \
94110 echo " " ; \
95111 echo " Removing build artifacts for package: $$ pkg" ; \
96- rm -rf $$ pkg/build || exit 1; \
112+ cd $$ pkg; \
113+ $(MAKE ) clean; \
97114 done
98115 $(QUIET ) echo ' Finished removing build artifacts.'
99116
0 commit comments