@tsparticles/cli 2.2.3 → 2.2.4

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,4 +1,27 @@
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
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
@@ -14,7 +37,7 @@ async function bundle(basePath) {
14
37
  console.log("Bundling started");
15
38
  let res = false;
16
39
  try {
17
- const options = (await import(path_1.default.join(basePath, "webpack.config.js")));
40
+ const options = (await Promise.resolve(`${path_1.default.join(basePath, "webpack.config.js")}`).then(s => __importStar(require(s))));
18
41
  res = await new Promise((resolve, reject) => {
19
42
  (0, webpack_1.default)(options.default, (err, stats) => {
20
43
  if (err) {
@@ -1,4 +1,27 @@
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
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
@@ -15,7 +38,7 @@ async function buildDistFiles(basePath) {
15
38
  console.log("Build - started on dist files");
16
39
  let res;
17
40
  try {
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");
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");
19
42
  const data = await fs_extra_1.default.readFile(libPackage), text = data.toString(), libObj = JSON.parse(text);
20
43
  libObj.version = pkgInfo.version;
21
44
  if (pkgInfo.dependencies) {
@@ -1,4 +1,27 @@
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
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
@@ -20,7 +43,7 @@ async function getFolderStats(folderPath, bundlePath) {
20
43
  if (!(await fs_extra_1.default.pathExists(folderPath))) {
21
44
  return stats;
22
45
  }
23
- const dir = await fs_extra_1.default.promises.opendir(folderPath), path = await import("path");
46
+ const dir = await fs_extra_1.default.promises.opendir(folderPath), path = await Promise.resolve().then(() => __importStar(require("path")));
24
47
  for await (const dirent of dir) {
25
48
  const increment = 1;
26
49
  if (dirent.isDirectory()) {
@@ -46,8 +69,8 @@ async function getFolderStats(folderPath, bundlePath) {
46
69
  * @returns the stats for the dist folder
47
70
  */
48
71
  async function getDistStats(basePath) {
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")))
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))))
51
74
  : {}, bundlePath = (await fs_extra_1.default.exists(distFolder)) && pkgInfo.jsdelivr
52
75
  ? path.resolve(path.join(distFolder, pkgInfo.jsdelivr))
53
76
  : undefined;
@@ -1,4 +1,27 @@
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
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
@@ -101,7 +124,7 @@ async function compile(basePath, type) {
101
124
  if (!options) {
102
125
  return 3 /* ExitCodes.NoOptions */;
103
126
  }
104
- const ts = await import("typescript"), parsed = ts.parseJsonConfigFileContent(options, ts.sys, basePath);
127
+ const ts = await Promise.resolve().then(() => __importStar(require("typescript"))), parsed = ts.parseJsonConfigFileContent(options, ts.sys, basePath);
105
128
  if (!parsed) {
106
129
  return 4 /* ExitCodes.ParseError */;
107
130
  }
@@ -1,4 +1,27 @@
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
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
26
  exports.buildCommand = void 0;
4
27
  const commander_1 = require("commander");
@@ -17,44 +40,44 @@ buildCommand.option("-t, --tsc", "Build the library using TypeScript", false);
17
40
  buildCommand.argument("[path]", `Path to the project root folder, default is "src"`, "src");
18
41
  buildCommand.action(async (argPath) => {
19
42
  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;
20
- const basePath = process.cwd(), { getDistStats } = await import("./build-diststats.js"), oldStats = await getDistStats(basePath);
43
+ const basePath = process.cwd(), { getDistStats } = await Promise.resolve().then(() => __importStar(require("./build-diststats.js"))), oldStats = await getDistStats(basePath);
21
44
  if (clean) {
22
- const { clearDist } = await import("./build-clear.js");
45
+ const { clearDist } = await Promise.resolve().then(() => __importStar(require("./build-clear.js")));
23
46
  await clearDist(basePath);
24
47
  }
25
- const path = await import("path"), srcPath = path.join(basePath, argPath), fs = await import("fs-extra");
48
+ const path = await Promise.resolve().then(() => __importStar(require("path"))), srcPath = path.join(basePath, argPath), fs = await Promise.resolve().then(() => __importStar(require("fs-extra")));
26
49
  if (!(await fs.pathExists(srcPath))) {
27
50
  throw new Error("Provided path does not exist");
28
51
  }
29
52
  let canContinue = true;
30
53
  if (canContinue && prettier) {
31
- const { prettifySrc } = await import("./build-prettier.js");
54
+ const { prettifySrc } = await Promise.resolve().then(() => __importStar(require("./build-prettier.js")));
32
55
  canContinue = await prettifySrc(basePath, srcPath, ci);
33
56
  }
34
57
  if (canContinue && doLint) {
35
- const { lint } = await import("./build-eslint.js");
58
+ const { lint } = await Promise.resolve().then(() => __importStar(require("./build-eslint.js")));
36
59
  canContinue = await lint(ci);
37
60
  }
38
61
  if (canContinue && tsc) {
39
- const { buildTS } = await import("./build-tsc.js");
62
+ const { buildTS } = await Promise.resolve().then(() => __importStar(require("./build-tsc.js")));
40
63
  canContinue = await buildTS(basePath);
41
64
  }
42
65
  if (canContinue && circularDeps) {
43
- const { buildCircularDeps } = await import("./build-circular-deps.js");
66
+ const { buildCircularDeps } = await Promise.resolve().then(() => __importStar(require("./build-circular-deps.js")));
44
67
  canContinue = await buildCircularDeps(basePath);
45
68
  }
46
69
  if (canContinue && doBundle) {
47
- const { bundle } = await import("./build-bundle.js");
70
+ const { bundle } = await Promise.resolve().then(() => __importStar(require("./build-bundle.js")));
48
71
  canContinue = await bundle(basePath);
49
72
  }
50
73
  if (canContinue && prettier) {
51
- const { prettifyReadme, prettifyPackageJson, prettifyPackageDistJson } = await import("./build-prettier.js");
74
+ const { prettifyReadme, prettifyPackageJson, prettifyPackageDistJson } = await Promise.resolve().then(() => __importStar(require("./build-prettier.js")));
52
75
  canContinue = await prettifyReadme(basePath, ci);
53
76
  canContinue = await prettifyPackageJson(basePath, ci);
54
77
  canContinue = await prettifyPackageDistJson(basePath, ci);
55
78
  }
56
79
  if (canContinue && distfiles) {
57
- const { buildDistFiles } = await import("./build-distfiles.js");
80
+ const { buildDistFiles } = await Promise.resolve().then(() => __importStar(require("./build-distfiles.js")));
58
81
  canContinue = await buildDistFiles(basePath);
59
82
  }
60
83
  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.3",
86
+ "@tsparticles/cli": "^2.2.4",
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",
3
+ "version": "2.2.4",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "tsparticles-cli": "dist/cli.js"
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": "Node16",
30
+ "module": "commonjs",
31
31
  /* Specify what module code is generated. */
32
32
  "rootDir": ".",
33
33
  /* Specify the root folder within your source files. */
34
- "moduleResolution": "Node16",
34
+ "moduleResolution": "node",
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. */