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

@digibib/deichman-admin-frontend-common

v6.0.3

Published

Set of common Deichman Svelte components

Downloads

11

Readme

Common svelte components to be shared among Deichman admin (Tjenestekatalog, Fuge) applications.

Technology used

All components, code, the tests, and all DevApp related stuff should be written using typescript.

The build system uses rollup.js.

Tests are written using the jest framework.

A small dev server is provided for rapid testing of component changes (the component wrapper containers must be created, if they do not exist from a previous iteration). The dev server uses rollup-plugin-serve and rollup-plugin-livereload.

Dev application

A small dev application was added to the project which makes visual testing of new components/component features easy.

To start the application execute

npm run dev

Structure

frontend-common
├─┬ devapp
│ ├── [comp-1]      // devApp contains one sub-folder for each component contained within the package
│ ├── [comp-2]
│ ...
│ ├── [comp-n]
│ ├── main.ts       // Main entry point
│ └── DevApp.svelte // Main DevApp app component
└─┬ public
  ├── bundle.js     // Generated bundle.js, see rollup.config.dev.js for configuration
  └── index.html    // Static index.html - app renders here

Configuration

The application is configured by the rollup.config.dev.js configuration file. In short, it uses rollup-plugin-livereload to achieve live reload on code changes, and rollup-plugin-serve to serve the requests on port 8900. The port number easily updatable in rollup.config.dev.js.

Live reload is watching public (implicitly changes in src, since those changes trigger rebuild of bundle.js) and devapp for changes.

Testing

To run the tests execute

npm run test

To run the tests in watch mode, run

npm run test:watch

See the terminal fur further options (to run all tests on change, only the failed ones, etc...).

Local development

To avoid deploying many dummy/temporary versions in the official nmp registry, it is wise to use a local NPM registry during development.

Running end configuring verdaccio

Verdaccio is a lightweight npm registry. To start it up as a local docker container run:

docker run -it -d --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio

Add a user:

npm adduser --registry http://localhost:4873/
Username: dev
Password: dev
Email: (this IS public) [email protected]

To log in, run:

npm login --registry http://localhost:4873/

Use deb/deb as username/password.

To publish, run:

npm publish --registry http://localhost:4873/

Configuring dependent projects

In all dependent projects the local repo needs to be referred for fe-common. This can be achieved by adding a custom .npmrc file with hte following content:

@digibib:registry=http://host.docker.internal:4873

Also make sure to add this line to /etc/hosts:

127.0.0.1 host.docker.internal

This makes sure that running npm -i locally would find the local verdaccio repo.

Note: this file is added to tjenestekatalog and fuge, but the registry is disabled (commented out):

;@digibib:registry=http://host.docker.internal:4873

To use local registry, uncomment the line above.

Development cycle

To create a new version, run

npm version [major|minor|patch]

Publish it to the local verdaccio repo:

npm publish --registry http://localhost:4873/

Make sure, .npmrc is correct in the dependent project (see above).

Update the dependent project to use the new npm version.

Run npm -i.

Rebuild the affected docker container.

Rinse and repeat :)