tobiipro / babel-preset-firecloud Goto Github PK
View Code? Open in Web Editor NEWThe Babel preset used within Tobii Cloud Services.
Home Page: https://babeljs.io
License: The Unlicense
The Babel preset used within Tobii Cloud Services.
Home Page: https://babeljs.io
License: The Unlicense
test by building schemata-firecloud, which with @babel/[email protected]
fails with
09:32:23 [INFO] Generating dts/atex-beacon-in-view-event-v1-json.d.ts...
error SyntaxError: Unexpected token W in JSON at position 1
at JSON.parse (<anonymous>)
at /Users/andrei/git/firecloud/schemata-firecloud/node_modules/json-schema-to-typescript/dist/src/cli.js:70:33
at step (/Users/andrei/git/firecloud/schemata-firecloud/node_modules/json-schema-to-typescript/dist/src/cli.js:33:23)
at Object.next (/Users/andrei/git/firecloud/schemata-firecloud/node_modules/json-schema-to-typescript/dist/src/cli.js:14:53)
at fulfilled (/Users/andrei/git/firecloud/schemata-firecloud/node_modules/json-schema-to-typescript/dist/src/cli.js:5:58)
in its current form https://github.com/tobiipro/babel-preset-firecloud/blob/7d4447cd3bf4aad4857c346a8c794f72be0485ca/plugins/babel-plugin-firecloud-src-arg.js this plugin can work even when no srcFuns
are given in the config.
One could argue though that you anyway have to provide srcFuns
in order to make this plugin useful, so it's not a big deal to provide also disabled: false
.
NOTE A negative side-effect. While debugging, Chrome won't be able to get the value of an exported variable, because the source map will reference exports.something, while you still hover something.
__filename is available in node and webpack, and it would provide an absolute path, instead of a scoped one
regardless of the state of #2 , we should be consistent with
PS: this is a TODO for all the repos we now have on github, not a real issue for this repo
Jest mocks do not allow accessing vars from the outer scope, which exports
is. Also, other weird errors occur, which I don't really want to dig into. Already wasted too much time on this...
One of the most simple and clean solutions IMO is to use different env
s for dev and test in .babelrc
. I managed to get it working pretty easy, since jest sets NODE_ENV=test
and this one is used by Babel to pick config. We have this variable in our makefile, but it's not exported, so gets redefined by jest. Another level of control is to use BABEL_ENV
variable, which has higher priority.
Let's discuss in the office how we want to tweak these vars to make it work properly.
Case like let _ = require('lodash-firecloud');
Otherwise, we can get in the end exports._.merge(...
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.