1.0.0 • Published 4 years ago

pscore-web v1.0.0

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
4 years ago

:book: PSCore-Web Build status

A portal into the world of Public Safety and Compliance.

Agencies that operate within the public safety sector often take a fairly similar approach to their software solution workflows.

This project intends to maximise the re-usability of the components that make up these softwares across multiple implementations of the PSCore solution by providing a UI library as well as a template (demo) from which new projects can be built.

It should be noted that this is not a product in its own right, as a generic product will not be able to satisfy all requirements of a given client.

Packages included in the PSCore-Web project

Several packages are maintained within this repository and each should be worked on individually.

PSCore-Demo

A generic product that demonstrates the basic functionalities provided within the web based PSCore solution. There may be multiple implementations of the demo depending on the types of authorities that PSCore will cater towards, (ie Police, Roads, etc...)

PSCore-Docs

A catalogue of components that can be used to construct a PSCore project. It will allow a user to toggle a component's state and test its rendering across various view sizes. A working version of the app itself can be viewed here

PSCore-UI

A collection of components, utilities, and themes that can be used within a PSCore project. Much of the look and feel of a web based PSCore product will come from the elements that make up the PSCore-UI library.

Getting started

Bootstrapping of the packages should occur before any work can be done. Afterwards, refer to the documentation of each package individually for how it should be built and run where applicable.

# Install pnpm
  $ npm install pnpm -g
# This installs dependencies and generates symlinks between all the packages so they can be referenced locally
  $ pnpm install

Development

pnpm manages this monorepo in independent mode , which means that each package will be built, and have its version bumped, as well as being published in the case of the PSCore-UI package, independent of the overall repository.

Clean & Bootstrap

Run these command before you start development to avoid discrepancies between packages.

You can clean build folder:

pnpm run clean-all

Install dependencies and symlink packages:

pnpm install

Convenience NPM scripts

  1. enable-alpha enters alpha releasing mode.
  2. disable-alpha exits alpha releasing mode
  3. add-changeset adds a changeset.
  4. update-version updates packages version.
  5. publish-packages publishes packages.
  6. build-and-publish-ci builds and publishes changed packages, their dependents and dependencies except pscore-docs in CI.
  7. build-all builds all packages except pscore-docs.
  8. build-docs builds pscore-docs package.
  9. build-pkg will filter with ends with package name. .e.g PKG=ui pnpm build-pkg

Contribution

Conventional Commits

Commits should be conforming to the guidelines set out in Conventional Commits.

Add these prefixes to define what action you have performed in your commit message

feat:     A new feature
fix:      A bug fix
docs:     Documentation only changes
style:    Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
refactor: A code change that neither fixes a bug nor adds a feature
perf:     A code change that improves performance
test:     Adding missing or correcting existing tests
chore:    Changes to the build process or auxiliary tools and libraries such as documentation generation

Changeset

A changeset is an intent to release a set of packages at particular semver bump types with a summary of the changes made.

This repo uses Changesets for managing release process. Changesets maintain a history of changesets in .changesets folder. Developers are required to write changesets for changes that should be documented. Upon publishing, changesets will be written into changelogs in packages.

Add a changeset.

pnpm run add-changeset

It asks which packages have changes and which semver of those packages to bump. For pre-release mode, ignore major/minor bump. Patch bump is fine as it does not increase patch number in pre-release mode.

Changesets Github bot checks each PR its changesets. Reviewers may add changesets onto the PR. Changesets may not be required if changes aren't to be documented.

Publishing

Automatic Github Publishing

The repository has set up a Github action .github/worksflow/release.yml for publishing packages to NPM. Every push on develop branch may create a pull request with new changelogs and version. Upon a merge, it automatically release the packages.

Manual Publishing

Always fetch latest changes from develop.

Authorised NPM account should have 2FA turned on and an OTP will be prompted when doing release/alpha-release

Releasing an alpha version

This will have alpha tag in the versions released and increase the prerelease number.

Enter pre-release mode

Tag is set to alpha:

pnpm run enable-alpha
Version packages
pnpm run update-version

Commit .pre.json file

Create a pull request and review the new generated changelogs and version. Once it's merged, continue to publish.

Publish packages

Changeset uses npm to publish packages. You may pass in OTP parameter. Commit will be tagged upon a successful publishing. You must push tags manually.

pnpm run publish-packages
Exit pre-release mode

Tag is set to alpha:

pnpm run disable-alpha
Releasing a beta version
pnpx changeset pre enter beta

This will have beta tag in the versions released.

Follow the same process of releasing alpha version.

1.0.0

4 years ago