@arkyn/server 3.0.1-beta.151 → 3.0.1-beta.152

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkyn/server",
3
- "version": "3.0.1-beta.151",
3
+ "version": "3.0.1-beta.152",
4
4
  "author": "Arkyn | Lucas Gonçalves",
5
5
  "main": "./dist/bundle.js",
6
6
  "module": "./dist/bundle.js",
@@ -1,57 +0,0 @@
1
- import { resolve } from "node:path";
2
- import Bun from "bun";
3
-
4
- interface ExportEntry {
5
- import: string;
6
- types?: string;
7
- }
8
-
9
- interface PackageJson {
10
- exports?: Record<string, ExportEntry>;
11
- [key: string]: unknown;
12
- }
13
-
14
- const root = process.cwd();
15
-
16
- const indexContent = await Bun.file(resolve(root, "src/index.ts")).text();
17
-
18
- const packageJson = (await Bun.file(
19
- resolve(root, "package.json"),
20
- ).json()) as PackageJson;
21
-
22
- const exportsMap: Record<string, ExportEntry> = {};
23
-
24
- const regex =
25
- /export\s+(?:\*|\{[\s\S]*?\}|type\s+\{[\s\S]*?\})\s+from\s+["'](.+)["']/g;
26
-
27
- for (const match of indexContent.matchAll(regex)) {
28
- let importPath = match[1];
29
-
30
- if (!importPath.startsWith(".")) continue;
31
-
32
- importPath = importPath.replace(/^\.\//, "");
33
-
34
- const exportName = importPath.split("/").pop()!;
35
-
36
- exportsMap[`./${exportName}`] = {
37
- import: `./dist/${importPath}/index.js`,
38
- types: `./dist/${importPath}/index.d.ts`,
39
- };
40
- }
41
-
42
- packageJson.exports = {
43
- ".": {
44
- import: "./dist/bundle.js",
45
- types: "./dist/index.d.ts",
46
- },
47
- ...Object.fromEntries(
48
- Object.entries(exportsMap).sort(([a], [b]) => a.localeCompare(b)),
49
- ),
50
- };
51
-
52
- await Bun.write(
53
- resolve(root, "package.json"),
54
- JSON.stringify(packageJson, null, 2) + "\n",
55
- );
56
-
57
- console.log(`Added ${Object.keys(exportsMap).length + 2} exports.`);