mirror of
https://github.com/twentyhq/twenty.git
synced 2024-09-11 23:37:21 +03:00
chore: setup twenty-ui absolute path alias (#4732)
Split from https://github.com/twentyhq/twenty/pull/4518 - Setup `@ui/*` as an internal alias to reference `twenty-ui/src`. - Configures twenty-front to understand the `@ui/*` alias on development mode, so twenty-ui can be hot reloaded. - When building on production mode, twenty-front needs twenty-ui to be built beforehand (which is automatic with the `dependsOn` option). - Configures twenty-front to understand the `@ui/*` alias when launching tests, so there is no need to re-build twenty-ui for tests. --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
parent
41960f3593
commit
c5349291c8
@ -48,11 +48,16 @@ module.exports = {
|
|||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
groups: [
|
groups: [
|
||||||
|
// Packages
|
||||||
['^react', '^@?\\w'],
|
['^react', '^@?\\w'],
|
||||||
['^(@|~|src)(/.*|$)'],
|
// Internal modules
|
||||||
|
['^(@|~|src|@ui)(/.*|$)'],
|
||||||
|
// Side effect imports
|
||||||
['^\\u0000'],
|
['^\\u0000'],
|
||||||
|
// Relative imports
|
||||||
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
|
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
|
||||||
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
|
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
|
||||||
|
// CSS imports
|
||||||
['^.+\\.?(css)$'],
|
['^.+\\.?(css)$'],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
40
nx.json
40
nx.json
@ -19,6 +19,19 @@
|
|||||||
"cache": true,
|
"cache": true,
|
||||||
"dependsOn": ["^build"]
|
"dependsOn": ["^build"]
|
||||||
},
|
},
|
||||||
|
"storybook:build": {
|
||||||
|
"cache": true,
|
||||||
|
"inputs": [
|
||||||
|
"default",
|
||||||
|
"^default",
|
||||||
|
"{projectRoot}/.storybook/**/*",
|
||||||
|
"{projectRoot}/tsconfig.storybook.json"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"storybook:dev": {
|
||||||
|
"cache": true,
|
||||||
|
"dependsOn": ["^build"]
|
||||||
|
},
|
||||||
"@nx/jest:jest": {
|
"@nx/jest:jest": {
|
||||||
"cache": true,
|
"cache": true,
|
||||||
"inputs": ["default", "^default", "{workspaceRoot}/jest.preset.js"],
|
"inputs": ["default", "^default", "{workspaceRoot}/jest.preset.js"],
|
||||||
@ -48,15 +61,6 @@
|
|||||||
"cache": true,
|
"cache": true,
|
||||||
"dependsOn": ["^build"],
|
"dependsOn": ["^build"],
|
||||||
"inputs": ["default", "^default"]
|
"inputs": ["default", "^default"]
|
||||||
},
|
|
||||||
"storybook:build": {
|
|
||||||
"cache": true,
|
|
||||||
"inputs": [
|
|
||||||
"default",
|
|
||||||
"^default",
|
|
||||||
"{projectRoot}/.storybook/**/*",
|
|
||||||
"{projectRoot}/tsconfig.storybook.json"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"installation": {
|
"installation": {
|
||||||
@ -65,10 +69,24 @@
|
|||||||
"generators": {
|
"generators": {
|
||||||
"@nx/react": {
|
"@nx/react": {
|
||||||
"application": {
|
"application": {
|
||||||
"babel": true
|
"babel": true,
|
||||||
|
"style": "@emotion/styled",
|
||||||
|
"linter": "eslint",
|
||||||
|
"bundler": "vite",
|
||||||
|
"compiler": "swc",
|
||||||
|
"unitTestRunner": "jest",
|
||||||
|
"projectNameAndRootFormat": "derived"
|
||||||
},
|
},
|
||||||
"library": {
|
"library": {
|
||||||
"unitTestRunner": "none"
|
"style": "@emotion/styled",
|
||||||
|
"linter": "eslint",
|
||||||
|
"bundler": "vite",
|
||||||
|
"compiler": "swc",
|
||||||
|
"unitTestRunner": "jest",
|
||||||
|
"projectNameAndRootFormat": "derived"
|
||||||
|
},
|
||||||
|
"component": {
|
||||||
|
"style": "@emotion/styled"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -303,10 +303,10 @@
|
|||||||
"ts-loader": "^9.2.3",
|
"ts-loader": "^9.2.3",
|
||||||
"ts-node": "10.9.1",
|
"ts-node": "10.9.1",
|
||||||
"tsconfig-paths": "^4.2.0",
|
"tsconfig-paths": "^4.2.0",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "5.3.3",
|
||||||
"vite": "^5.0.0",
|
"vite": "^5.0.0",
|
||||||
"vite-plugin-checker": "^0.6.2",
|
"vite-plugin-checker": "^0.6.2",
|
||||||
"vite-plugin-dts": "~2.3.0",
|
"vite-plugin-dts": "3.8.1",
|
||||||
"vite-plugin-svgr": "^4.2.0",
|
"vite-plugin-svgr": "^4.2.0",
|
||||||
"vitest": "1.4.0"
|
"vitest": "1.4.0"
|
||||||
},
|
},
|
||||||
@ -320,7 +320,8 @@
|
|||||||
"packageManager": "yarn@4.0.2",
|
"packageManager": "yarn@4.0.2",
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"graphql": "16.8.0",
|
"graphql": "16.8.0",
|
||||||
"type-fest": "4.10.1"
|
"type-fest": "4.10.1",
|
||||||
|
"typescript": "5.3.3"
|
||||||
},
|
},
|
||||||
"version": "0.2.1",
|
"version": "0.2.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -17,13 +17,6 @@
|
|||||||
"require": "./dist/index.js"
|
"require": "./dist/index.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
|
||||||
"@nx/vite": "17.2.8",
|
|
||||||
"@vitejs/plugin-react-swc": "^3.5.0",
|
|
||||||
"vite": "^5.0.0",
|
|
||||||
"vite-plugin-dts": "~2.3.0",
|
|
||||||
"vite-tsconfig-paths": "^4.2.1"
|
|
||||||
},
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.1",
|
"node": "^18.17.1",
|
||||||
"npm": "please-use-yarn",
|
"npm": "please-use-yarn",
|
||||||
|
@ -13,8 +13,7 @@ export default defineConfig({
|
|||||||
tsconfigPaths(),
|
tsconfigPaths(),
|
||||||
dts({
|
dts({
|
||||||
entryRoot: 'src',
|
entryRoot: 'src',
|
||||||
tsConfigFilePath: path.join(__dirname, 'tsconfig.lib.json'),
|
tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
|
||||||
skipDiagnostics: true,
|
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ initialize({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const requestBody = await request.json();
|
const requestBody = await request.json();
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.warn(`Unhandled ${request.method} request to ${request.url}
|
console.warn(`Unhandled ${request.method} request to ${request.url}
|
||||||
with payload ${JSON.stringify(requestBody)}\n
|
with payload ${JSON.stringify(requestBody)}\n
|
||||||
This request should be mocked with MSW`);
|
This request should be mocked with MSW`);
|
||||||
|
@ -1,20 +1,30 @@
|
|||||||
export default {
|
/* eslint-disable @nx/enforce-module-boundaries,import/no-relative-packages */
|
||||||
|
import { JestConfigWithTsJest, pathsToModuleNameMapper } from 'ts-jest';
|
||||||
|
|
||||||
|
import { compilerOptions as twentyUiCompilerOptions } from '../twenty-ui/tsconfig.json';
|
||||||
|
|
||||||
|
import { compilerOptions } from './tsconfig.json';
|
||||||
|
|
||||||
|
const jestConfig: JestConfigWithTsJest = {
|
||||||
// to enable logs, comment out the following line
|
// to enable logs, comment out the following line
|
||||||
silent: true,
|
silent: true,
|
||||||
setupFilesAfterEnv: ['./src/setupTests.ts'],
|
displayName: 'twenty-front',
|
||||||
|
preset: '../../jest.preset.js',
|
||||||
|
setupFilesAfterEnv: ['./setupTests.ts'],
|
||||||
testEnvironment: 'jsdom',
|
testEnvironment: 'jsdom',
|
||||||
|
transformIgnorePatterns: ['../../node_modules/'],
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.(ts|js|tsx|jsx)$': '@swc/jest',
|
'^.+\\.(ts|js|tsx|jsx)$': '@swc/jest',
|
||||||
},
|
},
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
'~/(.+)': '<rootDir>/src/$1',
|
...pathsToModuleNameMapper(compilerOptions.paths),
|
||||||
'@/(.+)': '<rootDir>/src/modules/$1',
|
// Include internal library aliases, so there is no need to build the library before tests.
|
||||||
'twenty-ui': '<rootDir>/../twenty-ui/src/index.ts',
|
...pathsToModuleNameMapper(twentyUiCompilerOptions.paths),
|
||||||
'@testing/(.+)': '<rootDir>/src/testing/$1',
|
|
||||||
'\\.(jpg|jpeg|png|gif|webp|svg|svg\\?react)$':
|
'\\.(jpg|jpeg|png|gif|webp|svg|svg\\?react)$':
|
||||||
'<rootDir>/__mocks__/imageMock.js',
|
'<rootDir>/__mocks__/imageMock.js',
|
||||||
'\\.css$': '<rootDir>/__mocks__/styleMock.js',
|
'\\.css$': '<rootDir>/__mocks__/styleMock.js',
|
||||||
},
|
},
|
||||||
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
||||||
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
||||||
coverageThreshold: {
|
coverageThreshold: {
|
||||||
global: {
|
global: {
|
||||||
@ -41,5 +51,7 @@ export default {
|
|||||||
'__stories__/*',
|
'__stories__/*',
|
||||||
'display/icon/index.ts',
|
'display/icon/index.ts',
|
||||||
],
|
],
|
||||||
// coverageDirectory: '<rootDir>/coverage/',
|
coverageDirectory: './coverage',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default jestConfig;
|
||||||
|
@ -28,7 +28,7 @@ describe.skip('downloadFile', () => {
|
|||||||
const link = document.querySelector(
|
const link = document.querySelector(
|
||||||
'a[href="mock-url"][download="file.pdf"]',
|
'a[href="mock-url"][download="file.pdf"]',
|
||||||
);
|
);
|
||||||
console.log(document.body.innerHTML, link);
|
|
||||||
expect(link).not.toBeNull();
|
expect(link).not.toBeNull();
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { useSetRecoilState } from 'recoil';
|
import { useSetRecoilState } from 'recoil';
|
||||||
import { Button, ButtonGroup } from 'tsup.ui.index';
|
|
||||||
import { IconCheckbox, IconNotes, IconPaperclip } from 'twenty-ui';
|
import { IconCheckbox, IconNotes, IconPaperclip } from 'twenty-ui';
|
||||||
|
|
||||||
import { useOpenCreateActivityDrawer } from '@/activities/hooks/useOpenCreateActivityDrawer';
|
import { useOpenCreateActivityDrawer } from '@/activities/hooks/useOpenCreateActivityDrawer';
|
||||||
import { ActivityTargetableObject } from '@/activities/types/ActivityTargetableEntity';
|
import { ActivityTargetableObject } from '@/activities/types/ActivityTargetableEntity';
|
||||||
|
import { Button } from '@/ui/input/button/components/Button';
|
||||||
|
import { ButtonGroup } from '@/ui/input/button/components/ButtonGroup';
|
||||||
import { TAB_LIST_COMPONENT_ID } from '@/ui/layout/show-page/components/ShowPageRightContainer';
|
import { TAB_LIST_COMPONENT_ID } from '@/ui/layout/show-page/components/ShowPageRightContainer';
|
||||||
import { useTabList } from '@/ui/layout/tab/hooks/useTabList';
|
import { useTabList } from '@/ui/layout/tab/hooks/useTabList';
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ const meta: Meta<typeof CommandMenu> = {
|
|||||||
label: 'Create Task',
|
label: 'Create Task',
|
||||||
type: CommandType.Create,
|
type: CommandType.Create,
|
||||||
Icon: IconCheckbox,
|
Icon: IconCheckbox,
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
onCommandClick: () => console.log('create task click'),
|
onCommandClick: () => console.log('create task click'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -54,6 +55,7 @@ const meta: Meta<typeof CommandMenu> = {
|
|||||||
label: 'Create Note',
|
label: 'Create Note',
|
||||||
type: CommandType.Create,
|
type: CommandType.Create,
|
||||||
Icon: IconNotes,
|
Icon: IconNotes,
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
onCommandClick: () => console.log('create note click'),
|
onCommandClick: () => console.log('create note click'),
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { FallbackProps } from 'react-error-boundary';
|
import { FallbackProps } from 'react-error-boundary';
|
||||||
import { Button } from 'tsup.ui.index';
|
|
||||||
import { IconRefresh } from 'twenty-ui';
|
import { IconRefresh } from 'twenty-ui';
|
||||||
|
|
||||||
|
import { Button } from '@/ui/input/button/components/Button';
|
||||||
import AnimatedPlaceholder from '@/ui/layout/animated-placeholder/components/AnimatedPlaceholder';
|
import AnimatedPlaceholder from '@/ui/layout/animated-placeholder/components/AnimatedPlaceholder';
|
||||||
import {
|
import {
|
||||||
AnimatedPlaceholderEmptyContainer,
|
AnimatedPlaceholderEmptyContainer,
|
||||||
|
@ -146,6 +146,7 @@ describe('useFavorites', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const responderProvided: ResponderProvided = {
|
const responderProvided: ResponderProvided = {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
announce: (message: string) => console.log(message),
|
announce: (message: string) => console.log(message),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { MenuItem, MenuItemMultiSelect } from 'tsup.ui.index';
|
|
||||||
|
|
||||||
import { FieldMetadataItemOption } from '@/object-metadata/types/FieldMetadataItem';
|
import { FieldMetadataItemOption } from '@/object-metadata/types/FieldMetadataItem';
|
||||||
import { useFilterDropdown } from '@/object-record/object-filter-dropdown/hooks/useFilterDropdown';
|
import { useFilterDropdown } from '@/object-record/object-filter-dropdown/hooks/useFilterDropdown';
|
||||||
import { useOptionsForSelect } from '@/object-record/object-filter-dropdown/hooks/useOptionsForSelect';
|
import { useOptionsForSelect } from '@/object-record/object-filter-dropdown/hooks/useOptionsForSelect';
|
||||||
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
||||||
|
import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem';
|
||||||
|
import { MenuItemMultiSelect } from '@/ui/navigation/menu-item/components/MenuItemMultiSelect';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from '~/utils/isDefined';
|
||||||
|
|
||||||
export const EMPTY_FILTER_VALUE = '';
|
export const EMPTY_FILTER_VALUE = '';
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { MenuItem } from 'tsup.ui.index';
|
|
||||||
import { IconFilterOff } from 'twenty-ui';
|
import { IconFilterOff } from 'twenty-ui';
|
||||||
|
|
||||||
import { useFilterDropdown } from '@/object-record/object-filter-dropdown/hooks/useFilterDropdown';
|
import { useFilterDropdown } from '@/object-record/object-filter-dropdown/hooks/useFilterDropdown';
|
||||||
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
||||||
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
|
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
|
||||||
|
import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem';
|
||||||
|
|
||||||
export const ObjectFilterDropdownRecordRemoveFilterMenuItem = () => {
|
export const ObjectFilterDropdownRecordRemoveFilterMenuItem = () => {
|
||||||
const { emptyFilterButKeepDefinition } = useFilterDropdown();
|
const { emptyFilterButKeepDefinition } = useFilterDropdown();
|
||||||
|
@ -351,6 +351,7 @@ describe('useFilterDropdown', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should handle scopeId undefined on initial values', () => {
|
it('should handle scopeId undefined on initial values', () => {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.error = jest.fn();
|
console.error = jest.fn();
|
||||||
|
|
||||||
const renderFunction = () => {
|
const renderFunction = () => {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { useCallback, useContext, useRef } from 'react';
|
import { useCallback, useContext, useRef } from 'react';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { MenuItem } from 'tsup.ui.index';
|
|
||||||
|
|
||||||
import { RecordBoardColumnContext } from '@/object-record/record-board/record-board-column/contexts/RecordBoardColumnContext';
|
import { RecordBoardColumnContext } from '@/object-record/record-board/record-board-column/contexts/RecordBoardColumnContext';
|
||||||
import { DropdownMenu } from '@/ui/layout/dropdown/components/DropdownMenu';
|
import { DropdownMenu } from '@/ui/layout/dropdown/components/DropdownMenu';
|
||||||
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
||||||
|
import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem';
|
||||||
import { useListenClickOutside } from '@/ui/utilities/pointer-event/hooks/useListenClickOutside';
|
import { useListenClickOutside } from '@/ui/utilities/pointer-event/hooks/useListenClickOutside';
|
||||||
|
|
||||||
const StyledMenuContainer = styled.div`
|
const StyledMenuContainer = styled.div`
|
||||||
|
@ -2,7 +2,6 @@ import { useCallback, useContext } from 'react';
|
|||||||
import { css } from '@emotion/react';
|
import { css } from '@emotion/react';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
import { LightIconButton, MenuItem } from 'tsup.ui.index';
|
|
||||||
import {
|
import {
|
||||||
IconChevronDown,
|
IconChevronDown,
|
||||||
IconDotsVertical,
|
IconDotsVertical,
|
||||||
@ -32,10 +31,12 @@ import { useSetRecordInStore } from '@/object-record/record-store/hooks/useSetRe
|
|||||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||||
import { isFieldCellSupported } from '@/object-record/utils/isFieldCellSupported';
|
import { isFieldCellSupported } from '@/object-record/utils/isFieldCellSupported';
|
||||||
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
|
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
|
||||||
|
import { LightIconButton } from '@/ui/input/button/components/LightIconButton';
|
||||||
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
|
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
|
||||||
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
||||||
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
|
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
|
||||||
import { DropdownScope } from '@/ui/layout/dropdown/scopes/DropdownScope';
|
import { DropdownScope } from '@/ui/layout/dropdown/scopes/DropdownScope';
|
||||||
|
import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem';
|
||||||
import { AnimatedEaseInOut } from '@/ui/utilities/animation/components/AnimatedEaseInOut';
|
import { AnimatedEaseInOut } from '@/ui/utilities/animation/components/AnimatedEaseInOut';
|
||||||
|
|
||||||
const StyledListItem = styled(RecordDetailRecordsListItem)<{
|
const StyledListItem = styled(RecordDetailRecordsListItem)<{
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { LightIconButton } from 'tsup.ui.index';
|
|
||||||
import { IconChevronRight } from 'twenty-ui';
|
import { IconChevronRight } from 'twenty-ui';
|
||||||
|
|
||||||
import { ConnectedAccount } from '@/accounts/types/ConnectedAccount';
|
import { ConnectedAccount } from '@/accounts/types/ConnectedAccount';
|
||||||
@ -16,6 +15,7 @@ import {
|
|||||||
} from '@/settings/accounts/components/SettingsAccountsSynchronizationStatus';
|
} from '@/settings/accounts/components/SettingsAccountsSynchronizationStatus';
|
||||||
import { SettingsListCard } from '@/settings/components/SettingsListCard';
|
import { SettingsListCard } from '@/settings/components/SettingsListCard';
|
||||||
import { IconGmail } from '@/ui/display/icon/components/IconGmail';
|
import { IconGmail } from '@/ui/display/icon/components/IconGmail';
|
||||||
|
import { LightIconButton } from '@/ui/input/button/components/LightIconButton';
|
||||||
|
|
||||||
const StyledRowRightContainer = styled.div`
|
const StyledRowRightContainer = styled.div`
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -12,6 +12,7 @@ const meta: Meta<typeof DraggableList> = {
|
|||||||
component: DraggableList,
|
component: DraggableList,
|
||||||
decorators: [ComponentDecorator],
|
decorators: [ComponentDecorator],
|
||||||
parameters: {
|
parameters: {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
onDragEnd: () => console.log('dragged'),
|
onDragEnd: () => console.log('dragged'),
|
||||||
},
|
},
|
||||||
argTypes: {
|
argTypes: {
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { useTheme } from '@emotion/react';
|
import { useTheme } from '@emotion/react';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { MenuItem } from 'tsup.ui.index';
|
|
||||||
import { IconChevronDown } from 'twenty-ui';
|
import { IconChevronDown } from 'twenty-ui';
|
||||||
|
|
||||||
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
|
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
|
||||||
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
|
||||||
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
|
import { useDropdown } from '@/ui/layout/dropdown/hooks/useDropdown';
|
||||||
import { ActionBarEntry } from '@/ui/navigation/action-bar/types/ActionBarEntry';
|
import { ActionBarEntry } from '@/ui/navigation/action-bar/types/ActionBarEntry';
|
||||||
|
import { MenuItem } from '@/ui/navigation/menu-item/components/MenuItem';
|
||||||
import { MenuItemAccent } from '@/ui/navigation/menu-item/types/MenuItemAccent';
|
import { MenuItemAccent } from '@/ui/navigation/menu-item/types/MenuItemAccent';
|
||||||
|
|
||||||
type ActionBarItemProps = {
|
type ActionBarItemProps = {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { Tag } from 'tsup.ui.index';
|
|
||||||
|
|
||||||
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
|
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
|
||||||
|
import { Tag } from '@/ui/display/tag/components/Tag';
|
||||||
import { Checkbox } from '@/ui/input/components/Checkbox';
|
import { Checkbox } from '@/ui/input/components/Checkbox';
|
||||||
import { MenuItemLeftContent } from '@/ui/navigation/menu-item/internals/components/MenuItemLeftContent';
|
import { MenuItemLeftContent } from '@/ui/navigation/menu-item/internals/components/MenuItemLeftContent';
|
||||||
import { ThemeColor } from '@/ui/theme/constants/MainColorNames';
|
import { ThemeColor } from '@/ui/theme/constants/MainColorNames';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { useTheme } from '@emotion/react';
|
import { useTheme } from '@emotion/react';
|
||||||
import { Tag } from 'tsup.ui.index';
|
|
||||||
import { IconCheck } from 'twenty-ui';
|
import { IconCheck } from 'twenty-ui';
|
||||||
|
|
||||||
|
import { Tag } from '@/ui/display/tag/components/Tag';
|
||||||
import { ThemeColor } from '@/ui/theme/constants/MainColorNames';
|
import { ThemeColor } from '@/ui/theme/constants/MainColorNames';
|
||||||
|
|
||||||
import { StyledMenuItemLeftContent } from '../internals/components/StyledMenuItemBase';
|
import { StyledMenuItemLeftContent } from '../internals/components/StyledMenuItemBase';
|
||||||
|
@ -23,7 +23,9 @@ export const Default: Story = {
|
|||||||
LeftIcon: IconBell,
|
LeftIcon: IconBell,
|
||||||
accent: 'default',
|
accent: 'default',
|
||||||
iconButtons: [
|
iconButtons: [
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
{ Icon: IconBell, onClick: () => console.log('Clicked') },
|
{ Icon: IconBell, onClick: () => console.log('Clicked') },
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
{ Icon: IconBell, onClick: () => console.log('Clicked') },
|
{ Icon: IconBell, onClick: () => console.log('Clicked') },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -85,11 +87,13 @@ export const Catalog: CatalogStory<Story, typeof MenuItem> = {
|
|||||||
{
|
{
|
||||||
Icon: IconBell,
|
Icon: IconBell,
|
||||||
onClick: () =>
|
onClick: () =>
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log('Clicked on first icon button'),
|
console.log('Clicked on first icon button'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Icon: IconBell,
|
Icon: IconBell,
|
||||||
onClick: () =>
|
onClick: () =>
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log('Clicked on second icon button'),
|
console.log('Clicked on second icon button'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -24,7 +24,9 @@ export const Default: Story = {
|
|||||||
args: {
|
args: {
|
||||||
LeftIcon: IconBell,
|
LeftIcon: IconBell,
|
||||||
accent: 'default',
|
accent: 'default',
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
iconButtons: [{ Icon: IconMinus, onClick: () => console.log('Clicked') }],
|
iconButtons: [{ Icon: IconMinus, onClick: () => console.log('Clicked') }],
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
onClick: () => console.log('Clicked'),
|
onClick: () => console.log('Clicked'),
|
||||||
text: 'Menu item draggable',
|
text: 'Menu item draggable',
|
||||||
isDragDisabled: false,
|
isDragDisabled: false,
|
||||||
@ -86,6 +88,7 @@ export const Catalog: Story = {
|
|||||||
{
|
{
|
||||||
Icon: IconMinus,
|
Icon: IconMinus,
|
||||||
onClick: () =>
|
onClick: () =>
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log('Clicked on minus icon button'),
|
console.log('Clicked on minus icon button'),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -3,6 +3,7 @@ import { useTheme } from '@emotion/react';
|
|||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { isNonEmptyString } from '@sniptt/guards';
|
import { isNonEmptyString } from '@sniptt/guards';
|
||||||
import { useSetRecoilState } from 'recoil';
|
import { useSetRecoilState } from 'recoil';
|
||||||
|
import { Pill } from 'twenty-ui';
|
||||||
|
|
||||||
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
|
import { IconComponent } from '@/ui/display/icon/types/IconComponent';
|
||||||
import { isNavigationDrawerOpenState } from '@/ui/navigation/states/isNavigationDrawerOpenState';
|
import { isNavigationDrawerOpenState } from '@/ui/navigation/states/isNavigationDrawerOpenState';
|
||||||
@ -85,18 +86,6 @@ const StyledItemLabel = styled.div`
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledSoonPill = styled.div`
|
|
||||||
align-items: center;
|
|
||||||
background-color: ${({ theme }) => theme.background.transparent.light};
|
|
||||||
border-radius: 50px;
|
|
||||||
display: flex;
|
|
||||||
font-size: ${({ theme }) => theme.font.size.xs};
|
|
||||||
height: 16px;
|
|
||||||
justify-content: center;
|
|
||||||
padding-left: ${({ theme }) => theme.spacing(2)};
|
|
||||||
padding-right: ${({ theme }) => theme.spacing(2)};
|
|
||||||
`;
|
|
||||||
|
|
||||||
const StyledItemCount = styled.div`
|
const StyledItemCount = styled.div`
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: ${({ theme }) => theme.color.blue};
|
background-color: ${({ theme }) => theme.color.blue};
|
||||||
@ -168,7 +157,7 @@ export const NavigationDrawerItem = ({
|
|||||||
>
|
>
|
||||||
{Icon && <Icon size={theme.icon.size.md} stroke={theme.icon.stroke.md} />}
|
{Icon && <Icon size={theme.icon.size.md} stroke={theme.icon.stroke.md} />}
|
||||||
<StyledItemLabel>{label}</StyledItemLabel>
|
<StyledItemLabel>{label}</StyledItemLabel>
|
||||||
{soon && <StyledSoonPill>Soon</StyledSoonPill>}
|
{soon && <Pill label="Soon" />}
|
||||||
{!!count && <StyledItemCount>{count}</StyledItemCount>}
|
{!!count && <StyledItemCount>{count}</StyledItemCount>}
|
||||||
{keyboard && (
|
{keyboard && (
|
||||||
<StyledKeyBoardShortcut className="keyboard-shortcuts">
|
<StyledKeyBoardShortcut className="keyboard-shortcuts">
|
||||||
|
@ -52,6 +52,7 @@ describe('useAvailableScopeIdOrThrow', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should throw an error if no scopeId is provided and scopeId is undefined in the context', () => {
|
it('should throw an error if no scopeId is provided and scopeId is undefined in the context', () => {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.error = jest.fn();
|
console.error = jest.fn();
|
||||||
|
|
||||||
const renderFunction = () =>
|
const renderFunction = () =>
|
||||||
|
3
packages/twenty-front/src/nx-react.d.ts
vendored
Normal file
3
packages/twenty-front/src/nx-react.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/// <reference types="@nx/react/typings/cssmodule.d.ts" />
|
||||||
|
/// <reference types="@nx/react/typings/image.d.ts" />
|
||||||
|
/// <reference types="@nx/react/typings/styled-jsx.d.ts" />
|
@ -1,9 +1,9 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useNavigate, useSearchParams } from 'react-router-dom';
|
import { useNavigate, useSearchParams } from 'react-router-dom';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { MainButton } from 'tsup.ui.index';
|
|
||||||
|
|
||||||
import { AppPath } from '@/types/AppPath';
|
import { AppPath } from '@/types/AppPath';
|
||||||
|
import { MainButton } from '@/ui/input/button/components/MainButton';
|
||||||
import { useAuthorizeAppMutation } from '~/generated/graphql';
|
import { useAuthorizeAppMutation } from '~/generated/graphql';
|
||||||
import { isDefined } from '~/utils/isDefined';
|
import { isDefined } from '~/utils/isDefined';
|
||||||
|
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../dist/out-tsc"
|
"outDir": "../../dist/out-tsc",
|
||||||
|
"types": ["node"]
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
|
"**/__mocks__/**/*",
|
||||||
"**/*.spec.ts",
|
"**/*.spec.ts",
|
||||||
"**/*.test.ts",
|
|
||||||
"**/*.spec.tsx",
|
"**/*.spec.tsx",
|
||||||
"**/*.test.tsx",
|
"**/*.stories.ts",
|
||||||
"jest.config.ts",
|
"**/*.stories.tsx",
|
||||||
"tsup.config.ts",
|
"**/*.test.ts",
|
||||||
"tsup.ui.index.tsx"
|
"**/*.test.tsx"
|
||||||
],
|
],
|
||||||
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
|
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
|
||||||
}
|
}
|
||||||
|
@ -7,14 +7,6 @@
|
|||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
|
||||||
"@/*": ["src/modules/*"],
|
|
||||||
"~/*": ["src/*"],
|
|
||||||
"twenty-ui": ["../twenty-ui/src/index.ts"]
|
|
||||||
},
|
|
||||||
|
|
||||||
/* Bundler mode */
|
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"allowSyntheticDefaultImports": true,
|
"allowSyntheticDefaultImports": true,
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
@ -22,13 +14,16 @@
|
|||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
|
|
||||||
/* Linting */
|
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noUnusedLocals": false,
|
"noUnusedLocals": false,
|
||||||
"noUnusedParameters": false,
|
"noUnusedParameters": false,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"forceConsistentCasingInFileNames": true
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["packages/twenty-front/src/modules/*"],
|
||||||
|
"~/*": ["packages/twenty-front/src/*"],
|
||||||
|
"twenty-ui": ["packages/twenty-ui/src/index.ts"]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"files": [],
|
"files": [],
|
||||||
"include": [],
|
"include": [],
|
||||||
@ -39,5 +34,6 @@
|
|||||||
{
|
{
|
||||||
"path": "./tsconfig.spec.json"
|
"path": "./tsconfig.spec.json"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"extends": "../../tsconfig.base.json"
|
||||||
}
|
}
|
||||||
|
@ -5,13 +5,19 @@
|
|||||||
"types": ["jest", "node"]
|
"types": ["jest", "node"]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"vite.config.ts",
|
|
||||||
"jest.config.ts",
|
|
||||||
"**/*.test.ts",
|
|
||||||
"**/*.test.tsx",
|
|
||||||
"**/*.spec.ts",
|
|
||||||
"**/*.d.ts",
|
|
||||||
".storybook/**/*",
|
".storybook/**/*",
|
||||||
"**/*.stories.tsx"
|
"**/__mocks__/**/*",
|
||||||
|
"jest.config.ts",
|
||||||
|
"setupTests.ts",
|
||||||
|
"src/**/*.d.ts",
|
||||||
|
"src/**/*.spec.ts",
|
||||||
|
"src/**/*.spec.tsx",
|
||||||
|
"src/**/*.stories.ts",
|
||||||
|
"src/**/*.stories.tsx",
|
||||||
|
"src/**/*.test.ts",
|
||||||
|
"src/**/*.test.tsx",
|
||||||
|
"tsup.config.ts",
|
||||||
|
"tsup.ui.index.tsx",
|
||||||
|
"vite.config.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -31,24 +31,34 @@ export default defineConfig(({ command, mode }) => {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const plugins = [
|
|
||||||
react({ jsxImportSource: '@emotion/react' }),
|
|
||||||
tsconfigPaths(),
|
|
||||||
svgr(),
|
|
||||||
checker(checkers),
|
|
||||||
];
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
// base: ,
|
root: __dirname,
|
||||||
envPrefix: 'REACT_APP_',
|
cacheDir: '../../node_modules/.vite/packages/twenty-front',
|
||||||
|
|
||||||
|
server: {
|
||||||
|
port: 3001,
|
||||||
|
host: 'localhost',
|
||||||
|
},
|
||||||
|
|
||||||
|
plugins: [
|
||||||
|
react({ jsxImportSource: '@emotion/react' }),
|
||||||
|
tsconfigPaths({
|
||||||
|
projects: [
|
||||||
|
'tsconfig.json',
|
||||||
|
// Include internal library aliases in development mode, so hot reload is enabled for libraries.
|
||||||
|
mode === 'development' ? '../twenty-ui/tsconfig.json' : undefined,
|
||||||
|
].filter(Boolean) as string[],
|
||||||
|
}),
|
||||||
|
svgr(),
|
||||||
|
checker(checkers),
|
||||||
|
],
|
||||||
|
|
||||||
build: {
|
build: {
|
||||||
outDir: 'build',
|
outDir: 'build',
|
||||||
},
|
},
|
||||||
plugins,
|
|
||||||
server: {
|
envPrefix: 'REACT_APP_',
|
||||||
// open: true,
|
|
||||||
port: 3001,
|
|
||||||
},
|
|
||||||
define: {
|
define: {
|
||||||
'process.env': {
|
'process.env': {
|
||||||
REACT_APP_SERVER_BASE_URL,
|
REACT_APP_SERVER_BASE_URL,
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
"@types/lodash.upperfirst": "^4.3.7",
|
"@types/lodash.upperfirst": "^4.3.7",
|
||||||
"@types/react": "^18.2.39",
|
"@types/react": "^18.2.39",
|
||||||
"rimraf": "^5.0.5",
|
"rimraf": "^5.0.5",
|
||||||
"typescript": "^5.3.3"
|
"typescript": "5.3.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.17.1",
|
"node": "^18.17.1",
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import { JestConfigWithTsJest } from 'ts-jest';
|
export default {
|
||||||
|
|
||||||
const jestConfig: JestConfigWithTsJest = {
|
|
||||||
displayName: 'twenty-ui',
|
displayName: 'twenty-ui',
|
||||||
preset: '../../jest.preset.js',
|
preset: '../../jest.preset.js',
|
||||||
setupFilesAfterEnv: ['./setupTests.ts'],
|
setupFilesAfterEnv: ['./setupTests.ts'],
|
||||||
|
testEnvironment: 'jsdom',
|
||||||
transformIgnorePatterns: ['../../node_modules/'],
|
transformIgnorePatterns: ['../../node_modules/'],
|
||||||
transform: {
|
transform: {
|
||||||
'^.+\\.[tj]sx?$': [
|
'^.+\\.[tj]sx?$': [
|
||||||
@ -17,7 +16,7 @@ const jestConfig: JestConfigWithTsJest = {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
||||||
coverageDirectory: '../../coverage/packages/twenty-ui',
|
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
||||||
|
coverageDirectory: './coverage',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default jestConfig;
|
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "twenty-ui",
|
"name": "twenty-ui",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"main": "./index.js",
|
"type": "module",
|
||||||
"module": "./index.mjs",
|
"main": "./dist/index.js",
|
||||||
"typings": "./index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"import": "./dist/index.js",
|
||||||
|
"require": "./dist/index.cjs"
|
||||||
|
}
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"nx": "NX_DEFAULT_PROJECT=twenty-ui node ../../node_modules/nx/bin/nx.js",
|
"build": "vite build"
|
||||||
"start": "storybook dev -p 6006",
|
|
||||||
"build": "npx vite build"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.base.json",
|
"extends": "../../tsconfig.base.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "commonjs",
|
"jsx": "react-jsx",
|
||||||
"forceConsistentCasingInFileNames": true,
|
"allowJs": false,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noImplicitOverride": true,
|
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"noPropertyAccessFromIndexSignature": true,
|
"noEmit": true,
|
||||||
"noImplicitReturns": true,
|
"types": ["node"],
|
||||||
"noFallthroughCasesInSwitch": true,
|
"paths": {
|
||||||
"jsx": "react-jsx"
|
"@ui/*": ["packages/twenty-ui/src/*"]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"files": [],
|
"files": [],
|
||||||
"include": [],
|
"include": [],
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "../../dist/out-tsc",
|
"outDir": "../../dist/out-tsc"
|
||||||
"types": ["node"]
|
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"**/*.spec.ts",
|
"**/*.spec.ts",
|
||||||
|
@ -7,11 +7,10 @@
|
|||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"jest.config.ts",
|
"jest.config.ts",
|
||||||
|
"setupTests.ts",
|
||||||
"src/**/*.d.ts",
|
"src/**/*.d.ts",
|
||||||
"src/**/*.spec.ts",
|
"src/**/*.spec.ts",
|
||||||
"src/**/*.spec.tsx",
|
|
||||||
"src/**/*.test.ts",
|
"src/**/*.test.ts",
|
||||||
"src/**/*.test.tsx",
|
|
||||||
"vite.config.ts"
|
"vite.config.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin';
|
|||||||
import react from '@vitejs/plugin-react-swc';
|
import react from '@vitejs/plugin-react-swc';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
|
import checker from 'vite-plugin-checker';
|
||||||
import dts from 'vite-plugin-dts';
|
import dts from 'vite-plugin-dts';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
@ -14,16 +15,15 @@ export default defineConfig({
|
|||||||
nxViteTsPaths(),
|
nxViteTsPaths(),
|
||||||
dts({
|
dts({
|
||||||
entryRoot: 'src',
|
entryRoot: 'src',
|
||||||
tsConfigFilePath: path.join(__dirname, 'tsconfig.lib.json'),
|
tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
|
||||||
skipDiagnostics: true,
|
}),
|
||||||
|
checker({
|
||||||
|
typescript: {
|
||||||
|
tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|
||||||
// Uncomment this if you are using workers.
|
|
||||||
// worker: {
|
|
||||||
// plugins: [ nxViteTsPaths() ],
|
|
||||||
// },
|
|
||||||
|
|
||||||
// Configuration for building your library.
|
// Configuration for building your library.
|
||||||
// See: https://vitejs.dev/guide/build.html#library-mode
|
// See: https://vitejs.dev/guide/build.html#library-mode
|
||||||
build: {
|
build: {
|
||||||
|
Loading…
Reference in New Issue
Block a user