Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ember-freestyle

chrislopresto35.3kMIT0.22.0TypeScript support: included

Create a living styleguide for your Ember app.

ember-addon

readme

Ember Freestyle

Build Status

NPM Version Download Count All Time Ember Observer Score

All Contributors

Ember Freestyle is an Ember addon that allows you to quickly create a component explorer for your Ember app.

Documentation

This README provides a lightweight overview of Ember Freestyle to get you going. More complete documentation can be found at https://chrislopresto.github.io/ember-freestyle.

Live Demo

To see Ember Freestyle in action, visit https://chrislopresto.github.io/ember-freestyle/#/acceptance.

Compatibility

  • Ember.js v3.24 or above
  • Ember CLI v3.24 or above
  • Node.js v18 or above
  • Ember Auto Import v2 or above

ember-freestyle includes TypeScript types, and provides a template registry that can be imported from ember-freestyle/template-registry for Glint usage.

Installation

This installation process is opinionated in order to get you going quickly.

  1. ember install ember-freestyle

    This will do the following:

    • Install the ember-freestyle addon itself
    • Add a freestyle template in your app
    • Add a freestyle controller in your app
  2. Add this.route('freestyle'); to your app/router.js file

  3. Navigate to /freestyle. You should now see something like:

All of the generated output is optional. If you don't want a freestyle route, for example, feel free to get rid of it and add a freestyle-guide somewhere else in your app.

You can use the freestyle-guide component anywhere you'd like in your app. You can organize your components into multiple Freestyle guides if you want to. You can even use the constituent components like freestyle-usage on their own.

Problems? No problem.

Hopefully the installation instructions got you off to a smooth, seamless start. If you have any problems, feel free to chat with us in the Ember Community Discord or open an issue. As always, PRs are welcome!

Excluding Ember Freestyle's Styles

If you want to exclude Ember Freestyle's styles, you can set the includeStyles option to false in your ember-cli-build.js file:

// ember-cli-build.js

module.exports = function (defaults) {
  const app = new EmberApp(defaults, {
    'ember-freestyle': {
      includeStyles: false,
    },
  };
};

This might be useful in case you want to define your own styles or if you are using ember-cli-sass and want to import Ember Freestyle's styles explicitly:

$FreestyleGuide-color--primary: #C70039;
$FreestyleGuide-color--accent: #DAF7A6;

@import 'ember-freestyle';

Excluding Ember Freestyle from Your Production Build

We recommend excluding Ember Freestyle from production builds using Ember CLI's addons.exclude option.

// ember-cli-build.js

const environment = process.env.EMBER_ENV;
const addonsToExclude = environment === 'production' ? ['ember-freestyle'] : [];

module.exports = function (defaults) {
  const app = new EmberApp(defaults, {
    addons: {
      exclude: addonsToExclude,
    },
  };
};

Using Ember Freestyle Within an Addon

You should include ember-freestyle in your devDependencies so that apps using your addon will not include Ember Freestyle CSS and JavaScript in their production builds.

In V2 addons

You will need to configure babel to run ember-freestyle's AST Transform in order to capture source code from Freestyle::Usage example blocks. For example:

// babel.config.mjs
import FreestyleTransform from 'ember-freestyle/lib/ast-transform.js';

export default {
  plugins: [
    // ...
    [
      'babel-plugin-ember-template-compilation',
      {
        targetFormat: 'hbs',
        transforms: [FreestyleTransform],
      },
    ],
    // ...
  ],
};

Contributing

See the Contributing guide for details.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Chris LoPresto

💻 📖 ⚠️

Luke Melia

💻 📖 ⚠️

Andrew Fan

💻

Chris van der Ploeg

💻 📖

Ilya Radchenko

💻 📖

Mike Szörnyi

💻 📖

miguel barcos

⚠️

Nathan Ward

💻 📖

zidjian257

💻 ⚠️

Eli Dupuis

💻

Peter Wagenet

💻

Sivakumar Kailasam

💻

Manuel Wiedenmann

💻

Lucas Hill

💻

Alex Zlotnik

💻

Tamzin Blake

💻

Simon Ihmig

📖

Ryan Tablada

💻

Kerrick Long

💻

Hajdukovic Radovan

💻 📖

Rob

💻

Gijs Boddeus

💻

Sarah Canieso

💻

Brian Runnells

💻

Dan Wenzel

💻 ⚠️

Camille TJHOA

💻 📖

Michael Swanson

⚠️

Sam Van Campenhout

📖

Chris Krycho

💻

Will Bagby

💻 ⚠️

Noah

💻

Stanley Stuart

💻

Matt McManus

💻

Suzi Dao

💻 ⚠️

Ray Tiley

💻

lucasmerat

💻

Kit

💻

Andrey Mikhaylov (lolmaus)

🐛 💻

Bert De Block

💻 🤔

This project follows the all-contributors specification. Contributions of any kind are welcome!

License

This project is licensed under the MIT License.

changelog

Changelog

All notable changes to this project will be documented in this file.

v0.22.0 (2025-03-18)

v0.21.0 (2024-09-27)

:boom: Breaking Change

:rocket: Enhancement

:bug: Bug Fix

:house: Internal

Committers: 3

v0.20.0 (2023-10-07)

:rocket: Enhancement

  • #973 Eliminate uppercase'ing of menu items and update menu item hover state (@lukemelia)

Committers: 1

v0.19.0 (2023-09-28)

:boom: Breaking Change

:rocket: Enhancement

  • #963 Add an Api type to Freestyle::Usage for when you expect a component as argument (@lukemelia)

:bug: Bug Fix

Committers: 2

v0.18.0 (2023-07-18)

:rocket: Enhancement

:bug: Bug Fix

:house: Internal

Committers: 2

v0.17.0 (2022-10-18)

:rocket: Enhancement

Committers: 1

:rocket: Enhancement

Committers: 1

v0.16.0-beta.0 (2022-09-22)

:boom: Breaking Change

Committers: 1

v0.15.0 (2022-09-14)

:rocket: Enhancement

:bug: Bug Fix

:memo: Documentation

:house: Internal

Committers: 3

0.14.0 (2022-03-11)

⚠ BREAKING CHANGES

  • remove freestyle-showdown-content component
  • update ember-modifier to v3
  • update to Ember v4.2

  • remove freestyle-showdown-content component (5956a9e)

  • update ember-modifier to v3 (700eb07)
  • update to Ember v4.2 (f6646a2)

0.13.2 (2021-11-21)

0.13.1 (2021-11-21)

This release didn't make it to npm. 0.13.2 has the same stuff.

Features

  • remove dependency on ember-cli-sass and sass (5482db1)

Bug Fixes

0.13.0 (2021-10-29)

⚠ BREAKING CHANGES

  • remove the use of ember-json-viewer
  • drop support for Node v10

Features

  • deprecate <FreestyleShowdownContent /> component (78f2568)

Bug Fixes

  • fix generated id for freestyle-dynamic-input component (942c901)
  • import computed.or directly (ecb6811)
  • import htmlSafe from @ember/template (57ea33f)
  • make AST plugin functional (87f521c)
  • resolve deprecations related to built-in component events (a4d07c6)
  • drop support for Node v10 (2add9c7)
  • remove the use of ember-json-viewer (023f559)

0.12.11 (2021-03-23)

Bug Fixes

  • Move glimmer/tracker to the deps list since (3a39dc6)
  • rendering a color palette (336af81)

0.12.10 (2021-03-17)

Bug Fixes

0.12.9 (2021-03-12)

Bug Fixes

  • @ember/render-modifiers must be a normal dependency (4bacc17)

0.12.8 (2021-03-03)

Features

0.12.7 (2021-02-26)

Bug Fixes

  • Only avoid preprocessing ember-freestyle's templates not the templates of an addon that depends on it (8b3df73)

0.12.6 (2021-02-25)

Bug Fixes

0.12.5 (2021-02-24)

0.12.4 (2021-02-17)

Bug Fixes

  • Improve handling of named-blocks-polyfill mangled hbs (c456bff)

0.12.3 (2021-02-04)

Bug Fixes

0.12.2 (2021-02-04)

Features

Bug Fixes

  • Don't run AST transform on freestyle itself, just on it's parent app/addon (e086fbf)
  • Support for nested addon (93c6183)

0.12.1 (2020-09-22)

0.12.0 (2020-05-21)

⚠ BREAKING CHANGES

  • Remove support for freestyle-note

  • A stub component has been left to throw an error which points the documentation

  • test: Update test matrix support to ember 3.12 and 3.16

  • Preserve formatting for <FreestyleUsage> source blocks in AST transform

  • also moved unindenting to the AST plugin rather than in-browser

  • style: Improve documentation site styles

  • chore: removed unused import

Co-authored-by: Luke Melia luke@lukemelia.com

Features

  • Support Freestyle Usage|Note angle bracket component invoc… (#300) (61b668c)
  • BREAKING CHANGE: Switch to AST transform for freestyle-usage source preview, drop support for comment-delineated snippets, remove freestyle-notes component (#357) (5cc6f42), closes #357

0.11.10 (2020-04-03)

0.11.9 (2019-10-07)

0.11.8 (2019-10-06)

Bug Fixes

  • Remove jQuery usage and update project dependencies (#238) (f77ba52)

0.11.7 (2019-10-06)

0.11.6 (2019-10-06)

0.11.5 (2019-10-06)

Features

0.11.4 (2019-10-06)

0.11.3 (2019-10-06)

Bug Fixes

  • Remove computed property override deprecation (#198) (71b8b64)

0.11.2 (2019-10-06)

0.11.1 (2019-10-06)

0.11.0 (2019-10-06)

Features

  • Update ember-cli-sass to use Dart Sass. 191

0.10.0 (2018-11-07)

Bug Fixes

  • Don't include blank lines when determining how much to unindent 181 (danwenzel)

Features

0.9.0 (2018-09-10)

Bug Fixes

Features

0.8.1 (2018-03-01)

Bug Fixes

0.8.0 (2018-02-27)

Bug Fixes

Features

0.7.0 (2018-02-20)

Features

0.6.2 (2017-11-01)

Bug Fixes

Features

0.6.1 (2017-07-14)

Features

0.6.0 (2017-07-09)

Features

0.5.0 (2017-07-09)

Features

0.4.2 (2017-07-01)

Bug Fixes

Features

0.4.1 (2017-05-03)

Bug Fixes

0.4.0 (2017-05-03)

Features

0.3.0 (2017-05-03)

Bug Fixes

Features

0.2.14 (2017-02-24)

Bug Fixes

  • Fix 'calling set on destroyed object' error 97 (tamzinblake)
  • Fix(freestyle-menu): Reset f queryParam in menu 83 (fsmanuel)
  • Fix snippet language detection 76 (wagenet)

Features

0.2.13 (2016-08-16)

Bug Fixes

Features

  • Removes quotes to enable fontFamily on freestyle-typeface component 140 (wagenet)
  • Return false for isDevelopingAddon 74 (elidupuis)
  • Move rendered component next to its corresponding code snippet 70 (vine77)
  • Add some better test coverage before refactoring. 66 (migbar)

0.2.12 (2016-05-24)

Bug Fixes

  • Fix Menu When Page Loaded While Section or Subsection Focused 60 (chrislopresto)

Features

0.2.11 (2016-05-20)

Features

0.2.10 (2016-04-20)

Features

0.2.9 (2016-04-08)

Features

0.2.8 (2016-04-07)

Features

0.2.7 (2016-03-30)

Features

0.2.6 (2016-03-03)

0.2.5 (2016-03-03)

0.2.4 (2016-03-03)

0.2.3 (2016-03-03)

Features

0.2.2 (2016-02-29)

Bug Fixes

  • add missing ember-truth-helpers dependency 5 (andrewfan)

Features

0.2.1 (2016-02-22)

Features

0.2.0 (2016-02-22)

Features

0.1.1 (2016-02-21)

Features

0.1.0 (2016-02-14)

Features