@e-mc/task 0.8.10 → 0.9.1

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.
Files changed (4) hide show
  1. package/LICENSE +7 -3
  2. package/README.md +34 -11
  3. package/index.js +1 -6
  4. package/package.json +3 -3
package/LICENSE CHANGED
@@ -1,7 +1,11 @@
1
1
  Copyright 2024 An Pham
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
4
 
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
6
 
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+
9
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
+
11
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @e-mc/task
2
2
 
3
- * NodeJS 14
4
- * ES2019
3
+ * NodeJS 16
4
+ * ES2020
5
5
 
6
6
  ## General Usage
7
7
 
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/index.d.ts
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.9.1/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { IFileManager, IHost, ModuleConstructor } from "./index";
@@ -21,7 +21,7 @@ import type { Command, SpawnResult } from "./task";
21
21
  interface ITask extends IClient<IHost, TaskModule> {
22
22
  using?(data: IFileThread): Promise<unknown>;
23
23
  collect?(items: unknown[], preceding?: boolean): Promise<SpawnResult>[];
24
- map?(tasks: Command[]): Promise<SpawnResult | undefined>[];
24
+ map?(tasks: Command[]): Promise<SpawnResult | void>[];
25
25
  series?(tasks: Command[]): Promise<unknown>;
26
26
  parallel?(tasks: Command[]): Promise<unknown>;
27
27
  spawn?(task: Record<string | number | symbol, unknown>, callback: (result?: SpawnResult) => void): void;
@@ -30,20 +30,43 @@ interface ITask extends IClient<IHost, TaskModule> {
30
30
 
31
31
  interface TaskConstructor extends ModuleConstructor {
32
32
  finalize(this: IHost, instance: ITask, assets: ExternalAsset[]): Promise<unknown>;
33
- /* @deprecated - ITask.using */
34
- using?(this: IHost, instance: ITask, assets: ExternalAsset[], preceding?: boolean): Promise<unknown>;
35
33
  readonly prototype: ITask;
36
34
  new(module?: TaskModule, ...args: unknown[]): ITask;
37
35
  }
38
36
  ```
39
37
 
38
+ ## Settings
39
+
40
+ ```typescript
41
+ import type { PermittedDirectories } from "./core";
42
+
43
+ interface TaskModule {
44
+ // handler: "@pi-r/gulp";
45
+ settings?: {
46
+ broadcast_id?: string | string[];
47
+ users?: Record<string, Record<string, unknown>>;
48
+ exec?: {
49
+ uid?: number;
50
+ gid?: number;
51
+ };
52
+ };
53
+ permission?: PermittedDirectories;
54
+ }
55
+ ```
56
+
57
+ ### Example usage
58
+
59
+ - [@pi-r/gulp](https://e-mc.readthedocs.io/en/latest/task/index.html)
60
+
61
+ NOTE: Usage without a **Host** is conducted through static methods. The **using** class method is called by the **Host** to perform the transformation.
62
+
40
63
  ## References
41
64
 
42
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/asset.d.ts
43
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/core.d.ts
44
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/settings.d.ts
45
- - https://www.unpkg.com/@e-mc/types@0.8.10/lib/task.d.ts
65
+ - https://www.unpkg.com/@e-mc/types@0.9.1/lib/asset.d.ts
66
+ - https://www.unpkg.com/@e-mc/types@0.9.1/lib/core.d.ts
67
+ - https://www.unpkg.com/@e-mc/types@0.9.1/lib/settings.d.ts
68
+ - https://www.unpkg.com/@e-mc/types@0.9.1/lib/task.d.ts
46
69
 
47
70
  ## LICENSE
48
71
 
49
- MIT
72
+ BSD 3-Clause
package/index.js CHANGED
@@ -1,12 +1,7 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  const core_1 = require("@e-mc/core");
4
3
  class Task extends core_1.Client {
5
4
  static async finalize(instance, assets) { }
6
5
  }
7
- exports.default = Task;
8
6
 
9
- if (exports.default) {
10
- module.exports = exports.default;
11
- module.exports.default = exports.default;
12
- }
7
+ module.exports = Task;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/task",
3
- "version": "0.8.10",
3
+ "version": "0.9.1",
4
4
  "description": "Task constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -17,9 +17,9 @@
17
17
  "squared-functions"
18
18
  ],
19
19
  "author": "An Pham <anpham6@gmail.com>",
20
- "license": "MIT",
20
+ "license": "BSD 3-Clause",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/core": "0.8.10"
23
+ "@e-mc/core": "0.9.1"
24
24
  }
25
25
  }