-
-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add runner script to create packages in math/iter/special
#2927
base: develop
Are you sure you want to change the base?
Conversation
I thought to update Along with that, are we also thinking to update our scaffolding structure (https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/_tools/scaffold/math-iter-unary/data), as our meta data does not contain some of the fields used in that. |
} else { | ||
log( 'Creating package: @%s...', 'stdlib/math/iter/special/' + o.alias ); | ||
} | ||
names = objectKeys( o ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gunjjoshi You need to be more selective in what you extract from the JSON file. You need to map the JSON value to a corresponding environment variable in the scaffold script. You cannot just copy-paste the runner.js
from the random-array-unary
scaffold.
envs.push( str ); | ||
} | ||
cmd = envs.join( ' ' ) + ' . ' + SCAFFOLD_SCRIPT; | ||
shell( cmd ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During development, you can print the expected command by commenting out this line and adding a console.log( cmd )
.
What are we using this for: https://github.com/stdlib-js/stdlib/blob/develop/lib/node_modules/%40stdlib/_tools/scaffold/math-iter-unary/scripts/data.json#L3 ?
When I remove this from |
for ( j = 0; j < names.length; j++ ) { | ||
k = names[ j ]; | ||
v = o[ k ]; | ||
str = uppercase( k ); | ||
str += '='; | ||
str += '\'' + v + '\''; | ||
envs.push( str ); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gunjjoshi The reason why you are getting the errors is that you are still passing everything to the scaffold.sh
script. You need to explicitly map fields in the data.json
to environment variables in the scaffold.sh
file. We shouldn't expect these to be 1:1. Meaning, you actually need to perform data transformations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Furthermore, I wouldn't expect that we'd need everything in the data.json
file. I would expect that we pick and choose the appropriate data fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, got it. Thanks!
lib/node_modules/@stdlib/_tools/scaffold/math-iter-unary/scripts/scaffold.sh
Outdated
Show resolved
Hide resolved
Signed-off-by: Gunj Joshi <[email protected]>
Made a few changes, the structure is generated correctly now. |
Description
This pull request:
runner.js
in_tools/scaffold/math-iter-unary/scripts
to generate packages inmath/iter/special
.Related Issues
This pull request:
Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers