@@ -8,49 +8,73 @@ category: packages
8
8
[ ![ MIT License] [ license-badge ]] [ license ]   ;
9
9
[ ![ Code of Conduct] [ coc-badge ]] [ coc ]
10
10
11
- A CLI tool for UI component libraries made by Instructure Inc.
11
+ A CLI tool for InstUI build and publish tools made by Instructure Inc.
12
12
13
- ### Installation
13
+ ### Scripts
14
+
15
+ For more documentation on available options and parameters for individual commands run:
14
16
15
17
``` sh
16
- npm install @instructure/ ui-scripts
18
+ ui-scripts < command > --help
17
19
```
18
20
19
- ### Scripts
20
-
21
- #### ` build `
21
+ #### build
22
22
23
23
To build (babel transpile) a package to be consumed as a library:
24
24
25
- ` npm run ui-scripts build `
25
+ ` npm run ui-scripts build --modules cjs ` writes commonjs modules to the lib/ directory.
26
+
27
+ ` npm run ui-scripts build --modules es ` writes es modules to the es/ directory.
28
+
29
+ ` npm run ui-scripts build --modules es,cjs ` writes es modules to both directories.
30
+
31
+ If not specified, ` modules ` defaults to ` es ` .
26
32
27
33
To build (webpack) a package to be consumed as an application:
28
34
29
35
` npm run ui-scripts bundle `
30
36
31
- #### ` clean `
37
+ #### bump version
38
+
39
+ To update all package versions
40
+ (defaults to determining the version automatically using commit messages):
41
+
42
+ ` npm run ui-scripts bump [version|major|minor|patch] `
43
+
44
+ #### clean
32
45
33
46
To clean out built/generated files from a package:
34
47
35
48
` npm run ui-scripts clean `
36
49
37
- #### ` modules `
50
+ #### deprecate
38
51
39
- ` npm run ui-scripts build --modules cjs ` writes commonjs modules to the lib/ directory.
52
+ Deprecates ALL of a certain version of instUI npm packages by running ` npm deprecate ` .
53
+ ` versionToDeprecate ` defaults to the current version.
40
54
41
- ` npm run ui-scripts build --modules es ` writes es modules to the es/ directory.
55
+ ` npm run ui-scripts deprecate --versionToDeprecate 5.11.0 --fixVersion 5.11.1 `
42
56
43
- ` npm run ui-scripts build --modules es,cjs ` writes es modules to both directories.
57
+ #### examples (Storybook)
44
58
45
- If not specified, ` modules ` defaults to ` es ` .
59
+ To build component examples and start up a dev server with hot reloading:
46
60
47
- #### ` test `
61
+ ` npm run ui-scripts examples --watch -p 8080 `
48
62
49
- To run tests for a package :
63
+ To build component examples for deploying :
50
64
51
- ` npm run ui-scripts test `
65
+ ` npm run ui-scripts examples `
66
+
67
+ #### generating design tokens
68
+
69
+ ` npm run generate-tokens <options> `
70
+
71
+ Generate cross-platform design tokens for the given theme.
52
72
53
- #### ` lint `
73
+ ` npm run generate-all-tokens `
74
+
75
+ Generate cross-platform design tokens for all themes in the repo.
76
+
77
+ #### lint
54
78
55
79
To lint (eslint/stylelint) all files:
56
80
@@ -64,49 +88,19 @@ To fix lint issues:
64
88
65
89
` npm run ui-scripts lint --fix `
66
90
67
- #### ` install-react `
68
-
69
- To install a specific version of React and ReactDOM without updating ` package.json `
70
- (defaults to the versions specified in the resolutions field):
71
-
72
- ` npm run ui-scripts install-react [version] `
73
-
74
- #### ` bump `
75
-
76
- To update all package versions
77
- (defaults to determining the version automatically using commit messages):
78
-
79
- ` npm run ui-scripts bump [version|major|minor|patch] `
80
-
81
- #### ` publish `
91
+ #### publish to npm
82
92
83
93
To publish all packages (defaults to current version):
84
94
85
95
` npm run ui-scripts publish [version] `
86
96
87
- #### ` deploy-docs `
88
-
89
- To run the deploy of the documentation (to Github pages):
90
-
91
- ` npm run ui-scripts deploy-docs `
92
-
93
- #### ` examples `
94
-
95
- To build component examples and start up a dev server with hot reloading:
96
-
97
- ` npm run ui-scripts examples --watch -p 8080 `
98
-
99
- To build component examples for deploying:
100
-
101
- ` npm run ui-scripts examples `
102
-
103
- #### ` server `
97
+ #### server
104
98
105
99
To start up a server to test production builds of examples or docs:
106
100
107
101
` npm run ui-scripts server -p 8080 `
108
102
109
- #### ` tag `
103
+ #### npm tag
110
104
111
105
To add an NPM dist-tag for all packages:
112
106
@@ -116,55 +110,26 @@ To remove an NPM dist-tag for all packages:
116
110
117
111
` npm run ui-scripts tag rm 5.11.0 latest `
118
112
119
- #### ` deprecate `
113
+ #### running tests
120
114
121
- To deprecate all packages (optional arguments: version, fix version) :
115
+ To run all tests :
122
116
123
- ` npm run ui-scripts deprecate 5.11.0 5.11.1 `
117
+ ` npm run ui-scripts test `
124
118
125
- ### Configuration
119
+ To run tests for a package:
126
120
127
- If you'd like to use the publish, deploy, and release scripts, you'll need to configure your project as follows:
121
+ ` npm run ui- scripts test -- --scope @instructure/ui-avatar `
128
122
129
- #### Project level
130
-
131
- Add the config to your project level ` package.json ` file:
132
-
133
- ``` json
134
- "config" : {
135
- "ui-scripts" : {
136
- "slack_emoji" : " :instui:" ,
137
- "slack_channel" : " #instui" ,
138
- "jira_host" : " instructure.atlassian.net" ,
139
- "jira_project_id" : " 17900" ,
140
- "jira_project_key" : " INSTUI" ,
141
- "npm_scope" : " @instructure:registry=https://registry.npmjs.org/" ,
142
- "gh_pages_branch" : " gh-pages" ,
143
- "gh_pages_dir" : " packages/__docs__/__build__" ,
144
- "gh_pages_cname" : " instructure.design" ,
145
- "changelog_url" : " https://instructure.design/#CHANGELOG"
146
- }
147
- }
148
- ```
123
+ ### Configuration
149
124
150
- #### Environment variables
125
+ If you'd like to use the publish, deploy, and release scripts, you'll need to configure your project as follows:
151
126
152
- Add a ` .env ` file to your project root:
127
+ Add a ` .env ` file to your project root or define these env vars for your shell :
153
128
154
129
``` sh
155
130
NPM_TOKEN=
156
131
NPM_USERNAME=
157
132
NPM_EMAIL=
158
- GIT_EMAIL=" "
159
- GIT_USERNAME=
160
- GIT_REMOTE_URL=gerrit:instructure-ui
161
- GIT_REMOTE_NAME=origin
162
- JIRA_CONSUMER_KEY=
163
- JIRA_TOKEN=
164
- JIRA_SECRET=
165
- JIRA_PEM_PATH=/Users/your_user_name/.ssh/jira.pem
166
- SLACK_USERNAME=instui
167
- SLACK_WEBHOOK=
168
133
```
169
134
170
135
[ npm ] : https://img.shields.io/npm/v/@instructure/ui-scripts.svg
0 commit comments