As of ember-concurrency 2.0.0, the decorators provided by ember-concurrency-decorators
have been moved directly into ember-concurrency
, removing the need for this additional package.
This codemod refactors away existing ember-concurrency-decorators
imports automatically.
- The target Ember app or addon must be using ember-concurrency >=2.0.0 in order for decorator imports to be available.
git clone https://github.com/camerondubas/ember-concurrency-decorators-codemod
cd ember-concurrency-decorators-codemod
npm install
npx jscodeshift -t refactor-imports.ts <path/*glob>.js <path/*glob>.ts
--quotes
: Whether to use 'single' or "double" quotes for strings. Default value: single
Before:
import Component from '@glimmer/component';
import { timeout } from 'ember-concurrency';
import { dropTask, task } from 'ember-concurrency-decorators';
...
After:
import Component from '@glimmer/component';
import { timeout, dropTask, task } from 'ember-concurrency';
...
Before:
import Component from '@glimmer/component';
import { dropTask, task } from 'ember-concurrency-decorators';
...
After:
import Component from '@glimmer/component';
import { dropTask, task } from 'ember-concurrency';
...
Before:
import Component from '@glimmer/component';
import { timeout } from 'ember-concurrency';
import { dropTask, task } from 'ember-concurrency-decorators';
import type { TaskGenerator } from "ember-concurrency";
...
After:
import Component from '@glimmer/component';
import { timeout, dropTask, task } from 'ember-concurrency';
import type { TaskGenerator } from "ember-concurrency";
...
yarn test
yarn lint
This project is licensed under the MIT License.