Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can-migrate does not appear to function on Windows #109

Open
RyanMilligan opened this issue Jun 25, 2018 · 3 comments
Open

can-migrate does not appear to function on Windows #109

RyanMilligan opened this issue Jun 25, 2018 · 3 comments

Comments

@RyanMilligan
Copy link

When I attempt to run can-migrate on my Windows machine, I get the following output:

> can-migrate "**/*.js" --apply --can-version 3
Running transform: undefined.
0 / 43 files modified (0 errors).
Percent complete: 1%.
Time remaining: 1018 seconds.

Running transform: undefined.
0 / 43 files modified (0 errors).
Percent complete: 2%.
Time remaining: 947 seconds.

Running transform: undefined.
0 / 43 files modified (0 errors).
Percent complete: 3%.
Time remaining: 921 seconds.

The same happens with --can-version 4. @chasenlehara indicated that this issue may be specific to Windows.

@phillipskevin
Copy link
Contributor

@RyanMilligan is the code for your app available on github or anywhere else?

@phillipskevin
Copy link
Contributor

One thing you can try is installing [email protected]. It could be something I broke when I was working on the output recently.

This is almost definitely something I caused:

Running transform: undefined.

This code:

function getReadableTransformName(transformFile) {
var file = transformFile.split('.js')[0];
var parts = file.split('lib/transforms/');
return parts[1];
}

should use path to get the name of the file so that it works cross-OS.

@phillipskevin
Copy link
Contributor

@RyanMilligan I tested out can-migrate on windows and other than the issue with the undefined transform names, it worked ok.

If you can push your project to github, I can take a look at why it's not working.

Here's the output from running can-migrate on canjs/chat@3:

C:\Users\kevin-pc\dev\chat>can-migrate "src/**/*.js" --apply --can-version 4
Running transform: undefined.
0 / 12 files modified (0 errors).
Percent complete: 10%.
Time remaining: 25 seconds.

Running transform: undefined.
0 / 12 files modified (0 errors).
Percent complete: 20%.
Time remaining: 23 seconds.

Running transform: undefined.
0 / 12 files modified (0 errors).
Percent complete: 30%.
Time remaining: 21 seconds.

Running transform: undefined.
1 / 12 files modified (0 errors).
Percent complete: 40%.
Time remaining: 18 seconds.

Running transform: undefined.
0 / 12 files modified (0 errors).
Percent complete: 50%.
Time remaining: 15 seconds.

Running transform: undefined.
0 / 12 files modified (0 errors).
Percent complete: 60%.
Time remaining: 12 seconds.

Running transform: undefined.
0 / 12 files modified (0 errors).
Percent complete: 70%.
Time remaining: 10 seconds.

Running transform: undefined.
0 / 12 files modified (0 errors).
Percent complete: 80%.
Time remaining: 7 seconds.

Running transform: undefined.
0 / 12 files modified (0 errors).
Percent complete: 90%.
Time remaining: 4 seconds.

Running transform: undefined.
0 / 12 files modified (0 errors).
Percent complete: 100%.
Time remaining: 1 seconds.
C:\Users\kevin-pc\dev\chat>can-migrate "src/**/*.stache" --apply --can-version 4
Running transform: undefined.
0 / 3 files modified (0 errors).
Percent complete: 10%.
Time remaining: 1 seconds.

Running transform: undefined.
0 / 3 files modified (0 errors).
Percent complete: 20%.
Time remaining: 1 seconds.

Running transform: undefined.
0 / 3 files modified (0 errors).
Percent complete: 30%.
Time remaining: 2 seconds.

Running transform: undefined.
0 / 3 files modified (0 errors).
Percent complete: 40%.
Time remaining: 2 seconds.

Running transform: undefined.
0 / 3 files modified (0 errors).
Percent complete: 50%.
Time remaining: 2 seconds.

Running transform: undefined.
0 / 3 files modified (0 errors).
Percent complete: 60%.
Time remaining: 1 seconds.

Running transform: undefined.
1 / 3 files modified (0 errors).
Percent complete: 70%.
Time remaining: 1 seconds.

Running transform: undefined.
0 / 3 files modified (0 errors).
Percent complete: 80%.
Time remaining: 1 seconds.

Running transform: undefined.
2 / 3 files modified (0 errors).
Percent complete: 90%.
Time remaining: 1 seconds.

Running transform: undefined.
0 / 3 files modified (0 errors).
Percent complete: 100%.
Time remaining: 1 seconds.
C:\Users\kevin-pc\dev\chat>git diff
diff --git a/src/home/home.stache b/src/home/home.stache
index 103697f..d17a2ab 100644
--- a/src/home/home.stache
+++ b/src/home/home.stache
@@ -1,4 +1,4 @@
-<can-import from="can-stache/helpers/route" />
+<can-import from="can-stache-route-helpers" />

 <h1 class="page-header text-center">
   <img src="https://canjs.com/doc/static/node_modules/bit-docs-html-canjs/static/img/canjs_logo.svg"
diff --git a/src/main.js b/src/main.js
index aeaadb7..e0065a9 100644
--- a/src/main.js
+++ b/src/main.js
@@ -18,7 +18,7 @@ const AppViewModel = CanMap.extend({

 const appState = new AppViewModel();

-route("{page}", { page: "home" });
+route.register("{page}", { page: "home" });
 route.data = appState;
 route.start();

diff --git a/src/messages/messages.stache b/src/messages/messages.stache
index fd6e511..0f476d3 100644
--- a/src/messages/messages.stache
+++ b/src/messages/messages.stache
@@ -1,9 +1,9 @@
-<can-import from="can-stache/helpers/route" />
+<can-import from="can-stache-route-helpers" />
 <can-import from="canjs-chat/models/message" />

 <h5><a href="{{routeUrl page='home'}}">Home</a></h5>

-<message-model get-list="{}" class="list-group">
+<message-model get-list:from='"{}"' class="list-group">
   {{#each ./value}}
     <div class="list-group-item">
       <h4 class="list-group-item-heading">{{name}}</h4>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants