npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-jhipster-database-helper

v1.2.0-fix

Published

A JHipster module for already existing databases

Downloads

6

Readme

generator-jhipster-db-helper

NPM version Build Status Dependency Status Join the chat at https://gitter.im/generator-jhipster-db-helper/Lobby

This is a JHipster module, meant to be used in a JHipster application.

JHipster was created with the purpose to generate pristine new applications. It enforces conventions which makes it hard to use it with messy existing databases. However some of us still want create a JHipster applications with such databases. generator-jhipster-db-helper makes it easy.

Usage

  1. Install our module from JHipster Marketplace or using your favourite package manager.

yarn add generator-jhipster-db-helper

  1. Run the main generator on your already created JHipster application.

yo generator-jhipster-db-helper

  1. Answer our module's questions after creating or regenerating an entity

dbh-1 1 0-demo-questions

Our module do all the necessary modifications (see below some of them)

dbh-1 1 0-demo-entity-git-diff

  1. Profit

Check this application to see all the modifications our module do.

Installation

Prerequisites

As this is a JHipster module, we expect you have JHipster and its related tools already installed:

Create a new JHipster app and choose a SQL database.

With Yarn

To install this module: yarn global add generator-jhipster-db-helper

To update this module: yarn global upgrade generator-jhipster-db-helper

With NPM

To install this module: npm install -g generator-jhipster-db-helper

To update this module: npm update -g generator-jhipster-db-helper

How this module works

Upon running the main generator, it changes the naming convention to a more flexible one, registers itself as a post app hook and registers the 'fix-entity' sub-generator as a post-entity hook.

When you create or regenerate an entity, the sub-generator fix-entity will run after jhipster:entity has finished running. It receives information from jhipster:entity and uses it to find out what must be modified.

It asks the user what values it must use as replacements for the entity and liquibase files with. It offers jhipster default values or user previous values if any as default answers.

It then match correspond values and replaces them with user input using regexes.

It stores your answer in the entity configuration file .jhipster/Entity.json and makes the necessary replacements in both ORM and changelog files.

Contributing

Development

  1. Set up your local copy
    1. Fork this module
    2. Clone your fork on your working machine
    3. Install dependencies by running yarn
    4. Create a branch from master (see section Branching below)
    5. Develop new stuff
  2. Use your local copy
    1. Register your local copy by running yarn link inside your clone directory
    2. Create an application to test your modifications
    3. Link the application with your local copy by running yarn link generator-jhipster-db-helper inside your application directory
    4. Use the module (see section Usage above)

You can edit your local repository and test the changes in the application directly. There is no need to rebuild the app.

An easy way to get an application with many entities and all relationship types is to:

  1. Copy the whole travis directory.
  2. Edit the script run-test-case.sh to modify JHIPSTER_VERSION variable.
  3. Run the script from the travis directory, not the test-case directory.
  4. The application will be created inside the test-case

Branching

When submitting changes, please do so from a new branch, not the master branch. Please name your branch according these rules :

  • descriptive name : fork is bad, bugfix/entity-name-validation is good.
  • all characters must be lowercase
  • use dash - as a word separator.
  • use a prefix to describe the branch's type :
    • feature/ : New thing or improvement
    • bugfix/xx- : Repairing something that wasn't working correctly
      • replace xx with the number of the issue. Always open an issue about discovered bugs.

Integration testing

We use Travis CI for integration testing. If you want our module to support another type of database, another application configuration or another set up of entities, the first thing you should do is adding your test case to the travis build.

General guidelines

We aligned ourselves on the guidelines of jhipster/generator-jhipster, if you don't know them, please read them.

Contact

Join the chat at https://gitter.im/generator-jhipster-db-helper/Lobby

License

Apache-2.0 © Adrien Horgnies & Bastien Michaux