Repository: diogomoretti/javali
Branch: master
Commit: bc7591e055d4
Files: 44
Total size: 40.5 KB
Directory structure:
gitextract_o2bcdwhj/
├── .editorconfig
├── .gitignore
├── .npmrc
├── .travis.yml
├── cli/
│ ├── index.js
│ └── scripts/
│ ├── create.js
│ ├── log.js
│ ├── manager.js
│ └── template.js
├── docs/
│ ├── CNAME
│ ├── assets/
│ │ ├── css/
│ │ │ └── main.css
│ │ └── favicons/
│ │ ├── browserconfig.xml
│ │ └── site.webmanifest
│ └── index.html
├── license.md
├── package.json
├── readme.md
├── templates/
│ ├── js/
│ │ ├── _babelrc
│ │ ├── _editorconfig
│ │ ├── _gitignore
│ │ ├── _npmrc
│ │ ├── _package
│ │ ├── example/
│ │ │ └── index.html
│ │ ├── license.md
│ │ ├── readme.md
│ │ ├── rollup.config.js
│ │ └── src/
│ │ ├── main.js
│ │ ├── my-library.js
│ │ └── my-library.test.js
│ └── ts/
│ ├── _babelrc
│ ├── _editorconfig
│ ├── _gitignore
│ ├── _npmrc
│ ├── _package
│ ├── example/
│ │ └── index.html
│ ├── license.md
│ ├── readme.md
│ ├── rollup.config.js
│ ├── src/
│ │ ├── main.ts
│ │ ├── my-library.test.ts
│ │ └── my-library.ts
│ ├── tsconfig.app.json
│ └── tsconfig.json
└── tests/
└── index.test.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
================================================
FILE: .gitignore
================================================
# See https://help.github.com/ignore-files/ for more about ignoring files.
# dependencies
node_modules
# builds
build
dist
.rpt2_cache
# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json
================================================
FILE: .npmrc
================================================
package-lock=false
================================================
FILE: .travis.yml
================================================
language: node_js
node_js:
- 'stable'
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
install:
- 'yarn install --immutable'
script:
- 'yarn lint'
- 'yarn test'
================================================
FILE: cli/index.js
================================================
#!/usr/bin/env node
const program = require('commander')
const create = require('./scripts/create')
const log = require('./scripts/log')
const { version } = require('../package.json')
let appName
program
.version(version)
.arguments('<appName>')
.option('-v, --version', 'version')
.option('-t, --typescript', 'use typescript')
.action((_appName) => {
appName = _appName
})
.parse(process.argv)
if (appName) {
create(appName, program.typescript)
} else {
log('Please, choose a name for your project ;)')
}
================================================
FILE: cli/scripts/create.js
================================================
const fs = require('fs')
const path = require('path').join
const fullPath = require('path')
const wrench = require('wrench')
const runPath = process.cwd()
const template = require('./template')
const log = require('./log')
const isFolderExistsSync = dir => {
try {
fs.accessSync(dir)
return true
} catch (e) {
return false
}
}
async function create (app, ts) {
const fullPathFolder = path(runPath, app)
const fullPathTemplate = path(
fullPath.resolve(__dirname),
`../../templates/${ts ? 'ts' : 'js'}`
)
if (isFolderExistsSync(fullPathFolder)) {
log(`Folder "${app}" already exists`, 'error')
} else {
const filesToRename = ['_babelrc', '_editorconfig', '_gitignore', '_npmrc', '_package']
const filesFinal = ['.babelrc', '.editorconfig', '.gitignore', '.npmrc', 'package.json']
await wrench.copyDirSyncRecursive(fullPathTemplate, fullPathFolder, {
excludeHiddenUnix: false
})
filesToRename.map((item, index) => {
fs.renameSync(
fullPath.resolve(fullPathFolder, item),
fullPath.resolve(fullPathFolder, filesFinal[index])
)
})
log(`Project folder "${app}" was created =]`, 'success')
template(app)
}
}
module.exports = create
================================================
FILE: cli/scripts/log.js
================================================
const chalk = require('chalk')
const log = (msg, type) => {
const prefix = chalk.hex('#fef30a').bold('🐗 Javali ')
let typeMessage = chalk.hex('#f5f5f5').bold(`➜ ${msg}`)
if (type === 'success') {
typeMessage = chalk.green.bold(`✔︎ ${msg}`)
} else if (type === 'error') {
typeMessage = chalk.red.bold(`✖ ${msg}`)
}
return console.log(`${prefix}${typeMessage}`)
}
module.exports = log
================================================
FILE: cli/scripts/manager.js
================================================
const shell = require('shelljs')
const checkManager = () => shell.which('yarn') ? 'yarn' : 'npm'
module.exports = checkManager
================================================
FILE: cli/scripts/template.js
================================================
const _ = require('lodash')
const recursive = require('recursive-readdir')
const fs = require('fs')
const log = require('./log')
const manager = require('./manager')
const path = require('path').join
const runPath = process.cwd()
_.templateSettings = {
evaluate: /{{([\s\S]+?)}}/g,
interpolate: /{{=([\s\S]+?)}}/g,
escape: /{{-([\s\S]+?)}}/g
}
async function run (app) {
await recursive(path(runPath, app), ['.DS_Store'], (err, files) => {
if (!err) {
const managerType = manager()
const cmdRun = (managerType === 'yarn') ? 'yarn' : 'npm run'
const cmdInstall = (managerType === 'yarn') ? 'yarn' : 'npm install'
files.forEach(file => {
const fileContent = fs.readFileSync(file, 'utf8')
const compiled = _.template(fileContent)
const metadata = {
appName: _.kebabCase(app),
appManager: managerType,
appCmd: cmdRun
}
try {
fs.writeFileSync(file, compiled(metadata))
} catch (err) {
log(err, 'error')
}
})
log(`To get started, run: "cd ${app} && ${cmdInstall} && ${cmdRun} start"`)
}
})
}
module.exports = run
================================================
FILE: docs/CNAME
================================================
javali.js.org
================================================
FILE: docs/assets/css/main.css
================================================
:root {
--main-color: #fef30a;
--text-color: #232020;
--font-title: 'Archivo', sans-serif;
--font-code: 'PT Mono', monospace;
}
::selection {
background: var(--main-color);
color: var(--text-color);
}
::-moz-selection {
background: var(--main-color);
color: var(--text-color);
}
* {
box-sizing: inherit;
}
html {
font-size: 10px;
box-sizing: border-box;
scroll-behavior: smooth;
height: 100%;
}
body {
margin: 0;
padding: 0;
font-size: 1rem;
background: #fff;
height: 100%;
color: var(--text-color);
cursor: default;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
.fork-button {
display: block;
position: absolute;
width: 30em;
padding: .5em 0;
text-align: center;
text-transform: uppercase;
text-decoration: none;
font-size: 1.2em;
font-weight: bold;
color: var(--text-color);
background: var(--main-color);
transform: rotate(45deg);
top: 5em;
right: -9em;
z-index: 10;
}
/* Header */
.header {
position: relative;
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
overflow: hidden;
border-top: 5px solid var(--main-color);
padding: 1em 2em 0;
}
.header-top {
display: flex;
max-width: 1040px;
margin: 0 auto;
width: 100%;
}
.header-column {
flex: 1;
}
.header-column--menu {
display: flex;
justify-content: flex-end;
align-items: center;
}
.header-logo img {
max-width: 200px;
}
/* Menu */
.header-menu-list {
list-style: none;
margin: 0;
padding: 1.2em 0 0 0;
display: flex;
}
.header-menu-list li:not(:first-child) {
margin-left: 5em;
}
.header-menu-list a {
position: relative;
font-family: var(--font-title);
font-size: 1.4rem;
font-weight: 600;
text-transform: uppercase;
text-decoration: none;
color: var(--text-color);
padding: .6em 0;
border-radius: 3px;
transition: background .5s ease;
}
.header-menu-list a:after {
content: "";
bottom: 0;
display: block;
height: 2px;
left: 50%;
position: absolute;
background: var(--main-color);
transition: width .3s ease 0s, left .3s ease 0s;
width: 0;
}
.header-menu-list a:hover:after {
width: 100%;
left: 0;
}
.header-main {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.header-main-content {
max-width: 800px;
margin: -6em auto 0;
text-align: center;
}
.header-main-title {
font-family: var(--font-title);
font-size: 4.3rem;
color: #222;
line-height: 1.3;
}
code {
font-family: var(--font-code);
font-size: 1.8rem;
display: inline-block;
border: 2px solid var(--main-color);
padding: 1em 2em;
}
#scroll-indicator {
position: absolute;
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
height: 50px;
width: 30px;
bottom: 40px;
border: 2px solid var(--text-color);
border-radius: 20px;
opacity: .2;
transition: opacity 1s ease;
}
#scroll-indicator:before {
content: '';
position: absolute;
top: 10px;
left: 50%;
width: 6px;
height: 6px;
margin-left: -3px;
background-color: var(--text-color);
border-radius: 100%;
animation: scroll-down 2s infinite;
}
#scroll-indicator.hide {
opacity: 0;
}
/* Section: Features */
.section-features-content {
margin: 0 auto;
max-width: 1040px;
padding: 0 2em 10em;
}
.section-features-content-item {
display: flex;
padding: 5em 0 10em;
}
.section-features-column__image {
position: relative;
text-align: right;
}
.section-features-column__image:before {
content: '';
display: block;
width: 50%;
height: 100px;
position: absolute;
left: 5em;
top: 50%;
margin-top: -50px;
background: var(--main-color);
z-index: -1;
}
.section-features-content-item:last-child .section-features-column__image:before {
width: 60%;
left: 0;
}
.section-features-content-item:last-child .section-features-column__text {
text-align: right;
}
.section-features-content-item:last-child .section-feature-description {
padding-right: 0;
padding-left: 5em;
}
.section-features-column__image img {
max-width: 85%;
mix-blend-mode: darken;
}
.section-features-column__text {
flex: 1;
}
.section-feature-title {
font-size: 3rem;
color: var(--text-color);
margin: 0;
padding: 1em 0 .8em;
font-family: var(--font-title);
}
.section-feature-description {
margin: 0;
padding: 0;
font-size: 1.6rem;
color: #333;
line-height: 2;
padding-right: 5em;
}
.section-feature-description a {
position: relative;
display: inline-block;
white-space: nowrap;
text-decoration: none;
color: inherit;
padding: 0 2px;
font-weight: bold;
}
.section-feature-description a:before {
content: '';
position: absolute;
left: 0;
right: 0;
width: 100%;
height: 3px;
bottom: 3px;
background: var(--main-color);
z-index: -1;
transition: height .3s cubic-bezier(0.67, 0.04, 0, 1.21);
}
.section-feature-description a:hover:before {
height: 78%;
}
/* Section: Get Started */
.section-started {
background: var(--main-color);
overflow: hidden;
}
.get-started-image {
position: absolute;
right: 0;
top: 10em;
max-width: 420px;
mix-blend-mode: darken;
transform: rotate(-15deg);
}
.section-started-content {
position: relative;
max-width: 1040px;
margin: 0 auto;
padding: 8em 2em 2em 2em;
}
.section-started-title {
font-family: var(--font-title);
font-size: 4.3rem;
margin: 0;
padding: 0 0 1.3em 0;
}
.section-started-subtitle {
font-family: var(--font-title);
font-size: 2.4rem;
margin: 0;
padding: 0 0 1em 0;
}
.started-steps {
list-style: none;
margin: 0;
padding: 1em 0 5em 0;
}
.started-steps li {
font-size: 1.8rem;
margin-bottom: 1.4em;
line-height: 1.6;
}
.started-steps li p {
margin: 0 0 1.2em 0;
padding: 0;
}
.started-steps li span {
padding: 0 1em;
}
.started-steps li code {
background: #fff;
font-size: 1.6rem;
padding: 1em 1.2em;
margin-bottom: .5em;
}
/* Footer */
.footer {
background: var(--text-color);
padding: 4em 0;
}
.footer-content {
position: relative;
max-width: 1040px;
margin: 0 auto;
padding: 0 2em;
}
.footer-content p {
color: #eee;
margin: 0;
padding: 0;
font-size: 1.4rem;
}
.footer-content p a {
color: inherit;
text-decoration: none;
padding-bottom: 2px;
border-bottom: 2px solid #333;
transition: border .5s ease;
}
.footer-content p a:hover {
color: #fff;
border-bottom-color: var(--main-color);
}
.footer-content p img {
max-width: 18px;
display: inline-block;
vertical-align: middle;
margin: -3px .3em 0;
}
.footer-image {
position: absolute;
max-width: 80px;
top: -.8em;
right: 2em;
}
/* Breakpoints */
@media (max-width: 1200px) {
.header-menu {
padding-right: 10em;
}
}
@media (max-width: 800px) {
.fork-button {
display: none;
}
.header-menu {
padding-right: 0;
}
.section-features-content {
padding-bottom: 0;
}
.section-features-content-item {
flex-direction: column;
}
.section-features-content-item:first-child {
flex-direction: column-reverse;
}
.section-features-column__image {
text-align: left;
}
.section-features-column__image img {
max-width: 100%;
}
.section-features-column__image:before {
left: 0;
}
.section-feature-description {
padding-right: 1em;
}
.section-features-content-item:last-child .section-features-column__text {
text-align: left;
}
.section-features-content-item:last-child .section-feature-description {
padding-left: 0;
padding-right: 1em;
}
}
@media (max-width: 580px) {
.header-menu,
.get-started-image,
#scroll-indicator {
display: none;
}
.fork-button {
display: block;
top: 4em;
right: -10em;
font-size: 1em;
font-weight: bold;
padding: .7em 0;
}
.header {
height: 550px;
}
.header-logo {
margin-left: -5px;
}
.header-main-content {
text-align: left;
}
.header-main-title {
font-size: 3.5rem;
}
.section-started-content {
padding-top: 6em;
}
}
/* Animations */
@keyframes scroll-down {
0% {
transform: translate(0, 0);
opacity: 0;
}
40% {
opacity: 1;
}
80% {
transform: translate(0, 20px);
opacity: 0;
}
100% {
opacity: 0;
}
}
================================================
FILE: docs/assets/favicons/browserconfig.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="assets/favicons/mstile-150x150.png"/>
<TileColor>#ffc40d</TileColor>
</tile>
</msapplication>
</browserconfig>
================================================
FILE: docs/assets/favicons/site.webmanifest
================================================
{
"name": "",
"short_name": "",
"icons": [
{
"src": "android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "android-chrome-256x256.png",
"sizes": "256x256",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
================================================
FILE: docs/index.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Javali • Create a modern JavaScript library that uses ES6 + Jest</title>
<link rel="apple-touch-icon" sizes="180x180" href="assets/favicons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicons/favicon-16x16.png">
<link rel="manifest" href="assets/favicons/site.webmanifest">
<link rel="mask-icon" href="assets/favicons/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="assets/favicons/favicon.ico">
<meta name="msapplication-TileColor" content="#ffc40d">
<meta name="msapplication-config" content="assets/favicons/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<meta property="og:title" content="Javali">
<meta property="og:description" content="Create a modern JavaScript library that uses ES6 + Jest">
<meta property="og:image" content="https://javali.js.org/assets/img/social.jpg">
<meta property="og:url" content="https://javali.js.org">
<meta name="twitter:title" content="Javali">
<meta name="twitter:description" content="Create a modern JavaScript library that uses ES6 + Jest">
<meta name="twitter:image" content="https://javali.js.org/assets/img/social.jpg">
<meta name="twitter:card" content="summary_large_image">
<link href="//fonts.googleapis.com/css?family=Archivo:400,600,700" rel="stylesheet">
<link href="//fonts.googleapis.com/css?family=PT+Mono" rel="stylesheet">
<link href="./assets/css/main.css" rel="stylesheet">
</head>
<body>
<header class="header">
<a href="https://github.com/diogomoretti/javali" class="fork-button">View on github</a>
<div class="header-top">
<div class="header-column">
<h1 class="header-logo">
<img src="assets/img/logo.png" alt="Javali logo" />
</h1>
</div>
<div class="header-column header-column--menu">
<nav class="header-menu">
<ul class="header-menu-list">
<li>
<a href="#features">Features</a>
</li>
<li>
<a href="#get-started">Get started</a>
</li>
</ul>
</nav>
</div>
</div>
<div class="header-main">
<div class="header-main-content">
<h2 class="header-main-title">
Create a modern JavaScript library that uses ES6 + Jest
</h2>
<code>
npx javali my-lib
</code>
</div>
</div>
<span id="scroll-indicator"></span>
</header>
<section id="features" class="section-features">
<div class="section-features-content">
<div class="section-features-content-item">
<div class="section-features-column__text">
<h3 class="section-feature-title">
Simple, fast and efficient
</h3>
<p class="section-feature-description">
Javali is a CLI similar to <a href="#">Create React App</a>. With a simple command you can easily generate your <strong>JavaScript library</strong>. Without questions and complicated settings, you simply pass the name of your project and the magic happens.
</p>
</div>
<div class="section-features-column__image">
<img src="assets/img/feat-01.jpg" />
</div>
</div>
<div class="section-features-content-item">
<div class="section-features-column__image">
<img src="assets/img/feat-02.jpg" />
</div>
<div class="section-features-column__text">
<h3 class="section-feature-title">
Modern: ES6 and Jest
</h3>
<p class="section-feature-description">
The generated library has all the newest features from the front-end development. You write ES6 and your library is compiled to ES5 (UMD and CJS). Besides that, the lib has <a href="https://jestjs.io">Jest</a> for tests, <a href="https://rollupjs.org">Rollup</a> as bundler, <a href="https://github.com/tapio/live-server">Live Server</a> to run locally and much more.
</p>
</div>
</div>
</div>
</section>
<section id="get-started" class="section-started">
<div class="section-started-content">
<img class="get-started-image" src="assets/img/get-started.jpg" />
<h1 class="section-started-title">Get started</h1>
<h2 class="section-started-subtitle">Using npx</h2>
<ul class="started-steps">
<li>
<p><strong>1.</strong> Install and create your library immediately:</p>
<code>
npx javali my-lib
</code>
</li>
<li><strong>2.</strong> Enjoy</li>
</ul>
<h2 class="section-started-subtitle">Using global cli</h2>
<ul class="started-steps">
<li>
<p><strong>1.</strong> Install Javali globally:</p>
<code>
yarn global add javali
</code>
<span>or</span>
<code>
npm install -g javali
</code>
</li>
<li>
<p><strong>2.</strong> Create your library:</p>
<code>
javali my-lib
</code>
</li>
<li><strong>3.</strong> Enjoy</li>
</ul>
</div>
</section>
<footer class="footer">
<div class="footer-content">
<p>
Made with <img src="assets/img/heart.svg" /> by <a href="http://github.com/diogomoretti">Diogo Moretti</a>
</p>
<img class="footer-image" src="assets/img/footer.png" />
</div>
</footer>
<script>
const scrollIndicator = document.getElementById('scroll-indicator')
document.addEventListener('scroll', () => {
if (window.scrollY > 20) {
scrollIndicator.classList.add('hide')
}
})
</script>
</body>
</html>
================================================
FILE: license.md
================================================
# The MIT License (MIT)
Copyright (c) 2019 – Diogo Moretti
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: package.json
================================================
{
"name": "javali",
"version": "1.1.0",
"description": "Create a modern JavaScript library that uses ES6 + Jest",
"main": "./cli/index.js",
"bin": {
"javali": "./cli/index.js"
},
"scripts": {
"site:server": "live-server ./docs --port=7001 -q --no-browser",
"lint": "standard",
"test": "jest"
},
"jest": {
"testPathIgnorePatterns": [
"<rootDir>/templates/"
]
},
"keywords": [
"cli",
"generator",
"javascript",
"library",
"es6",
"jest"
],
"repository": {
"type": "git",
"url": "https://github.com/diogomoretti/javali"
},
"standard": {
"ignore": [
"/templates/",
"/docs/",
"/tests/"
]
},
"author": "Diogo Moretti <diogo.pearljam@gmail.com>",
"license": "MIT",
"devDependencies": {
"jest": "^24.7.1",
"live-server": "^1.2.1",
"rimraf": "^2.6.3",
"standard": "^12.0.1"
},
"dependencies": {
"chalk": "^2.4.2",
"commander": "^2.19.0",
"lodash": "^4.17.11",
"recursive-readdir": "^2.2.2",
"shelljs": "^0.8.3",
"wrench": "^1.5.9"
}
}
================================================
FILE: readme.md
================================================
<p align="center">
<img src="https://user-images.githubusercontent.com/2853428/54870888-3b2b5800-4d8b-11e9-8e3d-f56fd7692117.png" alt="Javali" width="430">
<p align="center">
<a href="https://www.npmjs.com/package/javali"><img alt="NPM" src="https://img.shields.io/npm/v/javali.svg?style=flat-square"></a> <a href="https://standardjs.com"><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square" alt="JavaScript Style Guide" /></a>
</p>
<h3 align="center"><strong>⁓ <a href="https://javali.js.org">javali.js.org</a> ⁓</strong></h3>
</p>
<br>
## 🐗 About
**[Javali](https://javali.js.org/)** (aka **JAVA***Script* **LI***brary*) is a CLI like [Create React App](https://github.com/facebook/create-react-app), but for creating JavaScript libraries. Below, some features:
- **Simple command** to create a library
- **Fully ES6** that compiles to UMD and CommonJS
- **Supports Typescript**
- **[Jest](https://jestjs.io/)** for tests
- **[Rollup](https://rollupjs.org)** as bundler
- **[Live Server](https://github.com/tapio/live-server)** to run locally
<br>
## 🐗 Get started
### Using `npx`
**1** ⁓ Install and create your library immediately:
```shell
npx javali my-lib
```
**2** ⁓ Enjoy!
### Using global cli
**1** ⁓ Install **[Javali](https://javali.js.org/)** globally:
```shell
yarn global add javali
or
npm install -g javali
```
**2** ⁓ Create your library:
```shell
javali my-lib
```
Or using TypeScript:
```shell
javali my-lib --typescript
```
**3** ⁓ Enjoy!
✅ A folder and library called `my-lib` will be created in this case.
<br>
## 🐗 Contributing
1. Fork this repository
2. `git checkout -b my-feature`
3. `git add --all`
4. `git commit -m "My commit message about my-feature"`
5. `git push origin my-feature`
6. Open a Pull Request =]
<br>
## 🐗 License
[MIT](./license.md) © [Diogo Moretti](https://github.com/diogomoretti)
================================================
FILE: templates/js/_babelrc
================================================
{
"presets": [
["@babel/preset-env", {
"modules": false,
"targets": {
"browsers": "ie >= 11"
}
}]
],
"env": {
"test": {
"presets": [["@babel/preset-env"]]
}
}
}
================================================
FILE: templates/js/_editorconfig
================================================
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
================================================
FILE: templates/js/_gitignore
================================================
node_modules/
dist/
npm-debug.log
yarn-error.log
package-lock.json
================================================
FILE: templates/js/_npmrc
================================================
package-lock=false
================================================
FILE: templates/js/_package
================================================
{
"name": "{{= appName }}",
"version": "0.1.0",
"main": "dist/{{= appName }}.cjs.js",
"module": "dist/{{= appName }}.esm.js",
"browser": "dist/{{= appName }}.umd.js",
"license": "MIT",
"repository": {
"type": "git",
"url": ""
},
"devDependencies": {
"@babel/core": "7.4.0",
"@babel/preset-env": "7.4.2",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "24.5.0",
"jest": "24.5.0",
"live-server": "^1.2.1",
"rollup": "1.7.0",
"rollup-plugin-babel": "4.3.2",
"rollup-plugin-commonjs": "9.2.1",
"rollup-plugin-node-resolve": "4.0.1",
"concurrently": "^4.1.0"
},
"scripts": {
"prepare": "{{= appCmd }} build",
"build": "rollup -c",
"watch": "rollup -c -w",
"server": "live-server --port=7000 -q --open=./example",
"start": "concurrently \"{{= appManager }}:watch\" \"{{= appManager }}:server\"",
"test": "jest"
},
"files": [
"dist"
]
}
================================================
FILE: templates/js/example/index.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>{{= appName }}</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-size: 20px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
.demo {
text-align: center;
max-width: 1000px;
margin: 0 auto;
}
.logo {
max-width: 400px;
padding-bottom: 3em;
}
button {
font-size: 20px;
margin-top: 1em;
}
</style>
</head>
<body>
<div class="demo">
<img class="logo" src="https://user-images.githubusercontent.com/2853428/54870888-3b2b5800-4d8b-11e9-8e3d-f56fd7692117.png" />
<div id="root"></div>
</div>
<script src="../dist/{{= appName }}.umd.js"></script>
</body>
</html>
================================================
FILE: templates/js/license.md
================================================
The MIT License (MIT)
Copyright (c) 2019
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: templates/js/readme.md
================================================
# 🐗 {{= appName }}
> My awesome lib created by [Javali](https://javali.js.org)
================================================
FILE: templates/js/rollup.config.js
================================================
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import pkg from './package.json'
import babel from 'rollup-plugin-babel'
export default [
{
input: 'src/main.js',
output: {
name: 'index',
file: pkg.browser,
format: 'umd'
},
plugins: [
resolve(),
commonjs(),
babel({
exclude: 'node_modules/**'
})
]
},
{
input: 'src/main.js',
external: [],
output: [
{ file: pkg.main, format: 'cjs' },
{ file: pkg.module, format: 'es' }
]
}
]
================================================
FILE: templates/js/src/main.js
================================================
import myLibrary from './my-library'
const myLib = new myLibrary('#root')
================================================
FILE: templates/js/src/my-library.js
================================================
class myLibrary {
constructor (trigger) {
this.trigger = trigger
this.renderDiv()
this.listenClick()
}
renderDiv () {
const div = document.querySelector(this.trigger)
div.innerHTML = `<div id="counter">0</div><button id="btn">Counter</button>`
}
updateCounter () {
const div = document.getElementById('counter')
div.innerHTML = parseInt(div.innerHTML) + 1
}
listenClick () {
const btn = document.getElementById('btn')
btn.addEventListener('click', this.updateCounter)
}
}
export default myLibrary
================================================
FILE: templates/js/src/my-library.test.js
================================================
import myLibrary from './my-library'
document.body.innerHTML = '<div id="root"></div>'
describe('myLibrary', () => {
it('render library wrapper inside trigger div', () => {
const myLib = new myLibrary('#root')
expect(document.body.innerHTML).toBe('<div id="root"><div id="counter">0</div><button id="btn">Counter</button></div>')
})
it('start counter with 0', () => {
const myLib = new myLibrary('#root')
const counter = document.getElementById('counter').innerHTML
expect(parseInt(counter)).toBe(0)
})
it('when click on button, counter is 1', () => {
const myLib = new myLibrary('#root')
myLib.updateCounter()
const counter = document.getElementById('counter').innerHTML
expect(parseInt(counter)).toBe(1)
})
})
================================================
FILE: templates/ts/_babelrc
================================================
{
"presets": [
["@babel/preset-env", {
"modules": false,
"targets": {
"browsers": "ie >= 11"
}
}],
"@babel/preset-typescript"
],
"env": {
"test": {
"presets": [["@babel/preset-env"]]
}
}
}
================================================
FILE: templates/ts/_editorconfig
================================================
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
================================================
FILE: templates/ts/_gitignore
================================================
node_modules/
dist/
npm-debug.log
yarn-error.log
package-lock.json
================================================
FILE: templates/ts/_npmrc
================================================
package-lock=false
================================================
FILE: templates/ts/_package
================================================
{
"name": "{{= appName }}",
"version": "0.1.0",
"main": "dist/{{= appName }}.cjs.js",
"types": "dist/{{= appName }}.d.ts",
"module": "dist/{{= appName }}.esm.js",
"browser": "dist/{{= appName }}.umd.js",
"license": "MIT",
"repository": {
"type": "git",
"url": ""
},
"devDependencies": {
"@babel/core": "7.4.0",
"@babel/preset-env": "7.4.2",
"@babel/preset-typescript": "7.3.3",
"@types/jest": "24.0.11",
"babel-core": "7.0.0-bridge.0",
"babel-jest": "24.5.0",
"jest": "24.5.0",
"live-server": "^1.2.1",
"rollup": "1.7.0",
"rollup-plugin-babel": "4.3.2",
"rollup-plugin-commonjs": "9.2.1",
"rollup-plugin-node-resolve": "4.0.1",
"concurrently": "^4.1.0"
},
"scripts": {
"prepare": "{{= appCmd }} build",
"build": "rollup -c && yarn build:types",
"watch": "rollup -c -w",
"server": "live-server --port=7000 -q --open=./example",
"start": "concurrently \"{{= appManager }}:watch\" \"{{= appManager }}:server\"",
"test": "jest",
"build:types": "tsc -p tsconfig.app.json --emitDeclarationOnly"
},
"files": [
"dist"
],
"dependencies": {
"typescript": "^3.3.4000"
}
}
================================================
FILE: templates/ts/example/index.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>{{= appName }}</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-size: 20px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
.demo {
text-align: center;
max-width: 1000px;
margin: 0 auto;
}
.logo {
max-width: 400px;
padding-bottom: 3em;
}
button {
font-size: 20px;
margin-top: 1em;
}
</style>
</head>
<body>
<div class="demo">
<img class="logo" src="https://user-images.githubusercontent.com/2853428/54870888-3b2b5800-4d8b-11e9-8e3d-f56fd7692117.png" />
<div id="root"></div>
</div>
<script src="../dist/{{= appName }}.umd.js"></script>
</body>
</html>
================================================
FILE: templates/ts/license.md
================================================
The MIT License (MIT)
Copyright (c) 2019
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: templates/ts/readme.md
================================================
# 🐗 {{= appName }}
> My awesome lib created by [Javali](https://javali.js.org)
================================================
FILE: templates/ts/rollup.config.js
================================================
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import pkg from './package.json'
import babel from 'rollup-plugin-babel'
const plugins = [
resolve({
extensions: ['.js', '.ts']
}),
commonjs(),
babel({
exclude: 'node_modules/**',
extensions: ['.js', '.ts']
})
]
export default [
{
input: 'src/main.ts',
output: {
name: 'index',
file: pkg.browser,
format: 'umd'
},
plugins
},
{
input: 'src/main.ts',
external: [],
output: [
{ file: pkg.main, format: 'cjs' },
{ file: pkg.module, format: 'es' }
],
plugins
}
]
================================================
FILE: templates/ts/src/main.ts
================================================
import myLibrary from './my-library'
const myLib = new myLibrary('#root')
================================================
FILE: templates/ts/src/my-library.test.ts
================================================
import myLibrary from './my-library'
document.body.innerHTML = '<div id="root"></div>'
describe('myLibrary', () => {
it('render library wrapper inside trigger div', () => {
const myLib = new myLibrary('#root')
expect(document.body.innerHTML).toBe('<div id="root"><div id="counter">0</div><button id="btn">Counter</button></div>')
})
it('start counter with 0', () => {
const myLib = new myLibrary('#root')
const counter = document.getElementById('counter').innerHTML
expect(parseInt(counter)).toBe(0)
})
it('when click on button, counter is 1', () => {
const myLib = new myLibrary('#root')
myLib.updateCounter()
const counter = document.getElementById('counter').innerHTML
expect(parseInt(counter)).toBe(1)
})
})
================================================
FILE: templates/ts/src/my-library.ts
================================================
class myLibrary {
trigger: string;
constructor (trigger: string) {
this.trigger = trigger
this.renderDiv()
this.listenClick()
}
renderDiv () {
const div = document.querySelector(this.trigger)
div!.innerHTML = `<div id="counter">0</div><button id="btn">Counter</button>`
}
updateCounter () {
const div = document.getElementById('counter')
div!.innerHTML = `${parseInt(div!.innerHTML) + 1}`
}
listenClick () {
const btn = document.getElementById('btn')
btn!.addEventListener('click', this.updateCounter)
}
}
export default myLibrary
================================================
FILE: templates/ts/tsconfig.app.json
================================================
{
"extends": "./tsconfig.json",
"exclude": ["**/*.test.ts"]
}
================================================
FILE: templates/ts/tsconfig.json
================================================
{
"include": ["src"],
"compilerOptions": {
/* Basic Options */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
"declaration": true, /* Generates corresponding '.d.ts' file. */
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./dist", /* Redirect output structure to the directory. */
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
// "composite": true, /* Enable project compilation */
// "removeComments": true, /* Do not emit comments to output. */
// "noEmit": true, /* Do not emit outputs. */
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
/* Additional Checks */
// "noUnusedLocals": true, /* Report errors on unused locals. */
// "noUnusedParameters": true, /* Report errors on unused parameters. */
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
/* Source Map Options */
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
/* Experimental Options */
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
}
}
================================================
FILE: tests/index.test.js
================================================
const fs = require('fs')
const path = require('path')
const rimraf = require('rimraf')
const exec = require('child_process').exec
const TEMP_FOLDER = '__temp__'
beforeAll(() => {
if (!fs.existsSync(TEMP_FOLDER)) {
fs.mkdirSync(TEMP_FOLDER)
}
})
test('Run Javali cli without errors', async () => {
const result = await cli('my-library', TEMP_FOLDER)
expect(result.code).toBe(0)
})
test('Create a library called "my-library"', async () => {
await cli('my-library', TEMP_FOLDER)
const folderExists = fs.existsSync(`${TEMP_FOLDER}/my-library`)
expect(folderExists).toBe(true)
})
test('Create a library called "my-library-with-typescript" with Typescript', async () => {
await cli('my-library-with-typescript --typescript', TEMP_FOLDER)
const fileExists = fs.existsSync(`${TEMP_FOLDER}/my-library-with-typescript/tsconfig.json`)
expect(fileExists).toBe(true)
})
afterAll(() => {
rimraf.sync(TEMP_FOLDER)
})
function cli (args, cwd) {
return new Promise(resolve => {
exec(`node ${path.resolve('./cli/index')} ${args}`,
{ cwd },
(error, stdout, stderr) => {
resolve({
code: error && error.code ? error.code : 0,
error,
stdout,
stderr
})
})
})
}
gitextract_o2bcdwhj/
├── .editorconfig
├── .gitignore
├── .npmrc
├── .travis.yml
├── cli/
│ ├── index.js
│ └── scripts/
│ ├── create.js
│ ├── log.js
│ ├── manager.js
│ └── template.js
├── docs/
│ ├── CNAME
│ ├── assets/
│ │ ├── css/
│ │ │ └── main.css
│ │ └── favicons/
│ │ ├── browserconfig.xml
│ │ └── site.webmanifest
│ └── index.html
├── license.md
├── package.json
├── readme.md
├── templates/
│ ├── js/
│ │ ├── _babelrc
│ │ ├── _editorconfig
│ │ ├── _gitignore
│ │ ├── _npmrc
│ │ ├── _package
│ │ ├── example/
│ │ │ └── index.html
│ │ ├── license.md
│ │ ├── readme.md
│ │ ├── rollup.config.js
│ │ └── src/
│ │ ├── main.js
│ │ ├── my-library.js
│ │ └── my-library.test.js
│ └── ts/
│ ├── _babelrc
│ ├── _editorconfig
│ ├── _gitignore
│ ├── _npmrc
│ ├── _package
│ ├── example/
│ │ └── index.html
│ ├── license.md
│ ├── readme.md
│ ├── rollup.config.js
│ ├── src/
│ │ ├── main.ts
│ │ ├── my-library.test.ts
│ │ └── my-library.ts
│ ├── tsconfig.app.json
│ └── tsconfig.json
└── tests/
└── index.test.js
SYMBOL INDEX (14 symbols across 5 files)
FILE: cli/scripts/create.js
function create (line 18) | async function create (app, ts) {
FILE: cli/scripts/template.js
function run (line 15) | async function run (app) {
FILE: templates/js/src/my-library.js
class myLibrary (line 1) | class myLibrary {
method constructor (line 2) | constructor (trigger) {
method renderDiv (line 8) | renderDiv () {
method updateCounter (line 13) | updateCounter () {
method listenClick (line 18) | listenClick () {
FILE: templates/ts/src/my-library.ts
class myLibrary (line 1) | class myLibrary {
method constructor (line 4) | constructor (trigger: string) {
method renderDiv (line 10) | renderDiv () {
method updateCounter (line 15) | updateCounter () {
method listenClick (line 20) | listenClick () {
FILE: tests/index.test.js
constant TEMP_FOLDER (line 6) | const TEMP_FOLDER = '__temp__'
function cli (line 35) | function cli (args, cwd) {
Condensed preview — 44 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (46K chars).
[
{
"path": ".editorconfig",
"chars": 147,
"preview": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\nend_of_line = lf\ninsert_final_newline = true\ntrim_"
},
{
"path": ".gitignore",
"chars": 300,
"preview": "\n# See https://help.github.com/ignore-files/ for more about ignoring files.\n\n# dependencies\nnode_modules\n\n# builds\nbuild"
},
{
"path": ".npmrc",
"chars": 19,
"preview": "package-lock=false\n"
},
{
"path": ".travis.yml",
"chars": 190,
"preview": "language: node_js\nnode_js:\n - 'stable'\nbefore_install:\n - curl -o- -L https://yarnpkg.com/install.sh | bash\ninstall:\n "
},
{
"path": "cli/index.js",
"chars": 532,
"preview": "#!/usr/bin/env node\n\nconst program = require('commander')\nconst create = require('./scripts/create')\nconst log = require"
},
{
"path": "cli/scripts/create.js",
"chars": 1239,
"preview": "const fs = require('fs')\nconst path = require('path').join\nconst fullPath = require('path')\nconst wrench = require('wren"
},
{
"path": "cli/scripts/log.js",
"chars": 408,
"preview": "const chalk = require('chalk')\n\nconst log = (msg, type) => {\n const prefix = chalk.hex('#fef30a').bold('🐗 Javali ')\n "
},
{
"path": "cli/scripts/manager.js",
"chars": 127,
"preview": "const shell = require('shelljs')\nconst checkManager = () => shell.which('yarn') ? 'yarn' : 'npm'\nmodule.exports = checkM"
},
{
"path": "cli/scripts/template.js",
"chars": 1172,
"preview": "const _ = require('lodash')\nconst recursive = require('recursive-readdir')\nconst fs = require('fs')\nconst log = require("
},
{
"path": "docs/CNAME",
"chars": 14,
"preview": "javali.js.org\n"
},
{
"path": "docs/assets/css/main.css",
"chars": 8328,
"preview": ":root {\n --main-color: #fef30a;\n --text-color: #232020;\n --font-title: 'Archivo', sans-serif;\n --font-code: 'PT Mono"
},
{
"path": "docs/assets/favicons/browserconfig.xml",
"chars": 261,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<browserconfig>\n <msapplication>\n <tile>\n <square150x150logo"
},
{
"path": "docs/assets/favicons/site.webmanifest",
"chars": 424,
"preview": "{\n \"name\": \"\",\n \"short_name\": \"\",\n \"icons\": [\n {\n \"src\": \"android-chrome-192x192.png\",\n "
},
{
"path": "docs/index.html",
"chars": 5999,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, in"
},
{
"path": "license.md",
"chars": 1084,
"preview": "# The MIT License (MIT)\n\nCopyright (c) 2019 – Diogo Moretti\n\nPermission is hereby granted, free of charge, to any person"
},
{
"path": "package.json",
"chars": 1097,
"preview": "{\n \"name\": \"javali\",\n \"version\": \"1.1.0\",\n \"description\": \"Create a modern JavaScript library that uses ES6 + Jest\",\n"
},
{
"path": "readme.md",
"chars": 1901,
"preview": "<p align=\"center\">\n<img src=\"https://user-images.githubusercontent.com/2853428/54870888-3b2b5800-4d8b-11e9-8e3d-f56fd769"
},
{
"path": "templates/js/_babelrc",
"chars": 217,
"preview": "{\n \"presets\": [\n [\"@babel/preset-env\", {\n \"modules\": false,\n \"targets\": {\n \"browsers\": \"ie >= 11\"\n "
},
{
"path": "templates/js/_editorconfig",
"chars": 147,
"preview": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\nend_of_line = lf\ninsert_final_newline = true\ntrim_"
},
{
"path": "templates/js/_gitignore",
"chars": 67,
"preview": "node_modules/\ndist/\nnpm-debug.log\nyarn-error.log\npackage-lock.json\n"
},
{
"path": "templates/js/_npmrc",
"chars": 19,
"preview": "package-lock=false\n"
},
{
"path": "templates/js/_package",
"chars": 937,
"preview": "{\n \"name\": \"{{= appName }}\",\n \"version\": \"0.1.0\",\n \"main\": \"dist/{{= appName }}.cjs.js\",\n \"module\": \"dist/{{= appNam"
},
{
"path": "templates/js/example/index.html",
"chars": 1050,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, in"
},
{
"path": "templates/js/license.md",
"chars": 1066,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2019\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\n"
},
{
"path": "templates/js/readme.md",
"chars": 80,
"preview": "# 🐗 {{= appName }}\n\n> My awesome lib created by [Javali](https://javali.js.org)\n"
},
{
"path": "templates/js/rollup.config.js",
"chars": 578,
"preview": "import resolve from 'rollup-plugin-node-resolve'\nimport commonjs from 'rollup-plugin-commonjs'\nimport pkg from './packag"
},
{
"path": "templates/js/src/main.js",
"chars": 75,
"preview": "import myLibrary from './my-library'\n\nconst myLib = new myLibrary('#root')\n"
},
{
"path": "templates/js/src/my-library.js",
"chars": 553,
"preview": "class myLibrary {\n constructor (trigger) {\n this.trigger = trigger\n this.renderDiv()\n this.listenClick()\n }\n\n"
},
{
"path": "templates/js/src/my-library.test.js",
"chars": 764,
"preview": "import myLibrary from './my-library'\n\ndocument.body.innerHTML = '<div id=\"root\"></div>'\n\ndescribe('myLibrary', () => {\n "
},
{
"path": "templates/ts/_babelrc",
"chars": 245,
"preview": "{\n \"presets\": [\n [\"@babel/preset-env\", {\n \"modules\": false,\n \"targets\": {\n \"browsers\": \"ie >= 11\"\n "
},
{
"path": "templates/ts/_editorconfig",
"chars": 147,
"preview": "root = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\nend_of_line = lf\ninsert_final_newline = true\ntrim_"
},
{
"path": "templates/ts/_gitignore",
"chars": 67,
"preview": "node_modules/\ndist/\nnpm-debug.log\nyarn-error.log\npackage-lock.json\n"
},
{
"path": "templates/ts/_npmrc",
"chars": 19,
"preview": "package-lock=false\n"
},
{
"path": "templates/ts/_package",
"chars": 1189,
"preview": "{\n \"name\": \"{{= appName }}\",\n \"version\": \"0.1.0\",\n \"main\": \"dist/{{= appName }}.cjs.js\",\n \"types\": \"dist/{{= appName"
},
{
"path": "templates/ts/example/index.html",
"chars": 1050,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, in"
},
{
"path": "templates/ts/license.md",
"chars": 1066,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2019\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\n"
},
{
"path": "templates/ts/readme.md",
"chars": 80,
"preview": "# 🐗 {{= appName }}\n\n> My awesome lib created by [Javali](https://javali.js.org)\n"
},
{
"path": "templates/ts/rollup.config.js",
"chars": 651,
"preview": "import resolve from 'rollup-plugin-node-resolve'\nimport commonjs from 'rollup-plugin-commonjs'\nimport pkg from './packag"
},
{
"path": "templates/ts/src/main.ts",
"chars": 75,
"preview": "import myLibrary from './my-library'\n\nconst myLib = new myLibrary('#root')\n"
},
{
"path": "templates/ts/src/my-library.test.ts",
"chars": 764,
"preview": "import myLibrary from './my-library'\n\ndocument.body.innerHTML = '<div id=\"root\"></div>'\n\ndescribe('myLibrary', () => {\n "
},
{
"path": "templates/ts/src/my-library.ts",
"chars": 589,
"preview": "class myLibrary {\n\ttrigger: string;\n\n constructor (trigger: string) {\n this.trigger = trigger\n this.renderDiv()\n "
},
{
"path": "templates/ts/tsconfig.app.json",
"chars": 65,
"preview": "{\n \"extends\": \"./tsconfig.json\",\n \"exclude\": [\"**/*.test.ts\"]\n}"
},
{
"path": "templates/ts/tsconfig.json",
"chars": 5462,
"preview": "{\n \"include\": [\"src\"],\n \"compilerOptions\": {\n /* Basic Options */\n \"target\": \"es5\", /* "
},
{
"path": "tests/index.test.js",
"chars": 1253,
"preview": "const fs = require('fs')\nconst path = require('path')\nconst rimraf = require('rimraf')\nconst exec = require('child_proce"
}
]
About this extraction
This page contains the full source code of the diogomoretti/javali GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 44 files (40.5 KB), approximately 12.6k tokens, and a symbol index with 14 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.