@plumeria/utils 12.0.7 → 12.0.8

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/optimizer.js CHANGED
@@ -16,10 +16,10 @@ async function optimizer(cssCode) {
16
16
  code: Buffer.from(merged.css),
17
17
  minify: process.env.NODE_ENV === 'production',
18
18
  targets: {
19
- safari: 16,
20
- edge: 110,
21
- firefox: 110,
22
- chrome: 110,
19
+ safari: 16 << 16,
20
+ edge: 110 << 16,
21
+ firefox: 110 << 16,
22
+ chrome: 110 << 16,
23
23
  },
24
24
  });
25
25
  return Buffer.from(light.code).toString('utf-8');
package/dist/resolver.js CHANGED
@@ -36,41 +36,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.resolveImportPath = resolveImportPath;
37
37
  const fs = __importStar(require("fs"));
38
38
  const path = __importStar(require("path"));
39
- const tsConfigCache = new Map();
40
- const tsConfigPathCache = new Map();
41
- function getTsConfig(startDir) {
42
- let currentDir = startDir;
43
- if (tsConfigPathCache.has(currentDir)) {
44
- const cachedPath = tsConfigPathCache.get(currentDir);
45
- if (cachedPath === null)
46
- return null;
47
- return {
48
- config: tsConfigCache.get(cachedPath) ?? null,
49
- basePath: path.dirname(cachedPath),
50
- };
39
+ let cachedTsConfig = undefined;
40
+ function getTsConfig() {
41
+ if (cachedTsConfig !== undefined) {
42
+ return cachedTsConfig;
51
43
  }
52
- while (currentDir !== path.parse(currentDir).root) {
53
- const tsConfigPath = path.join(process.cwd(), 'tsconfig.json');
54
- if (fs.existsSync(tsConfigPath)) {
55
- if (!tsConfigCache.has(tsConfigPath)) {
56
- try {
57
- const config = require(tsConfigPath);
58
- tsConfigCache.set(tsConfigPath, config.compilerOptions || null);
59
- }
60
- catch {
61
- tsConfigCache.set(tsConfigPath, null);
62
- }
63
- }
64
- tsConfigPathCache.set(startDir, tsConfigPath);
65
- return {
66
- config: tsConfigCache.get(tsConfigPath) ?? null,
44
+ const tsConfigPath = path.join(process.cwd(), 'tsconfig.json');
45
+ if (fs.existsSync(tsConfigPath)) {
46
+ try {
47
+ const config = require(tsConfigPath);
48
+ cachedTsConfig = {
49
+ config: config.compilerOptions || null,
67
50
  basePath: path.dirname(tsConfigPath),
68
51
  };
69
52
  }
70
- currentDir = path.dirname(currentDir);
53
+ catch {
54
+ cachedTsConfig = null;
55
+ }
71
56
  }
72
- tsConfigPathCache.set(startDir, null);
73
- return null;
57
+ else {
58
+ cachedTsConfig = null;
59
+ }
60
+ return cachedTsConfig;
74
61
  }
75
62
  const extensions = [
76
63
  '.ts',
@@ -96,7 +83,7 @@ function resolveImportPath(importPath, importerPath) {
96
83
  if (importPath.startsWith('.')) {
97
84
  return resolveWithExtension(path.resolve(path.dirname(importerPath), importPath));
98
85
  }
99
- const tsConfig = getTsConfig(path.dirname(importerPath));
86
+ const tsConfig = getTsConfig();
100
87
  const config = tsConfig?.config;
101
88
  if (config?.paths) {
102
89
  const root = tsConfig.basePath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/utils",
3
- "version": "12.0.7",
3
+ "version": "12.0.8",
4
4
  "description": "Plumeria Utils",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",