mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2024-11-27 08:39:59 +08:00
commit
51dd07c662
@ -9,4 +9,5 @@ module.exports = {
|
||||
},
|
||||
],
|
||||
],
|
||||
plugins: ['@babel/plugin-transform-runtime'],
|
||||
};
|
||||
|
134
packages/runtime/__tests__/ImplWrapper/ImplWrapper.spec.tsx
Normal file
134
packages/runtime/__tests__/ImplWrapper/ImplWrapper.spec.tsx
Normal file
@ -0,0 +1,134 @@
|
||||
import '@testing-library/jest-dom/extend-expect';
|
||||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
import produce from 'immer';
|
||||
import { initSunmaoUI } from '../../src';
|
||||
import { TestLib } from '../testLib';
|
||||
import { destroyTimesMap, renderTimesMap, clearTesterMap } from '../testLib/Tester';
|
||||
import {
|
||||
SingleComponentSchema,
|
||||
ComponentSchemaChangeSchema,
|
||||
HiddenTraitSchema,
|
||||
MergeStateSchema,
|
||||
AsyncMergeStateSchema,
|
||||
} from './mockSchema';
|
||||
|
||||
// A pure single sunmao component will render twice when it mount.
|
||||
// The first one is its first render, the second one is because traitResults and evaledProperties updates.
|
||||
// If you find the renderTimes in tests is different from what you get in browser,
|
||||
// please check whether the react is in StrictMode, because in StrictMode, component will render twice by default.
|
||||
const SingleComponentRenderTimes = '2';
|
||||
|
||||
describe('single component condition', () => {
|
||||
it('only render one time', () => {
|
||||
const { App } = initSunmaoUI({ libs: [TestLib] });
|
||||
const { unmount } = render(<App options={SingleComponentSchema} />);
|
||||
|
||||
// simple component will render 2 times, because it have to eval trait and properties twice
|
||||
expect(screen.getByTestId('single')).toHaveTextContent(SingleComponentRenderTimes);
|
||||
expect(screen.getByTestId('single-destroy-times')).toHaveTextContent('0');
|
||||
unmount();
|
||||
clearTesterMap();
|
||||
});
|
||||
});
|
||||
|
||||
describe('after the schema changes', () => {
|
||||
it('the component and its siblings will not unmount after schema changes', () => {
|
||||
const { App } = initSunmaoUI({ libs: [TestLib] });
|
||||
const { rerender, unmount } = render(<App options={ComponentSchemaChangeSchema} />);
|
||||
expect(screen.getByTestId('staticComponent-destroy-times')).toHaveTextContent('0');
|
||||
expect(screen.getByTestId('dynamicComponent-destroy-times')).toHaveTextContent('0');
|
||||
|
||||
const newMockSchema = produce(ComponentSchemaChangeSchema, draft => {
|
||||
const c = draft.spec.components.find(c => c.id === 'dynamicComponent');
|
||||
if (c) {
|
||||
c.properties.text = 'baz';
|
||||
}
|
||||
});
|
||||
rerender(<App options={newMockSchema} />);
|
||||
|
||||
expect(screen.getByTestId('staticComponent-destroy-times')).toHaveTextContent('0');
|
||||
expect(screen.getByTestId('dynamicComponent-destroy-times')).toHaveTextContent('0');
|
||||
unmount();
|
||||
clearTesterMap();
|
||||
});
|
||||
});
|
||||
|
||||
describe('hidden trait condition', () => {
|
||||
it('the hidden component should not merge state in store', () => {
|
||||
const { App, stateManager } = initSunmaoUI({ libs: [TestLib] });
|
||||
stateManager.noConsoleError = true;
|
||||
const { unmount } = render(<App options={HiddenTraitSchema} />);
|
||||
expect(screen.getByTestId('tester')).toHaveTextContent(SingleComponentRenderTimes);
|
||||
expect(screen.getByTestId('tester-text')).toHaveTextContent('');
|
||||
expect(stateManager.store['input1']).toBeUndefined();
|
||||
|
||||
unmount();
|
||||
clearTesterMap();
|
||||
});
|
||||
});
|
||||
|
||||
describe('when component merge state synchronously', () => {
|
||||
it('it will not cause extra render', () => {
|
||||
const { App, stateManager } = initSunmaoUI({ libs: [TestLib] });
|
||||
const { unmount } = render(<App options={MergeStateSchema} />);
|
||||
expect(screen.getByTestId('tester')).toHaveTextContent(SingleComponentRenderTimes);
|
||||
expect(screen.getByTestId('tester-text')).toHaveTextContent('foo-bar-baz');
|
||||
expect(stateManager.store['input'].value).toBe('foo');
|
||||
|
||||
unmount();
|
||||
clearTesterMap();
|
||||
});
|
||||
|
||||
it(`the components' order will not affect render result`, () => {
|
||||
const newMergeStateSchema = produce(MergeStateSchema, draft => {
|
||||
const temp = draft.spec.components[0];
|
||||
draft.spec.components[0] = draft.spec.components[1];
|
||||
draft.spec.components[1] = temp;
|
||||
});
|
||||
const { App, stateManager } = initSunmaoUI({ libs: [TestLib] });
|
||||
stateManager.noConsoleError = true;
|
||||
const { unmount } = render(<App options={newMergeStateSchema} />);
|
||||
expect(screen.getByTestId('tester')).toHaveTextContent(SingleComponentRenderTimes);
|
||||
expect(screen.getByTestId('tester-text')).toHaveTextContent('foo-bar-baz');
|
||||
expect(stateManager.store['input'].value).toBe('foo');
|
||||
|
||||
unmount();
|
||||
clearTesterMap();
|
||||
});
|
||||
});
|
||||
|
||||
describe('when component merge state asynchronously', () => {
|
||||
const timeoutPromise = () =>
|
||||
new Promise<any>(res => {
|
||||
setTimeout(() => res(true), 30);
|
||||
});
|
||||
|
||||
it('it will cause extra render', async () => {
|
||||
const { App, stateManager } = initSunmaoUI({ libs: [TestLib] });
|
||||
stateManager.noConsoleError = true;
|
||||
const { unmount } = render(<App options={AsyncMergeStateSchema} />);
|
||||
await waitFor(timeoutPromise);
|
||||
// 4 = 2 default render times + timeout trait run twice causing another 2 renders
|
||||
expect(await screen.findByTestId('tester')).toHaveTextContent('4');
|
||||
|
||||
unmount();
|
||||
clearTesterMap();
|
||||
});
|
||||
|
||||
it(`the components' order may cause extra render`, async () => {
|
||||
const newMergeStateSchema = produce(AsyncMergeStateSchema, draft => {
|
||||
const temp = draft.spec.components[0];
|
||||
draft.spec.components[0] = draft.spec.components[1];
|
||||
draft.spec.components[1] = temp;
|
||||
});
|
||||
const { App, stateManager } = initSunmaoUI({ libs: [TestLib] });
|
||||
stateManager.noConsoleError = true;
|
||||
const { unmount } = render(<App options={newMergeStateSchema} />);
|
||||
await waitFor(timeoutPromise);
|
||||
// 5 = 2 default render times + timeout trait run twice causing another 2 renders + order causing change
|
||||
expect(await screen.findByTestId('tester')).toHaveTextContent('5');
|
||||
|
||||
unmount();
|
||||
clearTesterMap();
|
||||
});
|
||||
});
|
175
packages/runtime/__tests__/ImplWrapper/mockSchema.ts
Normal file
175
packages/runtime/__tests__/ImplWrapper/mockSchema.ts
Normal file
@ -0,0 +1,175 @@
|
||||
import { Application } from '@sunmao-ui/core';
|
||||
|
||||
export const SingleComponentSchema: Application = {
|
||||
version: 'sunmao/v1',
|
||||
kind: 'Application',
|
||||
metadata: {
|
||||
name: 'some App',
|
||||
},
|
||||
spec: {
|
||||
components: [
|
||||
{
|
||||
id: 'single',
|
||||
type: 'test/v1/tester',
|
||||
properties: {
|
||||
text: 'Hello, world!',
|
||||
},
|
||||
traits: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
// for testing whether a component and its siblings will unmount after schema changes
|
||||
export const ComponentSchemaChangeSchema: Application = {
|
||||
version: 'sunmao/v1',
|
||||
kind: 'Application',
|
||||
metadata: {
|
||||
name: 'some App',
|
||||
},
|
||||
spec: {
|
||||
components: [
|
||||
{
|
||||
id: 'staticComponent',
|
||||
type: 'test/v1/tester',
|
||||
properties: {
|
||||
text: 'foo',
|
||||
},
|
||||
traits: [],
|
||||
},
|
||||
{
|
||||
id: 'dynamicComponent',
|
||||
type: 'test/v1/tester',
|
||||
properties: {
|
||||
text: 'bar',
|
||||
},
|
||||
traits: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const HiddenTraitSchema: Application = {
|
||||
version: 'sunmao/v1',
|
||||
kind: 'Application',
|
||||
metadata: {
|
||||
name: 'some App',
|
||||
},
|
||||
spec: {
|
||||
components: [
|
||||
{
|
||||
id: 'input1',
|
||||
type: 'test/v1/input',
|
||||
properties: {
|
||||
defaultValue: 'foo',
|
||||
},
|
||||
traits: [
|
||||
{
|
||||
type: 'core/v1/hidden',
|
||||
properties: {
|
||||
hidden: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'tester',
|
||||
type: 'test/v1/tester',
|
||||
properties: {
|
||||
text: '{{input1.value}}',
|
||||
},
|
||||
traits: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const MergeStateSchema: Application = {
|
||||
version: 'sunmao/v1',
|
||||
kind: 'Application',
|
||||
metadata: {
|
||||
name: 'some App',
|
||||
},
|
||||
spec: {
|
||||
components: [
|
||||
{
|
||||
id: 'tester',
|
||||
type: 'test/v1/tester',
|
||||
properties: {
|
||||
text: '{{input.value}}-{{input2.value}}-{{input3.value}}',
|
||||
},
|
||||
traits: [],
|
||||
},
|
||||
{
|
||||
id: 'input',
|
||||
type: 'test/v1/input',
|
||||
properties: {
|
||||
defaultValue: 'foo',
|
||||
},
|
||||
traits: [],
|
||||
},
|
||||
{
|
||||
id: 'input2',
|
||||
type: 'test/v1/input',
|
||||
properties: {
|
||||
defaultValue: 'bar',
|
||||
},
|
||||
traits: [],
|
||||
},
|
||||
{
|
||||
id: 'input3',
|
||||
type: 'test/v1/input',
|
||||
properties: {
|
||||
defaultValue: 'baz',
|
||||
},
|
||||
traits: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const AsyncMergeStateSchema: Application = {
|
||||
version: 'sunmao/v1',
|
||||
kind: 'Application',
|
||||
metadata: {
|
||||
name: 'some App',
|
||||
},
|
||||
spec: {
|
||||
components: [
|
||||
{
|
||||
id: 'input',
|
||||
type: 'test/v1/input',
|
||||
properties: {
|
||||
defaultValue: 'foo',
|
||||
},
|
||||
traits: [],
|
||||
},
|
||||
{
|
||||
id: 'text',
|
||||
type: 'core/v1/text',
|
||||
properties: {
|
||||
value: {
|
||||
raw: 'text',
|
||||
format: 'plain',
|
||||
},
|
||||
},
|
||||
traits: [
|
||||
{
|
||||
type: 'test/v1/timeout',
|
||||
properties: {
|
||||
value: '{{input.value + Math.random()}}',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'tester',
|
||||
type: 'test/v1/tester',
|
||||
properties: {
|
||||
text: '{{text.result}}',
|
||||
},
|
||||
traits: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
169
packages/runtime/__tests__/_internal/List.spec.tsx
Normal file
169
packages/runtime/__tests__/_internal/List.spec.tsx
Normal file
@ -0,0 +1,169 @@
|
||||
import '@testing-library/jest-dom/extend-expect';
|
||||
import { Application } from '@sunmao-ui/core';
|
||||
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
|
||||
import { initSunmaoUI } from '../../src';
|
||||
import { clearTesterMap } from '../testLib/Tester';
|
||||
import { TestLib } from '../testLib';
|
||||
|
||||
const ListSchema: Application = {
|
||||
version: 'sunmao/v1',
|
||||
kind: 'Application',
|
||||
metadata: {
|
||||
name: 'some App',
|
||||
},
|
||||
spec: {
|
||||
components: [
|
||||
{
|
||||
id: 'list',
|
||||
type: 'core/v1/list',
|
||||
properties: {
|
||||
listData: [
|
||||
{
|
||||
id: 'foo',
|
||||
},
|
||||
{
|
||||
id: 'bar',
|
||||
},
|
||||
{
|
||||
id: 'baz',
|
||||
},
|
||||
],
|
||||
},
|
||||
traits: [],
|
||||
},
|
||||
{
|
||||
id: 'tester',
|
||||
type: 'test/v1/tester',
|
||||
properties: {
|
||||
text: '{{$slot.$listItem.id}}',
|
||||
},
|
||||
traits: [
|
||||
{
|
||||
type: 'core/v1/slot',
|
||||
properties: {
|
||||
container: {
|
||||
id: 'list',
|
||||
slot: 'content',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
const ListEventSchema: Application = {
|
||||
version: 'sunmao/v1',
|
||||
kind: 'Application',
|
||||
metadata: {
|
||||
name: 'some App',
|
||||
},
|
||||
spec: {
|
||||
components: [
|
||||
{
|
||||
id: 'list',
|
||||
type: 'core/v1/list',
|
||||
properties: {
|
||||
listData: [
|
||||
{
|
||||
id: 'foo',
|
||||
},
|
||||
{
|
||||
id: 'bar',
|
||||
},
|
||||
{
|
||||
id: 'baz',
|
||||
},
|
||||
],
|
||||
},
|
||||
traits: [],
|
||||
},
|
||||
{
|
||||
id: 'button',
|
||||
type: 'test/v1/button',
|
||||
properties: {},
|
||||
traits: [
|
||||
{
|
||||
type: 'core/v1/slot',
|
||||
properties: {
|
||||
container: {
|
||||
id: 'list',
|
||||
slot: 'content',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'core/v1/event',
|
||||
properties: {
|
||||
handlers: [
|
||||
{
|
||||
type: 'click',
|
||||
componentId: 'state',
|
||||
method: {
|
||||
name: 'setValue',
|
||||
parameters: {
|
||||
key: 'value',
|
||||
value: '{{state.value}}{{$slot.$listItem.id}}',
|
||||
},
|
||||
},
|
||||
disabled: false,
|
||||
wait: {
|
||||
type: 'delay',
|
||||
time: 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'state',
|
||||
type: 'core/v1/dummy',
|
||||
properties: {},
|
||||
traits: [
|
||||
{
|
||||
type: 'core/v1/state',
|
||||
properties: {
|
||||
key: 'value',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'tester',
|
||||
type: 'test/v1/tester',
|
||||
properties: {
|
||||
text: '{{state.value}}',
|
||||
},
|
||||
traits: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
describe('Core List Component', () => {
|
||||
const { App, stateManager } = initSunmaoUI({ libs: [TestLib] });
|
||||
stateManager.noConsoleError = true;
|
||||
it('can render component directly', () => {
|
||||
const { unmount } = render(<App options={ListSchema} />);
|
||||
|
||||
expect(screen.getByTestId('list_tester_0-text')).toHaveTextContent('foo');
|
||||
expect(screen.getByTestId('list_tester_1-text')).toHaveTextContent('bar');
|
||||
expect(screen.getByTestId('list_tester_2-text')).toHaveTextContent('baz');
|
||||
unmount();
|
||||
clearTesterMap();
|
||||
});
|
||||
|
||||
it('can add event to list items', () => {
|
||||
const { unmount } = render(<App options={ListEventSchema} />);
|
||||
|
||||
fireEvent.click(screen.getByTestId('list_button_0'));
|
||||
fireEvent.click(screen.getByTestId('list_button_1'));
|
||||
fireEvent.click(screen.getByTestId('list_button_2'));
|
||||
expect(screen.getByTestId('tester-text')).toHaveTextContent('foobarbaz');
|
||||
unmount();
|
||||
clearTesterMap();
|
||||
});
|
||||
});
|
147
packages/runtime/__tests__/_internal/ModuleRenderer.spec.tsx
Normal file
147
packages/runtime/__tests__/_internal/ModuleRenderer.spec.tsx
Normal file
@ -0,0 +1,147 @@
|
||||
import '@testing-library/jest-dom/extend-expect';
|
||||
import { Application, createModule, RuntimeModule } from '@sunmao-ui/core';
|
||||
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
|
||||
import { initSunmaoUI } from '../../src';
|
||||
import { clearTesterMap } from '../testLib/Tester';
|
||||
import { TestLib } from '../testLib';
|
||||
|
||||
const ModuleSchema: RuntimeModule = createModule({
|
||||
version: 'custom/v1',
|
||||
metadata: { name: 'myModule0', description: 'my module' },
|
||||
spec: {
|
||||
stateMap: { data: '{{ $moduleId }}__input.value' },
|
||||
events: ['onClickButton'],
|
||||
properties: {},
|
||||
exampleProperties: { defaultValue: 'foo' },
|
||||
},
|
||||
impl: [
|
||||
{
|
||||
id: '{{ $moduleId }}__button',
|
||||
type: 'test/v1/button',
|
||||
properties: {},
|
||||
traits: [
|
||||
{
|
||||
type: 'core/v1/event',
|
||||
properties: {
|
||||
handlers: [
|
||||
{
|
||||
type: 'click',
|
||||
componentId: '$module',
|
||||
method: {
|
||||
name: 'onClickButton',
|
||||
parameters: {
|
||||
moduleId: '{{$moduleId}}',
|
||||
},
|
||||
},
|
||||
disabled: false,
|
||||
wait: { type: 'delay', time: 0 },
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: '{{ $moduleId }}__input',
|
||||
type: 'test/v1/input',
|
||||
properties: { defaultValue: '{{defaultValue}}' },
|
||||
traits: [],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const ApplicationSchema: Application = {
|
||||
version: 'sunmao/v1',
|
||||
kind: 'Application',
|
||||
metadata: { name: 'some App' },
|
||||
spec: {
|
||||
components: [
|
||||
{
|
||||
id: 'moduleContainer',
|
||||
type: 'core/v1/moduleContainer',
|
||||
properties: {
|
||||
id: 'myModule',
|
||||
type: 'custom/v1/myModule0',
|
||||
properties: { defaultValue: 'foo' },
|
||||
handlers: [
|
||||
{
|
||||
type: 'onClickButton',
|
||||
componentId: 'state',
|
||||
method: {
|
||||
name: 'setValue',
|
||||
parameters: { key: 'value', value: '{{myModule.data}}' },
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'onClickButton',
|
||||
componentId: '$utils',
|
||||
method: {
|
||||
name: 'chakra_ui/v1/openToast',
|
||||
parameters: {
|
||||
position: 'top',
|
||||
duration: 1000,
|
||||
title: '{{myModule.data}}',
|
||||
description: '',
|
||||
isClosable: false,
|
||||
variant: 'subtle',
|
||||
status: 'info',
|
||||
id: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
traits: [],
|
||||
},
|
||||
{
|
||||
id: 'state',
|
||||
type: 'core/v1/dummy',
|
||||
properties: {},
|
||||
traits: [{ type: 'core/v1/state', properties: { key: 'value' } }],
|
||||
},
|
||||
{
|
||||
id: 'tester',
|
||||
type: 'test/v1/tester',
|
||||
properties: { text: '{{myModule.data}}' },
|
||||
traits: [],
|
||||
},
|
||||
{
|
||||
id: 'tester2',
|
||||
type: 'test/v1/tester',
|
||||
properties: { text: '{{state.value}}' },
|
||||
traits: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
describe('ModuleRenderer', () => {
|
||||
const { App, stateManager, registry } = initSunmaoUI({ libs: [TestLib] });
|
||||
registry.registerModule(ModuleSchema);
|
||||
stateManager.noConsoleError = true;
|
||||
it('can accept properties', () => {
|
||||
const { rerender, unmount } = render(<App options={ApplicationSchema} />);
|
||||
expect(screen.getByTestId('myModule__input')).toHaveValue('foo');
|
||||
unmount();
|
||||
clearTesterMap();
|
||||
});
|
||||
|
||||
it('can expose state', () => {
|
||||
const { rerender, unmount } = render(<App options={ApplicationSchema} />);
|
||||
expect(screen.getByTestId('tester-text')).toHaveTextContent('foo');
|
||||
|
||||
fireEvent.change(screen.getByTestId('myModule__input'), { target: { value: 'bar' } });
|
||||
expect(screen.getByTestId('myModule__input')).toHaveValue('bar');
|
||||
expect(screen.getByTestId('tester-text')).toHaveTextContent('bar');
|
||||
unmount();
|
||||
clearTesterMap();
|
||||
});
|
||||
|
||||
it('can expose event', () => {
|
||||
const { rerender, unmount } = render(<App options={ApplicationSchema} />);
|
||||
fireEvent.change(screen.getByTestId('myModule__input'), { target: { value: 'baz' } });
|
||||
fireEvent.click(screen.getByTestId('myModule__button'));
|
||||
expect(screen.getByTestId('tester2-text')).toHaveTextContent('baz');
|
||||
unmount();
|
||||
clearTesterMap();
|
||||
});
|
||||
});
|
@ -1,6 +1,5 @@
|
||||
import { render } from '@testing-library/react';
|
||||
import Text from '../../src/components/_internal/Text';
|
||||
import React from 'react';
|
||||
|
||||
describe('Text component', () => {
|
||||
it('should render plain text', () => {
|
||||
|
@ -24,8 +24,9 @@ describe('evalExpression function', () => {
|
||||
},
|
||||
};
|
||||
const stateManager = new StateManager();
|
||||
stateManager.noConsoleError = true;
|
||||
it('can eval {{}} expression', () => {
|
||||
const evalOptions = { evalListItem: false, scopeObject: scope, noConsoleError: true };
|
||||
const evalOptions = { evalListItem: false, scopeObject: scope };
|
||||
|
||||
expect(stateManager.maskedEval('value', evalOptions)).toEqual('value');
|
||||
expect(stateManager.maskedEval('{{true}}', evalOptions)).toEqual(true);
|
||||
@ -80,7 +81,6 @@ describe('evalExpression function', () => {
|
||||
stateManager.maskedEval('{{value}}', {
|
||||
scopeObject: { override: 'foo' },
|
||||
overrideScope: true,
|
||||
noConsoleError: true,
|
||||
})
|
||||
).toBeInstanceOf(ExpressionError);
|
||||
expect(
|
||||
@ -95,7 +95,6 @@ describe('evalExpression function', () => {
|
||||
expect(
|
||||
stateManager.maskedEval('{{wrongExp}}', {
|
||||
fallbackWhenError: exp => exp,
|
||||
noConsoleError: true,
|
||||
})
|
||||
).toEqual('{{wrongExp}}');
|
||||
});
|
||||
@ -107,7 +106,6 @@ describe('evalExpression function', () => {
|
||||
$moduleId: 'myModule',
|
||||
text: 'hello',
|
||||
},
|
||||
noConsoleError: true,
|
||||
ignoreEvalError: true,
|
||||
})
|
||||
).toEqual(`hello {{myModule__state0.value}}`);
|
||||
|
1
packages/runtime/__tests__/styleMock.js
Normal file
1
packages/runtime/__tests__/styleMock.js
Normal file
@ -0,0 +1 @@
|
||||
module.exports = {};
|
37
packages/runtime/__tests__/testLib/Button.tsx
Normal file
37
packages/runtime/__tests__/testLib/Button.tsx
Normal file
@ -0,0 +1,37 @@
|
||||
import { implementRuntimeComponent } from '../../src/utils/buildKit';
|
||||
import { Type } from '@sinclair/typebox';
|
||||
|
||||
export default implementRuntimeComponent({
|
||||
version: 'test/v1',
|
||||
metadata: {
|
||||
name: 'button',
|
||||
displayName: 'Button',
|
||||
description: 'for test',
|
||||
isDraggable: false,
|
||||
isResizable: false,
|
||||
exampleProperties: {},
|
||||
exampleSize: [1, 1],
|
||||
annotations: {
|
||||
category: 'Advance',
|
||||
},
|
||||
},
|
||||
spec: {
|
||||
properties: Type.Object({}),
|
||||
state: Type.Object({}),
|
||||
methods: {},
|
||||
slots: {},
|
||||
styleSlots: [],
|
||||
events: ['click'],
|
||||
},
|
||||
})(({ callbackMap, component, elementRef }) => {
|
||||
const onClick = () => {
|
||||
callbackMap?.click();
|
||||
};
|
||||
return (
|
||||
<div ref={elementRef}>
|
||||
<button onClick={onClick} data-testid={component.id}>
|
||||
Test Button
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
});
|
44
packages/runtime/__tests__/testLib/Input.tsx
Normal file
44
packages/runtime/__tests__/testLib/Input.tsx
Normal file
@ -0,0 +1,44 @@
|
||||
import { implementRuntimeComponent } from '../../src/utils/buildKit';
|
||||
import { Type } from '@sinclair/typebox';
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
export default implementRuntimeComponent({
|
||||
version: 'test/v1',
|
||||
metadata: {
|
||||
name: 'input',
|
||||
displayName: 'Input',
|
||||
description: 'for test',
|
||||
isDraggable: false,
|
||||
isResizable: false,
|
||||
exampleProperties: {},
|
||||
exampleSize: [1, 1],
|
||||
annotations: {
|
||||
category: 'Advance',
|
||||
},
|
||||
},
|
||||
spec: {
|
||||
properties: Type.Object({
|
||||
defaultValue: Type.String(),
|
||||
}),
|
||||
state: Type.Object({
|
||||
value: Type.String(),
|
||||
}),
|
||||
methods: {},
|
||||
slots: {},
|
||||
styleSlots: [],
|
||||
events: [],
|
||||
},
|
||||
})(({ component, defaultValue, mergeState, elementRef }) => {
|
||||
const [value, setValue] = useState(defaultValue || '');
|
||||
useEffect(() => {
|
||||
mergeState({ value });
|
||||
}, [mergeState, value]);
|
||||
return (
|
||||
<input
|
||||
ref={elementRef}
|
||||
data-testid={component.id}
|
||||
value={value}
|
||||
onChange={e => setValue(e.target.value)}
|
||||
/>
|
||||
);
|
||||
});
|
63
packages/runtime/__tests__/testLib/Tester.tsx
Normal file
63
packages/runtime/__tests__/testLib/Tester.tsx
Normal file
@ -0,0 +1,63 @@
|
||||
import { implementRuntimeComponent } from '../../src/utils/buildKit';
|
||||
import { Type } from '@sinclair/typebox';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export const renderTimesMap: Record<string, number> = {};
|
||||
export const destroyTimesMap: Record<string, number> = {};
|
||||
|
||||
export function clearTesterMap() {
|
||||
for (const key in renderTimesMap) {
|
||||
delete renderTimesMap[key];
|
||||
}
|
||||
for (const key in destroyTimesMap) {
|
||||
delete destroyTimesMap[key];
|
||||
}
|
||||
}
|
||||
|
||||
export default implementRuntimeComponent({
|
||||
version: 'test/v1',
|
||||
metadata: {
|
||||
name: 'tester',
|
||||
displayName: 'Tester',
|
||||
description: 'for test',
|
||||
isDraggable: false,
|
||||
isResizable: false,
|
||||
exampleProperties: {},
|
||||
exampleSize: [1, 1],
|
||||
annotations: {
|
||||
category: 'Advance',
|
||||
},
|
||||
},
|
||||
spec: {
|
||||
properties: Type.Object({
|
||||
text: Type.String(),
|
||||
}),
|
||||
state: Type.Object({}),
|
||||
methods: {},
|
||||
slots: {},
|
||||
styleSlots: [],
|
||||
events: [],
|
||||
},
|
||||
})(({ component, elementRef, text }) => {
|
||||
const id = component.id;
|
||||
renderTimesMap[id] = (renderTimesMap[id] || 0) + 1;
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
destroyTimesMap[id] = (destroyTimesMap[id] || 0) + 1;
|
||||
};
|
||||
}, [id]);
|
||||
return (
|
||||
<div ref={elementRef}>
|
||||
<p>
|
||||
<span>RenderTimes:</span>
|
||||
<span data-testid={id}>{renderTimesMap[id] || 0}</span>{' '}
|
||||
</p>
|
||||
<p>
|
||||
<span>DestroyTimes:</span>
|
||||
<span data-testid={`${id}-destroy-times`}>{destroyTimesMap[id] || 0}</span>{' '}
|
||||
</p>
|
||||
<span data-testid={`${id}-text`}>{text}</span>
|
||||
</div>
|
||||
);
|
||||
});
|
32
packages/runtime/__tests__/testLib/TimeoutTrait.tsx
Normal file
32
packages/runtime/__tests__/testLib/TimeoutTrait.tsx
Normal file
@ -0,0 +1,32 @@
|
||||
import { Type } from '@sinclair/typebox';
|
||||
import { implementRuntimeTrait } from '../../src';
|
||||
|
||||
const TimeoutTraitPropertiesSpec = Type.Object({
|
||||
value: Type.String(),
|
||||
timeout: Type.Optional(Type.Number()),
|
||||
});
|
||||
|
||||
export default implementRuntimeTrait({
|
||||
version: 'test/v1',
|
||||
metadata: {
|
||||
name: 'timeout',
|
||||
description: 'for test',
|
||||
},
|
||||
spec: {
|
||||
properties: TimeoutTraitPropertiesSpec,
|
||||
methods: [],
|
||||
state: Type.Object({
|
||||
result: Type.String(),
|
||||
}),
|
||||
},
|
||||
})(() => {
|
||||
return ({ value, mergeState, timeout }) => {
|
||||
setTimeout(() => {
|
||||
mergeState({ result: value });
|
||||
}, timeout || 0);
|
||||
|
||||
return {
|
||||
props: null,
|
||||
};
|
||||
};
|
||||
});
|
11
packages/runtime/__tests__/testLib/index.ts
Normal file
11
packages/runtime/__tests__/testLib/index.ts
Normal file
@ -0,0 +1,11 @@
|
||||
// test
|
||||
import TestButton from './Button';
|
||||
import TestTester from './Tester';
|
||||
import TestInput from './Input';
|
||||
import TimeoutTrait from './TimeoutTrait';
|
||||
import { SunmaoLib } from '../../src';
|
||||
|
||||
export const TestLib: SunmaoLib = {
|
||||
components: [TestButton, TestTester, TestInput, TimeoutTrait],
|
||||
traits: [TimeoutTrait],
|
||||
};
|
@ -7,12 +7,12 @@ module.exports = {
|
||||
'^.+\\.[jt]sx?$': [
|
||||
'babel-jest',
|
||||
{
|
||||
configFile: path.resolve(
|
||||
__dirname,
|
||||
'../../config/babel.react.config.js'
|
||||
),
|
||||
configFile: path.resolve(__dirname, '../../config/babel.react.config.js'),
|
||||
},
|
||||
],
|
||||
},
|
||||
moduleNameMapper: {
|
||||
'\\.(css|less)$': '<rootDir>/__tests__/styleMock.js',
|
||||
},
|
||||
testEnvironment: 'jsdom',
|
||||
};
|
||||
|
@ -52,12 +52,15 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.15.5",
|
||||
"@babel/plugin-transform-runtime": "^7.18.2",
|
||||
"@babel/preset-env": "^7.15.6",
|
||||
"@babel/preset-react": "^7.14.5",
|
||||
"@babel/preset-typescript": "^7.15.0",
|
||||
"@babel/runtime": "^7.18.3",
|
||||
"@sunmao-ui/vite-plugins": "^1.0.2",
|
||||
"@swc/core": "^1.2.121",
|
||||
"@testing-library/react": "^12.1.0",
|
||||
"@testing-library/jest-dom": "^5.16.4",
|
||||
"@testing-library/react": "12.1.5",
|
||||
"@types/lodash": "^4.14.170",
|
||||
"@types/lodash-es": "^4.17.5",
|
||||
"@types/react": "^17.0.0",
|
||||
|
@ -11,7 +11,7 @@ import { initStateAndMethod } from '../../../utils/initStateAndMethod';
|
||||
|
||||
export const ImplWrapperMain = React.forwardRef<HTMLDivElement, ImplWrapperProps>(
|
||||
function ImplWrapperMain(props, ref) {
|
||||
const { component: c, children, slotProps, evalListItem } = props;
|
||||
const { component: c, children, evalListItem, slotProps } = props;
|
||||
const { registry, stateManager } = props.services;
|
||||
|
||||
const Impl = registry.getComponent(c.parsedType.version, c.parsedType.name).impl;
|
||||
@ -128,7 +128,7 @@ export const ImplWrapperMain = React.forwardRef<HTMLDivElement, ImplWrapperProps
|
||||
setEvaledComponentProperties({ ...result });
|
||||
|
||||
return stop;
|
||||
}, [c.properties, stateManager, slotProps]);
|
||||
}, [c.properties, stateManager, slotProps, evalListItem]);
|
||||
|
||||
useEffect(() => {
|
||||
const clearFunctions = propsFromTraits?.componentDidMount?.map(e => e());
|
||||
@ -164,7 +164,6 @@ export const ImplWrapperMain = React.forwardRef<HTMLDivElement, ImplWrapperProps
|
||||
hooks: props.hooks,
|
||||
isInModule: props.isInModule,
|
||||
});
|
||||
|
||||
const C = unmount ? null : (
|
||||
<Impl
|
||||
ref={ref}
|
||||
|
@ -25,8 +25,6 @@ type EvalOptions = {
|
||||
scopeObject?: Record<string, any>;
|
||||
overrideScope?: boolean;
|
||||
fallbackWhenError?: (exp: string) => any;
|
||||
noConsoleError?: boolean;
|
||||
// when ignoreEvalError is true, the eval process will continue after error happens in nests expression.
|
||||
ignoreEvalError?: boolean;
|
||||
};
|
||||
|
||||
@ -50,6 +48,9 @@ export class StateManager {
|
||||
|
||||
dependencies: Record<string, unknown>;
|
||||
|
||||
// when ignoreEvalError is true, the eval process will continue after error happens in nests expression.
|
||||
noConsoleError = false;
|
||||
|
||||
constructor(dependencies: Record<string, unknown> = {}) {
|
||||
this.dependencies = { ...DefaultDependencies, ...dependencies };
|
||||
}
|
||||
@ -93,7 +94,7 @@ export class StateManager {
|
||||
};
|
||||
|
||||
maskedEval(raw: string, options: EvalOptions = {}): unknown | ExpressionError {
|
||||
const { evalListItem = false, fallbackWhenError, noConsoleError } = options;
|
||||
const { evalListItem = false, fallbackWhenError } = options;
|
||||
let result: unknown[] = [];
|
||||
|
||||
try {
|
||||
@ -122,7 +123,7 @@ export class StateManager {
|
||||
if (error instanceof Error) {
|
||||
const expressionError = new ExpressionError(error.message);
|
||||
|
||||
if (!noConsoleError) {
|
||||
if (!this.noConsoleError) {
|
||||
consoleError(ConsoleType.Expression, '', expressionError.message);
|
||||
}
|
||||
|
||||
|
232
yarn.lock
232
yarn.lock
@ -202,6 +202,20 @@
|
||||
resolve "^1.14.2"
|
||||
semver "^6.1.2"
|
||||
|
||||
"@babel/helper-define-polyfill-provider@^0.3.1":
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz#52411b445bdb2e676869e5a74960d2d3826d2665"
|
||||
integrity sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA==
|
||||
dependencies:
|
||||
"@babel/helper-compilation-targets" "^7.13.0"
|
||||
"@babel/helper-module-imports" "^7.12.13"
|
||||
"@babel/helper-plugin-utils" "^7.13.0"
|
||||
"@babel/traverse" "^7.13.0"
|
||||
debug "^4.1.1"
|
||||
lodash.debounce "^4.0.8"
|
||||
resolve "^1.14.2"
|
||||
semver "^6.1.2"
|
||||
|
||||
"@babel/helper-environment-visitor@^7.16.7":
|
||||
version "7.16.7"
|
||||
resolved "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz"
|
||||
@ -328,6 +342,11 @@
|
||||
resolved "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz"
|
||||
integrity sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==
|
||||
|
||||
"@babel/helper-plugin-utils@^7.17.12":
|
||||
version "7.17.12"
|
||||
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.17.12.tgz#86c2347da5acbf5583ba0a10aed4c9bf9da9cf96"
|
||||
integrity sha512-JDkf04mqtN3y4iAbO1hv9U2ARpPyPL1zqyWs/2WG1pgSq9llHFjStX5jdxb84himgJm+8Ng+x0oiWF/nw/XQKA==
|
||||
|
||||
"@babel/helper-remap-async-to-generator@^7.16.0":
|
||||
version "7.16.0"
|
||||
resolved "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.0.tgz"
|
||||
@ -1011,6 +1030,18 @@
|
||||
dependencies:
|
||||
"@babel/helper-plugin-utils" "^7.14.5"
|
||||
|
||||
"@babel/plugin-transform-runtime@^7.18.2":
|
||||
version "7.18.2"
|
||||
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.18.2.tgz#04637de1e45ae8847ff14b9beead09c33d34374d"
|
||||
integrity sha512-mr1ufuRMfS52ttq+1G1PD8OJNqgcTFjq3hwn8SZ5n1x1pBhi0E36rYMdTK0TsKtApJ4lDEdfXJwtGobQMHSMPg==
|
||||
dependencies:
|
||||
"@babel/helper-module-imports" "^7.16.7"
|
||||
"@babel/helper-plugin-utils" "^7.17.12"
|
||||
babel-plugin-polyfill-corejs2 "^0.3.0"
|
||||
babel-plugin-polyfill-corejs3 "^0.5.0"
|
||||
babel-plugin-polyfill-regenerator "^0.3.0"
|
||||
semver "^6.3.0"
|
||||
|
||||
"@babel/plugin-transform-shorthand-properties@^7.16.0":
|
||||
version "7.16.0"
|
||||
resolved "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.0.tgz"
|
||||
@ -1204,6 +1235,13 @@
|
||||
dependencies:
|
||||
regenerator-runtime "^0.13.4"
|
||||
|
||||
"@babel/runtime@^7.18.3", "@babel/runtime@^7.9.2":
|
||||
version "7.18.3"
|
||||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.3.tgz#c7b654b57f6f63cf7f8b418ac9ca04408c4579f4"
|
||||
integrity sha512-38Y8f7YUhce/K7RMwTp7m0uCumpv9hZkitCbBClqQIow1qSbCvGkcegKOXpEWCQLfWmevgRiWokZ1GkpfhbZug==
|
||||
dependencies:
|
||||
regenerator-runtime "^0.13.4"
|
||||
|
||||
"@babel/template@^7.16.0", "@babel/template@^7.3.3":
|
||||
version "7.16.0"
|
||||
resolved "https://registry.npmjs.org/@babel/template/-/template-7.16.0.tgz"
|
||||
@ -3504,6 +3542,30 @@
|
||||
lz-string "^1.4.4"
|
||||
pretty-format "^27.0.2"
|
||||
|
||||
"@testing-library/jest-dom@^5.16.4":
|
||||
version "5.16.4"
|
||||
resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-5.16.4.tgz#938302d7b8b483963a3ae821f1c0808f872245cd"
|
||||
integrity sha512-Gy+IoFutbMQcky0k+bqqumXZ1cTGswLsFqmNLzNdSKkU9KGV2u9oXhukCbbJ9/LRPKiqwxEE8VpV/+YZlfkPUA==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.9.2"
|
||||
"@types/testing-library__jest-dom" "^5.9.1"
|
||||
aria-query "^5.0.0"
|
||||
chalk "^3.0.0"
|
||||
css "^3.0.0"
|
||||
css.escape "^1.5.1"
|
||||
dom-accessibility-api "^0.5.6"
|
||||
lodash "^4.17.15"
|
||||
redent "^3.0.0"
|
||||
|
||||
"@testing-library/react@12.1.5":
|
||||
version "12.1.5"
|
||||
resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-12.1.5.tgz#bb248f72f02a5ac9d949dea07279095fa577963b"
|
||||
integrity sha512-OfTXCJUFgjd/digLUuPxa0+/3ZxsQmE7ub9kcbW/wi96Bh3o/p5vrETcBGfP17NWPGqeYYl5LTRpwyGoMC4ysg==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.12.5"
|
||||
"@testing-library/dom" "^8.0.0"
|
||||
"@types/react-dom" "<18.0.0"
|
||||
|
||||
"@testing-library/react@^12.1.0":
|
||||
version "12.1.2"
|
||||
resolved "https://registry.npmjs.org/@testing-library/react/-/react-12.1.2.tgz"
|
||||
@ -3637,6 +3699,14 @@
|
||||
dependencies:
|
||||
"@types/istanbul-lib-report" "*"
|
||||
|
||||
"@types/jest@*":
|
||||
version "28.1.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-28.1.1.tgz#8c9ba63702a11f8c386ee211280e8b68cb093cd1"
|
||||
integrity sha512-C2p7yqleUKtCkVjlOur9BWVA4HgUQmEj/HWCt5WzZ5mLXrWnyIfl0wGuArc+kBXsy0ZZfLp+7dywB4HtSVYGVA==
|
||||
dependencies:
|
||||
jest-matcher-utils "^27.0.0"
|
||||
pretty-format "^27.0.0"
|
||||
|
||||
"@types/jest@^26.0.23":
|
||||
version "26.0.24"
|
||||
resolved "https://registry.npmjs.org/@types/jest/-/jest-26.0.24.tgz"
|
||||
@ -3743,6 +3813,13 @@
|
||||
dependencies:
|
||||
"@types/react" "*"
|
||||
|
||||
"@types/react-dom@<18.0.0":
|
||||
version "17.0.17"
|
||||
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.17.tgz#2e3743277a793a96a99f1bf87614598289da68a1"
|
||||
integrity sha512-VjnqEmqGnasQKV0CWLevqMTXBYG9GbwuE6x3VetERLh0cq2LTptFE73MrQi2S7GkKXCf2GgwItB/melLnxfnsg==
|
||||
dependencies:
|
||||
"@types/react" "^17"
|
||||
|
||||
"@types/react-dom@^17.0.0":
|
||||
version "17.0.10"
|
||||
resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-17.0.10.tgz"
|
||||
@ -3783,6 +3860,15 @@
|
||||
"@types/scheduler" "*"
|
||||
csstype "^3.0.2"
|
||||
|
||||
"@types/react@^17":
|
||||
version "17.0.45"
|
||||
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.45.tgz#9b3d5b661fd26365fefef0e766a1c6c30ccf7b3f"
|
||||
integrity sha512-YfhQ22Lah2e3CHPsb93tRwIGNiSwkuz1/blk4e6QrWS0jQzCSNbGLtOEYhPg02W0yGTTmpajp7dCTbBAMN3qsg==
|
||||
dependencies:
|
||||
"@types/prop-types" "*"
|
||||
"@types/scheduler" "*"
|
||||
csstype "^3.0.2"
|
||||
|
||||
"@types/resize-observer-browser@^0.1.6":
|
||||
version "0.1.6"
|
||||
resolved "https://registry.npmjs.org/@types/resize-observer-browser/-/resize-observer-browser-0.1.6.tgz"
|
||||
@ -3805,6 +3891,13 @@
|
||||
dependencies:
|
||||
"@types/estree" "*"
|
||||
|
||||
"@types/testing-library__jest-dom@^5.9.1":
|
||||
version "5.14.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.14.3.tgz#ee6c7ffe9f8595882ee7bda8af33ae7b8789ef17"
|
||||
integrity sha512-oKZe+Mf4ioWlMuzVBaXQ9WDnEm1+umLx0InILg+yvZVBBDmzV5KfZyLrCvadtWcx8+916jLmHafcmqqffl+iIw==
|
||||
dependencies:
|
||||
"@types/jest" "*"
|
||||
|
||||
"@types/unist@*", "@types/unist@^2.0.0":
|
||||
version "2.0.6"
|
||||
resolved "https://registry.npmjs.org/@types/unist/-/unist-2.0.6.tgz"
|
||||
@ -4296,6 +4389,11 @@ at-least-node@^1.0.0:
|
||||
resolved "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz"
|
||||
integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==
|
||||
|
||||
atob@^2.1.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
|
||||
integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
|
||||
|
||||
aws-sign2@~0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz"
|
||||
@ -4376,6 +4474,15 @@ babel-plugin-polyfill-corejs2@^0.2.3:
|
||||
"@babel/helper-define-polyfill-provider" "^0.2.4"
|
||||
semver "^6.1.1"
|
||||
|
||||
babel-plugin-polyfill-corejs2@^0.3.0:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz#440f1b70ccfaabc6b676d196239b138f8a2cfba5"
|
||||
integrity sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w==
|
||||
dependencies:
|
||||
"@babel/compat-data" "^7.13.11"
|
||||
"@babel/helper-define-polyfill-provider" "^0.3.1"
|
||||
semver "^6.1.1"
|
||||
|
||||
babel-plugin-polyfill-corejs3@^0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.3.0.tgz"
|
||||
@ -4384,6 +4491,14 @@ babel-plugin-polyfill-corejs3@^0.3.0:
|
||||
"@babel/helper-define-polyfill-provider" "^0.2.4"
|
||||
core-js-compat "^3.18.0"
|
||||
|
||||
babel-plugin-polyfill-corejs3@^0.5.0:
|
||||
version "0.5.2"
|
||||
resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz#aabe4b2fa04a6e038b688c5e55d44e78cd3a5f72"
|
||||
integrity sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ==
|
||||
dependencies:
|
||||
"@babel/helper-define-polyfill-provider" "^0.3.1"
|
||||
core-js-compat "^3.21.0"
|
||||
|
||||
babel-plugin-polyfill-regenerator@^0.2.3:
|
||||
version "0.2.3"
|
||||
resolved "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.3.tgz"
|
||||
@ -4391,6 +4506,13 @@ babel-plugin-polyfill-regenerator@^0.2.3:
|
||||
dependencies:
|
||||
"@babel/helper-define-polyfill-provider" "^0.2.4"
|
||||
|
||||
babel-plugin-polyfill-regenerator@^0.3.0:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz#2c0678ea47c75c8cc2fbb1852278d8fb68233990"
|
||||
integrity sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A==
|
||||
dependencies:
|
||||
"@babel/helper-define-polyfill-provider" "^0.3.1"
|
||||
|
||||
babel-preset-current-node-syntax@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz"
|
||||
@ -4488,6 +4610,17 @@ browserslist@^4.16.6, browserslist@^4.17.5:
|
||||
node-releases "^2.0.1"
|
||||
picocolors "^1.0.0"
|
||||
|
||||
browserslist@^4.20.3:
|
||||
version "4.20.4"
|
||||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.4.tgz#98096c9042af689ee1e0271333dbc564b8ce4477"
|
||||
integrity sha512-ok1d+1WpnU24XYN7oC3QWgTyMhY/avPJ/r9T00xxvUOIparA/gc+UPUMaod3i+G6s+nI2nUb9xZ5k794uIwShw==
|
||||
dependencies:
|
||||
caniuse-lite "^1.0.30001349"
|
||||
electron-to-chromium "^1.4.147"
|
||||
escalade "^3.1.1"
|
||||
node-releases "^2.0.5"
|
||||
picocolors "^1.0.0"
|
||||
|
||||
bser@2.1.1:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz"
|
||||
@ -4622,6 +4755,11 @@ caniuse-lite@^1.0.30001271:
|
||||
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001274.tgz"
|
||||
integrity sha512-+Nkvv0fHyhISkiMIjnyjmf5YJcQ1IQHZN6U9TLUMroWR38FNwpsC51Gb68yueafX1V6ifOisInSgP9WJFS13ew==
|
||||
|
||||
caniuse-lite@^1.0.30001349:
|
||||
version "1.0.30001352"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001352.tgz#cc6f5da3f983979ad1e2cdbae0505dccaa7c6a12"
|
||||
integrity sha512-GUgH8w6YergqPQDGWhJGt8GDRnY0L/iJVQcU3eJ46GYf52R8tk0Wxp0PymuFVZboJYXGiCqwozAYZNRjVj6IcA==
|
||||
|
||||
caseless@~0.12.0:
|
||||
version "0.12.0"
|
||||
resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz"
|
||||
@ -4644,6 +4782,14 @@ chalk@2.4.2, chalk@^2.0.0, chalk@^2.4.1, chalk@^2.4.2:
|
||||
escape-string-regexp "^1.0.5"
|
||||
supports-color "^5.3.0"
|
||||
|
||||
chalk@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4"
|
||||
integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==
|
||||
dependencies:
|
||||
ansi-styles "^4.1.0"
|
||||
supports-color "^7.1.0"
|
||||
|
||||
chalk@^4.0.0, chalk@^4.1.0:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz"
|
||||
@ -5095,6 +5241,14 @@ core-js-compat@^3.18.0, core-js-compat@^3.19.0:
|
||||
browserslist "^4.17.5"
|
||||
semver "7.0.0"
|
||||
|
||||
core-js-compat@^3.21.0:
|
||||
version "3.22.8"
|
||||
resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.22.8.tgz#46fa34ce1ddf742acd7f95f575f66bbb21e05d62"
|
||||
integrity sha512-pQnwg4xtuvc2Bs/5zYQPaEYYSuTxsF7LBWF0SvnVhthZo/Qe+rJpcEekrdNK5DWwDJ0gv0oI9NNX5Mppdy0ctg==
|
||||
dependencies:
|
||||
browserslist "^4.20.3"
|
||||
semver "7.0.0"
|
||||
|
||||
core-js@^2.4.0:
|
||||
version "2.6.12"
|
||||
resolved "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz"
|
||||
@ -5171,6 +5325,20 @@ css-box-model@1.2.1:
|
||||
dependencies:
|
||||
tiny-invariant "^1.0.6"
|
||||
|
||||
css.escape@^1.5.1:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.yarnpkg.com/css.escape/-/css.escape-1.5.1.tgz#42e27d4fa04ae32f931a4b4d4191fa9cddee97cb"
|
||||
integrity sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==
|
||||
|
||||
css@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/css/-/css-3.0.0.tgz#4447a4d58fdd03367c516ca9f64ae365cee4aa5d"
|
||||
integrity sha512-DG9pFfwOrzc+hawpmqX/dHYHJG+Bsdb0klhyi1sDneOgGOXy9wQIC8hzyVp1e4NRYDBdxcylvywPkkXCHAzTyQ==
|
||||
dependencies:
|
||||
inherits "^2.0.4"
|
||||
source-map "^0.6.1"
|
||||
source-map-resolve "^0.6.0"
|
||||
|
||||
cssom@^0.4.4:
|
||||
version "0.4.4"
|
||||
resolved "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz"
|
||||
@ -5421,6 +5589,11 @@ diff-sequences@^27.0.6:
|
||||
resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-27.0.6.tgz"
|
||||
integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ==
|
||||
|
||||
diff-sequences@^27.5.1:
|
||||
version "27.5.1"
|
||||
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327"
|
||||
integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ==
|
||||
|
||||
diff@^4.0.1:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
|
||||
@ -5452,6 +5625,11 @@ doctrine@^3.0.0:
|
||||
dependencies:
|
||||
esutils "^2.0.2"
|
||||
|
||||
dom-accessibility-api@^0.5.6:
|
||||
version "0.5.14"
|
||||
resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.14.tgz#56082f71b1dc7aac69d83c4285eef39c15d93f56"
|
||||
integrity sha512-NMt+m9zFMPZe0JcY9gN224Qvk6qLIdqex29clBvc/y75ZBX9YA9wNK3frsYvu2DI1xcCIwxwnX+TlsJ2DSOADg==
|
||||
|
||||
dom-accessibility-api@^0.5.9:
|
||||
version "0.5.10"
|
||||
resolved "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.10.tgz"
|
||||
@ -5514,6 +5692,11 @@ electron-to-chromium@^1.3.878:
|
||||
resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.885.tgz"
|
||||
integrity sha512-JXKFJcVWrdHa09n4CNZYfYaK6EW5aAew7/wr3L1OnsD1L+JHL+RCtd7QgIsxUbFPeTwPlvnpqNNTOLkoefmtXg==
|
||||
|
||||
electron-to-chromium@^1.4.147:
|
||||
version "1.4.151"
|
||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.151.tgz#d1c09dd3a06cb81ef03a3bbbff6905827c33ab4b"
|
||||
integrity sha512-XaG2LpZi9fdiWYOqJh0dJy4SlVywCvpgYXhzOlZTp4JqSKqxn5URqOjbm9OMYB3aInA2GuHQiem1QUOc1yT0Pw==
|
||||
|
||||
emittery@^0.8.1:
|
||||
version "0.8.1"
|
||||
resolved "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz"
|
||||
@ -7060,7 +7243,7 @@ inflight@^1.0.4:
|
||||
once "^1.3.0"
|
||||
wrappy "1"
|
||||
|
||||
inherits@2, inherits@^2.0.3, inherits@~2.0.3:
|
||||
inherits@2, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3:
|
||||
version "2.0.4"
|
||||
resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz"
|
||||
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
||||
@ -7594,6 +7777,16 @@ jest-diff@^27.3.1:
|
||||
jest-get-type "^27.3.1"
|
||||
pretty-format "^27.3.1"
|
||||
|
||||
jest-diff@^27.5.1:
|
||||
version "27.5.1"
|
||||
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-27.5.1.tgz#a07f5011ac9e6643cf8a95a462b7b1ecf6680def"
|
||||
integrity sha512-m0NvkX55LDt9T4mctTEgnZk3fmEg3NRYutvMPWM/0iPnkFj2wIeF45O1718cMSOFO1vINkqmxqD8vE37uTEbqw==
|
||||
dependencies:
|
||||
chalk "^4.0.0"
|
||||
diff-sequences "^27.5.1"
|
||||
jest-get-type "^27.5.1"
|
||||
pretty-format "^27.5.1"
|
||||
|
||||
jest-docblock@^27.0.6:
|
||||
version "27.0.6"
|
||||
resolved "https://registry.npmjs.org/jest-docblock/-/jest-docblock-27.0.6.tgz"
|
||||
@ -7647,6 +7840,11 @@ jest-get-type@^27.3.1:
|
||||
resolved "https://registry.npmjs.org/jest-get-type/-/jest-get-type-27.3.1.tgz"
|
||||
integrity sha512-+Ilqi8hgHSAdhlQ3s12CAVNd8H96ZkQBfYoXmArzZnOfAtVAJEiPDBirjByEblvG/4LPJmkL+nBqPO3A1YJAEg==
|
||||
|
||||
jest-get-type@^27.5.1:
|
||||
version "27.5.1"
|
||||
resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.1.tgz#3cd613c507b0f7ace013df407a1c1cd578bcb4f1"
|
||||
integrity sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw==
|
||||
|
||||
jest-haste-map@^27.3.1:
|
||||
version "27.3.1"
|
||||
resolved "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-27.3.1.tgz"
|
||||
@ -7699,6 +7897,16 @@ jest-leak-detector@^27.3.1:
|
||||
jest-get-type "^27.3.1"
|
||||
pretty-format "^27.3.1"
|
||||
|
||||
jest-matcher-utils@^27.0.0:
|
||||
version "27.5.1"
|
||||
resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-27.5.1.tgz#9c0cdbda8245bc22d2331729d1091308b40cf8ab"
|
||||
integrity sha512-z2uTx/T6LBaCoNWNFWwChLBKYxTMcGBRjAt+2SbP929/Fflb9aa5LGma654Rz8z9HLxsrUaYzxE9T/EFIL/PAw==
|
||||
dependencies:
|
||||
chalk "^4.0.0"
|
||||
jest-diff "^27.5.1"
|
||||
jest-get-type "^27.5.1"
|
||||
pretty-format "^27.5.1"
|
||||
|
||||
jest-matcher-utils@^27.3.1:
|
||||
version "27.3.1"
|
||||
resolved "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-27.3.1.tgz"
|
||||
@ -9047,6 +9255,11 @@ node-releases@^2.0.1:
|
||||
resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz"
|
||||
integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==
|
||||
|
||||
node-releases@^2.0.5:
|
||||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.5.tgz#280ed5bc3eba0d96ce44897d8aee478bfb3d9666"
|
||||
integrity sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q==
|
||||
|
||||
nopt@^4.0.1:
|
||||
version "4.0.3"
|
||||
resolved "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz"
|
||||
@ -9731,6 +9944,15 @@ pretty-format@^26.0.0, pretty-format@^26.6.2:
|
||||
ansi-styles "^4.0.0"
|
||||
react-is "^17.0.1"
|
||||
|
||||
pretty-format@^27.0.0, pretty-format@^27.5.1:
|
||||
version "27.5.1"
|
||||
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e"
|
||||
integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==
|
||||
dependencies:
|
||||
ansi-regex "^5.0.1"
|
||||
ansi-styles "^5.0.0"
|
||||
react-is "^17.0.1"
|
||||
|
||||
pretty-format@^27.0.2, pretty-format@^27.3.1:
|
||||
version "27.3.1"
|
||||
resolved "https://registry.npmjs.org/pretty-format/-/pretty-format-27.3.1.tgz"
|
||||
@ -10853,6 +11075,14 @@ source-map-js@^1.0.2:
|
||||
resolved "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz"
|
||||
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
|
||||
|
||||
source-map-resolve@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.6.0.tgz#3d9df87e236b53f16d01e58150fc7711138e5ed2"
|
||||
integrity sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==
|
||||
dependencies:
|
||||
atob "^2.1.2"
|
||||
decode-uri-component "^0.2.0"
|
||||
|
||||
source-map-support@^0.5.6:
|
||||
version "0.5.20"
|
||||
resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz"
|
||||
|
Loading…
Reference in New Issue
Block a user