Skip to content

Commit

Permalink
Adding moved project from personal account
Browse files Browse the repository at this point in the history
  • Loading branch information
addyosmani committed Jul 18, 2013
1 parent 8b0d216 commit 6a0b542
Show file tree
Hide file tree
Showing 142 changed files with 54,199 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
./.DS_Store
*.pyc
node_modules
bower_components
/bower_components
dist
.tmp
7 changes: 7 additions & 0 deletions Default (Linux).sublime-keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"keys": ["ctrl+shift+n"],
"__doc__": "Create new project",
"command": "project_maker"
}
]
7 changes: 7 additions & 0 deletions Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"keys": ["ctrl+shift+n"],
"__doc__": "Create new project",
"command": "project_maker"
}
]
7 changes: 7 additions & 0 deletions Default (Windows).sublime-keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"keys": ["ctrl+shift+n"],
"__doc__": "Create new project",
"command": "project_maker"
}
]
6 changes: 6 additions & 0 deletions Default.sublime-commands
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"caption": "SublimeYeoman: Create project",
"command": "project_maker"
}
]
99 changes: 96 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,97 @@
sublime-plugin
==============
Sublime Yeoman
===================

A Sublime Text 2 plug-in to allow creating any kind of project from your own custom templates (based on the former [STProjectMaker](https://github.com/bit101/STProjectMaker)). Currently in alpha.

![](https://f.cloud.github.com/assets/110953/819687/680e6e5e-efb6-11e2-869a-9ffedfb101e4.jpg)

## Currently includes templates for

* AngularJS
* Backbone
* Ember
* Chrome App
* RequireJS
* WebApp

## Limitations

Sublime Yeoman currently ships with samples static templates for a number of different types of projects. These templates are the output of the corresponding Yeoman generators, however we eventually intend on shelling out to the `yo` binary to provide access to all Yeoman community generators.

## Installation

### Manually:

Clone or download this project into a folder named "SublimeYeoman" in your Sublime Text 2 Packages folder. If you're not sure where your Packages folder is, use menu `Preferences/Browse Packages...`

Optionally, set up a key binding. I like to override Control-Shift-N in menu `Preferences/Key Bindings - User`

[
{ "keys": ["ctrl+shift+n"], "command": "project_maker" }
]

## Usage

Invoking the command will show a Quick Panel list of available templates.

Choose the template to base your project on.

You will be prompted to enter a path for your new project. Do so.

You will be prompted for values for any replaceable tokens in any template files or file names. Enter the values you want to use.

Newly created project folder will open in system file manager.

## Creating and Modifying Templates

A template is simply a folder stored in `<sublime packages dir>/SublimeYeoman/Templates/`. It can contain any number and types of files and nested folders of files.

### Tokens

Text files in the template may contain replaceable tokens in the form of `${token_name}`. When you create a new project, you will be prompted for values to use for each token found. The same token can be used multiple times in multiple files. You will only be prompted a single time for its value.

Example:

Hello from ${user_name}

when supplied a value of `Keith` for the `user_name` token will become:

Hello from Keith

### Tokenized File Names

Template file names may also be tokenized using the form `_token_name_.ext`. The leading underscore, token name and trailing underscore will be replaced by the value given.

Example:

/foo/bar/baz/_info_file_.text

when supplied with a value of `data` for the `info_file` token will become:

/foo/bar/baz/data.text


### Predefined Tokens

There are two predefined tokens:

`${{project_path}}` in text files will be replaced by the absolute path of the new project directory.

`${{project_name}` in text files or `_project_name_` as a file name will be replaced by the base name of the project directory.

Example:

Project path is `/foo/bar/baz/MyProject/`

`project_path` will be replaced by `/foo/bar/baz/MyProject/`

`project_name` will be replaced by `MyProject`

### Sublime Project files

If the chosen template has a `.sublime-project` file in the top level, that file will be copied over and processed like any other file in the template. However, if this does not exist, a default `.sublime-project` file will be created using the `project_name` token as its base name.

### Ignored Files

Obviously, you don't want to try to do token replacement in binary files. The plug-in has a long list of file types that it will ignore when doing token replacement. You can always add your own if any files in your templates cause a problem. The list is contained in the `yeoman.sublime.sublime-settings` file. Note, these files _will_ be copied into the project. They will just not be parsed for tokens.

A Sublime Text plugin for Yeoman
3 changes: 3 additions & 0 deletions Templates/AngularApp/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "app/bower_components"
}
21 changes: 21 additions & 0 deletions Templates/AngularApp/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions Templates/AngularApp/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
5 changes: 5 additions & 0 deletions Templates/AngularApp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
.tmp
.sass-cache
app/bower_components
24 changes: 24 additions & 0 deletions Templates/AngularApp/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"globals": {
"angular": false
}
}
Loading

0 comments on commit 6a0b542

Please sign in to comment.