From 8f8e50687f0986d28bb7ed9147259c5e621bb4ae Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Tue, 12 Sep 2017 20:05:04 +0300 Subject: [PATCH] Move source code to src/ to keep main directory less cluttered --- CHANGES.md | 2 ++ OPTIONS.md | 4 ++-- plugin-example.js => examples/plugin-example.js | 0 ng-annotate | 2 +- package.json | 4 ++-- generate-sourcemap.js => src/generate-sourcemap.js | 0 lut.js => src/lut.js | 0 ng-annotate-main.js => src/ng-annotate-main.js | 0 ng-annotate.js => src/ng-annotate.js | 2 +- nginject.js => src/nginject.js | 0 {optionals => src/optionals}/angular-dashboard-framework.js | 0 pos-to-linecolumn.js => src/pos-to-linecolumn.js | 0 scope.js => src/scope.js | 0 scopetools.js => src/scopetools.js | 0 traverse.js => src/traverse.js | 0 run-tests.js => tests/run-tests.js | 4 ++-- 16 files changed, 10 insertions(+), 8 deletions(-) rename plugin-example.js => examples/plugin-example.js (100%) rename generate-sourcemap.js => src/generate-sourcemap.js (100%) rename lut.js => src/lut.js (100%) rename ng-annotate-main.js => src/ng-annotate-main.js (100%) rename ng-annotate.js => src/ng-annotate.js (99%) rename nginject.js => src/nginject.js (100%) rename {optionals => src/optionals}/angular-dashboard-framework.js (100%) rename pos-to-linecolumn.js => src/pos-to-linecolumn.js (100%) rename scope.js => src/scope.js (100%) rename scopetools.js => src/scopetools.js (100%) rename traverse.js => src/traverse.js (100%) rename run-tests.js => tests/run-tests.js (98%) diff --git a/CHANGES.md b/CHANGES.md index 0610d64..b0d94f7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,7 @@ ## UNRELEASED * Require node>=4.0.0. + * Reorganize internal directory structure. The main file moved to + `src/ng-annotate-main.js`. ## v1.6.0 2017-05-28 * Switch from tilde ~ dependencies to ^ caret dependencies. diff --git a/OPTIONS.md b/OPTIONS.md index 17cb526..b42274b 100644 --- a/OPTIONS.md +++ b/OPTIONS.md @@ -29,13 +29,13 @@ controllers, etc.) with a new name when declared and referenced through annotati Use it like this: `--rename oldname1 newname1 oldname2 newname2` *experimental* Use the `--plugin` option to load a user plugin with the provided path, -1.x may change API). See [plugin-example.js](plugin-example.js) for more info. +1.x may change API). See [plugin-example.js](examples/plugin-example.js) for more info. *experimental* Use the `--stats` option to print statistics on stderr. ## Library (API) -ng-annotate can be used as a library. See [ng-annotate.js](ng-annotate.js) for further info about +ng-annotate can be used as a library. See [ng-annotate.js](src/ng-annotate.js) for further info about options and return value. ```js diff --git a/plugin-example.js b/examples/plugin-example.js similarity index 100% rename from plugin-example.js rename to examples/plugin-example.js diff --git a/ng-annotate b/ng-annotate index 40fb562..b78590f 100755 --- a/ng-annotate +++ b/ng-annotate @@ -1,2 +1,2 @@ #!/usr/bin/env node -require("./ng-annotate.js"); +require("./src/ng-annotate.js"); diff --git a/package.json b/package.json index ca874b2..2c020dc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "ng-annotate-patched", "version": "1.6.0", "description": "add, remove and rebuild angularjs dependency injection annotations", - "main": "ng-annotate-main.js", + "main": "src/ng-annotate-main.js", "repository": { "type": "git", "url": "https://github.com/bluetech/ng-annotate-patched.git" @@ -37,7 +37,7 @@ "transformation" ], "scripts": { - "test": "node run-tests" + "test": "node tests/run-tests" }, "bin": "./ng-annotate", "author": "Olov Lassus ", diff --git a/generate-sourcemap.js b/src/generate-sourcemap.js similarity index 100% rename from generate-sourcemap.js rename to src/generate-sourcemap.js diff --git a/lut.js b/src/lut.js similarity index 100% rename from lut.js rename to src/lut.js diff --git a/ng-annotate-main.js b/src/ng-annotate-main.js similarity index 100% rename from ng-annotate-main.js rename to src/ng-annotate-main.js diff --git a/ng-annotate.js b/src/ng-annotate.js similarity index 99% rename from ng-annotate.js rename to src/ng-annotate.js index d8af793..5b16ce7 100644 --- a/ng-annotate.js +++ b/src/ng-annotate.js @@ -9,7 +9,7 @@ const fs = require("fs"); const fmt = require("simple-fmt"); const tryor = require("tryor"); const ngAnnotate = require("./ng-annotate-main"); -const version = require("./package.json").version; +const version = require("../package.json").version; const optimist = require("optimist") .usage("ng-annotate v" + version + "\n\nUsage: ng-annotate OPTIONS \n\n" + "provide - instead of to read from stdin\n" + diff --git a/nginject.js b/src/nginject.js similarity index 100% rename from nginject.js rename to src/nginject.js diff --git a/optionals/angular-dashboard-framework.js b/src/optionals/angular-dashboard-framework.js similarity index 100% rename from optionals/angular-dashboard-framework.js rename to src/optionals/angular-dashboard-framework.js diff --git a/pos-to-linecolumn.js b/src/pos-to-linecolumn.js similarity index 100% rename from pos-to-linecolumn.js rename to src/pos-to-linecolumn.js diff --git a/scope.js b/src/scope.js similarity index 100% rename from scope.js rename to src/scope.js diff --git a/scopetools.js b/src/scopetools.js similarity index 100% rename from scopetools.js rename to src/scopetools.js diff --git a/traverse.js b/src/traverse.js similarity index 100% rename from traverse.js rename to src/traverse.js diff --git a/run-tests.js b/tests/run-tests.js similarity index 98% rename from run-tests.js rename to tests/run-tests.js index edc4383..b123e70 100644 --- a/run-tests.js +++ b/tests/run-tests.js @@ -4,7 +4,7 @@ "use strict"; -const ngAnnotate = require("./ng-annotate-main"); +const ngAnnotate = require("../src/ng-annotate-main"); const fs = require("fs"); const os = require("os"); const path = require("path"); @@ -16,7 +16,7 @@ const coffee = require("coffee-script"); const convertSourceMap = require("convert-source-map"); // optionals -const ngAnnotateAdfPlugin = require("./optionals/angular-dashboard-framework.js"); +const ngAnnotateAdfPlugin = require("../src/optionals/angular-dashboard-framework.js"); function slurp(filename) { return String(fs.readFileSync(filename));