c596a5e342
## Description Promotes the next-gen UI library (formerly `twenty-new-ui`) to the name **`twenty-ui`** (v0.1.0, publishable) and renames the old package to **`twenty-ui-deprecated`**. Rewrites ~1,730 `twenty-ui` imports → `twenty-ui-deprecated`, updates all configs/CI/Docker/deps, and migrates twenty-front's `Toggle` to the new package (first consumer) as a drop-in. ## Next steps - Wire the `ui/v*` publish dispatch (`cd-deploy-tag.yaml` + `.yarnrc.yml`), then tag `ui/v0.1.0` to publish. - Continue migrating components from `twenty-ui-deprecated` → `twenty-ui`.
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
import { readFileSync } from 'fs';
|
|
import { dirname, resolve } from 'path';
|
|
import { pathsToModuleNameMapper } from 'ts-jest';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = dirname(__filename);
|
|
|
|
const tsConfigPath = resolve(__dirname, './tsconfig.json');
|
|
const tsConfig = JSON.parse(readFileSync(tsConfigPath, 'utf8'));
|
|
|
|
const jestConfig = {
|
|
displayName: 'twenty-ui',
|
|
preset: '../../jest.preset.js',
|
|
setupFilesAfterEnv: ['./setupTests.ts'],
|
|
testEnvironment: 'jsdom',
|
|
transformIgnorePatterns: ['../../node_modules/'],
|
|
transform: {
|
|
'^.+\\.[tj]sx?$': [
|
|
'@swc/jest',
|
|
{
|
|
jsc: {
|
|
parser: { syntax: 'typescript', tsx: true },
|
|
transform: { react: { runtime: 'automatic' } },
|
|
},
|
|
},
|
|
],
|
|
},
|
|
moduleNameMapper: {
|
|
'\\.(jpg|jpeg|png|gif|webp|svg|svg)$': '<rootDir>/__mocks__/imageMockUi.js',
|
|
'\\.(scss|css)$': '<rootDir>/__mocks__/styleMock.js',
|
|
...pathsToModuleNameMapper(tsConfig.compilerOptions.paths, {
|
|
prefix: '<rootDir>/',
|
|
}),
|
|
},
|
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
|
|
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
|
coverageDirectory: './coverage',
|
|
};
|
|
|
|
export default jestConfig;
|