Skip to content

Commit

Permalink
fix: fix rollup build
Browse files Browse the repository at this point in the history
  • Loading branch information
bae-unidev committed Dec 5, 2024
1 parent 65a4893 commit b62e873
Show file tree
Hide file tree
Showing 35 changed files with 390 additions and 1,286 deletions.
13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"@react-native-community/cli": "10.2.2",
"@react-native-community/cli-platform-android": "10.2.0",
"@react-native-community/cli-platform-ios": "10.2.1",
"@rollup/plugin-alias": "3.1.9",
"@rollup/plugin-node-resolve": "13.3.0",
"@rollup/plugin-alias": "5.1.1",
"@rollup/plugin-node-resolve": "15.2.3",
"@storybook/addon-actions": "6.5.10",
"@storybook/addon-controls": "6.5.10",
"@storybook/addon-jest": "6.5.10",
Expand All @@ -79,9 +79,8 @@
"@testing-library/user-event": "14.2.1",
"@types/jest": "28.1.8",
"@types/node": "18.7.18",
"@types/react": "18.0.20",
"@types/react": "18.2.24",
"@types/react-dom": "18.0.6",
"@types/react-native": "0.70.4",
"@types/react-test-renderer": "18.0.0",
"@types/uuid": "8.3.4",
"@typescript-eslint/eslint-plugin": "5.59.6",
Expand Down Expand Up @@ -120,7 +119,6 @@
"react-native-config": "1.5.0",
"react-refresh": "^0.10.0",
"rollup-plugin-multi-input": "1.3.1",
"rollup-plugin-typescript2": "0.31.2",
"rollup-plugin-visualizer": "5.8.3",
"storybook": "6.5.10",
"style-loader": "^3.3.0",
Expand All @@ -146,7 +144,6 @@
"@expo/metro-config": "~0.18.11",
"@expo/webpack-config": "~19.0.1",
"@mdx-js/react": "1.6.22",
"@nrwl/rollup": "15.0.0",
"@nx/rollup": "19.8.9",
"@storybook/native-components": "2.2.8",
"@swc/helpers": "0.5.1",
Expand All @@ -166,7 +163,7 @@
"expo-updates": "~0.25.27",
"motion": "10.15.5",
"prism-react-renderer": "1.2.1",
"react": "18.2.0",
"react": "18.2.24",
"react-dom": "18.2.0",
"react-hook-form": "7.38.0",
"react-native": "0.74.5",
Expand All @@ -177,7 +174,7 @@
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-shadow-2": "6.0.6",
"react-native-svg": "15.2.0",
"react-native-svg": "15.10.0",
"react-native-svg-transformer": "1.0.0",
"react-native-tab-view": "3.3.4",
"react-native-uuid": "2.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/vibrant-benchmark-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"bundle-ios": {
"executor": "@nx/react-native:bundle",
"options": {
"entryFile": "src/main.tsx",
"main": "src/main.tsx",
"platform": "ios",
"bundleOutput": "dist/packages/vibrant-benchmark-app/ios/main.jsbundle"
}
Expand All @@ -43,7 +43,7 @@
"bundle-android": {
"executor": "@nx/react-native:bundle",
"options": {
"entryFile": "src/main.tsx",
"main": "src/main.tsx",
"platform": "android",
"bundleOutput": "dist/packages/vibrant-benchmark-app/android/main.jsbundle"
}
Expand Down
10 changes: 4 additions & 6 deletions packages/vibrant-components-web/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@
"tags": ["scope:vibrant"],
"targets": {
"build": {
"executor": "@nrwl/rollup:rollup",
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/packages/vibrant-components-web",
"tsConfig": "packages/vibrant-components-web/tsconfig.lib.json",
"project": "packages/vibrant-components-web/package.json",
"entryFile": "packages/vibrant-components-web/src/index.ts",
"main": "packages/vibrant-components-web/src/index.ts",
"skipTypeCheck": true,
"external": ["react/jsx-runtime"],
"format": ["esm", "cjs"],
"buildableProjectDepsInPackageJsonType": "dependencies",
"rollupConfig": "tools/config/rollup-config",
"compiler": "babel",
"assets": [
{
"glob": "packages/vibrant-components-web/README.md",
Expand All @@ -31,7 +29,7 @@
"executor": "nx:run-commands",
"options": {
"commands": [
"yarn tsc --project ./packages/vibrant-components-web/tsconfig.lib.json"
"yarn tsc --project ./packages/vibrant-components-web/tsconfig.json"
]
}
},
Expand Down
3 changes: 2 additions & 1 deletion packages/vibrant-components-web/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"]
"types": ["node"],
"paths": {}
},
"files": [
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
Expand Down
11 changes: 10 additions & 1 deletion packages/vibrant-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@
"sideEffects": false,
"peerDependencies": {
"@types/react": "^17.0.0 || ^18.0.0",
"react": "^17.0.0 || ^18.0.0"
"react": "^17.0.0 || ^18.0.0",
"react-native": "^0.71.0",
"react-native-screens": "3.22.1",
"react-native-reanimated": "^3.15.4",
"react-native-gesture-handler": "^2.20.0",
"@vibrant-ui/core": "*",
"@vibrant-ui/theme": "*",
"@vibrant-ui/motion": "*",
"@vibrant-ui/icons": "*",
"@vibrant-ui/utils": "*"
},
"dependencies": {
"uuid": "^8.3.2",
Expand Down
26 changes: 22 additions & 4 deletions packages/vibrant-components/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,25 @@
"tags": ["scope:vibrant"],
"targets": {
"build": {
"executor": "@nrwl/rollup:rollup",
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"dependsOn": [
{
"target": "build",
"dependencies": true
},
"build-native"
],
"options": {
"outputPath": "dist/packages/vibrant-components",
"tsConfig": "packages/vibrant-components/tsconfig.lib.json",
"project": "packages/vibrant-components/package.json",
"entryFile": "packages/vibrant-components/src/index.ts",
"external": ["react/jsx-runtime"],
"generateExportsField": true,
"skipTypeCheck": true,
"deleteOutputPath": false,
"format": ["esm", "cjs"],
"buildableProjectDepsInPackageJsonType": "dependencies",
"rollupConfig": "tools/config/rollup-config",
"compiler": "babel",
"assets": [
{
Expand All @@ -28,11 +35,22 @@
]
}
},
"build-native": {
"executor": "@nx/rollup:rollup",
"options": {
"outputPath": "dist/packages/vibrant-components",
"outputFileName": "index.native.js",
"tsConfig": "packages/vibrant-components/tsconfig.native.json",
"main": "packages/vibrant-components/src/index.ts",
"skipTypeCheck": true,
"format": ["cjs"]
}
},
"typecheck": {
"executor": "nx:run-commands",
"options": {
"commands": [
"yarn tsc --project ./packages/vibrant-components/tsconfig.lib.json"
"yarn tsc --project ./packages/vibrant-components/tsconfig.json"
]
}
},
Expand Down
3 changes: 1 addition & 2 deletions packages/vibrant-components/src/lib/Dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable max-lines */
import type { Align, Side } from 'packages/vibrant-utils/src/types';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import {
Box,
Expand All @@ -24,7 +23,7 @@ import {
useBackHandler,
useControllableState,
} from '@vibrant-ui/utils';
import type { LayoutEvent, Position, Rect } from '@vibrant-ui/utils';
import type { Align, LayoutEvent, Position, Rect, Side } from '@vibrant-ui/utils';
import { Backdrop } from '../Backdrop';
import { withDropdownVariation } from './DropdownProps';

Expand Down
3 changes: 2 additions & 1 deletion packages/vibrant-components/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"]
"types": ["node"],
"paths": {}
},
"files": [
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
Expand Down
8 changes: 8 additions & 0 deletions packages/vibrant-components/tsconfig.native.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"moduleSuffixes": [".native", ""],
"types": ["node"],
},
}
4 changes: 3 additions & 1 deletion packages/vibrant-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"react-native-screens": "3.22.1",
"react-native-reanimated": "^3.15.4",
"react-native-gesture-handler": "^2.20.0",
"@emotion/native": "^11.5.0"
"@emotion/native": "^11.5.0",
"@vibrant-ui/theme": "*",
"@vibrant-ui/utils": "*"
},
"dependencies": {
"@emotion/react": "^11.5.0",
Expand Down
31 changes: 11 additions & 20 deletions packages/vibrant-core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"tags": ["scope:vibrant"],
"targets": {
"build": {
"executor": "@nrwl/rollup:rollup",
"executor": "@nx/rollup:rollup",
"outputs": ["{options.outputPath}"],
"dependsOn": [
{
Expand All @@ -19,46 +19,37 @@
"outputPath": "dist/packages/vibrant-core",
"tsConfig": "packages/vibrant-core/tsconfig.lib.json",
"project": "packages/vibrant-core/package.json",
"main": "packages/vibrant-core/src/index.ts",
"deleteOutputPath": false,
"entryFile": "packages/vibrant-core/src/index.ts",
"generateExportsField": true,
"external": ["react/jsx-runtime"],
"format": ["esm", "cjs"],
"buildableProjectDepsInPackageJsonType": "dependencies",
"rollupConfig": "tools/config/rollup-config",
"compiler": "babel",
"assets": [
{
"glob": "packages/vibrant-core/README.md",
"input": ".",
"output": "."
}
],
"disablePreserveModules": true
]
}
},
"build-native": {
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"executor": "@nx/rollup:rollup",
"options": {
"outputPath": "dist/packages/vibrant-core",
"tsConfig": "packages/vibrant-core/tsconfig.lib.json",
"moduleSuffixes": [".native", ""],
"project": "packages/vibrant-core/package.json",
"outputFileName": "index.native",
"entryFile": "packages/vibrant-core/src/index.ts",
"external": ["react/jsx-runtime"],
"format": ["cjs"],
"rollupConfig": "tools/config/rollup-config",
"buildableProjectDepsInPackageJsonType": "dependencies",
"compiler": "babel",
"disablePreserveModules": true
"outputFileName": "index.native.js",
"tsConfig": "packages/vibrant-core/tsconfig.native.json",
"main": "packages/vibrant-core/src/index.ts",
"skipTypeCheck": true,
"format": ["cjs"]
}
},
"typecheck": {
"executor": "nx:run-commands",
"options": {
"commands": [
"yarn tsc --project ./packages/vibrant-core/tsconfig.lib.json"
"yarn tsc --project ./packages/vibrant-core/tsconfig.json"
]
}
},
Expand Down
4 changes: 3 additions & 1 deletion packages/vibrant-core/src/lib/Portal/Portal.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { ReactElement } from 'react';
import ReactDOM from 'react-dom';
import { usePortalRoot } from '../PortalRoot';
import { withPortalVariation } from './PortalProps';
Expand All @@ -14,5 +15,6 @@ export const Portal = withPortalVariation(({ innerRef, scrollable, children, sty
{children}
</div>,
container as Element
);
// fixme: change ReactElement<any, any> | null to ReactPortal
) as ReactElement<any, any> | null;
});
1 change: 0 additions & 1 deletion packages/vibrant-core/src/lib/Portal/PortalProps.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Ref } from 'react';

import type { ReactElementChildren } from '@vibrant-ui/core';
import { withVariation } from '../withVariation';

Expand Down
2 changes: 1 addition & 1 deletion packages/vibrant-core/src/lib/props/border/type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Rounded } from 'packages/vibrant-theme/src/types/BorderRadius';
import type { Rounded } from '@vibrant-ui/theme';
import type { ResponsiveValue } from '../../../types';

type BorderStyle = 'dashed' | 'none' | 'solid';
Expand Down
5 changes: 4 additions & 1 deletion packages/vibrant-core/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"]
"types": ["node"],
"paths": {
"@vibrant-ui/core": ["packages/vibrant-core/src/index.ts"]
}
},
"files": [
"../../node_modules/@nx/react/typings/cssmodule.d.ts",
Expand Down
8 changes: 8 additions & 0 deletions packages/vibrant-core/tsconfig.native.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"moduleSuffixes": [".native", ""],
"types": ["node"],
},
}
Loading

0 comments on commit b62e873

Please sign in to comment.