Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
f344504
wip save work
grabbou Apr 2, 2019
38e2cba
wip 3
grabbou Apr 2, 2019
1d0ea0d
Clean up diff
grabbou Apr 2, 2019
365c6eb
Loggers are unneccessary here
grabbou Apr 2, 2019
6c03344
Fix some Flowtype compatibilities between link and config
grabbou Apr 2, 2019
dc09588
Update snapshots
grabbou Apr 2, 2019
e86bd57
Misc inside config
grabbou Apr 2, 2019
3d67a0e
WIP integration
grabbou Apr 2, 2019
a3d5e5a
Remove async/await for now
grabbou Apr 2, 2019
740caef
Finish migration, start working on tests
grabbou Apr 2, 2019
bace218
Remove unused files
grabbou Apr 2, 2019
f5d92b8
Fix types for platforms and upgrade test
grabbou Apr 2, 2019
e845c72
Fix flow errors
grabbou Apr 2, 2019
7cafc3d
Remove old tests, move rest to new place
grabbou Apr 2, 2019
68a5460
fix: flaky tests; upgrade Jest to 24.6 (#282)
thymikee Apr 2, 2019
b899993
Add findDependencies suite and fix one bugg
grabbou Apr 2, 2019
c82824b
Rename snapshots instead of creating a new one
grabbou Apr 2, 2019
fa83f1f
Update snapshots with new fields
grabbou Apr 2, 2019
72485a5
Update snapshots
grabbou Apr 2, 2019
b60a381
Update link tests
grabbou Apr 2, 2019
d95e286
Bring missing snapshots back
grabbou Apr 2, 2019
11bae06
Turn off Flow for link test as its causing too much troubles
grabbou Apr 2, 2019
416c0bb
Fix formatting and update snapshot
grabbou Apr 2, 2019
a9d8fa4
unlink message has been updated for better readability
grabbou Apr 2, 2019
ec58f2f
Remove unused file:
grabbou Apr 2, 2019
a111f05
Reload configuration after install
grabbou Apr 2, 2019
3e6b3a1
Fix regressions
grabbou Apr 2, 2019
0d6fe63
Remove console.log
grabbou Apr 2, 2019
3d6182c
Fix ESLint issue
grabbou Apr 2, 2019
a0164bd
Possible fix to e2e test
grabbou Apr 2, 2019
453c59c
Export loadConfig function for public interface
grabbou Apr 2, 2019
bf2f88b
Refactor out types
grabbou Apr 2, 2019
3b49d80
Describe the types
grabbou Apr 2, 2019
b481105
Note about untyped parts
grabbou Apr 2, 2019
d188f14
Bring better debug logs for link
grabbou Apr 2, 2019
8f60628
Merge branch 'master' into feat/link-int
grabbou Apr 2, 2019
2f887fd
Lazily access reactNativePath
grabbou Apr 2, 2019
acb7993
make config truly lazy
grabbou Apr 2, 2019
9b5c3c6
Update and leave a todo note
grabbou Apr 2, 2019
8910d63
Flaky e2e tests
grabbou Apr 2, 2019
4838f19
Make assets lazy
grabbou Apr 2, 2019
d03c7c8
Add flow to assign
grabbou Apr 2, 2019
5e6584d
Fix types
grabbou Apr 2, 2019
26e0e18
Merge branch 'master' into feat/link-int
grabbou Apr 3, 2019
4a99ebc
Fix errors when no config for out-of-tree platform
grabbou Apr 3, 2019
32550bb
initial commit
grabbou Apr 3, 2019
fa68cef
UPdate flow
grabbou Apr 3, 2019
18e7693
Update message
grabbou Apr 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module.ignore_non_literal_requires=true
all=warn
unnecessary-optional-chain=off
dynamic-export=off
unsafe-getters-setters=off

# There is an ESLint rule for this
unclear-type=off
Expand Down
2 changes: 1 addition & 1 deletion e2e/__tests__/uninstall.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test('uninstall fails when package is not installed', () => {
});
const {stderr, code} = run(DIR, ['uninstall', pkg]);

expect(stderr).toContain(`Project "${pkg}" is not a react-native library`);
expect(stderr).toContain(`Failed to unlink "${pkg}".`);
expect(code).toBe(1);
});

Expand Down
7 changes: 3 additions & 4 deletions packages/cli/src/cliEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {getCommands} from './commands';
import init from './commands/init/initCompat';
import assertRequiredOptions from './tools/assertRequiredOptions';
import logger from './tools/logger';
import findPlugins from './tools/findPlugins';
import {setProjectDir} from './tools/PackageManager';
import pkgJson from '../package.json';
import loadConfig from './tools/config';
Expand Down Expand Up @@ -124,7 +123,7 @@ const addCommand = (command: CommandT, ctx: ContextT) => {
opt.command,
opt.description,
opt.parse || defaultOptParser,
opt.default,
typeof opt.default === 'function' ? opt.default(ctx) : opt.default,
),
);
};
Expand Down Expand Up @@ -184,7 +183,7 @@ async function setupAndRun() {
export default {
run,
init,
findPlugins,
loadConfig,
};

export {run, init, findPlugins};
export {run, init, loadConfig};
17 changes: 5 additions & 12 deletions packages/cli/src/commands/info/__tests__/info.test.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
// @flow
import info from '../info';
import logger from '../../../tools/logger';
import loadConfig from '../../../tools/config';

jest.mock('../../../tools/logger', () => ({
info: jest.fn(),
error: jest.fn(),
log: jest.fn(),
}));

const ctx = {
root: '',
reactNativePath: '',
dependencies: {},
platforms: {},
commands: [],
haste: {
platforms: [],
providesModuleNodeModules: [],
},
};
jest.mock('../../../tools/config');

beforeEach(() => {
jest.resetAllMocks();
});

const config = loadConfig();

test('prints output without arguments', async () => {
await info.func([], ctx, {});
await info.func([], config, {});
expect(logger.info).toHaveBeenCalledWith(
'Fetching system and libraries information...',
);
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commands/init/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ function createProject(projectName: string, options: Options, version: string) {
return createFromReactNativeTemplate(projectName, version, options.npm);
}

export default async function initialize(
export default (async function initialize(
[projectName]: Array<string>,
context: ContextT,
_context: ContextT,
options: Options,
) {
validateProjectName(projectName);
Expand All @@ -125,4 +125,4 @@ export default async function initialize(
logger.error(e.message);
fs.removeSync(projectName);
}
}
});
6 changes: 5 additions & 1 deletion packages/cli/src/commands/install/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ import type {ContextT} from '../../tools/types.flow';
import logger from '../../tools/logger';
import * as PackageManager from '../../tools/PackageManager';
import link from '../link/link';
import loadConfig from '../../tools/config';

async function install(args: Array<string>, ctx: ContextT) {
const name = args[0];

logger.info(`Installing "${name}"...`);
PackageManager.install([name]);

// Reload configuration to see newly installed dependency
const newConfig = loadConfig();

logger.info(`Linking "${name}"...`);
await link.func([name], ctx, {platforms: undefined});
await link.func([name], newConfig, {platforms: undefined});

logger.success(`Successfully installed and linked "${name}"`);
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading