prodex 1.3.0 → 1.4.1

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.
Files changed (42) hide show
  1. package/README.md +234 -234
  2. package/dist/cli/cli-input.js +20 -26
  3. package/dist/cli/init.js +4 -5
  4. package/dist/cli/picker.js +8 -7
  5. package/dist/cli/summary.js +15 -9
  6. package/dist/constants/cache-keys.js +11 -0
  7. package/dist/constants/config.js +6 -5
  8. package/dist/constants/flags.js +73 -0
  9. package/dist/constants/index.js +20 -0
  10. package/dist/constants/render-constants.js +0 -4
  11. package/dist/core/combine.js +31 -13
  12. package/dist/core/dependency.js +39 -19
  13. package/dist/core/helpers.js +42 -38
  14. package/dist/core/managers/cache.js +53 -0
  15. package/dist/core/managers/config.js +103 -0
  16. package/dist/core/renderers.js +9 -8
  17. package/dist/debug.js +13 -0
  18. package/dist/index.js +42 -13
  19. package/dist/lib/logger.js +37 -9
  20. package/dist/lib/polyfills.js +0 -10
  21. package/dist/lib/utils.js +0 -13
  22. package/dist/{core/parsers → resolvers/js}/extract-imports.js +1 -7
  23. package/dist/resolvers/js/js-resolver.js +92 -116
  24. package/dist/resolvers/js/resolve-alias.js +57 -0
  25. package/dist/resolvers/php/bindings.js +20 -9
  26. package/dist/resolvers/php/extract-imports.js +49 -0
  27. package/dist/resolvers/php/php-resolver.js +98 -59
  28. package/dist/resolvers/php/psr4.js +18 -5
  29. package/dist/shared/collections.js +33 -0
  30. package/dist/shared/index.js +19 -0
  31. package/dist/shared/io.js +51 -0
  32. package/dist/shared/patterns.js +29 -0
  33. package/dist/store.js +15 -0
  34. package/package.json +5 -4
  35. package/dist/cli/flags.js +0 -42
  36. package/dist/constants/config-loader.js +0 -95
  37. package/dist/core/file-utils.js +0 -41
  38. package/dist/resolvers/js/alias-loader.js +0 -52
  39. package/dist/resolvers/php/patterns.js +0 -17
  40. package/dist/resolvers/shared/excludes.js +0 -11
  41. package/dist/resolvers/shared/file-cache.js +0 -29
  42. package/dist/resolvers/shared/stats.js +0 -17
@@ -1,17 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.extractPhpImports = extractPhpImports;
5
- function extractPhpImports(code) {
6
- const out = new Set();
7
- const patterns = [
8
- /\b(?:require|include|require_once|include_once)\s*\(?['"]([^'"]+)['"]\)?/g,
9
- /\buse\s+([A-Z][\w\\]+(?:\s*{[^}]+})?)/g
10
- ];
11
- for (const r of patterns) {
12
- let m;
13
- while ((m = r.exec(code)))
14
- out.add(m[1]);
15
- }
16
- return out;
17
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.isExcluded = isExcluded;
8
- const micromatch_1 = __importDefault(require("micromatch"));
9
- function isExcluded(imp, exclude = []) {
10
- return micromatch_1.default.isMatch(imp.replaceAll("\\", "/"), exclude);
11
- }
@@ -1,29 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.tryResolvePhpFile = tryResolvePhpFile;
8
- const fs_1 = __importDefault(require("fs"));
9
- const path_1 = __importDefault(require("path"));
10
- const CACHE = new Map();
11
- function tryResolvePhpFile(imp, fromFile, psr4) {
12
- const key = `php:${imp}:${fromFile}`;
13
- if (CACHE.has(key))
14
- return CACHE.get(key);
15
- const nsKey = Object.keys(psr4).find(k => imp.startsWith(k));
16
- if (!nsKey) {
17
- CACHE.set(key, null);
18
- return null;
19
- }
20
- const rel = imp.slice(nsKey.length).replace(/\\/g, "/");
21
- const tries = [
22
- path_1.default.join(psr4[nsKey], rel),
23
- path_1.default.join(psr4[nsKey], rel + ".php"),
24
- path_1.default.join(psr4[nsKey], rel, "index.php")
25
- ];
26
- const resolved = tries.find(p => fs_1.default.existsSync(p) && fs_1.default.statSync(p).isFile());
27
- CACHE.set(key, resolved ? path_1.default.resolve(resolved) : null);
28
- return CACHE.get(key);
29
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.newStats = newStats;
5
- exports.mergeStats = mergeStats;
6
- exports.emptyStats = emptyStats;
7
- function newStats() {
8
- return { expected: new Set(), resolved: new Set() };
9
- }
10
- function mergeStats(target, src) {
11
- src.expected.forEach(i => target.expected.add(i));
12
- src.resolved.forEach(i => target.resolved.add(i));
13
- return target;
14
- }
15
- function emptyStats() {
16
- return { expected: new Set(), resolved: new Set() };
17
- }