From 8f30754bcce8ac909e4bbd3e73de4b3b0238c89c Mon Sep 17 00:00:00 2001 From: Geoff Doty Date: Sat, 29 Mar 2025 10:58:57 -0400 Subject: [PATCH] first pass at meta data --- .gitignore | 32 +++++++++++++++++++ CONTRIBUTING.md | 70 ++++++++++++++++++++++++++++++++++++++++++ LICENSE | 19 ++++++++++++ README.md | 78 +++++++++++++++++++++++++++++++++++++++++++++++ jsconfig.json | 28 +++++++++++++++++ package.json | 12 ++++++++ test/mite.test.js | 6 ++++ 7 files changed, 245 insertions(+) create mode 100644 .gitignore create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 jsconfig.json create mode 100644 package.json create mode 100644 test/mite.test.js 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 + +
+ +
+ + +``` + +Any tag property that starts with a `@` is an event, so you can do `@click=""`; + + +## Test + +**WIP** + +`bun test` + +> Currently [Bun]() is used as the development runtime + + +## Support + +Please open [an issue](https://github.com/n2geoff/mite/issues/new) for support. + +## Contributing + +Anyone is welcome to contribute, however, if you decide to get involved, please take a moment to review the [guidelines](CONTRIBUTING.md), they're minimalistic;) + +## License + +[MIT](LICENSE) + +--- +*Last updated: March 29, 2025* \ No newline at end of file diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..9c62f74 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + // Environment setup & latest features + "lib": ["ESNext"], + "target": "ESNext", + "module": "ESNext", + "moduleDetection": "force", + "jsx": "react-jsx", + "allowJs": true, + + // Bundler mode + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "noEmit": true, + + // Best practices + "strict": true, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedIndexedAccess": true, + + // Some stricter flags (disabled by default) + "noUnusedLocals": false, + "noUnusedParameters": false, + "noPropertyAccessFromIndexSignature": false + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..b421011 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "mite", + "description": "", + "version": "1.0.0", + "module": "src/Mite.js", + "type": "module", + "scripts": { + "build": "bun build ./src/Mite.js --outdir ./dist --target browser" + }, + "devDependencies": {}, + "peerDependencies": {} +} \ No newline at end of file diff --git a/test/mite.test.js b/test/mite.test.js new file mode 100644 index 0000000..806f411 --- /dev/null +++ b/test/mite.test.js @@ -0,0 +1,6 @@ +import { expect, test } from "bun:test"; +import { Mite } from "../src/Mite.js"; + +test("Mite Exists", () => { + expect(typeof Mite).toBe("function"); +});