Trying to add bootstrap to angular-cli-build.js but file missing. ng serve works with file absent. What replaced angular-cli-build.js file? - angular-ui-bootstrap

Currently following tutorial in using bootstrap with angular-cli. Tutorial declares that I need to put 'bootstrap/dist/**/*' inside of angular-cli-build.js file. Can't locate.
Other solutions to this problem say to change:
Package.json file
"angular-cli": {},
to
"angular-cli": "1.0.0-beta.11-webpack",
This gives me an error.
ng serve already functions correctly.
node version : v6.6.0
npm version : 3.10.7
angular-cli: 1.0.0-beta.14

I went back to the Angular-Cli documentation and followed the bootstrap steps. If all else fails. Ignore the tutorial ;)
[https://github.com/angular/angular-cli#creating-a-build]

Related

How to build using cra-append-sw now that #babel/polyfill has been deprecated?

I'm trying to add functionality to the serviceworker that create-react-app provides out of the box. Thankfully, cra-append-sw lets me do that without needing to eject from cra.
However, when installing cra-append-sw, npm gives me a warning that #babel/polyfill#7.4.4 has been deprecated (#babel/polyfill is listed as a cra-append-sw dependency):
As of Babel 7.4.0, this package has been deprecated in favor of directly including core-js/stable (to polyfill ECMAScript features) and regenerator-runtime/runtime (needed to use transpiled generator functions):
import "core-js/stable";
import "regenerator-runtime/runtime";
Then, when I try to npm run build to append a custom service worker, the build spits out a long error message, the top of which is:
ERROR in multi ./custom-sw.js
Module not found: Error: Can't resolve './custom-sw.js' in '/Users/michaelmersiades/workspace/vanilla-cra'
resolve './custom-sw.js' in '/Users/--/workspace/vanilla-cra'
using description file: /Users/--/workspace/vanilla-cra/package.json (relative path: .)
Field 'browser' doesn't contain a valid alias configuration
and custom-sw.js is not showing up in the build folder.
Is this fixable? If so, how? Or is this an issue for the good ira-append-sw folk?
My thanks in advance to anyone who can help.
Silly error. The custom-sw.js file was inside /src, but it needed to be in / (the root folder).
Moving it to / solved the problem.

How to setup babel 7 config files with Electron two package.json Structure?

I am upgrading to Babel 7. They have changed how config files are loaded.
As much as I've tried per their docs I can not make it work. Babel config loading docs
An Electron app with two package.json structure is explained here:
Electron builder docs
The problem is it looks like my babel config is not being loaded for the code where the second package.json is located. (main renderer)
I tend to think that this is because of this new way of loading config and the two package.json but it could be something else.
The app structure looks like this:
/package.json
/.babelrc (or babel.config.js now)
/app/package.json
/app/main.js <-- this can not be compiled anymore
I use Webpack with the babel loader.
Somehow, with the Webpack dev server, it works, but compiling for production fails.
The exact error I get is this:
(function (exports, require, module, __filename, __dirname) {
import "core-js/modules/web.dom.iterable";
SyntaxError: Unexpected string
For which I got a clue here that made me think there is some config being ignored.
The entire project is open source and can be seen in Github.
Cloning and running npm run compile:main will show the error.

Adding LostGrid to Ruby on Rails with webpack

First poster here.
I just created a new Rails project with webpack (rails new myapp --webpack). It comes with PostCSS and I wanted to add LostGrid to it. I ran the following, from the installation instructions from Lost:
npm install --save lost
This added Lost to package.json. The instructions then say to add the following to your webpack config, assuming you have postcss-loader installed & configured (which I understand was installed automatically when the project was created):
postcss: [
require('lost')
]
But I don't understand where the file is. I thought that I needed to add my PostCSS stuff to .postcssrc.yml in the root. I did this but I still don't get it to work.
I have very little experience with webpack and suspect that my approach is entirely flawed. I was excited to use PostCSS in Rails and would appreciate any help in getting to make LostGrid work here. Thanks!
Found your question moments after I ran into the same issue. Fortunately it's really simple!
When you run webpacker:install it installs a file called .postcssrc.yml in the root folder of the project. This is where you add thePostCSS plugins. Mine now looks like this:
plugins:
lost: {}
postcss-smart-import: {}
postcss-cssnext: {}
autoprefixer: {}
I am not sure yet whether the order matters. Still researching that.
See Webpacker issue #283 which is essentially the same question, but without an example provided.

Cannot use node-hid library in electron app

I had integrated OpenTok.js library for video call in my electron app, for which i want to use logitech device and to use it i need node-hid library using which my app can detect device.
I had done all the needful mentioned for using node-hid in Electron projects, package did get installed
but when i require it in my js file using :-
var HID = require('node-hid');
var devices = HID.devices();
And run my app , it gives an error
Error: Module version mismatch. Expected 50, got 51. So please help me
with this issue .
Thanks
Use electron-rebuild for rebuild modules for suitable for electron. Some node modules are not exactly suitable for electron, because electron uses it's own build of Node. So, electron-rebuild will sort out any incompatibility or functional issues of node modules we use. The recommended way it to add "postinstall": "electron-rebuild --force" line to scripts of package.json file.
One other thing, on linux when you run dev mode, you have to run the script as sudo. Otherwise it'll rise another issue like cannot open device with path...
hope this help someone... :)
I encountered this issue myself, and thought I would share the solution that worked for me. #Tharanga is correct - the recommended way to get around this is to include the below in package.json "scripts" section:
"postinstall": "electron-rebuild --force"
However, I have experienced inconsistent success with that approach.
Another approach is, after installing "node-hid", run this (if on mac):
.\node_modules\.bin\electron-rebuild
Or for Windows:
.\node_modules\.bin\electron-rebuild.cmd
Finally, if you are using webpack in your project, you must add this line to your webpack.config.js file (within module.exports block):
externals: {
"node-hid" : 'commonjs node-hid'
}
I hope this helps some folks in the future!

Apigility Admin UI Not Opening

so my apigility admin area was working just fine before they updated it to ZF3.
No after composer update, I am getting this when I try to open /apigility/ui
Does anyone know what might be the problem and how can we resolve this issue ?
The Issue is:
In the error logs you'll find that css and js data is not loaded. As the rwoverdijk/assetmanager is removed since apigility Admin 1.5 some files are not loaded anymore.
Solution:
Follow part 2. of the Upgrade from https://github.com/zfcampus/zf-apigility-admin#initial-upgrade-to-15
I also tried part 1 what was also working because now the rwoverdijk/assetmanager is now on 1.7.1 (but i do not know if the incompatibility is solved with this version so i did it with the zfcampus/zf-asset-manager). I'm still on ZF2 but the issue is the same.
Install zf-asset-manager. This is a Composer plugin, and operates when installing or uninstalling a package. If you add this, you will need to follow these steps:
composer require --dev zfcampus/zf-asset-manager
rm -Rf ./vendor
composer install
The additional steps are necessary in order for the plugin to pick up on the assets from the other components and copy them to the public folder. After installation you ll find a folder apigility-ui in you
Something similar happened to me when I reused the same code for a new repository on my local development environment having set the base_path value on
./module/Application/config/module.config.php.
'view_manager' => [
'base_path' => 'https://subdomain1.example.com',..]
I solved it by deleting the base_path config value.
The view cannot be rendered fully as the wrong html base is injected to the rendered view. In my case the html base looked like
<base href="http://subdomain2.example.com.devhttps://subdomain1.example.com/">
Instead of
<base href="http://subdomain2.example.com.dev">

Resources