PDA

View Full Version : [FIXED] Workspaces with Sencha Cmd 5



zokeefe
3 Apr 2014, 10:19 AM
Trying to create fresh workspace with 2 pages after install of new Sencha Cmd 5. Note I use the old -sdk switch instead of the new -ext because the new -ext flag results in an error on the second page generation.



$ sencha generate workspace .
Sencha Cmd v5.0.0.114
...
$ sencha -sdk /path/to/ext5 generate app page1 ./dealAnalysis
Sencha Cmd v5.0.0.114
...
$ sencha -sdk /path/to/ext5 generate app page2 ./dealManager
Sencha Cmd v5.0.0.114
...


wrksp/
--.sencha/
--build/
--dealAnalysis/
--dealManager/
--packages/
--ext/

But after that, all hope is lost.


$ cd dealAnalysis
$ sencha app build
Sencha Cmd v5.0.0.114
...
[ERR] Failed to parse CSS 3.0 style sheet: Encountered " "+" "+ "" at line 1, column 10012.Was expecting one of:
<S> ...
")" ...
<S> ...
..


the same command run from dealManager compiles the JS, but navigating to the build index.html I get "XMLHttpRequest cannot load file:///C:/path/to/my/workspace/build/production/DM/app.json (file:///C:/Users/zokeefe/Projects/ipas/client/build/production/DM/app.json). Cross origin requests are only supported for HTTP."

So I try:



$ cd dealAnalysis
$ sencha app watch
Sencha Cmd v5.0.0.114
...
[INF] Waiting for changes...


but visiting http://localhost:1841 loads this:
48551


:(

dongryphon
3 Apr 2014, 11:11 AM
Did you try drilling down into the folders? For example http://localhost:1841/dealManager in this case? That would be the "dev mode" version of that application.

The build also produces http://localhost:1841/build/production/dealManager with all your files concatenated and compressed.

zokeefe
3 Apr 2014, 2:03 PM
Ya, sorry perhaps I wasn't clear - the XHR cross origin requests were coming up when drilling into the page directories from `watch`.

I tried again doing:


Try to generate page1 with -ext flag --> success
Try to generate page2 with -ext flag -->
[ERR] Unable to locate 'framework.dir' property from sencha.cfg
[ERR] Please ensure this command was executed from a valid framework directory
[ERR] Non-framework directory
Try to generate page2 with -sdk switch --> success

Very odd

dongryphon
3 Apr 2014, 2:51 PM
The XHR issue stems from using the file protocol (file://) vs http to browse the app so using the http://localhost:1841/ form is the way to access things w/o those issues.

To help with the other issue, I'd need to see exact command lines and current directories to offer much more than a general suggestion: it sounds as if the first app and the workspace are not quite rightly configured to allow the second app to locate Ext JS. If you try it again in a clean folder, please provide all the commands you run and their output.

zokeefe
3 Apr 2014, 3:14 PM
Try to reproduce using clean directory. (Windows 7 x64)



$ mkdir ext5
$ cd ext5
$ sencha generate workspace .
Sencha Cmd v5.0.0.114
$ dir
Volume in drive C is OSDisk
Volume Serial Number is F4F8-E008

Directory of C:\Users\me\Projects\ext5

04/03/2014 04:05 PM <DIR> .
04/03/2014 04:05 PM <DIR> ..
04/03/2014 04:03 PM <DIR> .sencha
04/03/2014 04:03 PM <DIR> packages
0 File(s) 0 bytes
4 Dir(s) 406,360,555,520 bytes free

$ sencha generate app -ext Page1 ./page1
Sencha Cmd v5.0.0.114
[INF] Workspace does not have framework ext at C:\Users\me\Projects\ext5 ... copying
[INF] Loading app json manifest...
[INF] Writing content to C:\Users\me\Projects\ext5\page1/bootstrap.js
[INF] Writing content to C:\Users\me\Projects\ext5\page1/bootstrap.json

$ dir
Volume in drive C is OSDisk
Volume Serial Number is F4F8-E008

Directory of C:\Users\me\Projects\ext5

04/03/2014 04:10 PM <DIR> .
04/03/2014 04:10 PM <DIR> ..
04/03/2014 04:03 PM <DIR> .sencha
04/03/2014 04:10 PM <DIR> build
04/03/2014 04:09 PM <DIR> ext
04/03/2014 04:03 PM <DIR> packages
04/03/2014 04:10 PM <DIR> page1
0 File(s) 0 bytes
7 Dir(s) 406,286,143,488 bytes free

$ sencha generate app -ext Page2 ./page2
Sencha Cmd v5.0.0.114
[ERR] Unable to locate 'framework.dir' property from sencha.cfg
[ERR] Please ensure this command was executed from a valid framework directory
[ERR] Non-framework directory

dongryphon
3 Apr 2014, 3:25 PM
Moved to bugs forum

dongryphon
3 Apr 2014, 3:30 PM
Thanks for the report! I have opened a bug in our bug tracker.

zokeefe
3 Apr 2014, 3:40 PM
Thanks for being so fast and helpful with this!

zokeefe
3 Apr 2014, 3:54 PM
Just to reiterate the current workaround I'm using;

Download Ext 5.0.0 (.746)
You can use -ext for the first page generation
For generating pages 2, 3, .., n, you need to use the -sdk switch and link to your downloaded Ext5 sdk

dongryphon
3 Apr 2014, 4:07 PM
Sure thing - the details make it easy. :)

I think the following is what you are saying does work for 2nd+ app right?



$ dir
Volume in drive C is OSDisk
Volume Serial Number is F4F8-E008

Directory of C:\Users\me\Projects\ext5

04/03/2014 04:10 PM <DIR> .
04/03/2014 04:10 PM <DIR> ..
04/03/2014 04:03 PM <DIR> .sencha
04/03/2014 04:10 PM <DIR> build
04/03/2014 04:09 PM <DIR> ext
04/03/2014 04:03 PM <DIR> packages
04/03/2014 04:10 PM <DIR> page1
0 File(s) 0 bytes
7 Dir(s) 406,286,143,488 bytes free

$ sencha -sdk ext generate app Page2 ./page2
...


The key being that the "-sdk" switch operates on the local file system only (and hence the "ext" directory in this case). The (new) "-ext" switch is the one that does not find the existing, local "ext" folder.

Is that a fair restatement of what you are seeing?

zokeefe
3 Apr 2014, 4:14 PM
Yes, that is correct