Skip to content

Commit 15d218f

Browse files
committed
No declare global
1 parent c24e1a9 commit 15d218f

5 files changed

Lines changed: 10 additions & 25 deletions

File tree

packages/component/src/index.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,14 @@ import * as componentHooks from './hooks/index';
6060

6161
export { type SendBoxFocusOptions } from './hooks/index';
6262

63-
declare global {
64-
interface EnvironmentVariables {
65-
build_tool?: string | undefined;
66-
module_format?: string | undefined;
67-
node_env?: string | undefined;
68-
npm_package_version?: string | undefined;
69-
}
70-
}
71-
7263
const hooks = {
7364
...apiHooks,
7465
...componentHooks
7566
};
7667

77-
const buildTool = process.env.build_tool;
78-
const moduleFormat = process.env.module_format;
79-
const version = process.env.npm_package_version;
68+
const buildTool = (process as any).env.build_tool;
69+
const moduleFormat = (process as any).env.module_format;
70+
const version = (process as any).env.npm_package_version;
8071

8172
const buildInfo = { buildTool, moduleFormat, version };
8273

packages/react-valibot/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "botframework-webchat-react-valibot",
33
"version": "0.0.0-0",
44
"description": "The botframework-webchat react-valibot package",
5+
"types": "./dist/botframework-webchat-react-valibot.d.ts",
56
"exports": {
67
".": {
78
"import": {

packages/react-valibot/src/validateProps.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ test('when in strict isolation then failure should throw', () => {
5252
});
5353

5454
test('when under production mode and isolation is not specified then failure should warn', () => {
55+
// @ts-expect-error Accessing process without @types/node.
5556
process.env.NODE_ENV = 'production';
5657

5758
const props = { two: 2 };
@@ -60,6 +61,7 @@ test('when under production mode and isolation is not specified then failure sho
6061
});
6162

6263
test('when under production mode and no isolation then failure should warn', () => {
64+
// @ts-expect-error Accessing process without @types/node.
6365
process.env.NODE_ENV = 'production';
6466

6567
const props = { two: 2 };
@@ -68,6 +70,7 @@ test('when under production mode and no isolation then failure should warn', ()
6870
});
6971

7072
test('when under production mode and in strict isolation then failure should warn', () => {
73+
// @ts-expect-error Accessing process without @types/node.
7174
process.env.NODE_ENV = 'production';
7275

7376
const props = { two: 2 };

packages/react-valibot/src/validateProps.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
import { parse, safeParse, type BaseIssue, type BaseSchema, type InferInput, type InferOutput } from 'valibot';
22

3-
declare global {
4-
interface EnvironmentVariables {
5-
NODE_ENV?: string | undefined;
6-
}
7-
8-
interface Process {
9-
env: EnvironmentVariables;
10-
}
11-
12-
const process: Process;
13-
}
14-
153
/**
164
* Specifies the props isolation mode.
175
*
@@ -48,7 +36,8 @@ export default function validateProps<const TSchema extends BaseSchema<unknown,
4836
props: InferInput<TSchema>,
4937
isolationMode?: IsolationMode | undefined
5038
): InferInput<TSchema> | InferOutput<TSchema> {
51-
if (process.env.NODE_ENV === 'production') {
39+
// @ts-expect-error Accessing process without @types/node.
40+
if ((process as any).env.NODE_ENV === 'production') {
5241
return props as unknown as InferInput<TSchema>;
5342
}
5443

packages/redux-store/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "botframework-webchat-redux-store",
33
"version": "0.0.0-0",
44
"description": "The botframework-webchat redux-store package",
5+
"types": "./dist/botframework-webchat-redux-store.d.ts",
56
"exports": {
67
".": {
78
"import": {

0 commit comments

Comments
 (0)