diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d681cec --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +# temp scrach pads +examples/* +scratch.js + +# manged dependencies +node_modules + +# output +dist +*.tgz + +# code coverage +coverage +*.lcov + +# logs +logs + +# dotenv environment variable files +.env + +# caches +.eslintcache +.cache +*.tsbuildinfo + +# IDEs +.idea +.vscode + +# Finder (MacOS) folder config +.DS_Store diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..989432c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,70 @@ +# Contributing + +So you want to contribute, nice. **Thank you**. + +Bug reports and code and documentation patches are all welcome. You can help this project also by using the development version and by reporting any bugs you might encounter. + +You may contribute in several ways like: + +* Creating new features +* Fixing bugs +* Improving documentation and examples +* Translating any document here to your language + +## Table of contents + +* [Contributing](#contributing) + * [Developing](#developing) + * [Running tests](#running-tests) + * [Reporting a bug](#reporting-a-bug) + * [Request a feature](#request-a-feature) + * [Commit message](#commit-message) + * [Code style](#code-style) + +## Developing + +There is only one main source file in the project. It is the [/src/index.js](/src/Mite.js). +The [test/mite.spec.js](test/mite.test.js) is for now the only unit test file in the project. + +The `dist` includes the minified version of the source code. + +## Running tests + +Run unit tests using this command: + +```bash +bun test +``` + +## Reporting a bug + +Use the [GitHub issue tracker](https://github.com/n2geoff/mite/issues) to report any bug you find. +Bugs description should include: + +* How to reproduce the bug; +* Easy to understand title; + +Would be nice to have some code showing how to reproduce the code, you may use [gist](https://gist.github.com) or [Codepen](https://codepen.io) for uploading your example code. + +## Request a feature + +Use the [GitHub issue tracker](https://github.com/n2geoff/mite/issues) to request a new feature. + +Keep in mind, this is a pure javascript library + +## Commit message + +Commit messages should includes GitHub number reference and a imperative easy to understand sentence. + +## Coding style + +If it is supported in all major browers without transpiling, then please use those JavaScript language features in your code, with one caveat -- readablity is king. + +Currently the JavaScript Target is ES2017. + +This project is linted agaist [ESLint](https://eslint.org/) and the [`.eslintrc.js`](.eslintrc.js) is dead-simple, and all you need to followed. + +Thank you for reading this. + + +Hey, **star** this *repo* and/or share it with your friends. \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..925527c --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2025 Geoff Doty + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..33a365a --- /dev/null +++ b/README.md @@ -0,0 +1,78 @@ +# Mite +> The tiniest framework that *mite* work + +``` + /___\ ___ _ + )O.o( |\/| o | |_ BE small + \_^_/ | | | | |_ be STRONG + " " +``` + +Brainspace is limited, time is limited, ideas are abundant, so enter stage left: **Mite** + +**Mite** is a tiny `import` ui library that was born out of a necessity to rift out prototypes fast, and complement existing HTML/CSS/JS knowledge. The boiler-plate of most conventional frameworks takes longer than actually getting the core MVP of the idea out there. + +**Mite** provides an extendable one-and-done solutions from decorating components to building out single-page-applications -- pure-frontend, and core-web for the win! + +With **Mite** it is just one file and go... + +## Getting Started + +### Key Features +- **Reactive Data Binding**: Bind data to the DOM using `{{ }}` syntax, and Mite will automatically update the DOM when the data changes. +- **Directives**: + - `m-if`: Conditionally show or hide elements based on a truthy/falsy expression. + - `m-each`: Iterate over arrays to render lists dynamically. + - `:`-prefixed attributes (e.g., `:value`): Bind data to element attributes. +- **Event Handling**: Bind events to methods using `@event` syntax (e.g., `@click`). +- **Lightweight**: Mite is a single class with no external dependencies, making it easy to integrate into any project. + +## Usage + +```html + +