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

create-ut

v1.3.7

Published

Tool for creating UT microservices and applications

Downloads

40

Readme

create-ut

Tool for creating applications, microservices, ports, etc., based on UnderTree framework.

Usage

Use with npm init

User creates application, microservice, port or anything else by running:

  • create application in the current folder named impl-*

    npm init ut
    npm init ut app[-kind]
  • create application in a new folder named impl-name

    npm init ut app[-kind] impl-name
  • create microservice in the current folder named ut-*

    npm init ut ms[-kind]
    npm init ut service[-kind]
    npm init ut microservice[-kind]
  • create microservice in new folder named ut-name

    npm init ut ms[-kind] ut-name
    npm init ut service[-kind] ut-name
    npm init ut microservice[-kind] ut-name
  • create port in the current folder named ut-port-*

    npm init ut port[-kind]
  • create port in new folder named ut-port-name

    npm init ut port[-kind] ut-port-name
  • modify a local repo based on its .ut-create definition

    npm init ut path-to-repo

Algorithm

  1. Clone latest version of package impl-application[-kind] or ut-microservice[-kind]. Obtain repository by using package-json in a way similar to:

    const gitUrl = async () =>
       await require('package-json')('impl-application', {registryUrl: 'nexus.softwaregroup.com'})).repository.url
    }
  2. Require the module .ut-create in the cloned folder, having the following structure:

    module.exports = {
        params: {
            schema: {
                properties: {
                    id: {
                        type: 'string',
                        title: 'Package identifier'
                    },
                    title: {
                        type: 'string',
                        title: 'Package title'
                    },
                    userName: {
                        type: 'string',
                        title: 'User name',
                        default: 'based on output from git config --get user.email'
                    }
                },
                required: ['id', 'title', 'userName']
            },
            uiSchema: {
            }
        },
        rename: ({id, title, userName}) => [{
            files: 'server/**/*.js',
            replace: [
                /implementation: 'product'/,
                `implementation: '${id}'`
            ]
        }, {
            files: 'server/**/*.json',
            replace: [
                /"implementation": "product"/,
                `"implementation": '${id}'`
            ]
        }, {
            files: 'ut_*_rc', // example is for YAML based rc
            replace: [[
                /database: impl-firstName-lastName/,
                `database: impl-${userName.split('.').join('-')}`
            ],[
                /user: firstName\.lastName/,
                `user: ${userName}`
            ]]
        } /*etc*/]
    };
  3. Use ut-form-jsonschema to create a form based on the params property in create.js. Usually the following parameters are required:

    • package id - for example "agency"
    • package title - for example "Agency banking"
    • developer userName - as used by git first.last@softwaregroup.com, can be retrieved with git config --get user.email

    Start the default browser with the form URL and wait for the form to be submitted

  4. Do string replacement by using the information returned by the rename function in create.js. The property files specifies a glob pattern for files to be searched. The string or regular expression in replace array first element is used to find text to be replaced by the expression in the replace array second element (as in string.replace). If replace is array of arrays, apply the replacement multiple times.

  5. Change git remote:

    git remote set-url origin git@xxx:yyy/zzz.git
  6. Create Jenkins job

    TODO add description

  7. Configure git web hook to trigger Jenkins job

    TODO add description