-
Notifications
You must be signed in to change notification settings - Fork 588
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
Standard Package Structure #32
Comments
In the latest build 3093 all snippets have been moved to |
I actually like the idea of this structure |
@gerardroche (2) is for backwards compatibility? |
Backwards compatibility doesn't make sense here cause this repo is only for Build 3092 and later. |
@pradyunsg I updated my draft. |
Backwards compat. is not really the issue. Though, ST commands will only load from the root folder. I just don't think this needs to be a rule. A guideline maybe. Plugin guidelines and best practices is a supplementary information to the standard structure. |
That makes sense... It is indeed more apt as guideline. |
I'm mostly fine with the strucutre, but I have a few questions and things to consider:
Regarding your question list in OP:
@jrappen, for chronological reasons it would have been better if you did not modify your first draft in place but rather posted it here as a comment (which is also more on topic). |
This structure when done could go in the wiki. |
Regarding python rules: I guess I worded this a bit strongly. We can not enforce any rules in regard to this because authors can do pretty much whatever. Similarly with the entire structure guidelines. Unless ST wanted to break compatibility with all (!) packages, these need to stay guidelines. Also, I guess I was more talking about template classes than mixins because mixins wouldn't be directly subclassing commands. |
@FichteFoll fair enough, will do. I simply was opposed to the idea of reposting walls of text for people to spot the difference. Maybe adding a As of right now this discussion lacks feedback from Jon and which would be a great help moving forward. |
@FichteFoll
@jrappen Also, We could post something like a diff for the marking (<- need a better word) changes... I'll change the draft heading in the OP to the "Initial Draft" if that sounds good... Edit: And change it to the initial draft we had on this post. Just an example of the last update: @@ -11,9 +11,6 @@
*.hidden-tmTheme
/commands
*.sublime-commands
+ *.tmCommand
+ /drag-commands
+ *.tmDragCommand
/keymaps
*.sublime-keymap
/lib @gerardroche Putting the conclusions into the Wiki sounds good... The wiki should be linked to from Package Control Docs as well, for easier referencing. Edit: On second thought, that's obvious... 😅 This structure will not be enforced and shall remain only a guideline for near future. These may be enforced at some future date (with a future version of ST possibly) if seen appropriate by the relevant people (one could, in theory enforce this on packages in Package Control). Should Probably Jon is the best person to answer this next one: |
FichteFoll is right, these are all guidelines. ST will never enforce these on users. I've been using words like "rules", "mandatory" and "guidelines" which I probably shouldn't have. The way I see it, all default packages should conform to the standard directory structure, whereas it is only a recommended structure for third party packages. |
@@ -30,6 +30,8 @@
/mousemaps
*.sublime-mousemap
+ /projects
+ *.sublime-project
/settings
*.sublime-settings |
Disagree with In that sense, you might as well make folders for |
I agree with @FichteFoll, a project should have exactly one Carrying from his comment, there should be exactly one README and ideally only one LICENSE in a project. So, the same reasoning applies. |
@@ -11,8 +11,9 @@
/commands
*.sublime-commands
-/keymaps
+/inputmaps
*.sublime-keymap
+ *.sublime-mousemap
/lib
*.py
@@ -26,7 +27,6 @@
/metadata
*.tmPreferences
- /mousemaps
- *.sublime-mousemap
/settings
*.sublime-settings |
To reiterate some of my earlier concerns, I would:
Regarding plugins, I imagine the following:
Other concerns:
This leaves us with the following structure (not diffed because formatting change):
|
There's a small issue with this arrangement. For selecting Color Schemes arranged according this arrangement, one has to navigate through an extra level of menus, if you try to select one through the Preferences menu-option. |
True. I also don't know if themes can actually be in any subfolder and still be picked up. We could make exceptions for packages that only contain color schemes and themes (with these as the main purpose). Other packages that implement the color schemes on a programmatical basis, or via setting of some custom syntaxes, they could still be in the subfolder since they hardly get selected manually. |
Themes work in sub-directories. (Tested with Soda moved into a sub-folder of another temporary package; renamed one theme-file, changed tab-height and applied the renamed theme.) So, I'm thinking:
Diff from @FichteFoll 's version @@ -6,9 +6,6 @@
*.*
build/
*.sublime-build
-color-schemes/
- *.tmTheme
- *.hidden-tmTheme
commands/
*.sublime-commands
completions/
@@ -30,6 +27,7 @@
*.tmPreferences
other/
*.*
+ *.hidden-tmTheme # Auto-generated
settings/
*.sublime-settings
snippets/
@@ -47,6 +45,7 @@
*.sublime-syntax
themes/
*.sublime-theme
+*.tmTheme # Non auto-generated
.gitignore # git
.gitattributes # git
.no-sublime-package # Package Control Deviating slightly from the topic, on the "core"/closed-source part, I think there should be a change to make the loading of colour-schemes more consistent with the rest of the things like settings and themes. (And while he's at it, Jon might make a new, nicer syntax for defining colour-schemes 😉) /cc @sublimehq |
For nicer syntax for color schemes, I found CSS (and their pre-processor languages SCSS/Stylus) to be rather convenient. Other than that I have to agree that tmTheme files should probably be added to the package root. |
@FichteFoll I |
From a usability standpoint, I don't think adding a bunch of folders adds anything, but instead tends to make it harder to understand what a package contains. Browsing around various Atom, Textmate and VS Code packages, I find it weird to have to drill down into subfolders to see a single syntax or completion file. There are certainly circumstances where subfolders are a good idea. Snippets are a specific case where it definitely helps. We've recently moved the rest of the snippets into subfolders in this repo. I've considered a folder for tests, however I found value in having single large tests files as opposed to a lot of little ones. It can help catch bugs that won't be found when just testing all numbers, or all string variations. Those contexts tend to be fairly easy to get right anyway. It is the larger, I think some of these ideas could be really helpful for some packages. My recommendation would be to use them as you see fit. I don't see us ever enforcing this since it would break backwards compatibility. With these comments, I don't see there being any other action item, and in the interest of whittling down the list of issues to actionable things, I am going to close this. |
(JSON-based) |
The idea is that Packages in Sublime Text should be arranged in a standard way which may be optionally/partially enforced, like in other text-editors like TextMate 2 or Atom.
Since having too many files in the root directory of the Package creates a lot of noise, the various types of files should be moved into sub-directories in the package. While reducing noise in the root directory, it also makes the Package arrangement feel more organized.
Things worth more discussion (IMO):Some initial questions regarding the structure:
Can tests for the Python code be placed in "/lib/tests" and syntax tests be placed in "/syntaxes/tests" instead?
Should it be only one, with the same name as Package ({name}/{name}.py) and it should include everything that it wishes Sublime Text (and other plugins?) to know about...
Should they be CamelCase or snake_case or hypenated-names?
/cc @Jappen @FichteFoll @aziz @jbrooksuk @gerardroche @sublimehq
Initial Draft
(Based on @jrappen's original suggestion)
The text was updated successfully, but these errors were encountered: