Including library images in Aurelia - aurelia

Including thrid-party image resources for Aurelia
I have a third party library (AdminLTE) that I've installed in my Aurelia application. I've managed to update the aurelia.json file to bundle the necessary js and css files for the library, but I'm not clear on how to also include the library's associated images.
Can someone please provide some guidance on how to do this? I'm an Aurelia newbee.

So it turns out the version of the aurelia-cli was an older version that didn't include the copy-files task.
If you follow the configuration option example here it shows you how to copy library depencies (images or fonts) to a specified directory during the build.

Related

How to target ESNext modules on Nuxt?

I am asked to target ESNext modules on my Nuxt app, how can I do that? I could not find anything on the web.
Related to this issue: https://github.com/solana-labs/wallet-adapter/pull/107#issuecomment-939443776
Looking at the freshly released Nuxt v3 beta, we can see that ESmodules are only partially supported in Nuxt2.
You should probably wait/upgrade to Nuxt3.
checking the documentation itself, I found no reports of support for ES Modules, however, it is known that "vitejs/vite (vue)" and VueJS 3 via Command Line support these modules, I believe the Nuxt community needs to create a project template with this setting is built into the project settings.

Creating an aurelia custom element as an npm package (using the Aurelia CLI)

I am using the Aurelia CLI for creating a SPA and it makes everything a lot easier compared to using Jspm.
However now we have some custom elements like: <my-custom-element></my-custom-element> that we want to package into an npm package so we can use it in multiple/other Aurelia CLI projects.
How would I go about creating it? I can't find any examples or documentation about this.
My guess is that I need to transpile my custom element files so that I end up with an npm package containing .js files (we use typescript) and the correct module loader synax (CommonJS?)?
My understanding is that I can't simply create an npm package that contains my my-custom.element.ts + my-custom-element.html file since it all needs to be transpiled, bundled and so on.
I am also guessing that I can't simply do an au build and use my bundles since that would bundle the entire SPA and not just my custom element files?
So what steps do I need to perform to create an npm package that contains a custom element that can be added to my Aurelia CLI project?
Any help or samples would be very welcome! Thank you!
There are a heap of ways you can do this. However, to keep things simple I am going to recommend the official Aurelia plugin skeleton for developing plugins, which you can get on Github here. If you venture into the src folder, you'll see a very basic example of a custom element and how you can make it global. The plugin skeleton uses Gulp for build tasks, which can be found in the build/tasks directory.
At present, you cannot use the Aurelia CLI to create a plugin. But in the future, you will most likely see this feature added into the CLI as it becomes more than just a CLI for creating applications.

What is the use of gulp-sourcemaps?

I'm learning angular2 and I have seen the gulp-sourcemaps plugin used in the angular2-quickstart project. My question is general, why we use the gulp-sourcemaps? In what circumstances I should use this plugin?
It automatically creates source maps from your code. A source map is used to tell you which file and line in your original code a part of minified code comes from. So sourcemaps can be very helpful when debugging minified Angular apps in the browser.

Building a distributable static library that uses cocoapods

I'm building a static library to be distributed to other iOS developers and having some trouble configuring the linker to allow the static library to be used in another app. I have used this guide to create a MyStaticLibrary.framework bundle containing the lib itself, and other assets such as images. This builds successfully and uses cocoapods to source the required dependencies (AFNetworking, etc.). So far, so good.
But when I import MyStaticLibrary.framework into a new Xcode project to test build an app with the library, I get tons of linker errors (Undefined symbols for architecture i386, _OBJC_CLASS_$_CLASSNAME) indicating that I'm doing something very wrong here.
So my question is, how can I build MyStaticLibrary.framework with the dependencies sourced from cocoapods, such that I can provide a 3rd party with just my framework file and allow them access to all functions specified in the public headers?
Any libraries you include using CocoaPods will not be compiled into your framework by default - they're meant to be external dependencies that are not part of your actual product. However, according to their FAQ, they support a mode where you can download pods and not have them linked to your project. From their FAQ:
Note that CocoaPods itself does not require the use of a workspace. If
you prefer to use sub-projects, you can do so by running pod install
--no-integrate, which will leave integration into your project up to you as you see fit.
To include external dependencies in your compiled binary:
For code: Instead of using cocoapods, check out the repositories you want to include and copy the source files into your project -- this will ensure they are compiled with the rest of your code
For static libraries (i.e. .a files), in your framework's Link Binary With Libraries build phase, make sure to include all the ones you would like to compile. You should also make sure the associated header files are included in Copy Headers build phase, with the appropriate visibility.
Note When bundling third party libraries in this way, you run the risk of conflicting with the projects that are integrating your framework. For example, let's say you are using a lib called SOSomeView, and you choose to compile that in with your framework. Now, if the app you are integrating with also includes SOSomeView, you will get a compile-time error that the class is declared twice. To fix this issue, you should re-namespace any external dependencies you want to hardcode into your framework (i.e. rename the class to XXSOSomeView).
I don't know how to solve that problem if you are compiling static libraries in with your framework.

Linking to library

I installed ImageMagick through MacPorts. So all library files are in /opt/local/lib and headers in /opt/local/include/ImageMagick. It works OK on my mac. In xCode Build Settings - > Search Paths everything looks to be set OK.
Added library files to Linked Frameworks and Libraries
When I build my app it looks to be working. But when I try to run builded app on other computer where ImageMagick is not installed there comes this error message:
How can I fix it to make users to be able use my app without needing to additionally install ImageMagick and so on? How to link it that needed library files would come with my app (in project bundle)?
Af of now your linking library is referred from /opt/local/lib/ ---
Solution for your issue:
Make sure where ever app is installed suport library is installed to right location
Carry the dynamic library with app bundle and refere the dyld from the app bundle which will be relative to app bundle launch path.
Update: If you are looking for the second option --- With this option your library will be placed inside your app bundle ... so app can refer the library from the app bundle.
The precompiled dynamic library can be carried with the application -- in xCode --> Go to Build Phases for the target --> Build Phase (copy files) ... this will make sure your dynamic library is copied to into your app bundle ...
Update “install name” inside each dynamic library --- You can use 'otool' command to know present install path of your precompiled library and you can precompiled library install path using'install_name_tool' command in your terminal.
No support for it from ImageMagick forum, no support from StackOverflow, so I guess its impossible...