|
18 | 18 |
|
19 | 19 | # VARIABLES # |
20 | 20 |
|
21 | | -# Define the command for generating distributable browser bundles: |
22 | | -DIST_BROWSER_BUNDLES ?= NODE_PATH="$(NODE_PATH)" $(NODE) \ |
23 | | - --max_old_space_size=4096 \ |
24 | | - --expose_gc \ |
25 | | - $(TOOLS_PKGS_DIR)/bundle/scripts/dist_browser_bundles |
| 21 | +# Define the command for listing distributable bundle package directories: |
| 22 | +DIST_PKG_DIRS ?= NODE_PATH="$(NODE_PATH)" $(NODE) \ |
| 23 | + $(DIST_DIR)/scripts/bundle_dirs.js |
26 | 24 |
|
27 | | -# Define the command-line options to be used when executing the command: |
28 | | -DIST_BROWSER_BUNDLES_FLAGS ?= |
| 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 |
29 | 28 |
|
30 | | -# Define the command for updating distributable browser bundle stats in the dist README: |
31 | | -UPDATE_DIST_README_BROWSER_BUNDLE_STATS ?= $(NODE) $(TOOLS_PKGS_DIR)/bundle/scripts/update_dist_readme_browser_bundle_stats |
| 29 | +# Define the command for updating distributable package versions: |
| 30 | +DIST_UPDATE_VERSIONS ?= NODE_PATH="$(NODE_PATH)" $(NODE) \ |
| 31 | + $(DIST_DIR)/scripts/update_versions.js |
32 | 32 |
|
33 | | -# Define the command-line options to be used when executing the command: |
34 | | -UPDATE_DIST_README_BROWSER_BUNDLE_STATS_FLAGS ?= |
| 33 | +# Define the command for verifying distributable package versions: |
| 34 | +DIST_VERIFY_VERSIONS ?= NODE_PATH="$(NODE_PATH)" $(NODE) \ |
| 35 | + $(DIST_DIR)/scripts/verify_versions.js |
35 | 36 |
|
36 | 37 |
|
37 | 38 | # RULES # |
38 | 39 |
|
39 | 40 | #/ |
40 | | -# Generates distributable browser bundles. |
| 41 | +# Generates distributable bundles. |
41 | 42 | # |
42 | 43 | # @example |
43 | | -# make dist-browser-bundles |
| 44 | +# make dist-bundles |
44 | 45 | #/ |
45 | | -dist-browser-bundles: $(NODE_MODULES) |
46 | | - $(QUIET) echo 'Generating distributable browser bundles...' |
47 | | - $(QUIET) $(DIST_BROWSER_BUNDLES) $(DIST_BROWSER_BUNDLES_FLAGS) |
48 | | - $(QUIET) for file in $(DIST_DIR)/*.min.js; do \ |
| 46 | +dist-bundles: $(NODE_MODULES) |
| 47 | + $(QUIET) echo 'Generating distributable bundles...' |
| 48 | + $(QUIET) $(DIST_BUILD_SCRIPTS) | grep '^[\/]\|^[a-zA-Z]:[/\]' | while read -r file; do \ |
| 49 | + echo ""; \ |
| 50 | + echo "Running build script: $$file"; \ |
| 51 | + NODE_PATH="$(NODE_PATH)" \ |
| 52 | + $(NODE) $$file || exit 1; \ |
| 53 | + done |
| 54 | + $(QUIET) for file in $(DIST_DIR)/*/build/*.min.js; do \ |
49 | 55 | echo "Compressing file: $$file"; \ |
50 | 56 | $(GZIP) "$$file" -9 -c > "$$file".gz; \ |
51 | 57 | done |
52 | 58 |
|
53 | | -.PHONY: dist-browser-bundles |
| 59 | +.PHONY: dist-bundles |
54 | 60 |
|
55 | 61 | #/ |
56 | | -# Updates a README file documenting distributable browser bundles to include the most recent bundle statistics. |
| 62 | +# Publishes distributable bundles to the npm package registry. |
57 | 63 | # |
58 | 64 | # @example |
59 | | -# make update-dist-readme-browser-bundle-stats |
| 65 | +# make publish-dist-bundles |
60 | 66 | #/ |
61 | | -update-dist-readme-browser-bundle-stats: $(NODE_MODULES) |
62 | | - $(QUIET) NODE_PATH="$(NODE_PATH)" $(UPDATE_DIST_README_BROWSER_BUNDLE_STATS) $(UPDATE_DIST_README_BROWSER_BUNDLE_STATS_FLAGS) |
| 67 | +publish-dist-bundles: $(NODE_MODULES) |
| 68 | + $(QUIET) $(DIST_UPDATE_VERSIONS) |
| 69 | + $(QUIET) $(DIST_VERIFY_VERSIONS) |
| 70 | + $(QUIET) $(DIST_PKG_DIRS) | grep '^[\/]\|^[a-zA-Z]:[/\]' | while read -r pkg; do \ |
| 71 | + echo ""; \ |
| 72 | + echo "Publishing package: $$pkg"; \ |
| 73 | + cd $$pkg; \ |
| 74 | + $(NPM) publish --access public || exit 1; \ |
| 75 | + done |
| 76 | + |
63 | 77 |
|
64 | | -.PHONY: update-dist-readme-browser-bundle-stats |
| 78 | +.PHONY: publish-dist-bundles |
0 commit comments