@tsparticles/cli 2.2.2 → 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.
@@ -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 Promise.resolve(`${path_1.default.join(basePath, "webpack.config.js")}`).then(s => __importStar(require(s))));
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 Promise.resolve(`${path_1.default.join(basePath, "package.json")}`).then(s => __importStar(require(s)))), libPackage = path_1.default.join(basePath, "package.dist.json"), distPath = path_1.default.join(basePath, pkgInfo.publishConfig?.directory ?? "dist");
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 Promise.resolve().then(() => __importStar(require("path")));
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 Promise.resolve().then(() => __importStar(require("path"))), distFolder = path.join(basePath, "dist"), pkgInfo = (await fs_extra_1.default.exists(path.join(distFolder, "package.json")))
73
- ? (await Promise.resolve(`${path.join(distFolder, "package.json")}`).then(s => __importStar(require(s))))
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;
@@ -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 Promise.resolve().then(() => __importStar(require("typescript"))), parsed = ts.parseJsonConfigFileContent(options, ts.sys, basePath);
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
  }
@@ -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 Promise.resolve().then(() => __importStar(require("./build-diststats.js"))), oldStats = await getDistStats(basePath);
20
+ const basePath = process.cwd(), { getDistStats } = await import("./build-diststats.js"), oldStats = await getDistStats(basePath);
44
21
  if (clean) {
45
- const { clearDist } = await Promise.resolve().then(() => __importStar(require("./build-clear.js")));
22
+ const { clearDist } = await import("./build-clear.js");
46
23
  await clearDist(basePath);
47
24
  }
48
- const path = await Promise.resolve().then(() => __importStar(require("path"))), srcPath = path.join(basePath, argPath), fs = await Promise.resolve().then(() => __importStar(require("fs-extra")));
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 Promise.resolve().then(() => __importStar(require("./build-prettier.js")));
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 Promise.resolve().then(() => __importStar(require("./build-eslint.js")));
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 Promise.resolve().then(() => __importStar(require("./build-tsc.js")));
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 Promise.resolve().then(() => __importStar(require("./build-circular-deps.js")));
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 Promise.resolve().then(() => __importStar(require("./build-bundle.js")));
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 Promise.resolve().then(() => __importStar(require("./build-prettier")));
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 Promise.resolve().then(() => __importStar(require("./build-distfiles.js")));
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.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.2",
3
+ "version": "2.2.3",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "tsparticles-cli": "dist/cli.js"
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "@tsparticles/eslint-config": "^2.1.4",
14
14
  "@tsparticles/prettier-config": "^2.1.0",
15
- "@tsparticles/tsconfig": "^2.1.6",
15
+ "@tsparticles/tsconfig": "^2.1.7",
16
16
  "@tsparticles/webpack-plugin": "^2.1.6",
17
17
  "@typescript-eslint/eslint-plugin": "^7.1.0",
18
18
  "@typescript-eslint/parser": "^7.1.0",
@@ -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": "commonjs",
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": "node",
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. */