Skip to content
This repository was archived by the owner on Apr 26, 2025. It is now read-only.

Commit 16ae1bc

Browse files
committed
release: 0.3.0-alpha.2
1 parent 20efaff commit 16ae1bc

File tree

9 files changed

+70
-57
lines changed

9 files changed

+70
-57
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 0.3.0-alpha.2
2+
3+
- CLI: `react-tv init`
4+
- CLI: `react-tv init <app-name>`
5+
- add tests for CLI behavior
6+
- add .npmignore
7+
- add `jest:ci` job
8+
19
# 0.3.0-alpha.1
210

311
- migrate to react-reconciler 0.6.0

cli/__tests__/init-test.js

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,64 @@
1-
const { spawnSync } = require('child_process')
2-
const path = require('path')
3-
const rimraf = require('rimraf')
1+
const {spawnSync} = require('child_process');
2+
const path = require('path');
3+
const rimraf = require('rimraf');
44

5-
const scriptPath = path.resolve(__dirname, '../index.js')
6-
const packagePath = path.resolve(__dirname, '../__fixtures__/package')
7-
const emptyPackagePath = path.resolve(__dirname, '../__fixtures__/emptyPackage')
5+
const scriptPath = path.resolve(__dirname, '../index.js');
6+
const packagePath = path.resolve(__dirname, '../__fixtures__/package');
7+
const fixturesPath = path.resolve(__dirname, '../__fixtures__');
88

9-
require('./to-run-successfully-matcher')
9+
require('./to-run-successfully-matcher');
1010

1111
describe('[CLI] init', () => {
1212
describe('react-tv init', () => {
13-
let slug = 'react-tv'
13+
let slug = 'react-tv';
1414

15-
beforeEach((done) => rimraf(path.resolve(packagePath, slug), done))
16-
afterEach((done) => rimraf(path.resolve(packagePath, slug), done))
15+
beforeEach(done => rimraf(path.resolve(packagePath, slug), done));
16+
afterEach(done => rimraf(path.resolve(packagePath, slug), done));
1717

1818
it('should create react-tv folder', () => {
19-
const subject = spawnSync('node', [
20-
scriptPath,
21-
'init'
22-
], { cwd: packagePath })
19+
const subject = spawnSync('node', [scriptPath, 'init'], {
20+
cwd: packagePath,
21+
});
2322

24-
const createdAppPath = path.resolve(packagePath, slug)
25-
const appInfo = require(path.resolve(createdAppPath, 'webos/appinfo.json'))
23+
const createdAppPath = path.resolve(packagePath, slug);
24+
const appInfo = require(path.resolve(
25+
createdAppPath,
26+
'webos/appinfo.json'
27+
));
2628

27-
expect(appInfo.id).toEqual('react.tv.app')
28-
expect(appInfo.title).toEqual('package')
29-
expect(subject).toRunSuccessfully()
30-
})
29+
expect(appInfo.id).toEqual('react.tv.app');
30+
expect(appInfo.title).toEqual('package');
31+
expect(subject).toRunSuccessfully();
32+
});
3133

3234
it('should fail when package.json not exists', () => {
33-
const subject = spawnSync('node', [
34-
scriptPath,
35-
'init'
36-
], { cwd: emptyPackagePath })
35+
const subject = spawnSync('node', [scriptPath, 'init'], {
36+
cwd: fixturesPath,
37+
});
3738

38-
expect(subject).not.toRunSuccessfully()
39-
})
40-
})
39+
expect(subject).not.toRunSuccessfully();
40+
});
41+
});
4142

4243
describe('react-tv init <appName>', () => {
43-
const appName = 'russell-crowe'
44+
const appName = 'russell-crowe';
4445

45-
beforeEach((done) => rimraf(path.resolve(emptyPackagePath, appName), done))
46-
afterEach((done) => rimraf(path.resolve(emptyPackagePath, appName), done))
46+
beforeEach(done => rimraf(path.resolve(fixturesPath, appName), done));
47+
afterEach(done => rimraf(path.resolve(fixturesPath, appName), done));
4748

4849
it('should create custom app', () => {
49-
const subject = spawnSync('node', [
50-
scriptPath,
51-
'init',
52-
appName
53-
], { cwd: emptyPackagePath })
54-
55-
const createdAppPath = path.resolve(emptyPackagePath, appName)
56-
const createdPackageJson = require(path.resolve(createdAppPath, 'package.json'))
57-
58-
expect(subject).toRunSuccessfully()
59-
expect(createdPackageJson.name).toEqual('russell-crowe')
60-
})
61-
})
62-
})
50+
const subject = spawnSync('node', [scriptPath, 'init', appName], {
51+
cwd: fixturesPath,
52+
});
53+
54+
const createdAppPath = path.resolve(fixturesPath, appName);
55+
const createdPackageJson = require(path.resolve(
56+
createdAppPath,
57+
'package.json'
58+
));
59+
60+
expect(subject).toRunSuccessfully();
61+
expect(createdPackageJson.name).toEqual('russell-crowe');
62+
});
63+
});
64+
});
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
expect.extend({
22
toRunSuccessfully(received) {
3-
const pass = received.status === 0
3+
const pass = received.status === 0;
44

55
if (pass) {
66
return {
77
message: () => `expected exit code not to be 0`,
88
pass: true,
9-
}
9+
};
1010
} else {
1111
return {
12-
message: () => `expected exit code to be 0, was ${received.status} with error: \n${received.output}`,
12+
message: () =>
13+
`expected exit code to be 0, was ${received.status} with error: \n${
14+
received.output
15+
}`,
1316
pass: false,
14-
}
17+
};
1518
}
16-
}
17-
})
19+
},
20+
});

cli/bootstrap/custom-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"dependencies": {
1717
"react": "^16.0.0",
18-
"react-tv": "^0.3.0-alpha.1"
18+
"react-tv": "^0.3.0-alpha.2"
1919
},
2020
"devDependencies": {
2121
"babel-core": "^6.4.5",

cli/shared/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function createReactTVApp(appName) {
4040
recursive: true,
4141
silent: true,
4242
});
43-
} catch(e) {
43+
} catch (e) {
4444
return process.exit(1);
4545
}
4646

@@ -71,7 +71,7 @@ function createReactTVApp(appName) {
7171
recursive: true,
7272
silent: true,
7373
});
74-
} catch(e) {
74+
} catch (e) {
7575
return process.exit(1);
7676
}
7777

examples/benchmark/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"dependencies": {
1919
"react": "^16.0.0",
2020
"react-dom": "^16.0.0",
21-
"react-tv": "0.3.0-alpha.1"
21+
"react-tv": "0.3.0-alpha.2"
2222
},
2323
"devDependencies": {
2424
"babel-core": "^6.4.5",

examples/clock-app-with-react-tv/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"dependencies": {
1919
"react": "^16.0.0",
20-
"react-tv": "0.3.0-alpha.1"
20+
"react-tv": "0.3.0-alpha.2"
2121
},
2222
"devDependencies": {
2323
"babel-core": "^6.4.5",

examples/keyboard-navigation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"dependencies": {
1919
"react": "^16.0.0",
20-
"react-tv": "0.3.0-alpha.1"
20+
"react-tv": "0.3.0-alpha.2"
2121
},
2222
"devDependencies": {
2323
"babel-core": "^6.4.5",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-tv",
3-
"version": "0.3.0-alpha.1",
3+
"version": "0.3.0-alpha.2",
44
"description": "React renderer for low memory applications and Packager for TVs (WebOS, Tizen, Orsay)",
55
"main": "dist/react-tv.umd.js",
66
"bin": {

0 commit comments

Comments
 (0)