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

Commit ef819f7

Browse files
committed
Break README into two parts -
1. README.md contains the updated tutorial for the generator. 2. CONTRIBUTING.md contains the contribution guide.
1 parent 783bf4a commit ef819f7

File tree

2 files changed

+144
-25
lines changed

2 files changed

+144
-25
lines changed

CONTRIBUTING.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# generator-biojs-webcomponents [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]
2+
Generates the scaffold for a BioJS component automatically so you don't have to do it yourself.
3+
4+
This is the guide for contributing to this project. If you want to know about the generator and how to install and use it, you can read [this guide](README.md).
5+
6+
## Contribute
7+
8+
To contribute, clone this repository, install yeoman and run the code.
9+
10+
Step 1: Clone the repository.
11+
12+
a) Using HTTPS -
13+
14+
```bash
15+
git clone https://github.com/biojs/generator-biojs-webcomponents.git
16+
```
17+
18+
b) Using SSH -
19+
20+
```bash
21+
git clone [email protected]:biojs/generator-biojs-webcomponents.git
22+
```
23+
24+
Step 2: Go to generator's directory
25+
26+
```bash
27+
cd generator-biojs-webcomponents
28+
```
29+
30+
Step 3: Install yeoman
31+
32+
```bash
33+
npm install -g yo
34+
```
35+
36+
Step 4: Symlink the package
37+
38+
```bash
39+
npm link
40+
```
41+
42+
Step 5: Go out of the generator's directory. Run and test the generator locally.
43+
44+
```bash
45+
cd ..
46+
mkdir test-biojs-generator
47+
cd test-biojs-generator
48+
yo biojs-webcomponents
49+
```
50+
51+
Note: If you have installed the generator-biojs-webcomponents globally, there is no need to worry, this method will still work. You do not need to uninstall anything.
52+
53+
### To-do / roadmap.
54+
55+
See [issues](issues) for more details - we still need the following:
56+
57+
1. Scaffolder for _new_ browser tools (i.e. not just a wrapper for older tools)
58+
2. Scaffolder for command line tools.
59+
60+
## License
61+
62+
MIT © [Yo Yehudi](http://www.yo-yehudi.com)
63+
64+
[npm-image]: https://badge.fury.io/js/%40biojs%2Fgenerator-biojs-webcomponents.svg
65+
[npm-url]: https://npmjs.org/package/%40biojs%2Fgenerator-biojs-webcomponents
66+
[travis-image]: https://travis-ci.org/biojs/generator-biojs-webcomponents.svg?branch=master
67+
[travis-url]: https://travis-ci.org/biojs/generator-biojs-webcomponents
68+
[daviddm-image]: https://david-dm.org/biojs/generator-biojs-webcomponents.svg?theme=shields.io
69+
[daviddm-url]: https://david-dm.org/biojs/generator-biojs-webcomponents

README.md

Lines changed: 75 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# generator-biojs-webcomponents [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url]
2-
Generates the scaffold for a BioJS component automatically so you don't have to do it yourself.
2+
Generates the scaffold for a BioJS component automatically so you don't have to do it yourself.
3+
4+
This guide is for using the generator to make new components and upgrade existing ones. See [Section I](#i-getting-started) for getting started with the generator and installing it and [Section II](#ii-description-of-your-projects-folder-structure) for description of your project's directory after running the generator. Once you install the generator and run it, you will be asked some questions, you can read more about them in [Section III](#iii-workflow-and-questions).
5+
6+
For contributing to this project, see the [Contribution guide](CONTRIBUTING.md).
37

48
### What this tool currently does
59

@@ -33,7 +37,7 @@ Step 2b: Generate your new project.
3337
yo @biojs/biojs-webcomponents
3438
```
3539

36-
After running this, you will be asked some questions about the details of your project, after which the required dependencies will be automatically installed.
40+
After running this, you will be asked some questions about the details of your project, after which the required dependencies will be automatically installed. You can read more about the whole workflow and the questions asked [here](#iii-workflow-and-questions).
3741

3842
Once it's complete, look at your new README file for build instructions, and check out `src/index.js`
3943
and `examples/index.html` to get started - there are instructions in the code.
@@ -87,59 +91,105 @@ Other files are starter files for your project. Generally, you do not need to ed
8791

8892
If you face any issue, feel free to contact us at [Gitter](https://gitter.im/biojs).
8993

90-
## III. Contribute
94+
## III. Workflow and Questions
95+
96+
After running ```yo @biojs/biojs-webcomponents``` in your terminal, you will be asked -
97+
98+
```bash
99+
? What do you want to do today?
100+
> Upgrade an existing component to a Web Component
101+
Make a new Web Component
102+
```
103+
104+
Based on your choice, you will be asked different questions. Read more -
91105

92-
To contribute, clone this repository, install yeoman and run the code.
106+
### Upgrade an existing component to a Web Component
93107

94-
Step 1: Clone the repository.
108+
A) Import the build file of your existing component into the project's directory.
95109

96-
a) Using HTTPS -
110+
1) You can import the build file from your local computer.
111+
2) If you do not have the build file in your computer, you can import it from your component's package on npm.
97112

98113
```bash
99-
git clone https://github.com/biojs/generator-biojs-webcomponents.git
114+
? We need the build file (generally index.js, main.js or componentName.js) for this,
115+
import it using one of the options -
116+
1) Tell us the path of the file on your local machine and we will import it in the project.
117+
2) Tell us the npm package name, version, etc. and we will import it.
100118
```
101119

102-
b) Using SSH -
120+
Import from your local machine -
121+
122+
B) Enter the path of your build file.
103123

104124
```bash
105-
git clone [email protected]:biojs/generator-biojs-webcomponents.git
125+
Please enter the path of the build file.
106126
```
107127

108-
Step 2: Go to generator's directory
128+
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).
109129

110130
```bash
111-
cd generator-biojs-webcomponents
131+
Please enter the path of the build file, we will paste it into the existing directory.
112132
```
113133

114-
Step 3: Install yeoman
134+
Import from your compnent's package on npm -
135+
136+
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.
115137

116138
```bash
117-
npm install -g yo
139+
Enter the package name (case sensitive).
140+
Press enter if the package description shown is correct.
118141
```
119142
120-
Step 4: Symlink the package
143+
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.
121144
122145
```bash
123-
npm link
146+
? What do you want to do?
147+
1) Enter package name again.
148+
2) Import the file locally from your computer.
124149
```
125150
126-
Step 5: Go out of the generator's directory. Run and test the generator locally.
151+
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.
127152
128153
```bash
129-
cd ..
130-
mkdir test-biojs-generator
131-
cd test-biojs-generator
132-
yo biojs-webcomponents
154+
Great! We will import the latest version of your file from the npm package, if you don't want this,
155+
enter the version.
133156
```
134157
135-
Note: If you have installed the generator-biojs-webcomponents globally, there is no need to worry, this method will still work. You do not need to uninstall anything.
158+
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.
159+
160+
```bash
161+
This URL - https://www.jsdelivr.com/package/npm/<your-package-name>?version=<your-package-version>
162+
contains the directory of the package, please find the build file (generally in the dist or build
163+
folder) and paste the link here, we will download it for you.
164+
```
136165

137-
### To-do / roadmap.
166+
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.
138167

139-
See [issues](issues) for more details - we still need the following:
168+
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).
140169

141-
1. Scaffolder for _new_ browser tools (i.e. not just a wrapper for older tools)
142-
2. Scaffolder for command line tools.
170+
```bash
171+
This URL - https://www.jsdelivr.com/package/npm/<your-package-name>?version=<your-package-version>
172+
contains the directory of the package, please find the build file (generally in the dist or build
173+
folder) and paste the link here, we will download it for you in the existing folder.
174+
```
175+
176+
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).
177+
178+
### Make a new Web Component
179+
180+
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.
181+
182+
```bash
183+
Computer package name? This is a computer name with NO capital letters or special
184+
characters apart from the hyphen ( - ) .
185+
```
186+
187+
B) Enter human name for the project. This can only contain letters (small and capital) and spaces, no other special characters or numbers.
188+
189+
```bash
190+
Thanks! Now, give me a human name for the project with only letters and NO special
191+
characters apart from the whitespace (space). e.g. \"Genome Browser\"
192+
```
143193
144194
## License
145195

0 commit comments

Comments
 (0)