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

@lblod/submission-form-helpers

v2.10.2

Published

NPM package containing helpers to inspect and validate submission forms

Downloads

447

Readme

@lblod/submission-form-helpers

NPM package containing helpers to inspect and validate submission forms

Installation

npm install @lblod/submission-form-helpers

Usage

import {
  getFormrModelVersion,
  triplesForPath,
  fieldsForForm,
  validateForm,
  validateField,
  validationTypesForField,
  validationResultsForField,
  validationResultsForFieldPart,
  updateSimpleFormValue,
  addSimpleFormValue,
  removeSimpleFormValue,
  removeDatasetForSimpleFormValue,
  removeTriples,
  importTriplesForForm,
  generatorsForNode,
  triplesForGenerator
}  from "@lblod/submission-form-helpers"

import { RDF, FORM, SHACL, SKOS, XSD, DCT, NIE, MU } from "@lblod/submission-form-helpers"

import { check, checkTriples } from "@lblod/submission-form-helpers"

import constraintForUri from "@lblod/submission-form-helpers"

Development

  1. clone this repo
  2. run npm install to install all dependencies and run the initial build
  3. run npm run lint and npm run test before creating a PR to catch any issues early.

Testing your changes in other projects

Frontend projects

  1. install yalc
  2. use yalc publish to publish your changes to a local repository
  3. use yalc add in the folder of the project where you want to test the change.
  4. use yalc publish and yalc push to push code changes to all the projects that yalc added the package

npm link isn't working correctly in projects that use Webpack, so it's recommended to use yalc until that issue is resolved.

Backend microservices

  1. you can mount the volume to:
    • /path/to/code/submission-form-helpers:/app/node_modules/@lblod/submission-form-helpers
    • Expects the dist folder to be present, and you will have to restart the service
  2. make your changes
  3. run npm run build (babel will transpile to the dist/ folder)
  4. test inside your project

Releasing a new version

We use release-it to handle our release flow

Prerequisites

  • All PRs that need to show up in the changelog need a descriptive title and [correct label].

Generating the changelog (optional)

At the moment the changelog is updated manually. To make this a bit easier you can generate a basic changelog based on the merged PRs with lerna-changelog.

lerna-changelog requires a Github personal access token to work properly.

The following command can be used to generate the changelog:

GITHUB_AUTH=your-access-token npx lerna-changelog

Creating a new release

Simply run npm run release and follow the prompts.

If you generated the changelog using lerna-changelog you can add it to the changelog file and add it to the staged changes when release-it asks if you want to commit the changes. This will ensure that the changelog change is part of the release commit.

After the new tag is created and pushed CI will take care of publishing the package to npm.