@wopr-network/platform-core 1.14.2 → 1.14.4

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.
@@ -29,8 +29,11 @@ jobs:
29
29
 
30
30
  // Only auto-merge patch and minor updates (not major)
31
31
  const title = details.title;
32
- const isMajor = /from \d+ to \d+/.test(title) &&
33
- title.match(/from (\d+)/)?.[ 1] !== title.match(/to (\d+)/)?.[ 1];
32
+ const fromMajor = title.match(/from (\d+)\.\d/)?.[1];
33
+ const toMajor = title.match(/to (\d+)\.\d/)?.[1];
34
+ const isMajor = fromMajor !== undefined &&
35
+ toMajor !== undefined &&
36
+ fromMajor !== toMajor;
34
37
 
35
38
  core.setOutput('skip', isMajor ? 'true' : 'false');
36
39
  core.setOutput('pr_number', String(pr.number));
@@ -51,4 +54,4 @@ jobs:
51
54
  if: steps.meta.outputs.skip != 'true'
52
55
  env:
53
56
  GH_TOKEN: ${{ github.token }}
54
- run: gh pr merge --auto --squash ${{ steps.meta.outputs.pr_number }} || true
57
+ run: gh pr merge --auto --squash ${{ steps.meta.outputs.pr_number }} --repo ${{ github.repository }}
@@ -189,7 +189,14 @@ export function initBetterAuth(config) {
189
189
  export async function runAuthMigrations() {
190
190
  if (!_config)
191
191
  throw new Error("BetterAuth not initialized — call initBetterAuth() first");
192
- const { getMigrations } = (await import("better-auth/db"));
192
+ // better-auth 1.5.x moved getMigrations from "better-auth/db" to "better-auth/db/migration"
193
+ let getMigrations;
194
+ try {
195
+ ({ getMigrations } = (await import("better-auth/db/migration")));
196
+ }
197
+ catch {
198
+ ({ getMigrations } = (await import("better-auth/db")));
199
+ }
193
200
  const { runMigrations } = await getMigrations(authOptions(_config));
194
201
  await runMigrations();
195
202
  if (_config.twoFactor !== false) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wopr-network/platform-core",
3
- "version": "1.14.2",
3
+ "version": "1.14.4",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -264,7 +264,13 @@ export function initBetterAuth(config: BetterAuthConfig): void {
264
264
  export async function runAuthMigrations(): Promise<void> {
265
265
  if (!_config) throw new Error("BetterAuth not initialized — call initBetterAuth() first");
266
266
  type DbModule = { getMigrations: (opts: BetterAuthOptions) => Promise<{ runMigrations: () => Promise<void> }> };
267
- const { getMigrations } = (await import("better-auth/db")) as unknown as DbModule;
267
+ // better-auth 1.5.x moved getMigrations from "better-auth/db" to "better-auth/db/migration"
268
+ let getMigrations: DbModule["getMigrations"];
269
+ try {
270
+ ({ getMigrations } = (await import("better-auth/db/migration")) as unknown as DbModule);
271
+ } catch {
272
+ ({ getMigrations } = (await import("better-auth/db")) as unknown as DbModule);
273
+ }
268
274
  const { runMigrations } = await getMigrations(authOptions(_config));
269
275
  await runMigrations();
270
276
  if (_config.twoFactor !== false) {