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

@artsy/cohesion

v4.178.0

Published

Analytics schema

Downloads

6,865

Readme

Cohesion CircleCI npm version

Artsy's analytics schema

  • State: In development
  • GitHub: https://github.com/artsy/cohesion
  • Docs: https://cohesion.artsy.net
  • Ci: https://circleci.com/gh/artsy/cohesion
  • NPM: Package updates are published automatically on successful merges to main. Canaries are available on PR's from feature branches.
  • Point People: @damassi, @abhitip

Contributing

Requirements: Yarn

Set up:

yarn install

Run tests:

yarn test

Generate docs:

yarn docs

To view docs locally, visit the full filepath of docs/index.html in your browser, i.e, file:///Users/<MY_USER>/<MY_LOCAL_DIRECTORY>/cohesion/doc/index.html

Schema

The /Schema directory represents the Artsy's analytics schema, and describes expectations for data consumed by Redshift and Segment.

This schema is maintained by Artsy's data team, engineers should not expect to change these files.

Valid analytics events are described in /Schema/Events/index.ts, and individual event schemas live in the Schema/Events directory, divided by concern.

Typings for all allowed values, such as ContextModule, are exported for use by engineers in consuming projects.

Add a new event to the schema (For data analysts)

  1. In Schema/Events, add the name of the new event. This name defines the corresponding downstream table's name in Redshift, and should use the lowerCamelCase naming convention.
// Schema/Events/index.ts

export enum ActionType {
  ...
  myNewEvent = "myNewEvent",
  ...
}
  1. In Schema/Events directory, create a new interface describing the shape of the new event, as it is received in Segment/Redshift.
  • The name of the interface should match the ActionType created in step 1, but use the UpperCamelCase naming convention.
  • The action key is required and should match the ActionType created in step 1.
  • If your event uses values not yet in the schema, such as a new ContextModule, add new values to the existing typings in the Schema directory.
// Schema/Events/MyNewEvent.ts

export interface MyNewEvent {
  action: ActionType.myNewEvent
  context_module: ContextModule
  optional_property?: string
  required_property: number
}
  1. In Schema/Events/index.ts, add the new interface to the valid events main list, Event

  2. Add descriptive comments with examples to explain the use of your new event. Our documentation is generated automatically from in-code comments, find more information on syntax in the typedoc docs.

  3. If you have created any new files, add an export statement to Schema/index.ts like so:

// Schema/index.ts

export * from "./Events/MyNewEvent"
  1. PR your changes. Once merged, the schema will be updated and your new event and values will be available to consumers of this package.