@orion-studios/payload-admin-components 0.2.0-beta.6 → 0.2.0-beta.7

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/index.js CHANGED
@@ -76,12 +76,12 @@ var import_meta = {};
76
76
  function getPkgDistDir() {
77
77
  try {
78
78
  if (typeof import_meta?.url === "string") {
79
- return import_path.default.resolve(import_path.default.dirname((0, import_url.fileURLToPath)(import_meta.url)), "..");
79
+ return import_path.default.dirname((0, import_url.fileURLToPath)(import_meta.url));
80
80
  }
81
81
  } catch {
82
82
  }
83
83
  if (typeof __dirname === "string") {
84
- return import_path.default.resolve(__dirname, "..");
84
+ return __dirname;
85
85
  }
86
86
  try {
87
87
  const pkgJson = require.resolve("@orion-studios/payload-admin-components/package.json");
package/dist/index.mjs CHANGED
@@ -32,12 +32,12 @@ var themePreferenceField = {
32
32
  function getPkgDistDir() {
33
33
  try {
34
34
  if (typeof import.meta?.url === "string") {
35
- return path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
35
+ return path.dirname(fileURLToPath(import.meta.url));
36
36
  }
37
37
  } catch {
38
38
  }
39
39
  if (typeof __dirname === "string") {
40
- return path.resolve(__dirname, "..");
40
+ return __dirname;
41
41
  }
42
42
  try {
43
43
  const pkgJson = __require.resolve("@orion-studios/payload-admin-components/package.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-studios/payload-admin-components",
3
- "version": "0.2.0-beta.6",
3
+ "version": "0.2.0-beta.7",
4
4
  "description": "Custom admin UI components for Payload CMS",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -7,21 +7,22 @@ import { themePreferenceField } from '../fields/themePreference'
7
7
  /**
8
8
  * Resolve the dist/ directory of this package.
9
9
  * Works in both CJS (__dirname) and ESM (import.meta.url) contexts.
10
+ * Note: tsup bundles everything into dist/index.js, so __dirname IS the dist dir.
10
11
  */
11
12
  function getPkgDistDir(): string {
13
+ // ESM — import.meta.url is available
12
14
  try {
13
- // ESM — import.meta.url is available
14
15
  if (typeof import.meta?.url === 'string') {
15
- return path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
16
+ return path.dirname(fileURLToPath(import.meta.url))
16
17
  }
17
18
  } catch {
18
19
  // fall through to CJS
19
20
  }
20
- // CJS — __dirname is available
21
+ // CJS — __dirname is available (tsup bundles to dist/index.js, so __dirname = dist/)
21
22
  if (typeof __dirname === 'string') {
22
- return path.resolve(__dirname, '..')
23
+ return __dirname
23
24
  }
24
- // Fallback: resolve from cwd
25
+ // Fallback: resolve from package.json
25
26
  try {
26
27
  const pkgJson = require.resolve('@orion-studios/payload-admin-components/package.json')
27
28
  return path.resolve(path.dirname(pkgJson), 'dist')