Releases: ijlee2/ember-codemod-v1-to-v2
Downstreamed changes from @embroider/addon-blueprint
Features
- Set
allowDeclareFields
for TS projects totrue
by default1
1. See #32 to learn how to keep your v2
addon up-to-date.
Refactored utilities
Some of the utilities have been replaced with those from @codemod-utils
. This should help reduce the maintenance cost.
Downstreamed changes from @embroider/addon-blueprint
Bug fixes
- Added
@babel/runtime
to the addon'spackage.json
1
1. See #29 to learn how to keep your v2
addon up-to-date.
Updated blueprints for the workspace root
In addition to updating the dependencies, I simplified the codemod by not allowing the blueprints to add prettier
to the workspace root (not necessary).
Removed useRelativePaths. Refactored code.
Based on feedback from the Ember community as well as myself, I decided to remove the useRelativePaths
step. The removal has a few benefits:
- There's less code to maintain.
- The end-developer's code is preserved better.
- The end-developer can have an easier time getting the scripts for the addon and test-app packages to run.
If you did want to have relative paths, I recommend doing so in a separate pull request (i.e. separately from migrating to v2 format). ✨
Accounted for public assets
Thanks to @pragatheeswarans and @phndiaye.
Features
- Migrated assets in the
public
folder1 - Replicated the changes made in embroider-build/addon-blueprint#1062
Bug fixes
- For the test-app package, packages are moved from dependencies to devDependencies only when the package exists. A bug (a
RangeError
thrown incorrectly) would have surfaced when the v1 addon hastypescript
but notember-cli-typescript
.
1. See #23 to learn how to keep your v2
addon up-to-date.
2. See #22 to learn how to keep your v2
addon up-to-date.
Fixed bugs for scoped packages
Thanks to @phndiaye.
Bug fixes
- The
workspaces
field in the rootpackage.json
now list the package locations. A bug (listing the package names instead) would have surfaced when (1) the package is scoped or (2) an end-developer passes the argument--addon-location
,--test-app-location
, or--test-app-name
.1 - The regular expression for computing the relative path has been updated. A bug would have occurred when the package is scoped.1
1. See #17 to learn how to keep your v2 addon up-to-date.
Fixed a bug for TypeScript projects
Bug fixes
- Listed the
default
key as the last (the bug didn't affect JavaScript projects)1
1. See #16 to learn how to keep your v2 addon up-to-date.
Downstreamed changes from @embroider/addon-blueprint
Features
- Replicated the changes made in embroider-build/addon-blueprint#1031
- Kept
latestVersions
up-to-date
Bug fixes
1. See #14 to learn how to keep your v2
addon up-to-date.
Added files from addon-test-support to addon.publicEntrypoints()
Features
- When a v1 addon has
addon-test-support
, the codemod adds its files toaddon.publicEntrypoints()
. In other words, the codemod takes care of a configuration step forrollup.config.{js,mjs}
.1
1. See #11 to learn how to keep your v2
addon up-to-date.