/embroider-template

Monorepo for an example Ember v4.0+ addon implementation using the Embroider Build System

Primary LanguageCSSOtherNOASSERTION

Embroider Template


Ember 4.0+ and Embroider template repository
Built as part of the Twy'r effort by Vish Desai and contributors

TABLE OF CONTENTS

ABOUT

This is a monorepo used as a template for creating Ember addons using Embroider in the V2 format. It consists of two packages - the Basic Addon itself, and an Ember App for testing, debugging, documenting, and showcasing the addon.

STATUS

Category Status
Conventions Conventional Commits Commitizen friendly code style: prettier Contributor Covenant
Code Stats Languages GitHub repo size LoC Language grade Coverage Status
Security Known Vulnerabilities Total alerts Libraries.io dependency status for latest release, scoped npm package
Development GitHub commit activity GitHub last commit
Issues & PRs GitHub open issues GitHub closed issues GitHub open prs GitHub closed prs
Release Status GitHub package.json version GitHub tag (latest SemVer) GitHub release (latest SemVer)
Publish Status node-current npm bundle size npm

WHY

The Embroider build system gets default configurations for addons from two different places:

  1. The options from the "main" / "build" file specified in the addon's Ember Package Metadata
  2. The config() function from the same "main" / "build" file

At App build time,these addon configurations are processed as:

  1. The options object - merged with the @embroider/macros key specified in the "ember-cli-build.js" file of the app
  2. The config() return value - merged with the config/environment.js file of the app

The merged configs are accessible / usable in diffferent places:

  1. The merged options object is available in the @embroider/macros artifacts - getConfig, getOwnConfig, etc.
  2. The merged config() return value is available in the "contentFor" hooks

This monorepo provides an extremely trivial implementation of an addon / test-app pair that reads / uses a common configuration file called dual-build-config.js.

GOALS

Ember-related goals:

  1. Build for Ember 4.0+ - with no expectation of backward compatibility
  2. Build using Embroider - aim for "Native Support"

Addon goals::Showcase how to effectively integrate with / consume the Embroider build system artifacts:

  1. Use the contentFor hooks to conditionally inject HTML at build time - based on config defined in {{app}}/config/environment.js
  2. Use the @embroider/macros capabilities to conditionally include/exclude artifacts - based on config defined in {{app}}/ember-cli-build.js

Developer Experience Goals::Provide a monorepo to be used as a template / jump-off point:

  1. Should be trivial to clone / install / build / run and see how the classical / embroider build systems interact
  2. Should be trivial to remove the artifacts exported by the example addon and add new ones
  3. Should be trivial to use the new artifacts in the example app

CONTRIBUTING

Code of Conduct

All contributors to this project are expected to adhere to the Code of Conduct specified.

Developing

Details on getting the code, setting up the development environment, and instructions on how to extend/build/test the code are detailed in the Contribution Guide

Contributors

All Contributors

This project owes its existence to these wonderful people (emoji key):


Vish Desai

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

LICENSE

This project is licensed under the MIT +no-false-attribs license. You may get a copy of the license by following the link, or at LICENSE.md