1.0.98 • Published 5 months ago

common-lib-vue v1.0.98

Weekly downloads
170
License
-
Repository
github
Last release
5 months ago

BCGov Vue Common Library

Lifecycle:Stable

Storybook documentation: https://bcgov.github.io/common-lib-vue/

Recommended IDE Setup

VSCode + Volar (and disable Vetur).

Customize configuration

See Vite Configuration Reference.

Project Setup

npm install

Compile and Hot-Reload for Development

npm run dev

Compile and Minify for Production

npm run build

Run Unit Tests with Vitest

npm run test:unit
or
npm run test:unit:coverage

Run End-to-End Tests with Cypress

npm run test:e2e
or
npm run test:e2e:headless

Normally in projects that use Cypress with Vite, commands like npm run test:e2e:dev would allow you to run e2e tests against a developer as opposed to production build. In this library, the e2e tests are configured in the package.json to run with storybook, which handles the server hosting and mounting of components. npm run test:e2e will do all of that for you. npm run test:e2e:headless will also do the same thing but headless.

Lint with ESLint

npm run lint

This project uses ESLint for linting.

npm run format

This project uses Prettier for code formatting.

Start and launch Storybook

npm run storybook

Other important notes

This library requires a minimum of Node 22. This is because the PDFJS library we use for the FileUploader component uses the Promise.withResolvers method in it.

The captcha component in this library has a v-html directive in it. V-html directives can be insecure when used to render user-generated input. In this case, the v-html directive is only used to render a pre-formatted .svg file generated by a secure companion captcha service, which is a safe usage.

Dependency explanations:

  • @bcgov/bootstrap-v5-theme -- used for component styling. This package uses Bootstrap 5 under the hood, so common library project syntax needs to be compatibile with Bootstrap 5
  • axios -- used for external API calls
  • corejs -- used for polyfills in the FileUploader and other components. Might be able to be removed someday
  • date-fns -- used for the DateInput and DatePicker components
  • lodash -- debounce functionality in the AddressDoctorInput component and cloneDeepWith in the helpers/utils.js
  • maska -- masks user input in a number of components
  • pdfjs-dist -- used extensively in the FileUploader component
  • sha1 -- used to make hashes for the FileUploader component
  • uuid -- used to make image IDs for the FileUploader component
  • vue -- all of the components in this package are Vue components, so we need Vue
  • web-streams-polyfill -- readableStream polyfill used in FileUploader. Might be able to be removed someday

Dev Dependency explanations:

  • @storybook/addon-essentials -- adds basic functionality to Storybook, eg. Actions and Docs
  • @storybook/vue3 -- used to handle Vue 3 files in the Storybook preview
  • @storybook/vue3-vite -- used to run Storybook in Vite for improved performance
  • @vitejs/plugin-vue -- used to configure the vite.config.js file
  • @vitest/coverage-v8 -- used to measure code coverage with Vitest
  • @vue/test-utils -- used to mount Vue components in unit tests
  • cypress -- used in the npm run test:e2e command for e2e testing
  • eslint -- used in the npm run lint command for static code analysis
  • eslint-plugin-compat -- used with eslint to determine if any of our code is incompatible with modern browsers
  • eslint-plugin-cypress -- used to run static code analysis on Cypress tests without throwing errors
  • eslint-plugin-vue -- used to run static code analysis on Vue components
  • jsdom -- used in Vitest to run unit tests
  • prettier -- used in the npm run format command to automatically and consistently format code across the project
  • start-server-and-test -- used in the npm run test:e2e command to start a Vite server so Cypress can run in it
  • storybook -- used to conveniently render library components in the dev environment through the npm run storybook command
  • storybook-addon-mock -- used in Storybook to allow the AddressDoctorInput component to simulate receiving a API response
  • vite -- used to build and locally host the application
  • vitest -- used to run unit tests for the application
3.1.1-alpha.5

5 months ago

3.1.1-alpha.4

5 months ago

3.1.1-alpha.3

6 months ago

3.1.1-alpha.2

9 months ago

3.1.1-alpha.0

10 months ago

3.1.1-alpha.1

9 months ago

3.0.1-alpha.8

2 years ago

3.0.1-alpha.7

2 years ago

1.0.98

2 years ago

1.0.97

2 years ago

3.0.1-alpha.6

3 years ago

3.0.1-alpha.5

3 years ago

3.0.1-alpha.2

3 years ago

3.0.1-alpha.4

3 years ago

3.0.1-alpha.3

3 years ago

1.0.94

3 years ago

1.0.93

3 years ago

1.0.92

3 years ago

3.0.1-alpha.1

3 years ago

1.0.91

3 years ago

1.0.87-alpha.0

3 years ago

1.0.88

3 years ago

1.0.87

3 years ago

1.0.89

3 years ago

1.0.90

3 years ago

1.0.87-next.0

3 years ago

1.0.73

4 years ago

1.0.72

4 years ago

1.0.71

4 years ago

1.0.70

4 years ago

1.0.77

3 years ago

1.0.76

3 years ago

1.0.74

4 years ago

1.0.79

3 years ago

1.0.78

3 years ago

1.0.80

3 years ago

1.0.84

3 years ago

1.0.83

3 years ago

1.0.82

3 years ago

1.0.81

3 years ago

1.0.86

3 years ago

1.0.85

3 years ago

1.0.62

4 years ago

1.0.61

4 years ago

1.0.66

4 years ago

1.0.65

4 years ago

1.0.64

4 years ago

1.0.63

4 years ago

1.0.69

4 years ago

1.0.68

4 years ago

1.0.67

4 years ago

1.0.60

4 years ago

1.0.59

4 years ago

1.0.58

4 years ago

1.0.57

4 years ago

1.0.51

4 years ago

1.0.55

4 years ago

1.0.54

4 years ago

1.0.53

4 years ago

1.0.52

4 years ago

1.0.56

4 years ago

1.0.50

4 years ago

1.0.49

4 years ago

1.0.48

4 years ago

1.0.47

4 years ago

1.0.46

4 years ago

1.0.45

4 years ago

1.0.44

4 years ago

1.0.43

4 years ago

1.0.42

4 years ago

1.0.40

4 years ago

1.0.41

4 years ago

1.0.39

4 years ago

1.0.38

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.33

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.29

4 years ago

1.0.30

4 years ago

1.0.28

4 years ago

1.0.26

4 years ago

1.0.27

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.20

4 years ago

1.0.16

4 years ago

1.0.11

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago