2.10.0 • Published 1 month ago

@lblod/submission-form-helpers v2.10.0

Weekly downloads
75
License
MIT
Repository
github
Last release
1 month ago

@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.

2.10.0

1 month ago

2.9.0

3 months ago

2.8.0

3 months ago

2.7.0

4 months ago

2.6.0

4 months ago

2.5.1

4 months ago

2.5.0

5 months ago

2.4.0

5 months ago

2.3.0

1 year ago

2.2.0

1 year ago

1.4.1

2 years ago

1.4.0

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.3.0

2 years ago

1.2.6

2 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.3-alpha

3 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago