paralayer 1.10.0 → 1.11.0
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/dist/bin.js +5 -5
- package/dist/paralayer.d.ts +1 -1
- package/dist/paralayer.js +5 -5
- package/package.json +3 -3
- package/src/paralayer.ts +6 -7
package/dist/bin.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
import minimist from "minimist";
|
|
5
5
|
|
|
6
6
|
// src/paralayer.ts
|
|
7
|
-
import { Queue, Unit, safe } from "@eposlabs/utils";
|
|
8
7
|
import { watch } from "chokidar";
|
|
8
|
+
import { Queue, Unit, safe } from "dropcap/utils";
|
|
9
9
|
import { mkdir, readFile, rm, writeFile } from "fs/promises";
|
|
10
10
|
import { basename, extname, join, relative } from "path";
|
|
11
11
|
var Paralayer = class extends Unit {
|
|
@@ -30,7 +30,7 @@ var Paralayer = class extends Unit {
|
|
|
30
30
|
this.watcher.on("all", this.onAll);
|
|
31
31
|
this.watcher.on("ready", this.onReady);
|
|
32
32
|
await this.ready$.promise;
|
|
33
|
-
await this.queue.
|
|
33
|
+
await this.queue.add(() => this.build());
|
|
34
34
|
if (!this.options.watch) await this.watcher.close();
|
|
35
35
|
const setupJsPath = join(this.options.output, "setup.js");
|
|
36
36
|
return await readFile(setupJsPath, "utf-8");
|
|
@@ -49,11 +49,11 @@ var Paralayer = class extends Unit {
|
|
|
49
49
|
}
|
|
50
50
|
if (event === "unlink") {
|
|
51
51
|
delete this.files[path];
|
|
52
|
-
await this.queue.
|
|
52
|
+
await this.queue.add(() => this.build());
|
|
53
53
|
}
|
|
54
54
|
if (event === "add" || event === "change") {
|
|
55
55
|
this.files[path] = null;
|
|
56
|
-
await this.queue.
|
|
56
|
+
await this.queue.add(() => this.build());
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
onReady = async () => {
|
|
@@ -180,7 +180,7 @@ var Paralayer = class extends Unit {
|
|
|
180
180
|
const LayerName = layer.split(".").map(this.capitalize).join("");
|
|
181
181
|
if (style === "camel") return this.decapitalize(LayerName);
|
|
182
182
|
if (style === "Pascal") return LayerName;
|
|
183
|
-
throw this.never;
|
|
183
|
+
throw this.never();
|
|
184
184
|
}
|
|
185
185
|
capitalize(string) {
|
|
186
186
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
package/dist/paralayer.d.ts
CHANGED
package/dist/paralayer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/paralayer.ts
|
|
2
|
-
import { Queue, Unit, safe } from "@eposlabs/utils";
|
|
3
2
|
import { watch } from "chokidar";
|
|
3
|
+
import { Queue, Unit, safe } from "dropcap/utils";
|
|
4
4
|
import { mkdir, readFile, rm, writeFile } from "fs/promises";
|
|
5
5
|
import { basename, extname, join, relative } from "path";
|
|
6
6
|
var Paralayer = class extends Unit {
|
|
@@ -25,7 +25,7 @@ var Paralayer = class extends Unit {
|
|
|
25
25
|
this.watcher.on("all", this.onAll);
|
|
26
26
|
this.watcher.on("ready", this.onReady);
|
|
27
27
|
await this.ready$.promise;
|
|
28
|
-
await this.queue.
|
|
28
|
+
await this.queue.add(() => this.build());
|
|
29
29
|
if (!this.options.watch) await this.watcher.close();
|
|
30
30
|
const setupJsPath = join(this.options.output, "setup.js");
|
|
31
31
|
return await readFile(setupJsPath, "utf-8");
|
|
@@ -44,11 +44,11 @@ var Paralayer = class extends Unit {
|
|
|
44
44
|
}
|
|
45
45
|
if (event === "unlink") {
|
|
46
46
|
delete this.files[path];
|
|
47
|
-
await this.queue.
|
|
47
|
+
await this.queue.add(() => this.build());
|
|
48
48
|
}
|
|
49
49
|
if (event === "add" || event === "change") {
|
|
50
50
|
this.files[path] = null;
|
|
51
|
-
await this.queue.
|
|
51
|
+
await this.queue.add(() => this.build());
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
onReady = async () => {
|
|
@@ -175,7 +175,7 @@ var Paralayer = class extends Unit {
|
|
|
175
175
|
const LayerName = layer.split(".").map(this.capitalize).join("");
|
|
176
176
|
if (style === "camel") return this.decapitalize(LayerName);
|
|
177
177
|
if (style === "Pascal") return LayerName;
|
|
178
|
-
throw this.never;
|
|
178
|
+
throw this.never();
|
|
179
179
|
}
|
|
180
180
|
capitalize(string) {
|
|
181
181
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paralayer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "imkost",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"dist"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"
|
|
37
|
-
"
|
|
36
|
+
"chokidar": "^5.0.0",
|
|
37
|
+
"dropcap": "^1.0.0",
|
|
38
38
|
"minimist": "^1.2.8"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
package/src/paralayer.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { watch } from 'chokidar'
|
|
1
|
+
import { watch, type FSWatcher } from 'chokidar'
|
|
2
|
+
import { Queue, Unit, safe } from 'dropcap/utils'
|
|
4
3
|
import { mkdir, readFile, rm, writeFile } from 'node:fs/promises'
|
|
5
4
|
import { basename, extname, join, relative } from 'node:path'
|
|
6
5
|
|
|
@@ -50,7 +49,7 @@ export class Paralayer extends Unit {
|
|
|
50
49
|
this.watcher.on('ready', this.onReady)
|
|
51
50
|
|
|
52
51
|
await this.ready$.promise
|
|
53
|
-
await this.queue.
|
|
52
|
+
await this.queue.add(() => this.build())
|
|
54
53
|
if (!this.options.watch) await this.watcher.close()
|
|
55
54
|
|
|
56
55
|
// Return content of setup.js
|
|
@@ -82,13 +81,13 @@ export class Paralayer extends Unit {
|
|
|
82
81
|
// File removed? -> Remove and rebuild
|
|
83
82
|
if (event === 'unlink') {
|
|
84
83
|
delete this.files[path]
|
|
85
|
-
await this.queue.
|
|
84
|
+
await this.queue.add(() => this.build())
|
|
86
85
|
}
|
|
87
86
|
|
|
88
87
|
// File added/changed? -> Reset its content and rebuild
|
|
89
88
|
if (event === 'add' || event === 'change') {
|
|
90
89
|
this.files[path] = null
|
|
91
|
-
await this.queue.
|
|
90
|
+
await this.queue.add(() => this.build())
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
93
|
|
|
@@ -261,7 +260,7 @@ export class Paralayer extends Unit {
|
|
|
261
260
|
const LayerName = layer.split('.').map(this.capitalize).join('')
|
|
262
261
|
if (style === 'camel') return this.decapitalize(LayerName)
|
|
263
262
|
if (style === 'Pascal') return LayerName
|
|
264
|
-
throw this.never
|
|
263
|
+
throw this.never()
|
|
265
264
|
}
|
|
266
265
|
|
|
267
266
|
private capitalize(string: string) {
|