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`.
79 lines
2.0 KiB
TypeScript
79 lines
2.0 KiB
TypeScript
import react from '@vitejs/plugin-react-swc';
|
|
import * as path from 'path';
|
|
import { defineConfig } from 'vite';
|
|
import svgr from 'vite-plugin-svgr';
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
|
|
import packageJson from './package.json';
|
|
|
|
const depNames = Object.keys(packageJson.dependencies || {});
|
|
|
|
const isExternal = (id: string): boolean =>
|
|
depNames.some((dep) => id === dep || id.startsWith(dep + '/'));
|
|
|
|
export default defineConfig(() => {
|
|
return {
|
|
resolve: {
|
|
alias: {
|
|
'@new-ui/': path.resolve(__dirname, 'src') + '/',
|
|
'@assets/': path.resolve(__dirname, 'src/assets') + '/',
|
|
'@styles/': path.resolve(__dirname, 'src/styles') + '/',
|
|
},
|
|
},
|
|
css: {
|
|
modules: {
|
|
localsConvention: 'camelCaseOnly',
|
|
},
|
|
preprocessorOptions: {
|
|
scss: {
|
|
api: 'modern-compiler',
|
|
loadPaths: [path.resolve(__dirname, 'src/styles')],
|
|
additionalData: [
|
|
`@use 'abstracts/functions' as *;`,
|
|
`@use 'abstracts/mixins' as *;`,
|
|
`@use 'abstracts/breakpoints' as *;`,
|
|
'',
|
|
].join('\n'),
|
|
},
|
|
},
|
|
},
|
|
root: __dirname,
|
|
cacheDir: '../../node_modules/.vite/packages/twenty-ui-individual',
|
|
assetsInclude: ['src/**/*.svg'],
|
|
plugins: [
|
|
react(),
|
|
tsconfigPaths({
|
|
root: __dirname,
|
|
projects: ['tsconfig.json'],
|
|
}),
|
|
svgr(),
|
|
],
|
|
build: {
|
|
cssCodeSplit: false,
|
|
minify: 'esbuild',
|
|
sourcemap: true,
|
|
outDir: './dist/individual',
|
|
emptyOutDir: true,
|
|
commonjsOptions: {
|
|
transformMixedEsModules: true,
|
|
interopDefault: true,
|
|
defaultIsModuleExports: true,
|
|
requireReturnsDefault: 'auto',
|
|
},
|
|
lib: {
|
|
entry: 'src/individual-entry.ts',
|
|
formats: ['es'],
|
|
},
|
|
rollupOptions: {
|
|
external: isExternal,
|
|
output: {
|
|
preserveModules: true,
|
|
preserveModulesRoot: 'src',
|
|
entryFileNames: '[name].js',
|
|
},
|
|
},
|
|
},
|
|
logLevel: 'warn',
|
|
};
|
|
});
|