@tsparticles/cli 2.2.1 → 2.2.3
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/build/build-bundle.js +1 -24
- package/dist/build/build-distfiles.js +1 -24
- package/dist/build/build-diststats.js +3 -26
- package/dist/build/build-tsc.js +1 -24
- package/dist/build/build.js +10 -33
- package/files/empty-project/package.json +1 -1
- package/package.json +15 -15
- package/src/build/build.ts +1 -1
- package/src/tsconfig.json +4 -4
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
@@ -37,7 +14,7 @@ async function bundle(basePath) {
|
|
|
37
14
|
console.log("Bundling started");
|
|
38
15
|
let res = false;
|
|
39
16
|
try {
|
|
40
|
-
const options = (await
|
|
17
|
+
const options = (await import(path_1.default.join(basePath, "webpack.config.js")));
|
|
41
18
|
res = await new Promise((resolve, reject) => {
|
|
42
19
|
(0, webpack_1.default)(options.default, (err, stats) => {
|
|
43
20
|
if (err) {
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
@@ -38,7 +15,7 @@ async function buildDistFiles(basePath) {
|
|
|
38
15
|
console.log("Build - started on dist files");
|
|
39
16
|
let res;
|
|
40
17
|
try {
|
|
41
|
-
const pkgInfo = (await
|
|
18
|
+
const pkgInfo = (await import(path_1.default.join(basePath, "package.json"))), libPackage = path_1.default.join(basePath, "package.dist.json"), distPath = path_1.default.join(basePath, pkgInfo.publishConfig?.directory ?? "dist");
|
|
42
19
|
const data = await fs_extra_1.default.readFile(libPackage), text = data.toString(), libObj = JSON.parse(text);
|
|
43
20
|
libObj.version = pkgInfo.version;
|
|
44
21
|
if (pkgInfo.dependencies) {
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
@@ -43,7 +20,7 @@ async function getFolderStats(folderPath, bundlePath) {
|
|
|
43
20
|
if (!(await fs_extra_1.default.pathExists(folderPath))) {
|
|
44
21
|
return stats;
|
|
45
22
|
}
|
|
46
|
-
const dir = await fs_extra_1.default.promises.opendir(folderPath), path = await
|
|
23
|
+
const dir = await fs_extra_1.default.promises.opendir(folderPath), path = await import("path");
|
|
47
24
|
for await (const dirent of dir) {
|
|
48
25
|
const increment = 1;
|
|
49
26
|
if (dirent.isDirectory()) {
|
|
@@ -69,8 +46,8 @@ async function getFolderStats(folderPath, bundlePath) {
|
|
|
69
46
|
* @returns the stats for the dist folder
|
|
70
47
|
*/
|
|
71
48
|
async function getDistStats(basePath) {
|
|
72
|
-
const path = await
|
|
73
|
-
? (await
|
|
49
|
+
const path = await import("path"), distFolder = path.join(basePath, "dist"), pkgInfo = (await fs_extra_1.default.exists(path.join(distFolder, "package.json")))
|
|
50
|
+
? (await import(path.join(distFolder, "package.json")))
|
|
74
51
|
: {}, bundlePath = (await fs_extra_1.default.exists(distFolder)) && pkgInfo.jsdelivr
|
|
75
52
|
? path.resolve(path.join(distFolder, pkgInfo.jsdelivr))
|
|
76
53
|
: undefined;
|
package/dist/build/build-tsc.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
@@ -124,7 +101,7 @@ async function compile(basePath, type) {
|
|
|
124
101
|
if (!options) {
|
|
125
102
|
return 3 /* ExitCodes.NoOptions */;
|
|
126
103
|
}
|
|
127
|
-
const ts = await
|
|
104
|
+
const ts = await import("typescript"), parsed = ts.parseJsonConfigFileContent(options, ts.sys, basePath);
|
|
128
105
|
if (!parsed) {
|
|
129
106
|
return 4 /* ExitCodes.ParseError */;
|
|
130
107
|
}
|
package/dist/build/build.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.buildCommand = void 0;
|
|
27
4
|
const commander_1 = require("commander");
|
|
@@ -40,44 +17,44 @@ buildCommand.option("-t, --tsc", "Build the library using TypeScript", false);
|
|
|
40
17
|
buildCommand.argument("[path]", `Path to the project root folder, default is "src"`, "src");
|
|
41
18
|
buildCommand.action(async (argPath) => {
|
|
42
19
|
const opts = buildCommand.opts(), ci = !!opts.ci, all = !!opts.all || (!opts.bundle && !opts.clean && !opts.dist && !opts.lint && !opts.prettify && !opts.tsc), doBundle = all || !!opts.bundle, circularDeps = all || !!opts.circularDeps, clean = all || !!opts.clean, distfiles = all || !!opts.dist, doLint = all || !!opts.lint, prettier = all || !!opts.prettify, tsc = all || !!opts.tsc;
|
|
43
|
-
const basePath = process.cwd(), { getDistStats } = await
|
|
20
|
+
const basePath = process.cwd(), { getDistStats } = await import("./build-diststats.js"), oldStats = await getDistStats(basePath);
|
|
44
21
|
if (clean) {
|
|
45
|
-
const { clearDist } = await
|
|
22
|
+
const { clearDist } = await import("./build-clear.js");
|
|
46
23
|
await clearDist(basePath);
|
|
47
24
|
}
|
|
48
|
-
const path = await
|
|
25
|
+
const path = await import("path"), srcPath = path.join(basePath, argPath), fs = await import("fs-extra");
|
|
49
26
|
if (!(await fs.pathExists(srcPath))) {
|
|
50
27
|
throw new Error("Provided path does not exist");
|
|
51
28
|
}
|
|
52
29
|
let canContinue = true;
|
|
53
30
|
if (canContinue && prettier) {
|
|
54
|
-
const { prettifySrc } = await
|
|
31
|
+
const { prettifySrc } = await import("./build-prettier.js");
|
|
55
32
|
canContinue = await prettifySrc(basePath, srcPath, ci);
|
|
56
33
|
}
|
|
57
34
|
if (canContinue && doLint) {
|
|
58
|
-
const { lint } = await
|
|
35
|
+
const { lint } = await import("./build-eslint.js");
|
|
59
36
|
canContinue = await lint(ci);
|
|
60
37
|
}
|
|
61
38
|
if (canContinue && tsc) {
|
|
62
|
-
const { buildTS } = await
|
|
39
|
+
const { buildTS } = await import("./build-tsc.js");
|
|
63
40
|
canContinue = await buildTS(basePath);
|
|
64
41
|
}
|
|
65
42
|
if (canContinue && circularDeps) {
|
|
66
|
-
const { buildCircularDeps } = await
|
|
43
|
+
const { buildCircularDeps } = await import("./build-circular-deps.js");
|
|
67
44
|
canContinue = await buildCircularDeps(basePath);
|
|
68
45
|
}
|
|
69
46
|
if (canContinue && doBundle) {
|
|
70
|
-
const { bundle } = await
|
|
47
|
+
const { bundle } = await import("./build-bundle.js");
|
|
71
48
|
canContinue = await bundle(basePath);
|
|
72
49
|
}
|
|
73
50
|
if (canContinue && prettier) {
|
|
74
|
-
const { prettifyReadme, prettifyPackageJson, prettifyPackageDistJson } = await
|
|
51
|
+
const { prettifyReadme, prettifyPackageJson, prettifyPackageDistJson } = await import("./build-prettier.js");
|
|
75
52
|
canContinue = await prettifyReadme(basePath, ci);
|
|
76
53
|
canContinue = await prettifyPackageJson(basePath, ci);
|
|
77
54
|
canContinue = await prettifyPackageDistJson(basePath, ci);
|
|
78
55
|
}
|
|
79
56
|
if (canContinue && distfiles) {
|
|
80
|
-
const { buildDistFiles } = await
|
|
57
|
+
const { buildDistFiles } = await import("./build-distfiles.js");
|
|
81
58
|
canContinue = await buildDistFiles(basePath);
|
|
82
59
|
}
|
|
83
60
|
if (!canContinue) {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"prettier": "@tsparticles/prettier-config",
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@babel/core": "^7.23.9",
|
|
86
|
-
"@tsparticles/cli": "^2.2.
|
|
86
|
+
"@tsparticles/cli": "^2.2.3",
|
|
87
87
|
"@tsparticles/eslint-config": "^2.1.4",
|
|
88
88
|
"@tsparticles/prettier-config": "^2.1.0",
|
|
89
89
|
"@tsparticles/tsconfig": "^2.0.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/cli",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bin": {
|
|
6
6
|
"tsparticles-cli": "dist/cli.js"
|
|
@@ -12,38 +12,38 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@tsparticles/eslint-config": "^2.1.4",
|
|
14
14
|
"@tsparticles/prettier-config": "^2.1.0",
|
|
15
|
-
"@tsparticles/tsconfig": "^2.
|
|
16
|
-
"@tsparticles/webpack-plugin": "^2.1.
|
|
17
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
18
|
-
"@typescript-eslint/parser": "^
|
|
19
|
-
"commander": "^
|
|
20
|
-
"eslint": "^8.
|
|
15
|
+
"@tsparticles/tsconfig": "^2.1.7",
|
|
16
|
+
"@tsparticles/webpack-plugin": "^2.1.6",
|
|
17
|
+
"@typescript-eslint/eslint-plugin": "^7.1.0",
|
|
18
|
+
"@typescript-eslint/parser": "^7.1.0",
|
|
19
|
+
"commander": "^12.0.0",
|
|
20
|
+
"eslint": "^8.57.0",
|
|
21
21
|
"eslint-config-prettier": "^9.1.0",
|
|
22
|
-
"eslint-plugin-jsdoc": "^48.0
|
|
22
|
+
"eslint-plugin-jsdoc": "^48.2.0",
|
|
23
23
|
"eslint-plugin-tsdoc": "^0.2.17",
|
|
24
24
|
"fs-extra": "^11.2.0",
|
|
25
25
|
"klaw": "^4.1.0",
|
|
26
26
|
"lookpath": "^1.2.2",
|
|
27
27
|
"madge": "^6.1.0",
|
|
28
28
|
"path-scurry": "^1.10.1",
|
|
29
|
-
"prettier": "^3.2.
|
|
30
|
-
"prettier-plugin-multiline-arrays": "^3.0.
|
|
29
|
+
"prettier": "^3.2.5",
|
|
30
|
+
"prettier-plugin-multiline-arrays": "^3.0.4",
|
|
31
31
|
"prompts": "^2.4.2",
|
|
32
32
|
"rimraf": "^5.0.5",
|
|
33
33
|
"typescript": "^5.3.3",
|
|
34
|
-
"webpack": "^5.90.
|
|
34
|
+
"webpack": "^5.90.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/chai": "^4.3.
|
|
37
|
+
"@types/chai": "^4.3.12",
|
|
38
38
|
"@types/fs-extra": "^11.0.4",
|
|
39
39
|
"@types/klaw": "^3.0.6",
|
|
40
40
|
"@types/madge": "^5.0.3",
|
|
41
41
|
"@types/mocha": "^10.0.6",
|
|
42
|
-
"@types/node": "^20.11.
|
|
42
|
+
"@types/node": "^20.11.20",
|
|
43
43
|
"@types/prompts": "^2.4.9",
|
|
44
|
-
"chai": "^4.4.
|
|
44
|
+
"chai": "^4.4.1",
|
|
45
45
|
"cross-env": "^7.0.3",
|
|
46
|
-
"mocha": "^10.
|
|
46
|
+
"mocha": "^10.3.0",
|
|
47
47
|
"nyc": "^15.1.0",
|
|
48
48
|
"ts-node": "^10.9.2"
|
|
49
49
|
},
|
package/src/build/build.ts
CHANGED
|
@@ -85,7 +85,7 @@ buildCommand.action(async (argPath: string) => {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
if (canContinue && prettier) {
|
|
88
|
-
const { prettifyReadme, prettifyPackageJson, prettifyPackageDistJson } = await import("./build-prettier");
|
|
88
|
+
const { prettifyReadme, prettifyPackageJson, prettifyPackageDistJson } = await import("./build-prettier.js");
|
|
89
89
|
|
|
90
90
|
canContinue = await prettifyReadme(basePath, ci);
|
|
91
91
|
canContinue = await prettifyPackageJson(basePath, ci);
|
package/src/tsconfig.json
CHANGED
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
28
28
|
|
|
29
29
|
/* Modules */
|
|
30
|
-
"module": "
|
|
30
|
+
"module": "Node16",
|
|
31
31
|
/* Specify what module code is generated. */
|
|
32
32
|
"rootDir": ".",
|
|
33
33
|
/* Specify the root folder within your source files. */
|
|
34
|
-
"moduleResolution": "
|
|
34
|
+
"moduleResolution": "Node16",
|
|
35
35
|
/* Specify how TypeScript looks up a file from a given module specifier. */
|
|
36
36
|
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
37
37
|
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
/* Ensure that casing is correct in imports. */
|
|
86
86
|
|
|
87
87
|
/* Type Checking */
|
|
88
|
-
"strict": true
|
|
88
|
+
"strict": true
|
|
89
89
|
/* Enable all strict type-checking options. */
|
|
90
90
|
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
91
91
|
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
// "skipLibCheck": true
|
|
112
112
|
/* Skip type checking all .d.ts files. */
|
|
113
113
|
},
|
|
114
|
-
"references": [{ "path": "../" }]
|
|
114
|
+
"references": [{ "path": "../" }]
|
|
115
115
|
}
|