Ember CLI TypeScript Blueprint Polyfill

0.1.0 · abandoned · verified Sun Apr 19

This package `ember-cli-typescript-blueprint-polyfill` provides a utility function to enable TypeScript blueprint functionality in Ember applications and addons running on older versions of Ember CLI that predate native support for TypeScript blueprints. Its current stable version is 0.1.0, suggesting it reached its intended feature set early and is not actively developed for new capabilities. The package essentially polyfills RFC 0776, allowing `*.ts` files within a blueprint's `files` directory to be transformed into JavaScript during blueprint generation. It is primarily differentiated by its purpose of bridging this compatibility gap for legacy Ember CLI environments, as modern Ember CLI (typically v4.x and newer, following RFC 0776's merger in December 2021) includes this functionality natively. Consequently, this polyfill is largely redundant for new projects or those on recent Ember CLI versions, making its utility specific to maintaining older Ember ecosystems. Its release cadence is effectively stable, with no new versions anticipated given the widespread native support now available in the target environment.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to integrate the `typescriptBlueprintPolyfill` into an Ember CLI blueprint's `index.js` file, enabling TypeScript file transformation for that blueprint. This example configures the blueprint to process `.ts` files and ensures the polyfill is initialized correctly within the `init` hook.

// my-app/blueprints/foo/index.js
const typescriptBlueprintPolyfill = require('ember-cli-typescript-blueprint-polyfill');

module.exports = {
  // Required flag to indicate that the blueprint contains TypeScript files
  shouldTransformTypeScript: true,

  init() {
    // Ensure the super class's init method is called if it exists
    this._super && this._super.init.apply(this, arguments);
    // Call the polyfill with 'this' (the blueprint instance) as the argument
    typescriptBlueprintPolyfill(this);
  },

  // Other blueprint methods like locals, fileMapTokens, etc.
  // ...
};

view raw JSON →