How can I include a core.js polyfill in ember? - ember-cli

I was under the impression that I could do:
app.import('bower_components/core.js/library/fn/object/entries.js');
But it's not resolving the imported portions of it. If I start linking it up myself I end up with:
app.import('bower_components/core.js/modules/_global.js');
app.import('bower_components/core.js/modules/_export.js');
app.import('bower_components/core.js/library/fn/object/entries.js');
And
Module is not defined.
What's the proper way of doing this?

Right okay it seems like I need to install core.js then build it:
npm run grunt build:es7.object.entries
Then include the product of that.

Related

Adding pkg-config search path in CentOS

I have this library(lxc) installed which has the .pc file in
/usr/local/lib/pkgconfig I'm working on a modified version of CentOS. Apparantly, I'm having pkg-conf package (instead of pkg-config). When I try to install a package which has dependencies on this library, on running cmake .., I get the error Package 'lxc' required by 'virtual:world', not found /usr/share/cmake/Modules/FindPkgConfig.cmake:467(message): A required package was not found . Now when I do
pkg-config --variable pc_path pkg-config
it shows /usr/lin64/pkgconfig:/usr/share/pkgconfig. So I need to add the /usr/local/lib/pkgconfig to the search path. However, this does not seem straightforward. The general recommended solution is to add this path using export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig. However, this does not work. I also tried adding a file local.conf in the folder /etc/ld.so.conf.d with the content as /usr/local/lib/pkgconfig but this doesn't help either. Searching the man page of pkg_conf here https://man.archlinux.org/man/pkgconf.1.en , I also tried doing export $CMAKE_PREFIX_PATH=/usr/local/lib/pkgconfig, which also doesn't help. I'm a bit out of ideas at this point and would be really grateful if someone could provide an insight.

Angular Dart Tutorial - Unable to find modules for some sources

I'm trying to follow the Angular Dart tutorial (https://webdev.dartlang.org/angular/tutorial/toh-pt1) but got stuck after adding some html that makes use of the ngModel directive.
According to the tutorial in order to make use of the ngModel directive one has to add "angular_forms: ^2.0.0" to the pubspec.yaml, import 'package:angular_forms/angular_forms.dart' and add "formDirectives" to the component directives. I did all of that including running "pub get" to get the dependencies but when I run "webdev serve" I get the following error:
[SEVERE] build_web_compilers|entrypoint on test/app_test.dart (cached):
Unable to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).
What am I missing?
I had the same the problem. I don't think it mentions explicityly in the tute but after adding angular_forms dependency to the pubspec.yaml file, you need to pull in this new dependency with:
pub get
Hope it helps!

how to import / require standard node modules in typescript?

What is the best way to use require with typescript and standard NPM modules?
I'm trying to use the debug package.
I have installed from npm
also tsd install debug
However, Identical syntax is OK in one file, but not in another.
I guess this is a load order thing, and TS thinks I am redeclaring a variable?
let debug = require("debug")("async-test");
# ReferenceError: debug is not defined
debug = require("debug")("async-test");
# ReferenceError: debug is not defined
identical code on left/right panels (different files) will show an error/not.
What is the best way to use require with typescript and standard NPM modules?
Give typings a go. It has great debug definitions https://github.com/typed-typings/npm-debug.
npm install typings -g
typings install debug
Then setup your tsconfig.json: https://github.com/typings/typings#maindts-and-browserdts
Now you can just do:
import debug = require('debug')
With complete type safety 🌹

Composer Package Error

I'm not sure what I've done wrong here.
I've created a package and I'm trying to require it by using this:
composer require "karl-ballard/gravatar" : "1.0.*"
However, I keep getting this as an output:
InvalidArgumentException
Could not find package 1.0.* at any version for your minimum-stability
(stable). Check the package spelling or your minimum-stability
Can anyone tell me what I'm doing wrong?
https://github.com/krballard/gravatar
The syntax is wrong, see Docs for Composer require.
You copied the line for composer.json directly to the command line.
It's composer require "karl-ballard/gravatar:^1.0"

Perl ExtUtils::MakeMaker, how to install an external config (static config for project)?

I writing distribution package of my perl-program and I need to 'make install' command copy file e.g. conf/my.conf to /usr/local/etc/my.conf.
Which parameter should I use in WriteMakefile?
Thanks!
It doesn't exit :) (is on the old TODO)
use File::ShareDir::Install/File::UserConfig
or try your luck with Module::Build::SysPath
I've found not pretty, but useful solution:
sub MY::postamble {
return qq{
install :: conf/my.conf
\tcp conf/my.conf /usr/local/etc/my.conf
};
This is a simple add-on to Makefile to run the command when 'make install' running. In real life it's looks bit more difficult, but... =)
If there are any pretty idea, please welcome!