@serenity-is/tsbuild 6.4.3 → 6.5.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/dist/index.js +45 -8
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import esbuild from "esbuild";
|
|
2
|
-
import { existsSync, readdirSync, statSync, mkdirSync, writeFileSync, rmSync } from "fs";
|
|
2
|
+
import { existsSync, readdirSync, statSync, mkdirSync, writeFileSync, rmSync, readFileSync } from "fs";
|
|
3
3
|
import { join, relative, resolve } from "path";
|
|
4
4
|
import { exit } from "process";
|
|
5
|
+
import { globSync } from "glob";
|
|
5
6
|
|
|
6
7
|
export function checkIfTrigger() {
|
|
7
8
|
if (process.argv.slice(2).some(x => x == "--trigger")) {
|
|
@@ -29,7 +30,7 @@ export const esbuildOptions = (opt) => {
|
|
|
29
30
|
|
|
30
31
|
opt = Object.assign({}, opt);
|
|
31
32
|
|
|
32
|
-
var entryPointsRegEx
|
|
33
|
+
var entryPointsRegEx;
|
|
33
34
|
if (opt.entryPointsRegEx !== undefined) {
|
|
34
35
|
entryPointsRegEx = opt.entryPointsRegEx;
|
|
35
36
|
delete opt.entryPointsRegEx;
|
|
@@ -42,12 +43,48 @@ export const esbuildOptions = (opt) => {
|
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
var entryPoints = opt.entryPoints;
|
|
45
|
-
if (entryPoints ===
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
if (entryPoints === void 0) {
|
|
47
|
+
var globs;
|
|
48
|
+
if (existsSync('sergen.json')) {
|
|
49
|
+
var json = readFileSync('sergen.json', 'utf8').trim();
|
|
50
|
+
var cfg = JSON.parse(json || {});
|
|
51
|
+
globs = cfg?.TSBuild.EntryPoints;
|
|
52
|
+
if (globs === void 0 &&
|
|
53
|
+
cfg.Extends &&
|
|
54
|
+
existsSync(cfg.Extends)) {
|
|
55
|
+
json = readFileSync(cfg.Extends, 'utf8').trim();
|
|
56
|
+
cfg = JSON.parse(json || {});
|
|
57
|
+
globs = cfg?.TSBuild?.EntryPoints;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (globs == null && !entryPointsRegEx) {
|
|
62
|
+
globs = ['Modules/**/*Page.ts', 'Modules/**/ScriptInit.ts'];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (globs != null) {
|
|
66
|
+
var include = globs.filter(x => !x.startsWith('!'));
|
|
67
|
+
var exclude = globs.filter(x => x.startsWith('!')).map(x => x.substring(1));
|
|
68
|
+
exclude.push(".git/**");
|
|
69
|
+
exclude.push("App_Data/**");
|
|
70
|
+
exclude.push("bin/**");
|
|
71
|
+
exclude.push("obj/**");
|
|
72
|
+
exclude.push("node_modules/**");
|
|
73
|
+
exclude.push("**/node_modules/**");
|
|
74
|
+
|
|
75
|
+
entryPoints = globSync(include, {
|
|
76
|
+
ignore: exclude,
|
|
77
|
+
nodir: true,
|
|
78
|
+
matchBase: true
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
entryPoints = [];
|
|
83
|
+
entryPointRoots.forEach(root =>
|
|
84
|
+
scanDir(root)
|
|
85
|
+
.filter(p => p.match(entryPointsRegEx))
|
|
86
|
+
.forEach(p => entryPoints.push(root + '/' + p)));
|
|
87
|
+
}
|
|
51
88
|
}
|
|
52
89
|
|
|
53
90
|
var splitting = opt.splitting;
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenity-is/tsbuild",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.5",
|
|
4
4
|
"author": "Serenity (https://serenity.is)",
|
|
5
5
|
"bugs": "https://github.com/serenity-is/serenity/issues",
|
|
6
6
|
"description": "Serenity ESBuild functions",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"esbuild": "0.16.14"
|
|
8
|
+
"esbuild": "0.16.14",
|
|
9
|
+
"glob": "9.2.1"
|
|
9
10
|
},
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|