From 0645529a61396766916c86fcb965c1d336c1a6d2 Mon Sep 17 00:00:00 2001 From: Laura Lee Date: Wed, 8 Nov 2023 18:20:58 +0800 Subject: [PATCH 1/2] chore(gitignore): ignore examples lib and types --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index c06f4f5c..b861eae8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ packages/*/lib packages/*/types plugins/*/lib plugins/*/types +examples/*/lib +examples/*/types .next .env .env.local From 01b23ae7f1c864650776b68f0e7c210c20b4c929 Mon Sep 17 00:00:00 2001 From: Laura Lee Date: Wed, 8 Nov 2023 18:25:11 +0800 Subject: [PATCH 2/2] chore(examples): [plugins/custom-antd] add --- .../plugins/custom-antd/CHANGELOG.md | 1 + .../plugins/custom-antd/package.json | 55 +++++++++++++++++++ .../custom-antd/src/components/Input.tsx | 8 +++ .../custom-antd/src/components/index.ts | 0 .../plugins/custom-antd/src/index.ts | 1 + .../plugins/custom-antd/tsconfig.json | 10 ++++ 6 files changed, 75 insertions(+) create mode 100644 examples/next-starter/plugins/custom-antd/CHANGELOG.md create mode 100644 examples/next-starter/plugins/custom-antd/package.json create mode 100644 examples/next-starter/plugins/custom-antd/src/components/Input.tsx create mode 100644 examples/next-starter/plugins/custom-antd/src/components/index.ts create mode 100644 examples/next-starter/plugins/custom-antd/src/index.ts create mode 100644 examples/next-starter/plugins/custom-antd/tsconfig.json diff --git a/examples/next-starter/plugins/custom-antd/CHANGELOG.md b/examples/next-starter/plugins/custom-antd/CHANGELOG.md new file mode 100644 index 00000000..420e6f23 --- /dev/null +++ b/examples/next-starter/plugins/custom-antd/CHANGELOG.md @@ -0,0 +1 @@ +# Change Log diff --git a/examples/next-starter/plugins/custom-antd/package.json b/examples/next-starter/plugins/custom-antd/package.json new file mode 100644 index 00000000..ecfc4288 --- /dev/null +++ b/examples/next-starter/plugins/custom-antd/package.json @@ -0,0 +1,55 @@ +{ + "name": "@onr/plugin-custom-antd", + "private": true, + "version": "0.10.9", + "description": "add global config to antd plugin", + "license": "ISC", + "main": "lib/index.js", + "source": "src/index.ts", + "types": "types/index.d.ts", + "directories": { + "lib": "lib", + "test": "__tests__" + }, + "files": [ + "lib", + "types", + "src" + ], + "scripts": { + "dev": "tsc --watch --preserveWatchOutput", + "lint": "prettier -c 'src/**/*'; eslint src --ext .ts,.tsx", + "format": "prettier --write 'src/**/*'; eslint src --fix --ext .ts,.tsx", + "build": "tsc --build tsconfig.json", + "test": "jest --coverage --passWithNoTests", + "test:watch": "yarn test --watch", + "prepublishOnly": "yarn build" + }, + "bugs": { + "url": "https://github.com/OnrampLab/onr-react-ui/issues" + }, + "dependencies": { + "antd": "^5.10.0", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "peerDependencies": { + "next": "^13.4.2", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@babel/preset-typescript": "^7.22.5", + "@onr/eslint-config": "^0.6.2", + "@onr/prettier-config": "^1.4.2", + "@types/node": "^14.14.21", + "@types/react": "^17.0.0", + "@types/react-dom": "^17.0.0", + "eslint": "^8.40.0", + "typescript": "^5.1.3" + }, + "prettier": "@onr/prettier-config", + "publishConfig": { + "access": "public" + } +} diff --git a/examples/next-starter/plugins/custom-antd/src/components/Input.tsx b/examples/next-starter/plugins/custom-antd/src/components/Input.tsx new file mode 100644 index 00000000..560687f0 --- /dev/null +++ b/examples/next-starter/plugins/custom-antd/src/components/Input.tsx @@ -0,0 +1,8 @@ +import { Input as AntdInput, InputProps } from 'antd'; +import React from 'react'; + +interface Props extends InputProps {} + +export const Input: React.FC = props => { + return {props.children}; +}; diff --git a/examples/next-starter/plugins/custom-antd/src/components/index.ts b/examples/next-starter/plugins/custom-antd/src/components/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/examples/next-starter/plugins/custom-antd/src/index.ts b/examples/next-starter/plugins/custom-antd/src/index.ts new file mode 100644 index 00000000..07635cbb --- /dev/null +++ b/examples/next-starter/plugins/custom-antd/src/index.ts @@ -0,0 +1 @@ +export * from './components'; diff --git a/examples/next-starter/plugins/custom-antd/tsconfig.json b/examples/next-starter/plugins/custom-antd/tsconfig.json new file mode 100644 index 00000000..aadb2fd2 --- /dev/null +++ b/examples/next-starter/plugins/custom-antd/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.components.json", + "compilerOptions": { + "outDir": "lib", + "declarationDir": "./types", + "sourceMap": true + }, + "include": ["src/**/*"], + "exclude": ["**/*.spec.tsx?"] +}