Skip to content

Commit 9277d7b

Browse files
committed
Remove trailing comma and add makie index files
1 parent 3b529bb commit 9277d7b

File tree

47 files changed

+2853
-1795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2853
-1795
lines changed
Lines changed: 16 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2018 The Stdlib Authors.
4+
* Copyright (c) 2022 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -18,94 +18,29 @@
1818

1919
'use strict';
2020

21-
// MODULES //
22-
23-
var proc = require( 'process' );
24-
var spawn = require( 'child_process' ).spawn;
25-
26-
27-
// FUNCTIONS //
28-
29-
/**
30-
* Callback invoked upon encountering an error.
31-
*
32-
* @private
33-
* @param {Error} error - error object
34-
*/
35-
function onError( error ) {
36-
proc.exitCode = 1;
37-
console.error( 'Error: %s', error.message ); // eslint-disable-line no-console
38-
}
39-
40-
/**
41-
* Callback invoked upon child process close.
42-
*
43-
* @private
44-
* @param {number} code - exit code
45-
* @returns {void}
46-
*/
47-
function onFinish( code ) {
48-
if ( code !== 0 ) {
49-
proc.exitCode = code;
50-
return console.error( 'Child process exited with code `'+code + '`.' ); // eslint-disable-line no-console
51-
}
52-
}
53-
5421
/**
55-
* Callback invoked upon receiving data from `stdout`.
22+
* Plugin to run cross-language benchmarks.
5623
*
57-
* @private
58-
* @param {Buffer} data - standard output
59-
*/
60-
function stdout( data ) {
61-
proc.stdout.write( data );
62-
}
63-
64-
/**
65-
* Callback invoked upon receiving data from `stderr`.
24+
* @module @stdlib/_tools/makie/plugins/makie-benchmark-lang
6625
*
67-
* @private
68-
* @param {Buffer} data - standard error
69-
*/
70-
function stderr( data ) {
71-
proc.stderr.write( data );
72-
}
73-
74-
75-
// MAIN //
76-
77-
/**
78-
* Plugin to run benchmarks.
26+
* @example
27+
* var plugin = require( '@stdlib/_tools/makie/plugins/makie-benchmark-lang' );
28+
* var makie = require( '@stdlib/_tools/makie' );
29+
* var opts = {
30+
* 'plugins': {
31+
* 'benchmark': plugin
32+
* }
33+
* };
7934
*
80-
* @param {string} dir - Makefile directory
81-
* @param {string} cwd - current working directory
82-
* @param {string} subpath - subdirectory path
35+
* // Execute the `benchmark` command:
36+
* makie( '/home/stdlib-js/stdlib', opts, 'benchmark' );
8337
*/
84-
function plugin( dir, cwd, subpath ) {
85-
var opts;
86-
var args;
87-
var proc;
8838

89-
opts = {};
90-
opts.cwd = dir;
91-
92-
args = [];
93-
94-
// Environment variables:
95-
if ( subpath ) {
96-
args.push( 'BENCHMARKS_FILTER=.*/'+subpath+'/.*' );
97-
}
98-
// Target:
99-
args.push( 'benchmark-lang' );
39+
// MODULES //
10040

101-
proc = spawn( 'make', args, opts );
102-
proc.on( 'error', onError );
103-
proc.stdout.on( 'data', stdout );
104-
proc.stderr.on( 'data', stderr );
105-
proc.on( 'close', onFinish );
106-
}
41+
var main = require( './main.js' );
10742

10843

10944
// EXPORTS //
11045

111-
module.exports = plugin;
46+
module.exports = main;
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2018 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var proc = require( 'process' );
24+
var spawn = require( 'child_process' ).spawn;
25+
26+
27+
// FUNCTIONS //
28+
29+
/**
30+
* Callback invoked upon encountering an error.
31+
*
32+
* @private
33+
* @param {Error} error - error object
34+
*/
35+
function onError( error ) {
36+
proc.exitCode = 1;
37+
console.error( 'Error: %s', error.message ); // eslint-disable-line no-console
38+
}
39+
40+
/**
41+
* Callback invoked upon child process close.
42+
*
43+
* @private
44+
* @param {number} code - exit code
45+
* @returns {void}
46+
*/
47+
function onFinish( code ) {
48+
if ( code !== 0 ) {
49+
proc.exitCode = code;
50+
return console.error( 'Child process exited with code `'+code + '`.' ); // eslint-disable-line no-console
51+
}
52+
}
53+
54+
/**
55+
* Callback invoked upon receiving data from `stdout`.
56+
*
57+
* @private
58+
* @param {Buffer} data - standard output
59+
*/
60+
function stdout( data ) {
61+
proc.stdout.write( data );
62+
}
63+
64+
/**
65+
* Callback invoked upon receiving data from `stderr`.
66+
*
67+
* @private
68+
* @param {Buffer} data - standard error
69+
*/
70+
function stderr( data ) {
71+
proc.stderr.write( data );
72+
}
73+
74+
75+
// MAIN //
76+
77+
/**
78+
* Plugin to run benchmarks.
79+
*
80+
* @param {string} dir - Makefile directory
81+
* @param {string} cwd - current working directory
82+
* @param {string} subpath - subdirectory path
83+
*/
84+
function plugin( dir, cwd, subpath ) {
85+
var opts;
86+
var args;
87+
var proc;
88+
89+
opts = {};
90+
opts.cwd = dir;
91+
92+
args = [];
93+
94+
// Environment variables:
95+
if ( subpath ) {
96+
args.push( 'BENCHMARKS_FILTER=.*/'+subpath+'/.*' );
97+
}
98+
// Target:
99+
args.push( 'benchmark-lang' );
100+
101+
proc = spawn( 'make', args, opts );
102+
proc.on( 'error', onError );
103+
proc.stdout.on( 'data', stdout );
104+
proc.stderr.on( 'data', stderr );
105+
proc.on( 'close', onFinish );
106+
}
107+
108+
109+
// EXPORTS //
110+
111+
module.exports = plugin;
Lines changed: 16 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2018 The Stdlib Authors.
4+
* Copyright (c) 2022 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -18,94 +18,29 @@
1818

1919
'use strict';
2020

21-
// MODULES //
22-
23-
var proc = require( 'process' );
24-
var spawn = require( 'child_process' ).spawn;
25-
26-
27-
// FUNCTIONS //
28-
29-
/**
30-
* Callback invoked upon encountering an error.
31-
*
32-
* @private
33-
* @param {Error} error - error object
34-
*/
35-
function onError( error ) {
36-
proc.exitCode = 1;
37-
console.error( 'Error: %s', error.message ); // eslint-disable-line no-console
38-
}
39-
40-
/**
41-
* Callback invoked upon child process close.
42-
*
43-
* @private
44-
* @param {number} code - exit code
45-
* @returns {void}
46-
*/
47-
function onFinish( code ) {
48-
if ( code !== 0 ) {
49-
proc.exitCode = code;
50-
return console.error( 'Child process exited with code `'+code + '`.' ); // eslint-disable-line no-console
51-
}
52-
}
53-
5421
/**
55-
* Callback invoked upon receiving data from `stdout`.
22+
* Plugin to run benchmarks.
5623
*
57-
* @private
58-
* @param {Buffer} data - standard output
59-
*/
60-
function stdout( data ) {
61-
proc.stdout.write( data );
62-
}
63-
64-
/**
65-
* Callback invoked upon receiving data from `stderr`.
24+
* @module @stdlib/_tools/makie/plugins/makie-benchmark
6625
*
67-
* @private
68-
* @param {Buffer} data - standard error
69-
*/
70-
function stderr( data ) {
71-
proc.stderr.write( data );
72-
}
73-
74-
75-
// MAIN //
76-
77-
/**
78-
* Plugin to run benchmarks.
26+
* @example
27+
* var plugin = require( '@stdlib/_tools/makie/plugins/makie-benchmark' );
28+
* var makie = require( '@stdlib/_tools/makie' );
29+
* var opts = {
30+
* 'plugins': {
31+
* 'benchmark': plugin
32+
* }
33+
* };
7934
*
80-
* @param {string} dir - Makefile directory
81-
* @param {string} cwd - current working directory
82-
* @param {string} subpath - subdirectory path
35+
* // Execute the `benchmark` command:
36+
* makie( '/home/stdlib-js/stdlib', opts, 'benchmark' );
8337
*/
84-
function plugin( dir, cwd, subpath ) {
85-
var opts;
86-
var args;
87-
var proc;
8838

89-
opts = {};
90-
opts.cwd = dir;
91-
92-
args = [];
93-
94-
// Environment variables:
95-
if ( subpath ) {
96-
args.push( 'BENCHMARKS_FILTER=.*/'+subpath+'/.*' );
97-
}
98-
// Target:
99-
args.push( 'benchmark' );
39+
// MODULES //
10040

101-
proc = spawn( 'make', args, opts );
102-
proc.on( 'error', onError );
103-
proc.stdout.on( 'data', stdout );
104-
proc.stderr.on( 'data', stderr );
105-
proc.on( 'close', onFinish );
106-
}
41+
var main = require( './main.js' );
10742

10843

10944
// EXPORTS //
11045

111-
module.exports = plugin;
46+
module.exports = main;

0 commit comments

Comments
 (0)