Skip to content

Commit 18eb60b

Browse files
committed
Add support for generating a bundle containing iterator utilities
1 parent 173e3c8 commit 18eb60b

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

dist/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,24 @@ The specialized bundle, `stdlib-stats-base-dists-flat`, contains low-level stati
167167

168168
<!-- </bundle-stats> -->
169169

170+
#### Iterators
171+
172+
The specialized bundle, `stdlib-iter-flat`, contains iterator utilities and exposes them as a `flat` namespace.
173+
174+
```html
175+
<script type="text/javascript" src="/path/to/stdlib-iter-flat.min.js"></script>
176+
<script type="text/javascript">
177+
// If no recognized module system present, exposed to global scope:
178+
var iterErf = stdlib_iter_flat.iterErf;
179+
</script>
180+
```
181+
182+
##### Bundle Statistics
183+
184+
<!-- <bundle-stats files="stdlib-iter-flat.js,stdlib-iter-flat.min.js,stdlib-iter-flat.min.js.gz"> -->
185+
186+
<!-- </bundle-stats> -->
187+
170188
#### Plot
171189

172190
The specialized bundle, `stdlib-plot-flat`, contains plot functionality and exposes this functionality as a `flat` namespace.

lib/node_modules/@stdlib/_tools/bundle/scripts/dist_browser_bundles

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,30 @@ var bundles = [
319319
'@stdlib/repl/help'
320320
]
321321
},
322+
{
323+
'name': 'stdlib-iter-flat',
324+
'standalone': 'stdlib_iter_flat',
325+
'namespace': 'flat',
326+
'raw': true,
327+
'minified': true,
328+
'include': [
329+
// WARNING: this list is fragile, as we must manually update the list of what to include as packages across namespaces change, are added, and/or are removed.
330+
'@stdlib/array/from-iterator',
331+
'@stdlib/array/to-circular-iterator',
332+
'@stdlib/array/to-iterator',
333+
'@stdlib/array/to-iterator-right',
334+
'@stdlib/array/to-sparse-iterator',
335+
'@stdlib/array/to-sparse-iterator-right',
336+
'@stdlib/array/to-strided-iterator',
337+
'@stdlib/array/to-view-iterator',
338+
'@stdlib/array/to-view-iterator-right',
339+
'@stdlib/iter',
340+
'@stdlib/math/iter',
341+
'@stdlib/random/iter',
342+
'@stdlib/simulate/iter',
343+
'@stdlib/stats/iter'
344+
]
345+
},
322346
{
323347
'name': 'stdlib-math-base-special-flat',
324348
'standalone': 'stdlib_math_base_special_flat',

test/test.dist.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,22 @@ tape( 'project contains a distributable file containing "flat" namespace help te
165165
t.end();
166166
});
167167

168+
tape( 'project contains a distributable file containing iterator utilities (unminified)', function test( t ) {
169+
// eslint-disable-next-line stdlib/no-dynamic-require
170+
var bundle = require( join( dirpath, 'stdlib-iter-flat.js' ) );
171+
t.equal( typeof bundle, 'object', 'main export is an object' );
172+
t.equal( typeof bundle.iterErf, 'function', 'has member' );
173+
t.end();
174+
});
175+
176+
tape( 'project contains a distributable file containing iterator utilities (minified)', function test( t ) {
177+
// eslint-disable-next-line stdlib/no-dynamic-require
178+
var bundle = require( join( dirpath, 'stdlib-iter-flat.min.js' ) );
179+
t.equal( typeof bundle, 'object', 'main export is an object' );
180+
t.equal( typeof bundle.iterErf, 'function', 'has member' );
181+
t.end();
182+
});
183+
168184
tape( 'project contains a distributable file containing plotting functions (unminified)', function test( t ) {
169185
// eslint-disable-next-line stdlib/no-dynamic-require
170186
var bundle = require( join( dirpath, 'stdlib-plot-flat.js' ) );

0 commit comments

Comments
 (0)