Skip to content

Commit

Permalink
Update readme and license of base package
Browse files Browse the repository at this point in the history
  • Loading branch information
bennothommo committed Sep 26, 2023
1 parent 1c3fa6d commit 2ab8ace
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 1 deletion.
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
# Snowboard.js Framework

Standalone version of the [Winter CMS](https://wintercms.com) JavaScript framework that provides a simple but powerful system for organising and controlling your frontend functionality.
Standalone version of the [Winter CMS](https://wintercms.com) JavaScript framework that provides a simple yet powerful system for organising and controlling your frontend functionality. The main aims of the framework are to provide a familiar development experience for people using the Winter or Laravel PHP frameworks to develop functionality for their frontend interfaces.

This repository is a mono-repo of the core Snowboard framework and various packages that can be optionally implemented depending on the needs of your application.

## Packages

Package | NPM | Readme | Description
------- | --- | ------ | -----------
Base | [@wintercms/snowboard](https://www.npmjs.com/package/@wintercms/snowboard) | [Readme](https://github.com/wintercms/snowboard.js/blob/main/packages/base/README.md) | The core Snowboard framework functionality and utilities.
Reactivity | [@wintercms/snowboard-reactivity](https://www.npmjs.com/package/@wintercms/snowboard-reactivity) | [Readme](https://github.com/wintercms/snowboard.js/blob/main/packages/reactivity/README.md) | Adds reactivity and templating features to Snowboard.

## Getting in touch

You can get in touch with the maintainer team using the following mediums:

* [Follow us on Twitter](https://twitter.com/usewintercms) for announcements and updates.
* [Join us on Discord](https://discord.gg/D5MFSPH6Ux) to chat with us.

## Contributing

Before contributing issues or pull requests, be sure to review the [Contributing Guidelines](https://github.com/wintercms/.github/blob/master/CONTRIBUTING.md) first.

### Coding standards

This repository enforces the [Airbnb JavaScript Style](https://github.com/airbnb/javascript) through [ESLint](https://eslint.org/) and [Husky](https://github.com/typicode/husky). Automatic linting will occur when committing to the repository, and commits which do not meet the standard will be rejected.

### Code of conduct

In order to ensure that the Winter community is welcoming to all, please review and abide by the [Code of Conduct](https://github.com/wintercms/.github/blob/master/CODE_OF_CONDUCT.md).

## License

The Snowboard framework, as with the Winter platform itself, is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

## Security vulnerabilities

Please review [our security policy](https://github.com/wintercms/snowboard.js/security/policy) on how to report security vulnerabilities.
7 changes: 7 additions & 0 deletions packages/base/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2023 Winter CMS Maintainers (https://wintercms.com)

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.
95 changes: 95 additions & 0 deletions packages/base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Snowboard.js Base

Standalone version of the [Winter CMS](https://wintercms.com) JavaScript framework that provides a simple yet powerful system for organising and controlling your frontend functionality. The main aims of the framework are to provide a familiar development experience for people using the Winter or Laravel PHP frameworks to develop functionality for their frontend interfaces.

## Features

- Structured development experience using ES6 classes, with support for abstract classes, traits and extensions.
- Flexible plugin architecture with support for reusable plugins and singletons.
- Simple state and events management, operating across the entire app.
- Lightweight, only ~51kb minified, with minimal dependencies.
- Can be used directly with a `<script>` tag or through a build process (Webpack, Rollup, Laravel Mix, etc.).

## Installation

### Via a script tag

This framework can be included directly in your app through a `<script>` tag. Download the [latest release](https://github.com/wintercms/snowboard.js/releases) in the **Assets** tab and place it somewhere web-accessible, then include it in your page (generally just above the closing `</body>` tag).

```html
<script src="https://my.app.com/snowboard.min.js"></script>
```

This will autoload the Snowboard framework and make it available globally via the `Snowboard` variable. This allows you to add any plugins or extended functionality by simply loading in some JavaScript after the Snowboard script tag.

```html
<script>
Snowboard.addPlugin('myPlugin', MyPlugin);
Snowboard.on('ready', () => {
console.log('Snowboard is ready to go!');
});
</script>
```

### Via ES6 import

If you are using a build process such as Webpack, Rollup, Laravel Mix, etc, you can also set up your app to import Snowboard and create an app ready for use.

Your project must be enabled with NPM, (ie. it should have a `package.json` file), then you can simply include Snowboard as a dependency:

```bash
npm i -S @wintercms/snowboard
```

Then, in your entrypoint script, create the application:

```js
import { Snowboard } from '@wintercms/snowboard';
import MyPlugin from './plugins/MyPlugin';

const app = new Snowboard();
app.addPlugin('myPlugin', MyPlugin);
app.on('ready', () => {
console.log('Snowboard is ready to go!');
});

export default app;
```

## Documentation

Please see the [Snowboard documentation](https://wintercms.com/docs/v1.2/docs/snowboard/introduction) on Winter CMS.

## What's included

By default, the Base Snowboard package comes included with the following:

### Abstracts

- **PluginBase** - The base class used for all Snowboard plugins.
- **Singleton** - The base class used for all Snowboard singletons.

### Traits

- **Configurable** - Allows a plugin to derive configuration from data attributes and get and set configuration on the fly.
- **FiresEvents** - Provides the plugin with the ability to fire local and global JavaScript events, and allows outside functionality to listen to events on the plugin instance.

### Utilities

- **AssetLoader** - Allows the loading of CSS, JavaScript and image assets on the fly.
- **Cookie** - Provides a thin wrapper around the [JS Cookie](https://github.com/js-cookie/js-cookie) library to allow management of cookies.
- **JsonParser** - Provides a looser implementation of JSON, based off the [JSON5](https://json5.org/) library that accounts for many human errors with writing compliant JSON.
- **Sanitizer** - Provides sanitization of HTML documents and elements for common XSS vulnerabilities.
- **Url** - Provides URL handling.

## More information

For more information on development and usage of this framework and available packages, please see the main repository: https://github.com/wintercms/snowboard.js

## Security vulnerabilities

Please review [our security policy](https://github.com/wintercms/snowboard.js/security/policy) on how to report security vulnerabilities.

## License

This framework is licensed under the MIT license.

0 comments on commit 2ab8ace

Please sign in to comment.