sonamu 0.2.50 → 0.2.52

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": "sonamu",
3
- "version": "0.2.50",
3
+ "version": "0.2.52",
4
4
  "description": "Sonamu — TypeScript Fullstack API Framework",
5
5
  "keywords": [
6
6
  "typescript",
@@ -8,6 +8,13 @@
8
8
  "orm"
9
9
  ],
10
10
  "main": "./dist/index.js",
11
+ "module": "./dist/index.mjs",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.mjs",
15
+ "require": "./dist/index.js"
16
+ }
17
+ },
11
18
  "scripts": {
12
19
  "dev": "yarn tsc -w -p ./tsconfig.json",
13
20
  "build": "tsup --config ./tsup.config.js"
@@ -22,7 +29,7 @@
22
29
  "type": "git",
23
30
  "url": "https://github.com/ping-alive/sonamu.git"
24
31
  },
25
- "bin": "./dist/bin/cli.js",
32
+ "bin": "./dist/bin/cli-wrapper.mjs",
26
33
  "dependencies": {
27
34
  "chalk": "^4.1.2",
28
35
  "dotenv": "^16.0.2",
@@ -25,7 +25,9 @@ class DBClass {
25
25
  );
26
26
  try {
27
27
  const knexfileModule = await import(dbConfigPath);
28
- return knexfileModule.default as SonamuDBConfig;
28
+ return (knexfileModule.default?.default ??
29
+ knexfileModule.default ??
30
+ knexfileModule) as SonamuDBConfig;
29
31
  } catch {}
30
32
 
31
33
  throw new ServiceUnavailableException(
package/tsup.config.js CHANGED
@@ -11,13 +11,13 @@ export default defineConfig({
11
11
  shims: true,
12
12
  platform: "node",
13
13
  splitting: true,
14
- banner(ctx) {
15
- if (ctx.format === "esm") {
16
- return {
17
- js: `const require = (await import('module')).createRequire(import.meta.url);`,
18
- };
19
- }
20
- },
14
+ // banner(ctx) {
15
+ // if (ctx.format === "esm") {
16
+ // return {
17
+ // js: `const require = (await import('module')).createRequire(import.meta.url);`,
18
+ // };
19
+ // }
20
+ // },
21
21
  external: [
22
22
  "chalk",
23
23
  "dotenv",