Skip to content

Commit 4655a35

Browse files
committed
fix: move to esm by default
1 parent bec2d0c commit 4655a35

6 files changed

Lines changed: 12 additions & 9 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default defineConfig(
1010
'.yarn',
1111
'node_modules',
1212
'examples/next/.next/**',
13+
'examples/next/next-env.d.ts',
1314
] },
1415
{
1516
languageOptions: {

examples/next/app/premium/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import { useRef } from 'react';
3+
import { useId, useRef } from 'react';
44
import {
55
type RestrictedContentRef,
66
Pixel,
@@ -11,6 +11,7 @@ import Link from 'next/link';
1111

1212
const Premium = () => {
1313
const contentRef = useRef<RestrictedContentRef>(null);
14+
const id = useId();
1415

1516
return (
1617
<div className="app">
@@ -66,7 +67,7 @@ const Premium = () => {
6667
</div>
6768
</RestrictedContent>
6869

69-
<Paywall contentRef={contentRef} />
70+
<Paywall id={id} contentRef={contentRef} />
7071
<Pixel type="page-view" data={{ type: 'premium' }} />
7172

7273
<Link href="/">Return to home</Link>

examples/next/next-env.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
import "./.next/dev/types/routes.d.ts";
34

45
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/app/api-reference/config/typescript
6-
// for more information.
6+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

examples/next/next.config.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/next/next.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default {};

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@
22
"name": "@poool/react-access",
33
"version": "4.1.5",
44
"description": "The easiest way to add Poool Access to your React app ✨",
5+
"type": "module",
56
"repository": {
67
"type": "git",
78
"url": "git+https://github.com/p3ol/react-access.git"
89
},
910
"author": "Ugo Stephant <ugo@poool.fr>",
1011
"license": "MIT",
11-
"main": "dist/index.js",
12-
"module": "dist/index.mjs",
12+
"main": "dist/index.cjs",
13+
"module": "dist/index.js",
1314
"types": "dist/types/index.d.ts",
1415
"sideEffects": false,
1516
"exports": {
1617
".": {
1718
"types": "./dist/types/index.d.ts",
18-
"import": "./dist/index.mjs",
19-
"require": "./dist/index.js"
19+
"import": "./dist/index.js",
20+
"require": "./dist/index.cjs"
2021
}
2122
},
2223
"engines": {

0 commit comments

Comments
 (0)