Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove framer-motion #143

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/actions/doctor-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export async function doctorAction(options: DoctorActionOptions) {

/** ======================== Check if the allComponents required dependencies installed ======================== */
if (isAllComponents) {
// Check if framer-motion allComponents is installed
// Check if allComponents is installed
let [isCorrectInstalled, ...missingDependencies] = await checkRequiredContentInstalled(
'all',
allDependenciesKeys,
Expand Down
15 changes: 0 additions & 15 deletions src/constants/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"@heroui/theme": ">=2.4.0",
"@heroui/system": ">=2.4.0",
"tailwindcss": ">=3.4.0"
Expand Down Expand Up @@ -45,7 +44,6 @@
"peerDependencies": {
"@heroui/system": ">=2.4.0",
"@heroui/theme": ">=2.4.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"tailwindcss": ">=3.4.0"
Expand Down Expand Up @@ -110,7 +108,6 @@
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"@heroui/theme": ">=2.4.0",
"@heroui/system": ">=2.4.0",
"tailwindcss": ">=3.4.0"
Expand All @@ -127,7 +124,6 @@
"peerDependencies": {
"@heroui/system": ">=2.4.0",
"@heroui/theme": ">=2.4.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"tailwindcss": ">=3.4.0"
Expand All @@ -144,7 +140,6 @@
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"@heroui/theme": ">=2.4.0",
"@heroui/system": ">=2.4.0",
"tailwindcss": ">=3.4.0"
Expand Down Expand Up @@ -224,7 +219,6 @@
"peerDependencies": {
"@heroui/system": ">=2.4.0",
"@heroui/theme": ">=2.4.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"tailwindcss": ">=3.4.0"
Expand Down Expand Up @@ -272,7 +266,6 @@
"peerDependencies": {
"@heroui/system": ">=2.4.0",
"@heroui/theme": ">=2.4.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"tailwindcss": ">=3.4.0"
Expand Down Expand Up @@ -416,7 +409,6 @@
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"@heroui/theme": ">=2.4.0",
"@heroui/system": ">=2.4.0",
"tailwindcss": ">=3.4.0"
Expand All @@ -433,7 +425,6 @@
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"@heroui/theme": ">=2.4.0",
"@heroui/system": ">=2.4.0",
"tailwindcss": ">=3.4.0"
Expand Down Expand Up @@ -466,7 +457,6 @@
"peerDependencies": {
"@heroui/system": ">=2.4.0",
"@heroui/theme": ">=2.4.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"tailwindcss": ">=3.4.0"
Expand Down Expand Up @@ -515,7 +505,6 @@
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"@heroui/theme": ">=2.4.0",
"@heroui/system": ">=2.4.0",
"tailwindcss": ">=3.4.0"
Expand Down Expand Up @@ -548,7 +537,6 @@
"peerDependencies": {
"@heroui/system": ">=2.4.0",
"@heroui/theme": ">=2.4.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"tailwindcss": ">=3.4.0"
Expand Down Expand Up @@ -597,7 +585,6 @@
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"@heroui/theme": ">=2.4.0",
"@heroui/system": ">=2.4.0",
"tailwindcss": ">=3.4.0"
Expand Down Expand Up @@ -676,7 +663,6 @@
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"@heroui/theme": ">=2.4.0",
"@heroui/system": ">=2.4.0",
"tailwindcss": ">=3.4.0"
Expand All @@ -693,7 +679,6 @@
"peerDependencies": {
"react": ">=18 || >=19.0.0-rc.0",
"react-dom": ">=18 || >=19.0.0-rc.0",
"framer-motion": ">=11.5.6 || >=12.0.0-alpha.1",
"@heroui/theme": ">=2.4.0",
"@heroui/system": ">=2.4.0",
"tailwindcss": ">=3.4.0"
Expand Down
3 changes: 1 addition & 2 deletions src/constants/required.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ import {resolver} from './path';

export const HEROUI_CLI = 'heroui-cli';

export const FRAMER_MOTION = 'framer-motion';
export const TAILWINDCSS = 'tailwindcss';
export const HERO_UI = '@heroui/react';
export const THEME_UI = '@heroui/theme';
export const SYSTEM_UI = '@heroui/system';
export const ALL_COMPONENTS_REQUIRED = [HERO_UI, FRAMER_MOTION] as const;
export const ALL_COMPONENTS_REQUIRED = [HERO_UI] as const;

export const DOCS_INSTALLED = 'https://heroui.com/docs/guide/installation#global-installation';
export const DOCS_TAILWINDCSS_SETUP =
Expand Down
11 changes: 3 additions & 8 deletions src/helpers/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {type HeroUIComponents} from 'src/constants/component';
import {
DOCS_INSTALLED,
DOCS_TAILWINDCSS_SETUP,
FRAMER_MOTION,
HERO_UI,
SYSTEM_UI,
TAILWINDCSS,
Expand Down Expand Up @@ -111,7 +110,7 @@ interface CheckPeerDependenciesConfig {

/**
* Check if the required content is installed
* @example return result and missing required [false, '@heroui/react', 'framer-motion']
* @example return result and missing required [false, '@heroui/react']
* @param type
* @param dependenciesKeys
* @param checkPeerDependenciesConfig
Expand Down Expand Up @@ -141,25 +140,21 @@ export async function checkRequiredContentInstalled<

if (type === 'all') {
const hasAllComponents = dependenciesKeys.has(HERO_UI);
const hasFramerMotion = dependenciesKeys.has(FRAMER_MOTION);
const hasTailwind = dependenciesKeys.has(TAILWINDCSS);

if (hasAllComponents && hasFramerMotion && !peerDependenciesList.length) {
if (hasAllComponents && !peerDependenciesList.length) {
return [true];
}
!hasAllComponents && result.push(beta ? `${HERO_UI}@${store.betaVersion}` : HERO_UI);
!hasFramerMotion && result.push(FRAMER_MOTION);
!hasTailwind && result.push(TAILWINDCSS);
} else if (type === 'partial') {
const hasFramerMotion = dependenciesKeys.has(FRAMER_MOTION);
const hasTailwind = dependenciesKeys.has(TAILWINDCSS);
const hasSystemUI = dependenciesKeys.has(SYSTEM_UI);
const hasThemeUI = dependenciesKeys.has(THEME_UI);

if (hasFramerMotion && hasSystemUI && hasThemeUI && !peerDependenciesList.length) {
if (hasSystemUI && hasThemeUI && !peerDependenciesList.length) {
return [true];
}
!hasFramerMotion && result.push(FRAMER_MOTION);
const betaSystemUI = await getBetaVersionData(SYSTEM_UI);
const betaThemeUI = await getBetaVersionData(THEME_UI);

Expand Down