Skip to content

Commit

Permalink
Merge pull request #109 from sima-land/38-examples-bun
Browse files Browse the repository at this point in the history
Шаг 62 #38
  • Loading branch information
krutoo committed Mar 7, 2024
2 parents 32fba0c + a992178 commit c3fcca9
Show file tree
Hide file tree
Showing 35 changed files with 1,647 additions and 1,556 deletions.
27 changes: 0 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,30 +123,12 @@
"import": "./dist/esm/preset/isomorphic/index.js",
"default": "./dist/esm/preset/isomorphic/index.js"
},
"./preset/isomorphic/providers": {
"types": "./dist/types/preset/isomorphic/providers/index.d.ts",
"require": "./dist/cjs/preset/isomorphic/providers/index.js",
"import": "./dist/esm/preset/isomorphic/providers/index.js",
"default": "./dist/esm/preset/isomorphic/providers/index.js"
},
"./preset/isomorphic/utils": {
"types": "./dist/types/preset/isomorphic/utils/index.d.ts",
"require": "./dist/cjs/preset/isomorphic/utils/index.js",
"import": "./dist/esm/preset/isomorphic/utils/index.js",
"default": "./dist/esm/preset/isomorphic/utils/index.js"
},
"./preset/web": {
"types": "./dist/types/preset/web/index.d.ts",
"require": "./dist/cjs/preset/web/index.js",
"import": "./dist/esm/preset/web/index.js",
"default": "./dist/esm/preset/web/index.js"
},
"./preset/web/providers": {
"types": "./dist/types/preset/web/providers/index.d.ts",
"require": "./dist/cjs/preset/web/providers/index.js",
"import": "./dist/esm/preset/web/providers/index.js",
"default": "./dist/esm/preset/web/providers/index.js"
},
"./preset/server": {
"types": "./dist/types/preset/server/index.d.ts",
"require": "./dist/cjs/preset/server/index.js",
Expand Down Expand Up @@ -279,18 +261,9 @@
"preset/isomorphic": [
"./dist/types/preset/isomorphic/index.d.ts"
],
"preset/isomorphic/providers": [
"./dist/types/preset/isomorphic/providers/index.d.ts"
],
"preset/isomorphic/utils": [
"./dist/types/preset/isomorphic/utils/index.d.ts"
],
"preset/web": [
"./dist/types/preset/web/index.d.ts"
],
"preset/web/providers": [
"./dist/types/preset/web/providers/index.d.ts"
],
"preset/server": [
"./dist/types/preset/server/index.d.ts"
],
Expand Down
20 changes: 20 additions & 0 deletions src/config/__test__/base.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { createBaseConfig } from '../base';
import { createConfigSource } from '../source';

describe('createBaseConfig', () => {
it('should works properly', () => {
const source = createConfigSource({
NODE_ENV: 'tests',
APP_NAME: 'foobar',
APP_VERSION: 'good',
});

const config = createBaseConfig(source);

expect(config).toEqual({
env: 'tests',
appName: 'foobar',
appVersion: 'good',
});
});
});
16 changes: 16 additions & 0 deletions src/config/__test__/source.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { createConfigSource } from '../source';

describe('createConfigSource', () => {
beforeEach(() => {
(globalThis as any).__ISOMORPH_ENV__ = {
NODE_ENV: 'tests',
};
});

it('should works properly', () => {
const source = createConfigSource({ EXTRA_VAR: '123' });

expect(source.get('NODE_ENV')).toBe('tests');
expect(source.get('EXTRA_VAR')).toBe('123');
});
});
10 changes: 4 additions & 6 deletions src/preset/bun-handler/providers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ import {
LogHandlerFactory,
} from '../../../http';
import { Fragment } from 'react';
import {
FetchLogging,
getFetchErrorLogging,
getFetchExtraAborting,
getFetchLogging,
} from '../../isomorphic/utils';
import { getFetchErrorLogging } from '../../isomorphic/utils/get-fetch-error-logging';
import { getFetchExtraAborting } from '../../isomorphic/utils/get-fetch-extra-aborting';
import { getFetchLogging } from '../../isomorphic/utils/get-fetch-logging';
import { FetchLogging } from '../../isomorphic/utils/fetch-logging';
import { PageAssets } from '../../isomorphic/types';
import { RESPONSE_EVENT_TYPE } from '../../isomorphic/constants';
import { getPageResponseFormat } from '../../server/utils/get-page-response-format';
Expand Down
3 changes: 2 additions & 1 deletion src/preset/isomorphic/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { BaseConfig } from '../../../config/types';
import { Resolve } from '../../../di';
import { LogMiddlewareHandlerInit } from '../../../utils/axios/middleware/log';
import { KnownToken } from '../../../tokens';
import { AxiosLogging, SagaLogging } from '../utils';
import { AxiosLogging } from '../utils/axios-logging';
import { SagaLogging } from '../utils/saga-logging';
import createSagaMiddleware, { SagaMiddleware } from 'redux-saga';
import { applyMiddleware, configureFetch } from '../../../http';
import { CreateAxiosDefaults } from 'axios';
Expand Down
Loading

0 comments on commit c3fcca9

Please sign in to comment.