ember-codemod-remove-inject-as-service 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ _Codemod to remove `inject as service`_<sup>1</sup>
|
|
|
12
12
|
1. [Contributing](#contributing)
|
|
13
13
|
1. [License](#license)
|
|
14
14
|
|
|
15
|
-
<sup>1. `@ember/service`
|
|
15
|
+
<sup>1. `@ember/service` provides `service` since [Ember 4.1](https://blog.emberjs.com/ember-4-1-released/). `inject`, which became an alias to `service`, is [planned to be deprecated in v6](https://rfcs.emberjs.com/id/1001-deprecate-named-inject).</sup>
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
## Features
|
|
@@ -41,14 +41,14 @@ npx ember-codemod-remove-inject-as-service <arguments>
|
|
|
41
41
|
|
|
42
42
|
Step 2. Fix formatting issues.
|
|
43
43
|
|
|
44
|
-
- Optional: Do a find-and-replace-all, if you want to place `@service()` and `declare` on the same line when possible.
|
|
44
|
+
- Optional: Do a find-and-replace-all in TS files, if you want to place `@service()` and `declare` on the same line when possible.
|
|
45
45
|
|
|
46
|
-
- Find: `@service\((.+)\)
|
|
46
|
+
- Find: `@service\((.+)\)[\n\s]+declare`
|
|
47
47
|
- Replace: `@service($1) declare`
|
|
48
48
|
|
|
49
|
-
- Optional: Do a find-and-replace-all, if you want to place `@service` and `declare` on the same line when possible.
|
|
49
|
+
- Optional: Do a find-and-replace-all in TS files, if you want to place `@service` and `declare` on the same line when possible.
|
|
50
50
|
|
|
51
|
-
- Find: `@service
|
|
51
|
+
- Find: `@service[\n\s]+declare`
|
|
52
52
|
- Replace: `@service declare`
|
|
53
53
|
|
|
54
54
|
- Run `lint:js:fix` (i.e. autofix from `eslint` and `prettier`).
|