Skip to content

Commit 252f836

Browse files
committed
Merge branch 'main' into tmp-empty-object-json-fix
2 parents 334db0d + fa20052 commit 252f836

File tree

16 files changed

+450
-356
lines changed

16 files changed

+450
-356
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
dist
1+
dist
2+
dist-test

.github/workflows/sdk.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Setup Node.js
1414
uses: actions/setup-node@v1
1515
with:
16-
node-version: 14.15.5
16+
node-version: 14.19.0
1717

1818
- name: Install dependencies
1919
run: npm ci
@@ -29,3 +29,6 @@ jobs:
2929

3030
- name: Build
3131
run: npm run build
32+
33+
- name: Bundle Test
34+
run: npm run test:bundle

dist-test/cjs-test.cjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// this is supposed to fail if there's something wrong with the CJS bundle
2+
const { Client } = require('@relationalai/rai-sdk-javascript');
3+
4+
console.log('SDK Client', Client);

dist-test/esm-test.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// this is supposed to fail if there's something wrong with the ESM bundle
2+
import { Client } from '@relationalai/rai-sdk-javascript';
3+
4+
console.log('SDK Client', Client);

fetch.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Copyright 2021 RelationalAI, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy
6+
* of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
// This's just a mock to be included in the web version
18+
export default () => {};

jest.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ const pkg = JSON.parse(readFileSync('./package.json', 'utf-8'));
2020

2121
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
2222
const exports = {
23-
preset: 'ts-jest/presets/default-esm',
23+
preset: 'ts-jest/presets/js-with-ts-esm',
24+
transformIgnorePatterns: [
25+
'node_modules/(?!(fetch-blob|node-fetch|data-uri-to-buffer|formdata-polyfill)/)',
26+
],
2427
testEnvironment: 'node',
2528
globals: {
2629
__RAI_SDK_VERSION__: pkg.version,
2730
},
2831
moduleNameMapper: {
2932
'^lodash-es$': 'lodash',
3033
},
31-
transform: {},
3234
};
3335

3436
export default exports;

0 commit comments

Comments
 (0)