File tree 3 files changed +103
-202
lines changed
3 files changed +103
-202
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
const EmberApp = require ( 'ember-cli/lib/broccoli/ember-app' ) ;
4
+ const path = require ( 'path' ) ;
5
+ const fs = require ( 'fs' ) ;
4
6
5
7
module . exports = async function ( defaults ) {
8
+ const { readPackageUpSync } = await import ( 'read-package-up' ) ;
9
+
6
10
const app = new EmberApp ( defaults , {
7
11
// Add options here
12
+ trees : {
13
+ app : ( ( ) => {
14
+ let sideWatch = require ( '@embroider/broccoli-side-watch' ) ;
15
+
16
+ let paths = [ 'kolay' , '@universal-ember/kolay-ui' ] . map ( ( libraryName ) => {
17
+ let entry = require . resolve ( libraryName ) ;
18
+ let { packageJson, path : packageJsonPath } = readPackageUpSync ( { cwd : entry } ) ;
19
+ let packagePath = path . dirname ( packageJsonPath ) ;
20
+
21
+ console . debug (
22
+ `Side-watching ${ libraryName } from ${ packagePath } , which started in ${ entry } `
23
+ ) ;
24
+
25
+ let toWatch = packageJson . files
26
+ . map ( ( f ) => path . join ( packagePath , f ) )
27
+ . filter ( ( p ) => {
28
+ if ( ! fs . existsSync ( p ) ) return false ;
29
+ if ( ! fs . lstatSync ( p ) . isDirectory ( ) ) return false ;
30
+
31
+ return ! p . endsWith ( '/src' ) ;
32
+ } ) ;
33
+
34
+ return toWatch ;
35
+ } ) ;
36
+
37
+ return sideWatch ( 'app' , { watching : paths . flat ( ) } ) ;
38
+ } ) ( ) ,
39
+ } ,
8
40
'ember-cli-babel' : {
9
41
enableTypeScriptTransform : true ,
10
42
} ,
Original file line number Diff line number Diff line change 34
34
"@ember/string" : " ^3.1.1" ,
35
35
"@ember/test-helpers" : " ^3.3.0" ,
36
36
"@ember/test-waiters" : " ^3.1.0" ,
37
+ "@embroider/broccoli-side-watch" : " 0.0.2-unstable.ba9fd29" ,
37
38
"@embroider/compat" : " ^3.4.8" ,
38
39
"@embroider/core" : " ^3.4.8" ,
39
40
"@embroider/webpack" : " ^4.0.0" ,
79
80
"prettier-plugin-ember-template-tag" : " ^2.0.0" ,
80
81
"qunit" : " ^2.20.0" ,
81
82
"qunit-dom" : " ^3.2.0" ,
83
+ "read-package-up" : " ^11.0.0" ,
82
84
"stylelint" : " ^16.4.0" ,
83
85
"stylelint-config-standard" : " ^36.0.0" ,
84
86
"stylelint-prettier" : " ^5.0.0" ,
You can’t perform that action at this time.
0 commit comments