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

@scopethis/lead-core

v2.3.38

Published

## Contents - [Lead Mappa core](#lead-mappa-core) - [Contents](#contents) - [What's this repo for?](#whats-this-repo-for) - [How do I get going?](#how-do-i-get-going) - [What about the frontend?](#what-about-the-frontend) - [What's the code styl

Downloads

59

Readme

Lead Mappa core

Contents


What's this repo for?

The source files in this repo act as the central module of functionality for the Lead Mappa Platform.

Code is organised around core elements (Domains). For example, a lead, a user, or a job. Each domain contains "adapters" that perform a single task, such as "update profile" or "assign lead".

There are no controllers. Just adapters that attempt to follow the Clean Architecture code style.

^


How do I get going?

To get going do the following:

The following will spin up a dockerised version of the database

  • Local Supabase[Postgresql setup]
    • Install Docker
    • Install Supabase cli globally
    • cd supabase
    • supabase start
    • supabase reset will undo any changes not captured in migration

The following will download and install the dependencies and then start the test watchers.

  • Source code setup
    • npm install
    • npm run dev

❗🙀 Please note that when Supabase starts for the first time, it will provide keys that need to be placed in the appropriate env files. Subsequent start and stop commands will not change the keys. However, upgrading Supabase or asking Docker to download again will renew the keys.

^


What about the frontend?

The source files for the frontend and server are held in another repo. However, to ensure data integrity, with regard to testing, it makes sense to duplicate the migrations folder and start another instance of Supabase.

If you use "supabase-integration/supabase" as the directory name it will automatically be ignored by Git. You can then cd supabase-integration/supabase and run supabase start. Anything done in that folder will not be committed. So you can configure it differently to suit the frontend:

  • config.toml: Change the port numbers (a must)
  • config.toml: Change the project-id to "supabase-integration" (a must)
  • seed.sql: Add whatever data is required to start

^


What's the code style?

None yet, however, there is an overall architecture that is being followed, so please stick to that. Dependency Injection is being used throughout, but this is done in a consistent manner so should be easy to follow.

Conventional commits are being used, and a linter is in place, which is triggered by commit hooks, so please follow that, or your commits will be rejected by the linter.

^


How do I release a version?

This package is consumed as an NPM library. So we have to build before we release:

  • npm run build to test the code and compile everything
  • Commit this build to git
  • npm run release:[patch|minor|major] to tag, create a release and publish to NPM.

^


How can I actually use the package?

The test files are a good place to start to understand how the package can be used. As well as this, each domain should have a README file detailing how it's used. The basic pattern of use is shown below


  npm install @scopethis/lead-core
  
  ...

  // commonjs
  const container = require('@scopethis/lead-core').default
  const result = container('DomainAdapter', data)

  // ES6 - NOT PUBLISHED. Only used in this repo
  import container from '../../src'
  const result = await container('DomainAdapter', data)

  // Where 'DomainAdpater' is the resolved functionality
  // And data is the structured option passed to it

^