Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite87de1a

Browse files
committed
update version, find tutorials returns "latest" version string and "isLatest" bool
1 parent24015b3 commite87de1a

File tree

7 files changed

+30
-15
lines changed

7 files changed

+30
-15
lines changed

‎.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
node_modules
22
npm-debug.log
3+
.DS_Store
4+
.vscode

‎.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
node_modules
2+
npm-debug.log
3+
.DS_Store
4+
.vscode
5+
16
src
27
test
38
tsd.json

‎CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
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.9.1] - 2016-09-15
6+
- find tutorials now returns "isLatest" (bool) & "latest": (string of version)
7+
58
##[0.9.0] - 2016-08-16
69
- add@actions: write, writeFromFile
710

‎lib/tutorials/find-tutorials.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@ function findTutorials(dir, deps) {
1313
console.log("Error with "+name+": no package.json file found.");
1414
return{
1515
name:name,
16-
version:'NOT INSTALLED'
16+
version:'NOT INSTALLED',
17+
latest:'NOT INSTALLED',
18+
isLatest:true,
1719
};
1820
}
19-
vartutorialPackageJson=JSON.parse(fs_1.readFileSync(pathToTutorialPackageJson,'utf8'));
20-
varversion=tutorialPackageJson.version;
21+
varversion=JSON.parse(fs_1.readFileSync(pathToTutorialPackageJson,'utf8')).version;
2122
return{
2223
name:name,
2324
version:version,
24-
latest:false
25+
latest:version,
26+
isLatest:true,
2527
};
2628
}));
2729
}

‎package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name":"coderoad-cli",
3-
"version":"0.9.0",
3+
"version":"0.9.1",
44
"description":"Command line interface for CodeRoad. Build project files.",
55
"keywords": [
66
"coderoad"
@@ -35,7 +35,6 @@
3535
"atom-plugin-command-line":"1.0.2",
3636
"chalk":"1.1.3",
3737
"commander":"2.9.0",
38-
"lodash.kebabcase":"4.1.1",
3938
"node-file-exists":"1.1.0",
4039
"prompt":"1.0.0",
4140
"sort-package-json":"^1.4.0",

‎src/tutorials/find-tutorials.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ export default function findTutorials(
88
dir:string,deps:Object
99
):Tutorial.Info[]{
1010
if(!!deps&&Object.keys(deps).length>0){
11-
return(Object.keys(deps)
12-
11+
return(
12+
Object.keys(deps)
1313
// map over possible tutorials
1414
// filter to only packages with a coderoad.json file
1515
.filter((name:string)=>isTutorial(dir,name))
16-
.map(function(name:string){
16+
.map((name:string)=>{
1717
constpathToTutorialPackageJson=join(
1818
dir,'node_modules',name,'package.json'
1919
);
@@ -24,21 +24,24 @@ export default function findTutorials(
2424
);
2525
return{
2626
name,
27-
version:'NOT INSTALLED'
27+
version:'NOT INSTALLED',
28+
latest:'NOT INSTALLED',
29+
isLatest:true,
2830
};
2931
}
3032

31-
lettutorialPackageJson=JSON.parse(
33+
let{ version}=JSON.parse(
3234
readFileSync(pathToTutorialPackageJson,'utf8')
3335
);
34-
constversion=tutorialPackageJson.version;
3536

3637
return{
3738
name,
3839
version,
39-
latest:false// !!canUpdateTutorial(name, version)
40+
latest:version,
41+
isLatest:true,
4042
};
41-
}));
43+
})
44+
);
4245
}else{
4346
return[];
4447
}

‎src/typings/cr/tutorial.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ declare namespace Tutorial {
22
interfaceInfo{
33
name:string;
44
version:string;
5-
latest?:boolean;
5+
latest?:string;
6+
isLatest:boolean;
67
description?:string;
78
keywords?:string[];
89
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp