Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 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
32b5c2b
Better merge
grabbou Apr 3, 2019
8f65363
Add a comment
grabbou Apr 3, 2019
9fae1d4
Update code
grabbou Apr 3, 2019
160ea1e
Update test
grabbou Apr 3, 2019
0d40b70
update
grabbou Apr 3, 2019
7f4a855
Update snapshot
grabbou Apr 3, 2019
00abd83
extract variables for better Flow coverage
thymikee Apr 3, 2019
e7a12f7
fix more flowfixmes
thymikee Apr 3, 2019
1f5de68
fix more flowfixmes in unlink
thymikee Apr 3, 2019
3d65cda
simplify platform config type
thymikee Apr 3, 2019
c4c77c7
fix unproper usage of link
thymikee Apr 3, 2019
ac22627
Preserve stack trace and make inline error messages to align with cur…
grabbou Apr 3, 2019
75b9248
Remove regexp, check all modules
grabbou Apr 4, 2019
a124acf
Fix error message and do not link React Native
grabbou Apr 4, 2019
f166932
Better name
grabbou Apr 4, 2019
f9669fe
Fix multiple platforms
grabbou Apr 4, 2019
7875d6d
FIx flow
grabbou Apr 4, 2019
d78ac7a
Better error handling and supporting platforms
grabbou Apr 4, 2019
1069a2f
Dont do the validation
grabbou Apr 4, 2019
ac447a6
Add snapshot
grabbou Apr 4, 2019
d0aa842
Link assets only once
grabbou Apr 4, 2019
3253344
Update signature
grabbou Apr 4, 2019
31a4aee
Reset cache
grabbou Apr 4, 2019
51639ec
Treat React Native as a standalone platform
grabbou Apr 4, 2019
e6993a0
Remove log
grabbou Apr 4, 2019
477ac5f
UPdate tests and snapshots
grabbou Apr 4, 2019
f54fb6a
Fix snapshots
grabbou Apr 4, 2019
319439e
Fix snapshots
grabbou Apr 4, 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
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
at: ~/react-native-cli
- restore_cache:
keys:
- dependencies-{{ checksum "package.json" }}
- dependencies-
- v2-dependencies-{{ checksum "package.json" }}
- v2-dependencies-
- run: yarn install
- save_cache:
key: dependencies-{{ checksum "package.json" }}
key: v2-dependencies-{{ checksum "package.json" }}
paths:
- node_modules
- persist_to_workspace:
Expand Down
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
11 changes: 6 additions & 5 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 All @@ -38,15 +37,17 @@ const handleError = err => {
if (commander.verbose) {
logger.error(err.message);
} else {
// Some error messages (esp. custom ones) might have `.` at the end already.
const message = err.message.replace(/\.$/, '');
logger.error(
`${err.message}. ${chalk.dim(
`${message}. ${chalk.dim(
`Run CLI with ${chalk.reset('--verbose')} ${chalk.dim(
'flag for more details.',
)}`,
)}`,
);
}
logger.debug(err.stack);
logger.debug(chalk.dim(err.stack));
process.exit(1);
};

Expand Down Expand Up @@ -184,7 +185,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