From e85898fa3d4ad7b8877802b0afdacc88e8e6404b Mon Sep 17 00:00:00 2001 From: bobrimperator Date: Sat, 28 Dec 2024 10:15:17 +0100 Subject: [PATCH] feat(ember-simple-auth): specify addon exports --- packages/ember-simple-auth/package.json | 42 +++++++++++++++---- packages/ember-simple-auth/rollup.config.mjs | 1 + .../ember-simple-auth/src/services/session.ts | 2 +- 3 files changed, 37 insertions(+), 8 deletions(-) diff --git a/packages/ember-simple-auth/package.json b/packages/ember-simple-auth/package.json index c6af56e02..2e824d625 100644 --- a/packages/ember-simple-auth/package.json +++ b/packages/ember-simple-auth/package.json @@ -84,17 +84,45 @@ } }, "exports": { - ".": "./dist/index.js", - "./*": "./dist/*.js", - "./authenticators/oauth2-password-grant": "./dist/authenticators/oauth2-password-grant.js", + ".": { + "default": "./dist/index.js", + "types": "./declarations/index.d.ts" + }, + "./*": { + "default": "./dist/*.js", + "types": "./declarations/*.d.ts" + }, "./addon-main.js": "./addon-main.cjs", + "./authenticators/*": { + "default": "./dist/authenticators/*.js", + "types": "./declarations/authenticators/*.d.ts" + }, + "./initializers/*": { + "default": "./dist/initializers/*.js", + "types": "./declarations/initializers/*.d.ts" + }, + "./services/session": { + "default": "./dist/services/session.js", + "types": "./declarations/services/session.d.ts" + }, + "./session-stores/*": { + "default": "./dist/session-stores/*.js", + "types": "./declarations/session-stores/*.d.ts" + }, "./test-support": { - "types": "./declarations/test-support/*.d.ts", - "default": "./dist/test-support/index.js" + "default": "./dist/test-support/index.js", + "types": "./declarations/test-support/*.d.ts" }, "./utils/*": { - "types": "./dist/utils/*.d.ts", - "default": "./dist/utils/*.js" + "default": "./dist/utils/*.js", + "types": "./declarations/utils/*.d.ts" + } + }, + "typesVersions": { + "*": { + "*": [ + "./declarations/*.d.ts" + ] } }, "peerDependencies": { diff --git a/packages/ember-simple-auth/rollup.config.mjs b/packages/ember-simple-auth/rollup.config.mjs index bb3ad1762..cea29cf91 100644 --- a/packages/ember-simple-auth/rollup.config.mjs +++ b/packages/ember-simple-auth/rollup.config.mjs @@ -22,6 +22,7 @@ export default { addon.publicEntrypoints([ 'services/**/*.js', 'session-stores/**/*.js', + 'utils/is-fastboot.js', 'utils/**/*.js', 'authenticators/**/*.js', 'test-support/**/*.js', diff --git a/packages/ember-simple-auth/src/services/session.ts b/packages/ember-simple-auth/src/services/session.ts index 917bbc34f..6f31555bb 100644 --- a/packages/ember-simple-auth/src/services/session.ts +++ b/packages/ember-simple-auth/src/services/session.ts @@ -59,7 +59,7 @@ type InternalSessionMock = { @extends Service @public */ -export default class EmberSimpleAuthSessionService extends Service { +export default class SessionService extends Service { session: InternalSessionMock; constructor(owner: any) {