Creating custom project structures with Sails.js 0.10 generators

When looking at the upcoming Sails.js 0.10 release, one exciting feature that stands out is the addition of custom generators (currently @ rc4).

You can find a migration guide on Sails' GitHub page highlighting the benefits of these generators, but it lacks instructions on how to actually implement them in your own application.

Some interesting custom generators have already started to appear:

  1. sails-generate-auth
  2. sails-generate-gulp-bower

The first generator is readily available on npm. All it took was a simple npm install and the generator was integrated into my app effortlessly.

However, when attempting to install the second generator to switch from Grunt to Gulp, I encountered some difficulties.

If anyone has insight on how to install custom generators and connect them with a Sails.js application, please share your knowledge!

Answer №1

To add a sails-generator to your project, simply install it like any other npm package:

npm install sails-generate-auth

If you're looking to use sails-generate-gulp-bower, note that it has not been officially released on npm yet. To work around this, you can still install the latest version by using the following command.

npm install https://github.com/PaulAvery/sails-generate-gulp-bower/archive/master.tar.gz --save

However, remember that the author likely has their reasons for not releasing it officially just yet.

Answer №2

I crafted custom generators for integrating gulp with sails. Check out the repository here: https://github.com/Karnith/sails-generate-new-gulp

A total of 4 generators are necessary to work in tandem with a .sailsrc file. After installing them globally, you can use 'sails new' to kickstart your app creation process. 'Sails lift' command also functions seamlessly.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Bringing in Node Package in Angular

I decided to clone the Angular project from here: https://github.com/etherparty/explorer Now, I am looking to incorporate another module into it by following this link: https://github.com/miguelmota/ethereum-input-data-decoder However, when trying to uti ...

JavaScript : Retrieve attributes from a JSON object

Situation : I have a JSON object with multiple properties and need to send only selected properties as a JSON string to the server. Approach : To exclude certain properties from the JSON string, I utilized the Object.defineProperty() method to set enumera ...

Issues with the List and Carousel components in the Actions-on-google library

'use strict'; const functions = require('firebase-functions'); const { Button, dialogflow, BrowseCarouselItem, BrowseCarousel, Suggestions, List } = require('actions-on-google'); const axios = require('axios'); cons ...

Sharing Node/Express Sessions Between Client and Server

After searching for answers, it seems that my issue is unique and I may have been using the wrong search queries. The project I am working on involves a react app with server-side rendering. There is also another server responsible for handling the entire ...

Setting up dynamic routing in AngularJS for links

I am facing some confusion regarding routing in AngularJS. Normally, we can configure routes in angular.config() when the angular module is loaded. At that time, we define static information such as routePath, templateUrl, and controller. However, I am u ...

Utilizing AngularJS to effectively group and filter using Ng-repeat

I am working with an array retrieved from an Azure server Log (clicks array) that I need to sort in a specific way. Below is the request: $http({ method: 'Get', headers: { 'Host': 'api.applicationinsights.io&apo ...

How to trigger an update of the useEffect() hook when a button is clicked

I am working with a functional component that contains a button and uses the "useEffect()" hook. My goal is to trigger a re-render of the component, updating the useEffect() hook when the button is clicked. const Emp_list = (props) => { useEffect(() ...

Tips for making a website display in landscape mode rather than portrait orientation

As a newcomer to web design, I am curious if it is feasible to create a website that automatically rotates to landscape view when accessed on a mobile device. The current project I am working on is fluid in design, so this feature would greatly enhance t ...

Transferring values from jQuery AJAX to Node.js

Is there a way to successfully pass a variable from jQuery to nodejs without getting the [object Object] response? I want to ensure that nodejs can return a string variable instead. $('.test').click(function(){ var tsId = "Hello World"; ...

Creating a list of identical elements with shared attribute values using nightwatch.js or JavaScript - a step-by-step guide

I have been using nightwatch.js for automating tests on a web application, and I am facing difficulties in creating a list of elements that share common values in their attributes. Below is an example: The first three spans with a common value for the att ...

Python web application encountering issues running in browser

After successfully creating a Python desktop application with Tkinter library, we decided to convert it into a web app using pyjamas. The conversion process generated html files and javascripts as expected. However, when attempting to open the html file i ...

What is the best way to exclude empty fields from an API response when using the .map() function in Nextjs

I've created a custom repository API that I want to integrate into my Next.js web application. However, if any field in the API is empty, I need to exclude that particular element. The contents of my API: { "myrepo": [ { ...

Display the name of the file on the screen

Is there a way to dynamically display the file name in a view instead of hardcoding it? I would appreciate any assistance. Thank you! Here is my code snippet: <li> @if (Model.Picture2 != null) { base2 = Convert.ToBase64String(Model.Pict ...

Having trouble with the clear button for text input in Javascript when using Bootstrap and adding custom CSS. Any suggestions on how to fix

My code was working perfectly until I decided to add some CSS to it. You can view the code snippet by clicking on this link (I couldn't include it here due to issues with the code editor): View Gist code snippet here The code is based on Bootstrap. ...

Can an action be activated when the mouse comes to a halt?

Currently, I am having trouble triggering an event when a user stops moving their mouse over a div element. The current event is set up to show and follow another element along with the mouse movement, but I want it to only display when the mouse stops mov ...

Gaining access to the isolated scope of a sibling through the same Angular directive led to a valuable discovery

I am currently working on an angularjs directive that creates a multi-select dropdown with a complex template. The directives have isolated scopes and there is a variable called open in the dropdown that toggles its visibility based on clicks. Currently, t ...

Combining the devexpress dxDataGrid with Angular's $scope for seamless web development

I'm encountering difficulties with binding $scope in angular and dxDataGrid. Utilizing the devexpress library dx.all.js, which enhances the dxDataGrid with various features, I have a div for dx-data-grid and attempting to transfer the selected row da ...

Is it possible for CSS to prevent the insertion of spaces?

When filling out a form, I am able to insert spaces in inputs but not in the textarea (which is necessary). Interestingly, inserting spaces in the textarea works flawlessly. <form action="/#wpcf7-f519-o1" method="post" class="wpcf7-form" enctype="mu ...

How can one determine if a query aligns with any element within an array in Elasticsearch?

Suppose I have a specific query, such as 'hello', along with an ID like '12345'. My aim is to locate data that both matches the query in a 'text' field and the ID in a 'thread' field. However, the IDs provided are wi ...

My tests are not passing because I included a compare method in the Array prototype. What steps can I take to fix this issue in either the

Embarking on the challenging Mars Rover Kata has presented a unique problem for me. My jasmine tests are failing because of my array compare method within the prototype. This method is crucial for detecting obstacles at specific grid points. For instance, ...