Orchard AliasUI in a Recipe - orchardcms

I am using the AliasUI module in Orchard to configure a custom homepage from one of my modules. I set the "/" alias to a route in one of my custom modules. Is there a way to export this configuration into a custom recipe so it will be automatically configured once the recipe is run?

Check out Orchard.Setup; The commands and the recipes, There are commands all over the source; In the Blog module, for example.
If your code works now, it shouldn't matter where you run it from.

Related

How to aliasing Preact with Webpack?

Preact guide says
To alias any package in webpack, you need to add the resolve.alias section to your config. Depending on the configuration you're using, this section may already be present, but missing the aliases for Preact.
But using any of the official templates (default, typescript, material web components, etc...) doesn't generate any webpack.config.js file and preact has no eject command like react to access the full project configuration.
So, few things:
Firstly, Preact and Preact-CLI are two separate items.
You're quoting the section from our docs labeled "Integrating into an existing pipeline". This means adding Preact to an existing React application of yours, but, if you're using one of our templates, then this is a new project, not an existing one.
preact has no eject command like react to access the full project configuration.
There is no way to "eject" React. What you're referring to is the build tool called "Create React App".
We do allow for full configuration of the Webpack config with a preact.config.js. With this, you can edit any parts of the config that you'd like: change plugin options, add loaders, remove plugins, etc., without owning the configuration yourself. You can just comment out your changes in your config and you're back to the default config.
We believe CRA's "eject" is a poor API and therefore don't match it.

How to create custom node.js application starter scripts

I would like to create custom scripts for creating a new application just like npx create-react-app my-app. However, I would like to customize libraries and folder structure etc. However, I am not quite sure how to approach this. I thought about two ways but I am unsure which one will best fit my needs.
Should I create a custom package then create the files I need with fs etc.
A batch script to do the things I mentioned.
I found that express has this feature but it would be nice to be able to customize these settings. Are there any alternative and possibly more efficient methods for doing this?
Also, if I were to do it via nmp packages. How can I run them from the cli?
Thanks in advance!
If customizations are not too advanced, you can start by creating a template repository and place a single setup script in it, which can be implemented by using inquirer npm module. Here is an example:
See https://github.com/kriasoft/nodejs-api-starter -> setup.js

Add side-bar in JHipster application

I want to insert a sidebar into the body of the element body in a JHipster application.
Is there a command that can help me?
There is no module available for converting JHipster's nav bar into a sidebar. JHipster generates the code, but you will need to customize it yourself depending on your requirements.
You can see available JHipster commands by running jhipster --help, and the command's options by running jhipster service --help (example showing the service subgenerator options).
JHispter also offers modules, which extend JHipster's functionality with new commands. The full list can be viewed in the JHipster Module Marketplace. No module offers a sidebar option at this point in time.

Publish only Module in Orchard

I'm working in Orchard project & i want to implement WebApi in my project so that I plan to create one WebApi related separate module which handles all the database related code & returns the result to the other modules as well third party calls.
But for implementing like this, how can i publish my rest of the application at one place & the WebApi related module at another place.
You cannot run Orchard Modules without Orchard. If you want to separate site publishing from module publishing, you can update single modules. To do this you need to package you module and then upload and install it to the site. Either by Admin Dashboard or Orchard Command-line.
On how to package a module and install it with Orchard Command-line check the Orchard Doc's here
You can also upload the module package via Orchards Admin Dashboard. Check this Orchard Doc to accomplish this.
Important! Remember to update your module's version in Module.txt manifest file. Otherwise the update won't work.

How to you reference a required script that is bundled?

I'm working with the Hot Towel SPA template and I'm trying to add in some data that I want to get from breeze. I have the breeze nuget package installed and the breeze script files are in the scripts folder of the site.
I can reference it by using the actual file name like the following:
define(['durandal/app', '../scripts/breeze.min.js'], function (app, breeze) {
...
});
However, this will break when my site is running in release mode and the script is actually bundled. Plus, it is really ugly and feels like a hack to put the full name in there.
What is the correct way to do this?
By default Durandal loads external libraries via normal script calls not via requirejs. Same is true for HotTowel.
e.g. https://github.com/BlueSpire/Durandal/blob/master/index.html#L31
or if your platform supports it via bundling
https://github.com/johnpapa/PluralsightSpaJumpStartFinal/blob/master/SPAJumpStart/App_Start/BundleConfig.cs#L18
Simply load breeze before requiring main.js and you should be good to go.

Resources