Skip to content

Commit 26839ee

Browse files
authored
fix: import @toolbox/core into other packages (#31)
* fix: import @toolbox/core into other packages * fix test config
1 parent ad112c0 commit 26839ee

File tree

6 files changed

+21
-9
lines changed

6 files changed

+21
-9
lines changed

packages/toolbox-core/jest.config.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@
1919
"src/**/*.ts",
2020
"!src/**/*.d.ts",
2121
"!src/**/index.ts"
22-
]
22+
],
23+
"moduleNameMapper": {
24+
"^(\\.{1,2}/.*)\\.js$": "$1"
25+
}
2326
}

packages/toolbox-core/jest.e2e.config.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,8 @@
1515
"globalSetup": "<rootDir>/test/e2e/jest.globalSetup.ts",
1616
"globalTeardown": "<rootDir>/test/e2e/jest.globalTeardown.ts",
1717
"testTimeout": 60000,
18-
"collectCoverage": false
18+
"collectCoverage": false,
19+
"moduleNameMapper": {
20+
"^(\\.{1,2}/.*)\\.js$": "$1"
21+
}
1922
}

packages/toolbox-core/src/toolbox_core/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import {ToolboxTool} from './tool';
15+
import {ToolboxTool} from './tool.js';
1616
import axios from 'axios';
1717
import {type AxiosInstance, type AxiosResponse} from 'axios';
18-
import {ZodManifestSchema, createZodSchemaFromParams} from './protocol';
19-
import {logApiError} from './errorUtils';
18+
import {ZodManifestSchema, createZodSchemaFromParams} from './protocol.js';
19+
import {logApiError} from './errorUtils.js';
2020
import {ZodError} from 'zod';
2121

2222
type Manifest = import('zod').infer<typeof ZodManifestSchema>;

packages/toolbox-core/src/toolbox_core/tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import {ZodObject, ZodError, ZodRawShape} from 'zod';
1616
import {AxiosInstance, AxiosResponse} from 'axios';
17-
import {logApiError} from './errorUtils';
17+
import {logApiError} from './errorUtils.js';
1818

1919
/**
2020
* Creates a callable tool function representing a specific tool on a remote

packages/toolbox-core/tsconfig.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"extends": "./node_modules/gts/tsconfig-google.json",
33
"compilerOptions": {
4+
"module": "NodeNext",
5+
"moduleResolution": "NodeNext",
46
"rootDir": "src/toolbox_core",
5-
"outDir": "build"
7+
"outDir": "build",
8+
"declaration": true,
9+
"sourceMap": true
610
},
711
"include": [
812
"src/**/*.ts"
@@ -11,4 +15,4 @@
1115
"node_modules",
1216
"build"
1317
]
14-
}
18+
}

packages/toolbox-core/tsconfig.test.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"rootDir": ".",
5-
"outDir": "build"
5+
"outDir": "build",
6+
"esModuleInterop": true,
7+
"sourceMap": true
68
}
79
}

0 commit comments

Comments
 (0)