@ciena-org/ember-codemods
v0.3.8
Published
A collection of pretty good codemods for Ember
Readme
@ciena-org/ember-codemods
A collection of codemods that can be run to quickly refactor Ember code.
Usage
Replace TRANSFORM with one of the transforms listed below.
TRANSFORM="revert-computed-macro"; \
npx @ciena-org/ember-codemods $TRANSFORM path/of/files/ or/some**/*glob.jsTransforms
Deprecations
| Introduced in | Deprecation | Transform | | ------------- | -- | --------- | | 3.21 | ember-metal.get-with-default | ember-getWithDefault-to-lodash-get | | 3.24 | ember-string.prototype-extensions | ember-string-codemod | | 3.25 | ember-string.htmlsafe-ishtmlsafe | ember-string-htmlsafe-ishtmlsafe | | 3.26 | ember-glimmer.link-to-positional-arguments | link-to-positional | | 3.26 | ember-glimmer.with-syntax | replace-with-syntax | | 3.26 | has-block-and-has-block-params | has-block | | 3.27 | deprecated-run-loop-and-computed-dot-access | remove-run-loop-and-computed-dot-access| | 3.27 | ember.built-in-components.import | built-in-components-import| | 3.27 | ember-global | remove-global-ember | | 4.0 | ember-polyfills.deprecate-assign / ember-polyfills.deprecate-merge | deprecate-ember-polyfills | | 4.1 | deprecate-auto-location | deprecate-auto-location | | 4.10 | deprecate-ember-error | revert-ember-error | | 4.10 | ember-string.from-ember-module | ember-string-codemod |
Miscellaneous
| Transform | Description | Possible issues |
| --------- | ----------- | --------------- |
| revert-computed-macro| Replace computed from ember-macro-helpers with @ember/object instead. | Will add variable even if not used from function before. Can just remove as need be (or PR fix), was not a common occurence in my code to have unused dependency |
| ember-code-snippets-helper| Replace CodeSnippet component with get-code-snippet helper when updating ember-code-snippet to v3. | |
| replace-proxy-hack-with-decorator| Replace internal proxyAttr, proxyBelongsTo, and proxyHasMany macros with a expectationProxy class decorator. | This only works with models that aren't native classes, but I think it should be okay since the only models using these macros are following the classic syntax. |
Contributing
If you are interested in helping contribute to this project, please take a look at our Contributing Guide.
