zerotohero-dev / babil Goto Github PK
View Code? Open in Web Editor NEW[UNMAINTAINED] Babil transpiles all your dependencies without needing grunt or gulp.
Home Page: https://bytesized.tv/
License: Other
[UNMAINTAINED] Babil transpiles all your dependencies without needing grunt or gulp.
Home Page: https://bytesized.tv/
License: Other
use jsdoc or something similar.
the project shall have the modules that are specified in babel configuration json; otherwise the transpilation won’t be done.
so if the module does not exist, install it and modify the package json and let the user know about it.
When the transpilation is done the folder structure is like ./release/src/foo/bar
it should be ./release/foo/bar
instead.
move files one level up.
instead of this
babil.initialize( {
srcPath: join( __dirname, 'lib' ),
rootPath: join( __dirname, '..',
babelPath: join( __dirname, '../node_modules/babel-cli/bin/babel.js' )
} );
do this
babil.initialize( { cwd: __dirname } );
and let the rest of the options get defaults from that parameters.
it should transpile itself to make it work in all the places.
I’m not sure if it’s a duplicate issue.
if (!rootPath) {
throw 'Please provide a root path.';
}
instead of throwing a string, use a descendant of the Error object (something like VError)
Before every build the pipeline should check for outdated modules.
What happens:
Currently a dependency can go out-of-date without raising any alarms.
Expectation:
Out of date modules should either raise a warning or break a build.
babil requires node v.6 or above.
that’s not a big deal for demo use and to be used in screencasts etc;
however, it should also transpile itself so that unsupported runtimes can use it from the release folder.
EcmaScript of the project should be checked using eslint.
what happens:
Currently there is no syntax checking.
expectation:
project should be statically validated before publishing.
the promise is redundant;
let mkdir call next
instead.
and also add a link to the examples folder.
each merge to master should trigger a new build.
if the src folder has only files and no subfolders, the release folder should be created anyway.
What happens:
Given ./src/foo.js
no file is processed.
Expectation:
It should have created a release folder and ./release/foo.js
and ./release/foo.js.map
Use a framework like mocha to add unit tests.
Having coverage reports will also be nice.
I won’t pick a coverage percentage.
You should try and not focus on the coverage percentage per se, or try to find an arbitrary number for it, but instead focus on having as much logic and functionality tested as is humanly possible.
It is quite reasonable to have a, say, 50% coverage rate if only because only 50% of the code contains logic that can be tested, and the other 50% happens to be simple DTOs or things that are handled by a framework (where you don't need to test the functionalities of your framework) for instance.
Also
If you make a certain level of coverage a target, people will try to attain it. The trouble is that high coverage numbers are too easy to reach with low quality testing. At the most absurd level you have AssertionFreeTesting. But even without that you get lots of tests looking for things that rarely go wrong distracting you from testing the things that really matter.
Like most aspects of programming, testing requires thoughtfulness. TDD is a very useful, but certainly not sufficient, tool to help you get good tests. If you are testing thoughtfully and well, I would expect a coverage percentage in the upper 80s or 90s. I would be suspicious of anything like 100% - it would smell of someone writing tests to make the coverage numbers happy, but not thinking about what they are doing.
The reason, of course, why people focus on coverage numbers is because they want to know if they are testing enough. Certainly low coverage numbers, say below half, are a sign of trouble. But high numbers don't necessarily mean much, and lead to ignorance-promoting dashboards.
Also see: http://www.artima.com/weblogs/viewpost.jsp?thread=203994
This will help them be installed if parent project does not have them.
If the app cannot find either of them; then ask if it os okay to install and use them right now.
Not sure if I was drunk or something when creating this library… but…
"babel lib --source-maps -d release"
inside npm scripts, almost does the same thing in a much leaner way.
One advantage of babil is: it comes bundled with certain required dependencies, and does some preflight checks.
Though is it worth the hassle?
I don’t know.
es6 modules are "strict" by default; no need to use use strict
in NodeLandia.
echo '{ "presets": ["es2015"] }' > .babelrc
This code
const babil = require( 'babil' );
const transpile = babil.transpile;
const join = require( 'path' ).join;
const ROOT_PATH = join( __dirname, '..' );
babil.initialize( {
rootPath: ROOT_PATH,
srcPath: join( ROOT_PATH, 'generators/app/lib' ),
releasePath: join( ROOT_PATH, 'generators/app/release' )
} )
.then( transpile );
creates a release
folder at the project root; it should not.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.