A Yeoman generator to author JavaScript and TypeScript libraries. π³ Urca generator
Getting started
Before we begin, make sure you have the Yeoman scaffolding toolset installed (yo
), since it is part of the Yeoman tool set you might have installed it before.
Use npm to globally install yo
and the urca
generator:
npm install --global yo generator-urca
(If you have permissions problems installing a package globally, you may use sudo npm install ...
)
You are now ready to create your library!
How to use
The urca generator will help you create a JavaScript or TypeScript application in your working directory.
To create your library project, navigate to a new project folder and then use yo
to generate your application:
yo urca
The generator will ask you a few questions and will generate it for you.
Questions the generator will ask
- app name
- app description
- app keywords
- public or private repository
- JavaScript or TypeScript
- add or not React to demo page
- GitHub username
- GitHub email
- first and last name
- dependencies:
Directory structure
When the installation process is over, this is the file structure that will be generated:
.
βββ demo/ # demo page
β βββ index.html
β βββ index.j(t)s(x)
β βββ style.css
βββ dist/ # distributable version of app built using Parcel
βββ node_modules/ # npm managed libraries
βββ src/ # project source code
β βββ lib/ # folder for your library
β βββ hello.j(t)s
β βββ index.j(t)s # app entry point
βββ .eslintrc.js
βββ .gitignore
βββ .prettierignore
βββ .prettierrc.js
βββ .yo-rc.json
βββ LICENSE
βββ package.json
βββ README.md
βββ (tsconfig.json)
βββ yarn.lock
Features
- Prettier to format your code
- Eslint to lint your code
- Parcel to automagically compile ES6
- TypeScript
- React to simplify the demo page development
- Git initialization
- README
- MIT license
Scripts
Once you have created the structure of your new app, these are the prompt commands you can run:
yarn start:demo
: to preview and watch for demo page changes (http://localhost:1234)yarn build
: to build your webapp for production in/dist
Issues & contributing
This project is still in progress. Anyway, if you open an issue (or a PR), I will be happy :)
Todo
- Jest because testing matters
- React
- to lib
- to demo page