Skip to content

Commit

Permalink
fix: resolve missing dependencies for type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
abbaseya committed Jun 14, 2024
1 parent 8b08dbd commit 4fa0feb
Show file tree
Hide file tree
Showing 26 changed files with 75 additions and 204 deletions.
17 changes: 2 additions & 15 deletions packages/api/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import commonjs from '@rollup/plugin-commonjs';
import typescript from 'rollup-plugin-typescript2';
import generatePackageJson from 'rollup-plugin-generate-package-json';
import modify from 'rollup-plugin-modify';
import dts from 'rollup-plugin-dts';

import dotenv from 'dotenv';
dotenv.config();
Expand Down Expand Up @@ -199,7 +198,7 @@ const esmBundle = {
plugins: withLogging.concat([
typescript({
tsconfigOverride: {
compilerOptions: {declaration: false},
compilerOptions: {declaration: true},
include: include,
exclude: exclude
}
Expand All @@ -208,18 +207,6 @@ const esmBundle = {
])
};

const typeDeclarations = {
cache: BUILD_CACHE,
input: './index.ts',
output: [
{
format: 'es',
file: 'lib/index.d.ts'
}
],
plugins: [dts()]
};

const BUNDLES = process.env.BUNDLES
? process.env.BUNDLES.split(',')
: ['cjs', 'cjs-legacy', 'esm'];
Expand All @@ -232,7 +219,7 @@ export default () => {
case 'cjs-legacy':
return [commonJSLegacyBundle];
case 'esm':
return [esmBundle, typeDeclarations];
return [esmBundle];
}
return [];
}).flat();
Expand Down
1 change: 0 additions & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"prettier": "^3.3.2",
"require": "^2.4.20",
"rollup": "^4.18.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-generate-package-json": "^3.2.0",
"rollup-plugin-modify": "^3.0.0",
"rollup-plugin-typescript2": "^0.36.0",
Expand Down
17 changes: 2 additions & 15 deletions packages/bucketing/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import commonjs from '@rollup/plugin-commonjs';
import typescript from 'rollup-plugin-typescript2';
import generatePackageJson from 'rollup-plugin-generate-package-json';
import modify from 'rollup-plugin-modify';
import dts from 'rollup-plugin-dts';

import dotenv from 'dotenv';
dotenv.config();
Expand Down Expand Up @@ -199,7 +198,7 @@ const esmBundle = {
plugins: withLogging.concat([
typescript({
tsconfigOverride: {
compilerOptions: {declaration: false},
compilerOptions: {declaration: true},
include: include,
exclude: exclude
}
Expand All @@ -208,18 +207,6 @@ const esmBundle = {
])
};

const typeDeclarations = {
cache: BUILD_CACHE,
input: './index.ts',
output: [
{
format: 'es',
file: 'lib/index.d.ts'
}
],
plugins: [dts()]
};

const BUNDLES = process.env.BUNDLES
? process.env.BUNDLES.split(',')
: ['cjs', 'cjs-legacy', 'esm'];
Expand All @@ -232,7 +219,7 @@ export default () => {
case 'cjs-legacy':
return [commonJSLegacyBundle];
case 'esm':
return [esmBundle, typeDeclarations];
return [esmBundle];
}
return [];
}).flat();
Expand Down
1 change: 0 additions & 1 deletion packages/bucketing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"prettier": "^3.3.2",
"require": "^2.4.20",
"rollup": "^4.18.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-generate-package-json": "^3.2.0",
"rollup-plugin-modify": "^3.0.0",
"rollup-plugin-typescript2": "^0.36.0",
Expand Down
27 changes: 12 additions & 15 deletions packages/data/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import commonjs from '@rollup/plugin-commonjs';
import typescript from 'rollup-plugin-typescript2';
import generatePackageJson from 'rollup-plugin-generate-package-json';
import modify from 'rollup-plugin-modify';
import dts from 'rollup-plugin-dts';

import dotenv from 'dotenv';
dotenv.config();
Expand Down Expand Up @@ -64,7 +63,13 @@ const exclude = [
];

const external = [
'@convertcom/js-sdk-api',
'@convertcom/js-sdk-bucketing',
'@convertcom/js-sdk-enums',
'@convertcom/js-sdk-event',
'@convertcom/js-sdk-logger',
'@convertcom/js-sdk-rules',
'@convertcom/js-sdk-types',
'@convertcom/js-sdk-utils',
'murmurhash'
];
Expand Down Expand Up @@ -130,8 +135,12 @@ const commonJSBundle = {
},
license: 'Apache-2.0',
dependencies: {
'@convertcom/js-sdk-api': '>=1.0.0',
'@convertcom/js-sdk-bucketing': '>=1.0.0',
'@convertcom/js-sdk-enums': '>=1.0.0',
'@convertcom/js-sdk-event': '>=1.0.0',
'@convertcom/js-sdk-logger': '>=1.0.0',
'@convertcom/js-sdk-rules': '>=1.0.0',
'@convertcom/js-sdk-types': '>=1.0.0',
'@convertcom/js-sdk-utils': '>=1.0.0'
},
Expand Down Expand Up @@ -199,7 +208,7 @@ const esmBundle = {
plugins: withLogging.concat([
typescript({
tsconfigOverride: {
compilerOptions: {declaration: false},
compilerOptions: {declaration: true},
include: include,
exclude: exclude
}
Expand All @@ -208,18 +217,6 @@ const esmBundle = {
])
};

const typeDeclarations = {
cache: BUILD_CACHE,
input: './index.ts',
output: [
{
format: 'es',
file: 'lib/index.d.ts'
}
],
plugins: [dts()]
};

const BUNDLES = process.env.BUNDLES
? process.env.BUNDLES.split(',')
: ['cjs', 'cjs-legacy', 'esm'];
Expand All @@ -232,7 +229,7 @@ export default () => {
case 'cjs-legacy':
return [commonJSLegacyBundle];
case 'esm':
return [esmBundle, typeDeclarations];
return [esmBundle];
}
return [];
}).flat();
Expand Down
1 change: 0 additions & 1 deletion packages/data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"prettier": "^3.3.2",
"require": "^2.4.20",
"rollup": "^4.18.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-generate-package-json": "^3.2.0",
"rollup-plugin-modify": "^3.0.0",
"rollup-plugin-typescript2": "^0.36.0",
Expand Down
17 changes: 2 additions & 15 deletions packages/event/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import commonjs from '@rollup/plugin-commonjs';
import typescript from 'rollup-plugin-typescript2';
import generatePackageJson from 'rollup-plugin-generate-package-json';
import modify from 'rollup-plugin-modify';
import dts from 'rollup-plugin-dts';

import dotenv from 'dotenv';
dotenv.config();
Expand Down Expand Up @@ -195,7 +194,7 @@ const esmBundle = {
plugins: withLogging.concat([
typescript({
tsconfigOverride: {
compilerOptions: {declaration: false},
compilerOptions: {declaration: true},
include: include,
exclude: exclude
}
Expand All @@ -204,18 +203,6 @@ const esmBundle = {
])
};

const typeDeclarations = {
cache: BUILD_CACHE,
input: './index.ts',
output: [
{
format: 'es',
file: 'lib/index.d.ts'
}
],
plugins: [dts()]
};

const BUNDLES = process.env.BUNDLES
? process.env.BUNDLES.split(',')
: ['cjs', 'cjs-legacy', 'esm'];
Expand All @@ -228,7 +215,7 @@ export default () => {
case 'cjs-legacy':
return [commonJSLegacyBundle];
case 'esm':
return [esmBundle, typeDeclarations];
return [esmBundle];
}
return [];
}).flat();
Expand Down
1 change: 0 additions & 1 deletion packages/event/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"prettier": "^3.3.2",
"require": "^2.4.20",
"rollup": "^4.18.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-generate-package-json": "^3.2.0",
"rollup-plugin-modify": "^3.0.0",
"rollup-plugin-typescript2": "^0.36.0",
Expand Down
6 changes: 2 additions & 4 deletions packages/event/tests/event-manager.tests.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
/* eslint-disable mocha/consistent-spacing-between-blocks */
import 'mocha';
// import * as chai from 'chai';
import {expect} from 'chai';
import {assert} from 'chai';
import chai from 'chai';
import spies from 'chai-spies';

import {EventManager as em} from '../src/event-manager';

import {Config} from '@convertcom/js-sdk-types';

import configuration from './test-config.json';

const {expect, assert: ChaiAssert} = chai;
const assert: Chai.Assert = ChaiAssert; // to avoid error: Assertions require every name in the call target to be declared with an explicit type annotation.
chai.use(spies);

describe('EventManager tests', function () {
Expand Down
17 changes: 2 additions & 15 deletions packages/experience/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import commonjs from '@rollup/plugin-commonjs';
import typescript from 'rollup-plugin-typescript2';
import generatePackageJson from 'rollup-plugin-generate-package-json';
import modify from 'rollup-plugin-modify';
import dts from 'rollup-plugin-dts';

import dotenv from 'dotenv';
dotenv.config();
Expand Down Expand Up @@ -199,7 +198,7 @@ const esmBundle = {
plugins: withLogging.concat([
typescript({
tsconfigOverride: {
compilerOptions: {declaration: false},
compilerOptions: {declaration: true},
include: include,
exclude: exclude
}
Expand All @@ -208,18 +207,6 @@ const esmBundle = {
])
};

const typeDeclarations = {
cache: BUILD_CACHE,
input: './index.ts',
output: [
{
format: 'es',
file: 'lib/index.d.ts'
}
],
plugins: [dts()]
};

const BUNDLES = process.env.BUNDLES
? process.env.BUNDLES.split(',')
: ['cjs', 'cjs-legacy', 'esm'];
Expand All @@ -232,7 +219,7 @@ export default () => {
case 'cjs-legacy':
return [commonJSLegacyBundle];
case 'esm':
return [esmBundle, typeDeclarations];
return [esmBundle];
}
return [];
}).flat();
Expand Down
1 change: 0 additions & 1 deletion packages/experience/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"prettier": "^3.3.2",
"require": "^2.4.20",
"rollup": "^4.18.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-generate-package-json": "^3.2.0",
"rollup-plugin-modify": "^3.0.0",
"rollup-plugin-typescript2": "^0.36.0",
Expand Down
1 change: 0 additions & 1 deletion packages/js-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
"require": "^2.4.20",
"rollup": "^4.18.0",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-generate-package-json": "^3.2.0",
"rollup-plugin-jsdoc": "^0.1.2",
"rollup-plugin-modify": "^3.0.0",
Expand Down
17 changes: 2 additions & 15 deletions packages/js-sdk/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import json from '@rollup/plugin-json';
import generatePackageJson from 'rollup-plugin-generate-package-json';
import copy from 'rollup-plugin-copy';
import modify from 'rollup-plugin-modify';
import dts from 'rollup-plugin-dts';

import dotenv from 'dotenv';
dotenv.config();
Expand Down Expand Up @@ -230,7 +229,7 @@ const esmBundle = {
modify(SDK_VERSION),
typescript({
tsconfigOverride: {
compilerOptions: {declaration: false},
compilerOptions: {declaration: true},
exclude: exclude
}
}),
Expand Down Expand Up @@ -282,18 +281,6 @@ const umdBundle = {
])
};

const typeDeclarations = {
cache: BUILD_CACHE,
input: './index.ts',
output: [
{
format: 'es',
file: 'lib/index.d.ts'
}
],
plugins: [dts()]
};

const BUNDLES = process.env.BUNDLES
? process.env.BUNDLES.split(',')
: ['cjs', 'cjs-legacy', 'esm', 'umd'];
Expand All @@ -306,7 +293,7 @@ export default () => {
case 'cjs-legacy':
return [commonJSLegacyBundle];
case 'esm':
return [esmBundle, typeDeclarations];
return [esmBundle];
case 'umd':
return [umdBundle];
}
Expand Down
Loading

0 comments on commit 4fa0feb

Please sign in to comment.