Gathering detailed insights and metrics for generator-garlic-webapp
Gathering detailed insights and metrics for generator-garlic-webapp
Gathering detailed insights and metrics for generator-garlic-webapp
Gathering detailed insights and metrics for generator-garlic-webapp
A Yeoman generator to start a GarlicTech web app.
npm install generator-garlic-webapp
Typescript
Module System
Min. Node Version
Node Version
NPM Version
CoffeeScript (36.2%)
JavaScript (30.45%)
TypeScript (16.1%)
Shell (10.2%)
Makefile (4.73%)
HTML (1.74%)
Dockerfile (0.26%)
CSS (0.25%)
Gherkin (0.07%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
1 Stars
745 Commits
1 Watchers
4 Branches
1 Contributors
Updated on Jun 22, 2019
Latest Version
23.0.5
Package Id
generator-garlic-webapp@23.0.5
Unpacked Size
714.75 kB
Size
312.00 kB
File Count
317
NPM Version
6.4.1
Node Version
8.15.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
12
3
[![Build Status][build]][link]
[build]: https://travis-ci.org/garlictech/generator-garlic-webapp.svg?branch=master
[link]: https://travis-ci.org/garlictech/generator-garlic-webapp
The Yeoman generator and the loopback generator must be installed:
1$ sudo npm install -g yo generator-loopback
To install the generator-garlic-webapp, run:
1$ sudo npm install -g generator-garlic-webapp
The generator has some peer dependencies. If they are missing (for instance, the loopback.io generator), you must also install them globally. The above install command will warn you and list the missing software in this case.
When you use private Github and NPM repos, you have to specify some tokens to grant access to the resources. They are accessed via environment variables. In addition, you can work for several organizations in the same time, so you may have several scopes. This situation is handled by the following rules:
Your personal github access token must be in the GITHUB_TOKEN
environment variable.
Your NPM token must be in environment variables like: NPM_TOKEN_Garlictech
:
Prefix: NPM_TOKEN
Suffix: your scope in CamelCase.
Some of the generators may use NPM_TOKEN
as well. If both token variables are set, then the more specific one (NPM_TOKEN_Garlictech
) has priority.
tl;dr
mkdir my-project
cd my-project
yo garlic-webapp:angular2
# Select garlictech scope (the default)
npm run setup
npm run build:docker
npm start
npm run unittest
npm run e2etest
npm run build:prod
# ...then develop something, then:
git add .
npm run commit
mkdir my-project
cd my-project
yo garlic-webapp:angular2
Answer the (straighforward) questions, then you have a scaffolded Angular 2 app that you can build and start immediately.
You can use the following generators (deduct from their names what they generate):
yo garlic-webapp:ng2-service
yo garlic-webapp:ng2-module
yo garlic-webapp:ng2-component
You can add the base folder of the component and the component name. Mind, that the generated file names do not follow the usual Angular 2 conventions, because we utilize webpack file resolution.
Mind, that the generators generete new files only: for example, you can generate a service in a module folder with the intention that the module should provide the service. You have to add the service manually to the provides
array of the module.
tl;dr
mkdir my-project
cd my-project
yo garlic-webapp:angular2
# Select garlictech scope (the default)
npm run setup
npm run build
npm start
npm run unittest
npm run e2etest
# ...then develop something, then:
git add .
npm run commit
Your web site is: http://localhost:8081.
The generator generates files for the Garlictech workflow. For the details of the above procedure, consult this site.
All the client projects are based on Angular JS, plus some dockerized software (webpack, karma, protractor).
1$ yo garlic-webapp
module
: the project is an AngularJS module. There is no index.html
, therefore the generator creates a "site" for you that you can use during the development as some kind of sandbox. npm start
will use this site.site
: A regular, AngularJS based site. In this case, index.html
will be generated in the src
folder, as the entry point of your site.Good to know
Main angular module name:
MyOrganization.MyModuleName
Then, any services, etc. are named like:
MyOrganization.MyModuleName.MyService
The directives are named:
myOrganizationMyModuleMyDirective # in javascript
my-organization-my-module-my-directive # in HTML
-angular
(like a-cool-component-angular), then -angular
will be omitted in the angular module name generation.After that, it scaffolds the webapp.
The generated code will utilize the Docker based client side workflow package. Go there for more information about how to develop your site/module.
tl;dr
mkdir my-project
cd my-project
yo garlic-webapp:server --force
npm run setup-dev
make build
make start
# See your server in http://0.0.0.0:3000
# ...then develop something, then:
git add .
npm run commit
The generator generates files for the Garlictech workflow. For the details of the above procedure, consult this site.
1$ yo garlic-webapp:server --force
Mind the --force
parameter. We use composed generators and sometimes, files must be overwritten. This option eliminates the confirmation questions.
empty
: nothing. You start server development from scratch.
** express
: an Express server.
** loopback
: a loopback server. In this case, the loopback generator also starts.
*** Accept the default application name!
** The following environment variables are taken into account: DOCKER_REPO
.After that, the generator scaffolds the server.
For development, we use make
. For example, build the development server image:
make build
Read the Makefile comments for all the commands, they are obvious. Normally, they start a docker container and execute a command.
make build
It uses the generated Dockerfile.dev
and created a development server image. It id derived from the workflows-server
image. Go here for all the npm packages pre-installed.
You do not have to add the preinstalled packages to package.json
, just start requiring them.
You can start a bash session inside a container.
make bash
During the generator examples, we use MyOrganization az as example organization name. Mind, that the organization refers to the github organization, and must be in CamelCase. For example, if your organization is at
http://github.com/my-organization
, then the label you should use everywhere is MyOrganization
.
yo garlic-webapp:directive
Generate a directive. Asks for teh tirective name. If template extraction is enabled, then it generates ID for the directive templates in $templateCache
,
and adds references to the ui and style files in the src/templates
module. Do, the template of the directive can be replced in another project.
Otherwise, style and ui files are referenced directly from directive.coffee
. In this case, teh templates cannot be replaced.
The generator registers the directive in the main Angular module, so it ia available immediately.
Allow rewiting files when it asks for it!
They work both on server and client sides.
Creates and initializes a github repo for the project. It also configures Travis CI, and sets up the Slack notifications.
yo garlic-webapp:github
The organization is taken from the scope variable of .yo-rc.json
. Then, you have to add some tokens. The generator
can obtain those tokens from environment variables as well, it will offer them as defaults. The generation process will display those variable names.
Some variable names follow the convention in the docker-image section.
You can obtain the Slack webhook URL from the settings of any github repos (sending messages to the same Slack channel). As for Slack token, ask the admin of the organization.
Also, ask the development team id from the admin.
yo garlic-webapp:docker-image
Creates a docker image template in the docker-images
folder. Also, creates organization-specific build scripts.
Before that, you have to set the following environment variables:
export NPM_TOKEN_MyOrganization=<your NPM token>
export DOCKER_USERNAME=<username for docker.my-organization.com docker repo>
export DOCKER_PASSWORD=<password for docker.my-organization.com docker repo>
Alternatively, you can set NPM_TOKEN
instead of NPM_TOKEN_MyOrganization
. If both are set, NPM_TOKEN_MyOrganization
has priority.
Do not forget to change labels in docker.my-organization.com, if your docker repo is in a different host.
Known issues
scripts/build.sh
(because, for example, your docker registry is not in the generated docker.my-organization.com), then do not allow the generator to overwrite this file. If you did, you have to re-implement your changes.yo garlic-webapp:commitizen
We suggest using commitizen during github commits. This generator prepares your project for this. The default generator also invokes this, by default. The actual commitizen packages are in the workflows-common docker image.
yo garlic-webapp:semantic-release
We suggest using semantic release for travis ci-based automated releasing and labeling. This generator prepares your project for this. The default generator also invokes this, by default. The actual semantic-release packages are in the workflows-common docker image.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
no SAST tool detected
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
117 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More