• Stars
    star
    277
  • Rank 148,875 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Update Ember CLI projects

ember-cli-update

npm version Build status

logo

Update Ember CLI projects

The 2 use cases are:

  1. Updating a project's boilerplate code from an older Ember version to a newer one like 3.4.0 to 3.20.0 for example. These are called base blueprints and there are 3 types officially provided by ember-cli: app, addon, and glimmer.
    • This is different from the existing ember init command. That command tries to reset your project back to a brand new project. It removes all your changes and additions.
  2. Updating boilerplate code for a blueprint from an Ember addon from an older version to a newer one. These are called custom blueprints.

Check out the wiki guide for more details.

You can run the CLI either as a global executable available to all projects or an Ember CLI command in a single project.

The CLI attempts to be a thin wrapper of boilerplate-update.

Installation

As a global executable:

npm install -g ember-cli-update

As an Ember CLI command:

ember install ember-cli-update

(You must commit the change to package.json before running the update command or else you get an error.)

Usage

Make sure your git working directory is clean before updating.

Inside your project directory, if you installed globally run

ember-cli-update

or if you installed as an Ember CLI command run

ember update

This will update your app or addon to the latest Ember CLI version. It does this by fetching the latest version and comparing it to your project's Ember CLI version. It then applies a diff of the changes from the latest version to your project. It will only modify the files if there are changes between your project's version and the latest version, and it will only change the section necessary, not the entire file.

This is different from the existing ember init command. That command tries to reset your project back to a brand new project. It removes all your changes and additions.

You will probably encounter merge conflicts, in which the default behavior is to let you resolve conflicts on your own. You can supply the --resolve-conflicts option to run your system's git merge tool if any conflicts are found.

This tool can also run codemods for you. The option --run-codemods will figure out what codemods apply to your current version of Ember.js, and download and run them for you.

Examples

(These examples assume you are using the global command.)

To update to the latest version of Ember CLI:

ember-cli-update

To update to a certain version of Ember CLI:

ember-cli-update --to 3.1.0

To run codemods:

(This should be run after running the normal update shown above, and after you've resolved any conflicts.)

ember-cli-update --run-codemods

Commands

  --help                         Show help                             [boolean]
  --version                      Show version number                   [boolean]
  --package-name, --package, -p  Provide a package that can contain many
                                 blueprints ("@glimmer/blueprint", "git+https://
                                 [email protected]/tildeio/libkit.git",
                                 "../blueprint")                        [string]
  --blueprint, -b                Provide a custom blueprint for use in the
                                 update ("@glimmer/blueprint", "git+https://git@
                                 github.com/tildeio/libkit.git", "../blueprint")
                                                                        [string]
  --from                         Use a starting version that is different than
                                 what is in your package.json ("2.9.1") [string]
  --to                           Update to a version that isn't latest
                                 ("2.14.1", "~2.15", "latest", "beta")  [string]
  --resolve-conflicts            Automatically run git mergetool if conflicts
                                 found                [boolean] [default: false]
  --run-codemods                 Run codemods to help update your code
                                                      [boolean] [default: false]
  --codemods-source              Supply your own codemods manifest via URL
                                 ("ember-app-codemods-manifest@*",
                                 "git+https://github.com/ember-cli/ember-app-cod
                                 emods-manifest.git#semver:*")          [string]
  --codemods-json                Supply your own codemods manifest via JSON (`{
                                 /* json */ }`)                         [string]
  --reset                        Reset your code to the default blueprint at the
                                 new version          [boolean] [default: false]
  --compare-only                 Show the changes between different versions
                                 without updating     [boolean] [default: false]
  --stats-only                   Show all calculated values regarding your
                                 project              [boolean] [default: false]
  --list-codemods                List available codemods
                                                      [boolean] [default: false]
  --output-repo                  An output repository of changes over time
                                                                        [string]

Power User Guide

Let's update from Ember CLI 2.18.2 to Ember CLI 3.1.4

First, make sure you are on the latest ember-cli-update version for good measure.

npm install -g ember-cli-update

Then, run all compatible codemods against your current version. Since codemods are downloaded on the fly, they can be updated (and new ones added) without even getting a new version of ember-cli-update. Also, we may add additional codemods targeting your older version of Ember.js.

ember-cli-update --run-codemods

Assuming you are multiple versions behind of Ember CLI, you may want to update in stages. Unless you have a really simple app, updating in stages can help isolate upgrade issues.

ember-cli-update --to 3.0

Once you resolve conflicts and commit, You again want to run codemods. This is because new codemods targeting Ember.js 3.0 will now apply.

ember-cli-update --run-codemods

Now you are ready to update again. (If your final update is going to be the latest version of Ember CLI, you don't need the --to option.)

ember-cli-update --to 3.1

Again, after you resolve conflicts and commit, you want to run codemods because of new Ember.js 3.1 codemods.

ember-cli-update --run-codemods

And then you're done! You have a freshly updated app (or addon). As noted, you can consolidate these steps by doing a direct update, but then you may be confused if you encounter issues which version is to blame.

Hints

Need help using git mergetool? Here are some starting points:

If you made a mistake during the update/conflict resolution, run these commands to undo everything and get you back to before the update:

git reset --hard
git clean -f

If you notice ".orig" files lying around after a merge and don't want that behavior, run git config --global mergetool.keepBackup false.

To avoid being prompted "Hit return to start merge resolution tool (vimdiff):" for every conflict, set a merge tool like git config --global merge.tool "vimdiff".

If you run into an error like error: unrecognized input, you may need to update your git config color option like git config --global color.ui auto.

Troubleshooting

If you are getting an error or unexpected results, running the command with the debug flag:

  • Unix (global):   DEBUG=ember-cli-update,boilerplate-update,git-diff-apply ember-cli-update
  • Windows (global):   set DEBUG=ember-cli-update,boilerplate-update,git-diff-apply && ember-cli-update
  • Unix (command):   DEBUG=ember-cli-update,boilerplate-update,git-diff-apply ember update
  • Windows (command):   set DEBUG=ember-cli-update,boilerplate-update,git-diff-apply && ember update

will give you more detailed logging.

More Repositories

1

ember-cli

The Ember.js command line utility.
JavaScript
3,261
star
2

ember-exam

Run your tests with randomization, splitting, and parallelization for beautiful tests.
JavaScript
286
star
3

ember-twiddle

JSFiddle type thing for ember-cli style code
JavaScript
268
star
4

eslint-plugin-ember

An ESLint plugin that provides set of rules for Ember applications based on commonly known good practices.
JavaScript
260
star
5

ember-ajax

Service for making AJAX requests in Ember applications
JavaScript
213
star
6

ember-page-title

Page title management for Ember.js Apps
JavaScript
188
star
7

ember-try

An ember-cli addon to test against multiple npm dependencies, such as ember and ember-data.
JavaScript
179
star
8

ember-fetch

HTML5 fetch polyfill from github wrapped and bundled for ember-cli users.
JavaScript
176
star
9

ember-cli-deprecation-workflow

JavaScript
165
star
10

ember-cli-mocha

Mocha and Chai tests for ember-cli applications
JavaScript
147
star
11

ember-cli-eslint

Ember CLI addon for linting Ember projects with ESLint
JavaScript
116
star
12

ember-new-output

Change history of new Ember-CLI apps
JavaScript
91
star
13

ember-resolver

JavaScript
87
star
14

broccoli-asset-rev

Broccoli plugin to add fingerprint checksums and CDN URLs to your assets
JavaScript
86
star
15

ember-rfc176-data

JSON data for Ember.js RFC #176
JavaScript
83
star
16

loader.js

minimal amd loader mostly stolen from wycats.
JavaScript
79
star
17

ember-cli-htmlbars

JavaScript
77
star
18

ember-template-imports

Template import support in Ember!
JavaScript
74
star
19

ember-cli-htmlbars-inline-precompile

📃 Precompile inline HTMLBars templates via ES6 tagged template strings
JavaScript
67
star
20

ember-cli-todos

JavaScript
67
star
21

babel-plugin-feature-flags

A babel transform for managing feature flags
JavaScript
57
star
22

ember-cli-app-version

Adds your app's version to Ember Inspector's Info tab
JavaScript
55
star
23

ember-cli-shims

DEPRECATED - ES6 import shims for Ember.js
JavaScript
46
star
24

ember-octane-blueprint

App and Addon blueprints for Ember Octane
JavaScript
46
star
25

rfcs

Archive of RFCs for changes to ember-cli (for current RFC repo see https://github.com/emberjs/rfcs)
45
star
26

ember-cli-babel-polyfills

Split-build polyfills for evergreen and legacy browsers
JavaScript
34
star
27

ember-cli-qunit

QUnit testing package for ember-cli applications
JavaScript
30
star
28

ember-compatibility-helpers

Helpers that allow you to write backwards compat Ember addons
JavaScript
24
star
29

ember-cli-version-checker

Dependency version checker for Ember CLI addons
JavaScript
24
star
30

broccoli-viz

library to read/parse and produce various visualizations of broccoli.
JavaScript
23
star
31

ember-cli-blueprint-test-helpers

Test helpers for testing ember-cli blueprints
JavaScript
23
star
32

ember-cli-terser

JavaScript minification for Ember-CLI
JavaScript
23
star
33

ember-cli-inject-live-reload

Ember CLI plugin that injects live-reload script into HTML content
JavaScript
22
star
34

ember-cli-chai

Chai assertions for Ember.js
JavaScript
21
star
35

babel-plugin-filter-imports

A babel transform for filtering out imports
JavaScript
18
star
36

broccoli-caching-writer

JavaScript
17
star
37

ember-addon-output

Change history of new Ember-CLI addons
JavaScript
16
star
38

core-object

JavaScript
16
star
39

babel-plugin-ember-modules-api-polyfill

Polyfill for Ember JS API
JavaScript
15
star
40

ember-load-initializers

JavaScript
14
star
41

console-ui

JavaScript
14
star
42

broccoli-es6modules

new es6 module transpiler
JavaScript
14
star
43

ember-export-application-global

JavaScript
14
star
44

babel-plugin-debug-macros

TypeScript
13
star
45

ember-cli.github.io

Our documentation site
SCSS
13
star
46

ember-router-generator

JavaScript
12
star
47

ember-welcome-page

Welcome page for Ember CLI applications
JavaScript
12
star
48

broccoli-terser-sourcemap

Broccoli filter to uglify with sourcemaps
JavaScript
10
star
49

broccoli-asset-rewrite

Broccoli plugin to rewrite a source tree from an asset map.
JavaScript
10
star
50

ember-cli-test-loader

JavaScript
10
star
51

ember-source-channel-url

JavaScript
10
star
52

stress-app

HTML
9
star
53

capture-exit

JavaScript
9
star
54

ember-next

A home for experiments that aim to become the defaults when running ember-new.
JavaScript
9
star
55

babel-plugin-htmlbars-inline-precompile

Babel plugin to replace tagged template strings with precompiled HTMLBars templates
JavaScript
9
star
56

broccoli-lint-eslint

Integrates JavaScript linting with ESLint as part of your Broccoli build pipeline.
JavaScript
8
star
57

blprnt

JavaScript
7
star
58

ember-cli-clean-css

CSS minification via clean-css for Ember CLI
JavaScript
6
star
59

exists-sync

Deprecated, please use fs.existsSync instead
JavaScript
6
star
60

ember-disable-prototype-extensions

Disables Ember's prototype extensions
JavaScript
6
star
61

silent-error

JavaScript
5
star
62

ember-cli-jshint

JSHint lint tests for your Ember CLI projects
JavaScript
5
star
63

create-ember-app

yarn create ember-app <name>
JavaScript
4
star
64

broccoli-middleware

Broccoli asset builder middleware
HTML
4
star
65

ember-cli-babili

JavaScript
4
star
66

ember-cli-update-codemods-manifest

Master list of codemods and their instructions used by ember-cli-update
JavaScript
4
star
67

amd-name-resolver

Algorithm for resolving AMD module names
JavaScript
3
star
68

ember-cli-string-utils

JavaScript
3
star
69

ember-cli-legacy-blueprints

Ember and Ember-Data specific blueprints for ember-cli projects not using the Ember and Ember-Data addons.
JavaScript
3
star
70

ember-cli-lodash-subset

JavaScript
2
star
71

ember-cli-default-packager

Default Packager for Ember CLI. More details in https://github.com/ember-cli/rfcs/pull/110.
TypeScript
2
star
72

codesandbox

Official Ember.js template for codesandbox.io
JavaScript
2
star
73

broccoli-amd-funnel

Funnel based on whether a module is AMD or not
JavaScript
1
star
74

broccoli-builder

JavaScript
1
star
75

calculate-cache-key-for-tree

ember-cli addon tree cache key builder
JavaScript
1
star
76

broccoli-funnel-reducer

JavaScript
1
star
77

app-blueprint-test

JavaScript
1
star
78

ember-cli-preprocess-registry

JavaScript
1
star
79

ember-cli-import-polyfill

Backports newer addon import API to older ember-cli versions.
JavaScript
1
star
80

node-modules-path

JavaScript
1
star
81

ember-build-utilities

A suite of build utilities for constructing Ember CLI build pipelines
JavaScript
1
star
82

ember-try-config

Config helper for ember-try
JavaScript
1
star
83

broccoli-config-replace

Simple templating using a config.json and regex patterns.
JavaScript
1
star
84

ember-cli-changelog

Tool used to generate changelogs for ember-cli.
JavaScript
1
star
85

create-ember-addon

yarn create ember-addon <name>
JavaScript
1
star