wip build nextjs 13

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-03-13 15:37:49 +01:00
parent a0d0cfb5b8
commit 48ff1004f3
4 changed files with 280 additions and 529 deletions

View File

@@ -12,9 +12,9 @@
"@openpanel/web": "workspace:*"
},
"peerDependencies": {
"next": "^14.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"next": "^11.1.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@openpanel/eslint-config": "workspace:*",

View File

@@ -6,4 +6,5 @@ export default defineConfig({
...(config as any),
entry: ['index.tsx'],
format: ['cjs', 'esm'],
external: ['next', 'react', 'react-dom'],
});

769
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -57,22 +57,27 @@ function main() {
return console.error('Version is not valid');
}
const properties = {
private: false,
version,
type: 'module',
main: './dist/index.js',
module: './dist/index.mjs',
types: './dist/index.d.ts',
files: ['dist'],
exports: {
import: './dist/index.js',
require: './dist/index.cjs',
},
};
try {
for (const name of sdkPackages) {
const properties = {
private: false,
version,
type: 'module',
main: './dist/index.js',
module: './dist/index.mjs',
types: './dist/index.d.ts',
files: ['dist'],
exports: {
import: './dist/index.js',
require: './dist/index.cjs',
},
};
if (name === 'nextjs') {
// @ts-expect-error
delete properties.type;
// @ts-expect-error
delete properties.module;
}
const pkgJson = require(
workspacePath(`./packages/sdks/${name}/package.json`)
);