Browse Source

Rename support dirs to better names.

To `base` in `lang` and to `dist` in `cli`.
Herby Vojčík 5 years ago
parent
commit
307f4853f1

+ 3 - 3
Gruntfile.js

@@ -95,7 +95,7 @@ module.exports = function (grunt) {
                     insertRequire: ['app'],
                     optimize: "none",
                     wrap: helpers.nodeWrapperWithShebang,
-                    out: "cli/support/amber-cli.js"
+                    out: "cli/dist/amber-cli.js"
                 }
             },
             test_runner: {
@@ -134,8 +134,8 @@ module.exports = function (grunt) {
         },
 
         jshint: {
-            amber: ['lang/src/*.js', 'lang/support/*.js'],
-            cli: ['cli/src/*.js', 'cli/support/*.js'],
+            amber: ['lang/src/*.js', 'lang/base/*.js'],
+            cli: ['cli/src/*.js', 'cli/dist/*.js'],
             dev: ['sdk/lib/*.js'],
             grunt: ['Gruntfile.js', 'grunt-tasks/*.js', 'sdk/tasks/*.js']
         }

+ 0 - 0
cli/support/amber-cli.js → cli/dist/amber-cli.js


+ 0 - 0
cli/support/amberc-cli.js → cli/dist/amberc-cli.js


+ 2 - 2
cli/package.json

@@ -27,8 +27,8 @@
     "url": "https://lolg.it/amber/amber/issues?labels=in+cli"
   },
   "bin": {
-    "amber": "./support/amber-cli.js",
-    "amberc": "./support/amberc-cli.js"
+    "amber": "./dist/amber-cli.js",
+    "amberc": "./dist/amberc-cli.js"
   },
   "scripts": {
     "test": "mocha"

+ 1 - 1
cli/test/amberVersionTest.js

@@ -3,7 +3,7 @@
 var assert = require('assert'),
     shelljs = require('shelljs');
 
-process.env.AMBER_CLI = process.env.AMBER_CLI || "node ./support/amber-cli.js";
+process.env.AMBER_CLI = process.env.AMBER_CLI || "node ./dist/amber-cli.js";
 
 describe("amber version", function () {
     it("should return line with amber version", function () {

+ 0 - 0
lang/support/boot.js → lang/base/boot.js


+ 0 - 0
lang/support/brikz.js → lang/base/brikz.js


+ 0 - 0
lang/support/deploy.js → lang/base/deploy.js


+ 0 - 0
lang/support/devel.js → lang/base/devel.js


+ 0 - 0
lang/support/helpers.js → lang/base/helpers.js


+ 0 - 0
lang/support/kernel-checks.js → lang/base/kernel-checks.js


+ 0 - 0
lang/support/kernel-fundamentals.js → lang/base/kernel-fundamentals.js


+ 0 - 0
lang/support/kernel-language.js → lang/base/kernel-language.js


+ 0 - 0
lang/support/kernel-runtime.js → lang/base/kernel-runtime.js


+ 0 - 0
lang/support/lang.js → lang/base/lang.js


+ 0 - 0
lang/support/lazypack.js → lang/base/lazypack.js


+ 0 - 0
lang/support/parser.js → lang/base/parser.js


+ 0 - 0
lang/support/parser.pegjs → lang/base/parser.pegjs


+ 1 - 1
lang/local.amd.json

@@ -1,6 +1,6 @@
 {
     "paths": {
-        "amber": "support",
+        "amber": "base",
         "amber_core": "src"
     },
     "map": {

+ 1 - 1
lang/package.json

@@ -29,7 +29,7 @@
   },
   "scripts": {
     "echos": "node -e \"process.stdout.write(require('./package.json').strings[process.argv[1]])\"",
-    "build:parser": "(npm run -s echos buildParserBegin && pegjs --cache --export-var \"$\"globals.SmalltalkParser < support/parser.pegjs && npm run -s echos buildParserEnd) > support/parser.js"
+    "build:parser": "(npm run -s echos buildParserBegin && pegjs --cache --export-var \"$\"globals.SmalltalkParser < base/parser.pegjs && npm run -s echos buildParserEnd) > base/parser.js"
   },
   "devDependencies": {
     "pegjs": "^0.9.0"

+ 1 - 1
lang/src/Kernel-Infrastructure.js

@@ -2908,7 +2908,7 @@ $globals.Setting.a$cls);
 
 $core.addClass("SmalltalkImage", $globals.Object, ["globalJsVariables", "packageDictionary"], "Kernel-Infrastructure");
 //>>excludeStart("ide", pragmas.excludeIdeData);
-$globals.SmalltalkImage.comment="I represent the Smalltalk system, wrapping\x0aoperations of variable `$core` declared in `support/boot.js`.\x0a\x0a## API\x0a\x0aI have only one instance, accessed with global variable `Smalltalk`.\x0a\x0a## Classes\x0a\x0aClasses can be accessed using the following methods:\x0a\x0a- `#classes` answers the full list of Smalltalk classes in the system\x0a- `#globals #at:` answers a specific global (usually, a class) or `nil`\x0a\x0a## Packages\x0a\x0aPackages can be accessed using the following methods:\x0a\x0a- `#packages` answers the full list of packages\x0a- `#packageAt:` answers a specific package or `nil`\x0a\x0a## Parsing\x0a\x0aThe `#parse:` method is used to parse Amber source code.\x0aIt requires the `Compiler` package and the `support/parser.js` parser file in order to work.";
+$globals.SmalltalkImage.comment="I represent the Smalltalk system, wrapping\x0aoperations of variable `$core` declared in `base/boot.js`.\x0a\x0a## API\x0a\x0aI have only one instance, accessed with global variable `Smalltalk`.\x0a\x0a## Classes\x0a\x0aClasses can be accessed using the following methods:\x0a\x0a- `#classes` answers the full list of Smalltalk classes in the system\x0a- `#globals #at:` answers a specific global (usually, a class) or `nil`\x0a\x0a## Packages\x0a\x0aPackages can be accessed using the following methods:\x0a\x0a- `#packages` answers the full list of packages\x0a- `#packageAt:` answers a specific package or `nil`\x0a\x0a## Parsing\x0a\x0aThe `#parse:` method is used to parse Amber source code.\x0aIt requires the `Compiler` package and the `base/parser.js` parser file in order to work.";
 //>>excludeEnd("ide");
 $core.addMethod(
 $core.method({

+ 2 - 2
lang/src/Kernel-Infrastructure.st

@@ -789,7 +789,7 @@ Object subclass: #SmalltalkImage
 	package: 'Kernel-Infrastructure'!
 !SmalltalkImage commentStamp!
 I represent the Smalltalk system, wrapping
-operations of variable `$core` declared in `support/boot.js`.
+operations of variable `$core` declared in `base/boot.js`.
 
 ## API
 
@@ -812,7 +812,7 @@ Packages can be accessed using the following methods:
 ## Parsing
 
 The `#parse:` method is used to parse Amber source code.
-It requires the `Compiler` package and the `support/parser.js` parser file in order to work.!
+It requires the `Compiler` package and the `base/parser.js` parser file in order to work.!
 
 !SmalltalkImage methodsFor: 'accessing'!
 

+ 7 - 1
sdk/lib/amberc.js

@@ -87,7 +87,13 @@ AmberCompiler.prototype.main = function (configuration, finished_callback) {
         };
     }
 
-    if (!rjsConfig.paths.amber) rjsConfig.paths.amber = path.join(this.amber_dir, 'support');
+    if (!rjsConfig.paths.amber) {
+        // TODO remove backward compatibility, prefer 'base'
+        rjsConfig.paths.amber = path.join(this.amber_dir, 'support');
+        if (!fs.existsSync(rjsConfig.paths.amber)) {
+            rjsConfig.paths.amber = path.join(this.amber_dir, 'base');
+        }
+    }
     if (!rjsConfig.paths.amber_core) rjsConfig.paths.amber_core = path.join(this.amber_dir, 'src');
     rjsConfig.paths['text'] = require.resolve('requirejs-text').replace(/\.js$/, "");
     rjsConfig.paths['amber/without-imports'] = path.join(__dirname, 'without-imports');