Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1244] Alloy: "alloy new" should remove/empty "Resources" folder

GitHub Issuen/a
TypeImprovement
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sAlloy 1.5.1
Fix Version/sn/a
ComponentsTooling
Labelsn/a
ReporterFokke Zandbergen
AssigneeTim Poulsen
Created2015-02-14T13:57:46.000+0000
Updated2015-07-31T21:09:44.000+0000

Description

When you convert a classic project in an Alloy project, the classic Resources/app.js file will remain untouched because Alloy works with Resources/\[platform\]/app.js. While this isn't a problem, it is really confusing for new users, wondering if that code will be executed.

Solution

It would be better if running alloy new would delete or empty the Resources folder. As per [~sfeather]'s suggestion this might be improved upon by letting the user confirm he's aware Resources folder will be deleted and/or renaming it to e.g. Resources (classic) so it is preserved. This would also improve the current situation where the first time the user runs alloy compile or ti build he will lose his classic files as well.

To reproduce

Execute the following in a temporary directory:
ti create -t app -p ios -n res --id test.res -d . -u http://appcelerator.com
cd res
alloy new
ti build -p ios -b
cd Resources
nano app.js
You'll see that even after alloy compiles Resources/app.js is still the default classic app.js.

Comments

  1. Stephen Feather 2015-02-15

    alloy new should NOT be destructive. If a user is converting a classic to alloy, their old project would be IN Resources, and they may have forgotten to move the contents themselves, and now Alloy has eaten it. This is a bad idea.
  2. Fokke Zandbergen 2015-02-15

    Although alloy new currently is NOT destructive, the next time you run ti build the Resources folder IS destructed, apart from the app.js file. So I don't see much difference. The UX could even improve if alloy new would prompt the user to confirm Resources to be destructed.
  3. Stephen Feather 2015-02-15

    "So I don't see much difference." 1. Your ticket is not for ti build it is for alloy new. 2. The behavior of ti build is a different stage of development, namely building, not converting. 3. A user converting a project from classic to alloy doesn't have a place to put their old files in the new structure until alloy new has been run. If you are looking for a consumer/user friendly solution, take the contents of the classic Resources, move/rename/place them in Resources.classic or Resources.old to protect/preserve them, create the alloy structure as before and if purging Resources is so important to you, do it.
  4. Fokke Zandbergen 2015-02-15

    By not much different I mean: * Current: you lose the classic files (except for app.js) as soon as you do ti build or alloy compile after alloy new * Proposed: you lose the classic files as soon as you do alloy new I agree that if you're unaware that Alloy soon or later will clean Resources, both the current and proposed situation might surprise users and cause them to lose their classic files (if they're not using versioning or backups). So I've updated the ticket to ask for the user to confirm or for the current Resources directory to be renamed. Thanks for that suggestion Stephen!

JSON Source