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

ember-cli-deploy-chrome-app

v0.4.2

Published

Build and deploy an Ember app as a Chrome app.

Downloads

7

Readme

Ember CLI Deploy Chrome app

Build Status Ember Observer Score

This Ember CLI deploy plugin provides a way to build and deploy an Ember app as a Chrome app.

Installation

Install the plugin by running:

ember install ember-cli-deploy-chrome-app

This will generate a chrome folder and a key.pem file in the root of your project. In chrome you'll find background.js and a default manifest.json that you can change according to your needs. For more information about the manifest see this link.

You can add files and folders from your tmp/deploy-dist to the chrome app by copying or symlinking them in the chrome directory. window.html and the assets folder have already been added as a default. This way you can manage which parts of your Ember app will be added to your chrome app.

Usage

When you run ember deploy, a project_name.zip file will be generated in the chrome folder of the deploy folder. You can upload this file to the Chrome Web Store to publish it.

It is also possible to automatically upload and/or publish your chrome app to the Chrome Web Store by providing the extensionId of your app along with a clientId, clientSecret and a refreshToken for your google account. More details on how to generate those can be found here. The uploaded package will be published in ember-cli-deploy's activate step and is therefor optional.

During development you don't have to deploy your project all the time, you can just go to chrome://extensions with chrome and click 'Load unpacked extension'. Then choose the chrome folder and you'll see the app appear in chrome.

Configuration

You can configure the default behavior in config/deploy.js:

// config/deploy.js
module.exports = function(deployTarget) {
  return {
    'chrome-app': {
      ...
    }
  };
};
  • outputPath By default, the plugin will generate your chrome app in the chrome folder of the deploy folder. This can be changed by changing the outputPath to the desired location.
  • inputPath By default, the chrome app will be generated in the root of your project. If you would like to use a different name or location, you can change the inputPath variable to the desired location.
  • distDir If you want the chrome app to be saved outside of the deployed folder (for example if you don't want to upload it with the normal app) you can change the distDir to the desired location. The final location will be distDir/outputPath.
  • name Can be used to change the name of the generated files. Will default to the name of the package.

Chrome Web Store distributed apps

  • extensionId If you provide an extension id (the id of your app on the Chrome Web Store), the addon will generate a project_name.zip file that can be uploaded to the Chrome Web Store. It will not be added to distFiles.
  • publishTarget During the activate step, the package will be published on the Chrome Web Store. By default it will be published to everyone, but alternatively you can set publishTarget to trustedTesters to publish the package to your test group only.
  • clientId The client id that you can generate on console.developers.google.com
  • clientSecret The client secret that you can generate along with the client id.
  • refreshToken The refresh token that will be used to upload and/or publish your app to the Chrome Web Store. Details on how to generate it can be found here

Self-distributed apps

  • codebase If you provide a codebase url, the plugin will assume that you want to create a self-distributed chrome app. It will generate a signed project_name.crx and a update.xml file. The crx file will be signed with key.pem.
  • keyPath The location of your key, that is used to sign the extension in case of a self-distributed app.
  • updateUrl If you want new versions of the app to be installed automatically, you have to provide the full url to the update.xml file on your webserver. By default the file will be placed at chrome/update.xml. See https://developer.chrome.com/extensions/autoupdate for more information.

Instead of using tmp/deploy-dist you can also symlink to the dist directory, which makes it easier to use it in development. In that case you might need to change the config/deploy.js file to use dist as well:

// config/deploy.js
module.exports = function(deployTarget) {
  return {
    build: {
      outputPath: 'dist'
    },
    'chrome-app': {
      ...
    }
  };
};

Known limitations

  • Chrome apps currently seem not to be able yet to handle HTML5 pushState. Make sure locationType is set to hash in your config/environment.js file.
  • Depending on your configuration, you might need to disable fingerprinting. If you have symlinked chrome/window.html to dist/index.html, the asset urls in app/index.html will be compiled like normal. However, if you have a different window.html, it will not be compiled and thus will not be able to handle fingerprinted assets. In that case you have to disable it in ember-cli-build.js by setting fingerprint to { enabled: false }.

Credits

This package is based on the following awesome packages:

License

This project is released under the MIT License.