File tree 2 files changed +16
-3
lines changed
packages/compat/src/compat-adapters
2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -404,6 +404,10 @@ function updateFileWithTransform(
404
404
file : string ,
405
405
transformFunction : Babel . PluginItem | Babel . PluginItem [ ]
406
406
) {
407
+ // only update the file if it exists - this helps the codemods to work across many different versions
408
+ if ( ! existsSync ( resolve ( context . inputPaths [ 0 ] , file ) ) ) {
409
+ return ;
410
+ }
407
411
let inSource = readFileSync ( resolve ( context . inputPaths [ 0 ] , file ) , 'utf8' ) ;
408
412
409
413
let plugins = Array . isArray ( transformFunction ) ? transformFunction : [ transformFunction ] ;
@@ -464,6 +468,15 @@ class FixCycleImports extends Plugin {
464
468
path . node . source = t . stringLiteral ( '@ember/array/make' ) ;
465
469
path . node . specifiers = [ t . importDefaultSpecifier ( t . identifier ( 'makeArray' ) ) ] ;
466
470
}
471
+
472
+ if ( path . node . source . value === '@ember/-internals/runtime' ) {
473
+ path . replaceWith (
474
+ t . importDeclaration (
475
+ [ t . importSpecifier ( t . identifier ( 'ActionHandler' ) , t . identifier ( 'default' ) ) ] ,
476
+ t . stringLiteral ( '@ember/-internals/runtime/lib/mixins/action_handler' )
477
+ )
478
+ ) ;
479
+ }
467
480
} ,
468
481
} ,
469
482
} ;
Original file line number Diff line number Diff line change @@ -17,8 +17,9 @@ async function lts_4_4(project: Project) {
17
17
18
18
async function lts_4_8 ( project : Project ) {
19
19
project . linkDevDependency ( 'ember-source' , { baseDir : __dirname , resolveName : 'ember-source-4.8' } ) ;
20
- project . linkDevDependency ( 'ember-cli' , { baseDir : __dirname , resolveName : 'ember-cli-4.8' } ) ;
21
- project . linkDevDependency ( 'ember-data' , { baseDir : __dirname , resolveName : 'ember-data-4.8' } ) ;
20
+ // ember-cli 4.12 is the earliest version that can have an async function
21
+ project . linkDevDependency ( 'ember-cli' , { baseDir : __dirname , resolveName : 'ember-cli-4.12' } ) ;
22
+ project . linkDevDependency ( 'ember-data' , { baseDir : __dirname , resolveName : 'ember-data-5.3' } ) ;
22
23
}
23
24
24
25
async function lts_4_12 ( project : Project ) {
@@ -112,7 +113,6 @@ export function fullSupportMatrix(scenarios: Scenarios) {
112
113
// new vite based system is working as we like
113
114
. skip ( 'lts_3_28' )
114
115
. skip ( 'lts_4_4' )
115
- . skip ( 'lts_4_8' )
116
116
) ;
117
117
}
118
118
You can’t perform that action at this time.
0 commit comments