📦 sdk: fix nextjs package

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-03-13 20:10:28 +01:00
parent 84a734dd9b
commit f276deeeeb
4 changed files with 39 additions and 20 deletions

View File

@@ -40,16 +40,19 @@ function checkUncommittedChanges() {
}
function main() {
checkUncommittedChanges();
const args = arg({
// Types
'--version': String,
'--test': Boolean,
'--skip-git': Boolean,
// Aliases
'-v': '--version',
});
if (!args['--skip-git']) {
checkUncommittedChanges();
}
const version = args['--version'];
const test = args['--test'];
@@ -57,22 +60,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: Record<string, unknown> = {
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',
},
};
// Not sure if I even should have type: module for any sdk
if (name === 'nextjs') {
delete properties.type;
}
const pkgJson = require(
workspacePath(`./packages/sdks/${name}/package.json`)
);