whet 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/whet/Whet.js CHANGED
@@ -10,7 +10,7 @@ const $global = Register.$global
10
10
  export const Whet_Fields_ = Register.global("$hxClasses")["whet._Whet.Whet_Fields_"] =
11
11
  class Whet_Fields_ {
12
12
  static main() {
13
- Whet_Fields_.program.enablePositionalOptions().passThroughOptions().description("Project tooling.").usage("[options] [command] [+ [command]...]").version("0.0.3", "-v, --version").allowUnknownOption(true).showSuggestionAfterError(true).option("-p, --project <file>", "project to run", "Project.mjs").option("-l, --log-level <level>", "log level, a string/number", "info");
13
+ Whet_Fields_.program.enablePositionalOptions().passThroughOptions().description("Project tooling.").usage("[options] [command] [+ [command]...]").version("0.0.4", "-v, --version").allowUnknownOption(true).showSuggestionAfterError(true).option("-p, --project <file>", "project to run", "Project.mjs").option("-l, --log-level <level>", "log level, a string/number", "info");
14
14
  Whet_Fields_.program.parse();
15
15
  var options = Whet_Fields_.program.opts();
16
16
  if (options.logLevel != null) {
@@ -5,6 +5,7 @@ import {Stone} from "../../Stone"
5
5
  import {SourceHash} from "../../SourceHash"
6
6
  import {SourceData} from "../../Source"
7
7
  import {Project} from "../../Project"
8
+ import {Command} from "commander"
8
9
 
9
10
  export declare class HaxeBuild extends Stone<BuildConfig> {
10
11
  constructor(config: BuildConfig)
@@ -14,6 +15,7 @@ export declare class HaxeBuild extends Stone<BuildConfig> {
14
15
  */
15
16
  build(): Promise<any>
16
17
  protected generate(hash: SourceHash): Promise<SourceData[]>
18
+ protected getCommands(): Command[]
17
19
  list(): Promise<string[]>
18
20
  protected generateHash(): Promise<SourceHash>
19
21
  }
@@ -8,6 +8,7 @@ import {Log} from "../../Log.js"
8
8
  import * as Path__1 from "path"
9
9
  import {Path, Path as Path__2} from "../../../haxe/io/Path.js"
10
10
  import {Register} from "../../../genes/Register.js"
11
+ import {Command} from "commander"
11
12
  import * as ChildProcess from "child_process"
12
13
  import {StringTools} from "../../../StringTools.js"
13
14
  import {Lambda} from "../../../Lambda.js"
@@ -77,6 +78,12 @@ class HaxeBuild extends Register.inherits(Stone) {
77
78
  throw new Error("Cannot get source of a multi-file build. Not implemented yet.");
78
79
  };
79
80
  }
81
+ getCommands() {
82
+ var _gthis = this;
83
+ return [new Command("build").action(function (..._) {
84
+ return _gthis.build();
85
+ })];
86
+ }
80
87
  list() {
81
88
  if (this.config.hxml.isSingleFile()) {
82
89
  return Promise.resolve([this.config.hxml.getBuildFilename()]);
@@ -92,7 +99,10 @@ class HaxeBuild extends Register.inherits(Stone) {
92
99
  while (_g1 < _g2.length) {
93
100
  var src = _g2[_g1];
94
101
  ++_g1;
95
- _g.push(Utils.listDirectoryRecursively(src));
102
+ var norm = "/" + Path.normalize((src.charAt(0) == "/") ? HxOverrides.substr(src, 1, null) : src);
103
+ var this1 = (src.lastIndexOf("/") == src.length - 1) ? Path.addTrailingSlash(norm) : norm;
104
+ var root = RootDir.fromProject(this.config.hxml.project);
105
+ _g.push(Utils.listDirectoryRecursively((root.length == 1) ? this1.substring(1) : root.substring(1, root.length - 1) + this1));
96
106
  };
97
107
  var fileHashesP = Promise.all(_g).then(function (arrFiles) {
98
108
  var result = new Array(arrFiles.length);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whet",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "NodeJS based assets management and project tooling library.",
5
5
  "scripts": {
6
6
  "devinit": "npx dts2hx commander --modular --noLibWrap",