@pi-r/gulp 0.5.0 → 0.6.2

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 (3) hide show
  1. package/README.md +2 -0
  2. package/index.js +6 -6
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  ### @pi-r/gulp
2
2
 
3
+ https://e-mc.readthedocs.io/en/latest/task/index.html
4
+
3
5
  ### LICENSE
4
6
 
5
7
  MIT
package/index.js CHANGED
@@ -10,7 +10,7 @@ const Task = require('@e-mc/task');
10
10
  const BIN_NPX = Task.sanitizeCmd(which.sync('npx', { nothrow: true }) || 'npx');
11
11
  const BIN_GULP = Task.sanitizeCmd(which.sync("gulp" /* STRINGS.MODULE_NAME */, { nothrow: true }) || '');
12
12
  const REGEXP_TIMESTAMP = /^\[\d+:\d+:\d+\]$/;
13
- function executeTasks(assets, preceding, host) {
13
+ async function executeTasks(assets, preceding, host) {
14
14
  if (this.aborted) {
15
15
  return Promise.reject((0, types_1.createAbortError)());
16
16
  }
@@ -37,10 +37,10 @@ class Gulp extends Task {
37
37
  super(...arguments);
38
38
  this._moduleName = "gulp" /* STRINGS.MODULE_NAME */;
39
39
  }
40
- static finalize(instance, assets) {
40
+ static async finalize(instance, assets) {
41
41
  return executeTasks.call(instance, assets, false, this);
42
42
  }
43
- using(data) {
43
+ async using(data) {
44
44
  return executeTasks.call(this, [data.file], true, data.host);
45
45
  }
46
46
  collate(assets, isPreceding = false) {
@@ -146,7 +146,7 @@ class Gulp extends Task {
146
146
  return result;
147
147
  }
148
148
  queue(tasks) {
149
- return tasks.map(item => new Promise(resolve => { this.spawn(item, (result) => { resolve(result); }); }));
149
+ return tasks.map(async (item) => new Promise(resolve => { this.spawn(item, (result) => { resolve(result); }); }));
150
150
  }
151
151
  async series(tasks) {
152
152
  let added, deleted;
@@ -162,7 +162,7 @@ class Gulp extends Task {
162
162
  }
163
163
  return { added, deleted };
164
164
  }
165
- parallel(tasks) {
165
+ async parallel(tasks) {
166
166
  return Promise.allSettled(this.queue(tasks)).then(result => {
167
167
  let added, deleted, value;
168
168
  for (const item of result) {
@@ -247,7 +247,7 @@ class Gulp extends Task {
247
247
  const startTime = process.hrtime();
248
248
  const broadcastId = this.broadcastId;
249
249
  this.formatMessage(4 /* LOG_TYPE.PROCESS */, "gulp" /* STRINGS.MODULE_NAME */, ['Executing task...', task], gulpfile);
250
- Promise.all(items.map(src => fs.promises.copyFile(src, path.join(tempDir, path.basename(src)))))
250
+ Promise.all(items.map(async (src) => fs.promises.copyFile(src, path.join(tempDir, path.basename(src)))))
251
251
  .then(() => {
252
252
  try {
253
253
  const args = [...Task.sanitizeArgs(tasks), ...opts, '--gulpfile', `${normalizePath(gulpfile)}`, '--cwd', `${normalizePath(tempDir)}`];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/gulp",
3
- "version": "0.5.0",
3
+ "version": "0.6.2",
4
4
  "description": "Gulp task constructor for E-mc.",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -20,8 +20,8 @@
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/anpham6/pi-r#readme",
22
22
  "dependencies": {
23
- "@e-mc/task": "^0.7.0",
24
- "@e-mc/types": "^0.7.0",
23
+ "@e-mc/task": "^0.8.2",
24
+ "@e-mc/types": "^0.8.2",
25
25
  "gulp": "^4.0.2",
26
26
  "gulp-cli": "^2.3.0",
27
27
  "strip-ansi": "6.0.1",