Skip to content
This repository was archived by the owner on Mar 30, 2021. It is now read-only.

Commit 4c745fd

Browse files
committed
Updated documentation for new workflow
1 parent 59a0173 commit 4c745fd

File tree

2 files changed

+88
-48
lines changed

2 files changed

+88
-48
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,37 @@ Step 1: Clone the repository.
1111

1212
a) Using HTTPS -
1313

14-
```bash
14+
```
1515
git clone https://github.com/biojs/generator-biojs-webcomponents.git
1616
```
1717

1818
b) Using SSH -
1919

20-
```bash
20+
```
2121
git clone [email protected]:biojs/generator-biojs-webcomponents.git
2222
```
2323

2424
Step 2: Go to generator's directory
2525

26-
```bash
26+
```
2727
cd generator-biojs-webcomponents
2828
```
2929

3030
Step 3: Install yeoman
3131

32-
```bash
32+
```
3333
npm install -g yo
3434
```
3535

3636
Step 4: Symlink the package
3737

38-
```bash
38+
```
3939
npm link
4040
```
4141

4242
Step 5: Go out of the generator's directory. Run and test the generator locally.
4343

44-
```bash
44+
```
4545
cd ..
4646
mkdir test-biojs-generator
4747
cd test-biojs-generator

README.md

Lines changed: 82 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Note: If you need to manage multiple versions of node also consider [nvm](https:
1717

1818
Step 1: Install [Yeoman](http://yeoman.io).
1919

20-
```bash
20+
```
2121
npm install -g yo
2222
```
2323

2424
Step 2a: Install [generator-biojs-webcomponents](https://www.npmjs.com/package/@biojs/generator-biojs-webcomponents).
2525

26-
```bash
26+
```
2727
npm install -g yo @biojs/biojs-webcomponents
2828
```
2929

@@ -32,21 +32,21 @@ Step 2b: Generate your new project.
3232
```
3333
i) yo @biojs/biojs-webcomponents
3434
```
35-
This will make a new directory named `web-component` in the current directory. The `web-component` directory will be your project directory. If there is already a directory with the name `web-component`, the generator will not make a new one, rather the existing one will be your project directory.
35+
This will make a **new directory** named `web-component` in the **current directory**. The `web-component` directory will be your **project directory**. If there is already a directory with the name `web-component`, the generator will not make a new one, rather **the existing one will be your project directory**.
3636

3737
OR
3838

3939
```
4040
ii) yo @biojs/biojs-webcomponents .
4141
```
42-
This will run the generator in the current directory.
42+
This will run the generator in the **current directory**.
4343

4444
OR
4545

4646
```
4747
iii) yo @biojs/biojs-webcomponents /anyPath/yourNewProjectDir
4848
```
49-
This will run the generator in a new directory named `yourNewProjectDir` (you can choose any other name), the new directory will be created at the path you specified. If there is already a directory with the same name as you provided, the generator will not make a new one, rather the existing one will be your project directory.
49+
This will run the generator in a new directory named `yourNewProjectDir` (you can choose any other name), the new directory will be created at the **path you specified**. If there is already a directory with the same name as you provided, the generator will not make a new one, rather **the existing one will be your project directory**.
5050

5151

5252

@@ -58,7 +58,7 @@ and `examples/index.html` to get started - there are instructions in the code.
5858
## II. Description of your Project's Folder Structure
5959
Once you complete all the steps mentioned above you will have a project with a folder structure like this -
6060

61-
```bash
61+
```
6262
├── dev
6363
│ └────── serve.js
6464
├── examples
@@ -108,7 +108,9 @@ If you face any issue, feel free to contact us at [Gitter](https://gitter.im/bio
108108

109109
After running ```yo @biojs/biojs-webcomponents``` in your terminal, you will be asked -
110110

111-
```bash
111+
```
112+
? Press Enter key to get going!
113+
112114
? What do you want to do today?
113115
> Upgrade an existing component to a Web Component
114116
Make a new Web Component
@@ -120,86 +122,124 @@ Based on your choice, you will be asked different questions. Read more -
120122

121123
A) Import the build file of your existing component into the project's directory.
122124

123-
1) You can import the build file from your local computer.
124-
2) If you do not have the build file in your computer, you can import it from your component's package on npm.
125+
1) Install the component from npm [**Recommended - Fastest way**]
126+
2) You can import the build file from your local computer.
127+
3) If you do not have the build file in your computer, you can import it from your component's package on npm.
125128

126-
```bash
129+
```
127130
? We need the build file (generally index.js, main.js or componentName.js) for this,
128131
import it using one of the options -
129-
1) Tell us the path of the file on your local machine and we will import it in the project.
130-
2) Tell us the npm package name, version, etc. and we will import it.
132+
1) Install component from npm package (Recommended - fastest way)
133+
2) Tell us the path of the file on your local machine and we will import it in the project.
134+
3) Tell us the npm package name, version, etc. and we will import it.
131135
```
132136

133-
Import from your local machine -
137+
B1) Install component from npm package -
134138

135-
B) Enter the path of your build file.
139+
You have to enter the package name (case sensitive) of your component, the generator will show you the description of your package and ask whether the description shown is correct or not.
140+
141+
```
142+
Enter the package name (case sensitive).
143+
Press enter if the package description shown is correct.
144+
```
145+
146+
If the description shown is incorrect, press ```N``` and you will go back to step A where you can choose to enter the package name again or import the file from local storage.
147+
148+
```
149+
? What do you want to do?
150+
1) Enter package name again to install component from npm package. (Recommended - fastest way)
151+
2) Import the file locally from your computer.
152+
3) Enter package name, version, build file URL to download the build file.
153+
```
154+
155+
If the description shown is correct, press ```Enter``` or ```Y```. You will be asked about the version of the package you want to import from. You can press ```Enter``` if you want to import from the latest version or you can enter the version you need. If you enter a version which does not exist, the generator will ask for version again.
156+
157+
```
158+
Great! We will import the latest version of your file from the npm package, if you don't want this,
159+
enter the version.
160+
```
161+
162+
Your component will be installed. Next, the questions in [this](#make-a-new-web-component) section will be asked.
163+
164+
B2) Import build file from your local storage -
165+
166+
Firstly, the generator will ask you about the build directory - the build file will be imported in this directory which will be created in your project directory. You can press ```Enter``` if you want the default name - ```component-dist``` or enter a name of your choice.
167+
168+
If a directory with the same name already exists in your project directory, you can either enter a new name for your directory or press ```o```/```O``` if you want to overwrite the content of existing directory.
136169

137-
```bash
138-
Please enter the path of the build file.
170+
```
171+
The build file will be imported in a separate directory in the project's root.
172+
Enter the name of this directory or press Enter if you like to go with default.
173+
(component-dist)
139174
```
140175

141-
The generator will make a directory named ```component-dist``` in your component's directory. Your build file will be imported in this directory. If this directory (component-dist) already exists, you can enter ```skip``` and enter the path of the build file in the next question (given below).
176+
Enter the path of your build file.
142177

143-
```bash
144-
Please enter the path of the build file, we will paste it into the existing directory.
178+
```
179+
Please enter the path of the build file.
145180
```
146181

147-
Import from your compnent's package on npm -
182+
Your build file will be imported in the build directory. Next, the questions in [this](#make-a-new-web-component) section will be asked.
148183

149-
C) You have to enter the package name (case sensitive) of your component, the generator will show you the description of your package and ask whether the description shown is correct or not.
184+
B3) Import build file from your compnent's package on npm -
150185

151-
```bash
186+
You have to enter the package name (case sensitive) of your component, the generator will show you the description of your package and ask whether the description shown is correct or not.
187+
188+
```
152189
Enter the package name (case sensitive).
153190
Press enter if the package description shown is correct.
154191
```
155192

156193
If the description shown is incorrect, press ```N``` and you will go back to step A where you can choose to enter the package name again or import the file from local storage.
157194

158-
```bash
195+
```
159196
? What do you want to do?
160-
1) Enter package name again.
197+
1) Enter package name again to install component from npm package. (Recommended - fastest way)
161198
2) Import the file locally from your computer.
199+
3) Enter package name, version, build file URL to download the build file.
162200
```
163201

164-
If the description shown is correct, press ```Enter``` or ```Y```. You will be asked about the version of the package you want to import from.
202+
If the description shown is correct, press ```Enter``` or ```Y```. You will be asked about the version of the package you want to import from. You can press ```Enter``` if you want to import from the latest version or you can enter the version you need. If you enter a version which does not exist, the generator will ask for version again.
165203

166-
```bash
167-
Great! We will import the latest version of your file from the npm package, if you don't want this,
168-
enter the version.
204+
```
205+
Great! We will import the latest version of your file from the npm package,
206+
if you don't want this, enter the version.
169207
```
170208

171-
You can press ```Enter``` if you want to import from the latest version or you can enter the version you need. If the version exists, you will be shown a URL which will redirect you to your package's directory.
209+
Once you enter a valid version and press ```Enter```, the generator will ask you about the build directory - the build file will be imported in this directory which will be created in your project directory. You can press ```Enter``` if you want the default name - ```component-dist``` or enter a name of your choice.
172210

173-
```bash
174-
This URL - https://www.jsdelivr.com/package/npm/<your-package-name>?version=<your-package-version>
175-
contains the directory of the package, please find the build file (generally in the dist or build
176-
folder) and paste the link here, we will download it for you.
177-
```
211+
If a directory with the same name already exists in your project directory, you can either enter a new name for your directory or press ```o```/```O``` if you want to overwrite the content of existing directory.
178212

179-
After going to this URL, you can find the build file in the root folder or a separate folder named build or dist. The build file is generally named index.js, package_name.js, index.min.js or package_name.min.js.
213+
```
214+
The build file will be imported in a separate directory in the project's root.
215+
Enter the name of this directory or press Enter if you like to go with default.
216+
(component-dist)
217+
```
180218

181-
You have to copy the URL/link to the build file and enter it and the generator will download it for you in a directory named ```component-dist```. If this directory (component-dist) already exists then enter ```skip``` and enter the URL in the next question (given below).
219+
Once you have your build directory ready, generator will show you a URL, which containts the component's directory. You can find the build file in the root folder or a separate folder named build, dist, etc. The build file is generally named index.js, package_name.js, index.min.js or package_name.min.js, etc. Copy the URL of the build file and paste it in the generator.
182220

183-
```bash
221+
```
184222
This URL - https://www.jsdelivr.com/package/npm/<your-package-name>?version=<your-package-version>
185-
contains the directory of the package, please find the build file (generally in the dist or build
186-
folder) and paste the link here, we will download it for you in the existing folder.
223+
contains the directory of the package, please find the build file (generally in the dist or build
224+
folder) and paste the link here, we will download it for you.
187225
```
188226

189-
D) After successfully importing the build file, you will be asked the same questions (questions A and B in the next section) about your component as asked while [making a new one](#make-a-new-web-component).
227+
The generator will download the build file in the build directory. Next, the questions in [this](#make-a-new-web-component) section will be asked.
228+
229+
C) After successfully installing the component/importing the build file, you will be asked the same questions (questions A and B in the next section) about your component as asked while [making a new one](#make-a-new-web-component).
190230

191231
### Make a new Web Component
192232

193233
A) Enter computer package name. This should contain only small alphabets and hyphen ( - ) between the words. You can't use CAPITAL letters, number, space, any other special character(s) and hyphen at beginning or end.
194234

195-
```bash
235+
```
196236
Computer package name? This is a computer name with NO capital letters or special
197237
characters apart from the hyphen ( - ) .
198238
```
199239

200240
B) Enter human name for the project. This can only contain letters (small and capital) and spaces, no other special characters or numbers.
201241

202-
```bash
242+
```
203243
Thanks! Now, give me a human name for the project with only letters and NO special
204244
characters apart from the whitespace (space). e.g. \"Genome Browser\"
205245
```

0 commit comments

Comments
 (0)