├── .editorconfig
├── .github
└── workflows
│ ├── release.yml
│ └── test.yml
├── .gitignore
├── .prettierrc
├── CHANGELOG.md
├── LICENCE
├── README.md
├── benchmark
├── CHANGELOG.md
├── benchmark.suite.js
├── libs
│ ├── commander.js
│ ├── gluegun.js
│ ├── index.js
│ ├── lesy.js
│ └── yargs.js
├── package.json
└── results
│ ├── perf.chart.html
│ └── perf.json
├── commitlint.config.js
├── docs
├── CHANGELOG.md
├── LICENSE
├── README.md
├── builder
│ └── doc
│ │ ├── create-pages.js
│ │ ├── create-schema.js
│ │ └── utils.js
├── gatsby-browser.js
├── gatsby-config.js
├── gatsby-node.js
├── gatsby-ssr.js
├── lesy-config.json
├── lesy-routes.js
├── package-lock.json
├── package.json
├── postcss.config.js
├── src
│ ├── components
│ │ ├── common
│ │ │ ├── button.js
│ │ │ ├── footer.js
│ │ │ ├── header.js
│ │ │ ├── heading.js
│ │ │ ├── icon.js
│ │ │ ├── link-button.js
│ │ │ ├── newsletter.js
│ │ │ ├── search-preview.js
│ │ │ ├── search.js
│ │ │ ├── seo.js
│ │ │ └── theme-switch.js
│ │ ├── doc
│ │ │ ├── footer-nav.js
│ │ │ ├── sidebar.js
│ │ │ └── toc.js
│ │ ├── home
│ │ │ ├── chart.js
│ │ │ ├── example.js
│ │ │ ├── features
│ │ │ │ ├── artist.js
│ │ │ │ ├── commands.js
│ │ │ │ ├── index.js
│ │ │ │ ├── middlewares.js
│ │ │ │ ├── performance.js
│ │ │ │ ├── pilot.js
│ │ │ │ ├── plugins.js
│ │ │ │ └── testing.js
│ │ │ ├── mac-frame.js
│ │ │ ├── others-features.js
│ │ │ ├── reel.js
│ │ │ ├── split-card.js
│ │ │ └── step.js
│ │ ├── libraries
│ │ │ └── two-fold-card.js
│ │ └── plugins
│ │ │ └── package-card.js
│ ├── content
│ │ ├── docs
│ │ │ ├── codebase
│ │ │ │ ├── contributing.md
│ │ │ │ ├── license.md
│ │ │ │ ├── release-notes.md
│ │ │ │ └── roadmap.md
│ │ │ ├── components
│ │ │ │ ├── commands.md
│ │ │ │ ├── configuration.md
│ │ │ │ ├── features.md
│ │ │ │ ├── middlewares.md
│ │ │ │ ├── plugins.md
│ │ │ │ └── validators.md
│ │ │ ├── development
│ │ │ │ ├── indepth-concepts.md
│ │ │ │ ├── local-setup.md
│ │ │ │ └── project-overview.md
│ │ │ ├── extensions
│ │ │ │ ├── libraries-overview.md
│ │ │ │ └── plugins-overview.md
│ │ │ ├── getting-started
│ │ │ │ ├── installation.md
│ │ │ │ ├── introduction.md
│ │ │ │ └── overview.md
│ │ │ ├── resources
│ │ │ │ ├── lesy-cli.md
│ │ │ │ └── starter-template.md
│ │ │ └── testing
│ │ │ │ └── testbed.md
│ │ ├── libraries
│ │ │ └── standalone
│ │ │ │ ├── artist-UI.md
│ │ │ │ └── object-validator.md
│ │ ├── plugins
│ │ │ └── official
│ │ │ │ ├── arg-validator.md
│ │ │ │ ├── artist.md
│ │ │ │ ├── auto-help.md
│ │ │ │ ├── config-files.md
│ │ │ │ ├── local-store.md
│ │ │ │ ├── pilot-dashboard.md
│ │ │ │ ├── prompt.md
│ │ │ │ ├── scaffold-generator.md
│ │ │ │ └── sidekick.md
│ │ └── tutorial
│ │ │ └── todo-app
│ │ │ ├── overview.md
│ │ │ ├── step-1-add-database.md
│ │ │ ├── step-2-create-commands.md
│ │ │ ├── step-3-add-todo-stats.md
│ │ │ ├── step-4-display-help.md
│ │ │ ├── step-5-web-interface.md
│ │ │ ├── step-6-dynamic-todo.md
│ │ │ ├── step-7-testing.md
│ │ │ └── wrapup-and-release.md
│ ├── images
│ │ ├── gatsby-astronaut.png
│ │ └── gatsby-icon.png
│ ├── layouts
│ │ ├── doc.layout.js
│ │ └── general.layout.js
│ ├── pages
│ │ ├── 404.js
│ │ ├── benchmark.js
│ │ ├── branding.js
│ │ ├── community.js
│ │ ├── index.js
│ │ ├── libraries.js
│ │ └── plugins.js
│ ├── styles
│ │ ├── common.css
│ │ ├── fonts.css
│ │ ├── release-notes.scss
│ │ ├── syntax
│ │ │ ├── base.scss
│ │ │ ├── dark.scss
│ │ │ └── light.scss
│ │ └── tailwind.css
│ └── templates
│ │ └── doc.template.js
├── static
│ ├── .doc
│ ├── .doc-links
│ ├── data
│ │ └── perf.json
│ ├── images
│ │ ├── home-icons
│ │ │ ├── artist.png
│ │ │ ├── command.png
│ │ │ ├── middleware.png
│ │ │ ├── more.png
│ │ │ ├── performance.png
│ │ │ ├── pilot.png
│ │ │ └── plugins.png
│ │ ├── home-illus
│ │ │ ├── middleware.svg
│ │ │ └── plugins.svg
│ │ ├── lesy-core-flow.png
│ │ ├── lesy-core-flow2.png
│ │ ├── lesy-head.svg
│ │ ├── library-intros
│ │ │ ├── artist.png
│ │ │ └── validator.png
│ │ ├── logo.png
│ │ ├── pilot
│ │ │ └── console.png
│ │ ├── plugin-intros
│ │ │ ├── artist.png
│ │ │ ├── config.png
│ │ │ ├── generator.png
│ │ │ ├── help.png
│ │ │ ├── pilot.png
│ │ │ ├── prompter.png
│ │ │ ├── store.png
│ │ │ └── validator.png
│ │ ├── render1612453288681.gif
│ │ └── social.png
│ ├── js
│ │ └── theme.js
│ └── webfonts
│ │ ├── Basier_Mono_webfont_license.pdf
│ │ └── basier-square-mono-regular
│ │ ├── basiersquaremono-regular-demo.html
│ │ ├── basiersquaremono-regular-webfont.eot
│ │ ├── basiersquaremono-regular-webfont.ttf
│ │ ├── basiersquaremono-regular-webfont.woff
│ │ ├── basiersquaremono-regular-webfont.woff2
│ │ ├── generator_config.txt
│ │ ├── specimen_files
│ │ ├── grid_12-825-55-15.css
│ │ └── specimen_stylesheet.css
│ │ └── stylesheet.css
└── tailwind.config.js
├── jest.config.js
├── lerna.json
├── lint-staged.config.js
├── package-lock.json
├── package.json
├── packages
├── cli
│ ├── .npmignore
│ ├── CHANGELOG.md
│ ├── LICENCE
│ ├── README.md
│ ├── __tests__
│ │ └── main.spec.ts
│ ├── bin
│ │ └── cmd
│ ├── package.json
│ ├── src
│ │ ├── commands
│ │ │ ├── default.command.ts
│ │ │ └── new.command.ts
│ │ ├── index.ts
│ │ └── templates
│ │ │ ├── js-basic
│ │ │ └── {{name}}
│ │ │ │ ├── __tests__
│ │ │ │ ├── hello.command.integration.test.js
│ │ │ │ └── hello.command.test.js
│ │ │ │ ├── bin
│ │ │ │ └── cmd
│ │ │ │ ├── jest.config.js
│ │ │ │ ├── package.json
│ │ │ │ └── src
│ │ │ │ ├── commands
│ │ │ │ ├── default.js
│ │ │ │ └── hello.js
│ │ │ │ └── index.js
│ │ │ └── ts-basic
│ │ │ └── {{name}}
│ │ │ ├── __tests__
│ │ │ ├── hello.command.integration.test.ts
│ │ │ └── hello.command.test.ts
│ │ │ ├── bin
│ │ │ └── cmd
│ │ │ ├── jest.config.js
│ │ │ ├── package.json
│ │ │ ├── src
│ │ │ ├── commands
│ │ │ │ ├── default.ts
│ │ │ │ └── hello.ts
│ │ │ └── index.ts
│ │ │ └── tsconfig.json
│ ├── tsconfig.build.json
│ └── tsconfig.json
├── compiler
│ ├── .npmignore
│ ├── CHANGELOG.md
│ ├── LICENCE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── tsconfig.build.json
│ └── tsconfig.json
├── core
│ ├── .npmignore
│ ├── CHANGELOG.md
│ ├── LICENCE
│ ├── README.md
│ ├── __tests__
│ │ ├── __snapshots__
│ │ │ └── core.spec.ts.snap
│ │ ├── command.spec.ts
│ │ ├── core.spec.ts
│ │ ├── feature.spec.ts
│ │ ├── fixtures
│ │ │ ├── command.ts
│ │ │ ├── commands
│ │ │ │ ├── command.one.ts
│ │ │ │ └── command.two.ts
│ │ │ ├── feature.ts
│ │ │ ├── features
│ │ │ │ ├── feature.one.ts
│ │ │ │ └── feature.two.ts
│ │ │ ├── middleware.ts
│ │ │ └── middlewares
│ │ │ │ ├── middleware.end.ts
│ │ │ │ └── middleware.start.ts
│ │ ├── helpers
│ │ │ ├── cmdCreators.ts
│ │ │ ├── data.provider.ts
│ │ │ └── loaderdata.provider.ts
│ │ ├── loader.spec.ts
│ │ └── middleware.spec.ts
│ ├── package.json
│ ├── src
│ │ ├── command.ts
│ │ ├── core.ts
│ │ ├── feature.ts
│ │ ├── index.ts
│ │ ├── loader.ts
│ │ ├── middleware.ts
│ │ ├── model.ts
│ │ └── utilities.ts
│ ├── tsconfig.build.json
│ └── tsconfig.json
├── helpers
│ └── validator
│ │ ├── .npmignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENCE
│ │ ├── README.md
│ │ ├── __tests__
│ │ ├── __snapshots__
│ │ │ └── validator.spec.ts.snap
│ │ └── validator.spec.ts
│ │ ├── package.json
│ │ ├── src
│ │ ├── index.ts
│ │ └── validators.ts
│ │ └── tsconfig.json
├── misc
│ ├── artist-ui
│ │ ├── .npmignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENCE
│ │ ├── README.md
│ │ ├── __tests__
│ │ │ ├── artist.spec.ts
│ │ │ ├── elements.spec.ts
│ │ │ └── utils.spec.ts
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── elements
│ │ │ │ ├── box.ts
│ │ │ │ ├── column.ts
│ │ │ │ ├── div.ts
│ │ │ │ ├── index.ts
│ │ │ │ ├── newline.ts
│ │ │ │ ├── progress.ts
│ │ │ │ ├── row.ts
│ │ │ │ ├── space.ts
│ │ │ │ ├── span.ts
│ │ │ │ ├── spinner.ts
│ │ │ │ ├── text.ts
│ │ │ │ └── unknown.ts
│ │ │ ├── index.ts
│ │ │ └── utils.ts
│ │ └── tsconfig.json
│ ├── captain
│ │ ├── CHANGELOG.md
│ │ ├── index.js
│ │ ├── main.js
│ │ ├── package.json
│ │ └── public
│ │ │ └── flashscreen.html
│ ├── pilot-ui
│ │ ├── .browserslistrc
│ │ ├── .editorconfig
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── README.md
│ │ ├── angular.json
│ │ ├── karma.conf.js
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ ├── setup
│ │ │ ├── config-store.js
│ │ │ └── socket.js
│ │ ├── src
│ │ │ ├── app
│ │ │ │ ├── components
│ │ │ │ │ ├── command
│ │ │ │ │ │ ├── command.component.ts
│ │ │ │ │ │ └── command.template.html
│ │ │ │ │ ├── console
│ │ │ │ │ │ ├── console.component.ts
│ │ │ │ │ │ └── console.template.html
│ │ │ │ │ ├── footer
│ │ │ │ │ │ ├── footer.component.ts
│ │ │ │ │ │ └── footer.template.html
│ │ │ │ │ ├── header
│ │ │ │ │ │ ├── header.component.ts
│ │ │ │ │ │ └── header.template.html
│ │ │ │ │ ├── heading
│ │ │ │ │ │ ├── heading.component.ts
│ │ │ │ │ │ └── heading.template.html
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── middlewares
│ │ │ │ │ │ ├── middlewares.component.ts
│ │ │ │ │ │ └── middlewares.template.html
│ │ │ │ │ ├── prompt
│ │ │ │ │ │ ├── prompt.component.ts
│ │ │ │ │ │ └── prompt.template.html
│ │ │ │ │ ├── searchbar
│ │ │ │ │ │ ├── searchbar.component.ts
│ │ │ │ │ │ └── searchbar.template.html
│ │ │ │ │ ├── sidemenu
│ │ │ │ │ │ ├── sidemenu.component.ts
│ │ │ │ │ │ └── sidemenu.template.html
│ │ │ │ │ └── toast
│ │ │ │ │ │ ├── toast.component.ts
│ │ │ │ │ │ └── toast.template.html
│ │ │ │ ├── directives
│ │ │ │ │ ├── copy
│ │ │ │ │ │ └── copy.directive.ts
│ │ │ │ │ ├── panel
│ │ │ │ │ │ └── panel.directive.ts
│ │ │ │ │ ├── popover
│ │ │ │ │ │ └── popover.directive.ts
│ │ │ │ │ └── tooltip
│ │ │ │ │ │ └── tooltip.directive.ts
│ │ │ │ ├── modules
│ │ │ │ │ └── query
│ │ │ │ │ │ ├── classes
│ │ │ │ │ │ ├── checkbox.class.ts
│ │ │ │ │ │ ├── dropdown.class.ts
│ │ │ │ │ │ └── textbox.class.ts
│ │ │ │ │ │ ├── components
│ │ │ │ │ │ ├── form
│ │ │ │ │ │ │ ├── form.component.ts
│ │ │ │ │ │ │ └── form.template.html
│ │ │ │ │ │ └── input
│ │ │ │ │ │ │ ├── input.component.ts
│ │ │ │ │ │ │ └── input.template.html
│ │ │ │ │ │ ├── model.ts
│ │ │ │ │ │ ├── pipes
│ │ │ │ │ │ └── name-pipe.ts
│ │ │ │ │ │ ├── query.module.ts
│ │ │ │ │ │ └── services
│ │ │ │ │ │ ├── control.service.ts
│ │ │ │ │ │ └── query.service.ts
│ │ │ │ ├── pages
│ │ │ │ │ ├── commands
│ │ │ │ │ │ ├── commands.page.ts
│ │ │ │ │ │ └── commands.template.html
│ │ │ │ │ ├── config
│ │ │ │ │ │ ├── config.page.ts
│ │ │ │ │ │ └── config.template.html
│ │ │ │ │ ├── help
│ │ │ │ │ │ ├── help.content.ts
│ │ │ │ │ │ ├── help.page.ts
│ │ │ │ │ │ └── help.template.html
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── projects
│ │ │ │ │ │ ├── projects.page.ts
│ │ │ │ │ │ └── projects.template.html
│ │ │ │ │ ├── run
│ │ │ │ │ │ ├── run.page.ts
│ │ │ │ │ │ └── run.template.html
│ │ │ │ │ └── settings
│ │ │ │ │ │ ├── settings.page.ts
│ │ │ │ │ │ └── settings.template.html
│ │ │ │ ├── pilot.config.ts
│ │ │ │ ├── pilot.main.ts
│ │ │ │ ├── pilot.models.ts
│ │ │ │ ├── pilot.module.ts
│ │ │ │ ├── pilot.routing.module.ts
│ │ │ │ ├── pilot.template.html
│ │ │ │ ├── services
│ │ │ │ │ ├── commands.service.ts
│ │ │ │ │ ├── common.service.ts
│ │ │ │ │ ├── hotkeys.service.ts
│ │ │ │ │ ├── logs.service.ts
│ │ │ │ │ ├── middlewares.service.ts
│ │ │ │ │ ├── modal.service.ts
│ │ │ │ │ ├── notification.service.ts
│ │ │ │ │ ├── projects.service.ts
│ │ │ │ │ ├── prompt.service.ts
│ │ │ │ │ ├── runners.service.ts
│ │ │ │ │ ├── safehtml.service.ts
│ │ │ │ │ ├── utils.service.ts
│ │ │ │ │ └── ws.service.ts
│ │ │ │ └── store
│ │ │ │ │ ├── actions
│ │ │ │ │ ├── command.actions.ts
│ │ │ │ │ ├── commands.actions.ts
│ │ │ │ │ ├── common.actions.ts
│ │ │ │ │ ├── logs.actions.ts
│ │ │ │ │ ├── middlewares.actions.ts
│ │ │ │ │ ├── notification.actions.ts
│ │ │ │ │ ├── project.actions.ts
│ │ │ │ │ ├── projects.actions.ts
│ │ │ │ │ ├── prompt.actions.ts
│ │ │ │ │ └── runners.actions.ts
│ │ │ │ │ └── states
│ │ │ │ │ ├── command.state.ts
│ │ │ │ │ ├── commands.state.ts
│ │ │ │ │ ├── common.state.ts
│ │ │ │ │ ├── index.ts
│ │ │ │ │ ├── logs.state.ts
│ │ │ │ │ ├── middlewares.state.ts
│ │ │ │ │ ├── notification.state.ts
│ │ │ │ │ ├── project.state.ts
│ │ │ │ │ ├── projects.state.ts
│ │ │ │ │ ├── prompt.state.ts
│ │ │ │ │ └── runners.state.ts
│ │ │ ├── assets
│ │ │ │ ├── .gitkeep
│ │ │ │ ├── android-chrome-192x192.png
│ │ │ │ ├── apple-touch-icon.png
│ │ │ │ ├── browserconfig.xml
│ │ │ │ ├── favicon-16x16.png
│ │ │ │ ├── favicon-32x32.png
│ │ │ │ ├── icons
│ │ │ │ │ ├── remixicon.css
│ │ │ │ │ ├── remixicon.eot
│ │ │ │ │ ├── remixicon.less
│ │ │ │ │ ├── remixicon.svg
│ │ │ │ │ ├── remixicon.symbol.svg
│ │ │ │ │ ├── remixicon.ttf
│ │ │ │ │ ├── remixicon.woff
│ │ │ │ │ └── remixicon.woff2
│ │ │ │ ├── site.webmanifest
│ │ │ │ └── svg
│ │ │ │ │ └── choose-cmd.svg
│ │ │ ├── environments
│ │ │ │ ├── environment.prod.ts
│ │ │ │ └── environment.ts
│ │ │ ├── favicon.ico
│ │ │ ├── index.html
│ │ │ ├── karma.conf.js
│ │ │ ├── main.ts
│ │ │ ├── polyfills.ts
│ │ │ ├── styles.scss
│ │ │ ├── tailwind.scss
│ │ │ ├── test.ts
│ │ │ ├── tsconfig.app.json
│ │ │ └── tsconfig.spec.json
│ │ ├── tailwind.config.js
│ │ ├── tsconfig.app.json
│ │ ├── tsconfig.base.json
│ │ ├── tsconfig.json
│ │ ├── tsconfig.spec.json
│ │ ├── tslint.json
│ │ └── webpack.config.js
│ └── test-utils
│ │ ├── CHANGELOG.md
│ │ ├── index.js
│ │ └── package.json
├── plugins
│ ├── lesy-plugin-artist
│ │ ├── .npmignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENCE
│ │ ├── README.md
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── artist.feature.ts
│ │ │ ├── artist.middleware.ts
│ │ │ └── index.ts
│ │ └── tsconfig.json
│ ├── lesy-plugin-config
│ │ ├── .npmignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENCE
│ │ ├── README.md
│ │ ├── __tests__
│ │ │ ├── config-plugin.spec.ts
│ │ │ └── test-config.json
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ └── middlewares
│ │ │ │ └── config.mw.ts
│ │ └── tsconfig.json
│ ├── lesy-plugin-demo
│ │ ├── .npmignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENCE
│ │ ├── README.md
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── commands
│ │ │ │ ├── cmd-name.command.ts
│ │ │ │ ├── console-colors.command.ts
│ │ │ │ └── input.command.ts
│ │ │ └── index.ts
│ │ └── tsconfig.json
│ ├── lesy-plugin-generator
│ │ ├── .npmignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENCE
│ │ ├── README.md
│ │ ├── __tests__
│ │ │ ├── fixtures
│ │ │ │ ├── dynamic
│ │ │ │ │ └── {{filename}}.txt
│ │ │ │ └── static
│ │ │ │ │ └── ins.txt
│ │ │ └── generator-plugin.spec.ts
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── generator.feature.ts
│ │ │ └── index.ts
│ │ └── tsconfig.json
│ ├── lesy-plugin-help
│ │ ├── .npmignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENCE
│ │ ├── README.md
│ │ ├── __tests__
│ │ │ ├── fixtures
│ │ │ │ └── help.feature.ts
│ │ │ └── help.command.test.ts
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── help.command.ts
│ │ │ ├── help.config.ts
│ │ │ ├── help.middleware.ts
│ │ │ ├── help.model.ts
│ │ │ └── index.ts
│ │ └── tsconfig.json
│ ├── lesy-plugin-pilot
│ │ ├── .npmignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENCE
│ │ ├── README.md
│ │ ├── __tests__
│ │ │ ├── fixtures
│ │ │ │ └── hello.txt
│ │ │ └── run.command.test.ts
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── __tests__
│ │ │ │ └── pilot.socket.test.ts
│ │ │ ├── helpers
│ │ │ │ ├── banner.ts
│ │ │ │ └── public-ip.ts
│ │ │ ├── index.ts
│ │ │ ├── interceptor.middleware.ts
│ │ │ ├── models.ts
│ │ │ ├── pilot.command.ts
│ │ │ ├── pilot.feature.ts
│ │ │ ├── pilot.socket.ts
│ │ │ └── run.command.ts
│ │ └── tsconfig.json
│ ├── lesy-plugin-prompt
│ │ ├── .npmignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENCE
│ │ ├── README.md
│ │ ├── __tests__
│ │ │ ├── fixtures
│ │ │ │ └── package.json
│ │ │ └── plugin.test.ts
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ └── prompt.feature.ts
│ │ └── tsconfig.json
│ ├── lesy-plugin-sidekick
│ │ ├── .npmignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENCE
│ │ ├── README.md
│ │ ├── __tests__
│ │ │ ├── fixtures
│ │ │ │ └── package.json
│ │ │ └── plugin.test.ts
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── features
│ │ │ │ └── pkg.feature.ts
│ │ │ ├── index.ts
│ │ │ └── middlewares
│ │ │ │ ├── error.middleware.ts
│ │ │ │ └── version.middlware.ts
│ │ └── tsconfig.json
│ ├── lesy-plugin-store
│ │ ├── .npmignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENCE
│ │ ├── README.md
│ │ ├── __tests__
│ │ │ └── store.command.test.ts
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── commands
│ │ │ │ ├── get.store.command.ts
│ │ │ │ ├── remove.store.command.ts
│ │ │ │ ├── set.store.command.ts
│ │ │ │ └── store.command.ts
│ │ │ ├── index.ts
│ │ │ ├── store.feature.ts
│ │ │ └── store.middleware.ts
│ │ └── tsconfig.json
│ └── lesy-plugin-validator
│ │ ├── .npmignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENCE
│ │ ├── README.md
│ │ ├── __tests__
│ │ └── validator.middleware.test.ts
│ │ ├── package.json
│ │ ├── src
│ │ ├── index.ts
│ │ └── validator.middleware.ts
│ │ └── tsconfig.json
├── testbed
│ ├── .npmignore
│ ├── CHANGELOG.md
│ ├── LICENCE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── custom.tsConfig.json
│ │ └── index.ts
│ └── tsconfig.json
└── types
│ ├── .npmignore
│ ├── CHANGELOG.md
│ ├── LICENCE
│ ├── README.md
│ ├── command.d.ts
│ ├── command.d.ts.map
│ ├── core.d.ts
│ ├── core.d.ts.map
│ ├── feature.d.ts
│ ├── feature.d.ts.map
│ ├── index.d.ts
│ ├── index.d.ts.map
│ ├── loader.d.ts
│ ├── loader.d.ts.map
│ ├── middleware.d.ts
│ ├── middleware.d.ts.map
│ ├── model.d.ts
│ ├── model.d.ts.map
│ ├── package.json
│ ├── utilities.d.ts
│ └── utilities.d.ts.map
├── tsconfig.base.json
└── tslint.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 4
6 | charset = utf-8
7 | trim_trailing_whitespace = false
8 | insert_final_newline = false
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "trailingComma": "all",
3 | "tabWidth": 2,
4 | "semi": true,
5 | "singleQuote": false
6 | }
7 |
--------------------------------------------------------------------------------
/LICENCE:
--------------------------------------------------------------------------------
1 | MIT License
2 | -----------
3 |
4 | Copyright (c) 2019 Lokesh Rajendran
5 | Permission is hereby granted, free of charge, to any person
6 | obtaining a copy of this software and associated documentation
7 | files (the "Software"), to deal in the Software without
8 | restriction, including without limitation the rights to use,
9 | copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the
11 | Software is furnished to do so, subject to the following
12 | conditions:
13 |
14 | The above copyright notice and this permission notice shall be
15 | included in all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 | OTHER DEALINGS IN THE SOFTWARE.
25 |
26 | English Česky
--------------------------------------------------------------------------------
/benchmark/benchmark.suite.js:
--------------------------------------------------------------------------------
1 | const b = require("benny");
2 | const commander = require("commander");
3 | const yargs = require("yargs");
4 | const { build: gluegun } = require("gluegun");
5 | const lesy = require("@lesy/compiler");
6 | const { commanderCode, gluegunCode, yargsCode, lesyCode } = require("./libs");
7 |
8 | const options = {
9 | // minSamples: 100
10 | };
11 |
12 | b.suite(
13 | "Performance test",
14 | b.add(
15 | "lesy",
16 | async () => {
17 | await lesyCode(lesy);
18 | },
19 | options,
20 | ),
21 |
22 | b.add(
23 | "commander",
24 | () => {
25 | commanderCode(commander);
26 | },
27 | options,
28 | ),
29 |
30 | b.add(
31 | "yargs",
32 | () => {
33 | yargsCode(yargs);
34 | },
35 | options,
36 | ),
37 |
38 | b.add(
39 | "glugun",
40 | async () => {
41 | await gluegunCode(gluegun);
42 | },
43 | options,
44 | ),
45 |
46 | b.cycle(),
47 | b.complete(),
48 | b.save({ file: "perf", version: "1.0.0", folder: "./results" }),
49 | b.save({ file: "perf", format: "chart.html", folder: "./results" }),
50 | );
51 |
--------------------------------------------------------------------------------
/benchmark/libs/commander.js:
--------------------------------------------------------------------------------
1 | module.exports = (program) => {
2 | program.command("greet").action(function () {});
3 |
4 | program.parse(["./", "./", "greet"]);
5 | };
6 |
--------------------------------------------------------------------------------
/benchmark/libs/gluegun.js:
--------------------------------------------------------------------------------
1 | module.exports = async (greet) => {
2 | const movieCLI = greet("greetings")
3 | .command({
4 | name: "greet",
5 | run: () => {},
6 | })
7 | .src(__dirname)
8 | .exclude([
9 | "meta",
10 | "strings",
11 | "print",
12 | "filesystem",
13 | "semver",
14 | "system",
15 | "prompt",
16 | "http",
17 | "template",
18 | "patching",
19 | ])
20 | .create();
21 |
22 | await movieCLI.run(["greet"]);
23 | };
24 |
--------------------------------------------------------------------------------
/benchmark/libs/index.js:
--------------------------------------------------------------------------------
1 | const commanderCode = require("./commander");
2 | const yargsCode = require("./yargs");
3 | const gluegunCode = require("./gluegun");
4 | const lesyCode = require("./lesy");
5 |
6 | module.exports = { commanderCode, yargsCode, gluegunCode, lesyCode };
7 |
--------------------------------------------------------------------------------
/benchmark/libs/lesy.js:
--------------------------------------------------------------------------------
1 | module.exports = async (lesy) =>
2 | await lesy({
3 | loadDefaultPlugins: false,
4 | commands: [{ name: "greet", run: () => {} }],
5 | }).parse(["greet"]);
6 |
--------------------------------------------------------------------------------
/benchmark/libs/yargs.js:
--------------------------------------------------------------------------------
1 | module.exports = (yargs) => {
2 | yargs
3 | .command(
4 | "greet",
5 | "greeting",
6 | () => {},
7 | (argv) => {},
8 | )
9 | .parse(["greet"]);
10 | };
11 |
--------------------------------------------------------------------------------
/benchmark/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@lesy/lesy-benchmark",
3 | "version": "1.0.0-beta.18",
4 | "main": "benchmark.suite.js",
5 | "scripts": {
6 | "benchmark": "node ./benchmark.suite.js",
7 | "benchmarkWS": "node --max-old-space-size=10000 ./benchmark.suite.js",
8 | "copy-to-docs": "cp results/perf.json ../docs/static/"
9 | },
10 | "private": true,
11 | "dependencies": {
12 | "@lesy/compiler": "^1.0.0-beta.18",
13 | "benny": "^3.6.14",
14 | "commander": "^6.0.0",
15 | "gluegun": "^4.4.0",
16 | "yargs": "^15.4.1"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/benchmark/results/perf.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Performance test",
3 | "date": "2020-09-16T02:50:16.591Z",
4 | "version": "1.0.0",
5 | "results": [
6 | {
7 | "name": "lesy",
8 | "ops": 195019,
9 | "margin": 0.77,
10 | "percentSlower": 18.55
11 | },
12 | {
13 | "name": "commander",
14 | "ops": 239421,
15 | "margin": 42.26,
16 | "percentSlower": 0
17 | },
18 | {
19 | "name": "yargs",
20 | "ops": 8520,
21 | "margin": 23.18,
22 | "percentSlower": 96.44
23 | },
24 | {
25 | "name": "glugun",
26 | "ops": 261,
27 | "margin": 23.46,
28 | "percentSlower": 99.89
29 | }
30 | ],
31 | "fastest": {
32 | "name": "commander",
33 | "index": 1
34 | },
35 | "slowest": {
36 | "name": "glugun",
37 | "index": 3
38 | }
39 | }
--------------------------------------------------------------------------------
/commitlint.config.js:
--------------------------------------------------------------------------------
1 | const lernaScopesConfig = require("@commitlint/config-lerna-scopes");
2 |
3 | const scopes = ["release"];
4 |
5 | const getScopes = (initialEnum = []) => ctx =>
6 | lernaScopesConfig.utils
7 | .getPackages()
8 | .then(packageList => initialEnum.concat(packageList))
9 | .then(scopeList => [2, "always", scopeList]);
10 |
11 | module.exports = {
12 | extends: ["@commitlint/config-conventional"],
13 | rules: {
14 | "scope-enum": ctx => getScopes(scopes)(ctx),
15 | },
16 | };
17 |
--------------------------------------------------------------------------------
/docs/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 | -----------
3 |
4 | Copyright (c) 2019 Lokesh Rajendran
5 | Permission is hereby granted, free of charge, to any person
6 | obtaining a copy of this software and associated documentation
7 | files (the "Software"), to deal in the Software without
8 | restriction, including without limitation the rights to use,
9 | copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the
11 | Software is furnished to do so, subject to the following
12 | conditions:
13 |
14 | The above copyright notice and this permission notice shall be
15 | included in all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 | OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # Lesy JS documentation
2 |
--------------------------------------------------------------------------------
/docs/builder/doc/create-pages.js:
--------------------------------------------------------------------------------
1 | const { routes, redirected } = require("../../lesy-routes");
2 | const { iteratePages, sidebarMenuItems } = require("./utils");
3 |
4 | exports.createPages = async ({ actions }) => {
5 | const { createRedirect, createPage } = actions;
6 |
7 | const pages = iteratePages(routes);
8 | const sidebarItems = sidebarMenuItems(pages);
9 |
10 | pages.forEach(page => {
11 | createPage({
12 | component: require.resolve("../../src/templates/doc.template.js"),
13 | path: page.slug,
14 | context: { ...page, sidebarItems: sidebarItems[page.parent.path] },
15 | });
16 | });
17 |
18 | redirected.forEach(({ from, to }) => {
19 | createRedirect({
20 | fromPath: from,
21 | toPath: to,
22 | isPermanent: true,
23 | redirectInBrowser: true,
24 | });
25 | });
26 | };
27 |
--------------------------------------------------------------------------------
/docs/builder/doc/create-schema.js:
--------------------------------------------------------------------------------
1 | const appConfig = require("../../lesy-config.json");
2 | exports.createSchemaCustomization = ({ actions, schema }) => {
3 | const { createTypes } = actions;
4 | const typeDefs = [
5 | "type Mdx implements Node { frontmatter: Frontmatter }",
6 | schema.buildObjectType({
7 | name: "Frontmatter",
8 | fields: {
9 | icon: {
10 | type: "String",
11 | resolve(source, args, context, info) {
12 | const { icon } = source;
13 | if (source.icon == null) {
14 | return appConfig.doc["default-page-icon"];
15 | }
16 | return icon;
17 | },
18 | },
19 | },
20 | }),
21 | ];
22 | createTypes(typeDefs);
23 | };
24 |
--------------------------------------------------------------------------------
/docs/gatsby-browser.js:
--------------------------------------------------------------------------------
1 | import "./src/styles/tailwind.css";
2 | import "./src/styles/fonts.css";
3 | import "./src/styles/common.css";
4 | import "./src/styles/release-notes.scss";
5 | import "./src/styles/syntax/light.scss";
6 | import "./src/styles/syntax/dark.scss";
7 | import "remixicon/fonts/remixicon.css";
8 | import "@lesy/brand/font/style.css";
9 |
--------------------------------------------------------------------------------
/docs/gatsby-node.js:
--------------------------------------------------------------------------------
1 | // Documentation pages and schema
2 | const { createPages } = require("./builder/doc/create-pages");
3 | const { createSchemaCustomization } = require("./builder/doc/create-schema");
4 |
5 | module.exports = {
6 | createPages,
7 | createSchemaCustomization,
8 | };
9 |
--------------------------------------------------------------------------------
/docs/gatsby-ssr.js:
--------------------------------------------------------------------------------
1 | const React = require("react");
2 |
3 | exports.onRenderBody = ({ setHeadComponents }) => {
4 | setHeadComponents([]);
5 | };
6 |
--------------------------------------------------------------------------------
/docs/lesy-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "doc": {
3 | "default-page-icon": "question-fill"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/docs/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | tailwindcss: {},
4 | autoprefixer: {},
5 | },
6 | }
7 |
--------------------------------------------------------------------------------
/docs/src/components/common/button.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | const Button = ({ children, label, icon }) => {
4 | return (
5 |
9 | );
10 | };
11 |
12 | export default Button;
13 |
--------------------------------------------------------------------------------
/docs/src/components/common/heading.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | const Heading = ({ title, desc }) => {
4 | return (
5 |
6 |
7 | {title}
8 |
9 |
{desc}
10 |
11 | );
12 | };
13 |
14 | export default Heading;
15 |
--------------------------------------------------------------------------------
/docs/src/components/common/icon.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import clsx from "clsx";
3 |
4 | const Icon = ({ name, size = "base", col = "gray-500", className = "" }) => {
5 | return (
6 |
11 | );
12 | };
13 |
14 | export default Icon;
15 |
--------------------------------------------------------------------------------
/docs/src/components/common/link-button.js:
--------------------------------------------------------------------------------
1 | import { Link } from "gatsby";
2 | import React from "react";
3 |
4 | const LinkButton = ({ children, label, icon, to, href, external = false }) => {
5 | const Comp = external ? `a` : Link;
6 | return (
7 |
12 | {icon && }
13 | {children || label}
14 |
15 | );
16 | };
17 |
18 | export default LinkButton;
19 |
--------------------------------------------------------------------------------
/docs/src/components/common/search-preview.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Link } from "gatsby";
3 | import { Highlight } from "react-instantsearch-dom";
4 | const SearchPreview = props => {
5 | const { hit } = props;
6 | return (
7 |
8 |
9 |
10 |
11 |
12 |
13 | {new Date(hit.date).toLocaleDateString()}
14 |
15 |
16 |
17 |
18 | );
19 | };
20 | export default SearchPreview;
21 |
--------------------------------------------------------------------------------
/docs/src/components/common/theme-switch.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | const ThemeSwitch = ({ children, name = "app", prefix = "" }) => {
4 | const handler = () => window.__toggleTheme(name, prefix);
5 | const Icon = ({ className }) => (
6 |
7 | );
8 | return children(handler, Icon);
9 | };
10 |
11 | export default ThemeSwitch;
12 |
--------------------------------------------------------------------------------
/docs/src/components/doc/toc.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import PropTypes from "prop-types";
3 | import { Link } from "gatsby";
4 |
5 | const DocTOC = ({ items }) => {
6 | let level = 0;
7 | const getItems = items => {
8 | if (!items) return null;
9 | level += 1;
10 | const rootItemCls =
11 | level === 1 ? "font-medium pb-1 text-gray-600 dark:text-gray-300" : "";
12 | return items.map(item => {
13 | return (
14 |
15 |
16 | {item.title}
17 |
18 | {item.items && (
19 |
{getItems(item.items)}
20 | )}
21 |
22 | );
23 | });
24 | };
25 | if (!items) return null;
26 |
27 | return (
28 |
29 |
30 | On this page
31 |
32 | {getItems(items)}
33 |
34 | );
35 | };
36 |
37 | DocTOC.propTypes = {
38 | items: PropTypes.array.isRequired,
39 | };
40 |
41 | export default DocTOC;
42 |
--------------------------------------------------------------------------------
/docs/src/components/home/example.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Step from "./step";
3 | import MacFrame from "./mac-frame";
4 | const codes = {};
5 | codes["1"] = `> npx lesy new my-cli`;
6 | codes["2"] = `export default {
7 | name: "greet",
8 | run:() => console.log("Hello!")
9 | }`;
10 | codes["3"] = `> ./bin/cmd greet`;
11 |
12 | const Example = ({ icon, step, title, lang, role }) => {
13 | return (
14 |
15 |
16 |
17 |
18 | {codes[step]}
19 |
20 |
21 |
22 | );
23 | };
24 | export default Example;
25 |
--------------------------------------------------------------------------------
/docs/src/components/home/features/artist.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import SplitCard from "../split-card";
3 |
4 | const ArtistFeature = () => {
5 | return (
6 |
7 |
14 |
15 |

19 |
20 |
21 |
22 | );
23 | };
24 |
25 | export default ArtistFeature;
26 |
--------------------------------------------------------------------------------
/docs/src/components/home/features/index.js:
--------------------------------------------------------------------------------
1 | import ArtistFeature from "./artist";
2 | import CommandFeature from "./commands";
3 | import MiddlewareFeature from "./middlewares";
4 | import PerfFeature from "./performance";
5 | import PilotFeature from "./pilot";
6 | import PluginFeature from "./plugins";
7 | import TestingFeature from "./testing";
8 |
9 | const ft = {};
10 |
11 | ft.Middlware = MiddlewareFeature;
12 | ft.Command = CommandFeature;
13 | ft.Plugin = PluginFeature;
14 | ft.Pilot = PilotFeature;
15 | ft.Artist = ArtistFeature;
16 | ft.Testing = TestingFeature;
17 | ft.Perf = PerfFeature;
18 |
19 | export default ft;
20 |
--------------------------------------------------------------------------------
/docs/src/components/home/features/middlewares.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import SplitCard from "../split-card";
3 |
4 | const MiddlewareFeature = () => {
5 | return (
6 |
7 |
13 |
14 |

15 |
16 |
17 |
18 | );
19 | };
20 |
21 | export default MiddlewareFeature;
22 |
--------------------------------------------------------------------------------
/docs/src/components/home/features/performance.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Chart from "../chart";
3 | import SplitCard from "../split-card";
4 | import chartData from "../../../../static/data/perf.json";
5 |
6 | const PerfFeature = () => {
7 | return (
8 |
9 |
14 |
15 |
16 |
17 |
18 |
19 | );
20 | };
21 |
22 | export default PerfFeature;
23 |
--------------------------------------------------------------------------------
/docs/src/components/home/features/pilot.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import SplitCard from "../split-card";
3 |
4 | const PilotFeature = () => {
5 | return (
6 |
7 |
13 |
14 |

19 |
20 |
21 |
22 | );
23 | };
24 |
25 | export default PilotFeature;
26 |
--------------------------------------------------------------------------------
/docs/src/components/home/mac-frame.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 |
3 | const MacFrame = ({ title, children, lang }) => {
4 | return (
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | {title}
14 |
15 |
16 |
17 |
18 | {children}
19 |
20 |
21 |
22 | );
23 | };
24 |
25 | export default MacFrame;
26 |
--------------------------------------------------------------------------------
/docs/src/components/home/step.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | const Step = ({ icon, step, title }) => {
3 | return (
4 |
5 |
6 |
7 |
8 | Step {step}:
9 |
10 |
11 | {title}
12 |
13 |
14 |
15 | );
16 | };
17 |
18 | export default Step;
19 |
--------------------------------------------------------------------------------
/docs/src/content/docs/codebase/release-notes.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Release notes"
3 | summary: "Releases"
4 | icon: book-3-fill
5 | ---
6 |
7 |
8 | {props.releases.map(e=>{
9 | return
10 | })}
11 |
12 |
--------------------------------------------------------------------------------
/docs/src/content/docs/codebase/roadmap.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Roadmap"
3 | icon: road-map-fill
4 | ---
5 |
6 | ### Plugins
7 |
8 | - [ ] Autocorrect mispelled args
9 | - [ ] Notification
10 |
11 | ### Others
12 |
13 | - [ ] Support for desktop app
14 | - [x] Allow pilot to show registered middlewares
15 |
--------------------------------------------------------------------------------
/docs/src/content/docs/components/configuration.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Configuration
3 | icon: settings-3-fill
4 | summary: In main index.ts file you can add a config object, which will be avilable in commands and middlewares.
5 | ---
6 |
7 | ```typescript
8 | const commands = [...];
9 | const middlewares = [...];
10 | const config = {
11 | name: "Peter"
12 | }
13 |
14 | export { commands, middlewares,config };
15 | ```
16 |
17 | In any command or middleware, run context will have a config property
18 |
19 | ```typescript
20 | export default {
21 | name: "hello",
22 | run: ({ config }) => {
23 | console.log(config.name);
24 | },
25 | };
26 | ```
27 |
28 | ## Advanced config
29 |
30 | - `@lesy/lesy-plugin-config` plugin will extend this feature to support load config from **yaml** **json** **rc** files.
31 | - `@lesy/lesy-plugin-store` plugin will store config or any data in system.
32 |
--------------------------------------------------------------------------------
/docs/src/content/docs/development/indepth-concepts.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Indepth concepts"
3 | icon: focus-2-fill
4 | ---
5 |
6 | ## Architecture
7 |
8 | 
9 |
10 | ## How it works
11 |
12 | **core** has two main methods. `bootstrap` and `run`
13 |
14 | **bootstrap(userData)**
15 |
16 | - Takes the user provided data(commands, featutes, etc.,)
17 | - Passes all data to loader to extract the content.
18 | - Extracted content is saved in state
19 | - Executes middlewares hooked to `INIT` and `START`
20 |
21 | **run(argv)**
22 |
23 | - Takes user provided command args from the terminal or from `parse` method
24 | - Parse arguments and flags
25 | - Find the correct command from the args
26 | - Validate args and flags
27 | - Run command
28 | - During this flow it executes middlewares hooked to `PRE_PARSE`, `POST_PARSE`, `PRE_VALIDATE`,`PRE_RUN`,`END`
29 |
--------------------------------------------------------------------------------
/docs/src/content/docs/extensions/libraries-overview.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Standalone libraries"
3 | icon: "briefcase-4-fill"
4 | ---
5 |
6 | These are independent, standalone libraries that can be used without lesy.
7 |
8 | ## Artist UI
9 |
10 | Artist is an UI library which helps you to update console screen on data change. And not just that, Artist also comes bundled with all necessary elements like spinner, colums, tables, progress bar and more to spice up the visuals. [View docs](/libraries/standalone/artist-UI)
11 |
12 | ## Object validator
13 |
14 | A lightweight bare minimum core library to validate simple objects with your own custom rules and conditions. This also lets you to use async rules, custom response messages. [View docs](/libraries/standalone/object-validator)
15 |
--------------------------------------------------------------------------------
/docs/src/content/docs/resources/lesy-cli.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Lesy CLI"
3 | icon: "terminal-box-fill"
4 | ---
5 |
6 | # hello
7 |
8 | How are you
9 |
--------------------------------------------------------------------------------
/docs/src/content/docs/resources/starter-template.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Starter template"
3 | icon: "folder-open-fill"
4 | ---
5 |
6 | # hello
7 |
8 | How are you
9 |
--------------------------------------------------------------------------------
/docs/src/content/docs/testing/testbed.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Testbed overview
3 | icon: bug-fill
4 | summary: Lesy ships own testing tool `@lesy/testbed` for unit and integration test.
5 | ---
6 |
7 | Generally commands, middlewares, features can be tested independently with Jest. But however, to test them with the app or to test a plugin **testbed** can be used
8 |
9 | ```js
10 | import { resolve } from "path";
11 | import { LesyTestBed } from "@lesy/testbed";
12 |
13 | describe("CLI", () => {
14 | let app;
15 |
16 | beforeEach(() => {
17 | app = new LesyTestBed({
18 | root: resolve(__dirname, "./"),
19 | commands: [
20 | `src/commands/default.command.ts`,
21 | {
22 | name: "hello",
23 | run: () => console.log("hello yoyo!"),
24 | },
25 | ],
26 | });
27 | });
28 |
29 | it("should log proper output", async () => {
30 | let response = await app.run(["hello"]);
31 | expect(response).toContain("hello yoyo!");
32 | });
33 | });
34 | ```
35 |
--------------------------------------------------------------------------------
/docs/src/content/plugins/official/arg-validator.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Arg validator"
3 | icon: shield-keyhole-fill
4 | summary: ""
5 | ---
6 |
7 | **@lesy/lesy-plugin-validator** plugin helps to prompt for required argument if it is not filled.
8 |
9 | ## Installation
10 |
11 | ```shell
12 | $ npm install @lesy/lesy-plugin-validator
13 | ```
14 |
15 | Then add it to plugins array in main `index` file
16 |
17 | ```typescript
18 | export default {
19 | commands:[...],
20 | plugins:['@lesy/lesy-plugin-prompt','@lesy/lesy-plugin-validator']
21 | }
22 | ```
23 |
24 | > This plugin depends on prompt plugin. Please install and add `@lesy/lesy-plugin-prompt` as well.
25 |
26 | ## Usage
27 |
28 | Once you have added this plugin, it will automatically prompt for required arguements if it is not supplied.
29 |
--------------------------------------------------------------------------------
/docs/src/content/plugins/official/sidekick.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Sidekick"
3 | icon: rocket-fill
4 | summary: ""
5 | ---
6 |
7 | **@lesy/lesy-plugin-sidekick** is a build-in plugin helps you to,
8 |
9 | - Load package json file
10 | - Allows `--version` flag globally
11 | - Dsiplay any exceptions thrown inside any commands
12 |
13 | ## Usage
14 |
15 | ```typescript
16 | // in any command or middleware context
17 | export default {
18 | name: "pkginfo",
19 | run: ({ feature }) => {
20 | console.log(feature.pkg);
21 | },
22 | };
23 | ```
24 |
25 | ## Disable plugin
26 |
27 | ```js
28 | const path = require("path");
29 | const lesy = require("@lesy/compiler");
30 |
31 | lesy({
32 | isTypescriptApp: true,
33 | loadDefaultPlugins: false,
34 | root: path.resolve(__dirname, "../"),
35 | }).parse();
36 | ```
37 |
--------------------------------------------------------------------------------
/docs/src/content/tutorial/todo-app/wrapup-and-release.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: "Touch up and publish"
3 | icon: bug-fill
4 | summary: ""
5 | ---
6 |
7 | I hope this tutorial helped you to understand the basic concepts and fundamental blocks of lesy framework. What we have learned from this tutorial is just the high level guide to get started and running an application, but there's lot more we can do when combining all the components.
8 |
9 | ## Source code
10 |
11 | Complete source code of this tutorial is published in [Github]() repository. You can take a look at that for reference.
12 |
13 | ## What's next?
14 |
15 | Next step would be reading the [documentation]() to know more about the API and advanced features.
16 |
17 | ## Feedback
18 |
19 | Main intention of this tutorial is to make you confortable in basics of lesy. But if you are struck at any point or need more explaination, please feel free to send a feedback via [hello@lesyjs.io]() or [@lesyjs]() twitter handle.
20 |
21 | ## Learn more
22 |
23 | - Lesy [documentation]()
24 | - Official [Plugins]() list and docs
25 | - Standalone [modules]() docs
26 |
--------------------------------------------------------------------------------
/docs/src/images/gatsby-astronaut.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/src/images/gatsby-astronaut.png
--------------------------------------------------------------------------------
/docs/src/images/gatsby-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/src/images/gatsby-icon.png
--------------------------------------------------------------------------------
/docs/src/layouts/general.layout.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Footer from "../components/common/footer";
3 | import Header from "../components/common/header";
4 | import Newsletter from "../components/common/newsletter";
5 | import SEO from "../components/common/seo";
6 |
7 | const GeneralLayout = ({ children, ...info }) => {
8 | return (
9 |
10 |
11 |
12 |
13 | {children}
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | );
22 | };
23 |
24 | export default GeneralLayout;
25 |
--------------------------------------------------------------------------------
/docs/src/pages/404.js:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import Heading from "../components/common/heading";
3 | import GeneralLayout from "../layouts/general.layout";
4 |
5 | const NotFoundPage = () => {
6 | return (
7 |
8 |
9 |
13 |
14 |
15 | );
16 | };
17 |
18 | export default NotFoundPage;
19 |
--------------------------------------------------------------------------------
/docs/src/styles/fonts.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: "bsmono";
3 | src: url("/webfonts/basier-square-mono-regular/basiersquaremono-regular-webfont.eot");
4 | src: url("/webfonts/basier-square-mono-regular/basiersquaremono-regular-webfont.eot?#iefix")
5 | format("embedded-opentype"),
6 | url("/webfonts/basier-square-mono-regular/basiersquaremono-regular-webfont.woff2")
7 | format("woff2"),
8 | url("/webfonts/basier-square-mono-regular/basiersquaremono-regular-webfont.woff")
9 | format("woff"),
10 | url("/webfonts/basier-square-mono-regular/basiersquaremono-regular-webfont.ttf")
11 | format("truetype");
12 | font-weight: normal;
13 | font-style: normal;
14 | }
15 |
--------------------------------------------------------------------------------
/docs/src/styles/syntax/dark.scss:
--------------------------------------------------------------------------------
1 | @import "./base";
2 |
3 | .dark,
4 | .light .gatsby-highlight {
5 | --base-color: #f9f8f6;
6 | --selection-color: #8b5704;
7 | --code-bg-color: #1f2a37;
8 | --inline-bg-color: #1f2a37;
9 | --inline-text-color: #c3bebe;
10 | --header-color: #949dbf;
11 | --punc-color: #adb7ce;
12 | --prop-color: #eb75a2;
13 | --selector-color: #f3cd91;
14 | --id-color: #858799;
15 | --str-color: #7da8d6;
16 | --keyword-color: #93ece0;
17 | --declaration-color: #eb75a2;
18 | --variable-color: #6577ec;
19 | --line-hl-color: #d2cdc6;
20 | --line-hl-left-bg-color: #9a918454;
21 | --line-highlight-color: #433f3754;
22 | --line-hl-start-color: #433f3754;
23 | --line-hl-end-color: #433f3700;
24 |
25 | --chart-lines: #525f70;
26 | --chart-ticks: #969da6;
27 | --chart-label: rgba(255, 255, 255, 0.8);
28 | --chart-text: #fff;
29 |
30 | @extend %base;
31 | }
32 |
33 | .dark {
34 | --bg-color: #1f2a37;
35 | --inline-bg-color: #1f2a37;
36 | }
37 |
38 | .dark._override {
39 | --code-bg-color: transparent;
40 | }
41 |
--------------------------------------------------------------------------------
/docs/src/styles/syntax/light.scss:
--------------------------------------------------------------------------------
1 | @import "./base";
2 | .light {
3 | --base-color: #0d0b07;
4 | --selection-color: #f3cd91;
5 | --code-bg-color: #f5f7fa;
6 | --inline-bg-color: #f4f7fa;
7 | --inline-text-color: #2c5281;
8 | --header-color: #b2b8bd;
9 | --punc-color: #a39b8f;
10 | --prop-color: #007a6a;
11 | --selector-color: #931f4c;
12 | --id-color: #4a4c59;
13 | --str-color: #364ddd;
14 | --keyword-color: #955d04;
15 | --declaration-color: #007a6a;
16 | --variable-color: #4b60e7;
17 | --line-hl-color: #d2cdc6;
18 | --line-hl-left-bg-color: #9a918454;
19 | --line-highlight-color: #9a918454;
20 | --line-hl-start-color: #9a918454;
21 | --line-hl-end-color: #9a918400;
22 |
23 | --chart-lines: #dde0e6;
24 | --chart-ticks: #718096;
25 | --chart-label: rgba(255, 255, 255, 0.8);
26 | --chart-text: #374151;
27 |
28 | @extend %base;
29 | }
30 |
--------------------------------------------------------------------------------
/docs/src/styles/tailwind.css:
--------------------------------------------------------------------------------
1 | @tailwind base;
2 | @tailwind components;
3 | @tailwind utilities;
4 |
--------------------------------------------------------------------------------
/docs/static/.doc-links:
--------------------------------------------------------------------------------
1 | # getting started
2 |
3 | - introduction
4 | - installation
5 | - overview
6 |
7 | # quick start tutorial
8 |
9 | - overview
10 | - step1: setup
11 | - step2: write command
12 | - step3: create middleware
13 | - step4: add tool
14 | - step5: create plugin
15 | - step6: install pilot plugin
16 | - step7: install help plugin
17 | - step8: testing
18 | - step9: build and warp up
19 |
20 | # core concepts
21 |
22 | - command
23 | - middleware
24 | - toolkit
25 | - plugin
26 | - configuration
27 | - validator
28 |
29 | # testing
30 |
31 | - testbed
32 |
33 | # official plugins
34 |
35 | - help
36 | - pilot
37 | - artist
38 | - generator
39 | - store
40 | - config files
41 | - prompt
42 | - essentials
43 | - validator
44 |
45 | # standalone libraries
46 |
47 | - artist ui
48 | - validator
49 |
50 | # dev guide
51 |
52 | - project overview
53 | - install locally
54 | - tech used
55 | - indepth concepts
56 | - roadmap
57 | - release notes
58 | - contibution
59 |
--------------------------------------------------------------------------------
/docs/static/data/perf.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Performance test",
3 | "date": "2020-09-16T02:50:16.591Z",
4 | "version": "1.0.0",
5 | "results": [
6 | {
7 | "name": "lesy",
8 | "ops": 195019,
9 | "margin": 0.77,
10 | "percentSlower": 18.55
11 | },
12 | {
13 | "name": "commander",
14 | "ops": 239421,
15 | "margin": 42.26,
16 | "percentSlower": 0
17 | },
18 | {
19 | "name": "yargs",
20 | "ops": 8520,
21 | "margin": 23.18,
22 | "percentSlower": 96.44
23 | },
24 | {
25 | "name": "glugun",
26 | "ops": 261,
27 | "margin": 23.46,
28 | "percentSlower": 99.89
29 | }
30 | ],
31 | "fastest": {
32 | "name": "commander",
33 | "index": 1
34 | },
35 | "slowest": {
36 | "name": "glugun",
37 | "index": 3
38 | }
39 | }
--------------------------------------------------------------------------------
/docs/static/images/home-icons/artist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/home-icons/artist.png
--------------------------------------------------------------------------------
/docs/static/images/home-icons/command.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/home-icons/command.png
--------------------------------------------------------------------------------
/docs/static/images/home-icons/middleware.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/home-icons/middleware.png
--------------------------------------------------------------------------------
/docs/static/images/home-icons/more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/home-icons/more.png
--------------------------------------------------------------------------------
/docs/static/images/home-icons/performance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/home-icons/performance.png
--------------------------------------------------------------------------------
/docs/static/images/home-icons/pilot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/home-icons/pilot.png
--------------------------------------------------------------------------------
/docs/static/images/home-icons/plugins.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/home-icons/plugins.png
--------------------------------------------------------------------------------
/docs/static/images/lesy-core-flow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/lesy-core-flow.png
--------------------------------------------------------------------------------
/docs/static/images/lesy-core-flow2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/lesy-core-flow2.png
--------------------------------------------------------------------------------
/docs/static/images/library-intros/artist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/library-intros/artist.png
--------------------------------------------------------------------------------
/docs/static/images/library-intros/validator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/library-intros/validator.png
--------------------------------------------------------------------------------
/docs/static/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/logo.png
--------------------------------------------------------------------------------
/docs/static/images/pilot/console.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/pilot/console.png
--------------------------------------------------------------------------------
/docs/static/images/plugin-intros/artist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/plugin-intros/artist.png
--------------------------------------------------------------------------------
/docs/static/images/plugin-intros/config.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/plugin-intros/config.png
--------------------------------------------------------------------------------
/docs/static/images/plugin-intros/generator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/plugin-intros/generator.png
--------------------------------------------------------------------------------
/docs/static/images/plugin-intros/help.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/plugin-intros/help.png
--------------------------------------------------------------------------------
/docs/static/images/plugin-intros/pilot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/plugin-intros/pilot.png
--------------------------------------------------------------------------------
/docs/static/images/plugin-intros/prompter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/plugin-intros/prompter.png
--------------------------------------------------------------------------------
/docs/static/images/plugin-intros/store.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/plugin-intros/store.png
--------------------------------------------------------------------------------
/docs/static/images/plugin-intros/validator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/plugin-intros/validator.png
--------------------------------------------------------------------------------
/docs/static/images/render1612453288681.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/render1612453288681.gif
--------------------------------------------------------------------------------
/docs/static/images/social.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/images/social.png
--------------------------------------------------------------------------------
/docs/static/webfonts/Basier_Mono_webfont_license.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/webfonts/Basier_Mono_webfont_license.pdf
--------------------------------------------------------------------------------
/docs/static/webfonts/basier-square-mono-regular/basiersquaremono-regular-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/webfonts/basier-square-mono-regular/basiersquaremono-regular-webfont.eot
--------------------------------------------------------------------------------
/docs/static/webfonts/basier-square-mono-regular/basiersquaremono-regular-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/webfonts/basier-square-mono-regular/basiersquaremono-regular-webfont.ttf
--------------------------------------------------------------------------------
/docs/static/webfonts/basier-square-mono-regular/basiersquaremono-regular-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/webfonts/basier-square-mono-regular/basiersquaremono-regular-webfont.woff
--------------------------------------------------------------------------------
/docs/static/webfonts/basier-square-mono-regular/basiersquaremono-regular-webfont.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lokesh-coder/lesyjs/a560c7a617a994a6621a8ae4f101dfb218bc11dd/docs/static/webfonts/basier-square-mono-regular/basiersquaremono-regular-webfont.woff2
--------------------------------------------------------------------------------
/docs/static/webfonts/basier-square-mono-regular/generator_config.txt:
--------------------------------------------------------------------------------
1 | # Font Squirrel Font-face Generator Configuration File
2 | # Upload this file to the generator to recreate the settings
3 | # you used to create these fonts.
4 |
5 | {"mode":"expert","formats":["ttf","woff","woff2","eotz"],"tt_instructor":"default","fix_gasp":"xy","fix_vertical_metrics":"Y","metrics_ascent":"","metrics_descent":"","metrics_linegap":"","add_spaces":"Y","add_hyphens":"Y","fallback":"none","fallback_custom":"100","webonly":"Y","options_subset":"none","subset_custom":"","subset_custom_range":"","subset_ot_features_list":"","css_stylesheet":"stylesheet.css","filename_suffix":"-webfont","emsquare":"2048","spacing_adjustment":"0","rememberme":"Y"}
--------------------------------------------------------------------------------
/docs/static/webfonts/basier-square-mono-regular/stylesheet.css:
--------------------------------------------------------------------------------
1 | /*! Generated by Font Squirrel (https://www.fontsquirrel.com) on June 10, 2019 */
2 |
3 |
4 |
5 | @font-face {
6 | font-family: 'basier_square_monoregular';
7 | src: url('basiersquaremono-regular-webfont.eot');
8 | src: url('basiersquaremono-regular-webfont.eot?#iefix') format('embedded-opentype'),
9 | url('basiersquaremono-regular-webfont.woff2') format('woff2'),
10 | url('basiersquaremono-regular-webfont.woff') format('woff'),
11 | url('basiersquaremono-regular-webfont.ttf') format('truetype');
12 | font-weight: normal;
13 | font-style: normal;
14 |
15 | }
--------------------------------------------------------------------------------
/lerna.json:
--------------------------------------------------------------------------------
1 | {
2 | "packages": [
3 | "benchmark",
4 | "docs",
5 | "packages/*",
6 | "packages/helpers/*",
7 | "packages/misc/*",
8 | "packages/plugins/*"
9 | ],
10 | "version": "1.0.0-beta.18",
11 | "command": {
12 | "bootstrap": {
13 | "ignore": "@lesy/lesy-pilot-ui",
14 | "npmClientArgs": [
15 | "--no-package-lock"
16 | ]
17 | },
18 | "version": {
19 | "message": "chore(release): 🎉 publish %s",
20 | "ignoreChanges": [
21 | "./docs/**",
22 | "./benchmark/**",
23 | "/coverage/**",
24 | "**/__fixtures__/**",
25 | "**/__tests__/**",
26 | "**/*.md",
27 | "**/package-lock.json"
28 | ]
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/lint-staged.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "*": () => "npm run lint",
3 | };
4 |
--------------------------------------------------------------------------------
/packages/cli/.npmignore:
--------------------------------------------------------------------------------
1 | src/
2 | __tests__/
3 | /tsconfig.json
4 | tsconfig.build.json
5 | *.tsbuildinfo
--------------------------------------------------------------------------------
/packages/cli/LICENCE:
--------------------------------------------------------------------------------
1 | MIT License
2 | -----------
3 |
4 | Copyright (c) 2019 Lokesh Rajendran
5 | Permission is hereby granted, free of charge, to any person
6 | obtaining a copy of this software and associated documentation
7 | files (the "Software"), to deal in the Software without
8 | restriction, including without limitation the rights to use,
9 | copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the
11 | Software is furnished to do so, subject to the following
12 | conditions:
13 |
14 | The above copyright notice and this permission notice shall be
15 | included in all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 | OTHER DEALINGS IN THE SOFTWARE.
25 |
26 | English Česky
--------------------------------------------------------------------------------
/packages/cli/README.md:
--------------------------------------------------------------------------------
1 | # @lesy/cli
2 |
--------------------------------------------------------------------------------
/packages/cli/__tests__/main.spec.ts:
--------------------------------------------------------------------------------
1 | import { LesyTestBed } from "@lesy/testbed";
2 | import { resolve } from "path";
3 | // tslint:disable-next-line: import-name
4 | import * as PluginData from "../src";
5 |
6 | describe("CLI", () => {
7 | let testBed;
8 | beforeEach(() => {
9 | testBed = new LesyTestBed({
10 | isTypescriptApp: true,
11 | loadDefaultPlugins: false,
12 | root: resolve(__dirname, "../"),
13 | features: [(f: any) => (f.pkg = { version: "1.0.0" })],
14 | ...PluginData,
15 | });
16 | });
17 | it("should print greeting message", async () => {
18 | const response = await testBed.run([]);
19 | expect(response).toContain("Lesy CLI Framework - v1.0.0");
20 | });
21 | });
22 |
--------------------------------------------------------------------------------
/packages/cli/bin/cmd:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | const path = require("path");
4 | const lesy = require("@lesy/compiler");
5 |
6 | exports.default = lesy({
7 | isTypescriptApp: true,
8 | root: path.resolve(__dirname, "../"),
9 | }).parse();
10 |
--------------------------------------------------------------------------------
/packages/cli/src/commands/default.command.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | description: `Lesy CLI Framework`,
3 | run: ({ utils, feature }) => {
4 | const chalk = utils.color();
5 | let message = `Lesy CLI Framework - v${feature.pkg.version}\n`;
6 | message += `Super easy tool to create CLI applications\n\n`;
7 | message += `Get started by running ${chalk.bold.green(
8 | "lesy new [project-name]",
9 | )}\n`;
10 | console.log(message);
11 | },
12 | };
13 |
--------------------------------------------------------------------------------
/packages/cli/src/index.ts:
--------------------------------------------------------------------------------
1 | const commands = [`${__dirname}/commands`];
2 | const plugins = [
3 | "@lesy/lesy-plugin-generator",
4 | "@lesy/lesy-plugin-prompt",
5 | "@lesy/lesy-plugin-help",
6 | [
7 | "@lesy/lesy-plugin-pilot",
8 | {
9 | docTitle: "Lesy CLI | Dashboard",
10 | appName: "Lesy CLI",
11 | },
12 | ],
13 | ];
14 |
15 | export { commands, plugins };
16 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/js-basic/{{name}}/__tests__/hello.command.integration.test.js:
--------------------------------------------------------------------------------
1 | const { resolve } = require("path");
2 | const { LesyTestBed } = require("@lesy/testbed");
3 | const HelloCommand = require("../src/commands/hello");
4 |
5 | describe("Hello - Integration test", () => {
6 | let testBed;
7 | beforeEach(() => {
8 | testBed = new LesyTestBed({
9 | isTypescriptApp: false,
10 | root: resolve(__dirname, "./"),
11 | commands: [HelloCommand],
12 | });
13 | });
14 | it("should return proper response", async () => {
15 | let response = await testBed.run(["hello"]);
16 | expect(response).toContain("Hello Stranger!");
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/js-basic/{{name}}/__tests__/hello.command.test.js:
--------------------------------------------------------------------------------
1 | const HelloCommand = require("../src/commands/hello");
2 |
3 | describe("Hello command", () => {
4 | let consoleLogMock;
5 | beforeEach(() => {
6 | consoleLogMock = jest.spyOn(console, "log").mockImplementation();
7 | });
8 |
9 | afterEach(() => {
10 | consoleLogMock.mockRestore();
11 | });
12 |
13 | it("should return proper response", async () => {
14 | HelloCommand.run({ args: { name: "foo" } });
15 | expect(consoleLogMock).toBeCalledWith("Hello foo!");
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/js-basic/{{name}}/bin/cmd:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | const path = require("path");
4 | const lesy = require("@lesy/compiler");
5 |
6 | const options = {
7 | root: path.resolve(__dirname, "../"),
8 | };
9 |
10 | exports.default = lesy(options).parse();
11 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/js-basic/{{name}}/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | collectCoverage: true,
3 |
4 | collectCoverageFrom: ["./src/**"],
5 |
6 | coverageDirectory: "coverage",
7 |
8 | coveragePathIgnorePatterns: ["/node_modules/", "/.history/", "types"],
9 |
10 | resetModules: true,
11 |
12 | testEnvironment: "node",
13 |
14 | testPathIgnorePatterns: [
15 | "/node_modules/",
16 | "/fixtures/",
17 | "/.history/",
18 | "types",
19 | ],
20 |
21 | verbose: true,
22 | };
23 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/js-basic/{{name}}/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{{name}}",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "src/index.js",
6 | "scripts": {
7 | "test": "jest"
8 | },
9 | "bin": {
10 | "{{cmdName}}": "bin/cmd"
11 | },
12 | "dependencies": {
13 | "@lesy/compiler": "^{{version}}",
14 | "@lesy/lesy-plugin-pilot": "^{{version}}"
15 | },
16 | "devDependencies": {
17 | "jest": "^24.9.0",
18 | "@lesy/testbed": "^{{version}}"
19 | },
20 | "keywords": [
21 | "lesy"
22 | ],
23 | "author": "",
24 | "license": "MIT"
25 | }
26 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/js-basic/{{name}}/src/commands/default.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: "default",
3 | description: "Main command",
4 | run: () => console.log(`Hello {{name}}!`)
5 | };
6 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/js-basic/{{name}}/src/commands/hello.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: "hello",
3 | aliases: ["h", "hi", "ola"],
4 | args: { name: {} },
5 | run: ({ args }) => console.log(`Hello ${args.name || "Stranger"}!`)
6 | };
7 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/js-basic/{{name}}/src/index.js:
--------------------------------------------------------------------------------
1 | const commands = [`${__dirname}/commands`];
2 | const plugins = ["@lesy/lesy-plugin-pilot"];
3 |
4 | module.exports = { commands, plugins };
5 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/ts-basic/{{name}}/__tests__/hello.command.integration.test.ts:
--------------------------------------------------------------------------------
1 | import { LesyTestBed } from "@lesy/testbed";
2 | import { resolve } from "path";
3 | import hello from "../src/commands/hello";
4 |
5 | describe("Hello command", () => {
6 | let testBed;
7 | beforeEach(() => {
8 | testBed = new LesyTestBed({
9 | isTypescriptApp: true,
10 | root: resolve(__dirname, "./"),
11 | commands: [hello],
12 | });
13 | });
14 | it("should return proper response", async () => {
15 | const response = await testBed.run(["hello"]);
16 | expect(response).toContain("Hello Stranger!");
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/ts-basic/{{name}}/__tests__/hello.command.test.ts:
--------------------------------------------------------------------------------
1 | import hello from "../src/commands/hello";
2 |
3 | describe("Hello command", () => {
4 | let consoleLogMock;
5 | beforeEach(() => {
6 | consoleLogMock = jest.spyOn(console, "log").mockImplementation();
7 | });
8 |
9 | afterEach(() => {
10 | consoleLogMock.mockRestore();
11 | });
12 |
13 | it("should return proper response", async () => {
14 | hello.run({ args: { name: "foo" } });
15 | expect(consoleLogMock).toBeCalledWith("Hello foo!");
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/ts-basic/{{name}}/bin/cmd:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | const path = require("path");
4 | const lesy = require("@lesy/compiler");
5 |
6 | const options = {
7 | isTypescriptApp: true,
8 | root: path.resolve(__dirname, "../"),
9 | };
10 |
11 | exports.default = lesy(options).parse();
12 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/ts-basic/{{name}}/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | collectCoverage: true,
3 |
4 | collectCoverageFrom: ["./src/**"],
5 |
6 | coverageDirectory: "coverage",
7 |
8 | coveragePathIgnorePatterns: ["/node_modules/", "/.history/", "types"],
9 |
10 | globals: {
11 | "ts-jest": {
12 | tsConfig: "./tsconfig.json",
13 | diagnostics: false
14 | }
15 | },
16 |
17 | preset: "ts-jest",
18 |
19 | resetModules: true,
20 |
21 | testEnvironment: "node",
22 |
23 | testPathIgnorePatterns: [
24 | "/node_modules/",
25 | "/fixtures/",
26 | "/.history/",
27 | "types"
28 | ],
29 |
30 | verbose: true
31 | };
32 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/ts-basic/{{name}}/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{{name}}",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "dist/index.js",
6 | "scripts": {
7 | "clean": "rm -rf ./dist",
8 | "build": "npm run clean && tsc --build tsconfig.json",
9 | "test": "jest"
10 | },
11 | "bin": {
12 | "{{cmdName}}": "bin/cmd"
13 | },
14 | "dependencies": {
15 | "@lesy/compiler": "^{{version}}",
16 | "@lesy/lesy-plugin-pilot": "^{{version}}"
17 | },
18 | "devDependencies": {
19 | "@lesy/testbed": "^{{version}}",
20 | "@types/jest": "^24.0.19",
21 | "@types/node": "^12.11.1",
22 | "copyfiles": "^2.1.1",
23 | "jest": "^24.9.0",
24 | "ts-jest": "^24.1.0",
25 | "typescript": "^3.6.4"
26 | },
27 | "keywords": [
28 | "lesy"
29 | ],
30 | "author": "",
31 | "license": "MIT"
32 | }
33 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/ts-basic/{{name}}/src/commands/default.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "default",
3 | description: "Main command",
4 | run: () => console.log("Hello {{name}}!"),
5 | };
6 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/ts-basic/{{name}}/src/commands/hello.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "hello",
3 | aliases: ["h", "hi", "ola"],
4 | args: { name: {} },
5 | run: ({ args }) => console.log(`Hello ${args.name || "Stranger"}!`),
6 | };
7 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/ts-basic/{{name}}/src/index.ts:
--------------------------------------------------------------------------------
1 | const commands = [`${__dirname}/commands`];
2 | const plugins = ["@lesy/lesy-plugin-pilot"];
3 |
4 | export { commands, plugins };
5 |
--------------------------------------------------------------------------------
/packages/cli/src/templates/ts-basic/{{name}}/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2017",
4 | "module": "commonjs",
5 | "declaration": true,
6 | "outDir": "./dist",
7 | "noEmit": false,
8 | "importHelpers": false,
9 | "noImplicitAny": false,
10 | "moduleResolution": "node",
11 | "esModuleInterop": true,
12 | "allowSyntheticDefaultImports": true
13 | },
14 | "exclude": ["node_modules", "__tests__"],
15 | "compileOnSave": false
16 | }
17 |
--------------------------------------------------------------------------------
/packages/cli/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "paths": {}
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/packages/compiler/.npmignore:
--------------------------------------------------------------------------------
1 | src/
2 | __tests__/
3 | tsconfig.json
4 | tsconfig.build.json
5 | *.tsbuildinfo
--------------------------------------------------------------------------------
/packages/compiler/LICENCE:
--------------------------------------------------------------------------------
1 | MIT License
2 | -----------
3 |
4 | Copyright (c) 2019 Lokesh Rajendran
5 | Permission is hereby granted, free of charge, to any person
6 | obtaining a copy of this software and associated documentation
7 | files (the "Software"), to deal in the Software without
8 | restriction, including without limitation the rights to use,
9 | copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the
11 | Software is furnished to do so, subject to the following
12 | conditions:
13 |
14 | The above copyright notice and this permission notice shall be
15 | included in all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 | OTHER DEALINGS IN THE SOFTWARE.
25 |
26 | English Česky
--------------------------------------------------------------------------------
/packages/compiler/README.md:
--------------------------------------------------------------------------------
1 | # @lesy/compiler
2 |
--------------------------------------------------------------------------------
/packages/compiler/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@lesy/compiler",
3 | "version": "1.0.0-beta.18",
4 | "description": "",
5 | "main": "dist/index.js",
6 | "scripts": {
7 | "build": "rm -rf ./dist && tsc --build tsconfig.build.json"
8 | },
9 | "keywords": [
10 | "compiler",
11 | "cli",
12 | "lesy",
13 | "typescript"
14 | ],
15 | "author": {
16 | "email": "mexican.dirtyfellow@gmail.com",
17 | "name": "Lokesh Rajendran"
18 | },
19 | "license": "MIT",
20 | "dependencies": {
21 | "@lesy/core": "^1.0.0-beta.18",
22 | "@lesy/lesy-plugin-sidekick": "^1.0.0-beta.18",
23 | "ts-node": "^9.0.0",
24 | "tsconfig-paths": "^3.9.0"
25 | },
26 | "publishConfig": {
27 | "access": "public"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/packages/compiler/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "paths": {}
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/packages/compiler/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2017",
4 | "module": "commonjs",
5 | "allowJs": false,
6 | "declaration": true,
7 | "declarationMap": true,
8 | "sourceMap": false,
9 | "outDir": "./dist",
10 | "removeComments": true,
11 | "noEmit": false,
12 | "importHelpers": false,
13 | "moduleResolution": "node",
14 | "allowSyntheticDefaultImports": true,
15 | "esModuleInterop": true,
16 | "baseUrl": "./",
17 | "paths": {
18 | "@lesy/core": ["../core/src/index.ts"]
19 | }
20 | },
21 | "exclude": ["node_modules", "__tests__"],
22 | "compileOnSave": false
23 | }
24 |
--------------------------------------------------------------------------------
/packages/core/.npmignore:
--------------------------------------------------------------------------------
1 | src/
2 | __tests__/
3 | tsconfig.json
4 | tsconfig.build.json
5 | *.tsbuildinfo
--------------------------------------------------------------------------------
/packages/core/LICENCE:
--------------------------------------------------------------------------------
1 | MIT License
2 | -----------
3 |
4 | Copyright (c) 2019 Lokesh Rajendran
5 | Permission is hereby granted, free of charge, to any person
6 | obtaining a copy of this software and associated documentation
7 | files (the "Software"), to deal in the Software without
8 | restriction, including without limitation the rights to use,
9 | copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the
11 | Software is furnished to do so, subject to the following
12 | conditions:
13 |
14 | The above copyright notice and this permission notice shall be
15 | included in all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 | OTHER DEALINGS IN THE SOFTWARE.
25 |
26 | English Česky
--------------------------------------------------------------------------------
/packages/core/README.md:
--------------------------------------------------------------------------------
1 | # @lesy/core
2 |
--------------------------------------------------------------------------------
/packages/core/__tests__/feature.spec.ts:
--------------------------------------------------------------------------------
1 | import { LesyFeature } from "../src/feature";
2 |
3 | describe("Feature", () => {
4 | let feature: LesyFeature;
5 | beforeEach(() => {
6 | feature = new LesyFeature();
7 | });
8 | test("basic", () => {
9 | const obj = (f: any) => {
10 | f.abc = "xyz";
11 | return f;
12 | };
13 | feature.add(obj);
14 | expect(feature.getFeatures()).toMatchObject({ abc: "xyz" });
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/packages/core/__tests__/fixtures/command.ts:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: "foobar",
3 | run: () => {},
4 | };
5 |
--------------------------------------------------------------------------------
/packages/core/__tests__/fixtures/commands/command.one.ts:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: "commandOne",
3 | run: () => {},
4 | };
5 |
--------------------------------------------------------------------------------
/packages/core/__tests__/fixtures/commands/command.two.ts:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | name: "commandTwo",
3 | run: () => {},
4 | };
5 |
--------------------------------------------------------------------------------
/packages/core/__tests__/fixtures/feature.ts:
--------------------------------------------------------------------------------
1 | export default (x: any) => {
2 | x.abc = "xyz";
3 | return x;
4 | };
5 |
--------------------------------------------------------------------------------
/packages/core/__tests__/fixtures/features/feature.one.ts:
--------------------------------------------------------------------------------
1 | export default (x: any) => {
2 | x.one = "one";
3 | return x;
4 | };
5 |
--------------------------------------------------------------------------------
/packages/core/__tests__/fixtures/features/feature.two.ts:
--------------------------------------------------------------------------------
1 | export default (x: any) => {
2 | x.two = "two";
3 | return x;
4 | };
5 |
--------------------------------------------------------------------------------
/packages/core/__tests__/fixtures/middleware.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | on: "PRE_RUN",
3 | run: () => {},
4 | };
5 |
--------------------------------------------------------------------------------
/packages/core/__tests__/fixtures/middlewares/middleware.end.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | on: "END",
3 | run: () => {},
4 | };
5 |
--------------------------------------------------------------------------------
/packages/core/__tests__/fixtures/middlewares/middleware.start.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | on: "START",
3 | run: () => {},
4 | };
5 |
--------------------------------------------------------------------------------
/packages/core/__tests__/helpers/cmdCreators.ts:
--------------------------------------------------------------------------------
1 | export const newCmdObj = (name, props = {}) => ({
2 | name,
3 | run: () => {},
4 | ...props,
5 | });
6 | export const newCmdFn = (name, props = {}) => () => {
7 | return {
8 | name,
9 | run: () => {},
10 | ...props,
11 | };
12 | };
13 | export const newCmdClass = (name, props = {}) => {
14 | return class CustomCommand {
15 | name = name;
16 | constructor() {
17 | Object.keys(props).forEach((k: string) => {
18 | this[k] = props[k];
19 | });
20 | }
21 |
22 | run() {}
23 | };
24 | };
25 |
--------------------------------------------------------------------------------
/packages/core/__tests__/helpers/data.provider.ts:
--------------------------------------------------------------------------------
1 | const propsData = [
2 | { name: "main", input: { main: "parent" }, expected: ["main", "parent"] },
3 | {
4 | name: "args",
5 | input: { args: { name: "john" } },
6 | expected: ["args", { name: "john" }],
7 | },
8 | ];
9 |
10 | export { propsData };
11 |
--------------------------------------------------------------------------------
/packages/core/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@lesy/core",
3 | "version": "1.0.0-beta.18",
4 | "description": "",
5 | "main": "dist/index.js",
6 | "scripts": {
7 | "clean": "rm -rf ./dist",
8 | "compile": "npm run clean && tsc --build tsconfig.build.json",
9 | "build": "npm run clean && ncc build src/index.ts -o dist -e @lesy/validator -e tsconfig-paths -e ts-node -e chalk -e ora -e argh -e trough --no-source-map-register -m"
10 | },
11 | "keywords": [
12 | "core",
13 | "cli",
14 | "lesy",
15 | "commands",
16 | "typescript"
17 | ],
18 | "author": {
19 | "email": "mexican.dirtyfellow@gmail.com",
20 | "name": "Lokesh Rajendran"
21 | },
22 | "license": "MIT",
23 | "dependencies": {
24 | "@lesy/test-utils": "^1.0.0-beta.18",
25 | "@lesy/validator": "^1.0.0-beta.18",
26 | "argh": "^1.0.0",
27 | "chalk": "^4.0.0",
28 | "ora": "^4.0.4",
29 | "trough": "1.0.5"
30 | },
31 | "publishConfig": {
32 | "access": "public"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/packages/core/src/feature.ts:
--------------------------------------------------------------------------------
1 | import { Feature, FeatureObj } from "./model";
2 | import { utils } from "./utilities";
3 |
4 | class LesyFeature {
5 | private feature = {};
6 | constructor(private root: string) {}
7 |
8 | add(featureFn: Feature) {
9 | featureFn(this.feature, this.root, utils);
10 | }
11 | getFeatures(): FeatureObj {
12 | return this.feature;
13 | }
14 | }
15 | export { LesyFeature };
16 |
--------------------------------------------------------------------------------
/packages/core/src/index.ts:
--------------------------------------------------------------------------------
1 | export { LesyCoreClass } from "./core";
2 | export * from "./model";
3 |
--------------------------------------------------------------------------------
/packages/core/src/utilities.ts:
--------------------------------------------------------------------------------
1 | export const utils = {
2 | color: () => {
3 | return require("chalk");
4 | },
5 | spinner: () => {
6 | return require("ora");
7 | },
8 | };
9 |
--------------------------------------------------------------------------------
/packages/core/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "paths": {}
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/packages/core/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2017",
4 | "module": "commonjs",
5 | "allowJs": false,
6 | "declaration": true,
7 | "declarationDir": "../types",
8 | "declarationMap": true,
9 | "sourceMap": false,
10 | "outDir": "./dist",
11 | "removeComments": true,
12 | "noEmit": false,
13 | "importHelpers": false,
14 | "moduleResolution": "node",
15 | "allowSyntheticDefaultImports": true,
16 | "esModuleInterop": true,
17 | "baseUrl": "./",
18 | "paths": {
19 | "@lesy/validator": ["../helpers/validator/src/index.ts"],
20 | "@lesy/test-utils": ["../misc/test-utils"]
21 | }
22 | },
23 | "exclude": ["node_modules", "__tests__"],
24 | "compileOnSave": false
25 | }
26 |
--------------------------------------------------------------------------------
/packages/helpers/validator/.npmignore:
--------------------------------------------------------------------------------
1 | src/
2 | __tests__/
3 | tsconfig.json
4 | tsconfig.build.json
5 | *.tsbuildinfo
--------------------------------------------------------------------------------
/packages/helpers/validator/LICENCE:
--------------------------------------------------------------------------------
1 | MIT License
2 | -----------
3 |
4 | Copyright (c) 2019 Lokesh Rajendran
5 | Permission is hereby granted, free of charge, to any person
6 | obtaining a copy of this software and associated documentation
7 | files (the "Software"), to deal in the Software without
8 | restriction, including without limitation the rights to use,
9 | copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the
11 | Software is furnished to do so, subject to the following
12 | conditions:
13 |
14 | The above copyright notice and this permission notice shall be
15 | included in all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 | OTHER DEALINGS IN THE SOFTWARE.
25 |
26 | English Česky
--------------------------------------------------------------------------------
/packages/helpers/validator/README.md:
--------------------------------------------------------------------------------
1 | # @lesy/validator
2 |
--------------------------------------------------------------------------------
/packages/helpers/validator/__tests__/__snapshots__/validator.spec.ts.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`LesyValidator should succeed if required param is truthy 1`] = `
4 | Array [
5 | Object {
6 | "error": null,
7 | "name": "name",
8 | "passed": true,
9 | "validator": "required",
10 | },
11 | ]
12 | `;
13 |
14 | exports[`LesyValidator should throw err if required param is falsy 1`] = `
15 | Array [
16 | Object {
17 | "error": " validation failed for [name]",
18 | "name": "name",
19 | "passed": false,
20 | "validator": "required",
21 | },
22 | ]
23 | `;
24 |
25 | exports[`LesyValidator should throw errs as array if multiple props failed 1`] = `
26 | Array [
27 | Object {
28 | "error": " validation failed for [name]",
29 | "name": "name",
30 | "passed": false,
31 | "validator": "required",
32 | },
33 | Object {
34 | "error": " validation failed for [age]",
35 | "name": "age",
36 | "passed": false,
37 | "validator": "required",
38 | },
39 | ]
40 | `;
41 |
--------------------------------------------------------------------------------
/packages/helpers/validator/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@lesy/validator",
3 | "version": "1.0.0-beta.18",
4 | "description": "",
5 | "main": "dist/index.js",
6 | "scripts": {
7 | "clean": "rm -rf ./dist",
8 | "build": "npm run clean && tsc --build"
9 | },
10 | "keywords": [
11 | "cli",
12 | "lesy",
13 | "validator"
14 | ],
15 | "author": {
16 | "email": "mexican.dirtyfellow@gmail.com",
17 | "name": "Lokesh Rajendran"
18 | },
19 | "license": "MIT",
20 | "publishConfig": {
21 | "access": "public"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/packages/helpers/validator/src/validators.ts:
--------------------------------------------------------------------------------
1 | export const requiredValidator = (value, rule) => rule === !!value;
2 | export const exactValidator = (value, rule) => value === rule;
3 | export const sizeValidator = (value, rule) => {
4 | return !!value && value.length >= rule.min && value.length <= rule.max;
5 | };
6 |
--------------------------------------------------------------------------------
/packages/helpers/validator/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2017",
4 | "module": "commonjs",
5 | "allowJs": false,
6 | "declaration": true,
7 | "declarationMap": true,
8 | "sourceMap": false,
9 | "outDir": "./dist",
10 | "removeComments": true,
11 | "noEmit": false,
12 | "importHelpers": false,
13 | "moduleResolution": "node",
14 | "allowSyntheticDefaultImports": true,
15 | "esModuleInterop": true
16 | },
17 | "exclude": ["node_modules", "__tests__"],
18 | "compileOnSave": false
19 | }
20 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/.npmignore:
--------------------------------------------------------------------------------
1 | src/
2 | __tests__/
3 | tsconfig.json
4 | tsconfig.build.json
5 | *.tsbuildinfo
--------------------------------------------------------------------------------
/packages/misc/artist-ui/LICENCE:
--------------------------------------------------------------------------------
1 | MIT License
2 | -----------
3 |
4 | Copyright (c) 2019 Lokesh Rajendran
5 | Permission is hereby granted, free of charge, to any person
6 | obtaining a copy of this software and associated documentation
7 | files (the "Software"), to deal in the Software without
8 | restriction, including without limitation the rights to use,
9 | copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the
11 | Software is furnished to do so, subject to the following
12 | conditions:
13 |
14 | The above copyright notice and this permission notice shall be
15 | included in all copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 | OTHER DEALINGS IN THE SOFTWARE.
25 |
26 | English Česky
--------------------------------------------------------------------------------
/packages/misc/artist-ui/README.md:
--------------------------------------------------------------------------------
1 | # @lesy/artist
2 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/__tests__/utils.spec.ts:
--------------------------------------------------------------------------------
1 | import { flatten, flattenToStr } from "../src/utils";
2 |
3 | describe("utils", () => {
4 | it("should deep flatten the array", () => {
5 | const input = ["one", "two", ["three", "four"], ["five", ["six", "seven"]]];
6 | expect(flattenToStr(input)).toEqual([
7 | "one",
8 | "two",
9 | "three four",
10 | "five six seven",
11 | ]);
12 | });
13 |
14 | it("should flatten the array to one level", () => {
15 | const input = ["one", "two", ["three", "four"], ["five", ["six", "seven"]]];
16 | expect(flatten(input)).toEqual([
17 | "one",
18 | "two",
19 | "three",
20 | "four",
21 | "five",
22 | ["six", "seven"],
23 | ]);
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@lesy/artist",
3 | "version": "1.0.0-beta.18",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {},
7 | "keywords": [],
8 | "author": {
9 | "email": "mexican.dirtyfellow@gmail.com",
10 | "name": "Lokesh Rajendran"
11 | },
12 | "license": "MIT",
13 | "dependencies": {
14 | "@fabiospampinato/store": "^1.10.0",
15 | "boxen": "^4.2.0",
16 | "chalk": "^4.1.0",
17 | "cli-spinners": "^2.5.0",
18 | "cliui": "^7.0.4",
19 | "handlebars": "^4.7.6",
20 | "himalaya": "^1.1.0",
21 | "html-minifier": "^4.0.0",
22 | "html-parse-stringify": "^2.0.0",
23 | "lodash.isequal": "^4.5.0",
24 | "lodash.throttle": "^4.1.1",
25 | "log-update": "^4.0.0",
26 | "memoize-one": "^5.1.1",
27 | "progress-string": "^1.2.2"
28 | },
29 | "publishConfig": {
30 | "access": "public"
31 | },
32 | "devDependencies": {
33 | "@types/html-minifier": "^4.0.0",
34 | "@types/lodash.isequal": "^4.5.5"
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/src/elements/box.ts:
--------------------------------------------------------------------------------
1 | const boxen = require("boxen");
2 |
3 | export default {
4 | name: "box",
5 | render: (ctx: any, data: any) => {
6 | return boxen(ctx.renderEl(data.children));
7 | },
8 | };
9 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/src/elements/column.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "column",
3 | render: (ctx: any, data: any) => {
4 | // tslint:disable-next-line: prefer-template
5 | return ctx.renderEl(data.children) + "::";
6 | },
7 | };
8 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/src/elements/div.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "div",
3 | render: (ctx, data) => {
4 | return [null, ctx.renderEl(data.children), null].join("\n");
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/src/elements/index.ts:
--------------------------------------------------------------------------------
1 | export { default as column } from "./column";
2 | export { default as div } from "./div";
3 | export { default as newline } from "./newline";
4 | export { default as row } from "./row";
5 | export { default as space } from "./space";
6 | export { default as span } from "./span";
7 | export { default as text } from "./text";
8 | export { default as spinner } from "./spinner";
9 | export { default as progress } from "./progress";
10 | export { default as unknown } from "./unknown";
11 | export { default as box } from "./box";
12 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/src/elements/newline.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "newline",
3 | render: () => "\n",
4 | };
5 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/src/elements/progress.ts:
--------------------------------------------------------------------------------
1 | import progressString from "progress-string";
2 |
3 | export default {
4 | name: "progress",
5 | render: (_, data: any) => {
6 | const score = data.attributes.find((a: any) => a.key === "score")?.value;
7 | return progressString({
8 | width: 30,
9 | total: 100,
10 | style: (complete, incomplete) => {
11 | return `[${"▓".repeat(
12 | complete.length,
13 | )}${"░".repeat(incomplete.length)}]`;
14 | },
15 | })(Number(score));
16 | },
17 | };
18 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/src/elements/row.ts:
--------------------------------------------------------------------------------
1 | const cliui = require("cliui");
2 | import { flatten } from "../utils";
3 |
4 | export default {
5 | name: "row",
6 | render: (ctx: any, data: any) => {
7 | const ui = cliui();
8 | const str = ctx
9 | .renderEl(data.children.filter((c: any) => c.tagName === "column"))
10 | .trim();
11 |
12 | const border = ctx.props.border !== undefined;
13 |
14 | ui.div(
15 | ...flatten(str.split("::"))
16 | .filter((x: any) => x)
17 | .map((text: any) => ({ text, border })),
18 | );
19 | return ui.toString();
20 | },
21 | };
22 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/src/elements/space.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "space",
3 | render: (ctx: any, data: any) => {
4 | const defaultProps = {
5 | length: "1",
6 | };
7 |
8 | const props = { ...defaultProps, ...ctx.props };
9 | return `${" ".repeat(Number(props.length))}`;
10 | },
11 | };
12 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/src/elements/span.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "span",
3 | render: (ctx: any, data: any) => {
4 | return ctx.renderEl(data.children);
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/src/elements/spinner.ts:
--------------------------------------------------------------------------------
1 | import cliSpinners from "cli-spinners";
2 | export default {
3 | name: "spinner",
4 | init: ({ store, props, timer }) => {
5 | const { type = "dots" } = props;
6 | const { interval } = cliSpinners[type];
7 | if (!store.spinner) store.spinner = {};
8 | if (!store.spinner[type]) store.spinner[type] = 0;
9 | timer(
10 | () => {
11 | store.spinner[type] += 1;
12 | },
13 | interval,
14 | type,
15 | );
16 | },
17 | render: ({ store, props }) => {
18 | const { type = "dots" } = props;
19 | const { frames } = cliSpinners[type];
20 | return `${frames[store.spinner[type] % frames.length]}`;
21 | },
22 | };
23 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/src/elements/text.ts:
--------------------------------------------------------------------------------
1 | import chalk from "chalk";
2 |
3 | export default {
4 | name: "text",
5 | render: (ctx, data) => {
6 | const defaultProps = {
7 | pl: "0",
8 | pr: "0",
9 | color: "",
10 | bg: "",
11 | dim: undefined,
12 | italic: undefined,
13 | strikethrough: undefined,
14 | bold: undefined,
15 | underline: undefined,
16 | };
17 |
18 | const props = { ...defaultProps, ...ctx.props };
19 |
20 | const textData = data.content ? data.content : ctx.renderEl(data.children);
21 | let style = chalk;
22 | if (props.color) style = style[props.color];
23 | ["bold", "underline", "italic", "strikethrough"].forEach((type) => {
24 | if (props[type] === null) style = style[type];
25 | });
26 |
27 | return style(textData);
28 | },
29 | };
30 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/src/elements/unknown.ts:
--------------------------------------------------------------------------------
1 | export default {
2 | name: "unknown",
3 | render: (ctx) => {
4 | return `Element ${ctx.tagName} is unknown`;
5 | },
6 | };
7 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/src/utils.ts:
--------------------------------------------------------------------------------
1 | const flatten = (arr) => {
2 | return arr.reduce((acc, val) => acc.concat(val), []);
3 | };
4 |
5 | const flattenToStr = (arr: any[]) => {
6 | return arr.reduce((acc: any[], val: any) => {
7 | if (Array.isArray(val)) acc.push(flattenToStr(val).join(" "));
8 | else acc.push(val);
9 | return acc;
10 | }, []);
11 | };
12 |
13 | export { flatten, flattenToStr };
14 |
--------------------------------------------------------------------------------
/packages/misc/artist-ui/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2017",
4 | "module": "commonjs",
5 | "allowJs": false,
6 | "declaration": true,
7 | "declarationMap": true,
8 | "sourceMap": false,
9 | "outDir": "./dist",
10 | "removeComments": true,
11 | "noEmit": false,
12 | "importHelpers": false,
13 | "moduleResolution": "node",
14 | "allowSyntheticDefaultImports": true,
15 | "esModuleInterop": true
16 | },
17 | "exclude": ["node_modules", "__tests__"],
18 | "compileOnSave": false
19 | }
20 |
--------------------------------------------------------------------------------
/packages/misc/captain/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Change Log
2 |
3 | All notable changes to this project will be documented in this file.
4 | See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5 |
6 | # [1.0.0-beta.18](https://github.com/lokesh-coder/lesyjs/compare/v1.0.0-beta.17...v1.0.0-beta.18) (2021-05-03)
7 |
8 | **Note:** Version bump only for package @lesy/captain
9 |
10 |
11 |
12 |
13 |
14 | # [1.0.0-beta.17](https://github.com/lokesh-coder/lesyjs/compare/v1.0.0-beta.16...v1.0.0-beta.17) (2021-04-29)
15 |
16 | **Note:** Version bump only for package @lesy/captain
17 |
18 |
19 |
20 |
21 |
22 | # [1.0.0-beta.16](https://github.com/lokesh-coder/lesyjs/compare/v1.0.0-beta.15...v1.0.0-beta.16) (2021-04-27)
23 |
24 |
25 | ### Features
26 |
27 | * **captain:** pilot desktop version ([5ca0339](https://github.com/lokesh-coder/lesyjs/commit/5ca0339f047d46d8580d30b3c904a876f04962a0))
28 |
--------------------------------------------------------------------------------
/packages/misc/captain/index.js:
--------------------------------------------------------------------------------
1 | function pilot() {
2 | const lesy = require("@lesy/compiler");
3 | const path = require("path");
4 |
5 | return lesy({
6 | root: path.resolve(__dirname, "./"),
7 | commands: [{ run: () => console.log("hello") }],
8 | plugins: ["@lesy/lesy-plugin-pilot"],
9 | }).parse(["pilot"]);
10 | }
11 |
12 | module.exports = pilot;
13 |
--------------------------------------------------------------------------------
/packages/misc/pilot-ui/.browserslistrc:
--------------------------------------------------------------------------------
1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 |
5 | # You can see what browsers were selected by your queries by running:
6 | # npx browserslist
7 |
8 | > 0.5%
9 | last 2 versions
10 | Firefox ESR
11 | not dead
12 | not IE 9-11 # For IE 9-11 support, remove 'not'.
--------------------------------------------------------------------------------
/packages/misc/pilot-ui/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/packages/misc/pilot-ui/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 | # Only exists if Bazel was run
8 | /bazel-out
9 |
10 | # dependencies
11 | /node_modules
12 |
13 | # profiling files
14 | chrome-profiler-events.json
15 | speed-measure-plugin.json
16 |
17 | # IDEs and editors
18 | /.idea
19 | .project
20 | .classpath
21 | .c9/
22 | *.launch
23 | .settings/
24 | *.sublime-workspace
25 |
26 | # IDE - VSCode
27 | .vscode/*
28 | !.vscode/settings.json
29 | !.vscode/tasks.json
30 | !.vscode/launch.json
31 | !.vscode/extensions.json
32 | .history/*
33 |
34 | # misc
35 | /.sass-cache
36 | /connect.lock
37 | /coverage
38 | /libpeerconnection.log
39 | npm-debug.log
40 | yarn-error.log
41 | testem.log
42 | /typings
43 |
44 | # System Files
45 | .DS_Store
46 | Thumbs.db
47 |
--------------------------------------------------------------------------------
/packages/misc/pilot-ui/README.md:
--------------------------------------------------------------------------------
1 | # @lesy/lesy-pilot-ui
2 |
--------------------------------------------------------------------------------
/packages/misc/pilot-ui/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, './coverage/web'),
20 | reports: ['html', 'lcovonly', 'text-summary'],
21 | fixWebpackSourcePaths: true
22 | },
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false,
30 | restartOnFileChange: true
31 | });
32 | };
33 |
--------------------------------------------------------------------------------
/packages/misc/pilot-ui/setup/config-store.js:
--------------------------------------------------------------------------------
1 | const Configstore = require("configstore");
2 | const config = new Configstore("lesy-pilot-ui", {});
3 | module.exports = config;
4 |
--------------------------------------------------------------------------------
/packages/misc/pilot-ui/setup/socket.js:
--------------------------------------------------------------------------------
1 | const config = require("./config-store");
2 | let argh = require("argh");
3 |
4 | let values = process.argv.slice(2);
5 | argh = argh(values[1].split(" "));
6 |
7 | if (argh.sport) {
8 | config.set("sport", argh.sport);
9 | console.log("using sport from cache");
10 | }
11 |
12 | if (argh.shost) {
13 | config.set("shost", argh.shost);
14 | console.log("using shost from cache");
15 | }
16 |
17 | if (!argh.sport && !config.has("sport")) {
18 | throw new Error("Please specify --sport");
19 | }
20 |
21 | if (!argh.shost && !config.has("shost")) {
22 | throw new Error("Please specify --shost");
23 | }
24 |
--------------------------------------------------------------------------------
/packages/misc/pilot-ui/src/app/components/header/header.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from "@angular/core";
2 | import { Select } from "@ngxs/store";
3 | import { Observable } from "rxjs";
4 |
5 | @Component({
6 | selector: "pilot-header",
7 | templateUrl: "./header.template.html",
8 | })
9 | export class HeaderComponent implements OnInit {
10 | menuItems = [];
11 | @Select((state) => state.common.config)
12 | webConfig$: Observable