Browse Source

scaffolding: Debowerize.

Herby Vojčík 5 years ago
parent
commit
f3eedb3560

+ 1 - 1
grunt-init-project/root/Gruntfile.js

@@ -37,7 +37,7 @@ module.exports = function (grunt) {
         // task configuration
         amberc: {
             options: {
-                amber_dir: path.join(__dirname, "bower_components", "amber"),
+                amber_dir: path.join(__dirname, "node_modules", "@ambers", "lang"),
                 configFile: "config.js"
             },
             all: {

+ 2 - 4
grunt-init-project/root/README.md

@@ -15,7 +15,7 @@ in an empty directory with `amber init`.
 In a client project, run
 
 ```sh
-bower install {%= name %} --save
+npm install {%= name %} --save
 grunt devel
 amber serve
 ```
@@ -30,9 +30,7 @@ save the change and commit the package. Reload.
 To bring project alive (for example after `git clone`):
 
 ```sh
-npm install
-bower install
-grunt devel
+npm run init
 ```
 
 Developing the project (after brought alive):

+ 0 - 1
grunt-init-project/root/gitignore-file

@@ -1,5 +1,4 @@
 /node_modules/
-/bower_components/
 
 /test_runner.js
 

+ 5 - 9
grunt-init-project/root/uninstall.html

@@ -21,24 +21,24 @@
       <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>
+          you should run <code>npm uninstall @ambers/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>
+          you should run <code>npm uninstall @ambers/contrib-web @ambers/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>If you aren't going to use <code>Silk</code>
           package from <code>silk</code> module,
           but want to retain <code>DOMite</code> DOM wrapper,
-          you should run <code>bower uninstall silk --save</code>
+          you should run <code>npm uninstall silk --save</code>
           from your CLI.</li>
       <li>If you aren't going to use the <code>Silk</code>
           package from the <code>silk</code> module,
           nor the DOM wrapper from <code>domite</code>,
-          you should run <code>bower uninstall silk domite --save</code>
+          you should run <code>npm uninstall silk domite --save</code>
           from your CLI.</li>
       <li>You cannot remove just the <code>DOMite</code> DOM wrapper
           and retain the Silk package, as it depends on <code>domite</code>.</li>
@@ -51,11 +51,7 @@
       with Promise present, you can <code>npm uninstall es6-promise --save</code>,
       then remove <code>es6-promise.amd.json</code> file.</p>
   <p>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.
-      Similarly, delete your <code>node_modules</code>
-      then run <code>npm install</code> from your CLI.
-      Finally, rerun <code>grunt devel</code>.</p>
+      by recreating it: run <code>npm run reset</code> from your CLI.</p>
   </body>
 
 </html>

+ 14 - 45
grunt-init-project/template.js

@@ -16,10 +16,10 @@ exports.notes = ' _Project title_ should be a human-readable title.';
 
 // Template-specific notes to be displayed after question prompts.
 exports.after = 'You need to have these installed globally via npm:' +
-' _@ambers/cli_; _grunt-cli_; _bower_.' +
-' Now, install project dependencies with _bower install_,' +
-' tool dependencies with _npm install_ and recompile with _grunt_.' +
-' If you are running _amber init_, these three tasks are going to be performed for you now.' +
+' _@ambers/cli_ and _grunt-cli_.' +
+' Now, install project dependencies with _npm install_' +
+' and recompile / prepare with _grunt default devel_.' +
+' If you are running _amber init_, these two tasks are going to be performed for you now.' +
 ' Afterwards, start the development server with _amber serve_.' +
 ' Your application is then accessible via _http://localhost:4000/_';
 
@@ -116,11 +116,18 @@ exports.template = function (grunt, init, done) {
         // A few additional properties.
         props.keywords = ['Amber', 'Smalltalk'];
         props.dependencies = {
-            "es6-promise": "^4.2.4"
+            "@ambers/contrib-jquery": "^0.5.1",
+            "@ambers/contrib-web": "^0.6.2",
+            "@ambers/lang": "^0.22.2",
+            "domite": "^0.8.0",
+            "es6-promise": "^4.2.4",
+            "silk": "^0.4.0"
         };
         props.devDependencies = {
             "@ambers/ide-starter-modal": "^0.2.0",
             "@ambers/sdk": "^0.10.7",
+            "@ambers/contrib-legacy": "^0.7.1",
+            "helios": "^0.10.0",
             "grunt": "^1.0.3",
             "grunt-contrib-clean": "^1.1.0",
             "grunt-contrib-requirejs": "^1.0.0",
@@ -130,52 +137,14 @@ exports.template = function (grunt, init, done) {
         props.node_version = '>=4.0.0';
         props.scripts = {
             "reset": "npm run clean && npm run init",
-            "clean": "(rm -rf bower_components || rd /s/q bower_components) && (rm -rf node_modules || rd /s/q node_modules)",
-            "init": "npm install && bower install && grunt default devel",
+            "clean": "(rm -rf node_modules || rd /s/q node_modules)",
+            "init": "npm install && grunt default devel",
             "test": "grunt test"
         };
 
         // Generate package.json file, used by npm and grunt.
         init.writePackageJSON('package.json', props);
 
-        // generate bower.json file
-        grunt.file.write('bower.json', JSON.stringify({
-            "name": props.name,
-            "description": props.description,
-            "ignore": [
-                "**/.*",
-                "node_modules",
-                "bower_components",
-                "/*.js",
-                "/*.html",
-                "test",
-                "tests"
-            ],
-            "authors": [
-                {
-                    "name": props.author_name,
-                    "email": props.author_email
-                }
-            ],
-            "homepage": props.homepage,
-            "main": props.main,
-            "keywords": props.keywords,
-            "license": props.licenses,
-            "private": false,
-            "dependencies": {
-                "amber": "^0.22.0",
-                "amber-contrib-jquery": "^0.4.1",
-                "amber-contrib-web": "^0.5.1",
-                "domite": "^0.7.1",
-                "silk": "^0.3.1"
-            },
-            "devDependencies": {
-                "amber-contrib-legacy": "^0.6.1",
-                "helios": "^0.9.1"
-            }
-        }, null, 2));
-
-
         // All done!
         done();
     });