@ambita/design-system 5.0.11 → 5.1.1-1291.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,75 +1,105 @@
1
1
  # Design System
2
2
 
3
- This template should help get you started developing with Vue 3 in Vite.
3
+ Written in Vue 3 using Vite and TypeScript.
4
4
 
5
- ## Recommended IDE Setup
5
+ ## Getting started
6
6
 
7
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
7
+ ### First run
8
8
 
9
- ## Type Support for `.vue` Imports in TS
9
+ Generate NPM token (try the 'npm whoami' command to see if you get any response). If no response, complete the following guide: https://ambita.atlassian.net/wiki/spaces/AI/pages/3060006975/Generate+NPM_TOKEN
10
10
 
11
- TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin) to make the TypeScript language service aware of `.vue` types.
11
+ To get the project up and running locally, install npm packages and start vite:
12
12
 
13
- If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a [Take Over Mode](https://github.com/johnsoncodehk/volar/discussions/471#discussioncomment-1361669) that is more performant. You can enable it by the following steps:
13
+ ```sh
14
+ npm i && npm run storybook
15
+ ```
14
16
 
15
- 1. Disable the built-in TypeScript Extension
16
- 1) Run `Extensions: Show Built-in Extensions` from VSCode's command palette
17
- 2) Find `TypeScript and JavaScript Language Features`, right click and select `Disable (Workspace)`
18
- 2. Reload the VSCode window by running `Developer: Reload Window` from the command palette.
17
+ ### [Vivid Blueprint](https://github.com/Ambita/vivid-blueprint)
19
18
 
20
- ## Customize configuration
19
+ We also have an optional front-end template which we highly recommend using for new Ambita front-end projects. It is based on the create-vue project and comes pre-installed with this design system along with other goodies.
21
20
 
22
- See [Vite Configuration Reference](https://vitejs.dev/config/).
21
+ ### Contribution
23
22
 
24
- ## Project Setup
23
+ New features must be developed on separate feature branches and merged into dev through pull requests. A GitHub workflow will then automatically publish a new npm package to @ambita/design-system.
24
+ It will have a dev tag and can be installed like this:
25
25
 
26
26
  ```sh
27
- npm install
27
+ npm i @ambita/design-system@dev
28
28
  ```
29
29
 
30
- ### Compile and Hot-Reload for Development
30
+ To be able to commit, the code must pass a lint-check and all unit tests must run successfully.
31
+ The code will be automatically formatted, but can also be run manually with a script shown below.
32
+
33
+ After testing the @dev package, a PR to main from dev can be created.
34
+ Post-merge, another workflow will be run, publishing a @latest package to npm which can be installed like this.
31
35
 
32
36
  ```sh
33
- npm run dev
37
+ npm i @ambita/design-system
34
38
  ```
35
39
 
36
- ### Type-Check, Compile and Minify for Production
40
+ #### New Components
41
+
42
+ Every new component and helper should have a storybook document associated with it and preferably unit tests as well. Remember to export it in `./src/index.ts`.
43
+
44
+ ### Scripts
45
+
46
+ #### Compile and Hot-Reload for Development
37
47
 
38
48
  ```sh
39
- npm run build
49
+ npm start
40
50
  ```
41
51
 
42
- ### Run Unit Tests with [Vitest](https://vitest.dev/)
52
+ #### Documentation and manual testing with [Storybook](https://storybook.js.org/)
43
53
 
44
54
  ```sh
45
- npm run test:unit
55
+ npm run storybook
46
56
  ```
47
57
 
48
- ### Run End-to-End Tests with [Cypress](https://www.cypress.io/)
58
+ #### Type-Check, Compile and Minify for Production
49
59
 
50
60
  ```sh
51
- npm run test:e2e:dev
61
+ npm run build
52
62
  ```
53
63
 
54
- This runs the end-to-end tests against the Vite development server.
55
- It is much faster than the production build.
64
+ #### Run Unit Tests with [Vitest](https://vitest.dev/)
56
65
 
57
- But it's still recommended to test the production build with `test:e2e` before deploying (e.g. in CI environments):
66
+ Once:
58
67
 
59
68
  ```sh
60
- npm run build
61
- npm run test:e2e
69
+ npm test
62
70
  ```
63
71
 
64
- ### Lint with [ESLint](https://eslint.org/)
72
+ Continuously:
65
73
 
66
74
  ```sh
67
- npm run lint
75
+ npm run test:unit
76
+ ```
77
+
78
+ #### Test coverage with [v8](https://vitest.dev/guide/coverage)
79
+
80
+ ```sh
81
+ npm run test:coverage
68
82
  ```
69
83
 
84
+ #### Lint with [ESLint](https://eslint.org/)
85
+
86
+ ```sh
87
+ npm run lint
88
+ ```
70
89
 
71
- ### Format with [Prettier](https://prettier.io/)
90
+ #### Format with [Prettier](https://prettier.io/)
72
91
 
73
92
  ```sh
74
93
  npm run format
75
94
  ```
95
+
96
+ #### Type Check [TypeScript](https://www.typescriptlang.org/)
97
+
98
+ ```sh
99
+ npm run type-check
100
+ ```
101
+
102
+ ## Links
103
+
104
+ - https://github.com/Ambita/vivid-blueprint
105
+ - https://github.com/Ambita/design-system-icons