From 2a9fe0fa9515e20eac737592834e9fdeeaf809c8 Mon Sep 17 00:00:00 2001 From: Tom Dale Date: Thu, 23 Mar 2017 10:25:23 -0700 Subject: [PATCH] Build @glimmer/interfaces --- build/broccoli/build-packages.js | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/build/broccoli/build-packages.js b/build/broccoli/build-packages.js index 96be27df87..938a3a3a44 100644 --- a/build/broccoli/build-packages.js +++ b/build/broccoli/build-packages.js @@ -31,9 +31,7 @@ function topsortPackages() { // that `package.json`. let pkgs = glob .sync(`${PACKAGES_PATH}/**/package.json`) - .map(pkgPath => require(pkgPath)) - // .filter(pkg => pkg.name === '@glimmer/util') - .filter(pkg => pkg.name !== '@glimmer/interfaces'); + .map(pkgPath => require(pkgPath)); // Get a list of package names discovered in the repo. let inRepoDependencies = pkgs.map(pkg => pkg.name); @@ -77,14 +75,25 @@ function topsortPackages() { */ function treeForPackage(packagePath) { let srcTrees = [ - funnel(packagePath, { exclude: ['test/'] }), + funnel(packagePath, { exclude: ['test/**/*'] }), ]; - let packageTree = funnel(buildPackage({ - srcTrees, - projectPath: packagePath, - tsconfigPath: TSCONFIG_PATH - }), { destDir: 'dist' }); + let packageTree; + + if (fs.existsSync(path.join(packagePath, 'index.d.ts'))) { + // @glimmer/interfaces only exports types, so we can copy it verbatim without + // any transpilation. + packageTree = funnel(packagePath, { + destDir: path.join('dist', 'types'), + exclude: ['package.json'] + }); + } else { + packageTree = funnel(buildPackage({ + srcTrees, + projectPath: packagePath, + tsconfigPath: TSCONFIG_PATH, + }), { destDir: 'dist' }); + } let packageJSONTree = treeForPackageJSON(packagePath);