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

@omnicar/sam-types

v0.0.746

Published

Typescript interfaces for all types used to communicate between SAM client(s) and the SAM API

Downloads

1,902

Readme

SAM-types

SAM types is used to collect and share all interfaces (types) that one or more repositories have in common. To facilitate and ensure that repositories use the same types when communicating with each other. In most cases, if not all, this is between SAM-api and one or more of the frontend clients like the SAM-admin.

Conventions

Request/Response interfaces

TODO: Fill this out

Versioning

We use standard semantic versioning

Development

Dependencies

The project only has one dependency: Typescript

This is to have tsc available.

Compiling

To compile the index.d.ts file and the index.js file, run npm run tsc (or yarn tsc). This cleans all existing .js files and updates the index.d.ts file and the index.js file.

Adding new interfaces, types, and enums

Write your interface or type like you normally would. In order to export it, you need to add it to the index.ts file which holds all exported interfaces, types, and enums. The enums (for now) need to be put directly in the index.ts file. To fix this we need to setup some Webpack configuration etc.

Local development

Using npm

To use the types locally in an application, add the line below as a dependency in your package.json file:

"sam-types": "file:../SAM-types"

The path is the relative path to the SAM-types project.

Using yarn

To use the types locally you can use yarn link. See docs here.

cd to the SAM-types folder and type: yarn link

Then cd to your application and type yarn link "sam-types". Now your application uses your local SAM-types project (using a symlink). To unlink, type yarn unlink "sam-types"

This means that you do not have to change anything in your package.json file.

Regular dependency

To use SAM-types in a project, add the line below as a dependency in your package.json file:

"sam-types": "OmniCar/SAM-types#0.0.1"

If you need to target something other than a specific release, consider targeting a branch or a commit as shown below:

  • "sam-types": "OmniCar/SAM-types#4727d357ea"
  • "sam-types": "OmniCar/SAM-types#feature\/branch"

Releasing

Using GitHub

  • Go to releases on GitHub
  • Press "Create a new release"
  • Set the "Tag version" to the appropriate version number (see versioning above)
  • Set the "Release title" to "Version <version_number>"
  • Describe the changes. What's new? are there any breaking changes? etc.
  • If you want you can see the changes on master compared to a release (for example version 0.0.1) by typing: git diff tags/0.0.1 master
  • Press "Publish release"

Using hub cli

If you have installed the hub cli (see link above), you can create a new release with the below command. Please note that it defaults to targeting the main (master) branch unless you use the -t option (more options here)

git release create -o -m "Release 0.0.2" "0.0.2"

If you did not set up the alias for git = hub you should write hub instead of git in the command above.