Skip to content

Commit

Permalink
fix: fix rollup build (#975)
Browse files Browse the repository at this point in the history
  • Loading branch information
bae-unidev authored Dec 5, 2024
1 parent 65a4893 commit 917a491
Show file tree
Hide file tree
Showing 39 changed files with 451 additions and 1,419 deletions.
62 changes: 31 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,38 +45,38 @@ jobs:
with:
run: yarn nx collect-coverage testing --ci --coverage-reporter=lcov --output-path=coverage/lcov.info
- name: Typecheck Affected Project
run: yarn nx affected --target=typecheck --parallel=1
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
git-commit: ${{ steps.setSHAs.outputs.head }}
run: yarn nx affected --target=typecheck --parallel=1
# - name: Upload coverage to Coveralls
# uses: coverallsapp/github-action@v2
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# git-commit: ${{ steps.setSHAs.outputs.head }}

chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: yarn
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Publish to Chromatic
if: github.ref != 'refs/heads/main'
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_TOKEN }}
onlyChanged: true
env:
NODE_OPTIONS: --max-old-space-size=8192
- name: Publish to Chromatic and auto accept changes
if: github.ref == 'refs/heads/main'
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_TOKEN }}
autoAcceptChanges: true
env:
NODE_OPTIONS: --max-old-space-size=8192
# chromatic:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v1
# - run: yarn
# - name: Setup Node
# uses: actions/setup-node@v3
# with:
# node-version: 16
# - name: Publish to Chromatic
# if: github.ref != 'refs/heads/main'
# uses: chromaui/action@latest
# with:
# projectToken: ${{ secrets.CHROMATIC_TOKEN }}
# onlyChanged: true
# env:
# NODE_OPTIONS: --max-old-space-size=8192
# - name: Publish to Chromatic and auto accept changes
# if: github.ref == 'refs/heads/main'
# uses: chromaui/action@latest
# with:
# projectToken: ${{ secrets.CHROMATIC_TOKEN }}
# autoAcceptChanges: true
# env:
# NODE_OPTIONS: --max-old-space-size=8192

# expo:
# runs-on: ubuntu-latest
Expand Down
43 changes: 18 additions & 25 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"npmScope": "class101",
"affected": {
"defaultBase": "main"
},
"tasksRunnerOptions": {
"default": {
"runner": "nx-cloud",
"options": {
"cacheableOperations": [
"build",
"lint",
"test",
"e2e",
"build-native",
"typecheck"
],
"accessToken": "ZDlmMzIwMjgtZThjZS00MWExLThlZTgtMGEyMGQyMzUyMmFifHJlYWQ=",
"parallel": 3
}
}
},
"workspaceLayout": {
"appsDir": "packages",
"libsDir": "packages"
Expand Down Expand Up @@ -69,16 +48,30 @@
},
"targetDefaults": {
"build": {
"inputs": ["production", "^production"]
"inputs": ["production", "^production"],
"cache": true
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"],
"cache": true
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"],
"cache": true
},
"build-storybook": {
"inputs": ["default", "^production", "{workspaceRoot}/.storybook/**/*"]
},
"e2e": {
"cache": true
},
"build-native": {
"cache": true
},
"typecheck": {
"cache": true
}
}
},
"parallel": 3,
"defaultBase": "main"
}
14 changes: 5 additions & 9 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 @@ -115,12 +114,10 @@
"jsonc-eslint-parser": "^2.1.0",
"ngx-deploy-npm": "4.1.1",
"nx": "19.8.9",
"nx-cloud": "16.0.5",
"prettier": "2.7.1",
"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 +143,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 +162,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 +173,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
8 changes: 4 additions & 4 deletions packages/vibrant-benchmark-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/vibrant-benchmark-app/src",
"projectType": "application",
"tags": [],
"targets": {
"start": {
"executor": "@nx/react-native:start",
Expand All @@ -23,7 +24,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 +44,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 Expand Up @@ -73,6 +74,5 @@
"passWithNoTests": true
}
}
},
"tags": []
}
}
12 changes: 5 additions & 7 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 All @@ -46,7 +44,7 @@
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["coverage/packages/vibrant-components-web"],
"outputs": ["{workspaceRoot}/coverage/packages/vibrant-components-web"],
"options": {
"jestConfig": "packages/vibrant-components-web/jest.config.ts",
"passWithNoTests": true
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
Loading

0 comments on commit 917a491

Please sign in to comment.