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

@max-pr/ets-frame-lib

v17.0.0

Published

A library to reuse components and functions across the entire ets_frame project

Downloads

69

Readme

A library to reuse components and functions across the entire ets_frame project

Using in other projects

To install into a (consumer) project: npm install @max-pr/ets-frame-lib

Notice that we are not using the --save option, meaning the package will not be installed when running the generic npm install command. So this will have to be ran every time there is an update to the library or node_modules is removed.

Then to use, you can import something like: import NotesData from '@max-pr/ets-frame-lib/dist/components/notes/notes-data'; Be sure to import from the dist/ directory.

Making edits / Developer practices

Be sure to edit the files under src/. The dist/ holds the compiled code and will be consumed by the projects.

To write library code more efficiently, it is recommended to update the consumers' package.json to list the library as a local dependency. This will allow for incrementally developing and testing new features without flooding the registry with publications. In the consumer, list the library as a dependency with "@max-pr/ets-frame-lib": "file:../lib". Any updates will have to be compiled by running npm run publish:npm within lib/ and re-installed for the consumer with rm -rf node_modules && npm install. Once the feature is complete, the library can be published by npm publish (within lib/).

Storybook

Storybook is used to document existence and behavior of components, and can be used to develop and view changes in real time.

Once the storybook package is installed, you can run npm run storybook and a new window will open showing all components with accopmanying .stories.jsx files. These files should exist next to the component src file NOTE THAT THE BOTH THE SRC AND STORY FILES MUST BE OF TYPE JSX

Conventions

  • All CSS classes should be prefixed with "ets-frame-lib-"

Maintaining / Publishing

After making updates to the library, make sure to update the version number in package.json accordingly:

  • X.0.0 - Major release - changes that break backwards compatibility
  • 0.X.0 - Minor release - New features, backwards compatible
  • 0.X.0 - Patch release - Bug fixes, backwards compatible

You can not re-publish under the same version number so you will always have to update the version when publishing updates.

Then, within lib/ run npm run publish:npm to build, then npm publish to publish the changes to npm. You will need to reinstall the package in the consumer projects for the changes to be reflected (i.e. npm install @max-pr/ets-frame-lib).

You will need to login to npm to publish. As of 2024-07-26, Max's account is the only account tied to the library.

Note on CSS

After many hours failing to bundle the css with the library components, the solution became to ship the css separately, with the expectation that the projects will include the css within the corresponding view script header. This means CSS associated with the library should be edited within scss/ets-frame-lib.css

To make managing this a little less cumbersome, the publish:npm build script has been configured to copy over the css file into /static/css/ upon execution. This makes it so the consumers will always have the latest css delivered, so long as they are importing it in the corresponding view. This also means any changes that only involve CSS do not need to be published to take effect (though, probably should be eventually).