Skip to content

Commit 46181ec

Browse files
committed
fix, inline checkmark output
1 parent c2aa309 commit 46181ec

File tree

18 files changed

+87
-115
lines changed

18 files changed

+87
-115
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [0.4.2]
6+
- same line '✓' output
7+
- bug fixes
8+
59
## [0.4]
610
- rename "project" to "info"
711
- rename "testDir" to "dir"

lib/build/linter/task-has-test.js

Whitespace-only changes.

lib/build/parser/project.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

lib/cli.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var create_1 = require('./create/create');
77
var search_1 = require('./search/search');
88
var tutorials_1 = require('./tutorials/tutorials');
99
var publish_1 = require('./publish/publish');
10+
var update_1 = require('./update/update');
1011
program
1112
.version('0.3.27')
1213
.usage('[options] <keywords>')
@@ -17,6 +18,7 @@ program
1718
.option('-s, --search [query]', 'search for tutorial package')
1819
.option('-r, --run', 'run tutorial')
1920
.parse(process.argv);
21+
update_1.checkForUpdate();
2022
if (!program.args.length &&
2123
!program.build && !program.tutorials && !program.run) {
2224
program.help();
@@ -25,9 +27,8 @@ else {
2527
if (program.build) {
2628
var tutorial = program.args[0] || 'tutorial/tutorial.md';
2729
var output = 'coderoad.json';
28-
console.log(chalk_1.grey("building from " + tutorial + "..."));
30+
process.stdout.write(chalk_1.grey("building coderoad.json for " + tutorial + "..."));
2931
build_1.default(tutorial, output);
30-
console.log(chalk_1.grey("build complete: coderoad.json"));
3132
}
3233
if (program.create) {
3334
var packageName = program.args[0];
@@ -44,5 +45,6 @@ else {
4445
var version = program.args[0];
4546
publish_1.default(version);
4647
}
48+
process.stdout.write(chalk_1.green(' ✓\n'));
4749
process.exit(0);
4850
}

lib/create/create.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var write_demo_1 = require('./write-demo');
44
var build_1 = require('../build/build');
55
function create(name) {
66
validate_1.validatePackageName(name);
7-
console.log('Creating demo tutorial...');
7+
process.stdout.write("Creating demo tutorial \"coderoad-" + name + "\"...");
88
write_demo_1.createPackageJson(name);
99
write_demo_1.createTutorialMd();
1010
write_demo_1.createTestFiles();

lib/create/write-demo.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ function createTutorialMd() {
2222
createFile(path_1.join('tutorial', '1', '01', 'page-one.md'));
2323
createFolder(path_1.join('tutorial', '1', '02'));
2424
createFile(path_1.join('tutorial', '1', '02', 'page-two.md'));
25-
createFolder(path_1.join('tutorial', 'common'));
26-
createFile(path_1.join('tutorial', 'common', 'loadJS.js'));
2725
}
2826
exports.createTutorialMd = createTutorialMd;
2927
function createPackageJson(name) {

lib/docs/docs.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

lib/list/list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22
var chalk_1 = require('chalk');
33
function tutorials() {
4-
console.log('List of tutorial packages...');
5-
console.log(chalk_1.red('"Tutorials" feature not implemented yet.'));
4+
process.stdout.write('List of tutorial packages... \n');
5+
process.stdout.write(chalk_1.red('"Tutorials" feature not implemented yet.'));
66
}
77
exports.tutorials = tutorials;

lib/publish/publish.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var chalk_1 = require('chalk');
33
var validate_1 = require('./validate');
44
function publish(version) {
55
validate_1.default(version);
6-
console.log("Publishing package version \"" + version + "\"...");
6+
process.stdout.write("Publishing package version \"" + version + "\"... \n");
77
console.log(chalk_1.yellow('Publish feature not implemented yet.\n'));
88
console.log('To publish your tutorial package follow these instructions: \n');
99
console.log("Setup a git repo and tag your version:\n > git init\n > git add -A\n > git commit -m \"$your-commit-message$\"\n > git tag v" + version + "\n > git add remote origin http://github.com/$your-github-id$/$your-package-name$\n > git push -u --tags\n ");

lib/run/run.js

Whitespace-only changes.

lib/update/update.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"use strict";
2+
function checkForUpdate() {
3+
}
4+
exports.checkForUpdate = checkForUpdate;

src/cli.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#! /usr/bin/env node
22

33
import * as program from 'commander';
4-
import {grey} from 'chalk';
4+
import {grey, green} from 'chalk';
55
import build from './build/build';
66
import create from './create/create';
77
import search from './search/search';
88
import tutorials from './tutorials/tutorials';
99
import publish from './publish/publish';
10+
import {checkForUpdate} from './update/update';
1011

1112
program
1213
.version('0.3.27')
@@ -20,6 +21,8 @@ program
2021

2122
.parse(process.argv);
2223

24+
checkForUpdate();
25+
2326
if (!program.args.length &&
2427
!program.build && !program.tutorials && !program.run) {
2528
program.help();
@@ -29,9 +32,8 @@ if (!program.args.length &&
2932
if (program.build) {
3033
const tutorial = program.args[0] || 'tutorial/tutorial.md';
3134
const output = 'coderoad.json';
32-
console.log(grey(`building from ${tutorial}...`));
35+
process.stdout.write(grey(`building coderoad.json for ${tutorial}...`));
3336
build(tutorial, output);
34-
console.log(grey(`build complete: coderoad.json`));
3537
}
3638

3739
// create
@@ -54,5 +56,7 @@ if (!program.args.length &&
5456
publish(version);
5557
}
5658

59+
process.stdout.write(green(' ✓\n'));
60+
5761
process.exit(0);
5862
}

src/create/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function create(name: string): void {
77
validatePackageName(name);
88

99
// continue
10-
console.log('Creating demo tutorial...');
10+
process.stdout.write(`Creating demo tutorial "coderoad-${name}"...`);
1111

1212
// npm package
1313
createPackageJson(name);

src/create/write-demo.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ export function createTutorialMd(): void {
2424
createFile(join('tutorial', '1', '01', 'page-one.md'));
2525
createFolder(join('tutorial', '1', '02'));
2626
createFile(join('tutorial', '1', '02', 'page-two.md'));
27-
createFolder(join('tutorial', 'common'));
28-
createFile(join('tutorial', 'common', 'loadJS.js'));
2927
}
3028

3129
export function createPackageJson(name: string): void {

src/list/list.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {red} from 'chalk';
22

33
export function tutorials(): void {
4-
console.log('List of tutorial packages...');
5-
console.log(red('"Tutorials" feature not implemented yet.'));
4+
process.stdout.write('List of tutorial packages... \n');
5+
process.stdout.write(red('"Tutorials" feature not implemented yet.'));
66
}

src/publish/publish.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import validateVersion from './validate';
33

44
export default function publish(version: string): void {
55
validateVersion(version);
6-
console.log(`Publishing package version "${version}"...`);
6+
process.stdout.write(`Publishing package version "${version}"... \n`);
77
console.log(yellow('Publish feature not implemented yet.\n'));
88
console.log('To publish your tutorial package follow these instructions: \n');
99
console.log(`Setup a git repo and tag your version:

src/update/update.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {green} from 'chalk';
2+
3+
export function checkForUpdate() {
4+
// TODO: NPM outdated
5+
// if () {
6+
// console.log(green(''));
7+
// }
8+
}

tsconfig.json

Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,54 @@
11
{
2-
"compilerOptions": {
3-
"target": "ES5",
4-
"module": "commonjs",
5-
"removeComments": true,
6-
"noResolve": true,
7-
"outDir": "lib"
8-
},
9-
"compileOnSave": true,
10-
"buildOnSave": true,
11-
"filesGlob": [
12-
"src/*.ts",
13-
"src/**/*.ts"
14-
],
15-
"files": [
16-
"src/cli.ts",
17-
"src/build/build.ts",
18-
"src/build/lint.ts",
19-
"src/build/parser/actions.ts",
20-
"src/build/parser/chapter.ts",
21-
"src/build/parser/cleanup.ts",
22-
"src/build/parser/import.ts",
23-
"src/build/parser/info.ts",
24-
"src/build/parser/match.ts",
25-
"src/build/parser/page.ts",
26-
"src/build/parser/task.ts",
27-
"src/build/readme.ts",
28-
"src/build/validators.ts",
29-
"src/create/create.ts",
30-
"src/create/validate.ts",
31-
"src/create/write-demo.ts",
32-
"src/list/list.ts",
33-
"src/publish/publish.ts",
34-
"src/publish/validate.ts",
35-
"src/search/search.ts",
36-
"src/search/validate.ts",
37-
"src/tools/file.ts",
38-
"src/tutorials/tutorials.ts",
39-
"src/typings/chalk/chalk.d.ts",
40-
"src/typings/commander/commander.d.ts",
41-
"src/typings/cr.d.ts",
42-
"src/typings/globals.d.ts",
43-
"src/typings/node/node.d.ts",
44-
"src/typings/prompt/prompt.d.ts",
45-
"src/typings/tsd.d.ts"
46-
],
47-
"exclude": [
48-
"node_modules"
49-
],
50-
"atom": {
51-
"rewriteTsconfig": true
52-
}
2+
"compilerOptions": {
3+
"target": "ES5",
4+
"module": "commonjs",
5+
"removeComments": true,
6+
"noResolve": true,
7+
"outDir": "lib"
8+
},
9+
"compileOnSave": true,
10+
"buildOnSave": true,
11+
"filesGlob": [
12+
"src/*.ts",
13+
"src/**/*.ts"
14+
],
15+
"files": [
16+
"src/cli.ts",
17+
"src/build/build.ts",
18+
"src/build/lint.ts",
19+
"src/build/parser/actions.ts",
20+
"src/build/parser/chapter.ts",
21+
"src/build/parser/cleanup.ts",
22+
"src/build/parser/import.ts",
23+
"src/build/parser/info.ts",
24+
"src/build/parser/match.ts",
25+
"src/build/parser/page.ts",
26+
"src/build/parser/task.ts",
27+
"src/build/readme.ts",
28+
"src/build/validators.ts",
29+
"src/create/create.ts",
30+
"src/create/validate.ts",
31+
"src/create/write-demo.ts",
32+
"src/list/list.ts",
33+
"src/publish/publish.ts",
34+
"src/publish/validate.ts",
35+
"src/search/search.ts",
36+
"src/search/validate.ts",
37+
"src/tools/file.ts",
38+
"src/tutorials/tutorials.ts",
39+
"src/typings/chalk/chalk.d.ts",
40+
"src/typings/commander/commander.d.ts",
41+
"src/typings/cr.d.ts",
42+
"src/typings/globals.d.ts",
43+
"src/typings/node/node.d.ts",
44+
"src/typings/prompt/prompt.d.ts",
45+
"src/typings/tsd.d.ts",
46+
"src/update/update.ts"
47+
],
48+
"exclude": [
49+
"node_modules"
50+
],
51+
"atom": {
52+
"rewriteTsconfig": true
53+
}
5354
}

0 commit comments

Comments
 (0)