Skip to content

Commit b2f8a27

Browse files
committed
fix: fix command acceptance test dummy app addon install
1 parent e837d4f commit b2f8a27

File tree

6 files changed

+37
-21
lines changed

6 files changed

+37
-21
lines changed

lib/project.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as rimraf from 'rimraf';
33
import printSlowNodes from 'broccoli-slow-trees';
44
import { sync as copyDereferenceSync } from 'copy-dereference';
55
import * as createDebug from 'debug';
6-
import { sync as glob } from 'glob';
6+
import { sync as glob } from 'globby';
77
import * as NestedError from 'nested-error-stacks';
88
import Builder, { BuilderOptions } from './builders/base';
99
import Watcher from './watcher';

lib/test/command-acceptance.ts

+10-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as assert from 'assert';
33
import * as path from 'path';
44
import { spawn, ChildProcess } from 'child_process';
55
import * as tmp from 'tmp';
6-
import { sync as glob } from 'glob';
6+
import { sync as glob } from 'globby';
77
import * as dedent from 'dedent-js';
88
import * as createDebug from 'debug';
99
import symlinkAll from '../utils/symlink-all';
@@ -126,17 +126,15 @@ export default class CommandAcceptanceTest {
126126
fs.mkdirSync(tmpNodeModules);
127127
// We symlink all the node_modules from our addon into the throwaway's node_modules
128128
symlinkAll(path.join(this.projectRoot, 'node_modules'), tmpNodeModules);
129-
// Then we copy the addon itself over as a dependency of the dummy app
130-
// (just the publishable parts)
131-
[
132-
'package.json',
133-
'*.md',
134-
'dist/**/*',
135-
'denali-build.js'
136-
].forEach((pattern) => {
137-
glob(pattern, { cwd: this.projectRoot }).forEach((file) => {
138-
fs.copySync(path.join(this.projectRoot, file), path.join(tmpNodeModules, projectPkg.name, file));
139-
});
129+
// Then we copy the addon itself over as a dependency of the dummy app.
130+
// We want to treat it like a git dep in case the command tries to build
131+
// the dummy app, which might try to build this addon. So copy over
132+
// everything that isn't gitignored, but also copy dist in case we can
133+
// use it.
134+
glob('**/*', { cwd: this.projectRoot, gitignore: true })
135+
.concat(glob('dist/**/*', { cwd: this.projectRoot }))
136+
.forEach((file: string) => {
137+
fs.copySync(path.join(this.projectRoot, file), path.join(tmpNodeModules, projectPkg.name, file));
140138
});
141139
}
142140

lib/trees/unit-tests.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as Plugin from 'broccoli-plugin';
44
import { Tree } from 'broccoli';
55
import * as SourceMapConcatenator from 'fast-sourcemap-concat';
66
import { all } from 'bluebird';
7-
import * as glob from 'glob';
7+
import { sync as glob } from 'globby';
88
import { template } from 'lodash';
99

1010
const unitTestOpen = template(fs.readFileSync(path.join(__dirname, '..', 'templates', 'unit-test-open.ejs'), 'utf-8'));
@@ -28,7 +28,7 @@ export default class UnitTestFilter extends (<new(...args: any[]) => Tree>Plugin
2828
}
2929

3030
async build() {
31-
let files = glob.sync('**/*.js', { nodir: true, cwd: this.inputPaths[0] });
31+
let files = glob('**/*.js', { cwd: this.inputPaths[0] });
3232
let fileConcats = files.map(this.wrapFile.bind(this));
3333
return await all(fileConcats);
3434
}

lib/typings.d.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ declare module "symlink-or-copy";
3131
declare module "broccoli-stew";
3232
declare module "broccoli-file-creator";
3333
declare module "broccoli-merge-trees";
34-
declare module "yarn/lib/constants" {
35-
export const GLOBAL_MODULE_DIRECTORY: string;
36-
export const LINK_REGISTRY_DIRECTORY: string;
37-
}
34+
declare module "globby";
3835
declare module "command-exists";
3936
declare module "broccoli/lib" {
4037
class Watcher {

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"@types/dotenv": "^4.0.2",
5353
"@types/flat": "^0.0.28",
5454
"@types/fs-extra": "^5.0.0",
55-
"@types/glob": "^5.0.35",
5655
"@types/lodash": "^4.14.100",
5756
"@types/mkdirp": "^0.5.2",
5857
"@types/node": "^9.4.0",
@@ -80,7 +79,7 @@
8079
"fast-sourcemap-concat": "^1.2.3",
8180
"find-plugins": "^1.1.6",
8281
"fs-extra": "^5.0.0",
83-
"glob": "^7.1.2",
82+
"globby": "^7.1.1",
8483
"is-directory": "^0.3.1",
8584
"lodash": "^4.17.5",
8685
"mkdirp": "^0.5.1",

yarn.lock

+22
Original file line numberDiff line numberDiff line change
@@ -1732,6 +1732,13 @@ diff@^3.2.0:
17321732
version "3.4.0"
17331733
resolved "https://registry.yarnpkg.com/diff/-/diff-3.4.0.tgz#b1d85507daf3964828de54b37d0d73ba67dda56c"
17341734

1735+
dir-glob@^2.0.0:
1736+
version "2.0.0"
1737+
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034"
1738+
dependencies:
1739+
arrify "^1.0.1"
1740+
path-type "^3.0.0"
1741+
17351742
dot-prop@^3.0.0:
17361743
version "3.0.0"
17371744
resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177"
@@ -2326,6 +2333,17 @@ globby@^6.0.0:
23262333
pify "^2.0.0"
23272334
pinkie-promise "^2.0.0"
23282335

2336+
globby@^7.1.1:
2337+
version "7.1.1"
2338+
resolved "https://registry.yarnpkg.com/globby/-/globby-7.1.1.tgz#fb2ccff9401f8600945dfada97440cca972b8680"
2339+
dependencies:
2340+
array-union "^1.0.1"
2341+
dir-glob "^2.0.0"
2342+
glob "^7.1.2"
2343+
ignore "^3.3.5"
2344+
pify "^3.0.0"
2345+
slash "^1.0.0"
2346+
23292347
got@^6.7.1:
23302348
version "6.7.1"
23312349
resolved "https://registry.yarnpkg.com/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0"
@@ -2514,6 +2532,10 @@ ignore-by-default@^1.0.0:
25142532
version "1.0.1"
25152533
resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09"
25162534

2535+
ignore@^3.3.5:
2536+
version "3.3.7"
2537+
resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021"
2538+
25172539
import-lazy@^2.1.0:
25182540
version "2.1.0"
25192541
resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43"

0 commit comments

Comments
 (0)