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

@amplication/data-service-generator

v1.1.13

Published

DSG (Data Service Generator) is the component responsible for the generation of source code by Amplication, and allows the integration of plugins into the code generation process.

Downloads

110

Readme

Amplication Data Service Generator

DSG (Data Service Generator) is the component responsible for the generation of source code by Amplication, and allows the integration of plugins into the code generation process.

Technologies

  • Node.js: the generated code is human-editable Node.js code.
  • TypeScript: the generator code and the generated code are both strictly typed TypeScript code.
  • Nest.js: is used for defining the API.
  • Express: is used as the base web framework for Nest.js.
  • Passport: is used for providing Basic authentication.
  • AccessControl: is used for providing ABAC and RBAC authorization.
  • PostgreSQL: is used for storing the application data.
  • Prisma: is used to interact with Postgres and define data migrations.
  • Docker: the generated code includes a Dockerfile for building containers.
  • Morgan: is used for logging calls to the API.
  • Recast: is used for generating the TypeScript code.
  • Jest: is used for testing the generator code and for testing in the generated code.

Development

:bulb: Before you begin, make sure you have all the below installed:

One time set up

After cloning the repository open its root directory and run the following commands:

  • Install dependencies of the monorepo (execute in root directory):

    npm install
    npm run bootstrap
  • Build the Data Service Generator and its dependencies:

    npm run build -- --scope @amplication/data-service-generator --include-dependencies
  • Open the data service generator directory

    cd packages/data-service-generator
  • Generate the test data service app

    npm run generate-test-data-service

Workflow

Make sure you are in the data service generator directory (packages/data-service-generator). Once you are done making changes, run the following commands:

  • Format files (editors like VSCode can do it for you automatically)

    npm run format
  • Lint files (editors like VSCode come with integration to display those continuously)

    npm run lint
  • Run unit tests

    npm test
  • (Optional) Rebuild the package

    npm run build

Testing

Generate test data service application

Generate an application according to the test data definitions. Once generated you can install its dependencies and start it with npm and spin a database with Docker.

npm run generate-test-data-service

E2E test data service application creation

The test will generate code according to the test data definitions, run a Docker container with it, run a database docker container, and try to call the API endpoints. Make sure to build the library before executing it.

npm run test:e2e

Generated Application Dependency Management

Add a dependency to the server template

npx lerna add --scope server-template $NAME_OF_DEPENDENCY

Add a dependency to the client template

npx lerna add --scope admin-template $NAME_OF_DEPENDENCY