1
0
Преглед на файлове

-m / mappings => -p / paths

Herbert Vojčík преди 9 години
родител
ревизия
4d26975a99
променени са 3 файла, в които са добавени 15 реда и са изтрити 15 реда
  1. 5 5
      external/amber-cli/support/amberc-cli.js
  2. 6 6
      external/amber-dev/lib/amberc.js
  3. 4 4
      external/amber-dev/tasks/grunt-amberc.js

+ 5 - 5
external/amber-cli/support/amberc-cli.js

@@ -35,10 +35,10 @@ function handle_options(optionsArray) {
 
     while (currentItem != null) {
         switch (currentItem) {
-            case '-m':
+            case '-p':
                 optionsArray.shift.split(',').forEach(function (pairString) {
                     var mapping = pairString.split(':');
-                    defaults.mappings[mapping[0]] = mapping[1];
+                    defaults.paths[mapping[0]] = mapping[1];
                 });
                 break;
            case '-l':
@@ -94,9 +94,9 @@ function print_usage_and_exit() {
         '     NOTE: Each .st file is currently considered to be a fileout of a single class',
         '     category of the same name as the file!',
         '',
-        '  -m amdpath1:realpath1,amdpath2:realpath2',
-        '     Set the amd mappings as comma-separate amd:realpath pairs.',
-        '     Mappings are not separated by spaces or end with .js.',
+        '  -p amdpath1:realpath1,amdpath2:realpath2',
+        '     Set the amd paths mapping as comma-separate amd:realpath pairs.',
+        '     Mapping elements are not separated by spaces or end with .js.',
         '',
         '  -l library1,library2',
         '     Load the libraries specified as comma-separate AMD module names.',

+ 6 - 6
external/amber-dev/lib/amberc.js

@@ -41,7 +41,7 @@ function AmberCompiler(amber_dir) {
  */
 var createDefaultConfiguration = function () {
     return {
-        mappings: {},
+        paths: {},
         load: [],
         stFiles: [],
         jsGlobals: [],
@@ -79,14 +79,14 @@ AmberCompiler.prototype.main = function (configuration, finished_callback) {
     configuration.compiler_libraries = this.compiler_libraries;
     configuration.amber_dir = this.amber_dir;
 
-    configuration.mappings['text'] = require.resolve('requirejs-text').replace(/\.js$/, "");
-    configuration.mappings['amber/without-imports'] = path.join(__dirname, 'without-imports');
-    if (!configuration.mappings.amber) configuration.mappings.amber = path.join(this.amber_dir, 'support');
-    if (!configuration.mappings.amber_core) configuration.mappings.amber_core = path.join(this.amber_dir, 'src');
+    configuration.paths['text'] = require.resolve('requirejs-text').replace(/\.js$/, "");
+    configuration.paths['amber/without-imports'] = path.join(__dirname, 'without-imports');
+    if (!configuration.paths.amber) configuration.paths.amber = path.join(this.amber_dir, 'support');
+    if (!configuration.paths.amber_core) configuration.paths.amber_core = path.join(this.amber_dir, 'src');
     configuration.requirejs = requirejs.config({
         context: "amberc",
         nodeRequire: require,
-        paths: configuration.mappings
+        paths: configuration.paths
     });
 
     check_configuration(configuration)

+ 4 - 4
external/amber-dev/tasks/grunt-amberc.js

@@ -37,11 +37,11 @@ module.exports = function (grunt) {
 
         var options = this.options({
             amber_dir: undefined,
-            mappings: {},
+            paths: {},
             verbose: grunt.option('verbose') || false
         });
         this.data.verbose = options.verbose;
-        this.data.mappings = options.mappings;
+        this.data.paths = options.paths;
 
         // mark required properties
         this.requiresConfig('amberc.options.amber_dir');
@@ -71,8 +71,8 @@ module.exports = function (grunt) {
         if (data.libraries != null) {
             configuration.load = data.libraries;
         }
-        if (data.mappings != null) {
-            configuration.mappings = data.mappings;
+        if (data.paths != null) {
+            configuration.paths = data.paths;
         }
         if (sourceFiles != null) {
             configuration.stFiles = sourceFiles;