Skip to content

Commit f294eb2

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into develop
2 parents c9f9f92 + 306ccdc commit f294eb2

54 files changed

Lines changed: 90 additions & 126 deletions

File tree

Some content is hidden

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

etc/.makie.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var path = require( 'path' );
2525

2626
// VARIABLES //
2727

28-
var prefix = path.resolve( __dirname, '../tools/makie/plugins' );
28+
var prefix = path.resolve( __dirname, '../lib/node_modules/@stdlib/_tools/makie/plugins' );
2929

3030

3131
// MAIN //

tools/makie/README.md renamed to lib/node_modules/@stdlib/_tools/makie/README.md

tools/makie/makie/README.md renamed to lib/node_modules/@stdlib/_tools/makie/makie/README.md

Lines changed: 2 additions & 2 deletions
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env node
2+
'use strict';
3+
4+
// MODULES //
5+
6+
var resolve = require( 'path' ).resolve;
7+
var join = require( 'path' ).join;
8+
var readFileSync = require( '@stdlib/fs/read-file' ).sync;
9+
var cwd = require( '@stdlib/process/cwd' );
10+
var CLI = require( '@stdlib/tools/cli' );
11+
var makie = require( './../lib' );
12+
13+
14+
// MAIN //
15+
16+
/**
17+
* Main execution sequence.
18+
*
19+
* @private
20+
* @returns {void}
21+
*/
22+
function main() {
23+
var dirpath;
24+
var flags;
25+
var args;
26+
var opts;
27+
var cli;
28+
var dir;
29+
30+
// Create a command-line interface:
31+
cli = new CLI({
32+
'pkg': require( './../package.json' ),
33+
'options': require( './../etc/cli_opts.json' ),
34+
'help': readFileSync( join( __dirname, '..', 'docs', 'usage.txt' ), {
35+
'encoding': 'utf8'
36+
})
37+
});
38+
39+
// Get any provided command-line arguments:
40+
args = cli.args();
41+
42+
// Get any provided command-line options:
43+
flags = cli.flags();
44+
45+
dir = cwd();
46+
if ( flags.dir ) {
47+
dirpath = resolve( dir, flags.dir );
48+
} else {
49+
// FIXME: this is fragile, as will break if the location of this file changes. Maybe search for first Makefile in a parent dir of `makie`? (similar to a package.json search; can use fs/resolve-parent-path stdlib pkg)
50+
dirpath = resolve( __dirname, '../../../../../../../' );
51+
}
52+
if ( flags.config ) {
53+
opts = require( resolve( dir, flags.config ) ); // eslint-disable-line stdlib/no-dynamic-require
54+
} else {
55+
opts = {};
56+
}
57+
makie( dirpath, opts, args[ 0 ] );
58+
}
59+
60+
main();

tools/makie/makie/bin/usage.txt renamed to lib/node_modules/@stdlib/_tools/makie/makie/docs/usage.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
Usage: makie [options] target
2+
Usage: makie [options] <target>
33

44
Options:
55

tools/makie/makie/bin/opts.json renamed to lib/node_modules/@stdlib/_tools/makie/makie/etc/cli_opts.json

File renamed without changes.

tools/makie/makie/lib/index.js renamed to lib/node_modules/@stdlib/_tools/makie/makie/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
/**
44
* Run project Makefile targets from anywhere in the project.
55
*
6-
* @module tools/makie/makie
6+
* @module @stdlib/_tools/makie/makie
77
*
88
* @example
9-
* var makie = require( 'tools/makie/makie' );
9+
* var makie = require( '@stdlib/_tools/makie/makie' );
1010
* var spawn = require( 'child_process' ).spawn;
1111
*
1212
* function plugin( dirpath, cwd, subpath ) {

tools/makie/makie/lib/makie.js renamed to lib/node_modules/@stdlib/_tools/makie/makie/lib/makie.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function makie( dirpath, opts, target ) {
4242
keys = Object.keys( opts.plugins );
4343
for ( i = 0; i < keys.length; i++ ) {
4444
key = keys[ i ];
45-
targets[ key ] = require( opts.plugins[ key ] );
45+
targets[ key ] = require( opts.plugins[ key ] ); // eslint-disable-line stdlib/no-dynamic-require
4646
}
4747
}
4848
plugin = targets[ target ];

tools/makie/makie/package.json renamed to lib/node_modules/@stdlib/_tools/makie/makie/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@stdlib/tools/makie/makie",
2+
"name": "@stdlib/_tools/makie/makie",
33
"version": "0.0.0",
44
"description": "Run project Makefile targets from anywhere in the project.",
55
"author": {

tools/makie/plugins/README.md renamed to lib/node_modules/@stdlib/_tools/makie/plugins/README.md

0 commit comments

Comments
 (0)