Skip to content

Commit

Permalink
refactor: move wrapping helper to utils (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
pattan authored Sep 10, 2024
1 parent 7d5f793 commit 9d83b16
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
"import": "./dist/advantage/messaging/publisher-side.js",
"require": "./dist/advantage/messaging/publisher-side.cjs",
"types": "./dist/advantage/messaging/publisher-side.d.ts"
},
"./utils": {
"import": "./dist/utils/index.js",
"require": "./dist/utils/index.cjs",
"types": "./dist/utils/index.d.ts"
}
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/advantage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export { Advantage } from "./advantage";
import { AdvantageWrapper } from "./wrapper";
import { AdvantageUILayer } from "./ui-layer";
import logger from "../utils/logging";
import { advantageWrapAdSlotElement as actualAdvantageWrapAdSlotElement } from "./wrapping-helper";
import { advantageWrapAdSlotElement as actualAdvantageWrapAdSlotElement } from "../utils/wrapping-helper";
export { actualAdvantageWrapAdSlotElement as advantageWrapAdSlotElement };
export * from "./messaging";
export * from "../types";
Expand Down
1 change: 1 addition & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export {
sendMessageAndOpenChannel,
sendMessageAndAwaitResponse
} from "./messaging";
export * from "./wrapping-helper";
File renamed without changes.
2 changes: 1 addition & 1 deletion www/docs/tutorial/publisher.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ It is now time to wrap your ad slots in the Advantage Wrapper.
You can also choose to use a helper method that does the wrapping for you:

```ts
import { advantageWrapAdSlotElement } from "@get-advantage/advantage";
import { advantageWrapAdSlotElement } from "@get-advantage/advantage/utils";

/* advantageWrapAdSlotElement is a function that wraps an ad slot element with an
Advantage-wrapper. It takes either a selector string or an HTMLElement as an argument.
Expand Down

0 comments on commit 9d83b16

Please sign in to comment.