Browse Source

Merge branch 'master' into silk

Herbert Vojčík 9 years ago
parent
commit
bdc284cfc3
6 changed files with 81 additions and 19 deletions
  1. 9 11
      README.md
  2. 1 2
      root/Gruntfile.js
  3. 5 3
      root/index.html
  4. 24 0
      root/parts.html
  5. 39 0
      root/uninstall.html
  6. 3 3
      template.js

+ 9 - 11
README.md

@@ -1,22 +1,20 @@
 # [Amber Smalltalk](http://amber-lang.net) application generator.
 
+The intention of this tool is to automate the creation of Amber projects.
+This tool is based on [grunt-init](http://gruntjs.com/project-scaffolding).
 
-## Installation (the Amber way)
+It is conveniently integrated into the `amber-cli` commandline tool, which should be preferred over using this project directly with `grunt-init`.
 
-If you want to go the completely integrated Amber way you should not use this grunt-init template directly.
-Use [amber-cli](https://www.npmjs.org/package/amber-cli) instead.
-Installation is done via `(sudo) npm install -g amber-cli`
-(in case you have old Amber CLI installed from `amber` package itself, which is now defunct,
-you should uninstall it first with `(sudo) npm uninstall -g amber`).
+Installation and initial getting started instructions can be found [here](https://www.npmjs.com/package/amber#getting-amber).
 
-Then you can stop reading here and jump over to the amber-cli documentation.
 
+#### Read on if you insist on doing it the [grunt-init](http://gruntjs.com/project-scaffolding) way
 
-## Installation (the [Grunt](http://gruntjs.com/project-scaffolding) way)
+Please note that `amber-cli` performs some additional project creation steps which you will be missing if you continue this way.
 
 Install [grunt-init](http://gruntjs.com/project-scaffolding) if you have not already done so.
 
-Place this template in your `~/.grunt-init/` directory after installing grunt-init with the following command.
+Place this template in your `~/.grunt-init/` directory using the following command:
 
 ```
 git clone git://github.com/amber-smalltalk/grunt-init-amber.git ~/.grunt-init/amber
@@ -25,11 +23,11 @@ git clone git://github.com/amber-smalltalk/grunt-init-amber.git ~/.grunt-init/am
 _Windows users, see [the grunt-init documentation](http://gruntjs.com/project-scaffolding) for the correct directory destination_
 
 
-At the command-line, cd into an empty directory, run this command and follow the prompts.
+At the command-line, change into an empty directory, run this command and follow the prompts.
 
 ```
 grunt-init amber
 ```
 
-_Note that this template will generate files in the current directory,
+_Note: this template will generate files in the current directory,
 so be sure to change to a new directory first if you do not want to overwrite existing files._

+ 1 - 2
root/Gruntfile.js

@@ -28,8 +28,7 @@ module.exports = function (grunt) {
         amberc: {
             options: {
                 amber_dir: path.join(__dirname, "bower_components", "amber"),
-                library_dirs: ['src', 'bower_components/amber/contrib/src'],
-                closure_jar: ''
+                library_dirs: ['src', 'bower_components/amber/contrib/src']
             },
             all: {
                 src: [

+ 5 - 3
root/index.html

@@ -9,9 +9,11 @@
   </head>
 
   <body>
-  <p>Hi, {%= author_name %}! Welcome to Amber project: "{%= title %}".</p>
-  <p>This is the place for your application's HTML. After getting familiar with Amber,
-      just remove this welcome contents from index.html and replace it with your own.</p>
+  <p>This is a sample app. It contains some
+  <a href="parts.html">batteries included</a>
+  and should be
+  <a href="uninstall.html">cleaned up</a>
+  once you start developing your own  app / lib.</p>
   <button id="amber-with">Hello from TagBrush >> with:</button>
   <button id="silk-tag">Hello from Silk >> TAG:</button>
   <button id="jquery-append">Hello from jQuery append</button>

+ 24 - 0
root/parts.html

@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+    <title>{%= title %}</title>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+    <meta name="author" content="{%= author_name %}" />
+  </head>
+
+  <body>
+  <p>The sample app contains three additional parts beyond Amber itself:</p>
+  <ul style="width: 40ex">
+      <li>The elements in <code>index.html</code>
+          <code>&lt;body&gt;</code> tag.</li>
+      <li><code>amber-contrib-jquery</code> module,
+          providing jQuery and a wrapper over it.</li>
+      <li><code>amber-contrib-web</code> module,
+          providing <code>Web</code> package
+          that allows for DOM manipulation
+          and is inspired by Seaside.</li>
+  </ul>
+  </body>
+
+</html>

+ 39 - 0
root/uninstall.html

@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+
+  <head>
+    <title>{%= title %}</title>
+    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+    <meta name="author" content="{%= author_name %}" />
+  </head>
+
+  <body>
+  <p>Once you start developing your own app / lib, you should
+      remove all unnecessary parts left from the sample app.</p>
+  <ul style="width: 40ex">
+      <li>In <code>index.html</code>
+          <code>&lt;body&gt;</code> tag,
+          everything should be removed, except
+          the <code>&lt;script&gt;</code> tag
+          that initializes Amber and starts your app;
+          then you can add elements specific to your own app
+          to the page.</li>
+      <li>If you aren't going to use <code>Web</code>
+          package from <code>amber-contrib-web</code> module,
+          but want to retain the jQuery wrapper,
+          you should run <code>bower uninstall amber-contrib-web --save</code>
+          from your CLI.</li>
+      <li>If you aren't going to use the <code>Web</code>
+          package from the <code>amber-contrib-web</code> module,
+          nor the jQuery wrapper from <code>amber-contrib-jquery</code>,
+          you should run <code>bower uninstall amber-contrib-web amber-contrib-jquery --save</code>
+          from your CLI.</li>
+      <li>You cannot remove just the jQuery wrapper and retain the Web package,
+          as it depends on the jQuery wrapper.</li>
+      <li>As the last step, make sure the dependency tree is in a correct state
+          by recreating it: first delete your <code>bower_components</code> folder,
+          then run <code>bower install</code> from your CLI.</li>
+  </ul>
+  </body>
+
+</html>

+ 3 - 3
template.js

@@ -116,7 +116,7 @@ exports.template = function (grunt, init, done) {
         // A few additional properties.
         props.keywords = ['Amber', 'Smalltalk'];
         props.devDependencies = {
-            "amber-dev": "^0.4.0",
+            "amber-dev": "^0.5.0",
             "grunt": "^0.4.5",
             "grunt-contrib-clean": "^0.6.0",
             "grunt-contrib-requirejs": "^0.4.4",
@@ -165,8 +165,8 @@ exports.template = function (grunt, init, done) {
             },
             "devDependencies": {
                 "amber-ide-starter-dialog": "^0.1.0",
-                "amber-contrib-legacy": "^0.2.0",
-                "helios": ">=0.4.3"
+                "amber-contrib-legacy": "^0.2.1",
+                "helios": ">=0.5.0"
             }
         }, null, 4));