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

Commit 92bbf6b

Browse files
committed
Minor improvements
1. This add instructions while installing dependencies. 2. Improves instructions in TODO.md. 3. Fix a bug that made webpack failed to make bundle.js.
1 parent 82c42ba commit 92bbf6b

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

generators/app/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,19 @@ module.exports = class extends Generator {
358358
bower: false,
359359
yarn: false
360360
});
361+
this.log(
362+
`While we install the dependencies, you can read the next steps - \n1. Write the code for your component, instructions are in ${chalk.yellow(
363+
"src/index.js"
364+
)}.\n2. Add css styles to your component in ${chalk.yellow(
365+
"src/style"
366+
)}.less.\n3. Run ${chalk.yellow(
367+
"npm run less && npm run build"
368+
)}.\n4. Use your component in ${chalk.yellow(
369+
"examples/index.html"
370+
)}.\n5. Test your component using ${chalk.yellow(
371+
"npm start"
372+
)}.\n\nYou can read the detailed instructions in TODO.md.\n`
373+
);
361374
}
362375
};
363376

generators/app/templates/TODO.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,16 @@ produced the basic files needed for your tool. You'll still need to handle the i
1515
},```
1616
- [] add any css styles to [src/style.less](src/style.less)
1717

18-
All those done? Brilliant! To push this component to npm, you'll need an [account at npmjs.com](https://www.npmjs.com/). Once you've signed up....
18+
Run the commands written below in the given order -
19+
1. `npm run less`
20+
2. `npm run build`
21+
3. `npm start`
22+
23+
Navigate to the `examples` page and check if your component is working.
24+
25+
All those done? Now anybody can use your Web Component by importing the [bundle.js](dist/bundle.js) file in the [dist](dist) directory and [style.css](dist/style.css) if you have a stylesheet.
26+
27+
Brilliant! To push this component to npm, you'll need an [account at npmjs.com](https://www.npmjs.com/). Once you've signed up....
1928

2029
1. Run `npm login` in your terminal to sign in to npm. Add your username and password when prompted.
2130
2. Run `npm publish` - this step will publish your app onto the public npm repository.

generators/app/templates/src/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import 'hybrids/shim';
21
import {
32
define
43
} from 'hybrids';
@@ -63,13 +62,18 @@ function initComponent(options) {
6362
/** you have a gene visualisation so you want a gene id **/
6463
/** as a parameter, set the parameter as an attribute, **/
6564
/** and then get the attribute from host, like this: **/
66-
var myGeneId = host.getAttribute("geneId");
65+
66+
var myGeneId = host.getAttribute("geneId");
67+
6768
/** The line above would return BRCA1 if you've left the **/
6869
/** default settings. Delete if needed. **/
70+
/** This is just an example, you should remove it later. **/
6971

7072
host.innerHTML = "<div>A placeholder for a pretty" +
7173
" visualisation for " + myGeneId + ".</div>";
7274

75+
/** The line above explains how you can interact with your Web Component. **/
76+
/** You should remove it later. **/
7377

7478
//leave this line here. Deleting it will result in your css going AWOL.
7579
addStylesIfNeeded();

0 commit comments

Comments
 (0)