volojs / volo

Create front end projects from templates, add dependencies, and automate the resulting projects
https://volojs.github.io/
Other
1.41k stars 100 forks source link

.ts files are always downloaded #197

Closed jbblanchet closed 9 years ago

jbblanchet commented 9 years ago

Like I said in the previous issue, I'm using volo to download TypeScript definition files. When running volo add, the files are always re-downloaded even if already present. I do not have this problem with .js files.

jrburke commented 9 years ago

I did the following:

volo create ts
cd ts
volo add borisyankov/DefinitelyTyped#q/Q.d.ts defs/Q.d
volo add borisyankov/DefinitelyTyped#q/Q.d.ts defs/Q.d

The second one prints out a message that it is already installed. I get the following message:

Skipping installed of www/lib/defs/Q.d.ts already exists. To install anyway, pass -f to the commandInstalled github:borisyankov/DefinitelyTyped/master#q/Q.d.ts at www/lib/defs/Q.d.ts
AMD dependency name: defs/Q.d.ts

Looks like I need fix the formatting of the message, but it says it skipped install because it is already installed. I verified this by modifying the Q.d.ts file then running the add command again, and the modifications were still there.

If you have different steps I should use, pass them along and we can reopen as necessary.

jbblanchet commented 9 years ago

My description of the problem wasn't clear enough, sorry about that.

Let's say I have to following volo section in my package.json file:

"volo": {
    "baseUrl": "lib",
    "dependencies": {
      "jquery": "github:jquery/jquery/2.1.1",
      "q": "github:kriskowal/q/v1.0.1",
      "knockout": "github:knockout/knockout/v3.2.0#dist/knockout.debug.js",
      "require": "github:jrburke/requirejs/2.1.15",
      "def/jquery.d": "github:borisyankov/DefinitelyTyped/master#jquery/jquery.d.ts",
      "def/express.d": "github:borisyankov/DefinitelyTyped/master#express/express.d.ts",
      "def/body-parser.d": "github:borisyankov/DefinitelyTyped/master#body-parser/body-parser.d.ts",
      "def/node.d": "github:borisyankov/DefinitelyTyped/master#node/node.d.ts",
      "def/Q.d": "github:borisyankov/DefinitelyTyped/master#q/Q.d.ts",
      "def/tv4.d": "github:borisyankov/DefinitelyTyped/master#tv4/tv4.d.ts"
    }
  }

If I delete my lib directory and run volo add, I'll get the following output. All files were downloaded and installed:

Downloading: http://code.jquery.com/jquery-2.1.1.js
Downloading: https://codeload.github.com/kriskowal/q/legacy.zip/v1.0.1
Downloading: https://raw.githubusercontent.com/knockout/knockout/v3.2.0/dist/knockout.debug.js
Downloading: https://raw.githubusercontent.com/jrburke/requirejs/2.1.15/require.js
Downloading: https://raw.githubusercontent.com/borisyankov/DefinitelyTyped/master/jquery/jquery.d.ts
Downloading: https://raw.githubusercontent.com/borisyankov/DefinitelyTyped/master/express/express.d.ts
Downloading: https://raw.githubusercontent.com/borisyankov/DefinitelyTyped/master/body-parser/body-parser.d.ts
Downloading: https://raw.githubusercontent.com/borisyankov/DefinitelyTyped/master/node/node.d.ts
Downloading: https://raw.githubusercontent.com/borisyankov/DefinitelyTyped/master/q/Q.d.ts
Downloading: https://raw.githubusercontent.com/borisyankov/DefinitelyTyped/master/tv4/tv4.d.ts

Installed github:jquery/jquery/2.1.1 at lib\jquery.js
Installed github:kriskowal/q/v1.0.1 at lib\q.js
Installed github:knockout/knockout/v3.2.0#dist/knockout.debug.js at lib\knockout.js
Installed github:jrburke/requirejs/2.1.15 at lib\require.js
Installed github:borisyankov/DefinitelyTyped/master#jquery/jquery.d.ts at lib\def\jquery.d.ts
Installed github:borisyankov/DefinitelyTyped/master#express/express.d.ts at lib\def\express.d.ts
Installed github:borisyankov/DefinitelyTyped/master#body-parser/body-parser.d.ts at lib\def\body-parser.d.ts
Installed github:borisyankov/DefinitelyTyped/master#node/node.d.ts at lib\def\node.d.ts
Installed github:borisyankov/DefinitelyTyped/master#q/Q.d.ts at lib\def\Q.d.ts
Installed github:borisyankov/DefinitelyTyped/master#tv4/tv4.d.ts at lib\def\tv4.d.ts

Now, if I run volo add a second time, I'll get the following output. Volo recognized that the .js files were already present and does not redownload them, but this logic isn't applied to the .ts files, so they are redownloaded and then skipped:

Downloading: https://raw.githubusercontent.com/borisyankov/DefinitelyTyped/master/jquery/jquery.d.ts
Downloading: https://raw.githubusercontent.com/borisyankov/DefinitelyTyped/master/express/express.d.ts
Downloading: https://raw.githubusercontent.com/borisyankov/DefinitelyTyped/master/body-parser/body-parser.d.ts
Downloading: https://raw.githubusercontent.com/borisyankov/DefinitelyTyped/master/node/node.d.ts
Downloading: https://raw.githubusercontent.com/borisyankov/DefinitelyTyped/master/q/Q.d.ts
Downloading: https://raw.githubusercontent.com/borisyankov/DefinitelyTyped/master/tv4/tv4.d.ts

Skipping installed of lib\def\jquery.d.ts already exists. To install anyway, pass -f to the commandInstalled github:borisyankov/DefinitelyTyped/master#jquery/jquery.d.ts at lib\def\jquery.d.ts
Skipping installed of lib\def\express.d.ts already exists. To install anyway, pass -f to the commandInstalled github:borisyankov/DefinitelyTyped/master#express/express.d.ts at lib\def\express.d.ts
Skipping installed of lib\def\body-parser.d.ts already exists. To install anyway, pass -f to the commandInstalled github:borisyankov/DefinitelyTyped/master#body-parser/body-parser.d.ts at lib\def\body-parser.d.ts
Skipping installed of lib\def\node.d.ts already exists. To install anyway, pass -f to the commandInstalled github:borisyankov/DefinitelyTyped/master#node/node.d.ts at lib\def\node.d.ts
Skipping installed of lib\def\Q.d.ts already exists. To install anyway, pass -f to the commandInstalled github:borisyankov/DefinitelyTyped/master#q/Q.d.ts at lib\def\Q.d.ts
Skipping installed of lib\def\tv4.d.ts already exists. To install anyway, pass -f to the commandInstalled github:borisyankov/DefinitelyTyped/master#tv4/tv4.d.ts at lib\def\tv4.d.ts

You're right that the end result is the same, but I was expecting (maybe wrongly) the same behavior for the .ts and .js files.