npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

buttered-ember

v0.5.0

Published

All the power of EmberJS, itty bitty living space

Downloads

8

Readme

buttered-ember

This is a fork of bottled-ember, a CLI tool for bootstrapping ember projects without all the boilerplate.

Usage

npx buttered-ember ./your-files

This will merge ./your-files into the backing app, allowing you to focus on just your own work, without being bogged down by the boilerplate of linting, package management, etc.

This can pair well with documentation generation. For example:

npx buttered-ember ./docs

Where ./docs could be a collection of markdown files. Ember doesn't natively support markdown-to-html conversion, but other dependencies can handle this.

To keep the management of "dependencies" minimal, a configuration file may be defined,

# yaml
# -> all properties are optional
#
# could be any npm dependency
# - this provides markdown to html conversion
# - default routing, templates, etc
template: '@my-scope/my-template'
dependencies:
  'highlight.js': '^11.0.0'

Templates

Templates are special folders that are applied like the "local files" that an end-user would be working with. An example use case could be a markdown-only project, but you want a common design / theme for all documentation sites published.

Unlike a v1 addon with aggressive app-re-exports, templates may provide top-level files, outside the app folder.

The "template root" is layered on top of the project root, so you can augment more than just the app folder.

For example:

.
├── package.json
└── template/
    ├── app/
    │   ├── router.js
    │   └── templates/
    │       └── application.hbs
    ├── docs/
    │   └── welcome.md
    ├── ember-cli-build.js
    └── .docfy.config.js

The advantage of this template folder is that is that it may be authored along side an addon or app so that the template itself can be automatedly tested.

Note that nothing outside the template folder is considered part of the template. So in the event you need to add dependencies as a part of your template, you'll want another package.json within the template folder.

Config

This uses cosmiconfig, so the following config formats are suppored:

  • "buttered-ember" entry in package.json
  • .buttered-emberrc.json
  • .buttered-emberrc.yaml
  • .buttered-emberrc.yml
  • .buttered-emberrc.js
  • .buttered-emberrc.cjs
  • or any of the above in a ./config/ directory
  • buttered-ember.config.js
  • buttered-ember.config.cjs

Live-reload (wip)

NOTE: this is not yet tested, and likely broken the goal here is that, even with markdown only projects, we should have live reload.

By default, the whole target directory will be watched for changes. If You need to work with the app or tests directories, those will also be wired up for you, but in the event you need a custom ember-cli-build.js, you can import a utility function and use the same watching logic:

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const { watchTrees } = require('buttered-ember');

module.exports = function (defaults) {
  const app = new EmberApp(defaults);

  const { Webpack } = require('@embroider/webpack');
  return require('@embroider/compat').compatBuild(app, Webpack, {
    extraPublicTrees: [watchTrees()],
    staticAddonTestSupportTrees: true,
    staticAddonTrees: true,
    staticHelpers: true,
    staticModifiers: true,
    staticComponents: true,
  });
};

Contributing

Testing

The test suite is split in to two test projects, a "regular" one, and one with "slow" tests.

These can each be ran via:

pnpm test # regular tests
pnpm test:slow # slow tests

The slow tests are more "end-to-end" focused, and run on full apps. When prefixing the test command with VERBOSE=true, the command to run in what directory run in will be printed before the test runs.

Example

VERBOSE=true pnpm test:slow


Running on fixture:

	node <repo>/src/bin.js test

In <repo>/tests/fixtures/docfy-classic-build

So for this test, we'd cd to /tests/fixtures/docfy-classic-build and run node ../../../src/bin.js test (or use the absolute path to the bin like the output says)