
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ember-native-class-codemod
Advanced tools
Codemods for transforming ember app code to native class syntax with decorators.
A codemod for transforming your ember app code to native JavaScript class syntax with decorators!
First, install the dependencies that the codemod relies on. These are addons that the codemod will add imports from:
ember install ember-classic-decorator
ember install ember-decorators
Then, boot up your application. Then, the codemod can be run using the following command:
npx ember-native-class-codemod http://localhost:4200/path/to/server [OPTIONS] path/of/files/ or/some**/*glob.js
The codemod accepts the following options, passed as CLI arguments, set in a .codemods.{json,js,cjs,yml} file, or set in a "codemods" object in package.json.
| Option | Type | Default | Details |
|---|---|---|---|
--class-fields / classFields | boolean | true | Enable/disable transformation using class fields |
--decorators / decorators | boolean | DecoratorsConfig | true | Set to false to disable transformation using decorators. Set to DecoratorsConfig object (see below) to pass additional decorator options. |
--classic-decorator / classicDecorator | boolean | true | Enable/disable adding the @classic decorator, which helps with transitioning Ember Octane |
--type / type | See below | See below | |
--quote / quote | 'single' | 'double' | 'single' | Whether to use double or single quotes by default for new statements that are added during the codemod. |
--ignore-leaking-state / ignoreLeakingState | `string | string[] | ['queryParams'] | Allow-list for ObjectExpression or ArrayExpression properties to ignore issues detailed in eslint-plugin-ember/avoid-leaking-state-in-ember-objects. In the classic class syntax, using arrays and objects as default properties causes their state to "leak" between instances. If you have custom properties where you know that the shared state won't be a problem (for example, read-only configuration values), you can use this config to ignore them. NOTE: Passing this option will override the defaults, so ensure you include 'queryParams' in the list unless you explicitly wish to disallow it. Pass as a comma-separated string if using as a CLI-option. Otherwise pass as an array of strings. |
DecoratorsConfig | An object with the following properties. | See below. | See below. |
DecoratorsConfig.inObjectLiterals | string | string[] | [] | Allow-list for decorators currently applied to object literal properties that can be safely applied to class properties. Pass as a comma-separated string if using as a CLI-option. Otherwise pass as an array of strings. NOTE: Decorators on object methods will be allowed by default. |
The first argument that you must pass to the codemod is the URL of a running instance of your application. The codemod opens up your application and analyzes the classes directly, so it can transform them, which is why it needs this URL. Any classes that were not analyzed will not be transformed. This includes classes that are private to a module and never exported.
If you have any lazily loaded modules, such as modules from Ember Engines, you'll need to make sure that the URL you provide loads these modules as well. Otherwise, the codemod will not be able to detect them or analyze them.
To disable this feature, run with NO_TELEMETRY=true and omit the path to your local server:
NO_TELEMETRY=true npx ember-native-class-codemod [OPTIONS] path/of/files/ or/some**/*glob.js
DANGER: Disabling the telemetry may result in incorrect behavior. Carefully vet the results.
The type option can be used to further narrow down transforms to a particular type of
ember object within the application or addon. The types can be any of the
following:
| Type | Option |
|---|---|
| Services | --type=services |
| Routes | --type=routes |
| Components | --type=components |
| Controllers | --type=controllers |
| Adapters | --type=adapters |
| Helpers | --type=helpers |
The path of the file being transformed is matched against the glob pattern of the type to determine whether to run the specific transforms.
If a type is not provided, the codemods will run against all the types in the path provided.
The codemods log execution information in the codemods.log file in the current
directory where the codemods are being executed. Specifically, details such as
failures and reasons for failures, are logged. This would be the recommended
starting point for debugging issues related to these codemods.
While the codemods transforms many types of ember objects, it does not support transformation of
ember-data classes such as DS.Model, DS.Adapter etcactions and
queryParams are the exception). See eslint-plugin-ember/avoid-leaking-state-in-ember-objects
for more details.meta or property
modifiers.pnpmpnpm testpnpm update-docsFAQs
Codemods for transforming ember app code to native class syntax with decorators.
The npm package ember-native-class-codemod receives a total of 259 weekly downloads. As such, ember-native-class-codemod popularity was classified as not popular.
We found that ember-native-class-codemod demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.